xref: /freebsd/sys/dev/bnxt/hsi_struct_def.h (revision d36b3662)
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright (c) 2016 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-2023, 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 /* This is the HWRM command header. */
49 /* hwrm_cmd_hdr (size:128b/16B) */
50 
51 typedef struct hwrm_cmd_hdr {
52 	/* The HWRM command request type. */
53 	uint16_t	req_type;
54 	/*
55 	 * The completion ring to send the completion event on. This should
56 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57 	 */
58 	uint16_t	cmpl_ring;
59 	/*
60 	 * The sequence ID is used by the driver for tracking multiple
61 	 * commands. This ID is treated as opaque data by the firmware and
62 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63 	 */
64 	uint16_t	seq_id;
65 	/*
66 	 * The target ID of the command:
67 	 * * 0x0-0xFFF8 - The function ID
68 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69 	 * * 0xFFFD - Reserved for user-space HWRM interface
70 	 * * 0xFFFF - HWRM
71 	 */
72 	uint16_t	target_id;
73 	/*
74 	 * A physical address pointer pointing to a host buffer that the
75 	 * command's response data will be written. This can be either a host
76 	 * physical address (HPA) or a guest physical address (GPA) and must
77 	 * point to a physically contiguous block of memory.
78 	 */
79 	uint64_t	resp_addr;
80 } hwrm_cmd_hdr_t, *phwrm_cmd_hdr_t;
81 
82 /* This is the HWRM response header. */
83 /* hwrm_resp_hdr (size:64b/8B) */
84 
85 typedef struct hwrm_resp_hdr {
86 	/* The specific error status for the command. */
87 	uint16_t	error_code;
88 	/* The HWRM command request type. */
89 	uint16_t	req_type;
90 	/* The sequence ID from the original command. */
91 	uint16_t	seq_id;
92 	/* The length of the response data in number of bytes. */
93 	uint16_t	resp_len;
94 } hwrm_resp_hdr_t, *phwrm_resp_hdr_t;
95 
96 /*
97  * TLV encapsulated message. Use the TLV type field of the
98  * TLV to determine the type of message encapsulated.
99  */
100 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
101 #define CMD_DISCR_LAST	CMD_DISCR_TLV_ENCAP
102 
103 
104 /* HWRM request message */
105 #define TLV_TYPE_HWRM_REQUEST			UINT32_C(0x1)
106 /* HWRM response message */
107 #define TLV_TYPE_HWRM_RESPONSE		UINT32_C(0x2)
108 /* RoCE slow path command */
109 #define TLV_TYPE_ROCE_SP_COMMAND		UINT32_C(0x3)
110 /* RoCE slow path command to query CC Gen1 support. */
111 #define TLV_TYPE_QUERY_ROCE_CC_GEN1		UINT32_C(0x4)
112 /* RoCE slow path command to modify CC Gen1 support. */
113 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1		UINT32_C(0x5)
114 /* Engine CKV - The Alias key EC curve and ECC public key information. */
115 #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001)
116 /* Engine CKV - Initialization vector. */
117 #define TLV_TYPE_ENGINE_CKV_IV		UINT32_C(0x8003)
118 /* Engine CKV - Authentication tag. */
119 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG		UINT32_C(0x8004)
120 /* Engine CKV - The encrypted data. */
121 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT	UINT32_C(0x8005)
122 /* Engine CKV - Supported host_algorithms. */
123 #define TLV_TYPE_ENGINE_CKV_HOST_ALGORITHMS	UINT32_C(0x8006)
124 /* Engine CKV - The Host EC curve name and ECC public key information. */
125 #define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY  UINT32_C(0x8007)
126 /* Engine CKV - The ECDSA signature. */
127 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE	UINT32_C(0x8008)
128 /* Engine CKV - The firmware EC curve name and ECC public key information. */
129 #define TLV_TYPE_ENGINE_CKV_FW_ECC_PUBLIC_KEY	UINT32_C(0x8009)
130 /* Engine CKV - Supported firmware algorithms. */
131 #define TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS	UINT32_C(0x800a)
132 #define TLV_TYPE_LAST			TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS
133 
134 
135 /* tlv (size:64b/8B) */
136 
137 typedef struct tlv {
138 	/*
139 	 * The command discriminator is used to differentiate between various
140 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
141 	 * command messages as well as newer TLV encapsulated HWRM commands.
142 	 *
143 	 * For TLV encapsulated messages this field must be 0x8000.
144 	 */
145 	uint16_t	cmd_discr;
146 	uint8_t	reserved_8b;
147 	uint8_t	flags;
148 	/*
149 	 * Indicates the presence of additional TLV encapsulated data
150 	 * follows this TLV.
151 	 */
152 	#define TLV_FLAGS_MORE	UINT32_C(0x1)
153 	/* Last TLV in a sequence of TLVs. */
154 		#define TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
155 	/* More TLVs follow this TLV. */
156 		#define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
157 	/*
158 	 * When an HWRM receiver detects a TLV type that it does not
159 	 * support with the TLV required flag set, the receiver must
160 	 * reject the HWRM message with an error code indicating an
161 	 * unsupported TLV type.
162 	 */
163 	#define TLV_FLAGS_REQUIRED	UINT32_C(0x2)
164 	/* No */
165 		#define TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
166 	/* Yes */
167 		#define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
168 		#define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
169 	/*
170 	 * This field defines the TLV type value which is divided into
171 	 * two ranges to differentiate between global and local TLV types.
172 	 * Global TLV types must be unique across all defined TLV types.
173 	 * Local TLV types are valid only for extensions to a given
174 	 * HWRM message and may be repeated across different HWRM message
175 	 * types. There is a direct correlation of each HWRM message type
176 	 * to a single global TLV type value.
177 	 *
178 	 * Global TLV range: `0 - (63k-1)`
179 	 *
180 	 * Local TLV range: `63k - (64k-1)`
181 	 */
182 	uint16_t	tlv_type;
183 	/*
184 	 * Length of the message data encapsulated by this TLV in bytes.
185 	 * This length does not include the size of the TLV header itself
186 	 * and it must be an integer multiple of 8B.
187 	 */
188 	uint16_t	length;
189 } tlv_t, *ptlv_t;
190 
191 /* Input */
192 /* input (size:128b/16B) */
193 
194 typedef struct input {
195 	/*
196 	 * This value indicates what type of request this is.  The format
197 	 * for the rest of the command is determined by this field.
198 	 */
199 	uint16_t	req_type;
200 	/*
201 	 * This value indicates the what completion ring the request will
202 	 * be optionally completed on.  If the value is -1, then no
203 	 * CR completion will be generated.  Any other value must be a
204 	 * valid CR ring_id value for this function.
205 	 */
206 	uint16_t	cmpl_ring;
207 	/* This value indicates the command sequence number. */
208 	uint16_t	seq_id;
209 	/*
210 	 * Target ID of this command.
211 	 *
212 	 * 0x0 - 0xFFF8 - Used for function ids
213 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
214 	 * 0xFFFF - HWRM
215 	 */
216 	uint16_t	target_id;
217 	/*
218 	 * This is the host address where the response will be written
219 	 * when the request is complete.  This area must be 16B aligned
220 	 * and must be cleared to zero before the request is made.
221 	 */
222 	uint64_t	resp_addr;
223 } input_t, *pinput_t;
224 
225 /* Output */
226 /* output (size:64b/8B) */
227 
228 typedef struct output {
229 	/*
230 	 * Pass/Fail or error type
231 	 *
232 	 * Note: receiver to verify the in parameters, and fail the call
233 	 * with an error when appropriate
234 	 */
235 	uint16_t	error_code;
236 	/* This field returns the type of original request. */
237 	uint16_t	req_type;
238 	/* This field provides original sequence number of the command. */
239 	uint16_t	seq_id;
240 	/*
241 	 * This field is the length of the response in bytes.  The
242 	 * last byte of the response is a valid flag that will read
243 	 * as '1' when the command has been completely written to
244 	 * memory.
245 	 */
246 	uint16_t	resp_len;
247 } output_t, *poutput_t;
248 
249 /* Short Command Structure */
250 /* hwrm_short_input (size:128b/16B) */
251 
252 typedef struct hwrm_short_input {
253 	/*
254 	 * This field indicates the type of request in the request buffer.
255 	 * The format for the rest of the command (request) is determined
256 	 * by this field.
257 	 */
258 	uint16_t	req_type;
259 	/*
260 	 * This field indicates a signature that is used to identify short
261 	 * form of the command listed here. This field shall be set to
262 	 * 17185 (0x4321).
263 	 */
264 	uint16_t	signature;
265 	/* Signature indicating this is a short form of HWRM command */
266 	#define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
267 	#define HWRM_SHORT_INPUT_SIGNATURE_LAST	HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
268 	/* The target ID of the command */
269 	uint16_t	target_id;
270 	/* Default target_id (0x0) to maintain compatibility with old driver */
271 	#define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0)
272 	/* Reserved for user-space HWRM interface */
273 	#define HWRM_SHORT_INPUT_TARGET_ID_TOOLS   UINT32_C(0xfffd)
274 	#define HWRM_SHORT_INPUT_TARGET_ID_LAST   HWRM_SHORT_INPUT_TARGET_ID_TOOLS
275 	/* This value indicates the length of the request. */
276 	uint16_t	size;
277 	/*
278 	 * This is the host address where the request was written.
279 	 * This area must be 16B aligned.
280 	 */
281 	uint64_t	req_addr;
282 } hwrm_short_input_t, *phwrm_short_input_t;
283 
284 #define GET_HWRM_REQ_TYPE(x) \
285 	(((x) < 0x80) ? \
286 	((x) == 0x0 ? "HWRM_VER_GET": \
287 	((x) == 0xb ? "HWRM_FUNC_ECHO_RESPONSE": \
288 	((x) == 0xc ? "HWRM_ERROR_RECOVERY_QCFG": \
289 	((x) == 0xd ? "HWRM_FUNC_DRV_IF_CHANGE": \
290 	((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \
291 	((x) == 0xf ? "HWRM_FUNC_VF_CFG": \
292 	((x) == 0x10 ? "HWRM_RESERVED1": \
293 	((x) == 0x11 ? "HWRM_FUNC_RESET": \
294 	((x) == 0x12 ? "HWRM_FUNC_GETFID": \
295 	((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \
296 	((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \
297 	((x) == 0x15 ? "HWRM_FUNC_QCAPS": \
298 	((x) == 0x16 ? "HWRM_FUNC_QCFG": \
299 	((x) == 0x17 ? "HWRM_FUNC_CFG": \
300 	((x) == 0x18 ? "HWRM_FUNC_QSTATS": \
301 	((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \
302 	((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \
303 	((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \
304 	((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \
305 	((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \
306 	((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \
307 	((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \
308 	((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \
309 	((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \
310 	((x) == 0x22 ? "HWRM_PORT_TS_QUERY": \
311 	((x) == 0x23 ? "HWRM_PORT_QSTATS": \
312 	((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \
313 	((x) == 0x25 ? "HWRM_PORT_CLR_STATS": \
314 	((x) == 0x26 ? "HWRM_PORT_LPBK_CLR_STATS": \
315 	((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \
316 	((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \
317 	((x) == 0x29 ? "HWRM_PORT_MAC_PTP_QCFG": \
318 	((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \
319 	((x) == 0x2b ? "HWRM_PORT_PHY_I2C_WRITE": \
320 	((x) == 0x2c ? "HWRM_PORT_PHY_I2C_READ": \
321 	((x) == 0x2d ? "HWRM_PORT_LED_CFG": \
322 	((x) == 0x2e ? "HWRM_PORT_LED_QCFG": \
323 	((x) == 0x2f ? "HWRM_PORT_LED_QCAPS": \
324 	((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \
325 	((x) == 0x31 ? "HWRM_QUEUE_QCFG": \
326 	((x) == 0x32 ? "HWRM_QUEUE_CFG": \
327 	((x) == 0x33 ? "HWRM_FUNC_VLAN_CFG": \
328 	((x) == 0x34 ? "HWRM_FUNC_VLAN_QCFG": \
329 	((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \
330 	((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \
331 	((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \
332 	((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \
333 	((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \
334 	((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \
335 	((x) == 0x3b ? "HWRM_QUEUE_DSCP_QCAPS": \
336 	((x) == 0x3c ? "HWRM_QUEUE_DSCP2PRI_QCFG": \
337 	((x) == 0x3d ? "HWRM_QUEUE_DSCP2PRI_CFG": \
338 	((x) == 0x40 ? "HWRM_VNIC_ALLOC": \
339 	((x) == 0x41 ? "HWRM_VNIC_FREE": \
340 	((x) == 0x42 ? "HWRM_VNIC_CFG": \
341 	((x) == 0x43 ? "HWRM_VNIC_QCFG": \
342 	((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \
343 	((x) == 0x45 ? "HWRM_VNIC_TPA_QCFG": \
344 	((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \
345 	((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \
346 	((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \
347 	((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \
348 	((x) == 0x4a ? "HWRM_VNIC_QCAPS": \
349 	((x) == 0x4b ? "HWRM_VNIC_UPDATE": \
350 	((x) == 0x50 ? "HWRM_RING_ALLOC": \
351 	((x) == 0x51 ? "HWRM_RING_FREE": \
352 	((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \
353 	((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \
354 	((x) == 0x54 ? "HWRM_RING_AGGINT_QCAPS": \
355 	((x) == 0x55 ? "HWRM_RING_SCHQ_ALLOC": \
356 	((x) == 0x56 ? "HWRM_RING_SCHQ_CFG": \
357 	((x) == 0x57 ? "HWRM_RING_SCHQ_FREE": \
358 	((x) == 0x5e ? "HWRM_RING_RESET": \
359 	((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \
360 	((x) == 0x61 ? "HWRM_RING_GRP_FREE": \
361 	((x) == 0x62 ? "HWRM_RING_CFG": \
362 	((x) == 0x63 ? "HWRM_RING_QCFG": \
363 	((x) == 0x64 ? "HWRM_RESERVED5": \
364 	((x) == 0x65 ? "HWRM_RESERVED6": \
365 	((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \
366 	((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \
367 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
368 	(((x) < 0x100) ? \
369 	((x) == 0x80 ? "HWRM_QUEUE_MPLS_QCAPS": \
370 	((x) == 0x81 ? "HWRM_QUEUE_MPLSTC2PRI_QCFG": \
371 	((x) == 0x82 ? "HWRM_QUEUE_MPLSTC2PRI_CFG": \
372 	((x) == 0x83 ? "HWRM_QUEUE_VLANPRI_QCAPS": \
373 	((x) == 0x84 ? "HWRM_QUEUE_VLANPRI2PRI_QCFG": \
374 	((x) == 0x85 ? "HWRM_QUEUE_VLANPRI2PRI_CFG": \
375 	((x) == 0x86 ? "HWRM_QUEUE_GLOBAL_CFG": \
376 	((x) == 0x87 ? "HWRM_QUEUE_GLOBAL_QCFG": \
377 	((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \
378 	((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \
379 	((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \
380 	((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \
381 	((x) == 0x94 ? "HWRM_CFA_VLAN_ANTISPOOF_CFG": \
382 	((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \
383 	((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \
384 	((x) == 0x97 ? "HWRM_CFA_ENCAP_RECORD_ALLOC": \
385 	((x) == 0x98 ? "HWRM_CFA_ENCAP_RECORD_FREE": \
386 	((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \
387 	((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \
388 	((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \
389 	((x) == 0x9c ? "HWRM_CFA_EM_FLOW_ALLOC": \
390 	((x) == 0x9d ? "HWRM_CFA_EM_FLOW_FREE": \
391 	((x) == 0x9e ? "HWRM_CFA_EM_FLOW_CFG": \
392 	((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \
393 	((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \
394 	((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \
395 	((x) == 0xaf ? "HWRM_STAT_CTX_ENG_QUERY": \
396 	((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \
397 	((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \
398 	((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \
399 	((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \
400 	((x) == 0xb4 ? "HWRM_PORT_QSTATS_EXT": \
401 	((x) == 0xb5 ? "HWRM_PORT_PHY_MDIO_WRITE": \
402 	((x) == 0xb6 ? "HWRM_PORT_PHY_MDIO_READ": \
403 	((x) == 0xb7 ? "HWRM_PORT_PHY_MDIO_BUS_ACQUIRE": \
404 	((x) == 0xb8 ? "HWRM_PORT_PHY_MDIO_BUS_RELEASE": \
405 	((x) == 0xb9 ? "HWRM_PORT_QSTATS_EXT_PFC_WD": \
406 	((x) == 0xba ? "HWRM_RESERVED7": \
407 	((x) == 0xbb ? "HWRM_PORT_TX_FIR_CFG": \
408 	((x) == 0xbc ? "HWRM_PORT_TX_FIR_QCFG": \
409 	((x) == 0xbd ? "HWRM_PORT_ECN_QSTATS": \
410 	((x) == 0xbe ? "HWRM_FW_LIVEPATCH_QUERY": \
411 	((x) == 0xbf ? "HWRM_FW_LIVEPATCH": \
412 	((x) == 0xc0 ? "HWRM_FW_RESET": \
413 	((x) == 0xc1 ? "HWRM_FW_QSTATUS": \
414 	((x) == 0xc2 ? "HWRM_FW_HEALTH_CHECK": \
415 	((x) == 0xc3 ? "HWRM_FW_SYNC": \
416 	((x) == 0xc4 ? "HWRM_FW_STATE_QCAPS": \
417 	((x) == 0xc5 ? "HWRM_FW_STATE_QUIESCE": \
418 	((x) == 0xc6 ? "HWRM_FW_STATE_BACKUP": \
419 	((x) == 0xc7 ? "HWRM_FW_STATE_RESTORE": \
420 	((x) == 0xc8 ? "HWRM_FW_SET_TIME": \
421 	((x) == 0xc9 ? "HWRM_FW_GET_TIME": \
422 	((x) == 0xca ? "HWRM_FW_SET_STRUCTURED_DATA": \
423 	((x) == 0xcb ? "HWRM_FW_GET_STRUCTURED_DATA": \
424 	((x) == 0xcc ? "HWRM_FW_IPC_MAILBOX": \
425 	((x) == 0xcd ? "HWRM_FW_ECN_CFG": \
426 	((x) == 0xce ? "HWRM_FW_ECN_QCFG": \
427 	((x) == 0xcf ? "HWRM_FW_SECURE_CFG": \
428 	((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \
429 	((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \
430 	((x) == 0xd2 ? "HWRM_FWD_RESP": \
431 	((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \
432 	((x) == 0xd4 ? "HWRM_OEM_CMD": \
433 	((x) == 0xd5 ? "HWRM_PORT_PRBS_TEST": \
434 	((x) == 0xd6 ? "HWRM_PORT_SFP_SIDEBAND_CFG": \
435 	((x) == 0xd7 ? "HWRM_PORT_SFP_SIDEBAND_QCFG": \
436 	((x) == 0xd8 ? "HWRM_FW_STATE_UNQUIESCE": \
437 	((x) == 0xd9 ? "HWRM_PORT_DSC_DUMP": \
438 	((x) == 0xda ? "HWRM_PORT_EP_TX_QCFG": \
439 	((x) == 0xdb ? "HWRM_PORT_EP_TX_CFG": \
440 	((x) == 0xdc ? "HWRM_PORT_CFG": \
441 	((x) == 0xdd ? "HWRM_PORT_QCFG": \
442 	((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \
443 	((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \
444 	((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \
445 	((x) == 0xe3 ? "HWRM_REG_POWER_HISTOGRAM": \
446 	((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \
447 	((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \
448 	((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \
449 	((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \
450 	((x) == 0xf4 ? "HWRM_CFA_METER_QCAPS": \
451 	((x) == 0xf5 ? "HWRM_CFA_METER_PROFILE_ALLOC": \
452 	((x) == 0xf6 ? "HWRM_CFA_METER_PROFILE_FREE": \
453 	((x) == 0xf7 ? "HWRM_CFA_METER_PROFILE_CFG": \
454 	((x) == 0xf8 ? "HWRM_CFA_METER_INSTANCE_ALLOC": \
455 	((x) == 0xf9 ? "HWRM_CFA_METER_INSTANCE_FREE": \
456 	((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \
457 	((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \
458 	((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \
459 	"Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
460 	(((x) < 0x180) ? \
461 	((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \
462 	((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \
463 	((x) == 0x102 ? "HWRM_CFA_VF_PAIR_INFO": \
464 	((x) == 0x103 ? "HWRM_CFA_FLOW_ALLOC": \
465 	((x) == 0x104 ? "HWRM_CFA_FLOW_FREE": \
466 	((x) == 0x105 ? "HWRM_CFA_FLOW_FLUSH": \
467 	((x) == 0x106 ? "HWRM_CFA_FLOW_STATS": \
468 	((x) == 0x107 ? "HWRM_CFA_FLOW_INFO": \
469 	((x) == 0x108 ? "HWRM_CFA_DECAP_FILTER_ALLOC": \
470 	((x) == 0x109 ? "HWRM_CFA_DECAP_FILTER_FREE": \
471 	((x) == 0x10a ? "HWRM_CFA_VLAN_ANTISPOOF_QCFG": \
472 	((x) == 0x10b ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC": \
473 	((x) == 0x10c ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE": \
474 	((x) == 0x10d ? "HWRM_CFA_PAIR_ALLOC": \
475 	((x) == 0x10e ? "HWRM_CFA_PAIR_FREE": \
476 	((x) == 0x10f ? "HWRM_CFA_PAIR_INFO": \
477 	((x) == 0x110 ? "HWRM_FW_IPC_MSG": \
478 	((x) == 0x111 ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO": \
479 	((x) == 0x112 ? "HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE": \
480 	((x) == 0x113 ? "HWRM_CFA_FLOW_AGING_TIMER_RESET": \
481 	((x) == 0x114 ? "HWRM_CFA_FLOW_AGING_CFG": \
482 	((x) == 0x115 ? "HWRM_CFA_FLOW_AGING_QCFG": \
483 	((x) == 0x116 ? "HWRM_CFA_FLOW_AGING_QCAPS": \
484 	((x) == 0x117 ? "HWRM_CFA_CTX_MEM_RGTR": \
485 	((x) == 0x118 ? "HWRM_CFA_CTX_MEM_UNRGTR": \
486 	((x) == 0x119 ? "HWRM_CFA_CTX_MEM_QCTX": \
487 	((x) == 0x11a ? "HWRM_CFA_CTX_MEM_QCAPS": \
488 	((x) == 0x11b ? "HWRM_CFA_COUNTER_QCAPS": \
489 	((x) == 0x11c ? "HWRM_CFA_COUNTER_CFG": \
490 	((x) == 0x11d ? "HWRM_CFA_COUNTER_QCFG": \
491 	((x) == 0x11e ? "HWRM_CFA_COUNTER_QSTATS": \
492 	((x) == 0x11f ? "HWRM_CFA_TCP_FLAG_PROCESS_QCFG": \
493 	((x) == 0x120 ? "HWRM_CFA_EEM_QCAPS": \
494 	((x) == 0x121 ? "HWRM_CFA_EEM_CFG": \
495 	((x) == 0x122 ? "HWRM_CFA_EEM_QCFG": \
496 	((x) == 0x123 ? "HWRM_CFA_EEM_OP": \
497 	((x) == 0x124 ? "HWRM_CFA_ADV_FLOW_MGNT_QCAPS": \
498 	((x) == 0x125 ? "HWRM_CFA_TFLIB": \
499 	((x) == 0x126 ? "HWRM_CFA_LAG_GROUP_MEMBER_RGTR": \
500 	((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \
501 	((x) == 0x128 ? "HWRM_CFA_TLS_FILTER_ALLOC": \
502 	((x) == 0x129 ? "HWRM_CFA_TLS_FILTER_FREE": \
503 	((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \
504 	((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \
505 	((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \
506 	((x) == 0x131 ? "HWRM_ENGINE_CKV_KEY_ADD": \
507 	((x) == 0x132 ? "HWRM_ENGINE_CKV_KEY_DELETE": \
508 	((x) == 0x133 ? "HWRM_ENGINE_CKV_FLUSH": \
509 	((x) == 0x134 ? "HWRM_ENGINE_CKV_RNG_GET": \
510 	((x) == 0x135 ? "HWRM_ENGINE_CKV_KEY_GEN": \
511 	((x) == 0x136 ? "HWRM_ENGINE_CKV_KEY_LABEL_CFG": \
512 	((x) == 0x137 ? "HWRM_ENGINE_CKV_KEY_LABEL_QCFG": \
513 	((x) == 0x13c ? "HWRM_ENGINE_QG_CONFIG_QUERY": \
514 	((x) == 0x13d ? "HWRM_ENGINE_QG_QUERY": \
515 	((x) == 0x13e ? "HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY": \
516 	((x) == 0x13f ? "HWRM_ENGINE_QG_METER_PROFILE_QUERY": \
517 	((x) == 0x140 ? "HWRM_ENGINE_QG_METER_PROFILE_ALLOC": \
518 	((x) == 0x141 ? "HWRM_ENGINE_QG_METER_PROFILE_FREE": \
519 	((x) == 0x142 ? "HWRM_ENGINE_QG_METER_QUERY": \
520 	((x) == 0x143 ? "HWRM_ENGINE_QG_METER_BIND": \
521 	((x) == 0x144 ? "HWRM_ENGINE_QG_METER_UNBIND": \
522 	((x) == 0x145 ? "HWRM_ENGINE_QG_FUNC_BIND": \
523 	((x) == 0x146 ? "HWRM_ENGINE_SG_CONFIG_QUERY": \
524 	((x) == 0x147 ? "HWRM_ENGINE_SG_QUERY": \
525 	((x) == 0x148 ? "HWRM_ENGINE_SG_METER_QUERY": \
526 	((x) == 0x149 ? "HWRM_ENGINE_SG_METER_CONFIG": \
527 	((x) == 0x14a ? "HWRM_ENGINE_SG_QG_BIND": \
528 	((x) == 0x14b ? "HWRM_ENGINE_QG_SG_UNBIND": \
529 	((x) == 0x154 ? "HWRM_ENGINE_CONFIG_QUERY": \
530 	((x) == 0x155 ? "HWRM_ENGINE_STATS_CONFIG": \
531 	((x) == 0x156 ? "HWRM_ENGINE_STATS_CLEAR": \
532 	((x) == 0x157 ? "HWRM_ENGINE_STATS_QUERY": \
533 	((x) == 0x158 ? "HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR": \
534 	((x) == 0x15e ? "HWRM_ENGINE_RQ_ALLOC": \
535 	((x) == 0x15f ? "HWRM_ENGINE_RQ_FREE": \
536 	((x) == 0x160 ? "HWRM_ENGINE_CQ_ALLOC": \
537 	((x) == 0x161 ? "HWRM_ENGINE_CQ_FREE": \
538 	((x) == 0x162 ? "HWRM_ENGINE_NQ_ALLOC": \
539 	((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \
540 	((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \
541 	((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \
542 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
543 	(((x) < 0x200) ? \
544 	((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \
545 	((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \
546 	((x) == 0x192 ? "HWRM_FUNC_BACKING_STORE_QCAPS": \
547 	((x) == 0x193 ? "HWRM_FUNC_BACKING_STORE_CFG": \
548 	((x) == 0x194 ? "HWRM_FUNC_BACKING_STORE_QCFG": \
549 	((x) == 0x195 ? "HWRM_FUNC_VF_BW_CFG": \
550 	((x) == 0x196 ? "HWRM_FUNC_VF_BW_QCFG": \
551 	((x) == 0x197 ? "HWRM_FUNC_HOST_PF_IDS_QUERY": \
552 	((x) == 0x198 ? "HWRM_FUNC_QSTATS_EXT": \
553 	((x) == 0x199 ? "HWRM_STAT_EXT_CTX_QUERY": \
554 	((x) == 0x19a ? "HWRM_FUNC_SPD_CFG": \
555 	((x) == 0x19b ? "HWRM_FUNC_SPD_QCFG": \
556 	((x) == 0x19c ? "HWRM_FUNC_PTP_PIN_QCFG": \
557 	((x) == 0x19d ? "HWRM_FUNC_PTP_PIN_CFG": \
558 	((x) == 0x19e ? "HWRM_FUNC_PTP_CFG": \
559 	((x) == 0x19f ? "HWRM_FUNC_PTP_TS_QUERY": \
560 	((x) == 0x1a0 ? "HWRM_FUNC_PTP_EXT_CFG": \
561 	((x) == 0x1a1 ? "HWRM_FUNC_PTP_EXT_QCFG": \
562 	((x) == 0x1a2 ? "HWRM_FUNC_KEY_CTX_ALLOC": \
563 	((x) == 0x1a3 ? "HWRM_FUNC_BACKING_STORE_CFG_V2": \
564 	((x) == 0x1a4 ? "HWRM_FUNC_BACKING_STORE_QCFG_V2": \
565 	((x) == 0x1a5 ? "HWRM_FUNC_DBR_PACING_CFG": \
566 	((x) == 0x1a6 ? "HWRM_FUNC_DBR_PACING_QCFG": \
567 	((x) == 0x1a7 ? "HWRM_FUNC_DBR_PACING_BROADCAST_EVENT": \
568 	((x) == 0x1a8 ? "HWRM_FUNC_BACKING_STORE_QCAPS_V2": \
569 	((x) == 0x1a9 ? "HWRM_FUNC_DBR_PACING_NQLIST_QUERY": \
570 	((x) == 0x1aa ? "HWRM_FUNC_DBR_RECOVERY_COMPLETED": \
571 	((x) == 0x1ab ? "HWRM_FUNC_SYNCE_CFG": \
572 	((x) == 0x1ac ? "HWRM_FUNC_SYNCE_QCFG": \
573 	"Unknown decode" ))))))))))))))))))))))))))))) : \
574 	(((x) < 0x280) ? \
575 	((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \
576 	((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \
577 	((x) == 0x202 ? "HWRM_SELFTEST_IRQ": \
578 	((x) == 0x203 ? "HWRM_SELFTEST_RETRIEVE_SERDES_DATA": \
579 	((x) == 0x204 ? "HWRM_PCIE_QSTATS": \
580 	((x) == 0x205 ? "HWRM_MFG_FRU_WRITE_CONTROL": \
581 	((x) == 0x206 ? "HWRM_MFG_TIMERS_QUERY": \
582 	((x) == 0x207 ? "HWRM_MFG_OTP_CFG": \
583 	((x) == 0x208 ? "HWRM_MFG_OTP_QCFG": \
584 	((x) == 0x209 ? "HWRM_MFG_HDMA_TEST": \
585 	((x) == 0x20a ? "HWRM_MFG_FRU_EEPROM_WRITE": \
586 	((x) == 0x20b ? "HWRM_MFG_FRU_EEPROM_READ": \
587 	((x) == 0x20c ? "HWRM_MFG_SOC_IMAGE": \
588 	((x) == 0x20d ? "HWRM_MFG_SOC_QSTATUS": \
589 	((x) == 0x20e ? "HWRM_MFG_PARAM_SEEPROM_SYNC": \
590 	((x) == 0x20f ? "HWRM_MFG_PARAM_SEEPROM_READ": \
591 	((x) == 0x210 ? "HWRM_MFG_PARAM_SEEPROM_HEALTH": \
592 	((x) == 0x211 ? "HWRM_MFG_PRVSN_EXPORT_CSR": \
593 	((x) == 0x212 ? "HWRM_MFG_PRVSN_IMPORT_CERT": \
594 	((x) == 0x213 ? "HWRM_MFG_PRVSN_GET_STATE": \
595 	((x) == 0x214 ? "HWRM_MFG_GET_NVM_MEASUREMENT": \
596 	((x) == 0x215 ? "HWRM_MFG_PSOC_QSTATUS": \
597 	((x) == 0x216 ? "HWRM_MFG_SELFTEST_QLIST": \
598 	((x) == 0x217 ? "HWRM_MFG_SELFTEST_EXEC": \
599 	((x) == 0x218 ? "HWRM_STAT_GENERIC_QSTATS": \
600 	"Unknown decode" ))))))))))))))))))))))))) : \
601 	(((x) < 0x300) ? \
602 	((x) == 0x2bc ? "HWRM_TF": \
603 	((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \
604 	((x) == 0x2c6 ? "HWRM_TF_SESSION_OPEN": \
605 	((x) == 0x2c7 ? "HWRM_TF_SESSION_ATTACH": \
606 	((x) == 0x2c8 ? "HWRM_TF_SESSION_REGISTER": \
607 	((x) == 0x2c9 ? "HWRM_TF_SESSION_UNREGISTER": \
608 	((x) == 0x2ca ? "HWRM_TF_SESSION_CLOSE": \
609 	((x) == 0x2cb ? "HWRM_TF_SESSION_QCFG": \
610 	((x) == 0x2cc ? "HWRM_TF_SESSION_RESC_QCAPS": \
611 	((x) == 0x2cd ? "HWRM_TF_SESSION_RESC_ALLOC": \
612 	((x) == 0x2ce ? "HWRM_TF_SESSION_RESC_FREE": \
613 	((x) == 0x2cf ? "HWRM_TF_SESSION_RESC_FLUSH": \
614 	((x) == 0x2d0 ? "HWRM_TF_SESSION_RESC_INFO": \
615 	((x) == 0x2d1 ? "HWRM_TF_SESSION_HOTUP_STATE_SET": \
616 	((x) == 0x2d2 ? "HWRM_TF_SESSION_HOTUP_STATE_GET": \
617 	((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \
618 	((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \
619 	((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \
620 	((x) == 0x2e2 ? "HWRM_TF_CTXT_MEM_ALLOC": \
621 	((x) == 0x2e3 ? "HWRM_TF_CTXT_MEM_FREE": \
622 	((x) == 0x2e4 ? "HWRM_TF_CTXT_MEM_RGTR": \
623 	((x) == 0x2e5 ? "HWRM_TF_CTXT_MEM_UNRGTR": \
624 	((x) == 0x2e6 ? "HWRM_TF_EXT_EM_QCAPS": \
625 	((x) == 0x2e7 ? "HWRM_TF_EXT_EM_OP": \
626 	((x) == 0x2e8 ? "HWRM_TF_EXT_EM_CFG": \
627 	((x) == 0x2e9 ? "HWRM_TF_EXT_EM_QCFG": \
628 	((x) == 0x2ea ? "HWRM_TF_EM_INSERT": \
629 	((x) == 0x2eb ? "HWRM_TF_EM_DELETE": \
630 	((x) == 0x2ec ? "HWRM_TF_EM_HASH_INSERT": \
631 	((x) == 0x2ed ? "HWRM_TF_EM_MOVE": \
632 	((x) == 0x2f8 ? "HWRM_TF_TCAM_SET": \
633 	((x) == 0x2f9 ? "HWRM_TF_TCAM_GET": \
634 	((x) == 0x2fa ? "HWRM_TF_TCAM_MOVE": \
635 	((x) == 0x2fb ? "HWRM_TF_TCAM_FREE": \
636 	((x) == 0x2fc ? "HWRM_TF_GLOBAL_CFG_SET": \
637 	((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \
638 	((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \
639 	((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \
640 	"Unknown decode" )))))))))))))))))))))))))))))))))))))) : \
641 	(((x) < 0x400) ? \
642 	((x) == 0x380 ? "HWRM_TFC_TBL_SCOPE_QCAPS": \
643 	((x) == 0x381 ? "HWRM_TFC_TBL_SCOPE_ID_ALLOC": \
644 	((x) == 0x382 ? "HWRM_TFC_TBL_SCOPE_CONFIG": \
645 	((x) == 0x383 ? "HWRM_TFC_TBL_SCOPE_DECONFIG": \
646 	((x) == 0x384 ? "HWRM_TFC_TBL_SCOPE_FID_ADD": \
647 	((x) == 0x385 ? "HWRM_TFC_TBL_SCOPE_FID_REM": \
648 	((x) == 0x386 ? "HWRM_TFC_TBL_SCOPE_POOL_ALLOC": \
649 	((x) == 0x387 ? "HWRM_TFC_TBL_SCOPE_POOL_FREE": \
650 	((x) == 0x388 ? "HWRM_TFC_SESSION_ID_ALLOC": \
651 	((x) == 0x389 ? "HWRM_TFC_SESSION_FID_ADD": \
652 	((x) == 0x38a ? "HWRM_TFC_SESSION_FID_REM": \
653 	((x) == 0x38b ? "HWRM_TFC_IDENT_ALLOC": \
654 	((x) == 0x38c ? "HWRM_TFC_IDENT_FREE": \
655 	((x) == 0x38d ? "HWRM_TFC_IDX_TBL_ALLOC": \
656 	((x) == 0x38e ? "HWRM_TFC_IDX_TBL_ALLOC_SET": \
657 	((x) == 0x38f ? "HWRM_TFC_IDX_TBL_SET": \
658 	((x) == 0x390 ? "HWRM_TFC_IDX_TBL_GET": \
659 	((x) == 0x391 ? "HWRM_TFC_IDX_TBL_FREE": \
660 	((x) == 0x392 ? "HWRM_TFC_GLOBAL_ID_ALLOC": \
661 	((x) == 0x393 ? "HWRM_TFC_TCAM_SET": \
662 	((x) == 0x394 ? "HWRM_TFC_TCAM_GET": \
663 	((x) == 0x395 ? "HWRM_TFC_TCAM_ALLOC": \
664 	((x) == 0x396 ? "HWRM_TFC_TCAM_ALLOC_SET": \
665 	((x) == 0x397 ? "HWRM_TFC_TCAM_FREE": \
666 	"Unknown decode" )))))))))))))))))))))))) : \
667 	(((x) < 0x480) ? \
668 	((x) == 0x400 ? "HWRM_SV": \
669 	"Unknown decode" ) : \
670 	(((x) < 0xff80) ? \
671 	((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \
672 	((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \
673 	((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \
674 	((x) == 0xff13 ? "HWRM_DBG_WRITE_INDIRECT": \
675 	((x) == 0xff14 ? "HWRM_DBG_DUMP": \
676 	((x) == 0xff15 ? "HWRM_DBG_ERASE_NVM": \
677 	((x) == 0xff16 ? "HWRM_DBG_CFG": \
678 	((x) == 0xff17 ? "HWRM_DBG_COREDUMP_LIST": \
679 	((x) == 0xff18 ? "HWRM_DBG_COREDUMP_INITIATE": \
680 	((x) == 0xff19 ? "HWRM_DBG_COREDUMP_RETRIEVE": \
681 	((x) == 0xff1a ? "HWRM_DBG_FW_CLI": \
682 	((x) == 0xff1b ? "HWRM_DBG_I2C_CMD": \
683 	((x) == 0xff1c ? "HWRM_DBG_RING_INFO_GET": \
684 	((x) == 0xff1d ? "HWRM_DBG_CRASHDUMP_HEADER": \
685 	((x) == 0xff1e ? "HWRM_DBG_CRASHDUMP_ERASE": \
686 	((x) == 0xff1f ? "HWRM_DBG_DRV_TRACE": \
687 	((x) == 0xff20 ? "HWRM_DBG_QCAPS": \
688 	((x) == 0xff21 ? "HWRM_DBG_QCFG": \
689 	((x) == 0xff22 ? "HWRM_DBG_CRASHDUMP_MEDIUM_CFG": \
690 	((x) == 0xff23 ? "HWRM_DBG_USEQ_ALLOC": \
691 	((x) == 0xff24 ? "HWRM_DBG_USEQ_FREE": \
692 	((x) == 0xff25 ? "HWRM_DBG_USEQ_FLUSH": \
693 	((x) == 0xff26 ? "HWRM_DBG_USEQ_QCAPS": \
694 	((x) == 0xff27 ? "HWRM_DBG_USEQ_CW_CFG": \
695 	((x) == 0xff28 ? "HWRM_DBG_USEQ_SCHED_CFG": \
696 	((x) == 0xff29 ? "HWRM_DBG_USEQ_RUN": \
697 	((x) == 0xff2a ? "HWRM_DBG_USEQ_DELIVERY_REQ": \
698 	((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \
699 	"Unknown decode" )))))))))))))))))))))))))))) : \
700 	(((x) <= 0xffff) ? \
701 	((x) == 0xffec ? "HWRM_NVM_DEFRAG": \
702 	((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \
703 	((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \
704 	((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \
705 	((x) == 0xfff0 ? "HWRM_NVM_FLUSH": \
706 	((x) == 0xfff1 ? "HWRM_NVM_GET_VARIABLE": \
707 	((x) == 0xfff2 ? "HWRM_NVM_SET_VARIABLE": \
708 	((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \
709 	((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \
710 	((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \
711 	((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \
712 	((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \
713 	((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \
714 	((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \
715 	((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \
716 	((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \
717 	((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \
718 	((x) == 0xfffd ? "HWRM_NVM_READ": \
719 	((x) == 0xfffe ? "HWRM_NVM_WRITE": \
720 	((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \
721 	"Unknown decode" )))))))))))))))))))) : \
722 	"Unknown decode" ))))))))))
723 
724 
725 /*
726  * Command numbering
727  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
728  * #	So only structure definition is provided here.
729  */
730 /* cmd_nums (size:64b/8B) */
731 
732 typedef struct cmd_nums {
733 	/*
734 	 * This version of the specification defines the commands listed in
735 	 * the table below. The following are general implementation
736 	 * requirements for these commands:
737 	 *
738 	 * # All commands listed below that are marked neither
739 	 * reserved nor experimental shall be implemented by the HWRM.
740 	 * # A HWRM client compliant to this specification should not use
741 	 * commands outside of the list below.
742 	 * # A HWRM client compliant to this specification should not use
743 	 * command numbers marked reserved below.
744 	 * # A command marked experimental below may not be implemented
745 	 * by the HWRM.
746 	 * # A command marked experimental may change in the
747 	 * future version of the HWRM specification.
748 	 * # A command not listed below may be implemented by the HWRM.
749 	 * The behavior of commands that are not listed below is outside
750 	 * the scope of this specification.
751 	 */
752 	uint16_t	req_type;
753 	#define HWRM_VER_GET				UINT32_C(0x0)
754 	#define HWRM_FUNC_ECHO_RESPONSE		UINT32_C(0xb)
755 	#define HWRM_ERROR_RECOVERY_QCFG		UINT32_C(0xc)
756 	#define HWRM_FUNC_DRV_IF_CHANGE		UINT32_C(0xd)
757 	#define HWRM_FUNC_BUF_UNRGTR			UINT32_C(0xe)
758 	#define HWRM_FUNC_VF_CFG			UINT32_C(0xf)
759 	/* Reserved for future use. */
760 	#define HWRM_RESERVED1				UINT32_C(0x10)
761 	#define HWRM_FUNC_RESET			UINT32_C(0x11)
762 	#define HWRM_FUNC_GETFID			UINT32_C(0x12)
763 	#define HWRM_FUNC_VF_ALLOC			UINT32_C(0x13)
764 	#define HWRM_FUNC_VF_FREE			UINT32_C(0x14)
765 	#define HWRM_FUNC_QCAPS			UINT32_C(0x15)
766 	#define HWRM_FUNC_QCFG				UINT32_C(0x16)
767 	#define HWRM_FUNC_CFG				UINT32_C(0x17)
768 	#define HWRM_FUNC_QSTATS			UINT32_C(0x18)
769 	#define HWRM_FUNC_CLR_STATS			UINT32_C(0x19)
770 	#define HWRM_FUNC_DRV_UNRGTR			UINT32_C(0x1a)
771 	#define HWRM_FUNC_VF_RESC_FREE			UINT32_C(0x1b)
772 	#define HWRM_FUNC_VF_VNIC_IDS_QUERY		UINT32_C(0x1c)
773 	#define HWRM_FUNC_DRV_RGTR			UINT32_C(0x1d)
774 	#define HWRM_FUNC_DRV_QVER			UINT32_C(0x1e)
775 	#define HWRM_FUNC_BUF_RGTR			UINT32_C(0x1f)
776 	#define HWRM_PORT_PHY_CFG			UINT32_C(0x20)
777 	#define HWRM_PORT_MAC_CFG			UINT32_C(0x21)
778 	/* Experimental */
779 	#define HWRM_PORT_TS_QUERY			UINT32_C(0x22)
780 	#define HWRM_PORT_QSTATS			UINT32_C(0x23)
781 	#define HWRM_PORT_LPBK_QSTATS			UINT32_C(0x24)
782 	/* Experimental */
783 	#define HWRM_PORT_CLR_STATS			UINT32_C(0x25)
784 	/* Experimental */
785 	#define HWRM_PORT_LPBK_CLR_STATS		UINT32_C(0x26)
786 	#define HWRM_PORT_PHY_QCFG			UINT32_C(0x27)
787 	#define HWRM_PORT_MAC_QCFG			UINT32_C(0x28)
788 	/* Experimental */
789 	#define HWRM_PORT_MAC_PTP_QCFG			UINT32_C(0x29)
790 	#define HWRM_PORT_PHY_QCAPS			UINT32_C(0x2a)
791 	#define HWRM_PORT_PHY_I2C_WRITE		UINT32_C(0x2b)
792 	#define HWRM_PORT_PHY_I2C_READ			UINT32_C(0x2c)
793 	#define HWRM_PORT_LED_CFG			UINT32_C(0x2d)
794 	#define HWRM_PORT_LED_QCFG			UINT32_C(0x2e)
795 	#define HWRM_PORT_LED_QCAPS			UINT32_C(0x2f)
796 	#define HWRM_QUEUE_QPORTCFG			UINT32_C(0x30)
797 	#define HWRM_QUEUE_QCFG			UINT32_C(0x31)
798 	#define HWRM_QUEUE_CFG				UINT32_C(0x32)
799 	#define HWRM_FUNC_VLAN_CFG			UINT32_C(0x33)
800 	#define HWRM_FUNC_VLAN_QCFG			UINT32_C(0x34)
801 	#define HWRM_QUEUE_PFCENABLE_QCFG		UINT32_C(0x35)
802 	#define HWRM_QUEUE_PFCENABLE_CFG		UINT32_C(0x36)
803 	#define HWRM_QUEUE_PRI2COS_QCFG			UINT32_C(0x37)
804 	#define HWRM_QUEUE_PRI2COS_CFG			UINT32_C(0x38)
805 	#define HWRM_QUEUE_COS2BW_QCFG			UINT32_C(0x39)
806 	#define HWRM_QUEUE_COS2BW_CFG			UINT32_C(0x3a)
807 	#define HWRM_QUEUE_DSCP_QCAPS			UINT32_C(0x3b)
808 	#define HWRM_QUEUE_DSCP2PRI_QCFG		UINT32_C(0x3c)
809 	#define HWRM_QUEUE_DSCP2PRI_CFG		UINT32_C(0x3d)
810 	#define HWRM_VNIC_ALLOC			UINT32_C(0x40)
811 	#define HWRM_VNIC_FREE				UINT32_C(0x41)
812 	#define HWRM_VNIC_CFG				UINT32_C(0x42)
813 	#define HWRM_VNIC_QCFG				UINT32_C(0x43)
814 	#define HWRM_VNIC_TPA_CFG			UINT32_C(0x44)
815 	/* Experimental */
816 	#define HWRM_VNIC_TPA_QCFG			UINT32_C(0x45)
817 	#define HWRM_VNIC_RSS_CFG			UINT32_C(0x46)
818 	#define HWRM_VNIC_RSS_QCFG			UINT32_C(0x47)
819 	#define HWRM_VNIC_PLCMODES_CFG			UINT32_C(0x48)
820 	#define HWRM_VNIC_PLCMODES_QCFG		UINT32_C(0x49)
821 	#define HWRM_VNIC_QCAPS			UINT32_C(0x4a)
822 	/* Updates specific fields in RX VNIC structure */
823 	#define HWRM_VNIC_UPDATE			UINT32_C(0x4b)
824 	#define HWRM_RING_ALLOC			UINT32_C(0x50)
825 	#define HWRM_RING_FREE				UINT32_C(0x51)
826 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS	UINT32_C(0x52)
827 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS	UINT32_C(0x53)
828 	#define HWRM_RING_AGGINT_QCAPS			UINT32_C(0x54)
829 	#define HWRM_RING_SCHQ_ALLOC			UINT32_C(0x55)
830 	#define HWRM_RING_SCHQ_CFG			UINT32_C(0x56)
831 	#define HWRM_RING_SCHQ_FREE			UINT32_C(0x57)
832 	#define HWRM_RING_RESET			UINT32_C(0x5e)
833 	#define HWRM_RING_GRP_ALLOC			UINT32_C(0x60)
834 	#define HWRM_RING_GRP_FREE			UINT32_C(0x61)
835 	#define HWRM_RING_CFG				UINT32_C(0x62)
836 	#define HWRM_RING_QCFG				UINT32_C(0x63)
837 	/* Reserved for future use. */
838 	#define HWRM_RESERVED5				UINT32_C(0x64)
839 	/* Reserved for future use. */
840 	#define HWRM_RESERVED6				UINT32_C(0x65)
841 	#define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC		UINT32_C(0x70)
842 	#define HWRM_VNIC_RSS_COS_LB_CTX_FREE		UINT32_C(0x71)
843 	#define HWRM_QUEUE_MPLS_QCAPS			UINT32_C(0x80)
844 	#define HWRM_QUEUE_MPLSTC2PRI_QCFG		UINT32_C(0x81)
845 	#define HWRM_QUEUE_MPLSTC2PRI_CFG		UINT32_C(0x82)
846 	#define HWRM_QUEUE_VLANPRI_QCAPS		UINT32_C(0x83)
847 	#define HWRM_QUEUE_VLANPRI2PRI_QCFG		UINT32_C(0x84)
848 	#define HWRM_QUEUE_VLANPRI2PRI_CFG		UINT32_C(0x85)
849 	#define HWRM_QUEUE_GLOBAL_CFG			UINT32_C(0x86)
850 	#define HWRM_QUEUE_GLOBAL_QCFG			UINT32_C(0x87)
851 	#define HWRM_CFA_L2_FILTER_ALLOC		UINT32_C(0x90)
852 	#define HWRM_CFA_L2_FILTER_FREE		UINT32_C(0x91)
853 	#define HWRM_CFA_L2_FILTER_CFG			UINT32_C(0x92)
854 	#define HWRM_CFA_L2_SET_RX_MASK		UINT32_C(0x93)
855 	#define HWRM_CFA_VLAN_ANTISPOOF_CFG		UINT32_C(0x94)
856 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC		UINT32_C(0x95)
857 	#define HWRM_CFA_TUNNEL_FILTER_FREE		UINT32_C(0x96)
858 	/* Experimental */
859 	#define HWRM_CFA_ENCAP_RECORD_ALLOC		UINT32_C(0x97)
860 	/* Experimental */
861 	#define HWRM_CFA_ENCAP_RECORD_FREE		UINT32_C(0x98)
862 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC		UINT32_C(0x99)
863 	#define HWRM_CFA_NTUPLE_FILTER_FREE		UINT32_C(0x9a)
864 	#define HWRM_CFA_NTUPLE_FILTER_CFG		UINT32_C(0x9b)
865 	/* Experimental */
866 	#define HWRM_CFA_EM_FLOW_ALLOC			UINT32_C(0x9c)
867 	/* Experimental */
868 	#define HWRM_CFA_EM_FLOW_FREE			UINT32_C(0x9d)
869 	/* Experimental */
870 	#define HWRM_CFA_EM_FLOW_CFG			UINT32_C(0x9e)
871 	#define HWRM_TUNNEL_DST_PORT_QUERY		UINT32_C(0xa0)
872 	#define HWRM_TUNNEL_DST_PORT_ALLOC		UINT32_C(0xa1)
873 	#define HWRM_TUNNEL_DST_PORT_FREE		UINT32_C(0xa2)
874 	#define HWRM_STAT_CTX_ENG_QUERY		UINT32_C(0xaf)
875 	#define HWRM_STAT_CTX_ALLOC			UINT32_C(0xb0)
876 	#define HWRM_STAT_CTX_FREE			UINT32_C(0xb1)
877 	#define HWRM_STAT_CTX_QUERY			UINT32_C(0xb2)
878 	#define HWRM_STAT_CTX_CLR_STATS		UINT32_C(0xb3)
879 	#define HWRM_PORT_QSTATS_EXT			UINT32_C(0xb4)
880 	#define HWRM_PORT_PHY_MDIO_WRITE		UINT32_C(0xb5)
881 	#define HWRM_PORT_PHY_MDIO_READ		UINT32_C(0xb6)
882 	#define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE		UINT32_C(0xb7)
883 	#define HWRM_PORT_PHY_MDIO_BUS_RELEASE		UINT32_C(0xb8)
884 	#define HWRM_PORT_QSTATS_EXT_PFC_WD		UINT32_C(0xb9)
885 	/* Reserved. */
886 	#define HWRM_RESERVED7				UINT32_C(0xba)
887 	#define HWRM_PORT_TX_FIR_CFG			UINT32_C(0xbb)
888 	#define HWRM_PORT_TX_FIR_QCFG			UINT32_C(0xbc)
889 	#define HWRM_PORT_ECN_QSTATS			UINT32_C(0xbd)
890 	#define HWRM_FW_LIVEPATCH_QUERY		UINT32_C(0xbe)
891 	#define HWRM_FW_LIVEPATCH			UINT32_C(0xbf)
892 	#define HWRM_FW_RESET				UINT32_C(0xc0)
893 	#define HWRM_FW_QSTATUS			UINT32_C(0xc1)
894 	#define HWRM_FW_HEALTH_CHECK			UINT32_C(0xc2)
895 	#define HWRM_FW_SYNC				UINT32_C(0xc3)
896 	#define HWRM_FW_STATE_QCAPS			UINT32_C(0xc4)
897 	#define HWRM_FW_STATE_QUIESCE			UINT32_C(0xc5)
898 	#define HWRM_FW_STATE_BACKUP			UINT32_C(0xc6)
899 	#define HWRM_FW_STATE_RESTORE			UINT32_C(0xc7)
900 	/* Experimental */
901 	#define HWRM_FW_SET_TIME			UINT32_C(0xc8)
902 	/* Experimental */
903 	#define HWRM_FW_GET_TIME			UINT32_C(0xc9)
904 	/* Experimental */
905 	#define HWRM_FW_SET_STRUCTURED_DATA		UINT32_C(0xca)
906 	/* Experimental */
907 	#define HWRM_FW_GET_STRUCTURED_DATA		UINT32_C(0xcb)
908 	/* Experimental */
909 	#define HWRM_FW_IPC_MAILBOX			UINT32_C(0xcc)
910 	#define HWRM_FW_ECN_CFG			UINT32_C(0xcd)
911 	#define HWRM_FW_ECN_QCFG			UINT32_C(0xce)
912 	#define HWRM_FW_SECURE_CFG			UINT32_C(0xcf)
913 	#define HWRM_EXEC_FWD_RESP			UINT32_C(0xd0)
914 	#define HWRM_REJECT_FWD_RESP			UINT32_C(0xd1)
915 	#define HWRM_FWD_RESP				UINT32_C(0xd2)
916 	#define HWRM_FWD_ASYNC_EVENT_CMPL		UINT32_C(0xd3)
917 	#define HWRM_OEM_CMD				UINT32_C(0xd4)
918 	/* Tells the fw to run PRBS test on a given port and lane. */
919 	#define HWRM_PORT_PRBS_TEST			UINT32_C(0xd5)
920 	#define HWRM_PORT_SFP_SIDEBAND_CFG		UINT32_C(0xd6)
921 	#define HWRM_PORT_SFP_SIDEBAND_QCFG		UINT32_C(0xd7)
922 	#define HWRM_FW_STATE_UNQUIESCE		UINT32_C(0xd8)
923 	/* Tells the fw to collect dsc dump on a given port and lane. */
924 	#define HWRM_PORT_DSC_DUMP			UINT32_C(0xd9)
925 	#define HWRM_PORT_EP_TX_QCFG			UINT32_C(0xda)
926 	#define HWRM_PORT_EP_TX_CFG			UINT32_C(0xdb)
927 	#define HWRM_PORT_CFG				UINT32_C(0xdc)
928 	#define HWRM_PORT_QCFG				UINT32_C(0xdd)
929 	#define HWRM_TEMP_MONITOR_QUERY		UINT32_C(0xe0)
930 	#define HWRM_REG_POWER_QUERY			UINT32_C(0xe1)
931 	#define HWRM_CORE_FREQUENCY_QUERY		UINT32_C(0xe2)
932 	#define HWRM_REG_POWER_HISTOGRAM		UINT32_C(0xe3)
933 	#define HWRM_WOL_FILTER_ALLOC			UINT32_C(0xf0)
934 	#define HWRM_WOL_FILTER_FREE			UINT32_C(0xf1)
935 	#define HWRM_WOL_FILTER_QCFG			UINT32_C(0xf2)
936 	#define HWRM_WOL_REASON_QCFG			UINT32_C(0xf3)
937 	/* Experimental */
938 	#define HWRM_CFA_METER_QCAPS			UINT32_C(0xf4)
939 	/* Experimental */
940 	#define HWRM_CFA_METER_PROFILE_ALLOC		UINT32_C(0xf5)
941 	/* Experimental */
942 	#define HWRM_CFA_METER_PROFILE_FREE		UINT32_C(0xf6)
943 	/* Experimental */
944 	#define HWRM_CFA_METER_PROFILE_CFG		UINT32_C(0xf7)
945 	/* Experimental */
946 	#define HWRM_CFA_METER_INSTANCE_ALLOC		UINT32_C(0xf8)
947 	/* Experimental */
948 	#define HWRM_CFA_METER_INSTANCE_FREE		UINT32_C(0xf9)
949 	/* Experimental */
950 	#define HWRM_CFA_METER_INSTANCE_CFG		UINT32_C(0xfa)
951 	/* Experimental */
952 	#define HWRM_CFA_VFR_ALLOC			UINT32_C(0xfd)
953 	/* Experimental */
954 	#define HWRM_CFA_VFR_FREE			UINT32_C(0xfe)
955 	/* Experimental */
956 	#define HWRM_CFA_VF_PAIR_ALLOC			UINT32_C(0x100)
957 	/* Experimental */
958 	#define HWRM_CFA_VF_PAIR_FREE			UINT32_C(0x101)
959 	/* Experimental */
960 	#define HWRM_CFA_VF_PAIR_INFO			UINT32_C(0x102)
961 	/* Experimental */
962 	#define HWRM_CFA_FLOW_ALLOC			UINT32_C(0x103)
963 	/* Experimental */
964 	#define HWRM_CFA_FLOW_FREE			UINT32_C(0x104)
965 	/* Experimental */
966 	#define HWRM_CFA_FLOW_FLUSH			UINT32_C(0x105)
967 	#define HWRM_CFA_FLOW_STATS			UINT32_C(0x106)
968 	#define HWRM_CFA_FLOW_INFO			UINT32_C(0x107)
969 	/* Experimental */
970 	#define HWRM_CFA_DECAP_FILTER_ALLOC		UINT32_C(0x108)
971 	/* Experimental */
972 	#define HWRM_CFA_DECAP_FILTER_FREE		UINT32_C(0x109)
973 	#define HWRM_CFA_VLAN_ANTISPOOF_QCFG		UINT32_C(0x10a)
974 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC	UINT32_C(0x10b)
975 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE	UINT32_C(0x10c)
976 	/* Experimental */
977 	#define HWRM_CFA_PAIR_ALLOC			UINT32_C(0x10d)
978 	/* Experimental */
979 	#define HWRM_CFA_PAIR_FREE			UINT32_C(0x10e)
980 	/* Experimental */
981 	#define HWRM_CFA_PAIR_INFO			UINT32_C(0x10f)
982 	/* Experimental */
983 	#define HWRM_FW_IPC_MSG			UINT32_C(0x110)
984 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO	UINT32_C(0x111)
985 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE	UINT32_C(0x112)
986 	/* Experimental */
987 	#define HWRM_CFA_FLOW_AGING_TIMER_RESET	UINT32_C(0x113)
988 	/* Experimental */
989 	#define HWRM_CFA_FLOW_AGING_CFG		UINT32_C(0x114)
990 	/* Experimental */
991 	#define HWRM_CFA_FLOW_AGING_QCFG		UINT32_C(0x115)
992 	/* Experimental */
993 	#define HWRM_CFA_FLOW_AGING_QCAPS		UINT32_C(0x116)
994 	/* Experimental */
995 	#define HWRM_CFA_CTX_MEM_RGTR			UINT32_C(0x117)
996 	/* Experimental */
997 	#define HWRM_CFA_CTX_MEM_UNRGTR		UINT32_C(0x118)
998 	/* Experimental */
999 	#define HWRM_CFA_CTX_MEM_QCTX			UINT32_C(0x119)
1000 	/* Experimental */
1001 	#define HWRM_CFA_CTX_MEM_QCAPS			UINT32_C(0x11a)
1002 	/* Experimental */
1003 	#define HWRM_CFA_COUNTER_QCAPS			UINT32_C(0x11b)
1004 	/* Experimental */
1005 	#define HWRM_CFA_COUNTER_CFG			UINT32_C(0x11c)
1006 	/* Experimental */
1007 	#define HWRM_CFA_COUNTER_QCFG			UINT32_C(0x11d)
1008 	/* Experimental */
1009 	#define HWRM_CFA_COUNTER_QSTATS		UINT32_C(0x11e)
1010 	/* Experimental */
1011 	#define HWRM_CFA_TCP_FLAG_PROCESS_QCFG		UINT32_C(0x11f)
1012 	/* Experimental */
1013 	#define HWRM_CFA_EEM_QCAPS			UINT32_C(0x120)
1014 	/* Experimental */
1015 	#define HWRM_CFA_EEM_CFG			UINT32_C(0x121)
1016 	/* Experimental */
1017 	#define HWRM_CFA_EEM_QCFG			UINT32_C(0x122)
1018 	/* Experimental */
1019 	#define HWRM_CFA_EEM_OP			UINT32_C(0x123)
1020 	/* Experimental */
1021 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS		UINT32_C(0x124)
1022 	/* Experimental - DEPRECATED */
1023 	#define HWRM_CFA_TFLIB				UINT32_C(0x125)
1024 	/* Experimental */
1025 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR		UINT32_C(0x126)
1026 	/* Experimental */
1027 	#define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR	UINT32_C(0x127)
1028 	/* Experimental */
1029 	#define HWRM_CFA_TLS_FILTER_ALLOC		UINT32_C(0x128)
1030 	/* Experimental */
1031 	#define HWRM_CFA_TLS_FILTER_FREE		UINT32_C(0x129)
1032 	/* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
1033 	#define HWRM_ENGINE_CKV_STATUS			UINT32_C(0x12e)
1034 	/* Engine CKV - Add a new CKEK used to encrypt keys. */
1035 	#define HWRM_ENGINE_CKV_CKEK_ADD		UINT32_C(0x12f)
1036 	/* Engine CKV - Delete a previously added CKEK. */
1037 	#define HWRM_ENGINE_CKV_CKEK_DELETE		UINT32_C(0x130)
1038 	/* Engine CKV - Add a new key to the key vault. */
1039 	#define HWRM_ENGINE_CKV_KEY_ADD		UINT32_C(0x131)
1040 	/* Engine CKV - Delete a key from the key vault. */
1041 	#define HWRM_ENGINE_CKV_KEY_DELETE		UINT32_C(0x132)
1042 	/* Engine CKV - Delete all keys from the key vault. */
1043 	#define HWRM_ENGINE_CKV_FLUSH			UINT32_C(0x133)
1044 	/* Engine CKV - Get random data. */
1045 	#define HWRM_ENGINE_CKV_RNG_GET		UINT32_C(0x134)
1046 	/* Engine CKV - Generate and encrypt a new AES key. */
1047 	#define HWRM_ENGINE_CKV_KEY_GEN		UINT32_C(0x135)
1048 	/* Engine CKV - Configure a label index with a label value. */
1049 	#define HWRM_ENGINE_CKV_KEY_LABEL_CFG		UINT32_C(0x136)
1050 	/* Engine CKV - Query a label */
1051 	#define HWRM_ENGINE_CKV_KEY_LABEL_QCFG		UINT32_C(0x137)
1052 	/* Engine - Query the available queue groups configuration. */
1053 	#define HWRM_ENGINE_QG_CONFIG_QUERY		UINT32_C(0x13c)
1054 	/* Engine - Query the queue groups assigned to a function. */
1055 	#define HWRM_ENGINE_QG_QUERY			UINT32_C(0x13d)
1056 	/* Engine - Query the available queue group meter profile configuration. */
1057 	#define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
1058 	/* Engine - Query the configuration of a queue group meter profile. */
1059 	#define HWRM_ENGINE_QG_METER_PROFILE_QUERY	UINT32_C(0x13f)
1060 	/* Engine - Allocate a queue group meter profile. */
1061 	#define HWRM_ENGINE_QG_METER_PROFILE_ALLOC	UINT32_C(0x140)
1062 	/* Engine - Free a queue group meter profile. */
1063 	#define HWRM_ENGINE_QG_METER_PROFILE_FREE	UINT32_C(0x141)
1064 	/* Engine - Query the meters assigned to a queue group. */
1065 	#define HWRM_ENGINE_QG_METER_QUERY		UINT32_C(0x142)
1066 	/* Engine - Bind a queue group meter profile to a queue group. */
1067 	#define HWRM_ENGINE_QG_METER_BIND		UINT32_C(0x143)
1068 	/* Engine - Unbind a queue group meter profile from a queue group. */
1069 	#define HWRM_ENGINE_QG_METER_UNBIND		UINT32_C(0x144)
1070 	/* Engine - Bind a queue group to a function. */
1071 	#define HWRM_ENGINE_QG_FUNC_BIND		UINT32_C(0x145)
1072 	/* Engine - Query the scheduling group configuration. */
1073 	#define HWRM_ENGINE_SG_CONFIG_QUERY		UINT32_C(0x146)
1074 	/* Engine - Query the queue groups assigned to a scheduling group. */
1075 	#define HWRM_ENGINE_SG_QUERY			UINT32_C(0x147)
1076 	/* Engine - Query the configuration of a scheduling group's meter profiles. */
1077 	#define HWRM_ENGINE_SG_METER_QUERY		UINT32_C(0x148)
1078 	/* Engine - Configure a scheduling group's meter profiles. */
1079 	#define HWRM_ENGINE_SG_METER_CONFIG		UINT32_C(0x149)
1080 	/* Engine - Bind a queue group to a scheduling group. */
1081 	#define HWRM_ENGINE_SG_QG_BIND			UINT32_C(0x14a)
1082 	/* Engine - Unbind a queue group from its scheduling group. */
1083 	#define HWRM_ENGINE_QG_SG_UNBIND		UINT32_C(0x14b)
1084 	/* Engine - Query the Engine configuration. */
1085 	#define HWRM_ENGINE_CONFIG_QUERY		UINT32_C(0x154)
1086 	/* Engine - Configure the statistics accumulator for an Engine. */
1087 	#define HWRM_ENGINE_STATS_CONFIG		UINT32_C(0x155)
1088 	/* Engine - Clear the statistics accumulator for an Engine. */
1089 	#define HWRM_ENGINE_STATS_CLEAR		UINT32_C(0x156)
1090 	/* Engine - Query the statistics accumulator for an Engine. */
1091 	#define HWRM_ENGINE_STATS_QUERY		UINT32_C(0x157)
1092 	/* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */
1093 	#define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR  UINT32_C(0x158)
1094 	/* Engine - Allocate an Engine RQ. */
1095 	#define HWRM_ENGINE_RQ_ALLOC			UINT32_C(0x15e)
1096 	/* Engine - Free an Engine RQ. */
1097 	#define HWRM_ENGINE_RQ_FREE			UINT32_C(0x15f)
1098 	/* Engine - Allocate an Engine CQ. */
1099 	#define HWRM_ENGINE_CQ_ALLOC			UINT32_C(0x160)
1100 	/* Engine - Free an Engine CQ. */
1101 	#define HWRM_ENGINE_CQ_FREE			UINT32_C(0x161)
1102 	/* Engine - Allocate an NQ. */
1103 	#define HWRM_ENGINE_NQ_ALLOC			UINT32_C(0x162)
1104 	/* Engine - Free an NQ. */
1105 	#define HWRM_ENGINE_NQ_FREE			UINT32_C(0x163)
1106 	/* Engine - Set the on-die RQE credit update location. */
1107 	#define HWRM_ENGINE_ON_DIE_RQE_CREDITS		UINT32_C(0x164)
1108 	/* Engine - Query the engine function configuration. */
1109 	#define HWRM_ENGINE_FUNC_QCFG			UINT32_C(0x165)
1110 	/* Experimental */
1111 	#define HWRM_FUNC_RESOURCE_QCAPS		UINT32_C(0x190)
1112 	/* Experimental */
1113 	#define HWRM_FUNC_VF_RESOURCE_CFG		UINT32_C(0x191)
1114 	/* Experimental */
1115 	#define HWRM_FUNC_BACKING_STORE_QCAPS		UINT32_C(0x192)
1116 	/* Experimental */
1117 	#define HWRM_FUNC_BACKING_STORE_CFG		UINT32_C(0x193)
1118 	/* Experimental */
1119 	#define HWRM_FUNC_BACKING_STORE_QCFG		UINT32_C(0x194)
1120 	/* Configures the BW of any VF */
1121 	#define HWRM_FUNC_VF_BW_CFG			UINT32_C(0x195)
1122 	/* Queries the BW of any VF */
1123 	#define HWRM_FUNC_VF_BW_QCFG			UINT32_C(0x196)
1124 	/* Queries pf ids belong to specified host(s) */
1125 	#define HWRM_FUNC_HOST_PF_IDS_QUERY		UINT32_C(0x197)
1126 	/* Queries extended stats per function */
1127 	#define HWRM_FUNC_QSTATS_EXT			UINT32_C(0x198)
1128 	/* Queries extended statistics context */
1129 	#define HWRM_STAT_EXT_CTX_QUERY		UINT32_C(0x199)
1130 	/* Configure SoC packet DMA settings */
1131 	#define HWRM_FUNC_SPD_CFG			UINT32_C(0x19a)
1132 	/* Query SoC packet DMA settings */
1133 	#define HWRM_FUNC_SPD_QCFG			UINT32_C(0x19b)
1134 	/* PTP - Queries configuration of timesync IO pins. */
1135 	#define HWRM_FUNC_PTP_PIN_QCFG			UINT32_C(0x19c)
1136 	/* PTP - Configuration of timesync IO pins. */
1137 	#define HWRM_FUNC_PTP_PIN_CFG			UINT32_C(0x19d)
1138 	/* PTP - Configuration for disciplining PHC. */
1139 	#define HWRM_FUNC_PTP_CFG			UINT32_C(0x19e)
1140 	/* PTP - Queries for PHC timestamps. */
1141 	#define HWRM_FUNC_PTP_TS_QUERY			UINT32_C(0x19f)
1142 	/* PTP - Extended PTP configuration. */
1143 	#define HWRM_FUNC_PTP_EXT_CFG			UINT32_C(0x1a0)
1144 	/* PTP - Query extended PTP configuration. */
1145 	#define HWRM_FUNC_PTP_EXT_QCFG			UINT32_C(0x1a1)
1146 	/* The command is used to allocate KTLS or QUIC key contexts. */
1147 	#define HWRM_FUNC_KEY_CTX_ALLOC		UINT32_C(0x1a2)
1148 	/* The is the new API to configure backing stores. */
1149 	#define HWRM_FUNC_BACKING_STORE_CFG_V2		UINT32_C(0x1a3)
1150 	/* The is the new API to query backing store configurations. */
1151 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2	UINT32_C(0x1a4)
1152 	/* To support doorbell pacing configuration. */
1153 	#define HWRM_FUNC_DBR_PACING_CFG		UINT32_C(0x1a5)
1154 	/* To query doorbell pacing configuration. */
1155 	#define HWRM_FUNC_DBR_PACING_QCFG		UINT32_C(0x1a6)
1156 	/*
1157 	 * To broadcast the doorbell event to the drivers to
1158 	 * initiate pacing of doorbells.
1159 	 */
1160 	#define HWRM_FUNC_DBR_PACING_BROADCAST_EVENT	UINT32_C(0x1a7)
1161 	/* The is the new API to query backing store capabilities. */
1162 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2	UINT32_C(0x1a8)
1163 	/* To query doorbell pacing NQ id list configuration. */
1164 	#define HWRM_FUNC_DBR_PACING_NQLIST_QUERY	UINT32_C(0x1a9)
1165 	/*
1166 	 * To notify the firmware that recovery cycle has been
1167 	 * completed by host function drivers.
1168 	 */
1169 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED	UINT32_C(0x1aa)
1170 	/* Configures SyncE configurations. */
1171 	#define HWRM_FUNC_SYNCE_CFG			UINT32_C(0x1ab)
1172 	/* Queries SyncE configurations. */
1173 	#define HWRM_FUNC_SYNCE_QCFG			UINT32_C(0x1ac)
1174 	/* Experimental */
1175 	#define HWRM_SELFTEST_QLIST			UINT32_C(0x200)
1176 	/* Experimental */
1177 	#define HWRM_SELFTEST_EXEC			UINT32_C(0x201)
1178 	/* Experimental */
1179 	#define HWRM_SELFTEST_IRQ			UINT32_C(0x202)
1180 	/* Experimental */
1181 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA	UINT32_C(0x203)
1182 	/* Experimental */
1183 	#define HWRM_PCIE_QSTATS			UINT32_C(0x204)
1184 	/* Experimental */
1185 	#define HWRM_MFG_FRU_WRITE_CONTROL		UINT32_C(0x205)
1186 	/* Returns the current value of a free running counter from the device. */
1187 	#define HWRM_MFG_TIMERS_QUERY			UINT32_C(0x206)
1188 	/* Experimental */
1189 	#define HWRM_MFG_OTP_CFG			UINT32_C(0x207)
1190 	/* Experimental */
1191 	#define HWRM_MFG_OTP_QCFG			UINT32_C(0x208)
1192 	/*
1193 	 * Tells the fw to run the DMA read from the host and DMA write
1194 	 * to the host test.
1195 	 */
1196 	#define HWRM_MFG_HDMA_TEST			UINT32_C(0x209)
1197 	/* Tells the fw to program the fru memory */
1198 	#define HWRM_MFG_FRU_EEPROM_WRITE		UINT32_C(0x20a)
1199 	/* Tells the fw to read the fru memory */
1200 	#define HWRM_MFG_FRU_EEPROM_READ		UINT32_C(0x20b)
1201 	/* Used to provision SoC software images */
1202 	#define HWRM_MFG_SOC_IMAGE			UINT32_C(0x20c)
1203 	/* Retrieves the SoC status and image provisioning information */
1204 	#define HWRM_MFG_SOC_QSTATUS			UINT32_C(0x20d)
1205 	/* Tells the fw to program the seeprom memory */
1206 	#define HWRM_MFG_PARAM_SEEPROM_SYNC		UINT32_C(0x20e)
1207 	/* Tells the fw to read the seeprom memory */
1208 	#define HWRM_MFG_PARAM_SEEPROM_READ		UINT32_C(0x20f)
1209 	/* Tells the fw to get the health of seeprom data */
1210 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH		UINT32_C(0x210)
1211 	/*
1212 	 * The command is used for certificate provisioning to export a
1213 	 * Certificate Signing Request (CSR) from the device.
1214 	 */
1215 	#define HWRM_MFG_PRVSN_EXPORT_CSR		UINT32_C(0x211)
1216 	/*
1217 	 * The command is used for certificate provisioning to import a
1218 	 * CA-signed certificate chain to the device.
1219 	 */
1220 	#define HWRM_MFG_PRVSN_IMPORT_CERT		UINT32_C(0x212)
1221 	/*
1222 	 * The command is used for certificate provisioning to query the
1223 	 * provisioned state.
1224 	 */
1225 	#define HWRM_MFG_PRVSN_GET_STATE		UINT32_C(0x213)
1226 	/*
1227 	 * The command is used to get the hash of the NVM configuration that is
1228 	 * calculated during firmware boot.
1229 	 */
1230 	#define HWRM_MFG_GET_NVM_MEASUREMENT		UINT32_C(0x214)
1231 	/* Retrieves the PSOC status and provisioning information. */
1232 	#define HWRM_MFG_PSOC_QSTATUS			UINT32_C(0x215)
1233 	/*
1234 	 * This command allows manufacturing tool to determine which selftests
1235 	 * are available to be run.
1236 	 */
1237 	#define HWRM_MFG_SELFTEST_QLIST		UINT32_C(0x216)
1238 	/*
1239 	 * This command allows manufacturing tool to request which selftests
1240 	 * to run.
1241 	 */
1242 	#define HWRM_MFG_SELFTEST_EXEC			UINT32_C(0x217)
1243 	/* Queries the generic stats */
1244 	#define HWRM_STAT_GENERIC_QSTATS		UINT32_C(0x218)
1245 	/* Experimental */
1246 	#define HWRM_TF				UINT32_C(0x2bc)
1247 	/* Experimental */
1248 	#define HWRM_TF_VERSION_GET			UINT32_C(0x2bd)
1249 	/* Experimental */
1250 	#define HWRM_TF_SESSION_OPEN			UINT32_C(0x2c6)
1251 	/* Experimental */
1252 	#define HWRM_TF_SESSION_ATTACH			UINT32_C(0x2c7)
1253 	/* Experimental */
1254 	#define HWRM_TF_SESSION_REGISTER		UINT32_C(0x2c8)
1255 	/* Experimental */
1256 	#define HWRM_TF_SESSION_UNREGISTER		UINT32_C(0x2c9)
1257 	/* Experimental */
1258 	#define HWRM_TF_SESSION_CLOSE			UINT32_C(0x2ca)
1259 	/* Experimental */
1260 	#define HWRM_TF_SESSION_QCFG			UINT32_C(0x2cb)
1261 	/* Experimental */
1262 	#define HWRM_TF_SESSION_RESC_QCAPS		UINT32_C(0x2cc)
1263 	/* Experimental */
1264 	#define HWRM_TF_SESSION_RESC_ALLOC		UINT32_C(0x2cd)
1265 	/* Experimental */
1266 	#define HWRM_TF_SESSION_RESC_FREE		UINT32_C(0x2ce)
1267 	/* Experimental */
1268 	#define HWRM_TF_SESSION_RESC_FLUSH		UINT32_C(0x2cf)
1269 	/* Experimental */
1270 	#define HWRM_TF_SESSION_RESC_INFO		UINT32_C(0x2d0)
1271 	/* Experimental */
1272 	#define HWRM_TF_SESSION_HOTUP_STATE_SET	UINT32_C(0x2d1)
1273 	/* Experimental */
1274 	#define HWRM_TF_SESSION_HOTUP_STATE_GET	UINT32_C(0x2d2)
1275 	/* Experimental */
1276 	#define HWRM_TF_TBL_TYPE_GET			UINT32_C(0x2da)
1277 	/* Experimental */
1278 	#define HWRM_TF_TBL_TYPE_SET			UINT32_C(0x2db)
1279 	/* Experimental */
1280 	#define HWRM_TF_TBL_TYPE_BULK_GET		UINT32_C(0x2dc)
1281 	/* Experimental */
1282 	#define HWRM_TF_CTXT_MEM_ALLOC			UINT32_C(0x2e2)
1283 	/* Experimental */
1284 	#define HWRM_TF_CTXT_MEM_FREE			UINT32_C(0x2e3)
1285 	/* Experimental */
1286 	#define HWRM_TF_CTXT_MEM_RGTR			UINT32_C(0x2e4)
1287 	/* Experimental */
1288 	#define HWRM_TF_CTXT_MEM_UNRGTR		UINT32_C(0x2e5)
1289 	/* Experimental */
1290 	#define HWRM_TF_EXT_EM_QCAPS			UINT32_C(0x2e6)
1291 	/* Experimental */
1292 	#define HWRM_TF_EXT_EM_OP			UINT32_C(0x2e7)
1293 	/* Experimental */
1294 	#define HWRM_TF_EXT_EM_CFG			UINT32_C(0x2e8)
1295 	/* Experimental */
1296 	#define HWRM_TF_EXT_EM_QCFG			UINT32_C(0x2e9)
1297 	/* Experimental */
1298 	#define HWRM_TF_EM_INSERT			UINT32_C(0x2ea)
1299 	/* Experimental */
1300 	#define HWRM_TF_EM_DELETE			UINT32_C(0x2eb)
1301 	/* Experimental */
1302 	#define HWRM_TF_EM_HASH_INSERT			UINT32_C(0x2ec)
1303 	/* Experimental */
1304 	#define HWRM_TF_EM_MOVE			UINT32_C(0x2ed)
1305 	/* Experimental */
1306 	#define HWRM_TF_TCAM_SET			UINT32_C(0x2f8)
1307 	/* Experimental */
1308 	#define HWRM_TF_TCAM_GET			UINT32_C(0x2f9)
1309 	/* Experimental */
1310 	#define HWRM_TF_TCAM_MOVE			UINT32_C(0x2fa)
1311 	/* Experimental */
1312 	#define HWRM_TF_TCAM_FREE			UINT32_C(0x2fb)
1313 	/* Experimental */
1314 	#define HWRM_TF_GLOBAL_CFG_SET			UINT32_C(0x2fc)
1315 	/* Experimental */
1316 	#define HWRM_TF_GLOBAL_CFG_GET			UINT32_C(0x2fd)
1317 	/* Experimental */
1318 	#define HWRM_TF_IF_TBL_SET			UINT32_C(0x2fe)
1319 	/* Experimental */
1320 	#define HWRM_TF_IF_TBL_GET			UINT32_C(0x2ff)
1321 	/* TruFlow command to check firmware table scope capabilities. */
1322 	#define HWRM_TFC_TBL_SCOPE_QCAPS		UINT32_C(0x380)
1323 	/* TruFlow command to allocate a table scope ID and create the pools. */
1324 	#define HWRM_TFC_TBL_SCOPE_ID_ALLOC		UINT32_C(0x381)
1325 	/* TruFlow command to configure the table scope memory. */
1326 	#define HWRM_TFC_TBL_SCOPE_CONFIG		UINT32_C(0x382)
1327 	/* TruFlow command to deconfigure a table scope memory. */
1328 	#define HWRM_TFC_TBL_SCOPE_DECONFIG		UINT32_C(0x383)
1329 	/* TruFlow command to add a FID to a table scope. */
1330 	#define HWRM_TFC_TBL_SCOPE_FID_ADD		UINT32_C(0x384)
1331 	/* TruFlow command to remove a FID from a table scope. */
1332 	#define HWRM_TFC_TBL_SCOPE_FID_REM		UINT32_C(0x385)
1333 	/* TruFlow command to allocate a table scope pool. */
1334 	#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC		UINT32_C(0x386)
1335 	/* TruFlow command to free a table scope pool. */
1336 	#define HWRM_TFC_TBL_SCOPE_POOL_FREE		UINT32_C(0x387)
1337 	/* Experimental */
1338 	#define HWRM_TFC_SESSION_ID_ALLOC		UINT32_C(0x388)
1339 	/* Experimental */
1340 	#define HWRM_TFC_SESSION_FID_ADD		UINT32_C(0x389)
1341 	/* Experimental */
1342 	#define HWRM_TFC_SESSION_FID_REM		UINT32_C(0x38a)
1343 	/* Experimental */
1344 	#define HWRM_TFC_IDENT_ALLOC			UINT32_C(0x38b)
1345 	/* Experimental */
1346 	#define HWRM_TFC_IDENT_FREE			UINT32_C(0x38c)
1347 	/* TruFlow command to allocate an index table entry */
1348 	#define HWRM_TFC_IDX_TBL_ALLOC			UINT32_C(0x38d)
1349 	/* TruFlow command to allocate and set an index table entry */
1350 	#define HWRM_TFC_IDX_TBL_ALLOC_SET		UINT32_C(0x38e)
1351 	/* TruFlow command to set an index table entry */
1352 	#define HWRM_TFC_IDX_TBL_SET			UINT32_C(0x38f)
1353 	/* TruFlow command to get an index table entry */
1354 	#define HWRM_TFC_IDX_TBL_GET			UINT32_C(0x390)
1355 	/* TruFlow command to free an index table entry */
1356 	#define HWRM_TFC_IDX_TBL_FREE			UINT32_C(0x391)
1357 	/* TruFlow command to allocate resources for a global id. */
1358 	#define HWRM_TFC_GLOBAL_ID_ALLOC		UINT32_C(0x392)
1359 	/* TruFlow command to set TCAM entry. */
1360 	#define HWRM_TFC_TCAM_SET			UINT32_C(0x393)
1361 	/* TruFlow command to get TCAM entry. */
1362 	#define HWRM_TFC_TCAM_GET			UINT32_C(0x394)
1363 	/* TruFlow command to allocate a TCAM entry. */
1364 	#define HWRM_TFC_TCAM_ALLOC			UINT32_C(0x395)
1365 	/* TruFlow command allocate and set TCAM entry. */
1366 	#define HWRM_TFC_TCAM_ALLOC_SET		UINT32_C(0x396)
1367 	/* TruFlow command to free a TCAM entry. */
1368 	#define HWRM_TFC_TCAM_FREE			UINT32_C(0x397)
1369 	/* Experimental */
1370 	#define HWRM_SV				UINT32_C(0x400)
1371 	/* Experimental */
1372 	#define HWRM_DBG_READ_DIRECT			UINT32_C(0xff10)
1373 	/* Experimental */
1374 	#define HWRM_DBG_READ_INDIRECT			UINT32_C(0xff11)
1375 	/* Experimental */
1376 	#define HWRM_DBG_WRITE_DIRECT			UINT32_C(0xff12)
1377 	/* Experimental */
1378 	#define HWRM_DBG_WRITE_INDIRECT		UINT32_C(0xff13)
1379 	#define HWRM_DBG_DUMP				UINT32_C(0xff14)
1380 	/* Experimental */
1381 	#define HWRM_DBG_ERASE_NVM			UINT32_C(0xff15)
1382 	/* Experimental */
1383 	#define HWRM_DBG_CFG				UINT32_C(0xff16)
1384 	/* Experimental */
1385 	#define HWRM_DBG_COREDUMP_LIST			UINT32_C(0xff17)
1386 	/* Experimental */
1387 	#define HWRM_DBG_COREDUMP_INITIATE		UINT32_C(0xff18)
1388 	/* Experimental */
1389 	#define HWRM_DBG_COREDUMP_RETRIEVE		UINT32_C(0xff19)
1390 	/* Experimental */
1391 	#define HWRM_DBG_FW_CLI			UINT32_C(0xff1a)
1392 	/*  */
1393 	#define HWRM_DBG_I2C_CMD			UINT32_C(0xff1b)
1394 	/*  */
1395 	#define HWRM_DBG_RING_INFO_GET			UINT32_C(0xff1c)
1396 	/* Experimental */
1397 	#define HWRM_DBG_CRASHDUMP_HEADER		UINT32_C(0xff1d)
1398 	/* Experimental */
1399 	#define HWRM_DBG_CRASHDUMP_ERASE		UINT32_C(0xff1e)
1400 	/* Send driver debug information to firmware */
1401 	#define HWRM_DBG_DRV_TRACE			UINT32_C(0xff1f)
1402 	/* Query debug capabilities of firmware */
1403 	#define HWRM_DBG_QCAPS				UINT32_C(0xff20)
1404 	/* Retrieve debug settings of firmware */
1405 	#define HWRM_DBG_QCFG				UINT32_C(0xff21)
1406 	/* Set destination parameters for crashdump medium */
1407 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG		UINT32_C(0xff22)
1408 	/* Experimental */
1409 	#define HWRM_DBG_USEQ_ALLOC			UINT32_C(0xff23)
1410 	/* Experimental */
1411 	#define HWRM_DBG_USEQ_FREE			UINT32_C(0xff24)
1412 	/* Experimental */
1413 	#define HWRM_DBG_USEQ_FLUSH			UINT32_C(0xff25)
1414 	/* Experimental */
1415 	#define HWRM_DBG_USEQ_QCAPS			UINT32_C(0xff26)
1416 	/* Experimental */
1417 	#define HWRM_DBG_USEQ_CW_CFG			UINT32_C(0xff27)
1418 	/* Experimental */
1419 	#define HWRM_DBG_USEQ_SCHED_CFG		UINT32_C(0xff28)
1420 	/* Experimental */
1421 	#define HWRM_DBG_USEQ_RUN			UINT32_C(0xff29)
1422 	/* Experimental */
1423 	#define HWRM_DBG_USEQ_DELIVERY_REQ		UINT32_C(0xff2a)
1424 	/* Experimental */
1425 	#define HWRM_DBG_USEQ_RESP_HDR			UINT32_C(0xff2b)
1426 	#define HWRM_NVM_DEFRAG			UINT32_C(0xffec)
1427 	#define HWRM_NVM_REQ_ARBITRATION		UINT32_C(0xffed)
1428 	/* Experimental */
1429 	#define HWRM_NVM_FACTORY_DEFAULTS		UINT32_C(0xffee)
1430 	#define HWRM_NVM_VALIDATE_OPTION		UINT32_C(0xffef)
1431 	#define HWRM_NVM_FLUSH				UINT32_C(0xfff0)
1432 	#define HWRM_NVM_GET_VARIABLE			UINT32_C(0xfff1)
1433 	#define HWRM_NVM_SET_VARIABLE			UINT32_C(0xfff2)
1434 	#define HWRM_NVM_INSTALL_UPDATE		UINT32_C(0xfff3)
1435 	#define HWRM_NVM_MODIFY			UINT32_C(0xfff4)
1436 	#define HWRM_NVM_VERIFY_UPDATE			UINT32_C(0xfff5)
1437 	#define HWRM_NVM_GET_DEV_INFO			UINT32_C(0xfff6)
1438 	#define HWRM_NVM_ERASE_DIR_ENTRY		UINT32_C(0xfff7)
1439 	#define HWRM_NVM_MOD_DIR_ENTRY			UINT32_C(0xfff8)
1440 	#define HWRM_NVM_FIND_DIR_ENTRY		UINT32_C(0xfff9)
1441 	#define HWRM_NVM_GET_DIR_ENTRIES		UINT32_C(0xfffa)
1442 	#define HWRM_NVM_GET_DIR_INFO			UINT32_C(0xfffb)
1443 	#define HWRM_NVM_RAW_DUMP			UINT32_C(0xfffc)
1444 	#define HWRM_NVM_READ				UINT32_C(0xfffd)
1445 	#define HWRM_NVM_WRITE				UINT32_C(0xfffe)
1446 	#define HWRM_NVM_RAW_WRITE_BLK			UINT32_C(0xffff)
1447 	#define HWRM_LAST				HWRM_NVM_RAW_WRITE_BLK
1448 	uint16_t	unused_0[3];
1449 } cmd_nums_t, *pcmd_nums_t;
1450 
1451 /* Return Codes */
1452 /* ret_codes (size:64b/8B) */
1453 
1454 typedef struct ret_codes {
1455 	uint16_t	error_code;
1456 	/* Request was successfully executed by the HWRM. */
1457 	#define HWRM_ERR_CODE_SUCCESS			UINT32_C(0x0)
1458 	/* The HWRM failed to execute the request. */
1459 	#define HWRM_ERR_CODE_FAIL			UINT32_C(0x1)
1460 	/*
1461 	 * The request contains invalid argument(s) or input
1462 	 * parameters.
1463 	 */
1464 	#define HWRM_ERR_CODE_INVALID_PARAMS		UINT32_C(0x2)
1465 	/*
1466 	 * The requester is not allowed to access the requested
1467 	 * resource. This error code shall be provided in a
1468 	 * response to a request to query or modify an existing
1469 	 * resource that is not accessible by the requester.
1470 	 */
1471 	#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED	UINT32_C(0x3)
1472 	/*
1473 	 * The HWRM is unable to allocate the requested resource.
1474 	 * This code only applies to requests for HWRM resource
1475 	 * allocations.
1476 	 */
1477 	#define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR	UINT32_C(0x4)
1478 	/*
1479 	 * Invalid combination of flags is specified in the
1480 	 * request.
1481 	 */
1482 	#define HWRM_ERR_CODE_INVALID_FLAGS		UINT32_C(0x5)
1483 	/*
1484 	 * Invalid combination of enables fields is specified in
1485 	 * the request.
1486 	 */
1487 	#define HWRM_ERR_CODE_INVALID_ENABLES		UINT32_C(0x6)
1488 	/*
1489 	 * Request contains a required TLV that is not supported by
1490 	 * the installed version of firmware.
1491 	 */
1492 	#define HWRM_ERR_CODE_UNSUPPORTED_TLV		UINT32_C(0x7)
1493 	/*
1494 	 * No firmware buffer available to accept the request. Driver
1495 	 * should retry the request.
1496 	 */
1497 	#define HWRM_ERR_CODE_NO_BUFFER			UINT32_C(0x8)
1498 	/*
1499 	 * This error code is only reported by firmware when some
1500 	 * sub-option of a supported HWRM command is unsupported.
1501 	 */
1502 	#define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR	UINT32_C(0x9)
1503 	/*
1504 	 * This error code is only reported by firmware when the specific
1505 	 * request is not able to process when the HOT reset in progress.
1506 	 */
1507 	#define HWRM_ERR_CODE_HOT_RESET_PROGRESS	UINT32_C(0xa)
1508 	/*
1509 	 * This error code is only reported by firmware when the registered
1510 	 * driver instances are not capable of hot reset.
1511 	 */
1512 	#define HWRM_ERR_CODE_HOT_RESET_FAIL		UINT32_C(0xb)
1513 	/*
1514 	 * This error code is only reported by the firmware when during
1515 	 * flow allocation when a request for a flow counter fails because
1516 	 * the number of flow counters are exhausted.
1517 	 */
1518 	#define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
1519 	/*
1520 	 * This error code is only reported by firmware when the registered
1521 	 * driver instances requested to offloaded a flow but was unable to because
1522 	 * the requested key's hash collides with the installed keys.
1523 	 */
1524 	#define HWRM_ERR_CODE_KEY_HASH_COLLISION	UINT32_C(0xd)
1525 	/*
1526 	 * This error code is only reported by firmware when the registered
1527 	 * driver instances requested to offloaded a flow but was unable to because
1528 	 * the same key has already been installed.
1529 	 */
1530 	#define HWRM_ERR_CODE_KEY_ALREADY_EXISTS	UINT32_C(0xe)
1531 	/*
1532 	 * Generic HWRM execution error that represents an
1533 	 * internal error.
1534 	 */
1535 	#define HWRM_ERR_CODE_HWRM_ERROR		UINT32_C(0xf)
1536 	/*
1537 	 * Firmware is unable to service the request at the present time. Caller
1538 	 * may try again later.
1539 	 */
1540 	#define HWRM_ERR_CODE_BUSY			UINT32_C(0x10)
1541 	/*
1542 	 * This error code is reported by Firmware when an operation requested
1543 	 * by the host is not allowed due to a secure lock violation.
1544 	 */
1545 	#define HWRM_ERR_CODE_RESOURCE_LOCKED		UINT32_C(0x11)
1546 	/*
1547 	 * This error code is reported by Firmware when an operation requested
1548 	 * by a VF cannot be forwarded to the parent PF as required, either
1549 	 * because the PF is down or otherwise doesn't have an appropriate
1550 	 * async completion ring or associated forwarding buffers configured.
1551 	 */
1552 	#define HWRM_ERR_CODE_PF_UNAVAILABLE		UINT32_C(0x12)
1553 	/*
1554 	 * This value indicates that the HWRM response is in TLV format and
1555 	 * should be interpreted as one or more TLVs starting with the
1556 	 * hwrm_resp_hdr TLV. This value is not an indication of any error
1557 	 * by itself, just an indication that the response should be parsed
1558 	 * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
1559 	 */
1560 	#define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE	UINT32_C(0x8000)
1561 	/* Unknown error */
1562 	#define HWRM_ERR_CODE_UNKNOWN_ERR		UINT32_C(0xfffe)
1563 	/* Unsupported or invalid command */
1564 	#define HWRM_ERR_CODE_CMD_NOT_SUPPORTED		UINT32_C(0xffff)
1565 	#define HWRM_ERR_CODE_LAST			HWRM_ERR_CODE_CMD_NOT_SUPPORTED
1566 	uint16_t	unused_0[3];
1567 } ret_codes_t, *pret_codes_t;
1568 
1569 #define GET_HWRM_ERROR_CODE(x) \
1570 	(((x) < 0x80) ? \
1571 	((x) == 0x0 ? "SUCCESS": \
1572 	((x) == 0x1 ? "FAIL": \
1573 	((x) == 0x2 ? "INVALID_PARAMS": \
1574 	((x) == 0x3 ? "RESOURCE_ACCESS_DENIED": \
1575 	((x) == 0x4 ? "RESOURCE_ALLOC_ERROR": \
1576 	((x) == 0x5 ? "INVALID_FLAGS": \
1577 	((x) == 0x6 ? "INVALID_ENABLES": \
1578 	((x) == 0x7 ? "UNSUPPORTED_TLV": \
1579 	((x) == 0x8 ? "NO_BUFFER": \
1580 	((x) == 0x9 ? "UNSUPPORTED_OPTION_ERR": \
1581 	((x) == 0xa ? "HOT_RESET_PROGRESS": \
1582 	((x) == 0xb ? "HOT_RESET_FAIL": \
1583 	((x) == 0xc ? "NO_FLOW_COUNTER_DURING_ALLOC": \
1584 	((x) == 0xd ? "KEY_HASH_COLLISION": \
1585 	((x) == 0xe ? "KEY_ALREADY_EXISTS": \
1586 	((x) == 0xf ? "HWRM_ERROR": \
1587 	((x) == 0x10 ? "BUSY": \
1588 	((x) == 0x11 ? "RESOURCE_LOCKED": \
1589 	((x) == 0x12 ? "PF_UNAVAILABLE": \
1590 	"Unknown decode" ))))))))))))))))))) : \
1591 	(((x) < 0x8080) ? \
1592 	((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \
1593 	"Unknown decode" ) : \
1594 	(((x) <= 0xffff) ? \
1595 	((x) == 0xfffe ? "UNKNOWN_ERR": \
1596 	((x) == 0xffff ? "CMD_NOT_SUPPORTED": \
1597 	"Unknown decode" )) : \
1598 	"Unknown decode" )))
1599 
1600 
1601 /* Output */
1602 /* hwrm_err_output (size:128b/16B) */
1603 
1604 typedef struct hwrm_err_output {
1605 	/*
1606 	 * Pass/Fail or error type
1607 	 *
1608 	 * Note: receiver to verify the in parameters, and fail the call
1609 	 * with an error when appropriate
1610 	 */
1611 	uint16_t	error_code;
1612 	/* This field returns the type of original request. */
1613 	uint16_t	req_type;
1614 	/* This field provides original sequence number of the command. */
1615 	uint16_t	seq_id;
1616 	/*
1617 	 * This field is the length of the response in bytes.  The
1618 	 * last byte of the response is a valid flag that will read
1619 	 * as '1' when the command has been completely written to
1620 	 * memory.
1621 	 */
1622 	uint16_t	resp_len;
1623 	/* debug info for this error response. */
1624 	uint32_t	opaque_0;
1625 	/* debug info for this error response. */
1626 	uint16_t	opaque_1;
1627 	/*
1628 	 * In the case of an error response, command specific error
1629 	 * code is returned in this field.
1630 	 */
1631 	uint8_t	cmd_err;
1632 	/*
1633 	 * This field is used in Output records to indicate that the output
1634 	 * is completely written to RAM.  This field should be read as '1'
1635 	 * to indicate that the output has been completely written.
1636 	 * When writing a command completion or response to an internal processor,
1637 	 * the order of writes has to be such that this field is written last.
1638 	 */
1639 	uint8_t	valid;
1640 } hwrm_err_output_t, *phwrm_err_output_t;
1641 
1642 /*
1643  * Following is the signature for HWRM message field that indicates not
1644  * applicable (All F's). Need to cast it the size of the field if needed.
1645  */
1646 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
1647 /* hwrm_func_buf_rgtr */
1648 #define HWRM_MAX_REQ_LEN 128
1649 /* hwrm_cfa_flow_info */
1650 #define HWRM_MAX_RESP_LEN 704
1651 /* 7 bit indirection table index. */
1652 #define HW_HASH_INDEX_SIZE 0x80
1653 #define HW_HASH_KEY_SIZE 40
1654 /* valid key for HWRM response */
1655 #define HWRM_RESP_VALID_KEY 1
1656 /* Reserved for BONO processor */
1657 #define HWRM_TARGET_ID_BONO 0xFFF8
1658 /* Reserved for KONG processor */
1659 #define HWRM_TARGET_ID_KONG 0xFFF9
1660 /* Reserved for APE processor */
1661 #define HWRM_TARGET_ID_APE 0xFFFA
1662 /*
1663  * This value will be used by tools for User-space HWRM Interface.
1664  * When tool execute any HWRM command with this target_id, firmware
1665  * will copy the response and/or data payload via register space instead
1666  * of DMAing it.
1667  */
1668 #define HWRM_TARGET_ID_TOOLS 0xFFFD
1669 #define HWRM_VERSION_MAJOR 1
1670 #define HWRM_VERSION_MINOR 10
1671 #define HWRM_VERSION_UPDATE 2
1672 /* non-zero means beta version */
1673 #define HWRM_VERSION_RSVD 136
1674 #define HWRM_VERSION_STR "1.10.2.136"
1675 
1676 /****************
1677  * hwrm_ver_get *
1678  ****************/
1679 
1680 
1681 /* hwrm_ver_get_input (size:192b/24B) */
1682 
1683 typedef struct hwrm_ver_get_input {
1684 	/* The HWRM command request type. */
1685 	uint16_t	req_type;
1686 	/*
1687 	 * The completion ring to send the completion event on. This should
1688 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
1689 	 */
1690 	uint16_t	cmpl_ring;
1691 	/*
1692 	 * The sequence ID is used by the driver for tracking multiple
1693 	 * commands. This ID is treated as opaque data by the firmware and
1694 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
1695 	 */
1696 	uint16_t	seq_id;
1697 	/*
1698 	 * The target ID of the command:
1699 	 * * 0x0-0xFFF8 - The function ID
1700 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
1701 	 * * 0xFFFD - Reserved for user-space HWRM interface
1702 	 * * 0xFFFF - HWRM
1703 	 */
1704 	uint16_t	target_id;
1705 	/*
1706 	 * A physical address pointer pointing to a host buffer that the
1707 	 * command's response data will be written. This can be either a host
1708 	 * physical address (HPA) or a guest physical address (GPA) and must
1709 	 * point to a physically contiguous block of memory.
1710 	 */
1711 	uint64_t	resp_addr;
1712 	/*
1713 	 * This field represents the major version of HWRM interface
1714 	 * specification supported by the driver HWRM implementation.
1715 	 * The interface major version is intended to change only when
1716 	 * non backward compatible changes are made to the HWRM
1717 	 * interface specification.
1718 	 */
1719 	uint8_t	hwrm_intf_maj;
1720 	/*
1721 	 * This field represents the minor version of HWRM interface
1722 	 * specification supported by the driver HWRM implementation.
1723 	 * A change in interface minor version is used to reflect
1724 	 * significant backward compatible modification to HWRM
1725 	 * interface specification.
1726 	 * This can be due to addition or removal of functionality.
1727 	 * HWRM interface specifications with the same major version
1728 	 * but different minor versions are compatible.
1729 	 */
1730 	uint8_t	hwrm_intf_min;
1731 	/*
1732 	 * This field represents the update version of HWRM interface
1733 	 * specification supported by the driver HWRM implementation.
1734 	 * The interface update version is used to reflect minor
1735 	 * changes or bug fixes to a released HWRM interface
1736 	 * specification.
1737 	 */
1738 	uint8_t	hwrm_intf_upd;
1739 	uint8_t	unused_0[5];
1740 } hwrm_ver_get_input_t, *phwrm_ver_get_input_t;
1741 
1742 /* hwrm_ver_get_output (size:1408b/176B) */
1743 
1744 typedef struct hwrm_ver_get_output {
1745 	/* The specific error status for the command. */
1746 	uint16_t	error_code;
1747 	/* The HWRM command request type. */
1748 	uint16_t	req_type;
1749 	/* The sequence ID from the original command. */
1750 	uint16_t	seq_id;
1751 	/* The length of the response data in number of bytes. */
1752 	uint16_t	resp_len;
1753 	/*
1754 	 * This field represents the major version of HWRM interface
1755 	 * specification supported by the HWRM implementation.
1756 	 * The interface major version is intended to change only when
1757 	 * non backward compatible changes are made to the HWRM
1758 	 * interface specification.
1759 	 * A HWRM implementation that is compliant with this
1760 	 * specification shall provide value of 1 in this field.
1761 	 */
1762 	uint8_t	hwrm_intf_maj_8b;
1763 	/*
1764 	 * This field represents the minor version of HWRM interface
1765 	 * specification supported by the HWRM implementation.
1766 	 * A change in interface minor version is used to reflect
1767 	 * significant backward compatible modification to HWRM
1768 	 * interface specification.
1769 	 * This can be due to addition or removal of functionality.
1770 	 * HWRM interface specifications with the same major version
1771 	 * but different minor versions are compatible.
1772 	 * A HWRM implementation that is compliant with this
1773 	 * specification shall provide value of 2 in this field.
1774 	 */
1775 	uint8_t	hwrm_intf_min_8b;
1776 	/*
1777 	 * This field represents the update version of HWRM interface
1778 	 * specification supported by the HWRM implementation.
1779 	 * The interface update version is used to reflect minor
1780 	 * changes or bug fixes to a released HWRM interface
1781 	 * specification.
1782 	 * A HWRM implementation that is compliant with this
1783 	 * specification shall provide value of 2 in this field.
1784 	 */
1785 	uint8_t	hwrm_intf_upd_8b;
1786 	uint8_t	hwrm_intf_rsvd_8b;
1787 	/*
1788 	 * This field represents the major version of HWRM firmware.
1789 	 * A change in firmware major version represents a major
1790 	 * firmware release.
1791 	 */
1792 	uint8_t	hwrm_fw_maj_8b;
1793 	/*
1794 	 * This field represents the minor version of HWRM firmware.
1795 	 * A change in firmware minor version represents significant
1796 	 * firmware functionality changes.
1797 	 */
1798 	uint8_t	hwrm_fw_min_8b;
1799 	/*
1800 	 * This field represents the build version of HWRM firmware.
1801 	 * A change in firmware build version represents bug fixes
1802 	 * to a released firmware.
1803 	 */
1804 	uint8_t	hwrm_fw_bld_8b;
1805 	/*
1806 	 * This field is a reserved field. This field can be used to
1807 	 * represent firmware branches or customer specific releases
1808 	 * tied to a specific (major,minor,update) version of the
1809 	 * HWRM firmware.
1810 	 */
1811 	uint8_t	hwrm_fw_rsvd_8b;
1812 	/*
1813 	 * This field represents the major version of mgmt firmware.
1814 	 * A change in major version represents a major release.
1815 	 */
1816 	uint8_t	mgmt_fw_maj_8b;
1817 	/*
1818 	 * This field represents the minor version of mgmt firmware.
1819 	 * A change in minor version represents significant
1820 	 * functionality changes.
1821 	 */
1822 	uint8_t	mgmt_fw_min_8b;
1823 	/*
1824 	 * This field represents the build version of mgmt firmware.
1825 	 * A change in update version represents bug fixes.
1826 	 */
1827 	uint8_t	mgmt_fw_bld_8b;
1828 	/*
1829 	 * This field is a reserved field. This field can be used to
1830 	 * represent firmware branches or customer specific releases
1831 	 * tied to a specific (major,minor,update) version
1832 	 */
1833 	uint8_t	mgmt_fw_rsvd_8b;
1834 	/*
1835 	 * This field represents the major version of network
1836 	 * control firmware.
1837 	 * A change in major version represents a major release.
1838 	 */
1839 	uint8_t	netctrl_fw_maj_8b;
1840 	/*
1841 	 * This field represents the minor version of network
1842 	 * control firmware.
1843 	 * A change in minor version represents significant
1844 	 * functionality changes.
1845 	 */
1846 	uint8_t	netctrl_fw_min_8b;
1847 	/*
1848 	 * This field represents the build version of network
1849 	 * control firmware.
1850 	 * A change in update version represents bug fixes.
1851 	 */
1852 	uint8_t	netctrl_fw_bld_8b;
1853 	/*
1854 	 * This field is a reserved field. This field can be used to
1855 	 * represent firmware branches or customer specific releases
1856 	 * tied to a specific (major,minor,update) version
1857 	 */
1858 	uint8_t	netctrl_fw_rsvd_8b;
1859 	/*
1860 	 * This field is used to indicate device's capabilities and
1861 	 * configurations.
1862 	 */
1863 	uint32_t	dev_caps_cfg;
1864 	/*
1865 	 * If set to 1, then secure firmware update behavior
1866 	 * is supported.
1867 	 * If set to 0, then secure firmware update behavior is
1868 	 * not supported.
1869 	 */
1870 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED		UINT32_C(0x1)
1871 	/*
1872 	 * If set to 1, then firmware based DCBX agent is supported.
1873 	 * If set to 0, then firmware based DCBX agent capability
1874 	 * is not supported on this device.
1875 	 */
1876 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED		UINT32_C(0x2)
1877 	/*
1878 	 * If set to 1, then HWRM short command format is supported.
1879 	 * If set to 0, then HWRM short command format is not supported.
1880 	 */
1881 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED			UINT32_C(0x4)
1882 	/*
1883 	 * If set to 1, then HWRM short command format is required.
1884 	 * If set to 0, then HWRM short command format is not required.
1885 	 */
1886 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED			UINT32_C(0x8)
1887 	/*
1888 	 * If set to 1, then the KONG host mailbox channel is supported.
1889 	 * If set to 0, then the KONG host mailbox channel is not supported.
1890 	 * By default, this flag should be 0 for older version of core firmware.
1891 	 */
1892 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED		UINT32_C(0x10)
1893 	/*
1894 	 * If set to 1, then the 64bit flow handle is supported in addition to the
1895 	 * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1896 	 * supported. By default, this flag should be 0 for older version of core firmware.
1897 	 */
1898 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED		UINT32_C(0x20)
1899 	/*
1900 	 * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1901 	 * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1902 	 * If set to 0, then filter types not supported.
1903 	 * By default, this flag should be 0 for older version of core firmware.
1904 	 */
1905 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED	UINT32_C(0x40)
1906 	/*
1907 	 * If set to 1, firmware is capable to support virtio vSwitch offload model.
1908 	 * If set to 0, firmware can't supported virtio vSwitch offload model.
1909 	 * By default, this flag should be 0 for older version of core firmware.
1910 	 */
1911 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED	UINT32_C(0x80)
1912 	/*
1913 	 * If set to 1, firmware is capable to support trusted VF.
1914 	 * If set to 0, firmware is not capable to support trusted VF.
1915 	 * By default, this flag should be 0 for older version of core firmware.
1916 	 */
1917 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED			UINT32_C(0x100)
1918 	/*
1919 	 * If set to 1, firmware is capable to support flow aging.
1920 	 * If set to 0, firmware is not capable to support flow aging.
1921 	 * By default, this flag should be 0 for older version of core firmware.
1922 	 * (deprecated)
1923 	 */
1924 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED			UINT32_C(0x200)
1925 	/*
1926 	 * If set to 1, firmware is capable to support advanced flow counters like,
1927 	 * Meter drop counters and EEM counters.
1928 	 * If set to 0, firmware is not capable to support advanced flow counters.
1929 	 * By default, this flag should be 0 for older version of core firmware.
1930 	 * (deprecated)
1931 	 */
1932 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED		UINT32_C(0x400)
1933 	/*
1934 	 * If set to 1, the firmware is able to support the use of the CFA
1935 	 * Extended Exact Match(EEM) feature.
1936 	 * If set to 0, firmware is not capable to support the use of the
1937 	 * CFA EEM feature.
1938 	 * By default, this flag should be 0 for older version of core firmware.
1939 	 * (deprecated)
1940 	 */
1941 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED			UINT32_C(0x800)
1942 	/*
1943 	 * If set to 1, the firmware is able to support advance CFA flow management
1944 	 * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1945 	 * If set to 0, then the firmware doesn’t support the advance CFA flow management
1946 	 * features.
1947 	 * By default, this flag should be 0 for older version of core firmware.
1948 	 */
1949 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED		UINT32_C(0x1000)
1950 	/*
1951 	 * Deprecated and replaced with cfa_truflow_supported.
1952 	 * If set to 1, the firmware is able to support TFLIB features.
1953 	 * If set to 0, then the firmware doesn’t support TFLIB features.
1954 	 * By default, this flag should be 0 for older version of core firmware.
1955 	 */
1956 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED			UINT32_C(0x2000)
1957 	/*
1958 	 * If set to 1, the firmware is able to support TruFlow features.
1959 	 * If set to 0, then the firmware doesn’t support TruFlow features.
1960 	 * By default, this flag should be 0 for older version of
1961 	 * core firmware.
1962 	 */
1963 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED			UINT32_C(0x4000)
1964 	/*
1965 	 * If set to 1, then firmware supports secure boot.
1966 	 * If set to 0, then firmware doesn't support secure boot.
1967 	 */
1968 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE			UINT32_C(0x8000)
1969 	/*
1970 	 * This field represents the major version of RoCE firmware.
1971 	 * A change in major version represents a major release.
1972 	 */
1973 	uint8_t	roce_fw_maj_8b;
1974 	/*
1975 	 * This field represents the minor version of RoCE firmware.
1976 	 * A change in minor version represents significant
1977 	 * functionality changes.
1978 	 */
1979 	uint8_t	roce_fw_min_8b;
1980 	/*
1981 	 * This field represents the build version of RoCE firmware.
1982 	 * A change in update version represents bug fixes.
1983 	 */
1984 	uint8_t	roce_fw_bld_8b;
1985 	/*
1986 	 * This field is a reserved field. This field can be used to
1987 	 * represent firmware branches or customer specific releases
1988 	 * tied to a specific (major,minor,update) version
1989 	 */
1990 	uint8_t	roce_fw_rsvd_8b;
1991 	/*
1992 	 * This field represents the name of HWRM FW (ASCII chars
1993 	 * with NULL at the end).
1994 	 */
1995 	char	hwrm_fw_name[16];
1996 	/*
1997 	 * This field represents the name of mgmt FW (ASCII chars
1998 	 * with NULL at the end).
1999 	 */
2000 	char	mgmt_fw_name[16];
2001 	/*
2002 	 * This field represents the name of network control
2003 	 * firmware (ASCII chars with NULL at the end).
2004 	 */
2005 	char	netctrl_fw_name[16];
2006 	/* This field represents the active board package name. */
2007 	char	active_pkg_name[16];
2008 	/*
2009 	 * This field represents the name of RoCE FW (ASCII chars
2010 	 * with NULL at the end).
2011 	 */
2012 	char	roce_fw_name[16];
2013 	/* This field returns the chip number. */
2014 	uint16_t	chip_num;
2015 	/* This field returns the revision of chip. */
2016 	uint8_t	chip_rev;
2017 	/* This field returns the chip metal number. */
2018 	uint8_t	chip_metal;
2019 	/* This field returns the bond id of the chip. */
2020 	uint8_t	chip_bond_id;
2021 	/* This value indicates the type of platform used for chip implementation. */
2022 	uint8_t	chip_platform_type;
2023 	/* ASIC */
2024 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC	UINT32_C(0x0)
2025 	/* FPGA platform of the chip. */
2026 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA	UINT32_C(0x1)
2027 	/* Palladium platform of the chip. */
2028 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
2029 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST	HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
2030 	/*
2031 	 * This field returns the maximum value of request window that
2032 	 * is supported by the HWRM. The request window is mapped
2033 	 * into device address space using MMIO.
2034 	 */
2035 	uint16_t	max_req_win_len;
2036 	/*
2037 	 * This field returns the maximum value of response buffer in
2038 	 * bytes.
2039 	 */
2040 	uint16_t	max_resp_len;
2041 	/*
2042 	 * This field returns the default request timeout value in
2043 	 * milliseconds.
2044 	 */
2045 	uint16_t	def_req_timeout;
2046 	/*
2047 	 * This field will indicate if any subsystems is not fully
2048 	 * initialized.
2049 	 */
2050 	uint8_t	flags;
2051 	/*
2052 	 * If set to 1, it will indicate to host drivers that firmware is
2053 	 * not ready to start full blown HWRM commands. Host drivers should
2054 	 * re-try HWRM_VER_GET with some timeout period. The timeout period
2055 	 * can be selected up to 5 seconds. Host drivers should also check
2056 	 * for dev_not_rdy_backing_store to identify if flag is set due to
2057 	 * backing store not been available.
2058 	 * For Example, PCIe hot-plug:
2059 	 *	Hot plug timing is system dependent. It generally takes up to
2060 	 *	600 milliseconds for firmware to clear DEV_NOT_RDY flag.
2061 	 * If set to 0, device is ready to accept all HWRM commands.
2062 	 */
2063 	#define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY		UINT32_C(0x1)
2064 	/*
2065 	 * If set to 1, external version present.
2066 	 * If set to 0, external version not present.
2067 	 */
2068 	#define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL		UINT32_C(0x2)
2069 	/*
2070 	 * Firmware sets this flag along with dev_not_rdy flag to indicate
2071 	 * host drivers that it has not completed resource initialization
2072 	 * required for data path operations. Host drivers should not send
2073 	 * any HWRM command that requires data path resources. Firmware will
2074 	 * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can retry
2075 	 * those commands once both the flags are cleared.
2076 	 * If this flag and dev_not_rdy flag are set to 0, device is ready
2077 	 * to accept all HWRM commands.
2078 	 */
2079 	#define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY_BACKING_STORE	UINT32_C(0x4)
2080 	uint8_t	unused_0[2];
2081 	/*
2082 	 * For backward compatibility this field must be set to 1.
2083 	 * Older drivers might look for this field to be 1 before
2084 	 * processing the message.
2085 	 */
2086 	uint8_t	always_1;
2087 	/*
2088 	 * This field represents the major version of HWRM interface
2089 	 * specification supported by the HWRM implementation.
2090 	 * The interface major version is intended to change only when
2091 	 * non backward compatible changes are made to the HWRM
2092 	 * interface specification. A HWRM implementation that is
2093 	 * compliant with this specification shall provide value of 1
2094 	 * in this field.
2095 	 */
2096 	uint16_t	hwrm_intf_major;
2097 	/*
2098 	 * This field represents the minor version of HWRM interface
2099 	 * specification supported by the HWRM implementation.
2100 	 * A change in interface minor version is used to reflect
2101 	 * significant backward compatible modification to HWRM
2102 	 * interface specification. This can be due to addition or
2103 	 * removal of functionality. HWRM interface specifications
2104 	 * with the same major version but different minor versions are
2105 	 * compatible. A HWRM implementation that is compliant with
2106 	 * this specification shall provide value of 2 in this field.
2107 	 */
2108 	uint16_t	hwrm_intf_minor;
2109 	/*
2110 	 * This field represents the update version of HWRM interface
2111 	 * specification supported by the HWRM implementation. The
2112 	 * interface update version is used to reflect minor changes or
2113 	 * bug fixes to a released HWRM interface specification.
2114 	 * A HWRM implementation that is compliant with this
2115 	 * specification shall provide value of 2 in this field.
2116 	 */
2117 	uint16_t	hwrm_intf_build;
2118 	/*
2119 	 * This field represents the patch version of HWRM interface
2120 	 * specification supported by the HWRM implementation.
2121 	 */
2122 	uint16_t	hwrm_intf_patch;
2123 	/*
2124 	 * This field represents the major version of HWRM firmware.
2125 	 * A change in firmware major version represents a major
2126 	 * firmware release.
2127 	 */
2128 	uint16_t	hwrm_fw_major;
2129 	/*
2130 	 * This field represents the minor version of HWRM firmware.
2131 	 * A change in firmware minor version represents significant
2132 	 * firmware functionality changes.
2133 	 */
2134 	uint16_t	hwrm_fw_minor;
2135 	/*
2136 	 * This field represents the build version of HWRM firmware.
2137 	 * A change in firmware build version represents bug fixes to
2138 	 * a released firmware.
2139 	 */
2140 	uint16_t	hwrm_fw_build;
2141 	/*
2142 	 * This field is a reserved field.
2143 	 * This field can be used to represent firmware branches or customer
2144 	 * specific releases tied to a specific (major,minor,update) version
2145 	 * of the HWRM firmware.
2146 	 */
2147 	uint16_t	hwrm_fw_patch;
2148 	/*
2149 	 * This field represents the major version of mgmt firmware.
2150 	 * A change in major version represents a major release.
2151 	 */
2152 	uint16_t	mgmt_fw_major;
2153 	/*
2154 	 * This field represents the minor version of HWRM firmware.
2155 	 * A change in firmware minor version represents significant
2156 	 * firmware functionality changes.
2157 	 */
2158 	uint16_t	mgmt_fw_minor;
2159 	/*
2160 	 * This field represents the build version of mgmt firmware.
2161 	 * A change in update version represents bug fixes.
2162 	 */
2163 	uint16_t	mgmt_fw_build;
2164 	/*
2165 	 * This field is a reserved field. This field can be used to
2166 	 * represent firmware branches or customer specific releases
2167 	 * tied to a specific (major,minor,update) version.
2168 	 */
2169 	uint16_t	mgmt_fw_patch;
2170 	/*
2171 	 * This field represents the major version of network control
2172 	 * firmware. A change in major version represents
2173 	 * a major release.
2174 	 */
2175 	uint16_t	netctrl_fw_major;
2176 	/*
2177 	 * This field represents the minor version of network control
2178 	 * firmware. A change in minor version represents significant
2179 	 * functionality changes.
2180 	 */
2181 	uint16_t	netctrl_fw_minor;
2182 	/*
2183 	 * This field represents the build version of network control
2184 	 * firmware. A change in update version represents bug fixes.
2185 	 */
2186 	uint16_t	netctrl_fw_build;
2187 	/*
2188 	 * This field is a reserved field. This field can be used to
2189 	 * represent firmware branches or customer specific releases
2190 	 * tied to a specific (major,minor,update) version
2191 	 */
2192 	uint16_t	netctrl_fw_patch;
2193 	/*
2194 	 * This field represents the major version of RoCE firmware.
2195 	 * A change in major version represents a major release.
2196 	 */
2197 	uint16_t	roce_fw_major;
2198 	/*
2199 	 * This field represents the minor version of RoCE firmware.
2200 	 * A change in minor version represents significant
2201 	 * functionality changes.
2202 	 */
2203 	uint16_t	roce_fw_minor;
2204 	/*
2205 	 * This field represents the build version of RoCE firmware.
2206 	 * A change in update version represents bug fixes.
2207 	 */
2208 	uint16_t	roce_fw_build;
2209 	/*
2210 	 * This field is a reserved field. This field can be used to
2211 	 * represent firmware branches or customer specific releases
2212 	 * tied to a specific (major,minor,update) version
2213 	 */
2214 	uint16_t	roce_fw_patch;
2215 	/*
2216 	 * This field returns the maximum extended request length acceptable
2217 	 * by the device which allows requests greater than mailbox size when
2218 	 * used with the short cmd request format.
2219 	 */
2220 	uint16_t	max_ext_req_len;
2221 	/*
2222 	 * This field returns the maximum request timeout value in seconds.
2223 	 * For backward compatibility, a value of zero should be interpreted
2224 	 * as the default value of 40 seconds. Drivers should always honor the
2225 	 * maximum timeout, but are permitted to warn if a longer duration than
2226 	 * this default is advertised. Values larger than 40 seconds should
2227 	 * only be used as a stopgap measure to address a device limitation or
2228 	 * for the purposes of test and debugging. The long term goal is for
2229 	 * firmware to significantly reduce this value in the passage of time.
2230 	 */
2231 	uint16_t	max_req_timeout;
2232 	uint8_t	unused_1[3];
2233 	/*
2234 	 * This field is used in Output records to indicate that the output
2235 	 * is completely written to RAM.  This field should be read as '1'
2236 	 * to indicate that the output has been completely written.
2237 	 * When writing a command completion or response to an internal processor,
2238 	 * the order of writes has to be such that this field is written last.
2239 	 */
2240 	uint8_t	valid;
2241 } hwrm_ver_get_output_t, *phwrm_ver_get_output_t;
2242 
2243 /* cfa_bds_read_cmd_data_msg (size:128b/16B) */
2244 
2245 typedef struct cfa_bds_read_cmd_data_msg {
2246 	/* This value selects the format for the mid-path command for the CFA. */
2247 	uint8_t	opcode;
2248 	/*
2249 	 * This is read command. From 32 to 128B can be read from a table
2250 	 * using this command.
2251 	 */
2252 	#define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ UINT32_C(0x0)
2253 	#define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ
2254 	/* This value selects the table type to be acted upon. */
2255 	uint8_t	table_type;
2256 	/* This value selects the table type to be acted upon. */
2257 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2258 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2259 	/* This command acts on the action table of the specified scope. */
2260 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2261 	/* This command acts on the exact match table of the specified scope. */
2262 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2263 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM
2264 	/* This value selects which table scope will be accessed. */
2265 	uint8_t	table_scope;
2266 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2267 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2268 	/*
2269 	 * This value identifies the number of 32B units will be accessed. A
2270 	 * value of zero is invalid. Maximum value is 4.
2271 	 */
2272 	uint8_t	data_size;
2273 	#define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2274 	#define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_SFT 0
2275 	/* This is the 32B index into the selected table to access. */
2276 	uint32_t	table_index;
2277 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2278 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2279 	/*
2280 	 * This is the 64b host address where you want the data returned to. The
2281 	 * data will be written to the same function as the one that owns the SQ
2282 	 * this command is read from. The bottom two bits of this value must be
2283 	 * zero. The size of the write is controlled by the data_size field.
2284 	 */
2285 	uint64_t	host_address;
2286 } cfa_bds_read_cmd_data_msg_t, *pcfa_bds_read_cmd_data_msg_t;
2287 
2288 /* cfa_bds_write_cmd_data_msg (size:1152b/144B) */
2289 
2290 typedef struct cfa_bds_write_cmd_data_msg {
2291 	/* This value selects the format for the mid-path command for the CFA. */
2292 	uint8_t	opcode;
2293 	/*
2294 	 * This is write command. From 32 to 128B can be written to a table
2295 	 * using this command.
2296 	 */
2297 	#define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE UINT32_C(0x1)
2298 	#define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE
2299 	/* This value selects the table type to be acted upon. */
2300 	uint8_t	write_thru_table_type;
2301 	/* This value selects the table type to be acted upon. */
2302 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2303 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2304 	/* This command acts on the action table of the specified scope. */
2305 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2306 	/* This command acts on the exact match table of the specified scope. */
2307 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2308 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM
2309 	/*
2310 	 * Indicates write-through control. Indicates write-through when set,
2311 	 * or write back when cleared.
2312 	 */
2313 	#define CFA_BDS_WRITE_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2314 	/* This value selects which table scope will be accessed. */
2315 	uint8_t	table_scope;
2316 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2317 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2318 	/*
2319 	 * This value identifies the number of 32B units will be accessed. A
2320 	 * value of zero is invalid. Maximum value is 4.
2321 	 */
2322 	uint8_t	data_size;
2323 	#define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2324 	#define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2325 	/* This is the 32B index into the selected table to access. */
2326 	uint32_t	table_index;
2327 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2328 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2329 	uint32_t	unused0;
2330 	uint32_t	unused1;
2331 	/*
2332 	 * This is the data to be written. Data length is determined by the
2333 	 * data_size field. The bd_cnt in the encapsulating BD must also be set
2334 	 * correctly to ensure that the BD is processed correctly and the full
2335 	 * WRITE_CMD message is extracted from the BD.
2336 	 */
2337 	uint32_t	dta[32];
2338 } cfa_bds_write_cmd_data_msg_t, *pcfa_bds_write_cmd_data_msg_t;
2339 
2340 /* cfa_bds_read_clr_cmd_data_msg (size:256b/32B) */
2341 
2342 typedef struct cfa_bds_read_clr_cmd_data_msg {
2343 	/* This value selects the format for the mid-path command for the CFA. */
2344 	uint8_t	opcode;
2345 	/*
2346 	 * This is read-clear command. 32B can be read from a table and
2347 	 * a 16b mask can be used to clear specific 16b units after the
2348 	 * read as an atomic operation.
2349 	 */
2350 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR UINT32_C(0x2)
2351 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR
2352 	/* This value selects the table type to be acted upon. */
2353 	uint8_t	table_type;
2354 	/* This value selects the table type to be acted upon. */
2355 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2356 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2357 	/* This command acts on the action table of the specified scope. */
2358 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2359 	/* This command acts on the exact match table of the specified scope. */
2360 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2361 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM
2362 	/* This value selects which table scope will be accessed. */
2363 	uint8_t	table_scope;
2364 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2365 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2366 	/*
2367 	 * This value identifies the number of 32B units will be accessed.
2368 	 * Always set the value to 1.
2369 	 */
2370 	uint8_t	data_size;
2371 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2372 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_SFT 0
2373 	/* This is the 32B index into the selected table to access. */
2374 	uint32_t	table_index;
2375 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2376 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2377 	/*
2378 	 * This is the 64b host address where you want the data returned to. The
2379 	 * data will be written to the same function as the one that owns the SQ
2380 	 * this command is read from. The bottom two bits of this value must be
2381 	 * zero. The size of the write is controlled by the data_size field.
2382 	 */
2383 	uint64_t	host_address;
2384 	/*
2385 	 * This is active high clear mask for the 32B of data that this command
2386 	 * can read. Bit 0 of the field will clear bits 15:0 of the first word
2387 	 * of data read when set to '1'.
2388 	 */
2389 	uint16_t	clear_mask;
2390 	uint16_t	unused0[3];
2391 	uint16_t	unused1[4];
2392 } cfa_bds_read_clr_cmd_data_msg_t, *pcfa_bds_read_clr_cmd_data_msg_t;
2393 
2394 /* cfa_bds_em_insert_cmd_data_msg (size:1152b/144B) */
2395 
2396 typedef struct cfa_bds_em_insert_cmd_data_msg {
2397 	/* This value selects the format for the mid-path command for the CFA. */
2398 	uint8_t	opcode;
2399 	/*
2400 	 * An exact match table insert will be attempted into the table.
2401 	 * If there is a free location in the bucket, the payload will
2402 	 * be written to the bucket.
2403 	 */
2404 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT UINT32_C(0x3)
2405 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT
2406 	/*
2407 	 * Indicates write-through control. Indicates write-through when set,
2408 	 * or write back when cleared.
2409 	 */
2410 	uint8_t	write_thru;
2411 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_MASK	UINT32_C(0xf)
2412 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_SFT	0
2413 	/*
2414 	 * Indicates write-through control. Indicates write-through when set,
2415 	 * or write back when cleared.
2416 	 */
2417 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2418 	/* This value selects which table scope will be accessed. */
2419 	uint8_t	table_scope;
2420 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2421 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2422 	/*
2423 	 * This value identifies the number of 32B units will be accessed. A
2424 	 * value of zero is invalid. Maximum value is 4.
2425 	 */
2426 	uint8_t	data_size;
2427 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2428 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2429 	/* This is the 32B index into the selected table to access. */
2430 	uint32_t	table_index;
2431 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2432 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2433 	/*
2434 	 * This is the 64b host address where you want the data returned to. The
2435 	 * data will be written to the same function as the one that owns the SQ
2436 	 */
2437 	uint64_t	host_address;
2438 	/*
2439 	 * This is the Exact Match Lookup Record. Data length is determined by
2440 	 * the data_size field. The bd_cnt in the encapsulating BD must also be
2441 	 */
2442 	uint32_t	dta[32];
2443 } cfa_bds_em_insert_cmd_data_msg_t, *pcfa_bds_em_insert_cmd_data_msg_t;
2444 
2445 /* cfa_bds_em_delete_cmd_data_msg (size:256b/32B) */
2446 
2447 typedef struct cfa_bds_em_delete_cmd_data_msg {
2448 	/* This value selects the format for the mid-path command for the CFA. */
2449 	uint8_t	opcode;
2450 	/* An exact match table delete will be attempted. */
2451 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE UINT32_C(0x4)
2452 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE
2453 	/*
2454 	 * Indicates write-through control. Indicates write-through when set,
2455 	 * or write back when cleared.
2456 	 */
2457 	uint8_t	write_thru;
2458 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_MASK	UINT32_C(0xf)
2459 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_SFT	0
2460 	/*
2461 	 * Indicates write-through control. Indicates write-through when set,
2462 	 * or write back when cleared.
2463 	 */
2464 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2465 	/* This value selects which table scope will be accessed. */
2466 	uint8_t	table_scope;
2467 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2468 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2469 	/*
2470 	 * This value identifies the number of 32B units will be accessed. A
2471 	 * value of zero is invalid. Maximum value is 4.
2472 	 */
2473 	uint8_t	data_size;
2474 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2475 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2476 	uint32_t	unused0;
2477 	/*
2478 	 * This is the 64b host address where you want the data returned to. The
2479 	 * data will be written to the same function as the one that owns the SQ
2480 	 */
2481 	uint64_t	host_address;
2482 	/*
2483 	 * This is the Exact Match Lookup Record. Data length is determined by
2484 	 * the data_size field. The bd_cnt in the encapsulating BD must also be
2485 	 */
2486 	uint64_t	dta;
2487 	uint64_t	unused1;
2488 } cfa_bds_em_delete_cmd_data_msg_t, *pcfa_bds_em_delete_cmd_data_msg_t;
2489 
2490 /* cfa_bds_invalidate_cmd_data_msg (size:128b/16B) */
2491 
2492 typedef struct cfa_bds_invalidate_cmd_data_msg {
2493 	/* This value selects the format for the mid-path command for the CFA. */
2494 	uint8_t	opcode;
2495 	/*
2496 	 * The specified table area will be invalidated. If it is needed.
2497 	 * again, it will be read from the backing store.
2498 	 */
2499 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE UINT32_C(0x5)
2500 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE
2501 	/* This value selects the table type to be acted upon. */
2502 	uint8_t	table_type;
2503 	/* This value selects the table type to be acted upon. */
2504 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2505 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2506 	/* This command acts on the action table of the specified scope. */
2507 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2508 	/* This command acts on the exact match table of the specified scope. */
2509 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2510 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM
2511 	/* This value selects which table scope will be accessed. */
2512 	uint8_t	table_scope;
2513 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2514 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2515 	/* This value specifies the number of cache lines to invalidate. */
2516 	uint8_t	data_size;
2517 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2518 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2519 	/* This is the 32B index into the selected table to access. */
2520 	uint32_t	table_index;
2521 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2522 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2523 	uint64_t	unused;
2524 } cfa_bds_invalidate_cmd_data_msg_t, *pcfa_bds_invalidate_cmd_data_msg_t;
2525 
2526 /* cfa_bds_event_collect_cmd_data_msg (size:128b/16B) */
2527 
2528 typedef struct cfa_bds_event_collect_cmd_data_msg {
2529 	/* This value selects the format for the mid-path command for the CFA. */
2530 	uint8_t	opcode;
2531 	/* Reads notification messages from the Host Notification Queue. */
2532 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT UINT32_C(0x6)
2533 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT
2534 	uint8_t	unused0;
2535 	/* This value selects which table scope will be accessed. */
2536 	uint8_t	table_scope;
2537 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2538 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2539 	/*
2540 	 * This value identifies the number of 32B units will be accessed. A
2541 	 * value of zero is invalid. Maximum value is 4.
2542 	 */
2543 	uint8_t	data_size;
2544 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2545 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2546 	uint32_t	unused1;
2547 	/*
2548 	 * This is the 64b host address where you want the data returned to. The
2549 	 * data will be written to the same function as the one that owns the SQ
2550 	 */
2551 	uint64_t	host_address;
2552 } cfa_bds_event_collect_cmd_data_msg_t, *pcfa_bds_event_collect_cmd_data_msg_t;
2553 
2554 /* ce_bds_add_data_msg (size:576b/72B) */
2555 
2556 typedef struct ce_bds_add_data_msg {
2557 	uint32_t	version_algorithm_kid_opcode;
2558 	/*
2559 	 * This value selects the operation for the mid-path command for the
2560 	 * crypto blocks.
2561 	 */
2562 	#define CE_BDS_ADD_DATA_MSG_OPCODE_MASK		UINT32_C(0xf)
2563 	#define CE_BDS_ADD_DATA_MSG_OPCODE_SFT		0
2564 	/*
2565 	 * This is the add command. Using this opcode, Host Driver can add
2566 	 * information required for kTLS processing. The information is
2567 	 * updated in the CFCK context.
2568 	 */
2569 		#define CE_BDS_ADD_DATA_MSG_OPCODE_ADD		UINT32_C(0x1)
2570 		#define CE_BDS_ADD_DATA_MSG_OPCODE_LAST		CE_BDS_ADD_DATA_MSG_OPCODE_ADD
2571 	/*
2572 	 * This field is the Crypto Context ID. The KID is used to store
2573 	 * information used by the associated kTLS offloaded connection.
2574 	 */
2575 	#define CE_BDS_ADD_DATA_MSG_KID_MASK		UINT32_C(0xfffff0)
2576 	#define CE_BDS_ADD_DATA_MSG_KID_SFT		4
2577 	/*
2578 	 * Currently only two algorithms are supported, AES_GCM_128 and
2579 	 * AES_GCM_256. Additional bits for future growth.
2580 	 */
2581 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_MASK		UINT32_C(0xf000000)
2582 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_SFT		24
2583 	/* AES_GCM_128 Algorithm */
2584 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_128	UINT32_C(0x1000000)
2585 	/* AES_GCM_256 Algorithm */
2586 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_256	UINT32_C(0x2000000)
2587 	/*
2588 	 * Version number of TLS connection. HW will provide registers that
2589 	 * converts the 4b encoded version number to 16b of actual version
2590 	 * number in the TLS Header. This field is initialized/updated by
2591 	 * this "KTLS crypto add" mid-path command.
2592 	 */
2593 	#define CE_BDS_ADD_DATA_MSG_VERSION_MASK		UINT32_C(0xf0000000)
2594 	#define CE_BDS_ADD_DATA_MSG_VERSION_SFT		28
2595 	/* TLS1.2 Version */
2596 		#define CE_BDS_ADD_DATA_MSG__TLS1_2			(UINT32_C(0x0) << 28)
2597 	/* TLS1.3 Version */
2598 		#define CE_BDS_ADD_DATA_MSG__TLS1_3			(UINT32_C(0x1) << 28)
2599 		#define CE_BDS_ADD_DATA_MSG__LAST			CE_BDS_ADD_DATA_MSG__TLS1_3
2600 	uint8_t	ctx_kind;
2601 	/* This field selects the context kind for the request. */
2602 	#define CE_BDS_ADD_DATA_MSG_CTX_KIND_MASK UINT32_C(0x1f)
2603 	#define CE_BDS_ADD_DATA_MSG_CTX_KIND_SFT  0
2604 	/* Crypto key transmit context */
2605 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_TX  UINT32_C(0x11)
2606 	/* Crypto key receive context */
2607 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX  UINT32_C(0x12)
2608 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_LAST  CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX
2609 	uint8_t	unused0[3];
2610 	/*
2611 	 * Salt is part of the nonce that is used as the Initial Vector (IV) in
2612 	 * AES-GCM cipher suites. These are exchanged as part of the handshake
2613 	 * process and is either the client_write_iv (when the client is
2614 	 * sending) or server_write_iv (when the server is sending). In
2615 	 * TLS1.2, 4B of Salt is concatenated with 8B of explicit_nonce to
2616 	 * generate the 12B of IV. In TLS1.3, 8B of TLS record sequence number
2617 	 * is zero padded to 12B and then xor'ed with the 4B of salt to generate
2618 	 * the 12B of IV. This value is initialized by this mid-path command.
2619 	 */
2620 	uint8_t	salt[4];
2621 	uint8_t	unused1[4];
2622 	/*
2623 	 * This field keeps track of the TCP sequence number that is expected as
2624 	 * the first byte in the next TCP packet. This field is calculated by HW
2625 	 * using the output of the parser. The field is initialized as part of
2626 	 * the Mid-path BD download/update of a kTLS connection. For every TCP
2627 	 * packet processed, TCE HW will update the value to Current packet TCP
2628 	 * sequence number + Current packet TCP Payload Length.
2629 	 */
2630 	uint32_t	pkt_tcp_seq_num;
2631 	/*
2632 	 * This field maintains the TCP sequence number of the first byte in the
2633 	 * header of the active TLS record. This field is initialized as part of
2634 	 * the Mid-path BD download/update of a kTLS connection. For every
2635 	 * record that is processed, TCE HW copies the value from the
2636 	 * next_tls_header_tcp_seq_num field.
2637 	 */
2638 	uint32_t	tls_header_tcp_seq_num;
2639 	/*
2640 	 * This is sequence number for the TLS record in a particular session.
2641 	 * In TLS1.2, record sequence number is part of the Associated Data (AD)
2642 	 * in the AEAD algorithm. In TLS1.3, record sequence number is part of
2643 	 * the Initial Vector (IV). The field is initialized as part of the
2644 	 * mid-path BD download/update of a kTLS connection. TCE HW increments
2645 	 * the field after that for every record processed as it parses the TCP
2646 	 * packet.
2647 	 */
2648 	uint64_t	record_seq_num;
2649 	/*
2650 	 * Key used for encrypting or decrypting TLS records. The Key is
2651 	 * exchanged during the hand-shake protocol by the client-server and
2652 	 * provided to HW through this mid-path BD.
2653 	 */
2654 	uint8_t	session_key[32];
2655 	/*
2656 	 * Additional IV that is exchanged as part of sessions setup between
2657 	 * the two end points. This field is used for TLS1.3 only.
2658 	 */
2659 	uint8_t	addl_iv[8];
2660 } ce_bds_add_data_msg_t, *pce_bds_add_data_msg_t;
2661 
2662 /* ce_bds_delete_data_msg (size:32b/4B) */
2663 
2664 typedef struct ce_bds_delete_data_msg {
2665 	uint32_t	kid_opcode_ctx_kind;
2666 	/*
2667 	 * This value selects the operation for the mid-path command for the
2668 	 * crypto blocks.
2669 	 */
2670 	#define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK	UINT32_C(0xf)
2671 	#define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT	0
2672 	/*
2673 	 * This is the delete command. Using this opcode, the host Driver
2674 	 * can remove a key context from the CFCK. If context is deleted
2675 	 * and packets with the same KID come through the pipeline, the
2676 	 * following actions are taken. For transmit packets, no crypto
2677 	 * operation will be performed, payload will be zero'ed out. For
2678 	 * receive packets, no crypto operation will be performed,
2679 	 * payload will be unmodified.
2680 	 */
2681 		#define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE	UINT32_C(0x2)
2682 		#define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST	CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE
2683 	/*
2684 	 * This field is the Crypto Context ID. The KID is used to store
2685 	 * information used by the associated kTLS offloaded connection.
2686 	 */
2687 	#define CE_BDS_DELETE_DATA_MSG_KID_MASK	UINT32_C(0xfffff0)
2688 	#define CE_BDS_DELETE_DATA_MSG_KID_SFT	4
2689 	/* This field selects the context kind for the request. */
2690 	#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_MASK   UINT32_C(0x1f000000)
2691 	#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_SFT	24
2692 	/* Crypto Key Transmit Context. */
2693 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_TX	(UINT32_C(0x11) << 24)
2694 	/* Crypto Key Receive Context. */
2695 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_RX	(UINT32_C(0x12) << 24)
2696 	/* QUIC Key Transmit Context. */
2697 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_TX  (UINT32_C(0x14) << 24)
2698 	/* QUIC Key Receive Context. */
2699 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX  (UINT32_C(0x15) << 24)
2700 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_LAST	CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX
2701 } ce_bds_delete_data_msg_t, *pce_bds_delete_data_msg_t;
2702 
2703 /* ce_bds_resync_resp_ack_msg (size:128b/16B) */
2704 
2705 typedef struct ce_bds_resync_resp_ack_msg {
2706 	uint32_t	resync_status_kid_opcode;
2707 	/*
2708 	 * This value selects the operation for the mid-path command for the
2709 	 * crypto blocks.
2710 	 */
2711 	#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_MASK	UINT32_C(0xf)
2712 	#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_SFT	0
2713 	/*
2714 	 * This command is used by the driver as a response to the resync
2715 	 * request sent by the crypto engine.
2716 	 */
2717 		#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC	UINT32_C(0x3)
2718 		#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_LAST	CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC
2719 	/*
2720 	 * This field is the Crypto Context ID. The KID is used to store
2721 	 * information used by the associated kTLS offloaded connection.
2722 	 */
2723 	#define CE_BDS_RESYNC_RESP_ACK_MSG_KID_MASK	UINT32_C(0xfffff0)
2724 	#define CE_BDS_RESYNC_RESP_ACK_MSG_KID_SFT	4
2725 	/*
2726 	 * This field indicates if the resync request resulted in a success or
2727 	 * a failure.
2728 	 */
2729 	#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS	UINT32_C(0x1000000)
2730 	/*
2731 	 * An ACK indicates that the driver was able to find the TLS record
2732 	 * associated with TCP sequence number provided by the HW
2733 	 */
2734 		#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK   (UINT32_C(0x0) << 24)
2735 		#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK
2736 	/*
2737 	 * This field is the echo of the TCP sequence number provided in the
2738 	 * resync request by the HW. If HW sent multiple resync requests, it
2739 	 * only tracks the latest TCP sequence number. When the response from
2740 	 * the Driver doesn't match the latest request, HW will drop the resync
2741 	 * response.
2742 	 */
2743 	uint32_t	resync_record_tcp_seq_num;
2744 	/*
2745 	 * This field indicates the TLS record sequence number associated with
2746 	 * the resync request. HW will take this number and add the delta records
2747 	 * it has found since sending the resync request, update the context and
2748 	 * resume decrypting records.
2749 	 */
2750 	uint64_t	resync_record_seq_num;
2751 } ce_bds_resync_resp_ack_msg_t, *pce_bds_resync_resp_ack_msg_t;
2752 
2753 /* ce_bds_resync_resp_nack_msg (size:64b/8B) */
2754 
2755 typedef struct ce_bds_resync_resp_nack_msg {
2756 	uint32_t	resync_status_kid_opcode;
2757 	/*
2758 	 * This value selects the operation for the mid-path command for the
2759 	 * crypto blocks.
2760 	 */
2761 	#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_MASK	UINT32_C(0xf)
2762 	#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_SFT	0
2763 	/*
2764 	 * This command is used by the driver as a response to the resync
2765 	 * request sent by the crypto engine.
2766 	 */
2767 		#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC	UINT32_C(0x3)
2768 		#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_LAST	CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC
2769 	/*
2770 	 * This field is the Crypto Context ID. The KID is used to store
2771 	 * information used by the associated kTLS offloaded connection.
2772 	 */
2773 	#define CE_BDS_RESYNC_RESP_NACK_MSG_KID_MASK	UINT32_C(0xfffff0)
2774 	#define CE_BDS_RESYNC_RESP_NACK_MSG_KID_SFT	4
2775 	/*
2776 	 * This field indicates if the resync request resulted in a success or
2777 	 * a failure.
2778 	 */
2779 	#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS	UINT32_C(0x1000000)
2780 	/*
2781 	 * An NAK indicates that the driver wasn't able to find the TLS
2782 	 * record associated with TCP sequence number provided by the HW
2783 	 */
2784 		#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK  (UINT32_C(0x1) << 24)
2785 		#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK
2786 	/*
2787 	 * This field is the echo of the TCP sequence number provided in the
2788 	 * resync request by the HW. If HW sent multiple resync requests, it
2789 	 * only tracks the latest TCP sequence number. When the response from
2790 	 * the Driver doesn't match the latest request, HW will drop the resync
2791 	 * response.
2792 	 */
2793 	uint32_t	resync_record_tcp_seq_num;
2794 } ce_bds_resync_resp_nack_msg_t, *pce_bds_resync_resp_nack_msg_t;
2795 
2796 /* crypto_presync_bd_cmd (size:256b/32B) */
2797 
2798 typedef struct crypto_presync_bd_cmd {
2799 	uint8_t	flags;
2800 	/*
2801 	 * Typically, presync BDs are used for packet retransmissions. Source
2802 	 * port sends all the packets in order over the network to destination
2803 	 * port and packets get dropped in the network. The destination port
2804 	 * will request retranmission of dropped packets and source port driver
2805 	 * will send presync BD to setup the transmitter appropriately. It will
2806 	 * provide the start and end TCP sequence number of the data to be
2807 	 * transmitted. HW keeps two sets of context variable, one for in order
2808 	 * traffic and one for retransmission traffic. HW is designed to
2809 	 * transmit everything posted in the presync BD and return to in order
2810 	 * mode after that. No inorder context variables are updated in the
2811 	 * process. There is a special case where packets can be dropped
2812 	 * between the TCP stack and Device Driver (Berkeley Packet Filter for
2813 	 * ex) and HW still needs to transmit rest of the traffic. In this
2814 	 * mode, driver will send a presync BD as if it is a retransmission but
2815 	 * at the end of the transmission, the in order variables need to be
2816 	 * updated. This flag is used by driver to indicate that in order
2817 	 * variables needs to be updated at the end of completing the task
2818 	 * associated with the presync BD.
2819 	 */
2820 	#define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR	UINT32_C(0x1)
2821 	/*
2822 	 * When packet with an authentication TAG is lost in the network,
2823 	 * During retransmission Device driver will post the entire record for
2824 	 * the hardware to recalculate the TAG. Hardware is set to retransmit
2825 	 * only portions of the record, it does so by looking at the Header
2826 	 * TCP Sequence Number and Start TCP Sequence Number. However, there
2827 	 * is a case where the header packet gets dropped in the stack for ex
2828 	 * BPF packet filter and it is impossible for the Hardware to
2829 	 * determine if this is a case of full replay for only the TAG
2830 	 * generation.
2831 	 */
2832 	#define CRYPTO_PRESYNC_BD_CMD_FLAGS_FULL_REPLAY_RETRAN	UINT32_C(0x2)
2833 	uint8_t	unused0;
2834 	uint16_t	unused1;
2835 	/*
2836 	 * This field maintains the TCP sequence number of the first byte in the
2837 	 * Header of the active TLS record. This field is set to 0 during
2838 	 * mid-path BD updates, but is set to correct value when a presync BD is
2839 	 * detected. For every record that is processed, the value from the
2840 	 * next_tls_header_tcp_seq_num field is copied.
2841 	 */
2842 	uint32_t	header_tcp_seq_num;
2843 	/*
2844 	 * When a retransmitted packet has a TLS authentication TAG present and
2845 	 * the data spans multiple TCP Packets, HW is required to read the entire
2846 	 * record to recalculate the TAG but only transmit what is required. This
2847 	 * field is the start TCP sequence number of the packet(s) that need to
2848 	 * be re-transmitted. This field is initialized to 0 during Mid-path BD
2849 	 * add command and initialized to value provided by the driver when
2850 	 * Pre-sync BD is detected. This field is never updated unless another
2851 	 * Pre-sync BD signaling a new retransmission is scheduled.
2852 	 */
2853 	uint32_t	start_tcp_seq_num;
2854 	/*
2855 	 * When a retransmitted packet has a TLS authentication TAG present and
2856 	 * the data spans multiple TCP Packets, HW is required to read the
2857 	 * entire record to recalculate the TAG but only transmit what is
2858 	 * required. This field is the end TCP sequence number of the packet(s)
2859 	 * that need to be re-transmitted. This field is initialized to 0 during
2860 	 * Mid-path BD add command and initialized to value provided by the
2861 	 * driver when Pre-sync BD is detected. This field is never updated
2862 	 * unless another Pre-sync BD signaling a new retransmission is
2863 	 * scheduled.
2864 	 */
2865 	uint32_t	end_tcp_seq_num;
2866 	/*
2867 	 * For TLS1.2, an explicit nonce is used as part of the IV (concatenated
2868 	 * with the SALT). For retrans packets, this field is extracted from the
2869 	 * TLS record, field right after the TLS Header and stored in the
2870 	 * context. This field needs to be stored in context as TCP segmentation
2871 	 * could have split the field into multiple TCP packets. This value is
2872 	 * initialized to 0 when presync BD is detected by taking the value from
2873 	 * the first TLS header. When subsequent TLS Headers are detected, the
2874 	 * value is extracted from packet.
2875 	 */
2876 	uint8_t	explicit_nonce[8];
2877 	/*
2878 	 * This is sequence number for the TLS record in a particular session. In
2879 	 * TLS1.2, record sequence number is part of the Associated Data (AD) in
2880 	 * the AEAD algorithm. In TLS1.3, record sequence number is part of the
2881 	 * Initial Vector (IV). The field is initialized to 0 during Mid-path BD
2882 	 * download. Is initialized to correct value when a pre-sync BD is
2883 	 * detected. TCE HW increments the field after that for every record
2884 	 * processed as it parses the TCP packet. Subsequent pre-sync BDs
2885 	 * delivering more retransmission instruction will also update this
2886 	 * field.
2887 	 */
2888 	uint64_t	record_seq_num;
2889 } crypto_presync_bd_cmd_t, *pcrypto_presync_bd_cmd_t;
2890 
2891 /* ce_bds_quic_add_data_msg (size:832b/104B) */
2892 
2893 typedef struct ce_bds_quic_add_data_msg {
2894 	uint32_t	ver_algo_kid_opcode;
2895 	/*
2896 	 * This value selects the operation for the mid-path command for the
2897 	 * crypto blocks.
2898 	 */
2899 	#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_MASK	UINT32_C(0xf)
2900 	#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_SFT	0
2901 	/*
2902 	 * This is the add command. Using this opcode, Host Driver can add
2903 	 * information required for QUIC processing. The information is
2904 	 * updated in the CFCK context.
2905 	 */
2906 		#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD		UINT32_C(0x1)
2907 		#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_LAST	CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD
2908 	/*
2909 	 * This field is the Crypto Context ID. The KID is used to store
2910 	 * information used by the associated QUIC offloaded connection.
2911 	 */
2912 	#define CE_BDS_QUIC_ADD_DATA_MSG_KID_MASK		UINT32_C(0xfffff0)
2913 	#define CE_BDS_QUIC_ADD_DATA_MSG_KID_SFT		4
2914 	/* Algorithm used for encryption and decryption. */
2915 	#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_MASK	UINT32_C(0xf000000)
2916 	#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_SFT	24
2917 	/* AES_GCM_128 Algorithm. */
2918 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_128  (UINT32_C(0x1) << 24)
2919 	/* AES_GCM_256 Algorithm. */
2920 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_256  (UINT32_C(0x2) << 24)
2921 	/* Chacha20 Algorithm. */
2922 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20	(UINT32_C(0x3) << 24)
2923 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_LAST	CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20
2924 	/* Version number of QUIC connection. */
2925 	#define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_MASK	UINT32_C(0xf0000000)
2926 	#define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_SFT	28
2927 	/* TLS1.2 Version */
2928 		#define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_2		(UINT32_C(0x0) << 28)
2929 	/* TLS1.3 Version */
2930 		#define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_3		(UINT32_C(0x1) << 28)
2931 	/* DTLS1.2 Version */
2932 		#define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2		(UINT32_C(0x2) << 28)
2933 	/* DTLS1.2 for RoCE Version */
2934 		#define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2_ROCE	(UINT32_C(0x3) << 28)
2935 	/* QUIC Version */
2936 		#define CE_BDS_QUIC_ADD_DATA_MSG__QUIC		(UINT32_C(0x4) << 28)
2937 		#define CE_BDS_QUIC_ADD_DATA_MSG__LAST		CE_BDS_QUIC_ADD_DATA_MSG__QUIC
2938 	uint32_t	ctx_kind_dcid_width_key_phase;
2939 	/* Key phase. */
2940 	#define CE_BDS_QUIC_ADD_DATA_MSG_KEY_PHASE	UINT32_C(0x1)
2941 	/* Destination connection ID width. */
2942 	#define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_MASK UINT32_C(0x3e)
2943 	#define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_SFT  1
2944 	/* This field selects the context kind for the request. */
2945 	#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_MASK   UINT32_C(0x7c0)
2946 	#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_SFT	6
2947 	/* QUIC key transmit context */
2948 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_TX  (UINT32_C(0x14) << 6)
2949 	/* QUIC key receive context */
2950 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX  (UINT32_C(0x15) << 6)
2951 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_LAST	CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX
2952 	uint64_t	unused_0;
2953 	/*
2954 	 * Least-significant 64 bits (of 96) of additional IV that is
2955 	 * exchanged as part of sessions setup between the two end
2956 	 * points for QUIC operations.
2957 	 */
2958 	uint64_t	quic_iv_lo;
2959 	/*
2960 	 * Most-significant 32 bits (of 96) of additional IV that is
2961 	 * exchanged as part of sessions setup between the two end
2962 	 * points for QUIC operations.
2963 	 */
2964 	uint32_t	quic_iv_hi;
2965 	uint32_t	unused_1;
2966 	/*
2967 	 * Key used for encrypting or decrypting records. The Key is exchanged
2968 	 * as part of sessions setup between the two end points through this
2969 	 * mid-path BD.
2970 	 */
2971 	uint32_t	session_key[8];
2972 	/* Header protection key. */
2973 	uint32_t	hp_key[8];
2974 	/* Packet number associated with the QUIC connection. */
2975 	uint64_t	pkt_number;
2976 } ce_bds_quic_add_data_msg_t, *pce_bds_quic_add_data_msg_t;
2977 
2978 /* bd_base (size:64b/8B) */
2979 
2980 typedef struct bd_base {
2981 	uint8_t	type;
2982 	/* This value identifies the type of buffer descriptor. */
2983 	#define BD_BASE_TYPE_MASK		UINT32_C(0x3f)
2984 	#define BD_BASE_TYPE_SFT		0
2985 	/*
2986 	 * Indicates that this BD is 16B long and is used for
2987 	 * normal L2 packet transmission.
2988 	 */
2989 		#define BD_BASE_TYPE_TX_BD_SHORT	UINT32_C(0x0)
2990 	/*
2991 	 * Indicates that this BD is 1BB long and is an empty
2992 	 * TX BD. Not valid for use by the driver.
2993 	 */
2994 		#define BD_BASE_TYPE_TX_BD_EMPTY	UINT32_C(0x1)
2995 	/*
2996 	 * Indicates that this BD is 16B long and is an RX Producer
2997 	 * (i.e. empty) buffer descriptor.
2998 	 */
2999 		#define BD_BASE_TYPE_RX_PROD_PKT	UINT32_C(0x4)
3000 	/*
3001 	 * Indicates that this BD is 16B long and is an RX
3002 	 * Producer Buffer BD.
3003 	 */
3004 		#define BD_BASE_TYPE_RX_PROD_BFR	UINT32_C(0x5)
3005 	/*
3006 	 * Indicates that this BD is 16B long and is an
3007 	 * RX Producer Assembly Buffer Descriptor.
3008 	 */
3009 		#define BD_BASE_TYPE_RX_PROD_AGG	UINT32_C(0x6)
3010 	/*
3011 	 * Indicates that this BD is used to issue a command to one of
3012 	 * the mid-path destinations.
3013 	 */
3014 		#define BD_BASE_TYPE_TX_BD_MP_CMD	UINT32_C(0x8)
3015 	/*
3016 	 * Indicates that this BD is used to issue a cryptographic pre-
3017 	 * sync command through the fast path and destined for TCE.
3018 	 */
3019 		#define BD_BASE_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
3020 	/*
3021 	 * Indicates a timed transmit BD. This is a 16b BD that is inserted
3022 	 * into a packet BD chain immediately after the first BD. It is used
3023 	 * to control the flow in a timed transmit operation.
3024 	 */
3025 		#define BD_BASE_TYPE_TX_BD_TIMEDTX	UINT32_C(0xa)
3026 	/*
3027 	 * Indicates that this BD is 32B long and is used for
3028 	 * normal L2 packet transmission.
3029 	 */
3030 		#define BD_BASE_TYPE_TX_BD_LONG	UINT32_C(0x10)
3031 	/*
3032 	 * Indicates that this BD is 32B long and is used for
3033 	 * L2 packet transmission for small packets that require
3034 	 * low latency.
3035 	 */
3036 		#define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
3037 		#define BD_BASE_TYPE_LAST		BD_BASE_TYPE_TX_BD_LONG_INLINE
3038 	uint8_t	unused_1[7];
3039 } bd_base_t, *pbd_base_t;
3040 
3041 /* tx_bd_short (size:128b/16B) */
3042 
3043 typedef struct tx_bd_short {
3044 	/*
3045 	 * All bits in this field must be valid on the first BD of a packet.
3046 	 * Only the packet_end bit must be valid for the remaining BDs
3047 	 * of a packet.
3048 	 */
3049 	uint16_t	flags_type;
3050 	/* This value identifies the type of buffer descriptor. */
3051 	#define TX_BD_SHORT_TYPE_MASK		UINT32_C(0x3f)
3052 	#define TX_BD_SHORT_TYPE_SFT		0
3053 	/*
3054 	 * Indicates that this BD is 16B long and is used for
3055 	 * normal L2 packet transmission.
3056 	 */
3057 		#define TX_BD_SHORT_TYPE_TX_BD_SHORT	UINT32_C(0x0)
3058 		#define TX_BD_SHORT_TYPE_LAST		TX_BD_SHORT_TYPE_TX_BD_SHORT
3059 	/*
3060 	 * All bits in this field must be valid on the first BD of a packet.
3061 	 * Only the packet_end bit must be valid for the remaining BDs
3062 	 * of a packet.
3063 	 */
3064 	#define TX_BD_SHORT_FLAGS_MASK	UINT32_C(0xffc0)
3065 	#define TX_BD_SHORT_FLAGS_SFT		6
3066 	/*
3067 	 * If set to 1, the packet ends with the data in the buffer
3068 	 * pointed to by this descriptor. This flag must be
3069 	 * valid on every BD.
3070 	 */
3071 	#define TX_BD_SHORT_FLAGS_PACKET_END	UINT32_C(0x40)
3072 	/*
3073 	 * If set to 1, the device will not generate a completion for
3074 	 * this transmit packet unless there is an error in it's
3075 	 * processing.
3076 	 * If this bit
3077 	 * is set to 0, then the packet will be completed normally.
3078 	 *
3079 	 * This bit must be valid only on the first BD of a packet.
3080 	 */
3081 	#define TX_BD_SHORT_FLAGS_NO_CMPL	UINT32_C(0x80)
3082 	/*
3083 	 * This value indicates how many 16B BD locations are consumed
3084 	 * in the ring by this packet.
3085 	 * A value of 1 indicates that this BD is the only BD (and that
3086 	 * it is a short BD). A value
3087 	 * of 3 indicates either 3 short BDs or 1 long BD and one short
3088 	 * BD in the packet. A value of 0 indicates
3089 	 * that there are 32 BD locations in the packet (the maximum).
3090 	 *
3091 	 * This field is valid only on the first BD of a packet.
3092 	 */
3093 	#define TX_BD_SHORT_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3094 	#define TX_BD_SHORT_FLAGS_BD_CNT_SFT	8
3095 	/*
3096 	 * This value is a hint for the length of the entire packet.
3097 	 * It is used by the chip to optimize internal processing.
3098 	 *
3099 	 * The packet will be dropped if the hint is too short.
3100 	 *
3101 	 * This field is valid only on the first BD of a packet.
3102 	 */
3103 	#define TX_BD_SHORT_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3104 	#define TX_BD_SHORT_FLAGS_LHINT_SFT	13
3105 	/* indicates packet length < 512B */
3106 		#define TX_BD_SHORT_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
3107 	/* indicates 512 <= packet length < 1KB */
3108 		#define TX_BD_SHORT_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
3109 	/* indicates 1KB <= packet length < 2KB */
3110 		#define TX_BD_SHORT_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
3111 	/* indicates packet length >= 2KB */
3112 		#define TX_BD_SHORT_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
3113 		#define TX_BD_SHORT_FLAGS_LHINT_LAST	TX_BD_SHORT_FLAGS_LHINT_GTE2K
3114 	/*
3115 	 * If set to 1, the device immediately updates the Send Consumer
3116 	 * Index after the buffer associated with this descriptor has
3117 	 * been transferred via DMA to NIC memory from host memory. An
3118 	 * interrupt may or may not be generated according to the state
3119 	 * of the interrupt avoidance mechanisms. If this bit
3120 	 * is set to 0, then the Consumer Index is only updated as soon
3121 	 * as one of the host interrupt coalescing conditions has been met.
3122 	 *
3123 	 * This bit must be valid on the first BD of a packet.
3124 	 */
3125 	#define TX_BD_SHORT_FLAGS_COAL_NOW	UINT32_C(0x8000)
3126 	/*
3127 	 * This is the length of the host physical buffer this BD describes
3128 	 * in bytes.
3129 	 *
3130 	 * This field must be valid on all BDs of a packet.
3131 	 */
3132 	uint16_t	len;
3133 	/*
3134 	 * The opaque data field is pass through to the completion and can be
3135 	 * used for any data that the driver wants to associate with the
3136 	 * transmit BD.
3137 	 *
3138 	 * This field must be valid on the first BD of a packet. If completion
3139 	 * coalescing is enabled on the TX ring, it is suggested that the driver
3140 	 * populate the opaque field to indicate the specific TX ring with which
3141 	 * the completion is associated, then utilize the opaque and sq_cons_idx
3142 	 * fields in the coalesced completion record to determine the specific
3143 	 * packets that are to be completed on that ring.
3144 	 */
3145 	uint32_t	opaque;
3146 	/*
3147 	 * This is the host physical address for the portion of the packet
3148 	 * described by this TX BD.
3149 	 *
3150 	 * This value must be valid on all BDs of a packet.
3151 	 */
3152 	uint64_t	addr;
3153 } tx_bd_short_t, *ptx_bd_short_t;
3154 
3155 /* tx_bd_long (size:128b/16B) */
3156 
3157 typedef struct tx_bd_long {
3158 	/* This value identifies the type of buffer descriptor. */
3159 	uint16_t	flags_type;
3160 	/*
3161 	 * This value indicates the type of buffer descriptor.
3162 	 * packet.
3163 	 */
3164 	#define TX_BD_LONG_TYPE_MASK		UINT32_C(0x3f)
3165 	#define TX_BD_LONG_TYPE_SFT		0
3166 	/*
3167 	 * Indicates that this BD is 32B long and is used for
3168 	 * normal L2 packet transmission.
3169 	 */
3170 		#define TX_BD_LONG_TYPE_TX_BD_LONG	UINT32_C(0x10)
3171 		#define TX_BD_LONG_TYPE_LAST		TX_BD_LONG_TYPE_TX_BD_LONG
3172 	/*
3173 	 * All bits in this field must be valid on the first BD of a packet.
3174 	 * Only the packet_end bit must be valid for the remaining BDs
3175 	 * of a packet.
3176 	 */
3177 	#define TX_BD_LONG_FLAGS_MASK	UINT32_C(0xffc0)
3178 	#define TX_BD_LONG_FLAGS_SFT		6
3179 	/*
3180 	 * If set to 1, the packet ends with the data in the buffer
3181 	 * pointed to by this descriptor. This flag must be
3182 	 * valid on every BD.
3183 	 */
3184 	#define TX_BD_LONG_FLAGS_PACKET_END	UINT32_C(0x40)
3185 	/*
3186 	 * If set to 1, the device will not generate a completion for
3187 	 * this transmit packet unless there is an error in it's
3188 	 * processing.
3189 	 * If this bit
3190 	 * is set to 0, then the packet will be completed normally.
3191 	 *
3192 	 * This bit must be valid only on the first BD of a packet.
3193 	 */
3194 	#define TX_BD_LONG_FLAGS_NO_CMPL	UINT32_C(0x80)
3195 	/*
3196 	 * This value indicates how many 16B BD locations are consumed
3197 	 * in the ring by this packet.
3198 	 * A value of 1 indicates that this BD is the only BD (and that
3199 	 * it is a short BD). A value
3200 	 * of 3 indicates either 3 short BDs or 1 long BD and one short
3201 	 * BD in the packet. A value of 0 indicates
3202 	 * that there are 32 BD locations in the packet (the maximum).
3203 	 *
3204 	 * This field is valid only on the first BD of a packet.
3205 	 */
3206 	#define TX_BD_LONG_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3207 	#define TX_BD_LONG_FLAGS_BD_CNT_SFT	8
3208 	/*
3209 	 * This value is a hint for the length of the entire packet.
3210 	 * It is used by the chip to optimize internal processing.
3211 	 *
3212 	 * The packet will be dropped if the hint is too short.
3213 	 *
3214 	 * This field is valid only on the first BD of a packet.
3215 	 */
3216 	#define TX_BD_LONG_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3217 	#define TX_BD_LONG_FLAGS_LHINT_SFT	13
3218 	/* indicates packet length < 512B */
3219 		#define TX_BD_LONG_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
3220 	/* indicates 512 <= packet length < 1KB */
3221 		#define TX_BD_LONG_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
3222 	/* indicates 1KB <= packet length < 2KB */
3223 		#define TX_BD_LONG_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
3224 	/* indicates packet length >= 2KB */
3225 		#define TX_BD_LONG_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
3226 		#define TX_BD_LONG_FLAGS_LHINT_LAST	TX_BD_LONG_FLAGS_LHINT_GTE2K
3227 	/*
3228 	 * If set to 1, the device immediately updates the Send Consumer
3229 	 * Index after the buffer associated with this descriptor has
3230 	 * been transferred via DMA to NIC memory from host memory. An
3231 	 * interrupt may or may not be generated according to the state
3232 	 * of the interrupt avoidance mechanisms. If this bit
3233 	 * is set to 0, then the Consumer Index is only updated as soon
3234 	 * as one of the host interrupt coalescing conditions has been met.
3235 	 *
3236 	 * This bit must be valid on the first BD of a packet.
3237 	 */
3238 	#define TX_BD_LONG_FLAGS_COAL_NOW	UINT32_C(0x8000)
3239 	/*
3240 	 * This is the length of the host physical buffer this BD describes
3241 	 * in bytes.
3242 	 *
3243 	 * This field must be valid on all BDs of a packet.
3244 	 */
3245 	uint16_t	len;
3246 	/*
3247 	 * The opaque data field is passed through to the completion and can be
3248 	 * used for any data that the driver wants to associate with the
3249 	 * transmit BD.
3250 	 *
3251 	 * This field must be valid on the first BD of a packet. If completion
3252 	 * coalescing is enabled on the TX ring, it is suggested that the driver
3253 	 * populate the opaque field to indicate the specific TX ring with which
3254 	 * the completion is associated, then utilize the opaque and sq_cons_idx
3255 	 * fields in the coalesced completion record to determine the specific
3256 	 * packets that are to be completed on that ring.
3257 	 */
3258 	uint32_t	opaque;
3259 	/*
3260 	 * This is the host physical address for the portion of the packet
3261 	 * described by this TX BD.
3262 	 *
3263 	 * This value must be valid on all BDs of a packet.
3264 	 */
3265 	uint64_t	addr;
3266 } tx_bd_long_t, *ptx_bd_long_t;
3267 
3268 /* Last 16 bytes of tx_bd_long. */
3269 /* tx_bd_long_hi (size:128b/16B) */
3270 
3271 typedef struct tx_bd_long_hi {
3272 	/*
3273 	 * All bits in this field must be valid on the first BD of a packet.
3274 	 * Their value on other BDs of the packet will be ignored.
3275 	 */
3276 	uint16_t	lflags;
3277 	/*
3278 	 * If set to 1, the controller replaces the TCP/UPD checksum
3279 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3280 	 * checksum field of the encapsulated TCP/UDP packets with the
3281 	 * hardware calculated TCP/UDP checksum for the packet associated
3282 	 * with this descriptor. The flag is ignored if the LSO flag is set.
3283 	 *
3284 	 * This bit must be valid on the first BD of a packet.
3285 	 */
3286 	#define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
3287 	/*
3288 	 * If set to 1, the controller replaces the IP checksum of the
3289 	 * normal packets, or the inner IP checksum of the encapsulated
3290 	 * packets with the hardware calculated IP checksum for the
3291 	 * packet associated with this descriptor.
3292 	 *
3293 	 * This bit must be valid on the first BD of a packet.
3294 	 */
3295 	#define TX_BD_LONG_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
3296 	/*
3297 	 * If set to 1, the controller will not append an Ethernet CRC
3298 	 * to the end of the frame.
3299 	 *
3300 	 * This bit must be valid on the first BD of a packet.
3301 	 *
3302 	 * Packet must be 64B or longer when this flag is set. It is not
3303 	 * useful to use this bit with any form of TX offload such as
3304 	 * CSO or LSO. The intent is that the packet from the host already
3305 	 * has a valid Ethernet CRC on the packet.
3306 	 */
3307 	#define TX_BD_LONG_LFLAGS_NOCRC		UINT32_C(0x4)
3308 	/*
3309 	 * This bit, in conjunction with the stamp_1step bit, controls whether
3310 	 * a TX packet timestamp is collected and the type of timestamp that
3311 	 * is collected.
3312 	 *
3313 	 * This bit must be valid on the first BD of a packet.
3314 	 *
3315 	 * Enumerations of the concatenation { stamp, stamp_1step } are
3316 	 * as follows:
3317 	 *
3318 	 * - 2'b00: ts_none - no timestamp
3319 	 * - 2'b01: ts_ptp_1step - 1-step PTP
3320 	 * - 2'b10: ts_2cmpl - 2-step PTP timestamp or PA timestamp
3321 	 * - 2'b11: ts_rsvd - reserved, same behavior as ts_none
3322 	 * For the ts_2cmpl enumeration, an additional completion is returned.
3323 	 * This additional completion may carry a 2-step PTP timestamp or a PA
3324 	 * timestamp, depending on parsing of the transmitted packet.
3325 	 */
3326 	#define TX_BD_LONG_LFLAGS_STAMP		UINT32_C(0x8)
3327 	/*
3328 	 * If set to 1, The controller replaces the tunnel IP checksum
3329 	 * field with hardware calculated IP checksum for the IP header
3330 	 * of the packet associated with this descriptor.
3331 	 *
3332 	 * For outer UDP checksum, global outer UDP checksum TE_NIC register
3333 	 * needs to be enabled. If the global outer UDP checksum TE_NIC
3334 	 * register bit is set, outer UDP checksum will be calculated for
3335 	 * the following cases:
3336 	 * 1. Packets with tcp_udp_chksum flag set to offload checksum for
3337 	 * inner packet AND the inner packet is TCP/UDP. If the inner packet
3338 	 * is ICMP for example (non-TCP/UDP), even if the tcp_udp_chksum is
3339 	 * set, the outer UDP checksum will not be calculated.
3340 	 * 2. Packets with lso flag set which implies inner TCP checksum
3341 	 * calculation as part of LSO operation.
3342 	 */
3343 	#define TX_BD_LONG_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
3344 	/*
3345 	 * If set to 1, the device will treat this packet with LSO(Large
3346 	 * Send Offload) processing for both normal or encapsulated
3347 	 * packets, which is a form of TCP segmentation. When this bit
3348 	 * is 1, the hdr_size and mss fields must be valid. The driver
3349 	 * doesn't need to set ot_ip_chksum, t_ip_chksum, ip_chksum, and
3350 	 * tcp_udp_chksum flags since the controller will replace the
3351 	 * appropriate checksum fields for segmented packets.
3352 	 *
3353 	 * When this bit is 1, the hdr_size and mss fields must be valid.
3354 	 */
3355 	#define TX_BD_LONG_LFLAGS_LSO		UINT32_C(0x20)
3356 	/*
3357 	 * If set to zero when LSO is '1', then the IPID will be treated
3358 	 * as a 16b number and will be wrapped if it exceeds a value of
3359 	 * 0xffff.
3360 	 *
3361 	 * If set to one when LSO is '1', then the IPID will be treated
3362 	 * as a 15b number and will be wrapped if it exceeds a value 0f
3363 	 * 0x7fff.
3364 	 */
3365 	#define TX_BD_LONG_LFLAGS_IPID_FMT	UINT32_C(0x40)
3366 	/*
3367 	 * If set to zero when LSO is '1', then the IPID of the tunnel
3368 	 * IP header will not be modified during LSO operations.
3369 	 *
3370 	 * If set to one when LSO is '1', then the IPID of the tunnel
3371 	 * IP header will be incremented for each subsequent segment of an
3372 	 * LSO operation.
3373 	 *
3374 	 * The flag is ignored if the LSO packet is a normal (non-tunneled)
3375 	 * TCP packet.
3376 	 */
3377 	#define TX_BD_LONG_LFLAGS_T_IPID		UINT32_C(0x80)
3378 	/*
3379 	 * If set to '1', then the RoCE ICRC will be appended to the
3380 	 * packet. Packet must be a valid RoCE format packet.
3381 	 */
3382 	#define TX_BD_LONG_LFLAGS_ROCE_CRC	UINT32_C(0x100)
3383 	/*
3384 	 * If set to '1', then the FCoE CRC will be appended to the
3385 	 * packet. Packet must be a valid FCoE format packet.
3386 	 */
3387 	#define TX_BD_LONG_LFLAGS_FCOE_CRC	UINT32_C(0x200)
3388 	/*
3389 	 * If set to '1', then the timestamp from the BD is used. If cleared
3390 	 * to 0, then TWE provides the timestamp.
3391 	 */
3392 	/*
3393 	 * The BD timestamp feature cannot be enabled concurrently with
3394 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3395 	 * shall never both be set in a BD.
3396 	 */
3397 	#define TX_BD_LONG_LFLAGS_BD_TS_EN	UINT32_C(0x400)
3398 	/*
3399 	 * If set to '1', this operation will cause a trace capture in each
3400 	 * block it passes through.
3401 	 */
3402 	#define TX_BD_LONG_LFLAGS_DEBUG_TRACE	UINT32_C(0x800)
3403 	/*
3404 	 * This bit, in conjunction with the stamp bit, controls whether a
3405 	 * TX packet timestamp is collected and the type of timestamp that
3406 	 * is collected.
3407 	 *
3408 	 * See the stamp field for a description of the valid combinations of
3409 	 * stamp and stamp_1step.
3410 	 *
3411 	 * This bit must be valid on the first BD of a packet.
3412 	 */
3413 	#define TX_BD_LONG_LFLAGS_STAMP_1STEP	UINT32_C(0x1000)
3414 	/*
3415 	 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3416 	 * field with hardware calculated IP checksum for the IP header of the
3417 	 * packet associated with this descriptor. For outer UDP checksum, it
3418 	 * will be the following behavior for all cases independent of
3419 	 * settings of inner LSO and checksum offload BD flags.
3420 	 * If outer UDP checksum is 0, then do not update it.
3421 	 * If outer UDP checksum is non zero, then  the hardware should
3422 	 * compute and update it.
3423 	 */
3424 	#define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x2000)
3425 	/*
3426 	 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel
3427 	 * IP header will not be modified during LSO operations. If set to one
3428 	 * when LSO is '1', then the IPID of the Outer-tunnel IP header will
3429 	 * be incremented for each subsequent segment of an LSO operation. The
3430 	 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3431 	 * packet.
3432 	 */
3433 	#define TX_BD_LONG_LFLAGS_OT_IPID		UINT32_C(0x4000)
3434 	/*
3435 	 * If set to '1', When set to 1, KTLS encryption will be enabled for
3436 	 * the packet.
3437 	 */
3438 	/*
3439 	 * The BD timestamp feature cannot be enabled concurrently with
3440 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3441 	 * shall never both be set in a BD.
3442 	 */
3443 	#define TX_BD_LONG_LFLAGS_CRYPTO_EN	UINT32_C(0x8000)
3444 	uint16_t	kid_or_ts_low_hdr_size;
3445 	/*
3446 	 * When LSO is '1', this field must contain the offset of the
3447 	 * TCP payload from the beginning of the packet in as
3448 	 * 16b words. In case of encapsulated/tunneling packet, this field
3449 	 * contains the offset of the inner TCP payload from beginning of the
3450 	 * packet as 16-bit words.
3451 	 *
3452 	 * This value must be valid on the first BD of a packet.
3453 	 */
3454 	#define TX_BD_LONG_HDR_SIZE_MASK	UINT32_C(0x1ff)
3455 	#define TX_BD_LONG_HDR_SIZE_SFT	0
3456 	/*
3457 	 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3458 	 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3459 	 * the 20-bit KID.
3460 	 */
3461 	/*
3462 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3463 	 * only implies that this value must not be used when filling this
3464 	 * field for crypto packets.
3465 	 */
3466 	#define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00)
3467 	#define TX_BD_LONG_KID_OR_TS_LOW_SFT 9
3468 	uint32_t	kid_or_ts_high_mss;
3469 	/*
3470 	 * This is the MSS value that will be used to do the LSO processing.
3471 	 * The value is the length in bytes of the TCP payload for each
3472 	 * segment generated by the LSO operation.
3473 	 *
3474 	 * This value must be valid on the first BD of a packet.
3475 	 */
3476 	#define TX_BD_LONG_MSS_MASK	UINT32_C(0x7fff)
3477 	#define TX_BD_LONG_MSS_SFT		0
3478 	/*
3479 	 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3480 	 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3481 	 * of this field contain the upper 13 bits of the 20-bit KID.
3482 	 */
3483 	/*
3484 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3485 	 * only implies that this value must not be used when filling this
3486 	 * field for crypto packets.
3487 	 */
3488 	#define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3489 	#define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15
3490 	/*
3491 	 * This value selects bits 25:16 of the CFA action to perform on the
3492 	 * packet. See the cfa_action field for more information.
3493 	 */
3494 	uint16_t	cfa_action_high;
3495 	#define TX_BD_LONG_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3496 	#define TX_BD_LONG_CFA_ACTION_HIGH_SFT 0
3497 	/*
3498 	 * This value selects a CFA action to perform on the packet.
3499 	 * Set this value to zero if no CFA action is desired.
3500 	 *
3501 	 * This value must be valid on the first BD of a packet.
3502 	 */
3503 	uint16_t	cfa_action;
3504 	/*
3505 	 * This value is action meta-data that defines CFA edit operations
3506 	 * that are done in addition to any action editing.
3507 	 */
3508 	uint32_t	cfa_meta;
3509 	/* When key=1, This is the VLAN tag VID value. */
3510 	#define TX_BD_LONG_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
3511 	#define TX_BD_LONG_CFA_META_VLAN_VID_SFT	0
3512 	/* When key=1, This is the VLAN tag DE value. */
3513 	#define TX_BD_LONG_CFA_META_VLAN_DE		UINT32_C(0x1000)
3514 	/* When key=1, This is the VLAN tag PRI value. */
3515 	#define TX_BD_LONG_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
3516 	#define TX_BD_LONG_CFA_META_VLAN_PRI_SFT	13
3517 	/* When key=1, This is the VLAN tag TPID select value. */
3518 	#define TX_BD_LONG_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
3519 	#define TX_BD_LONG_CFA_META_VLAN_TPID_SFT	16
3520 	/* 0x88a8 */
3521 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
3522 	/* 0x8100 */
3523 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
3524 	/* 0x9100 */
3525 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
3526 	/* 0x9200 */
3527 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
3528 	/* 0x9300 */
3529 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
3530 	/* Value programmed in CFA VLANTPID register. */
3531 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
3532 		#define TX_BD_LONG_CFA_META_VLAN_TPID_LAST	TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
3533 	/* When key=1, This is the VLAN tag TPID select value. */
3534 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
3535 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT	19
3536 	/*
3537 	 * This field identifies the type of edit to be performed
3538 	 * on the packet.
3539 	 *
3540 	 * This value must be valid on the first BD of a packet.
3541 	 */
3542 	#define TX_BD_LONG_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
3543 	#define TX_BD_LONG_CFA_META_KEY_SFT		28
3544 	/* No editing */
3545 		#define TX_BD_LONG_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
3546 	/*
3547 	 * - meta[17:16] - TPID select value (0 = 0x8100).
3548 	 * - meta[15:12] - PRI/DE value.
3549 	 * - meta[11:0] - VID value.
3550 	 */
3551 		#define TX_BD_LONG_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
3552 	/*
3553 	 * Provide metadata
3554 	 * - Wh+/SR - this option is not supported.
3555 	 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3556 	 *   is set in the Lookup Table.
3557 	 * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3558 	 *   en_bd_meta is set in the Lookup Table.
3559 	 */
3560 		#define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER  (UINT32_C(0x2) << 28)
3561 		#define TX_BD_LONG_CFA_META_KEY_LAST		TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER
3562 } tx_bd_long_hi_t, *ptx_bd_long_hi_t;
3563 
3564 /*
3565  * This structure is used to inform the NIC of packet data that needs to
3566  * be transmitted with additional processing that requires extra data
3567  * such as VLAN insertion plus attached inline data.
3568  * This BD type may be used to improve latency for small packets needing
3569  * the additional extended features supported by long BDs.
3570  */
3571 /* tx_bd_long_inline (size:256b/32B) */
3572 
3573 typedef struct tx_bd_long_inline {
3574 	uint16_t	flags_type;
3575 	/* This value identifies the type of buffer descriptor. */
3576 	#define TX_BD_LONG_INLINE_TYPE_MASK		UINT32_C(0x3f)
3577 	#define TX_BD_LONG_INLINE_TYPE_SFT		0
3578 	/*
3579 	 * This type of BD is 32B long and is used for inline L2 packet
3580 	 * transmission.
3581 	 */
3582 		#define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
3583 		#define TX_BD_LONG_INLINE_TYPE_LAST		TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
3584 	/*
3585 	 * All bits in this field may be set on the first BD of a packet.
3586 	 * Only the packet_end bit may be set in non-first BDs.
3587 	 */
3588 	#define TX_BD_LONG_INLINE_FLAGS_MASK		UINT32_C(0xffc0)
3589 	#define TX_BD_LONG_INLINE_FLAGS_SFT		6
3590 	/*
3591 	 * If set to 1, the packet ends with the data in the buffer
3592 	 * pointed to by this descriptor. This flag must be
3593 	 * valid on every BD.
3594 	 */
3595 	#define TX_BD_LONG_INLINE_FLAGS_PACKET_END	UINT32_C(0x40)
3596 	/*
3597 	 * If set to 1, the device will not generate a completion for
3598 	 * this transmit packet unless there is an error in its processing.
3599 	 * If this bit is set to 0, then the packet will be completed
3600 	 * normally.
3601 	 *
3602 	 * This bit may be set only on the first BD of a packet.
3603 	 */
3604 	#define TX_BD_LONG_INLINE_FLAGS_NO_CMPL	UINT32_C(0x80)
3605 	/*
3606 	 * This value indicates how many 16B BD locations are consumed
3607 	 * in the ring by this packet, including the BD and inline
3608 	 * data.
3609 	 */
3610 	#define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3611 	#define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT	8
3612 	/* This field is deprecated. */
3613 	#define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3614 	#define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT	13
3615 	/*
3616 	 * If set to 1, the device immediately updates the Send Consumer
3617 	 * Index after the buffer associated with this descriptor has
3618 	 * been transferred via DMA to NIC memory from host memory. An
3619 	 * interrupt may or may not be generated according to the state
3620 	 * of the interrupt avoidance mechanisms. If this bit
3621 	 * is set to 0, then the Consumer Index is only updated as soon
3622 	 * as one of the host interrupt coalescing conditions has been met.
3623 	 *
3624 	 * This bit must be valid on the first BD of a packet.
3625 	 */
3626 	#define TX_BD_LONG_INLINE_FLAGS_COAL_NOW	UINT32_C(0x8000)
3627 	/*
3628 	 * This is the length of the inline data, not including BD length, in
3629 	 * bytes.
3630 	 * The maximum value is 480.
3631 	 *
3632 	 * This field must be valid on all BDs of a packet.
3633 	 */
3634 	/*
3635 	 * A fatal error will be generated if the value of this field
3636 	 * does not correspond with the value of flags.bd_cnt. For example, if
3637 	 * this field carries a value of 20, then bd_cnt must equal 4.
3638 	 */
3639 	uint16_t	len;
3640 	/*
3641 	 * The opaque data field is passed through to the completion and can be
3642 	 * used for any data that the driver wants to associate with the
3643 	 * transmit BD. This field must be valid on the first BD of a packet.
3644 	 * If completion coalescing is enabled on the TX ring, it is suggested
3645 	 * that the driver populate the opaque field to indicate the specific
3646 	 * TX ring with which the completion is associated, then utilize the
3647 	 * opaque and sq_cons_idx fields in the coalesced completion record to
3648 	 * determine the specific packets that are to be completed on that ring.
3649 	 *
3650 	 * This field must be valid on the first BD of a packet.
3651 	 */
3652 	uint32_t	opaque;
3653 	uint64_t	unused1;
3654 	/*
3655 	 * All bits in this field must be valid on the first BD of a packet.
3656 	 * Their value on other BDs of the packet is ignored.
3657 	 */
3658 	uint16_t	lflags;
3659 	/*
3660 	 * If set to 1, the controller replaces the TCP/UPD checksum
3661 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3662 	 * checksum field of the encapsulated TCP/UDP packets with the
3663 	 * hardware calculated TCP/UDP checksum for the packet associated
3664 	 * with this descriptor. The flag is ignored if the LSO flag is set.
3665 	 */
3666 	#define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
3667 	/*
3668 	 * If set to 1, the controller replaces the IP checksum of the
3669 	 * normal packets, or the inner IP checksum of the encapsulated
3670 	 * packets with the hardware calculated IP checksum for the
3671 	 * packet associated with this descriptor.
3672 	 */
3673 	#define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
3674 	/*
3675 	 * If set to 1, the controller will not append an Ethernet CRC
3676 	 * to the end of the frame.
3677 	 *
3678 	 * Packet must be 64B or longer when this flag is set. It is not
3679 	 * useful to use this bit with any form of TX offload such as
3680 	 * CSO or LSO. The intent is that the packet from the host already
3681 	 * has a valid Ethernet CRC on the packet.
3682 	 */
3683 	#define TX_BD_LONG_INLINE_LFLAGS_NOCRC		UINT32_C(0x4)
3684 	/*
3685 	 * If set to 1, the device will record the time at which the packet
3686 	 * was actually transmitted at the TX MAC for 2-step time sync. This
3687 	 * bit must be valid on the first BD of a packet.
3688 	 */
3689 	#define TX_BD_LONG_INLINE_LFLAGS_STAMP		UINT32_C(0x8)
3690 	/*
3691 	 * If set to 1, the controller replaces the tunnel IP checksum
3692 	 * field with hardware calculated IP checksum for the IP header
3693 	 * of the packet associated with this descriptor. The hardware
3694 	 * updates an outer UDP checksum if it is non-zero.
3695 	 */
3696 	#define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
3697 	/*
3698 	 * This bit must be 0 for BDs of this type. LSO is not supported with
3699 	 * inline BDs.
3700 	 */
3701 	#define TX_BD_LONG_INLINE_LFLAGS_LSO		UINT32_C(0x20)
3702 	/* Since LSO is not supported with inline BDs, this bit is not used. */
3703 	#define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT	UINT32_C(0x40)
3704 	/* Since LSO is not supported with inline BDs, this bit is not used. */
3705 	#define TX_BD_LONG_INLINE_LFLAGS_T_IPID		UINT32_C(0x80)
3706 	/*
3707 	 * If set to '1', then the RoCE ICRC will be appended to the
3708 	 * packet. Packet must be a valid RoCE format packet.
3709 	 */
3710 	#define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC	UINT32_C(0x100)
3711 	/*
3712 	 * If set to '1', then the FCoE CRC will be appended to the
3713 	 * packet. Packet must be a valid FCoE format packet.
3714 	 */
3715 	#define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC	UINT32_C(0x200)
3716 	/*
3717 	 * If set to '1', then the timestamp from the BD is used. If cleared
3718 	 * to 0, then TWE provides the timestamp.
3719 	 */
3720 	/*
3721 	 * The BD timestamp feature cannot be enabled concurrently with
3722 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3723 	 * shall never both be set in a BD.
3724 	 */
3725 	#define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN	UINT32_C(0x400)
3726 	/*
3727 	 * If set to '1', this operation will cause a trace capture in each
3728 	 * block it passes through.
3729 	 */
3730 	#define TX_BD_LONG_INLINE_LFLAGS_DEBUG_TRACE	UINT32_C(0x800)
3731 	/*
3732 	 * If set to '1', the device will record the time at which the packet
3733 	 * was actually transmitted at the TX MAC for 1-step time sync. This
3734 	 * bit must be valid on the first BD of a packet.
3735 	 */
3736 	#define TX_BD_LONG_INLINE_LFLAGS_STAMP_1STEP	UINT32_C(0x1000)
3737 	/*
3738 	 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3739 	 * field with hardware calculated IP checksum for the IP header of the
3740 	 * packet associated with this descriptor. For outer UDP checksum, it
3741 	 * will be the following behavior for all cases independent of settings
3742 	 * of inner LSO and checksum offload BD flags. If outer UDP checksum
3743 	 * is 0, then do not update it. If outer UDP checksum is non zero, then
3744 	 * the hardware should compute and update it.
3745 	 */
3746 	#define TX_BD_LONG_INLINE_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x2000)
3747 	/*
3748 	 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
3749 	 * header will not be modified during LSO operations. If set to one
3750 	 * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
3751 	 * incremented for each subsequent segment of an LSO operation. The
3752 	 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3753 	 * packet.
3754 	 */
3755 	#define TX_BD_LONG_INLINE_LFLAGS_OT_IPID		UINT32_C(0x4000)
3756 	/*
3757 	 * If set to '1', When set to 1, KTLS encryption will be enabled for
3758 	 * the packet.
3759 	 */
3760 	/*
3761 	 * The BD timestamp feature cannot be enabled concurrently with
3762 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3763 	 * shall never both be set in a BD.
3764 	 */
3765 	#define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN	UINT32_C(0x8000)
3766 	uint8_t	unused2;
3767 	uint8_t	kid_or_ts_low;
3768 	#define TX_BD_LONG_INLINE_UNUSED		UINT32_C(0x1)
3769 	/*
3770 	 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3771 	 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3772 	 * the 20-bit KID.
3773 	 */
3774 	/*
3775 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3776 	 * only implies that this value must not be used when filling this
3777 	 * field for crypto packets.
3778 	 */
3779 	#define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe)
3780 	#define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1
3781 	uint32_t	kid_or_ts_high;
3782 	#define TX_BD_LONG_INLINE_UNUSED_MASK	UINT32_C(0x7fff)
3783 	#define TX_BD_LONG_INLINE_UNUSED_SFT	0
3784 	/*
3785 	 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3786 	 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3787 	 * of this field contain the upper 13 bits of the 20-bit KID.
3788 	 */
3789 	/*
3790 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3791 	 * only implies that this value must not be used when filling this
3792 	 * field for crypto packets.
3793 	 */
3794 	#define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3795 	#define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15
3796 	/*
3797 	 * This value selects bits 25:16 of the CFA action to perform on the
3798 	 * packet. See the cfa_action field for more information.
3799 	 */
3800 	uint16_t	cfa_action_high;
3801 	#define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3802 	#define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_SFT 0
3803 	/*
3804 	 * This value selects a CFA action to perform on the packet.
3805 	 * Set this value to zero if no CFA action is desired.
3806 	 *
3807 	 * This value must be valid on the first BD of a packet.
3808 	 */
3809 	uint16_t	cfa_action;
3810 	/*
3811 	 * This value is action meta-data that defines CFA edit operations
3812 	 * that are done in addition to any action editing.
3813 	 */
3814 	uint32_t	cfa_meta;
3815 	/* When key = 1, this is the VLAN tag VID value. */
3816 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
3817 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT	0
3818 	/* When key = 1, this is the VLAN tag DE value. */
3819 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_DE		UINT32_C(0x1000)
3820 	/* When key = 1, this is the VLAN tag PRI value. */
3821 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
3822 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT	13
3823 	/* When key = 1, this is the VLAN tag TPID select value. */
3824 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
3825 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT	16
3826 	/* 0x88a8 */
3827 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
3828 	/* 0x8100 */
3829 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
3830 	/* 0x9100 */
3831 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
3832 	/* 0x9200 */
3833 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
3834 	/* 0x9300 */
3835 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
3836 	/* Value programmed in CFA VLANTPID register. */
3837 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
3838 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST	TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
3839 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
3840 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT	19
3841 	/*
3842 	 * This field identifies the type of edit to be performed
3843 	 * on the packet.
3844 	 *
3845 	 * This value must be valid on the first BD of a packet.
3846 	 */
3847 	#define TX_BD_LONG_INLINE_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
3848 	#define TX_BD_LONG_INLINE_CFA_META_KEY_SFT		28
3849 	/* No editing */
3850 		#define TX_BD_LONG_INLINE_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
3851 	/*
3852 	 * - meta[17:16] - TPID select value (0 = 0x8100).
3853 	 * - meta[15:12] - PRI/DE value.
3854 	 * - meta[11:0] - VID value.
3855 	 */
3856 		#define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
3857 	/*
3858 	 * Provide metadata
3859 	 * - Wh+/SR - this option is not supported.
3860 	 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3861 	 *   is set in the Lookup Table.
3862 	 * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3863 	 *   en_bd_meta is set in the Lookup Table.
3864 	 */
3865 		#define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER  (UINT32_C(0x2) << 28)
3866 		#define TX_BD_LONG_INLINE_CFA_META_KEY_LAST		TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER
3867 } tx_bd_long_inline_t, *ptx_bd_long_inline_t;
3868 
3869 /* tx_bd_empty (size:128b/16B) */
3870 
3871 typedef struct tx_bd_empty {
3872 	/* This value identifies the type of buffer descriptor. */
3873 	uint8_t	type;
3874 	#define TX_BD_EMPTY_TYPE_MASK	UINT32_C(0x3f)
3875 	#define TX_BD_EMPTY_TYPE_SFT	0
3876 	/*
3877 	 * Indicates that this BD is 1BB long and is an empty
3878 	 * TX BD. Not valid for use by the driver.
3879 	 */
3880 		#define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
3881 		#define TX_BD_EMPTY_TYPE_LAST	TX_BD_EMPTY_TYPE_TX_BD_EMPTY
3882 	uint8_t	unused_1[3];
3883 	uint8_t	unused_2;
3884 	uint8_t	unused_3[3];
3885 	uint8_t	unused_4[8];
3886 } tx_bd_empty_t, *ptx_bd_empty_t;
3887 
3888 /* tx_bd_mp_cmd (size:128b/16B) */
3889 
3890 typedef struct tx_bd_mp_cmd {
3891 	/* Unless otherwise stated, sub-fields of this field are always valid. */
3892 	uint16_t	flags_type;
3893 	/* This value identifies the type of buffer descriptor. */
3894 	#define TX_BD_MP_CMD_TYPE_MASK	UINT32_C(0x3f)
3895 	#define TX_BD_MP_CMD_TYPE_SFT	0
3896 	/*
3897 	 * Indicates that this BD is used to issue a command to one of
3898 	 * the mid-path destinations.
3899 	 */
3900 		#define TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD  UINT32_C(0x8)
3901 		#define TX_BD_MP_CMD_TYPE_LAST	TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD
3902 	#define TX_BD_MP_CMD_FLAGS_MASK	UINT32_C(0xffc0)
3903 	#define TX_BD_MP_CMD_FLAGS_SFT	6
3904 	/*  */
3905 	#define TX_BD_MP_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
3906 	#define TX_BD_MP_CMD_FLAGS_UNUSED_SFT  6
3907 	/*
3908 	 * This value indicates the number of 16B BD locations (slots)
3909 	 * consumed in the ring by this mid-path command BD, including the
3910 	 * BD header and the command field.
3911 	 */
3912 	#define TX_BD_MP_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3913 	#define TX_BD_MP_CMD_FLAGS_BD_CNT_SFT  8
3914 	/*
3915 	 * This value defines the length of command field in bytes. The maximum
3916 	 * value shall be 496.
3917 	 */
3918 	/*
3919 	 * Note that a fatal error will be generated if the value of this field
3920 	 * does not correspond with the value of flags.bd_cnt. For example, if
3921 	 * this field carries a value of 20, then bd_cnt must equal 3.
3922 	 */
3923 	uint16_t	len;
3924 	/*
3925 	 * The opaque data field is pass through to the completion and can be
3926 	 * used for any data that the driver wants to associate with this
3927 	 * Tx mid-path command.
3928 	 */
3929 	uint32_t	opaque;
3930 	uint64_t	unused1;
3931 } tx_bd_mp_cmd_t, *ptx_bd_mp_cmd_t;
3932 
3933 /* tx_bd_presync_cmd (size:128b/16B) */
3934 
3935 typedef struct tx_bd_presync_cmd {
3936 	/* Unless otherwise stated, sub-fields of this field are always valid. */
3937 	uint16_t	flags_type;
3938 	/* This value identifies the type of buffer descriptor. */
3939 	#define TX_BD_PRESYNC_CMD_TYPE_MASK		UINT32_C(0x3f)
3940 	#define TX_BD_PRESYNC_CMD_TYPE_SFT		0
3941 	/*
3942 	 * Indicates that this BD is used to issue a cryptographic pre-
3943 	 * sync command through the fast path and destined for TCE.
3944 	 */
3945 		#define TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
3946 		#define TX_BD_PRESYNC_CMD_TYPE_LAST		TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD
3947 	#define TX_BD_PRESYNC_CMD_FLAGS_MASK		UINT32_C(0xffc0)
3948 	#define TX_BD_PRESYNC_CMD_FLAGS_SFT		6
3949 	/*  */
3950 	#define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_MASK	UINT32_C(0xc0)
3951 	#define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_SFT	6
3952 	/*
3953 	 * This value indicates the number of 16B BD locations (slots)
3954 	 * consumed in the ring by this pre-sync command BD, including the
3955 	 * BD header and the command field.
3956 	 */
3957 	#define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3958 	#define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_SFT	8
3959 	/*
3960 	 * This value defines the length of command field in bytes. The maximum
3961 	 * value shall be 496.
3962 	 */
3963 	/*
3964 	 * Note that a fatal error will be generated if the value of this field
3965 	 * does not correspond with the value of flags.bd_cnt. For example, if
3966 	 * this field carries a value of 20, then bd_cnt must equal 3.
3967 	 */
3968 	uint16_t	len;
3969 	/*
3970 	 * The opaque data field is pass through to TCE and can be used for
3971 	 * debug.
3972 	 */
3973 	uint32_t	opaque;
3974 	/*
3975 	 * This field is the Crypto Context ID to which the retransmit packet is
3976 	 * applied. The KID references the context fields used by the
3977 	 * associated kTLS offloaded connection.
3978 	 */
3979 	uint32_t	kid;
3980 	/*
3981 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3982 	 * only implies that this value must not be used when filling this
3983 	 * field for crypto packets.
3984 	 */
3985 	#define TX_BD_PRESYNC_CMD_KID_VAL_MASK UINT32_C(0xfffff)
3986 	#define TX_BD_PRESYNC_CMD_KID_VAL_SFT 0
3987 	uint32_t	unused_1;
3988 } tx_bd_presync_cmd_t, *ptx_bd_presync_cmd_t;
3989 
3990 /* rx_prod_pkt_bd (size:128b/16B) */
3991 
3992 typedef struct rx_prod_pkt_bd {
3993 	/* This value identifies the type of buffer descriptor. */
3994 	uint16_t	flags_type;
3995 	/* This value identifies the type of buffer descriptor. */
3996 	#define RX_PROD_PKT_BD_TYPE_MASK	UINT32_C(0x3f)
3997 	#define RX_PROD_PKT_BD_TYPE_SFT	0
3998 	/*
3999 	 * Indicates that this BD is 16B long and is an RX Producer
4000 	 * (i.e. empty) buffer descriptor.
4001 	 */
4002 		#define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT	UINT32_C(0x4)
4003 		#define RX_PROD_PKT_BD_TYPE_LAST	RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
4004 	#define RX_PROD_PKT_BD_FLAGS_MASK	UINT32_C(0xffc0)
4005 	#define RX_PROD_PKT_BD_FLAGS_SFT	6
4006 	/*
4007 	 * If set to 1, the packet will be placed at the address plus
4008 	 * 2B. The 2 Bytes of padding will be written as zero.
4009 	 */
4010 	/*
4011 	 * This is intended to be used when the host buffer is
4012 	 * cache-line aligned to produce packets that are easy to
4013 	 * parse in host memory while still allowing writes to be cache
4014 	 * line aligned.
4015 	 */
4016 	#define RX_PROD_PKT_BD_FLAGS_SOP_PAD	UINT32_C(0x40)
4017 	/*
4018 	 * If set to 1, the packet write will be padded out to the
4019 	 * nearest cache-line with zero value padding.
4020 	 */
4021 	/*
4022 	 * If receive buffers start/end on cache-line boundaries, this
4023 	 * feature will ensure that all data writes on the PCI bus
4024 	 * start/end on cache line boundaries.
4025 	 */
4026 	#define RX_PROD_PKT_BD_FLAGS_EOP_PAD	UINT32_C(0x80)
4027 	/*
4028 	 * This field has been deprecated. There can be no additional
4029 	 * BDs for this packet from this ring.
4030 	 *
4031 	 * Old definition:
4032 	 * This value is the number of additional buffers in the ring that
4033 	 * describe the buffer space to be consumed for this packet.
4034 	 * If the value is zero, then the packet must fit within the
4035 	 * space described by this BD. If this value is 1 or more, it
4036 	 * indicates how many additional "buffer" BDs are in the ring
4037 	 * immediately following this BD to be used for the same
4038 	 * network packet. Even if the packet to be placed does not need
4039 	 * all the additional buffers, they will be consumed anyway.
4040 	 */
4041 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
4042 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
4043 	/*
4044 	 * This is the length in Bytes of the host physical buffer where
4045 	 * data for the packet may be placed in host memory.
4046 	 */
4047 	/*
4048 	 * While this is a Byte resolution value, it is often advantageous
4049 	 * to ensure that the buffers provided end on a host cache line.
4050 	 */
4051 	uint16_t	len;
4052 	/*
4053 	 * The opaque data field is pass through to the completion and can be
4054 	 * used for any data that the driver wants to associate with this
4055 	 * receive buffer set.
4056 	 */
4057 	uint32_t	opaque;
4058 	/*
4059 	 * This is the host physical address where data for the packet may
4060 	 * be placed in host memory.
4061 	 */
4062 	/*
4063 	 * While this is a Byte resolution value, it is often advantageous
4064 	 * to ensure that the buffers provide start on a host cache line.
4065 	 */
4066 	uint64_t	addr;
4067 } rx_prod_pkt_bd_t, *prx_prod_pkt_bd_t;
4068 
4069 /* rx_prod_bfr_bd (size:128b/16B) */
4070 
4071 typedef struct rx_prod_bfr_bd {
4072 	/* This value identifies the type of buffer descriptor. */
4073 	uint16_t	flags_type;
4074 	/* This value identifies the type of buffer descriptor. */
4075 	#define RX_PROD_BFR_BD_TYPE_MASK	UINT32_C(0x3f)
4076 	#define RX_PROD_BFR_BD_TYPE_SFT	0
4077 	/*
4078 	 * Indicates that this BD is 16B long and is an RX
4079 	 * Producer Buffer BD.
4080 	 */
4081 		#define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
4082 		#define RX_PROD_BFR_BD_TYPE_LAST	RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
4083 	#define RX_PROD_BFR_BD_FLAGS_MASK	UINT32_C(0xffc0)
4084 	#define RX_PROD_BFR_BD_FLAGS_SFT	6
4085 	/*
4086 	 * This is the length in Bytes of the host physical buffer where
4087 	 * data for the packet may be placed in host memory.
4088 	 */
4089 	/*
4090 	 * While this is a Byte resolution value, it is often advantageous
4091 	 * to ensure that the buffers provided end on a host cache line.
4092 	 */
4093 	uint16_t	len;
4094 	/* This field is not used. */
4095 	uint32_t	opaque;
4096 	/*
4097 	 * This is the host physical address where data for the packet may
4098 	 * be placed in host memory.
4099 	 */
4100 	/*
4101 	 * While this is a Byte resolution value, it is often advantageous
4102 	 * to ensure that the buffers provide start on a host cache line.
4103 	 */
4104 	uint64_t	addr;
4105 } rx_prod_bfr_bd_t, *prx_prod_bfr_bd_t;
4106 
4107 /* rx_prod_agg_bd (size:128b/16B) */
4108 
4109 typedef struct rx_prod_agg_bd {
4110 	/* This value identifies the type of buffer descriptor. */
4111 	uint16_t	flags_type;
4112 	/* This value identifies the type of buffer descriptor. */
4113 	#define RX_PROD_AGG_BD_TYPE_MASK	UINT32_C(0x3f)
4114 	#define RX_PROD_AGG_BD_TYPE_SFT	0
4115 	/*
4116 	 * Indicates that this BD is 16B long and is an
4117 	 * RX Producer Assembly Buffer Descriptor.
4118 	 */
4119 		#define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG	UINT32_C(0x6)
4120 		#define RX_PROD_AGG_BD_TYPE_LAST	RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
4121 	#define RX_PROD_AGG_BD_FLAGS_MASK	UINT32_C(0xffc0)
4122 	#define RX_PROD_AGG_BD_FLAGS_SFT	6
4123 	/*
4124 	 * If set to 1, the packet write will be padded out to the
4125 	 * nearest cache-line with zero value padding.
4126 	 */
4127 	/*
4128 	 * If receive buffers start/end on cache-line boundaries, this
4129 	 * feature will ensure that all data writes on the PCI bus
4130 	 * end on cache line boundaries.
4131 	 */
4132 	#define RX_PROD_AGG_BD_FLAGS_EOP_PAD	UINT32_C(0x40)
4133 	/*
4134 	 * This is the length in Bytes of the host physical buffer where
4135 	 * data for the packet may be placed in host memory.
4136 	 */
4137 	/*
4138 	 * While this is a Byte resolution value, it is often advantageous
4139 	 * to ensure that the buffers provided end on a host cache line.
4140 	 */
4141 	uint16_t	len;
4142 	/*
4143 	 * The opaque data field is pass through to the completion and can be
4144 	 * used for any data that the driver wants to associate with this
4145 	 * receive assembly buffer.
4146 	 */
4147 	uint32_t	opaque;
4148 	/*
4149 	 * This is the host physical address where data for the packet may
4150 	 * be placed in host memory.
4151 	 */
4152 	/*
4153 	 * While this is a Byte resolution value, it is often advantageous
4154 	 * to ensure that the buffers provide start on a host cache line.
4155 	 */
4156 	uint64_t	addr;
4157 } rx_prod_agg_bd_t, *prx_prod_agg_bd_t;
4158 
4159 /* cfa_cmpls_cmp_data_msg (size:128b/16B) */
4160 
4161 typedef struct cfa_cmpls_cmp_data_msg {
4162 	uint32_t	mp_client_dma_length_opcode_status_type;
4163 	/*
4164 	 * This field represents the Mid-Path client that generated the
4165 	 * completion.
4166 	 */
4167 	/*
4168 	 * This field indicates the exact type of the completion. By
4169 	 * convention, the LSB identifies the length of the record in 16B
4170 	 * units. Even values indicate 16B records. Odd values indicate 32B
4171 	 * records.
4172 	 */
4173 	#define CFA_CMPLS_CMP_DATA_MSG_TYPE_MASK		UINT32_C(0x3f)
4174 	#define CFA_CMPLS_CMP_DATA_MSG_TYPE_SFT		0
4175 	/* Mid Path Short Completion with length = 16B. */
4176 		#define CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT	UINT32_C(0x1e)
4177 		#define CFA_CMPLS_CMP_DATA_MSG_TYPE_LAST		CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
4178 	/* This value indicates the status for the command. */
4179 	#define CFA_CMPLS_CMP_DATA_MSG_STATUS_MASK		UINT32_C(0x3c0)
4180 	#define CFA_CMPLS_CMP_DATA_MSG_STATUS_SFT		6
4181 	/* Completed without error. */
4182 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_OK		(UINT32_C(0x0) << 6)
4183 	/* Indicates an unsupported CFA opcode in the command. */
4184 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_UNSPRT_ERR	(UINT32_C(0x1) << 6)
4185 	/*
4186 	 * Indicates a CFA command formatting error. This error can occur on
4187 	 * any of the supported CFA commands.
4188 	 */
4189 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_FMT_ERR		(UINT32_C(0x2) << 6)
4190 	/*
4191 	 * Indicates an SVIF-Table scope error. This error can occur on any
4192 	 * of the supported CFA commands.
4193 	 */
4194 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_SCOPE_ERR	(UINT32_C(0x3) << 6)
4195 	/*
4196 	 * Indicates that the table_index is either outside of the
4197 	 * table_scope range set by its EM_SIZE or, for EM Insert, it is in
4198 	 * the static bucket range. This error can occur on EM Insert
4199 	 * commands. It can also occur on Read, Read Clear, Write, and
4200 	 * Invalidate commands if the table_type is EM.
4201 	 */
4202 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_ADDR_ERR		(UINT32_C(0x4) << 6)
4203 	/*
4204 	 * Cache operation responded with an error. This error can occur on
4205 	 * Read, Read Clear, Write, EM Insert, and EM Delete commands.
4206 	 */
4207 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_CACHE_ERR	(UINT32_C(0x5) << 6)
4208 	/*
4209 	 * Indicates failure on EM Insert or EM Delete Command. Hash index
4210 	 * and hash msb are returned in table_index and hash_msb fields.
4211 	 * Dma_length is set to 1 if the bucket is also returned (as dma
4212 	 * data).
4213 	 */
4214 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_EM_FAIL		(UINT32_C(0x6) << 6)
4215 	/*
4216 	 * Indicates no notifications were available on an Event Collection
4217 	 * command.
4218 	 */
4219 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL  (UINT32_C(0x7) << 6)
4220 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_LAST		CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL
4221 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_MASK		UINT32_C(0xc00)
4222 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_SFT		10
4223 	/* This is the opcode from the command. */
4224 	#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_MASK		UINT32_C(0xff000)
4225 	#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_SFT		12
4226 	/*
4227 	 * This is read command. From 32 to 128B can be read from a table
4228 	 * using this command.
4229 	 */
4230 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ		(UINT32_C(0x0) << 12)
4231 	/*
4232 	 * This is write command. From 32 to 128B can be written to a table
4233 	 * using this command.
4234 	 */
4235 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_WRITE		(UINT32_C(0x1) << 12)
4236 	/*
4237 	 * This is read-clear command. 32B can be read from a table and a 16b
4238 	 * mask can be used to clear specific 16b units after the read as an
4239 	 * atomic operation.
4240 	 */
4241 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ_CLR		(UINT32_C(0x2) << 12)
4242 	/*
4243 	 * An exact match table insert will be attempted into the table. If
4244 	 * there is a free location in the bucket, the payload will be
4245 	 * written to the bucket.
4246 	 */
4247 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_INSERT	(UINT32_C(0x3) << 12)
4248 	/* An exact match table delete will be attempted. */
4249 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_DELETE	(UINT32_C(0x4) << 12)
4250 	/*
4251 	 * The specified table area will be invalidated. If it is needed
4252 	 * again, it will be read from the backing store.
4253 	 */
4254 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_INVALIDATE	(UINT32_C(0x5) << 12)
4255 	/* Reads notification messages from the Host Notification Queue. */
4256 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT	(UINT32_C(0x6) << 12)
4257 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_LAST		CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT
4258 	/*
4259 	 * This field indicates the length of the DMA that accompanies the
4260 	 * completion. Specified in units of DWords (32b). Valid values are
4261 	 * between 0 and 128. A value of zero indicates that there is no DMA
4262 	 * that accompanies the completion.
4263 	 */
4264 	#define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_MASK	UINT32_C(0xff00000)
4265 	#define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_SFT	20
4266 	/*
4267 	 * This field represents the Mid-Path client that generated the
4268 	 * completion.
4269 	 */
4270 	#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK	UINT32_C(0xf0000000)
4271 	#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT		28
4272 	/* TX configurable flow processing block. */
4273 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_TE_CFA	(UINT32_C(0x2) << 28)
4274 	/* RX configurable flow processing block. */
4275 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA	(UINT32_C(0x3) << 28)
4276 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST		CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA
4277 	/*
4278 	 * This is a copy of the opaque field from the mid path BD of this
4279 	 * command.
4280 	 */
4281 	uint32_t	opaque;
4282 	uint16_t	hash_msb_v;
4283 	/*
4284 	 * This value is written by the NIC such that it will be different for
4285 	 * each pass through the completion queue. The even passes will
4286 	 * write 1. The odd passes will write 0.
4287 	 */
4288 	#define CFA_CMPLS_CMP_DATA_MSG_V		UINT32_C(0x1)
4289 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xe)
4290 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_SFT  1
4291 	/*
4292 	 * This is the upper 12b of the hash, returned on Exact Match
4293 	 * Insertion/Deletion Commands.
4294 	 */
4295 	#define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_MASK UINT32_C(0xfff0)
4296 	#define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_SFT 4
4297 	/* This is the table type from the command. */
4298 	uint8_t	table_type;
4299 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_MASK	UINT32_C(0xf)
4300 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_SFT	0
4301 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf0)
4302 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_SFT   4
4303 	/* This command acts on the action table of the specified scope. */
4304 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_ACTION  (UINT32_C(0x0) << 4)
4305 	/* This command acts on the exact match table of the specified scope. */
4306 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM	(UINT32_C(0x1) << 4)
4307 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_LAST   CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM
4308 	uint8_t	table_scope;
4309 	/* This is the table scope from the command. */
4310 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
4311 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_SFT 0
4312 	uint32_t	table_index;
4313 	/*
4314 	 * This is the table index from the command (if it exists). However, if
4315 	 * an Exact Match Insertion/Deletion command failed, then this is the
4316 	 * table index of the calculated static hash bucket.
4317 	 */
4318 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
4319 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_SFT 0
4320 } cfa_cmpls_cmp_data_msg_t, *pcfa_cmpls_cmp_data_msg_t;
4321 
4322 /* CFA Mid-Path 32B DMA Message */
4323 /* cfa_dma32b_data_msg (size:256b/32B) */
4324 
4325 typedef struct cfa_dma32b_data_msg {
4326 	/* DMA data value. */
4327 	uint32_t	dta[8];
4328 } cfa_dma32b_data_msg_t, *pcfa_dma32b_data_msg_t;
4329 
4330 /* CFA Mid-Path 64B DMA Message */
4331 /* cfa_dma64b_data_msg (size:512b/64B) */
4332 
4333 typedef struct cfa_dma64b_data_msg {
4334 	/* DMA data value. */
4335 	uint32_t	dta[16];
4336 } cfa_dma64b_data_msg_t, *pcfa_dma64b_data_msg_t;
4337 
4338 /* CFA Mid-Path 96B DMA Message */
4339 /* cfa_dma96b_data_msg (size:768b/96B) */
4340 
4341 typedef struct cfa_dma96b_data_msg {
4342 	/* DMA data value. */
4343 	uint32_t	dta[24];
4344 } cfa_dma96b_data_msg_t, *pcfa_dma96b_data_msg_t;
4345 
4346 /* CFA Mid-Path 128B DMA Message */
4347 /* cfa_dma128b_data_msg (size:1024b/128B) */
4348 
4349 typedef struct cfa_dma128b_data_msg {
4350 	/* DMA data value. */
4351 	uint32_t	dta[32];
4352 } cfa_dma128b_data_msg_t, *pcfa_dma128b_data_msg_t;
4353 
4354 /* ce_cmpls_cmp_data_msg (size:128b/16B) */
4355 
4356 typedef struct ce_cmpls_cmp_data_msg {
4357 	uint16_t	client_subtype_type;
4358 	/*
4359 	 * This field indicates the exact type of the completion. By
4360 	 * convention, the LSB identifies the length of the record in 16B
4361 	 * units. Even values indicate 16B records. Odd values indicate 32B
4362 	 * records.
4363 	 */
4364 	#define CE_CMPLS_CMP_DATA_MSG_TYPE_MASK	UINT32_C(0x3f)
4365 	#define CE_CMPLS_CMP_DATA_MSG_TYPE_SFT	0
4366 	/* Completion of a Mid Path Command. Length = 16B */
4367 		#define CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT  UINT32_C(0x1e)
4368 		#define CE_CMPLS_CMP_DATA_MSG_TYPE_LAST	CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
4369 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED0_MASK	UINT32_C(0xc0)
4370 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED0_SFT	6
4371 	/*
4372 	 * This value indicates the CE sub-type operation that is being
4373 	 * completed.
4374 	 */
4375 	#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_MASK	UINT32_C(0xf00)
4376 	#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SFT	8
4377 	/* Completion Response for a Solicited Command. */
4378 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SOLICITED	(UINT32_C(0x0) << 8)
4379 	/* Error Completion (Unsolicited). */
4380 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_ERR	(UINT32_C(0x1) << 8)
4381 	/* Re-Sync Completion (Unsolicited) */
4382 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC	(UINT32_C(0x2) << 8)
4383 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_LAST	CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC
4384 	/*
4385 	 * This field represents the Mid-Path client that generated the
4386 	 * completion.
4387 	 */
4388 	#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK	UINT32_C(0xf000)
4389 	#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT	12
4390 	/* TX crypto engine block. */
4391 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_TCE	(UINT32_C(0x0) << 12)
4392 	/* RX crypto engine block. */
4393 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_RCE	(UINT32_C(0x1) << 12)
4394 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST	CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_RCE
4395 	uint16_t	status;
4396 	/* This value indicates the status for the command. */
4397 	#define CE_CMPLS_CMP_DATA_MSG_STATUS_MASK	UINT32_C(0xf)
4398 	#define CE_CMPLS_CMP_DATA_MSG_STATUS_SFT	0
4399 	/* Completed without error. */
4400 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_OK	UINT32_C(0x0)
4401 	/* CFCK load error. */
4402 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_LD_ERR   UINT32_C(0x1)
4403 	/* FID check error. */
4404 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR  UINT32_C(0x2)
4405 	/* Context kind / MP version mismatch error. */
4406 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_VER_ERR  UINT32_C(0x3)
4407 	/* Unsupported Destination Connection ID Length. */
4408 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_DST_ID_ERR   UINT32_C(0x4)
4409 	/*
4410 	 * Invalid MP Command [anything other than ADD or DELETE
4411 	 * triggers this for QUIC].
4412 	 */
4413 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR   UINT32_C(0x5)
4414 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_LAST	CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR
4415 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED1_MASK	UINT32_C(0xfff0)
4416 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED1_SFT	4
4417 	/*
4418 	 * This is a copy of the opaque field from the mid path BD of this
4419 	 * command.
4420 	 */
4421 	uint32_t	opaque;
4422 	uint32_t	v;
4423 	/*
4424 	 * This value is written by the NIC such that it will be different
4425 	 * for each pass through the completion queue. The even passes will
4426 	 * write 1. The odd passes will write 0.
4427 	 */
4428 	#define CE_CMPLS_CMP_DATA_MSG_V	UINT32_C(0x1)
4429 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED2_MASK UINT32_C(0xfffffffe)
4430 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED2_SFT 1
4431 	uint32_t	kid;
4432 	/*
4433 	 * This field is the Crypto Context ID. The KID is used to store
4434 	 * information used by the associated kTLS offloaded connection.
4435 	 */
4436 	#define CE_CMPLS_CMP_DATA_MSG_KID_MASK	UINT32_C(0xfffff)
4437 	#define CE_CMPLS_CMP_DATA_MSG_KID_SFT	0
4438 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED3_MASK UINT32_C(0xfff00000)
4439 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED3_SFT 20
4440 } ce_cmpls_cmp_data_msg_t, *pce_cmpls_cmp_data_msg_t;
4441 
4442 /* cmpl_base (size:128b/16B) */
4443 
4444 typedef struct cmpl_base {
4445 	uint16_t	type;
4446 	/*
4447 	 * This field indicates the exact type of the completion.
4448 	 * By convention, the LSB identifies the length of the
4449 	 * record in 16B units. Even values indicate 16B
4450 	 * records. Odd values indicate 32B
4451 	 * records.
4452 	 */
4453 	#define CMPL_BASE_TYPE_MASK		UINT32_C(0x3f)
4454 	#define CMPL_BASE_TYPE_SFT		0
4455 	/*
4456 	 * TX L2 completion:
4457 	 * Completion of TX packet. Length = 16B
4458 	 */
4459 		#define CMPL_BASE_TYPE_TX_L2		UINT32_C(0x0)
4460 	/*
4461 	 * NO-OP completion:
4462 	 * Completion of NO-OP. Length = 16B
4463 	 */
4464 		#define CMPL_BASE_TYPE_NO_OP		UINT32_C(0x1)
4465 	/*
4466 	 * TX L2 coalesced completion:
4467 	 * Completion of coalesced TX packet. Length = 16B
4468 	 */
4469 		#define CMPL_BASE_TYPE_TX_L2_COAL	UINT32_C(0x2)
4470 	/*
4471 	 * TX L2 Packet Timestamp completion:
4472 	 * Completion of an L2 Packet Timestamp Packet. Length = 16B
4473 	 */
4474 		#define CMPL_BASE_TYPE_TX_L2_PKT_TS	UINT32_C(0x4)
4475 	/*
4476 	 * RX L2 TPA Start V2 Completion:
4477 	 * Completion of and L2 RX packet. Length = 32B
4478 	 * This is the new version of the RX_TPA_START completion used
4479 	 * in SR2 and later chips.
4480 	 */
4481 		#define CMPL_BASE_TYPE_RX_TPA_START_V2   UINT32_C(0xd)
4482 	/*
4483 	 * RX L2 V2 completion:
4484 	 * Completion of and L2 RX packet. Length = 32B
4485 	 * This is the new version of the RX_L2 completion used in SR2
4486 	 * and later chips.
4487 	 */
4488 		#define CMPL_BASE_TYPE_RX_L2_V2	UINT32_C(0xf)
4489 	/*
4490 	 * RX L2 completion:
4491 	 * This is the compressed version of Rx Completion for performance
4492 	 * applications. Length = 16B
4493 	 */
4494 		#define CMPL_BASE_TYPE_RX_L2_COMPRESS	UINT32_C(0x10)
4495 	/*
4496 	 * RX L2 completion:
4497 	 * Completion of and L2 RX packet. Length = 32B
4498 	 */
4499 		#define CMPL_BASE_TYPE_RX_L2		UINT32_C(0x11)
4500 	/*
4501 	 * RX Aggregation Buffer completion:
4502 	 * Completion of an L2 aggregation buffer in support of
4503 	 * TPA, HDS, or Jumbo packet completion. Length = 16B
4504 	 */
4505 		#define CMPL_BASE_TYPE_RX_AGG		UINT32_C(0x12)
4506 	/*
4507 	 * RX L2 TPA Start Completion:
4508 	 * Completion at the beginning of a TPA operation.
4509 	 * Length = 32B
4510 	 */
4511 		#define CMPL_BASE_TYPE_RX_TPA_START	UINT32_C(0x13)
4512 	/*
4513 	 * RX L2 TPA End Completion:
4514 	 * Completion at the end of a TPA operation.
4515 	 * Length = 32B
4516 	 */
4517 		#define CMPL_BASE_TYPE_RX_TPA_END	UINT32_C(0x15)
4518 	/*
4519 	 * RX TPA Aggregation Buffer Completion:
4520 	 * Completion of an L2 aggregation buffer in support of TPA packet
4521 	 * completion.
4522 	 * Length = 16B
4523 	 */
4524 		#define CMPL_BASE_TYPE_RX_TPA_AGG	UINT32_C(0x16)
4525 	/*
4526 	 * RX L2 completion: Completion of and L2 RX packet.
4527 	 * Length = 32B
4528 	 */
4529 		#define CMPL_BASE_TYPE_RX_L2_V3	UINT32_C(0x17)
4530 	/*
4531 	 * RX L2 TPA Start completion: Completion at the beginning of a TPA
4532 	 * operation.
4533 	 * Length = 32B
4534 	 */
4535 		#define CMPL_BASE_TYPE_RX_TPA_START_V3   UINT32_C(0x19)
4536 	/*
4537 	 * Statistics Ejection Completion:
4538 	 * Completion of statistics data ejection buffer.
4539 	 * Length = 16B
4540 	 */
4541 		#define CMPL_BASE_TYPE_STAT_EJECT	UINT32_C(0x1a)
4542 	/*
4543 	 * VEE Flush Completion:
4544 	 * This completion is inserted manually by
4545 	 * the Primate and processed by the VEE hardware to ensure that
4546 	 * all completions on a VEE function have been processed by the
4547 	 * VEE hardware before FLR process is completed.
4548 	 */
4549 		#define CMPL_BASE_TYPE_VEE_FLUSH	UINT32_C(0x1c)
4550 	/*
4551 	 * Mid Path Short Completion :
4552 	 * Completion of a Mid Path Command. Length = 16B
4553 	 */
4554 		#define CMPL_BASE_TYPE_MID_PATH_SHORT	UINT32_C(0x1e)
4555 	/*
4556 	 * Mid Path Long Completion :
4557 	 * Completion of a Mid Path Command. Length = 32B
4558 	 */
4559 		#define CMPL_BASE_TYPE_MID_PATH_LONG	UINT32_C(0x1f)
4560 	/*
4561 	 * HWRM Command Completion:
4562 	 * Completion of an HWRM command.
4563 	 */
4564 		#define CMPL_BASE_TYPE_HWRM_DONE	UINT32_C(0x20)
4565 	/* Forwarded HWRM Request */
4566 		#define CMPL_BASE_TYPE_HWRM_FWD_REQ	UINT32_C(0x22)
4567 	/* Forwarded HWRM Response */
4568 		#define CMPL_BASE_TYPE_HWRM_FWD_RESP	UINT32_C(0x24)
4569 	/* HWRM Asynchronous Event Information */
4570 		#define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
4571 	/* CQ Notification */
4572 		#define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
4573 	/* SRQ Threshold Event */
4574 		#define CMPL_BASE_TYPE_SRQ_EVENT	UINT32_C(0x32)
4575 	/* DBQ Threshold Event */
4576 		#define CMPL_BASE_TYPE_DBQ_EVENT	UINT32_C(0x34)
4577 	/* QP Async Notification */
4578 		#define CMPL_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
4579 	/* Function Async Notification */
4580 		#define CMPL_BASE_TYPE_FUNC_EVENT	UINT32_C(0x3a)
4581 		#define CMPL_BASE_TYPE_LAST		CMPL_BASE_TYPE_FUNC_EVENT
4582 	/* info1 is 16 b */
4583 	uint16_t	info1;
4584 	/* info2 is 32 b */
4585 	uint32_t	info2;
4586 	/*
4587 	 * This value is written by the NIC such that it will be different
4588 	 * for each pass through the completion queue. The even passes
4589 	 * will write 1. The odd passes will write 0.
4590 	 */
4591 	uint32_t	info3_v;
4592 	#define CMPL_BASE_V	UINT32_C(0x1)
4593 	#define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
4594 	#define CMPL_BASE_INFO3_SFT 1
4595 	/* info4 is 32 b */
4596 	uint32_t	info4;
4597 } cmpl_base_t, *pcmpl_base_t;
4598 
4599 /* tx_cmpl (size:128b/16B) */
4600 
4601 typedef struct tx_cmpl {
4602 	uint16_t	flags_type;
4603 	/*
4604 	 * This field indicates the exact type of the completion.
4605 	 * By convention, the LSB identifies the length of the
4606 	 * record in 16B units. Even values indicate 16B
4607 	 * records. Odd values indicate 32B
4608 	 * records.
4609 	 */
4610 	#define TX_CMPL_TYPE_MASK	UINT32_C(0x3f)
4611 	#define TX_CMPL_TYPE_SFT	0
4612 	/*
4613 	 * TX L2 completion:
4614 	 * Completion of TX packet. Length = 16B
4615 	 */
4616 		#define TX_CMPL_TYPE_TX_L2	UINT32_C(0x0)
4617 		#define TX_CMPL_TYPE_LAST	TX_CMPL_TYPE_TX_L2
4618 	#define TX_CMPL_FLAGS_MASK	UINT32_C(0xffc0)
4619 	#define TX_CMPL_FLAGS_SFT	6
4620 	/*
4621 	 * When this bit is '1', it indicates a packet that has an
4622 	 * error of some type. Type of error is indicated in
4623 	 * error_flags.
4624 	 */
4625 	#define TX_CMPL_FLAGS_ERROR	UINT32_C(0x40)
4626 	/*
4627 	 * When this bit is '1', it indicates that the packet completed
4628 	 * was transmitted using the push acceleration data provided
4629 	 * by the driver. When this bit is '0', it indicates that the
4630 	 * packet had not push acceleration data written or was executed
4631 	 * as a normal packet even though push data was provided.
4632 	 */
4633 	#define TX_CMPL_FLAGS_PUSH	UINT32_C(0x80)
4634 	/* unused1 is 16 b */
4635 	uint16_t	unused_0;
4636 	/*
4637 	 * This is a copy of the opaque field from the first TX BD of this
4638 	 * transmitted packet. Note that, if the packet was described by a short
4639 	 * CSO or short CSO inline BD, then the 16-bit opaque field from the
4640 	 * short CSO BD will appear in the bottom 16 bits of this field.
4641 	 */
4642 	uint32_t	opaque;
4643 	uint16_t	errors_v;
4644 	/*
4645 	 * This value is written by the NIC such that it will be different
4646 	 * for each pass through the completion queue. The even passes
4647 	 * will write 1. The odd passes will write 0.
4648 	 */
4649 	#define TX_CMPL_V				UINT32_C(0x1)
4650 	#define TX_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
4651 	#define TX_CMPL_ERRORS_SFT			1
4652 	/*
4653 	 * This error indicates that there was some sort of problem
4654 	 * with the BDs for the packet.
4655 	 */
4656 	#define TX_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
4657 	#define TX_CMPL_ERRORS_BUFFER_ERROR_SFT		1
4658 	/* No error */
4659 		#define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
4660 	/*
4661 	 * Bad Format:
4662 	 * BDs were not formatted correctly.
4663 	 */
4664 		#define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
4665 		#define TX_CMPL_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
4666 	/*
4667 	 * When this bit is '1', it indicates that the length of
4668 	 * the packet was zero. No packet was transmitted.
4669 	 */
4670 	#define TX_CMPL_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
4671 	/*
4672 	 * When this bit is '1', it indicates that the packet
4673 	 * was longer than the programmed limit in TDI. No
4674 	 * packet was transmitted.
4675 	 */
4676 	#define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
4677 	/*
4678 	 * When this bit is '1', it indicates that one or more of the
4679 	 * BDs associated with this packet generated a PCI error.
4680 	 * This probably means the address was not valid.
4681 	 */
4682 	#define TX_CMPL_ERRORS_DMA_ERROR			UINT32_C(0x40)
4683 	/*
4684 	 * When this bit is '1', it indicates that the packet was longer
4685 	 * than indicated by the hint. No packet was transmitted.
4686 	 */
4687 	#define TX_CMPL_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
4688 	/*
4689 	 * When this bit is '1', it indicates that the packet was
4690 	 * dropped due to Poison TLP error on one or more of the
4691 	 * TLPs in the PXP completion.
4692 	 */
4693 	#define TX_CMPL_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
4694 	/*
4695 	 * When this bit is '1', it indicates that the packet was dropped
4696 	 * due to a transient internal error in TDC. The packet or LSO can
4697 	 * be retried and may transmit successfully on a subsequent attempt.
4698 	 */
4699 	#define TX_CMPL_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
4700 	/*
4701 	 * When this bit is '1', it was not possible to collect a timestamp
4702 	 * for a PTP completion, in which case the timestamp_hi and
4703 	 * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4704 	 * completion, the timestamp_hi and timestamp_lo fields are valid.
4705 	 * RJRN will copy the value of this bit into the field of the same
4706 	 * name in all TX completions, regardless of whether such completions
4707 	 * are PTP completions or other TX completions.
4708 	 */
4709 	#define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
4710 	/* unused2 is 16 b */
4711 	uint16_t	unused_1;
4712 	/* unused3 is 32 b */
4713 	uint32_t	unused_2;
4714 } tx_cmpl_t, *ptx_cmpl_t;
4715 
4716 /* tx_cmpl_coal (size:128b/16B) */
4717 
4718 typedef struct tx_cmpl_coal {
4719 	uint16_t	flags_type;
4720 	/*
4721 	 * This field indicates the exact type of the completion.
4722 	 * By convention, the LSB identifies the length of the
4723 	 * record in 16B units. Even values indicate 16B
4724 	 * records. Odd values indicate 32B
4725 	 * records.
4726 	 */
4727 	#define TX_CMPL_COAL_TYPE_MASK	UINT32_C(0x3f)
4728 	#define TX_CMPL_COAL_TYPE_SFT	0
4729 	/*
4730 	 * TX L2 coalesced completion:
4731 	 * Completion of TX packet. Length = 16B
4732 	 */
4733 		#define TX_CMPL_COAL_TYPE_TX_L2_COAL   UINT32_C(0x2)
4734 		#define TX_CMPL_COAL_TYPE_LAST	TX_CMPL_COAL_TYPE_TX_L2_COAL
4735 	#define TX_CMPL_COAL_FLAGS_MASK	UINT32_C(0xffc0)
4736 	#define TX_CMPL_COAL_FLAGS_SFT	6
4737 	/*
4738 	 * When this bit is '1', it indicates a packet that has an
4739 	 * error of some type. Type of error is indicated in
4740 	 * error_flags.
4741 	 */
4742 	#define TX_CMPL_COAL_FLAGS_ERROR	UINT32_C(0x40)
4743 	/*
4744 	 * When this bit is '1', it indicates that the packet completed
4745 	 * was transmitted using the push acceleration data provided
4746 	 * by the driver. When this bit is '0', it indicates that the
4747 	 * packet had not push acceleration data written or was executed
4748 	 * as a normal packet even though push data was provided.
4749 	 */
4750 	#define TX_CMPL_COAL_FLAGS_PUSH	UINT32_C(0x80)
4751 	/* unused1 is 16 b */
4752 	uint16_t	unused_0;
4753 	/*
4754 	 * This is a copy of the opaque field from the first TX BD of the packet
4755 	 * which corresponds with the reported sq_cons_idx. Note that, with
4756 	 * coalesced completions, completions are generated for only some of the
4757 	 * packets. The driver will see the opaque field for only those packets.
4758 	 * Note that, if the packet was described by a short CSO or short CSO
4759 	 * inline BD, then the 16-bit opaque field from the short CSO BD will
4760 	 * appear in the bottom 16 bits of this field. For TX rings with
4761 	 * completion coalescing enabled (which would use the coalesced
4762 	 * completion record), it is suggested that the driver populate the
4763 	 * opaque field to indicate the specific TX ring with which the
4764 	 * completion is associated, then utilize the opaque and sq_cons_idx
4765 	 * fields in the coalesced completion record to determine the specific
4766 	 * packets that are to be completed on that ring.
4767 	 */
4768 	uint32_t	opaque;
4769 	uint16_t	errors_v;
4770 	/*
4771 	 * This value is written by the NIC such that it will be different
4772 	 * for each pass through the completion queue. The even passes
4773 	 * will write 1. The odd passes will write 0.
4774 	 */
4775 	#define TX_CMPL_COAL_V				UINT32_C(0x1)
4776 	#define TX_CMPL_COAL_ERRORS_MASK			UINT32_C(0xfffe)
4777 	#define TX_CMPL_COAL_ERRORS_SFT			1
4778 	/*
4779 	 * This error indicates that there was some sort of problem
4780 	 * with the BDs for the packet.
4781 	 */
4782 	#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
4783 	#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT		1
4784 	/* No error */
4785 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
4786 	/*
4787 	 * Bad Format:
4788 	 * BDs were not formatted correctly.
4789 	 */
4790 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
4791 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
4792 	/*
4793 	 * When this bit is '1', it indicates that the length of
4794 	 * the packet was zero. No packet was transmitted.
4795 	 */
4796 	#define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
4797 	/*
4798 	 * When this bit is '1', it indicates that the packet
4799 	 * was longer than the programmed limit in TDI. No
4800 	 * packet was transmitted.
4801 	 */
4802 	#define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
4803 	/*
4804 	 * When this bit is '1', it indicates that one or more of the
4805 	 * BDs associated with this packet generated a PCI error.
4806 	 * This probably means the address was not valid.
4807 	 */
4808 	#define TX_CMPL_COAL_ERRORS_DMA_ERROR			UINT32_C(0x40)
4809 	/*
4810 	 * When this bit is '1', it indicates that the packet was longer
4811 	 * than indicated by the hint. No packet was transmitted.
4812 	 */
4813 	#define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
4814 	/*
4815 	 * When this bit is '1', it indicates that the packet was
4816 	 * dropped due to Poison TLP error on one or more of the
4817 	 * TLPs in the PXP completion.
4818 	 */
4819 	#define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
4820 	/*
4821 	 * When this bit is '1', it indicates that the packet was dropped
4822 	 * due to a transient internal error in TDC. The packet or LSO can
4823 	 * be retried and may transmit successfully on a subsequent attempt.
4824 	 */
4825 	#define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
4826 	/*
4827 	 * When this bit is '1', it was not possible to collect a a timestamp
4828 	 * for a PTP completion, in which case the timestamp_hi and
4829 	 * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4830 	 * completion, the timestamp_hi and timestamp_lo fields are valid.
4831 	 * RJRN will copy the value of this bit into the field of the same
4832 	 * name in all TX completions, regardless of whether such
4833 	 * completions are PTP completions or other TX completions.
4834 	 */
4835 	#define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
4836 	/* unused2 is 16 b */
4837 	uint16_t	unused_1;
4838 	uint32_t	sq_cons_idx;
4839 	/*
4840 	 * This value is SQ index for the start of the packet following the
4841 	 * last completed packet.
4842 	 */
4843 	#define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
4844 	#define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
4845 } tx_cmpl_coal_t, *ptx_cmpl_coal_t;
4846 
4847 /* tx_cmpl_packet_timestamp (size:128b/16B) */
4848 
4849 typedef struct tx_cmpl_packet_timestamp {
4850 	uint16_t	ts_sub_ns_flags_type;
4851 	/*
4852 	 * This field indicates the exact type of the completion. By
4853 	 * convention, the LSB identifies the length of the record in 16B
4854 	 * units. Even values indicate 16B records. Odd values indicate
4855 	 * 32B records.
4856 	 */
4857 	#define TX_CMPL_PACKET_TIMESTAMP_TYPE_MASK		UINT32_C(0x3f)
4858 	#define TX_CMPL_PACKET_TIMESTAMP_TYPE_SFT		0
4859 	/*
4860 	 * TX L2 Packet Timestamp completion:
4861 	 * Completion of an L2 Packet Timestamp Packet. Length = 16B
4862 	 */
4863 		#define TX_CMPL_PACKET_TIMESTAMP_TYPE_TX_L2_PKT_TS	UINT32_C(0x4)
4864 		#define TX_CMPL_PACKET_TIMESTAMP_TYPE_LAST		TX_CMPL_PACKET_TIMESTAMP_TYPE_TX_L2_PKT_TS
4865 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_MASK		UINT32_C(0xfc0)
4866 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_SFT		6
4867 	/*
4868 	 * When this bit is '1', it indicates a packet that has an error
4869 	 * of some type. Type of error is indicated in error_flags.
4870 	 */
4871 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_ERROR		UINT32_C(0x40)
4872 	/*
4873 	 * This field indicates the TX packet timestamp type that is
4874 	 * represented by a TX Packet Timestamp Completion. Note that
4875 	 * this field is invalid if the timestamp_invalid_error flag
4876 	 * is set.
4877 	 */
4878 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE	UINT32_C(0x80)
4879 	/* The packet timestamp came from PM. */
4880 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PM	(UINT32_C(0x0) << 7)
4881 	/* The packet timestamp came from PA. */
4882 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PA	(UINT32_C(0x1) << 7)
4883 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_LAST	TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PA
4884 	/*
4885 	 * This flag indicates that the timestamp should have come from PM,
4886 	 * but came instead from PA because all PM timestamp resources were
4887 	 * in use. This can occur in the following circumstances:
4888 	 * 1. The BD specified ts_2cmpl_auto and the packet was a PTP packet
4889 	 *	but PA could not request a PM timestamp
4890 	 * 2. The BD specified ts_2cmpl_pm, but PA could not request a PM
4891 	 *	timestamp
4892 	 */
4893 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_FALLBACK	UINT32_C(0x100)
4894 	/*
4895 	 * For 2-step PTP timestamps, bits[3:0] of this field represent the
4896 	 * sub-nanosecond portion of the packet timestamp, returned from PM
4897 	 * for 2-step PTP timestamps. For PA timestamps, this field also
4898 	 * represents the sub-nanosecond portion of the packet timestamp;
4899 	 * however, due to synchronization uncertainties, the accuracy of
4900 	 * PA timestamps is limited to approximately +/- 4 ns. Therefore
4901 	 * this field is of dubious value for PA timestamps.
4902 	 */
4903 	#define TX_CMPL_PACKET_TIMESTAMP_TS_SUB_NS_MASK	UINT32_C(0xf000)
4904 	#define TX_CMPL_PACKET_TIMESTAMP_TS_SUB_NS_SFT	12
4905 	/*
4906 	 * This is bits [47:32] of the nanoseconds portion of the packet
4907 	 * timestamp, returned from PM for 2-step PTP timestamps or from
4908 	 * PA for PA timestamps. This field is in units of 2^32 ns.
4909 	 */
4910 	uint16_t	ts_ns_mid;
4911 	/*
4912 	 * This is a copy of the opaque field from the first TX BD of this
4913 	 * transmitted packet. Note that, if the packet was described by a
4914 	 * short CSO or short CSO inline BD, then the 16-bit opaque field
4915 	 * from the short CSO BD will appear in the bottom 16 bits of this
4916 	 * field.
4917 	 */
4918 	uint32_t	opaque;
4919 	uint16_t	errors_v;
4920 	/*
4921 	 * This value is written by the NIC such that it will be different
4922 	 * for each pass through the completion queue. The even passes
4923 	 * will write 1. The odd passes will write 0.
4924 	 */
4925 	#define TX_CMPL_PACKET_TIMESTAMP_V				UINT32_C(0x1)
4926 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_MASK			UINT32_C(0xfffe)
4927 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_SFT			1
4928 	/*
4929 	 * This field was previously used to indicate fatal errors, which
4930 	 * now result in aborting and bringing down the ring. This field
4931 	 * is deprecated.
4932 	 */
4933 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
4934 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_SFT		1
4935 	/* No error. */
4936 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
4937 	/* Deprecated. */
4938 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
4939 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_BAD_FMT
4940 	/*
4941 	 * This error is fatal and results in aborting and bringing down the
4942 	 * ring, thus is deprecated.
4943 	 */
4944 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
4945 	/*
4946 	 * This error is fatal and results in aborting and bringing down the
4947 	 * ring, thus is deprecated.
4948 	 */
4949 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
4950 	/*
4951 	 * When this bit is '1', it indicates that one or more of the BDs
4952 	 * associated with this packet generated a PCI error when accessing
4953 	 * header/payload data from host memory. It most likely indicates
4954 	 * that the address was not valid. Note that this bit has no meaning
4955 	 * for the timestamp completion and will always be '0'.
4956 	 */
4957 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_DMA_ERROR			UINT32_C(0x40)
4958 	/*
4959 	 * This error is fatal and results in aborting and bringing down the
4960 	 * ring, thus is deprecated.
4961 	 */
4962 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
4963 	/*
4964 	 * When this bit is '1', it indicates that the packet was dropped
4965 	 * due to Poison TLP error on one or more of the TLPs in one or more
4966 	 * of the associated PXP completion(s) when accessing header/payload
4967 	 * data from host memory. Note that this bit has no meaning for the
4968 	 * timestamp completion, and will always be '0'.
4969 	 */
4970 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
4971 	/*
4972 	 * When this bit is '1', it indicates that the packet was dropped
4973 	 * due to a transient internal error in TDC. The packet or LSO can
4974 	 * be retried and may transmit successfully on a subsequent attempt.
4975 	 * Note that this bit has no meaning for the timestamp completion
4976 	 * and will always be '0'.
4977 	 */
4978 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
4979 	/*
4980 	 * When this bit is '1', it was not possible to collect a timestamp
4981 	 * for a timestamp completion, in which case the ts_ns and ts_sub_ns
4982 	 * fields are invalid. When this bit is '0' in a timestamp
4983 	 * completion record, the ts_sub_ns, ts_ns_lo, and ts_ns_mid fields
4984 	 * are valid. Note that this bit has meaning only for the timestamp
4985 	 * completion. For types other than the timestamp completion, this
4986 	 * bit will always be '0'.
4987 	 */
4988 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
4989 	/*
4990 	 * When this bit is '1', it indicates that a Timed Transmit
4991 	 * SO-TXTIME packet violated the max_ttx_overtime constraint i.e.,
4992 	 * the time the packet was processed for transmission in TWE was
4993 	 * later than the time given by (TimedTx_BD.tx_time +
4994 	 * max_ttx_overtime) and as result, the packet was dropped.
4995 	 * Note that max_ttx_overtime is a global configuration in TWE.
4996 	 * Note that this bit has no meaning in a timestamp completion,
4997 	 * and will always be '0'.
4998 	 */
4999 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_TTX_OVERTIME_ERROR	UINT32_C(0x800)
5000 	/* unused2 is 16 b */
5001 	uint16_t	unused_2;
5002 	/*
5003 	 * This is bits [31:0] of the nanoseconds portion of the packet
5004 	 * timestamp, returned from PM for 2-step PTP timestamp or from
5005 	 * PA for PA timestamps. This field is in units of ns.
5006 	 */
5007 	uint32_t	ts_ns_lo;
5008 } tx_cmpl_packet_timestamp_t, *ptx_cmpl_packet_timestamp_t;
5009 
5010 /* rx_pkt_cmpl (size:128b/16B) */
5011 
5012 typedef struct rx_pkt_cmpl {
5013 	uint16_t	flags_type;
5014 	/*
5015 	 * This field indicates the exact type of the completion.
5016 	 * By convention, the LSB identifies the length of the
5017 	 * record in 16B units. Even values indicate 16B
5018 	 * records. Odd values indicate 32B
5019 	 * records.
5020 	 */
5021 	#define RX_PKT_CMPL_TYPE_MASK			UINT32_C(0x3f)
5022 	#define RX_PKT_CMPL_TYPE_SFT			0
5023 	/*
5024 	 * RX L2 completion:
5025 	 * Completion of and L2 RX packet. Length = 32B
5026 	 */
5027 		#define RX_PKT_CMPL_TYPE_RX_L2			UINT32_C(0x11)
5028 		#define RX_PKT_CMPL_TYPE_LAST			RX_PKT_CMPL_TYPE_RX_L2
5029 	#define RX_PKT_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
5030 	#define RX_PKT_CMPL_FLAGS_SFT			6
5031 	/*
5032 	 * When this bit is '1', it indicates a packet that has an
5033 	 * error of some type. Type of error is indicated in
5034 	 * error_flags.
5035 	 */
5036 	#define RX_PKT_CMPL_FLAGS_ERROR			UINT32_C(0x40)
5037 	/* This field indicates how the packet was placed in the buffer. */
5038 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
5039 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT		7
5040 	/*
5041 	 * Normal:
5042 	 * Packet was placed using normal algorithm.
5043 	 */
5044 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
5045 	/*
5046 	 * Jumbo:
5047 	 * Packet was placed using jumbo algorithm.
5048 	 */
5049 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
5050 	/*
5051 	 * Header/Data Separation:
5052 	 * Packet was placed using Header/Data separation algorithm.
5053 	 * The separation location is indicated by the itype field.
5054 	 */
5055 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
5056 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
5057 	/* This bit is '1' if the RSS field in this completion is valid. */
5058 	#define RX_PKT_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
5059 	/*
5060 	 * This bit is '1' if metadata has been added to the end of the
5061 	 * packet in host memory.
5062 	 */
5063 	#define RX_PKT_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
5064 	/*
5065 	 * This value indicates what the inner packet determined for the
5066 	 * packet was.
5067 	 */
5068 	#define RX_PKT_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
5069 	#define RX_PKT_CMPL_FLAGS_ITYPE_SFT		12
5070 	/*
5071 	 * Not Known:
5072 	 * Indicates that the packet type was not known.
5073 	 */
5074 		#define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
5075 	/*
5076 	 * IP Packet:
5077 	 * Indicates that the packet was an IP packet, but further
5078 	 * classification was not possible.
5079 	 */
5080 		#define RX_PKT_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
5081 	/*
5082 	 * TCP Packet:
5083 	 * Indicates that the packet was IP and TCP.
5084 	 * This indicates that the payload_offset field is valid.
5085 	 */
5086 		#define RX_PKT_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
5087 	/*
5088 	 * UDP Packet:
5089 	 * Indicates that the packet was IP and UDP.
5090 	 * This indicates that the payload_offset field is valid.
5091 	 */
5092 		#define RX_PKT_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
5093 	/*
5094 	 * FCoE Packet:
5095 	 * Indicates that the packet was recognized as a FCoE.
5096 	 * This also indicates that the payload_offset field is valid.
5097 	 */
5098 		#define RX_PKT_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
5099 	/*
5100 	 * RoCE Packet:
5101 	 * Indicates that the packet was recognized as a RoCE.
5102 	 * This also indicates that the payload_offset field is valid.
5103 	 */
5104 		#define RX_PKT_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
5105 	/*
5106 	 * ICMP Packet:
5107 	 * Indicates that the packet was recognized as ICMP.
5108 	 * This indicates that the payload_offset field is valid.
5109 	 */
5110 		#define RX_PKT_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
5111 	/*
5112 	 * PTP packet wo/timestamp:
5113 	 * Indicates that the packet was recognized as a PTP
5114 	 * packet.
5115 	 */
5116 		#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
5117 	/*
5118 	 * PTP packet w/timestamp:
5119 	 * Indicates that the packet was recognized as a PTP
5120 	 * packet and that a timestamp was taken for the packet.
5121 	 */
5122 		#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
5123 		#define RX_PKT_CMPL_FLAGS_ITYPE_LAST		RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5124 	/*
5125 	 * This is the length of the data for the packet stored in the
5126 	 * buffer(s) identified by the opaque value. This includes
5127 	 * the packet BD and any associated buffer BDs. This does not include
5128 	 * the length of any data places in aggregation BDs.
5129 	 */
5130 	uint16_t	len;
5131 	/*
5132 	 * This is a copy of the opaque field from the RX BD this completion
5133 	 * corresponds to.
5134 	 */
5135 	uint32_t	opaque;
5136 	uint8_t	agg_bufs_v1;
5137 	/*
5138 	 * This value is written by the NIC such that it will be different
5139 	 * for each pass through the completion queue. The even passes
5140 	 * will write 1. The odd passes will write 0.
5141 	 */
5142 	#define RX_PKT_CMPL_V1	UINT32_C(0x1)
5143 	/*
5144 	 * This value is the number of aggregation buffers that follow this
5145 	 * entry in the completion ring that are a part of this packet.
5146 	 * If the value is zero, then the packet is completely contained
5147 	 * in the buffer space provided for the packet in the RX ring.
5148 	 */
5149 	#define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5150 	#define RX_PKT_CMPL_AGG_BUFS_SFT 1
5151 	/* unused1 is 2 b */
5152 	#define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5153 	#define RX_PKT_CMPL_UNUSED1_SFT  6
5154 	/*
5155 	 * This is the RSS hash type for the packet. The value is packed
5156 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5157 	 * The value of tuple_extrac_op provides the information about
5158 	 * what fields the hash was computed on.
5159 	 * Note that 4-tuples values listed below are applicable
5160 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
5161 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5162 	 * enabled for TCP traffic only, then the values of tuple_extract_op
5163 	 * corresponding to 4-tuples are only valid for TCP traffic.
5164 	 */
5165 	uint8_t	rss_hash_type;
5166 	/*
5167 	 * The RSS hash was computed over source IP address,
5168 	 * destination IP address, source port, and destination port of inner
5169 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5170 	 * the packet headers are considered inner packet headers for the RSS
5171 	 * hash computation purpose.
5172 	 */
5173 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
5174 	/*
5175 	 * The RSS hash was computed over source IP address and destination
5176 	 * IP address of inner IP header. Note: For non-tunneled packets,
5177 	 * the packet headers are considered inner packet headers for the RSS
5178 	 * hash computation purpose.
5179 	 */
5180 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
5181 	/*
5182 	 * The RSS hash was computed over source IP address,
5183 	 * destination IP address, source port, and destination port of
5184 	 * IP and TCP or UDP headers of outer tunnel headers.
5185 	 * Note: For non-tunneled packets, this value is not applicable.
5186 	 */
5187 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
5188 	/*
5189 	 * The RSS hash was computed over source IP address and
5190 	 * destination IP address of IP header of outer tunnel headers.
5191 	 * Note: For non-tunneled packets, this value is not applicable.
5192 	 */
5193 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
5194 	#define RX_PKT_CMPL_RSS_HASH_TYPE_LAST  RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3
5195 	/*
5196 	 * This value indicates the offset in bytes from the beginning of the
5197 	 * packet where the inner payload starts. This value is valid for TCP,
5198 	 * UDP, FCoE, and RoCE packets.
5199 	 *
5200 	 * A value of zero indicates that header is 256B into the packet.
5201 	 */
5202 	uint8_t	payload_offset;
5203 	/* unused2 is 8 b */
5204 	uint8_t	unused1;
5205 	/*
5206 	 * This value is the RSS hash value calculated for the packet
5207 	 * based on the mode bits and key value in the VNIC.
5208 	 */
5209 	uint32_t	rss_hash;
5210 } rx_pkt_cmpl_t, *prx_pkt_cmpl_t;
5211 
5212 /* Last 16 bytes of rx_pkt_cmpl. */
5213 /* rx_pkt_cmpl_hi (size:128b/16B) */
5214 
5215 typedef struct rx_pkt_cmpl_hi {
5216 	uint32_t	flags2;
5217 	/*
5218 	 * This indicates that the ip checksum was calculated for the
5219 	 * inner packet and that the ip_cs_error field indicates if there
5220 	 * was an error.
5221 	 */
5222 	#define RX_PKT_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
5223 	/*
5224 	 * This indicates that the TCP, UDP or ICMP checksum was
5225 	 * calculated for the inner packet and that the l4_cs_error field
5226 	 * indicates if there was an error.
5227 	 */
5228 	#define RX_PKT_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
5229 	/*
5230 	 * This indicates that the ip checksum was calculated for the
5231 	 * tunnel header and that the t_ip_cs_error field indicates if there
5232 	 * was an error.
5233 	 */
5234 	#define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
5235 	/*
5236 	 * This indicates that the UDP checksum was
5237 	 * calculated for the tunnel packet and that the t_l4_cs_error field
5238 	 * indicates if there was an error.
5239 	 */
5240 	#define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
5241 	/* This value indicates what format the metadata field is. */
5242 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
5243 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT		4
5244 	/* No metadata information. Value is zero. */
5245 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
5246 	/*
5247 	 * The metadata field contains the VLAN tag and TPID value.
5248 	 * - metadata[11:0] contains the vlan VID value.
5249 	 * - metadata[12] contains the vlan DE value.
5250 	 * - metadata[15:13] contains the vlan PRI value.
5251 	 * - metadata[31:16] contains the vlan TPID value.
5252 	 */
5253 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
5254 	/*
5255 	 * If ext_meta_format is equal to 1, the metadata field
5256 	 * contains the lower 16b of the tunnel ID value, justified
5257 	 * to LSB
5258 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
5259 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
5260 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
5261 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
5262 	 * - IPV4 = 0 (not populated)
5263 	 * - IPV6 = Flow Label[19:0]
5264 	 * - PPPoE = sessionID[15:0]
5265 	 * - MPLs = Outer label[19:0]
5266 	 * - UPAR = Selected[31:0] with bit mask
5267 	 */
5268 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
5269 	/*
5270 	 * if ext_meta_format is equal to 1, metadata field contains
5271 	 * 16b metadata from the prepended header (chdr_data).
5272 	 */
5273 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
5274 	/*
5275 	 * If ext_meta_format is equal to 1, the metadata field contains
5276 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
5277 	 * inner_l4_size.
5278 	 * - metadata[8:0] contains the outer_l3_offset.
5279 	 * - metadata[17:9] contains the inner_l2_offset.
5280 	 * - metadata[26:18] contains the inner_l3_offset.
5281 	 * - metadata[31:27] contains the inner_l4_size.
5282 	 */
5283 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
5284 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST		RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
5285 	/*
5286 	 * This field indicates the IP type for the inner-most IP header.
5287 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5288 	 * This value is only valid if itype indicates a packet
5289 	 * with an IP header.
5290 	 */
5291 	#define RX_PKT_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
5292 	/*
5293 	 * This indicates that the complete 1's complement checksum was
5294 	 * calculated for the packet.
5295 	 */
5296 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
5297 	/*
5298 	 * The combination of this value and meta_format indicated what
5299 	 * format the metadata field is.
5300 	 */
5301 	#define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
5302 	#define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT	10
5303 	/*
5304 	 * This value is the complete 1's complement checksum calculated from
5305 	 * the start of the outer L3 header to the end of the packet (not
5306 	 * including the ethernet crc). It is valid when the
5307 	 * 'complete_checksum_calc' flag is set.
5308 	 */
5309 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
5310 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
5311 	/*
5312 	 * This is data from the CFA block as indicated by the meta_format
5313 	 * field.
5314 	 */
5315 	uint32_t	metadata;
5316 	/* When meta_format=1, this value is the VLAN VID. */
5317 	#define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
5318 	#define RX_PKT_CMPL_METADATA_VID_SFT  0
5319 	/* When meta_format=1, this value is the VLAN DE. */
5320 	#define RX_PKT_CMPL_METADATA_DE	UINT32_C(0x1000)
5321 	/* When meta_format=1, this value is the VLAN PRI. */
5322 	#define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
5323 	#define RX_PKT_CMPL_METADATA_PRI_SFT  13
5324 	/* When meta_format=1, this value is the VLAN TPID. */
5325 	#define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
5326 	#define RX_PKT_CMPL_METADATA_TPID_SFT 16
5327 	uint16_t	errors_v2;
5328 	/*
5329 	 * This value is written by the NIC such that it will be different
5330 	 * for each pass through the completion queue. The even passes
5331 	 * will write 1. The odd passes will write 0.
5332 	 */
5333 	#define RX_PKT_CMPL_V2					UINT32_C(0x1)
5334 	#define RX_PKT_CMPL_ERRORS_MASK				UINT32_C(0xfffe)
5335 	#define RX_PKT_CMPL_ERRORS_SFT				1
5336 	/*
5337 	 * This error indicates that there was some sort of problem with
5338 	 * the BDs for the packet that was found after part of the
5339 	 * packet was already placed. The packet should be treated as
5340 	 * invalid.
5341 	 */
5342 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
5343 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT		1
5344 	/* No buffer error */
5345 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
5346 	/*
5347 	 * Did Not Fit:
5348 	 * Packet did not fit into packet buffer provided.
5349 	 * For regular placement, this means the packet did not fit
5350 	 * in the buffer provided. For HDS and jumbo placement, this
5351 	 * means that the packet could not be placed into 7 physical
5352 	 * buffers or less.
5353 	 */
5354 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
5355 	/*
5356 	 * Not On Chip:
5357 	 * All BDs needed for the packet were not on-chip when
5358 	 * the packet arrived.
5359 	 */
5360 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
5361 	/*
5362 	 * Bad Format:
5363 	 * BDs were not formatted correctly.
5364 	 */
5365 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
5366 	/*
5367 	 * Flush:
5368 	 * There was a bad_format error on the previous operation
5369 	 */
5370 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
5371 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST		RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
5372 	/*
5373 	 * This indicates that there was an error in the IP header
5374 	 * checksum.
5375 	 */
5376 	#define RX_PKT_CMPL_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
5377 	/*
5378 	 * This indicates that there was an error in the TCP, UDP
5379 	 * or ICMP checksum.
5380 	 */
5381 	#define RX_PKT_CMPL_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
5382 	/*
5383 	 * This indicates that there was an error in the tunnel
5384 	 * IP header checksum.
5385 	 */
5386 	#define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
5387 	/*
5388 	 * This indicates that there was an error in the tunnel
5389 	 * UDP checksum.
5390 	 */
5391 	#define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
5392 	/*
5393 	 * This indicates that there was a CRC error on either an FCoE
5394 	 * or RoCE packet. The itype indicates the packet type.
5395 	 */
5396 	#define RX_PKT_CMPL_ERRORS_CRC_ERROR			UINT32_C(0x100)
5397 	/*
5398 	 * This indicates that there was an error in the tunnel
5399 	 * portion of the packet when this
5400 	 * field is non-zero.
5401 	 */
5402 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
5403 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT			9
5404 	/*
5405 	 * No additional error occurred on the tunnel portion
5406 	 * or the packet of the packet does not have a tunnel.
5407 	 */
5408 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
5409 	/*
5410 	 * Indicates that IP header version does not match
5411 	 * expectation from L2 Ethertype for IPv4 and IPv6
5412 	 * in the tunnel header.
5413 	 */
5414 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
5415 	/*
5416 	 * Indicates that header length is out of range in the
5417 	 * tunnel header. Valid for
5418 	 * IPv4.
5419 	 */
5420 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
5421 	/*
5422 	 * Indicates that the physical packet is shorter than that
5423 	 * claimed by the PPPoE header length for a tunnel PPPoE
5424 	 * packet.
5425 	 */
5426 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
5427 	/*
5428 	 * Indicates that physical packet is shorter than that claimed
5429 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
5430 	 * tunnel packet packets.
5431 	 */
5432 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
5433 	/*
5434 	 * Indicates that the physical packet is shorter than that
5435 	 * claimed by the tunnel UDP header length for a tunnel
5436 	 * UDP packet that is not fragmented.
5437 	 */
5438 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
5439 	/*
5440 	 * indicates that the IPv4 TTL or IPv6 hop limit check
5441 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
5442 	 * for IPv4, and IPv6.
5443 	 */
5444 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
5445 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST			RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
5446 	/*
5447 	 * This indicates that there was an error in the inner
5448 	 * portion of the packet when this
5449 	 * field is non-zero.
5450 	 */
5451 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
5452 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT			12
5453 	/*
5454 	 * No additional error occurred on the tunnel portion
5455 	 * or the packet of the packet does not have a tunnel.
5456 	 */
5457 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
5458 	/*
5459 	 * Indicates that IP header version does not match
5460 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
5461 	 * option other than VFT was parsed on
5462 	 * FCoE packet.
5463 	 */
5464 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
5465 	/*
5466 	 * indicates that header length is out of range. Valid for
5467 	 * IPv4 and RoCE
5468 	 */
5469 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
5470 	/*
5471 	 * indicates that the IPv4 TTL or IPv6 hop limit check
5472 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
5473 	 */
5474 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
5475 	/*
5476 	 * Indicates that physical packet is shorter than that
5477 	 * claimed by the l3 header length. Valid for IPv4,
5478 	 * IPv6 packet or RoCE packets.
5479 	 */
5480 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
5481 	/*
5482 	 * Indicates that the physical packet is shorter than that
5483 	 * claimed by the UDP header length for a UDP packet that is
5484 	 * not fragmented.
5485 	 */
5486 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
5487 	/*
5488 	 * Indicates that TCP header length > IP payload. Valid for
5489 	 * TCP packets only.
5490 	 */
5491 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
5492 	/* Indicates that TCP header length < 5. Valid for TCP. */
5493 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
5494 	/*
5495 	 * Indicates that TCP option headers result in a TCP header
5496 	 * size that does not match data offset in TCP header. Valid
5497 	 * for TCP.
5498 	 */
5499 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
5500 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST			RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
5501 	/*
5502 	 * This field identifies the CFA action rule that was used for this
5503 	 * packet.
5504 	 */
5505 	uint16_t	cfa_code;
5506 	uint32_t	reorder;
5507 	/*
5508 	 * This value holds the reordering sequence number for the packet.
5509 	 * If the reordering sequence is not valid, then this value is zero.
5510 	 * The reordering domain for the packet is in the bottom 8 to 10b of
5511 	 * the rss_hash value. The bottom 20b of this value contain the
5512 	 * ordering domain value for the packet.
5513 	 */
5514 	#define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
5515 	#define RX_PKT_CMPL_REORDER_SFT 0
5516 } rx_pkt_cmpl_hi_t, *prx_pkt_cmpl_hi_t;
5517 
5518 /* rx_pkt_v2_cmpl (size:128b/16B) */
5519 
5520 typedef struct rx_pkt_v2_cmpl {
5521 	uint16_t	flags_type;
5522 	/*
5523 	 * This field indicates the exact type of the completion.
5524 	 * By convention, the LSB identifies the length of the
5525 	 * record in 16B units. Even values indicate 16B
5526 	 * records. Odd values indicate 32B
5527 	 * records.
5528 	 */
5529 	#define RX_PKT_V2_CMPL_TYPE_MASK			UINT32_C(0x3f)
5530 	#define RX_PKT_V2_CMPL_TYPE_SFT			0
5531 	/*
5532 	 * RX L2 V2 completion:
5533 	 * Completion of and L2 RX packet. Length = 32B
5534 	 * This is the new version of the RX_L2 completion used in SR2
5535 	 * and later chips.
5536 	 */
5537 		#define RX_PKT_V2_CMPL_TYPE_RX_L2_V2			UINT32_C(0xf)
5538 		#define RX_PKT_V2_CMPL_TYPE_LAST			RX_PKT_V2_CMPL_TYPE_RX_L2_V2
5539 	#define RX_PKT_V2_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
5540 	#define RX_PKT_V2_CMPL_FLAGS_SFT			6
5541 	/*
5542 	 * When this bit is '1', it indicates a packet that has an
5543 	 * error of some type. Type of error is indicated in
5544 	 * error_flags.
5545 	 */
5546 	#define RX_PKT_V2_CMPL_FLAGS_ERROR			UINT32_C(0x40)
5547 	/* This field indicates how the packet was placed in the buffer. */
5548 	#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
5549 	#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT		7
5550 	/*
5551 	 * Normal:
5552 	 * Packet was placed using normal algorithm.
5553 	 */
5554 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
5555 	/*
5556 	 * Jumbo:
5557 	 * Packet was placed using jumbo algorithm.
5558 	 */
5559 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
5560 	/*
5561 	 * Header/Data Separation:
5562 	 * Packet was placed using Header/Data separation algorithm.
5563 	 * The separation location is indicated by the itype field.
5564 	 */
5565 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
5566 	/*
5567 	 * Truncation:
5568 	 * Packet was placed using truncation algorithm. The
5569 	 * placed (truncated) length is indicated in the payload_offset
5570 	 * field. The original length is indicated in the len field.
5571 	 */
5572 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION	(UINT32_C(0x3) << 7)
5573 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
5574 	/* This bit is '1' if the RSS field in this completion is valid. */
5575 	#define RX_PKT_V2_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
5576 	/*
5577 	 * This bit is '1' if metadata has been added to the end of the
5578 	 * packet in host memory. Metadata starts at the first 32B boundary
5579 	 * after the end of the packet for regular and jumbo placement.
5580 	 * It starts at the first 32B boundary after the end of the header
5581 	 * for HDS placement. The length of the metadata is indicated in the
5582 	 * metadata itself.
5583 	 */
5584 	#define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
5585 	/*
5586 	 * This value indicates what the inner packet determined for the
5587 	 * packet was.
5588 	 */
5589 	#define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
5590 	#define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT		12
5591 	/*
5592 	 * Not Known:
5593 	 * Indicates that the packet type was not known.
5594 	 */
5595 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
5596 	/*
5597 	 * IP Packet:
5598 	 * Indicates that the packet was an IP packet, but further
5599 	 * classification was not possible.
5600 	 */
5601 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
5602 	/*
5603 	 * TCP Packet:
5604 	 * Indicates that the packet was IP and TCP.
5605 	 * This indicates that the payload_offset field is valid.
5606 	 */
5607 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
5608 	/*
5609 	 * UDP Packet:
5610 	 * Indicates that the packet was IP and UDP.
5611 	 * This indicates that the payload_offset field is valid.
5612 	 */
5613 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
5614 	/*
5615 	 * FCoE Packet:
5616 	 * Indicates that the packet was recognized as a FCoE.
5617 	 * This also indicates that the payload_offset field is valid.
5618 	 */
5619 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
5620 	/*
5621 	 * RoCE Packet:
5622 	 * Indicates that the packet was recognized as a RoCE.
5623 	 * This also indicates that the payload_offset field is valid.
5624 	 */
5625 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
5626 	/*
5627 	 * ICMP Packet:
5628 	 * Indicates that the packet was recognized as ICMP.
5629 	 * This indicates that the payload_offset field is valid.
5630 	 */
5631 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
5632 	/*
5633 	 * PTP packet wo/timestamp:
5634 	 * Indicates that the packet was recognized as a PTP
5635 	 * packet.
5636 	 */
5637 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
5638 	/*
5639 	 * PTP packet w/timestamp:
5640 	 * Indicates that the packet was recognized as a PTP
5641 	 * packet and that a timestamp was taken for the packet.
5642 	 */
5643 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
5644 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST		RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5645 	/*
5646 	 * This is the length of the data for the packet stored in the
5647 	 * buffer(s) identified by the opaque value. This includes
5648 	 * the packet BD and any associated buffer BDs. This does not include
5649 	 * the length of any data places in aggregation BDs.
5650 	 */
5651 	uint16_t	len;
5652 	/*
5653 	 * This is a copy of the opaque field from the RX BD this completion
5654 	 * corresponds to.
5655 	 */
5656 	uint32_t	opaque;
5657 	uint8_t	agg_bufs_v1;
5658 	/*
5659 	 * This value is written by the NIC such that it will be different
5660 	 * for each pass through the completion queue. The even passes
5661 	 * will write 1. The odd passes will write 0.
5662 	 */
5663 	#define RX_PKT_V2_CMPL_V1	UINT32_C(0x1)
5664 	/*
5665 	 * This value is the number of aggregation buffers that follow this
5666 	 * entry in the completion ring that are a part of this packet.
5667 	 * If the value is zero, then the packet is completely contained
5668 	 * in the buffer space provided for the packet in the RX ring.
5669 	 */
5670 	#define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5671 	#define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
5672 	/* unused1 is 2 b */
5673 	#define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5674 	#define RX_PKT_V2_CMPL_UNUSED1_SFT  6
5675 	/*
5676 	 * This is the RSS hash type for the packet. The value is packed
5677 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5678 	 * The value of tuple_extrac_op provides the information about
5679 	 * what fields the hash was computed on.
5680 	 * Note that 4-tuples values listed below are applicable
5681 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
5682 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5683 	 * enabled for TCP traffic only, then the values of tuple_extract_op
5684 	 * corresponding to 4-tuples are only valid for TCP traffic.
5685 	 */
5686 	uint8_t	rss_hash_type;
5687 	/*
5688 	 * The RSS hash was computed over source IP address,
5689 	 * destination IP address, source port, and destination port of inner
5690 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5691 	 * the packet headers are considered inner packet headers for the RSS
5692 	 * hash computation purpose.
5693 	 */
5694 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
5695 	/*
5696 	 * The RSS hash was computed over source IP address and destination
5697 	 * IP address of inner IP header. Note: For non-tunneled packets,
5698 	 * the packet headers are considered inner packet headers for the RSS
5699 	 * hash computation purpose.
5700 	 */
5701 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
5702 	/*
5703 	 * The RSS hash was computed over source IP address,
5704 	 * destination IP address, source port, and destination port of
5705 	 * IP and TCP or UDP headers of outer tunnel headers.
5706 	 * Note: For non-tunneled packets, this value is not applicable.
5707 	 */
5708 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
5709 	/*
5710 	 * The RSS hash was computed over source IP address and
5711 	 * destination IP address of IP header of outer tunnel headers.
5712 	 * Note: For non-tunneled packets, this value is not applicable.
5713 	 */
5714 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
5715 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_LAST  RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3
5716 	uint16_t	metadata1_payload_offset;
5717 	/*
5718 	 * This is data from the CFA as indicated by the meta_format field.
5719 	 * If truncation placement is not used, this value indicates the offset
5720 	 * in bytes from the beginning of the packet where the inner payload
5721 	 * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
5722 	 * truncation placement is used, this value represents the placed
5723 	 * (truncated) length of the packet.
5724 	 */
5725 	#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK	UINT32_C(0x1ff)
5726 	#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT	0
5727 	/* This is data from the CFA as indicated by the meta_format field. */
5728 	#define RX_PKT_V2_CMPL_METADATA1_MASK		UINT32_C(0xf000)
5729 	#define RX_PKT_V2_CMPL_METADATA1_SFT		12
5730 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
5731 	#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
5732 	#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT	12
5733 	/* 0x88a8 */
5734 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
5735 	/* 0x8100 */
5736 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
5737 	/* 0x9100 */
5738 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
5739 	/* 0x9200 */
5740 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
5741 	/* 0x9300 */
5742 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
5743 	/* Value programmed in CFA VLANTPID register. */
5744 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
5745 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
5746 	/* When meta_format != 0, this value is the VLAN valid. */
5747 	#define RX_PKT_V2_CMPL_METADATA1_VALID		UINT32_C(0x8000)
5748 	/*
5749 	 * This value is the RSS hash value calculated for the packet
5750 	 * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
5751 	 * is set in VNIC context, this is the lower 32b of the host address
5752 	 * from the first BD used to place the packet.
5753 	 */
5754 	uint32_t	rss_hash;
5755 } rx_pkt_v2_cmpl_t, *prx_pkt_v2_cmpl_t;
5756 
5757 /* Last 16 bytes of RX Packet V2 Completion Record */
5758 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
5759 
5760 typedef struct rx_pkt_v2_cmpl_hi {
5761 	uint32_t	flags2;
5762 	/*
5763 	 * When this bit is '0', the cs_ok field has the following definition:-
5764 	 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
5765 	 * in the delivered packet, counted from the outer-most header group to
5766 	 * the inner-most header group, stopping at the first error. -
5767 	 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
5768 	 * in the delivered packet, counted from the outer-most header group to
5769 	 * the inner-most header group, stopping at the first error. When this
5770 	 * bit is '1', the cs_ok field has the following definition: -
5771 	 * hdr_cnt[2:0] = The number of header groups that were parsed by the
5772 	 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
5773 	 * will be '1' if all the parsed header groups with an IP checksum are
5774 	 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
5775 	 * header groups with an L4 checksum are valid.
5776 	 */
5777 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
5778 	/* This value indicates what format the metadata field is. */
5779 	#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
5780 	#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT		4
5781 	/* There is no metadata information. Values are zero. */
5782 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
5783 	/*
5784 	 * The {metadata1, metadata0} fields contain the vtag
5785 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
5786 	 * de, vid[11:0]} The metadata2 field contains the table scope
5787 	 * and action record pointer. - metadata2[25:0] contains the
5788 	 * action record pointer. - metadata2[31:26] contains the table
5789 	 * scope.
5790 	 */
5791 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
5792 	/*
5793 	 * The {metadata1, metadata0} fields contain the vtag
5794 	 * information:
5795 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5796 	 * The metadata2 field contains the Tunnel ID
5797 	 * value, justified to LSB.
5798 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
5799 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
5800 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
5801 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
5802 	 * - IPv4 = 0 (not populated)
5803 	 * - IPv6 = Flow Label[19:0]
5804 	 * - PPPoE = sessionID[15:0]
5805 	 * - MPLs = Outer label[19:0]
5806 	 * - UPAR = Selected[31:0] with bit mask
5807 	 */
5808 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
5809 	/*
5810 	 * The {metadata1, metadata0} fields contain the vtag
5811 	 * information:
5812 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
5813 	 * The metadata2 field contains the 32b metadata from the prepended
5814 	 * header (chdr_data).
5815 	 */
5816 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
5817 	/*
5818 	 * The {metadata1, metadata0} fields contain the vtag
5819 	 * information:
5820 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5821 	 * The metadata2 field contains the outer_l3_offset,
5822 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
5823 	 * - metadata2[8:0] contains the outer_l3_offset.
5824 	 * - metadata2[17:9] contains the inner_l2_offset.
5825 	 * - metadata2[26:18] contains the inner_l3_offset.
5826 	 * - metadata2[31:27] contains the inner_l4_size.
5827 	 */
5828 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
5829 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST		RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
5830 	/*
5831 	 * This field indicates the IP type for the inner-most IP header.
5832 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5833 	 * This value is only valid if itype indicates a packet
5834 	 * with an IP header.
5835 	 */
5836 	#define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE			UINT32_C(0x100)
5837 	/*
5838 	 * This indicates that the complete 1's complement checksum was
5839 	 * calculated for the packet.
5840 	 */
5841 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
5842 	/*
5843 	 * This field indicates the status of IP and L4 CS calculations done
5844 	 * by the chip. The format of this field is indicated by the
5845 	 * cs_all_ok_mode bit.
5846 	 */
5847 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
5848 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT		10
5849 	/*
5850 	 * This value is the complete 1's complement checksum calculated from
5851 	 * the start of the outer L3 header to the end of the packet (not
5852 	 * including the ethernet crc). It is valid when the
5853 	 * 'complete_checksum_calc' flag is set.
5854 	 */
5855 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
5856 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT	16
5857 	/*
5858 	 * This is data from the CFA block as indicated by the meta_format
5859 	 * field.
5860 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5861 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5862 	 *   act_rec_ptr[25:0]}
5863 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5864 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5865 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5866 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
5867 	 * of the host address from the first BD used to place the packet.
5868 	 */
5869 	uint32_t	metadata2;
5870 	uint16_t	errors_v2;
5871 	/*
5872 	 * This value is written by the NIC such that it will be different
5873 	 * for each pass through the completion queue. The even passes
5874 	 * will write 1. The odd passes will write 0.
5875 	 */
5876 	#define RX_PKT_V2_CMPL_HI_V2					UINT32_C(0x1)
5877 	#define RX_PKT_V2_CMPL_HI_ERRORS_MASK				UINT32_C(0xfffe)
5878 	#define RX_PKT_V2_CMPL_HI_ERRORS_SFT				1
5879 	/*
5880 	 * This error indicates that there was some sort of problem with
5881 	 * the BDs for the packet that was found after part of the
5882 	 * packet was already placed. The packet should be treated as
5883 	 * invalid.
5884 	 */
5885 	#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
5886 	#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT		1
5887 	/* No buffer error */
5888 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
5889 	/*
5890 	 * Did Not Fit: Packet did not fit into packet buffer provided.
5891 	 * For regular placement, this means the packet did not fit in
5892 	 * the buffer provided. For HDS and jumbo placement, this means
5893 	 * that the packet could not be placed into 8 physical buffers
5894 	 * (if fixed-size buffers are used), or that the packet could
5895 	 * not be placed in the number of physical buffers configured
5896 	 * for the VNIC (if variable-size buffers are used)
5897 	 */
5898 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
5899 	/*
5900 	 * Not On Chip: All BDs needed for the packet were not on-chip
5901 	 * when the packet arrived. For regular placement, this error is
5902 	 * not valid. For HDS and jumbo placement, this means that not
5903 	 * enough agg BDs were posted to place the packet.
5904 	 */
5905 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
5906 	/*
5907 	 * Bad Format:
5908 	 * BDs were not formatted correctly.
5909 	 */
5910 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
5911 	/*
5912 	 * Flush:
5913 	 * There was a bad_format error on the previous operation
5914 	 */
5915 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
5916 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST		RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
5917 	/*
5918 	 * This indicates that there was an error in the outer tunnel
5919 	 * portion of the packet when this field is non-zero.
5920 	 */
5921 	#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK		UINT32_C(0x70)
5922 	#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT		4
5923 	/*
5924 	 * No additional error occurred on the outer tunnel portion
5925 	 * of the packet or the packet does not have a outer tunnel.
5926 	 */
5927 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 4)
5928 	/*
5929 	 * Indicates that IP header version does not match expectation
5930 	 * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
5931 	 */
5932 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION	(UINT32_C(0x1) << 4)
5933 	/*
5934 	 * Indicates that header length is out of range in the outer
5935 	 * tunnel header. Valid for IPv4.
5936 	 */
5937 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 4)
5938 	/*
5939 	 * Indicates that physical packet is shorter than that claimed
5940 	 * by the outer tunnel l3 header length. Valid for IPv4, or
5941 	 * IPv6 outer tunnel packets.
5942 	 */
5943 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR	(UINT32_C(0x3) << 4)
5944 	/*
5945 	 * Indicates that the physical packet is shorter than that
5946 	 * claimed by the outer tunnel UDP header length for a outer
5947 	 * tunnel UDP packet that is not fragmented.
5948 	 */
5949 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 4)
5950 	/*
5951 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have
5952 	 * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
5953 	 * IPv4, and IPv6.
5954 	 */
5955 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL	(UINT32_C(0x5) << 4)
5956 	/*
5957 	 * Indicates that the IP checksum failed its check in the outer
5958 	 * tunnel header.
5959 	 */
5960 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR	(UINT32_C(0x6) << 4)
5961 	/*
5962 	 * Indicates that the L4 checksum failed its check in the outer
5963 	 * tunnel header.
5964 	 */
5965 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR	(UINT32_C(0x7) << 4)
5966 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST		RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
5967 	/*
5968 	 * This indicates that there was a CRC error on either an FCoE
5969 	 * or RoCE packet. The itype indicates the packet type.
5970 	 */
5971 	#define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR			UINT32_C(0x100)
5972 	/*
5973 	 * This indicates that there was an error in the tunnel portion
5974 	 * of the packet when this field is non-zero.
5975 	 */
5976 	#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
5977 	#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT			9
5978 	/*
5979 	 * No additional error occurred on the tunnel portion
5980 	 * of the packet or the packet does not have a tunnel.
5981 	 */
5982 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
5983 	/*
5984 	 * Indicates that IP header version does not match expectation
5985 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
5986 	 */
5987 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
5988 	/*
5989 	 * Indicates that header length is out of range in the tunnel
5990 	 * header. Valid for IPv4.
5991 	 */
5992 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
5993 	/*
5994 	 * Indicates that physical packet is shorter than that claimed
5995 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
5996 	 * packet packets.
5997 	 */
5998 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 9)
5999 	/*
6000 	 * Indicates that the physical packet is shorter than that claimed
6001 	 * by the tunnel UDP header length for a tunnel UDP packet that is
6002 	 * not fragmented.
6003 	 */
6004 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
6005 	/*
6006 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6007 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6008 	 */
6009 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 9)
6010 	/*
6011 	 * Indicates that the IP checksum failed its check in the tunnel
6012 	 * header.
6013 	 */
6014 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR		(UINT32_C(0x6) << 9)
6015 	/*
6016 	 * Indicates that the L4 checksum failed its check in the tunnel
6017 	 * header.
6018 	 */
6019 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR		(UINT32_C(0x7) << 9)
6020 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST			RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
6021 	/*
6022 	 * This indicates that there was an error in the inner
6023 	 * portion of the packet when this
6024 	 * field is non-zero.
6025 	 */
6026 	#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
6027 	#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT			12
6028 	/*
6029 	 * No additional error occurred on the tunnel portion
6030 	 * or the packet of the packet does not have a tunnel.
6031 	 */
6032 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
6033 	/*
6034 	 * Indicates that IP header version does not match
6035 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
6036 	 * option other than VFT was parsed on
6037 	 * FCoE packet.
6038 	 */
6039 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
6040 	/*
6041 	 * indicates that header length is out of range. Valid for
6042 	 * IPv4 and RoCE
6043 	 */
6044 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
6045 	/*
6046 	 * indicates that the IPv4 TTL or IPv6 hop limit check
6047 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6048 	 */
6049 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
6050 	/*
6051 	 * Indicates that physical packet is shorter than that
6052 	 * claimed by the l3 header length. Valid for IPv4,
6053 	 * IPv6 packet or RoCE packets.
6054 	 */
6055 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
6056 	/*
6057 	 * Indicates that the physical packet is shorter than that
6058 	 * claimed by the UDP header length for a UDP packet that is
6059 	 * not fragmented.
6060 	 */
6061 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
6062 	/*
6063 	 * Indicates that TCP header length > IP payload. Valid for
6064 	 * TCP packets only.
6065 	 */
6066 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
6067 	/* Indicates that TCP header length < 5. Valid for TCP. */
6068 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
6069 	/*
6070 	 * Indicates that TCP option headers result in a TCP header
6071 	 * size that does not match data offset in TCP header. Valid
6072 	 * for TCP.
6073 	 */
6074 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
6075 	/*
6076 	 * Indicates that the IP checksum failed its check in the
6077 	 * inner header.
6078 	 */
6079 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR		(UINT32_C(0x9) << 12)
6080 	/*
6081 	 * Indicates that the L4 checksum failed its check in the
6082 	 * inner header.
6083 	 */
6084 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR		(UINT32_C(0xa) << 12)
6085 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST			RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
6086 	/*
6087 	 * This is data from the CFA block as indicated by the meta_format
6088 	 * field.
6089 	 */
6090 	uint16_t	metadata0;
6091 	/* When meta_format=1, this value is the VLAN VID. */
6092 	#define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
6093 	#define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
6094 	/* When meta_format=1, this value is the VLAN DE. */
6095 	#define RX_PKT_V2_CMPL_HI_METADATA0_DE	UINT32_C(0x1000)
6096 	/* When meta_format=1, this value is the VLAN PRI. */
6097 	#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
6098 	#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
6099 	/*
6100 	 * The timestamp field contains the 32b timestamp for the packet from
6101 	 * the MAC.
6102 	 */
6103 	uint32_t	timestamp;
6104 } rx_pkt_v2_cmpl_hi_t, *prx_pkt_v2_cmpl_hi_t;
6105 
6106 /* rx_pkt_v3_cmpl (size:128b/16B) */
6107 
6108 typedef struct rx_pkt_v3_cmpl {
6109 	uint16_t	flags_type;
6110 	/*
6111 	 * This field indicates the exact type of the completion.
6112 	 * By convention, the LSB identifies the length of the
6113 	 * record in 16B units. Even values indicate 16B
6114 	 * records. Odd values indicate 32B
6115 	 * records.
6116 	 */
6117 	#define RX_PKT_V3_CMPL_TYPE_MASK			UINT32_C(0x3f)
6118 	#define RX_PKT_V3_CMPL_TYPE_SFT			0
6119 	/*
6120 	 * RX L2 V3 completion:
6121 	 * Completion of and L2 RX packet. Length = 32B
6122 	 * This is the new version of the RX_L2 completion used in Thor2
6123 	 * and later chips.
6124 	 */
6125 		#define RX_PKT_V3_CMPL_TYPE_RX_L2_V3			UINT32_C(0x17)
6126 		#define RX_PKT_V3_CMPL_TYPE_LAST			RX_PKT_V3_CMPL_TYPE_RX_L2_V3
6127 	#define RX_PKT_V3_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
6128 	#define RX_PKT_V3_CMPL_FLAGS_SFT			6
6129 	/*
6130 	 * When this bit is '1', it indicates a packet that has an
6131 	 * error of some type. Type of error is indicated in
6132 	 * error_flags.
6133 	 */
6134 	#define RX_PKT_V3_CMPL_FLAGS_ERROR			UINT32_C(0x40)
6135 	/* This field indicates how the packet was placed in the buffer. */
6136 	#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
6137 	#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_SFT		7
6138 	/*
6139 	 * Normal:
6140 	 * Packet was placed using normal algorithm.
6141 	 */
6142 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
6143 	/*
6144 	 * Jumbo:
6145 	 * Packet was placed using jumbo algorithm.
6146 	 */
6147 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
6148 	/*
6149 	 * Header/Data Separation:
6150 	 * Packet was placed using Header/Data separation algorithm.
6151 	 * The separation location is indicated by the itype field.
6152 	 */
6153 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
6154 	/*
6155 	 * Truncation:
6156 	 * Packet was placed using truncation algorithm. The
6157 	 * placed (truncated) length is indicated in the payload_offset
6158 	 * field. The original length is indicated in the len field.
6159 	 */
6160 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION	(UINT32_C(0x3) << 7)
6161 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION
6162 	/* This bit is '1' if the RSS field in this completion is valid. */
6163 	#define RX_PKT_V3_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
6164 	/*
6165 	 * This bit is '1' if metadata has been added to the end of the
6166 	 * packet in host memory. Metadata starts at the first 32B boundary
6167 	 * after the end of the packet for regular and jumbo placement.
6168 	 * It starts at the first 32B boundary after the end of the header
6169 	 * for HDS placement. The length of the metadata is indicated in the
6170 	 * metadata itself.
6171 	 */
6172 	#define RX_PKT_V3_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
6173 	/*
6174 	 * This value indicates what the inner packet determined for the
6175 	 * packet was.
6176 	 */
6177 	#define RX_PKT_V3_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
6178 	#define RX_PKT_V3_CMPL_FLAGS_ITYPE_SFT		12
6179 	/*
6180 	 * Not Known:
6181 	 * Indicates that the packet type was not known.
6182 	 */
6183 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
6184 	/*
6185 	 * IP Packet:
6186 	 * Indicates that the packet was an IP packet, but further
6187 	 * classification was not possible.
6188 	 */
6189 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
6190 	/*
6191 	 * TCP Packet:
6192 	 * Indicates that the packet was IP and TCP.
6193 	 * This indicates that the payload_offset field is valid.
6194 	 */
6195 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
6196 	/*
6197 	 * UDP Packet:
6198 	 * Indicates that the packet was IP and UDP.
6199 	 * This indicates that the payload_offset field is valid.
6200 	 */
6201 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
6202 	/*
6203 	 * FCoE Packet:
6204 	 * Indicates that the packet was recognized as a FCoE.
6205 	 * This also indicates that the payload_offset field is valid.
6206 	 */
6207 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
6208 	/*
6209 	 * RoCE Packet:
6210 	 * Indicates that the packet was recognized as a RoCE.
6211 	 * This also indicates that the payload_offset field is valid.
6212 	 */
6213 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
6214 	/*
6215 	 * ICMP Packet:
6216 	 * Indicates that the packet was recognized as ICMP.
6217 	 * This indicates that the payload_offset field is valid.
6218 	 */
6219 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
6220 	/*
6221 	 * PTP packet wo/timestamp:
6222 	 * Indicates that the packet was recognized as a PTP
6223 	 * packet.
6224 	 */
6225 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
6226 	/*
6227 	 * PTP packet w/timestamp:
6228 	 * Indicates that the packet was recognized as a PTP
6229 	 * packet and that a timestamp was taken for the packet.
6230 	 * The 4b sub-nanosecond portion of the timestamp is in
6231 	 * the payload_offset field.
6232 	 */
6233 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
6234 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_LAST		RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
6235 	/*
6236 	 * This is the length of the data for the packet stored in the
6237 	 * buffer(s) identified by the opaque value. This includes
6238 	 * the packet BD and any associated buffer BDs. This does not include
6239 	 * the length of any data places in aggregation BDs.
6240 	 */
6241 	uint16_t	len;
6242 	/*
6243 	 * This is a copy of the opaque field from the RX BD this completion
6244 	 * corresponds to.
6245 	 */
6246 	uint32_t	opaque;
6247 	uint16_t	rss_hash_type_agg_bufs_v1;
6248 	/*
6249 	 * This value is written by the NIC such that it will be different
6250 	 * for each pass through the completion queue. The even passes
6251 	 * will write 1. The odd passes will write 0.
6252 	 */
6253 	#define RX_PKT_V3_CMPL_V1		UINT32_C(0x1)
6254 	/*
6255 	 * This value is the number of aggregation buffers that follow this
6256 	 * entry in the completion ring that are a part of this packet.
6257 	 * If the value is zero, then the packet is completely contained
6258 	 * in the buffer space provided for the packet in the RX ring.
6259 	 */
6260 	#define RX_PKT_V3_CMPL_AGG_BUFS_MASK	UINT32_C(0x3e)
6261 	#define RX_PKT_V3_CMPL_AGG_BUFS_SFT	1
6262 	/* unused1 is 1 b */
6263 	#define RX_PKT_V3_CMPL_UNUSED1		UINT32_C(0x40)
6264 	/*
6265 	 * This is the RSS hash type for the packet. The value is packed
6266 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
6267 	 * The value of tuple_extrac_op provides the information about
6268 	 * what fields the hash was computed on.
6269 	 * Note that 4-tuples values listed below are applicable
6270 	 * for layer 4 protocols supported and enabled for RSS in the
6271 	 * hardware, HWRM firmware, and drivers. For example, if RSS hash
6272 	 * is supported and enabled for TCP traffic only, then the values of
6273 	 * tuple_extract_op corresponding to 4-tuples are only valid for
6274 	 * TCP traffic.
6275 	 */
6276 	#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_MASK   UINT32_C(0xff80)
6277 	#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_SFT	7
6278 	/*
6279 	 * The RSS hash was computed over source IP address,
6280 	 * destination IP address, source port, and destination port of
6281 	 * inner IP and TCP or UDP headers.
6282 	 */
6283 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_0   (UINT32_C(0x0) << 7)
6284 	/*
6285 	 * The RSS hash was computed over source IP address and
6286 	 * destination IP address of inner IP header.
6287 	 */
6288 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_1   (UINT32_C(0x1) << 7)
6289 	/*
6290 	 * The RSS hash was computed over source IP address,
6291 	 * destination IP address, source port, and destination port of
6292 	 * IP and TCP or UDP headers of outer tunnel headers.
6293 	 * Note: For non-tunneled packets, this value is not applicable.
6294 	 */
6295 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_2   (UINT32_C(0x2) << 7)
6296 	/*
6297 	 * The RSS hash was computed over source IP address and
6298 	 * destination IP address of IP header of outer tunnel headers.
6299 	 * Note: For non-tunneled packets, this value is not applicable.
6300 	 */
6301 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_3   (UINT32_C(0x3) << 7)
6302 	/*
6303 	 * The RSS hash was computed over source IP address of the inner
6304 	 * IP header.
6305 	 */
6306 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_4   (UINT32_C(0x4) << 7)
6307 	/*
6308 	 * The RSS hash was computed over destination IP address of the
6309 	 * inner IP header.
6310 	 */
6311 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_5   (UINT32_C(0x5) << 7)
6312 	/*
6313 	 * The RSS hash was computed over source IP address of the outer
6314 	 * IP header.
6315 	 * Note: For non-tunneled packets, this value is not applicable.
6316 	 */
6317 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_6   (UINT32_C(0x6) << 7)
6318 	/*
6319 	 * The RSS hash was computed over destination IP address of the
6320 	 * outer IP header.
6321 	 * Note: For non-tunneled packets, this value is not applicable.
6322 	 */
6323 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_7   (UINT32_C(0x7) << 7)
6324 	/*
6325 	 * The RSS hash was computed over source IP address, destination
6326 	 * IP address, and flow label of the inner IP header.
6327 	 * Note: For packets without an inner IPv6 header, this value is not
6328 	 * this value is not applicable.
6329 	 */
6330 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_8   (UINT32_C(0x8) << 7)
6331 	/*
6332 	 * The RSS hash was computed over the flow label of the inner
6333 	 * IP header.
6334 	 * Note: For packets without an inner IPv6 header, this value
6335 	 * is not applicable.
6336 	 */
6337 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_9   (UINT32_C(0x9) << 7)
6338 	/*
6339 	 * The RSS hash was computed over source IP address, destination
6340 	 * IP address, and flow label of the outer IP header.
6341 	 * Note: For packets without an outer IPv6 header, this value is not
6342 	 * applicable.
6343 	 */
6344 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_10  (UINT32_C(0xa) << 7)
6345 	/*
6346 	 * The RSS hash was computed over the flow label of the outer
6347 	 * IP header.
6348 	 * Note: For packets without an outer IPv6 header, this value
6349 	 * is not applicable.
6350 	 */
6351 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_11  (UINT32_C(0xb) << 7)
6352 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_LAST	RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_11
6353 	uint16_t	metadata1_payload_offset;
6354 	/*
6355 	 * If truncation placement is not used, this value indicates the offset
6356 	 * in bytes from the beginning of the packet where the inner payload
6357 	 * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets.
6358 	 * For PTP packets with timestamp (as indicated by the flags_itype
6359 	 * field), this field contains the 4b sub-nanosecond portion of the
6360 	 * timestamp.
6361 	 *
6362 	 * If truncation placement is used, this value represents the placed
6363 	 * (truncated) length of the packet.
6364 	 */
6365 	#define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_MASK	UINT32_C(0x1ff)
6366 	#define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_SFT	0
6367 	/* This is data from the CFA as indicated by the meta_format field. */
6368 	#define RX_PKT_V3_CMPL_METADATA1_MASK		UINT32_C(0xf000)
6369 	#define RX_PKT_V3_CMPL_METADATA1_SFT		12
6370 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
6371 	#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
6372 	#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_SFT	12
6373 	/* 0x88a8 */
6374 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
6375 	/* 0x8100 */
6376 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
6377 	/* 0x9100 */
6378 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
6379 	/* 0x9200 */
6380 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
6381 	/* 0x9300 */
6382 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
6383 	/* Value programmed in CFA VLANTPID register. */
6384 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
6385 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
6386 	/* When meta_format != 0, this value is the VLAN valid. */
6387 	#define RX_PKT_V3_CMPL_METADATA1_VALID		UINT32_C(0x8000)
6388 	/*
6389 	 * This value is the RSS hash value calculated for the packet
6390 	 * based on the mode bits and key value in the VNIC. When hairpin_en
6391 	 * is set in VNIC context, this is the lower 32b of the host address
6392 	 * from the first BD used to place the packet.
6393 	 */
6394 	uint32_t	rss_hash;
6395 } rx_pkt_v3_cmpl_t, *prx_pkt_v3_cmpl_t;
6396 
6397 /* Last 16 bytes of RX Packet V3 Completion Record */
6398 /* rx_pkt_v3_cmpl_hi (size:128b/16B) */
6399 
6400 typedef struct rx_pkt_v3_cmpl_hi {
6401 	uint32_t	flags2;
6402 	/*
6403 	 * This indicates that the ip checksum was calculated for the inner
6404 	 * packet and that the ip_cs_error field indicates if there was an
6405 	 * error.
6406 	 */
6407 	#define RX_PKT_V3_CMPL_HI_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
6408 	/*
6409 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
6410 	 * for the inner packet and that the l4_cs_error field indicates if
6411 	 * there was an error.
6412 	 */
6413 	#define RX_PKT_V3_CMPL_HI_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
6414 	/*
6415 	 * This indicates that the ip checksum was calculated for the tunnel
6416 	 * header and that the t_ip_cs_error field indicates if there was an
6417 	 * error.
6418 	 */
6419 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
6420 	/*
6421 	 * This indicates that the UDP checksum was calculated for the tunnel
6422 	 * packet and that the t_l4_cs_error field indicates if there was an
6423 	 * error.
6424 	 */
6425 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
6426 	/* This value indicates what format the metadata field is. */
6427 	#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
6428 	#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_SFT		4
6429 	/* There is no metadata information. Values are zero. */
6430 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
6431 	/*
6432 	 * The {metadata1, metadata0} fields contain the vtag
6433 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
6434 	 * de, vid[11:0]} The metadata2 field contains the table scope
6435 	 * and action record pointer. - metadata2[25:0] contains the
6436 	 * action record pointer. - metadata2[31:26] contains the table
6437 	 * scope.
6438 	 */
6439 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
6440 	/*
6441 	 * The {metadata1, metadata0} fields contain the vtag
6442 	 * information:
6443 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6444 	 * The metadata2 field contains the Tunnel ID
6445 	 * value, justified to LSB.
6446 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
6447 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
6448 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
6449 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
6450 	 * - IPv4 = 0 (not populated)
6451 	 * - IPv6 = Flow Label[19:0]
6452 	 * - PPPoE = sessionID[15:0]
6453 	 * - MPLs = Outer label[19:0]
6454 	 * - UPAR = Selected[31:0] with bit mask
6455 	 */
6456 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
6457 	/*
6458 	 * The {metadata1, metadata0} fields contain the vtag
6459 	 * information:
6460 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
6461 	 * The metadata2 field contains the 32b metadata from the prepended
6462 	 * header (chdr_data).
6463 	 */
6464 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
6465 	/*
6466 	 * The {metadata1, metadata0} fields contain the vtag
6467 	 * information:
6468 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6469 	 * The metadata2 field contains the outer_l3_offset,
6470 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
6471 	 * - metadata2[8:0] contains the outer_l3_offset.
6472 	 * - metadata2[17:9] contains the inner_l2_offset.
6473 	 * - metadata2[26:18] contains the inner_l3_offset.
6474 	 * - metadata2[31:27] contains the inner_l4_size.
6475 	 */
6476 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
6477 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_LAST		RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
6478 	/*
6479 	 * This field indicates the IP type for the inner-most IP header.
6480 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6481 	 * This value is only valid if itype indicates a packet
6482 	 * with an IP header.
6483 	 */
6484 	#define RX_PKT_V3_CMPL_HI_FLAGS2_IP_TYPE			UINT32_C(0x100)
6485 	/*
6486 	 * This indicates that the complete 1's complement checksum was
6487 	 * calculated for the packet.
6488 	 */
6489 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
6490 	/*
6491 	 * This field indicates the status of IP and L4 CS calculations done
6492 	 * by the chip. The format of this field is indicated by the
6493 	 * cs_all_ok_mode bit.
6494 	 */
6495 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE		UINT32_C(0x400)
6496 	/* Indicates that the Tunnel IP type was IPv4 */
6497 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV4		(UINT32_C(0x0) << 10)
6498 	/* Indicates that the Tunnel IP type was IPv6 */
6499 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6		(UINT32_C(0x1) << 10)
6500 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_LAST		RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6
6501 	/*
6502 	 * This value is the complete 1's complement checksum calculated from
6503 	 * the start of the outer L3 header to the end of the packet (not
6504 	 * including the ethernet crc). It is valid when the
6505 	 * 'complete_checksum_calc' flag is set.
6506 	 */
6507 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
6508 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT	16
6509 	/*
6510 	 * This is data from the CFA block as indicated by the meta_format
6511 	 * field.
6512 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
6513 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
6514 	 *   act_rec_ptr[25:0]}
6515 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
6516 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
6517 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
6518 	 */
6519 	uint32_t	metadata2;
6520 	uint16_t	errors_v2;
6521 	/*
6522 	 * This value is written by the NIC such that it will be different
6523 	 * for each pass through the completion queue. The even passes
6524 	 * will write 1. The odd passes will write 0.
6525 	 */
6526 	#define RX_PKT_V3_CMPL_HI_V2					UINT32_C(0x1)
6527 	#define RX_PKT_V3_CMPL_HI_ERRORS_MASK				UINT32_C(0xfffe)
6528 	#define RX_PKT_V3_CMPL_HI_ERRORS_SFT				1
6529 	/*
6530 	 * This error indicates that there was some sort of problem with
6531 	 * the BDs for the packet that was found after part of the
6532 	 * packet was already placed. The packet should be treated as
6533 	 * invalid.
6534 	 */
6535 	#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
6536 	#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_SFT		1
6537 	/* No buffer error */
6538 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
6539 	/*
6540 	 * Did Not Fit: Packet did not fit into packet buffer provided.
6541 	 * For regular placement, this means the packet did not fit in
6542 	 * the buffer provided. For HDS and jumbo placement, this means
6543 	 * that the packet could not be placed into 8 physical buffers.
6544 	 */
6545 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
6546 	/*
6547 	 * Not On Chip: All BDs needed for the packet were not on-chip
6548 	 * when the packet arrived. For regular placement, this error is
6549 	 * not valid. For HDS and jumbo placement, this means that not
6550 	 * enough agg BDs were posted to place the packet.
6551 	 */
6552 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
6553 	/*
6554 	 * Bad Format:
6555 	 * BDs were not formatted correctly.
6556 	 */
6557 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
6558 	/*
6559 	 * Flush:
6560 	 * There was a bad_format error on the previous operation
6561 	 */
6562 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
6563 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_LAST		RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
6564 	/* This indicates that there was an error in the IP header checksum. */
6565 	#define RX_PKT_V3_CMPL_HI_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
6566 	/*
6567 	 * This indicates that there was an error in the TCP, UDP or ICMP
6568 	 * checksum.
6569 	 */
6570 	#define RX_PKT_V3_CMPL_HI_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
6571 	/*
6572 	 * This indicates that there was an error in the tunnel IP header
6573 	 * checksum.
6574 	 */
6575 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
6576 	/* This indicates that there was an error in the tunnel UDP checksum. */
6577 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
6578 	/*
6579 	 * This indicates that there was a CRC error on either an FCoE
6580 	 * or RoCE packet. The itype indicates the packet type.
6581 	 */
6582 	#define RX_PKT_V3_CMPL_HI_ERRORS_CRC_ERROR			UINT32_C(0x100)
6583 	/*
6584 	 * This indicates that there was an error in the tunnel portion
6585 	 * of the packet when this field is non-zero.
6586 	 */
6587 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
6588 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_SFT			9
6589 	/*
6590 	 * No additional error occurred on the tunnel portion
6591 	 * of the packet or the packet does not have a tunnel.
6592 	 */
6593 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
6594 	/*
6595 	 * Indicates that IP header version does not match expectation
6596 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
6597 	 */
6598 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
6599 	/*
6600 	 * Indicates that header length is out of range in the tunnel
6601 	 * header. Valid for IPv4.
6602 	 */
6603 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
6604 	/*
6605 	 * Indicates that physical packet is shorter than that claimed
6606 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
6607 	 * packet packets.
6608 	 */
6609 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 9)
6610 	/*
6611 	 * Indicates that the physical packet is shorter than that claimed
6612 	 * by the tunnel UDP header length for a tunnel UDP packet that is
6613 	 * not fragmented.
6614 	 */
6615 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
6616 	/*
6617 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6618 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6619 	 */
6620 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 9)
6621 	/*
6622 	 * Indicates that the IP checksum failed its check in the tunnel
6623 	 * header.
6624 	 */
6625 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR		(UINT32_C(0x6) << 9)
6626 	/*
6627 	 * Indicates that the L4 checksum failed its check in the tunnel
6628 	 * header.
6629 	 */
6630 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR		(UINT32_C(0x7) << 9)
6631 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_LAST			RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
6632 	/*
6633 	 * This indicates that there was an error in the inner
6634 	 * portion of the packet when this
6635 	 * field is non-zero.
6636 	 */
6637 	#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
6638 	#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_SFT			12
6639 	/*
6640 	 * No additional error occurred on the tunnel portion
6641 	 * or the packet of the packet does not have a tunnel.
6642 	 */
6643 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
6644 	/*
6645 	 * Indicates that IP header version does not match
6646 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
6647 	 * option other than VFT was parsed on
6648 	 * FCoE packet.
6649 	 */
6650 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
6651 	/*
6652 	 * indicates that header length is out of range. Valid for
6653 	 * IPv4 and RoCE
6654 	 */
6655 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
6656 	/*
6657 	 * indicates that the IPv4 TTL or IPv6 hop limit check
6658 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6659 	 */
6660 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
6661 	/*
6662 	 * Indicates that physical packet is shorter than that
6663 	 * claimed by the l3 header length. Valid for IPv4,
6664 	 * IPv6 packet or RoCE packets.
6665 	 */
6666 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
6667 	/*
6668 	 * Indicates that the physical packet is shorter than that
6669 	 * claimed by the UDP header length for a UDP packet that is
6670 	 * not fragmented.
6671 	 */
6672 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
6673 	/*
6674 	 * Indicates that TCP header length > IP payload. Valid for
6675 	 * TCP packets only.
6676 	 */
6677 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
6678 	/* Indicates that TCP header length < 5. Valid for TCP. */
6679 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
6680 	/*
6681 	 * Indicates that TCP option headers result in a TCP header
6682 	 * size that does not match data offset in TCP header. Valid
6683 	 * for TCP.
6684 	 */
6685 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
6686 	/*
6687 	 * Indicates that the IP checksum failed its check in the
6688 	 * inner header.
6689 	 */
6690 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR		(UINT32_C(0x9) << 12)
6691 	/*
6692 	 * Indicates that the L4 checksum failed its check in the
6693 	 * inner header.
6694 	 */
6695 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR		(UINT32_C(0xa) << 12)
6696 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_LAST			RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
6697 	/*
6698 	 * This is data from the CFA block as indicated by the meta_format
6699 	 * field.
6700 	 */
6701 	uint16_t	metadata0;
6702 	/* When meta_format=1, this value is the VLAN VID. */
6703 	#define RX_PKT_V3_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
6704 	#define RX_PKT_V3_CMPL_HI_METADATA0_VID_SFT 0
6705 	/* When meta_format=1, this value is the VLAN DE. */
6706 	#define RX_PKT_V3_CMPL_HI_METADATA0_DE	UINT32_C(0x1000)
6707 	/* When meta_format=1, this value is the VLAN PRI. */
6708 	#define RX_PKT_V3_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
6709 	#define RX_PKT_V3_CMPL_HI_METADATA0_PRI_SFT 13
6710 	/*
6711 	 * The timestamp field contains the 32b timestamp for the packet from
6712 	 * the MAC.
6713 	 *
6714 	 * When hairpin_en is set in VNIC context, this is the upper 32b of the
6715 	 * host address from the first BD used to place the packet.
6716 	 */
6717 	uint32_t	timestamp;
6718 } rx_pkt_v3_cmpl_hi_t, *prx_pkt_v3_cmpl_hi_t;
6719 
6720 /* rx_pkt_compress_cmpl (size:128b/16B) */
6721 
6722 typedef struct rx_pkt_compress_cmpl {
6723 	uint16_t	flags_type;
6724 	/*
6725 	 * This field indicates the exact type of the completion.
6726 	 * By convention, the LSB identifies the length of the
6727 	 * record in 16B units. Even values indicate 16B
6728 	 * records. Odd values indicate 32B
6729 	 * records.
6730 	 */
6731 	#define RX_PKT_COMPRESS_CMPL_TYPE_MASK		UINT32_C(0x3f)
6732 	#define RX_PKT_COMPRESS_CMPL_TYPE_SFT			0
6733 	/*
6734 	 * RX L2 completion:
6735 	 * This is the compressed version of Rx Completion for performance
6736 	 * applications. Length = 16B
6737 	 * This version of the completion record is used in Thor2 and later
6738 	 * chips.
6739 	 */
6740 		#define RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS	UINT32_C(0x10)
6741 		#define RX_PKT_COMPRESS_CMPL_TYPE_LAST			RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS
6742 	#define RX_PKT_COMPRESS_CMPL_FLAGS_MASK		UINT32_C(0xffc0)
6743 	#define RX_PKT_COMPRESS_CMPL_FLAGS_SFT		6
6744 	/*
6745 	 * When this bit is '1', it indicates a packet that has an
6746 	 * error of some type. Type of error is indicated in
6747 	 * error_flags.
6748 	 */
6749 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ERROR		UINT32_C(0x40)
6750 	/*
6751 	 * This field indicates the status of IP and L4 CS calculations done
6752 	 * by the chip. The format of this field is indicated by the
6753 	 * cs_all_ok_mode bit.
6754 	 */
6755 	#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE		UINT32_C(0x100)
6756 	/* Indicates that the Tunnel IP type was IPv4 */
6757 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV4	(UINT32_C(0x0) << 8)
6758 	/* Indicates that the Tunnel IP type was IPv6 */
6759 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6	(UINT32_C(0x1) << 8)
6760 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_LAST	RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6
6761 	/*
6762 	 * This field indicates the IP type for the inner-most IP header.
6763 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6764 	 * This value is only valid if itype indicates a packet
6765 	 * with an IP header.
6766 	 */
6767 	#define RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE		UINT32_C(0x200)
6768 	/* This bit is '1' if the RSS field in this completion is valid. */
6769 	#define RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
6770 	/*
6771 	 * This value indicates what the inner packet determined for the
6772 	 * packet was.
6773 	 */
6774 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
6775 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT		12
6776 	/*
6777 	 * Not Known:
6778 	 * Indicates that the packet type was not known.
6779 	 */
6780 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 12)
6781 	/*
6782 	 * IP Packet:
6783 	 * Indicates that the packet was an IP packet, but further
6784 	 * classification was not possible.
6785 	 */
6786 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 12)
6787 	/*
6788 	 * TCP Packet:
6789 	 * Indicates that the packet was IP and TCP.
6790 	 * This indicates that the payload_offset field is valid.
6791 	 */
6792 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
6793 	/*
6794 	 * UDP Packet:
6795 	 * Indicates that the packet was IP and UDP.
6796 	 * This indicates that the payload_offset field is valid.
6797 	 */
6798 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
6799 	/*
6800 	 * FCoE Packet:
6801 	 * Indicates that the packet was recognized as a FCoE.
6802 	 * This also indicates that the payload_offset field is valid.
6803 	 */
6804 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
6805 	/*
6806 	 * RoCE Packet:
6807 	 * Indicates that the packet was recognized as a RoCE.
6808 	 * This also indicates that the payload_offset field is valid.
6809 	 */
6810 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
6811 	/*
6812 	 * ICMP Packet:
6813 	 * Indicates that the packet was recognized as ICMP.
6814 	 * This indicates that the payload_offset field is valid.
6815 	 */
6816 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
6817 	/*
6818 	 * PTP packet wo/timestamp:
6819 	 * Indicates that the packet was recognized as a PTP
6820 	 * packet.
6821 	 */
6822 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 12)
6823 	/*
6824 	 * PTP packet w/timestamp:
6825 	 * Indicates that the packet was recognized as a PTP
6826 	 * packet and that a timestamp was taken for the packet.
6827 	 * The 4b sub-nanosecond portion of the timestamp is in
6828 	 * the payload_offset field.
6829 	 */
6830 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
6831 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_LAST		RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
6832 	/*
6833 	 * This is the length of the data for the packet stored in the
6834 	 * buffer(s) identified by the opaque value. This includes
6835 	 * the packet BD and any associated buffer BDs. This does not include
6836 	 * the length of any data places in aggregation BDs.
6837 	 */
6838 	uint16_t	len;
6839 	/*
6840 	 * This value is the RSS hash value calculated for the packet
6841 	 * based on the mode bits and key value in the VNIC. When hairpin_en
6842 	 * is set in VNIC context, this is the lower 32b of the host address
6843 	 * from the first BD used to place the packet.
6844 	 */
6845 	uint32_t	rss_hash;
6846 	uint16_t	metadata1_cs_error_calc_v1;
6847 	/*
6848 	 * This value is written by the NIC such that it will be different
6849 	 * for each pass through the completion queue. The even passes
6850 	 * will write 1. The odd passes will write 0.
6851 	 */
6852 	#define RX_PKT_COMPRESS_CMPL_V1				UINT32_C(0x1)
6853 	/* unused is 3 b */
6854 	#define RX_PKT_COMPRESS_CMPL_UNUSED_MASK			UINT32_C(0xe)
6855 	#define RX_PKT_COMPRESS_CMPL_UNUSED_SFT			1
6856 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK		UINT32_C(0xff0)
6857 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_SFT		4
6858 	/* This indicates that there was an error in the IP header checksum. */
6859 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_ERROR	UINT32_C(0x10)
6860 	/*
6861 	 * This indicates that there was an error in the TCP, UDP or ICMP
6862 	 * checksum.
6863 	 */
6864 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_ERROR	UINT32_C(0x20)
6865 	/*
6866 	 * This indicates that there was an error in the tunnel IP header
6867 	 * checksum.
6868 	 */
6869 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_ERROR	UINT32_C(0x40)
6870 	/* This indicates that there was an error in the tunnel UDP checksum. */
6871 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_ERROR	UINT32_C(0x80)
6872 	/*
6873 	 * This indicates that the ip checksum was calculated for the inner
6874 	 * packet and that the ip_cs_error field indicates if there was an
6875 	 * error.
6876 	 */
6877 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_CALC	UINT32_C(0x100)
6878 	/*
6879 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
6880 	 * for the inner packet and that the l4_cs_error field indicates if
6881 	 * there was an error.
6882 	 */
6883 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_CALC	UINT32_C(0x200)
6884 	/*
6885 	 * This indicates that the ip checksum was calculated for the tunnel
6886 	 * header and that the t_ip_cs_error field indicates if there was an
6887 	 * error.
6888 	 */
6889 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_CALC	UINT32_C(0x400)
6890 	/*
6891 	 * This indicates that the UDP checksum was calculated for the tunnel
6892 	 * packet and that the t_l4_cs_error field indicates if there was an
6893 	 * error.
6894 	 */
6895 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_CALC	UINT32_C(0x800)
6896 	/* This is data from the CFA as indicated by the meta_format field. */
6897 	#define RX_PKT_COMPRESS_CMPL_METADATA1_MASK		UINT32_C(0xf000)
6898 	#define RX_PKT_COMPRESS_CMPL_METADATA1_SFT		12
6899 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
6900 	#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
6901 	#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_SFT	12
6902 	/* 0x88a8 */
6903 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID88A8	(UINT32_C(0x0) << 12)
6904 	/* 0x8100 */
6905 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID8100	(UINT32_C(0x1) << 12)
6906 	/* 0x9100 */
6907 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9100	(UINT32_C(0x2) << 12)
6908 	/* 0x9200 */
6909 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9200	(UINT32_C(0x3) << 12)
6910 	/* 0x9300 */
6911 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9300	(UINT32_C(0x4) << 12)
6912 	/* Value programmed in CFA VLANTPID register. */
6913 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
6914 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG
6915 	/* When meta_format != 0, this value is the VLAN valid. */
6916 	#define RX_PKT_COMPRESS_CMPL_METADATA1_VALID		UINT32_C(0x8000)
6917 	/* This is data from the CFA as indicated by the meta_format field. */
6918 	uint16_t	vlanc_tcid;
6919 	/* When meta_format!=0, this value is the VLAN VID. */
6920 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_MASK UINT32_C(0xfff)
6921 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_SFT 0
6922 	/* When meta_format!=0, this value is the VLAN DE. */
6923 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_DE	UINT32_C(0x1000)
6924 	/* When meta_format!=0, this value is the VLAN PRI. */
6925 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_MASK UINT32_C(0xe000)
6926 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_SFT 13
6927 	uint32_t	errors_agg_bufs_opaque;
6928 	/* Lower 16bits of the Opaque field provided in the Rx BD. */
6929 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_MASK				UINT32_C(0xffff)
6930 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_SFT				0
6931 	/*
6932 	 * This value is the number of aggregation buffers that follow this
6933 	 * entry in the completion ring that are a part of this packet.
6934 	 * If the value is zero, then the packet is completely contained
6935 	 * in the buffer space provided for the packet in the RX ring.
6936 	 */
6937 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_MASK				UINT32_C(0x1f0000)
6938 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_SFT				16
6939 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_MASK				UINT32_C(0x1fe00000)
6940 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_SFT				21
6941 	/*
6942 	 * This indicates that there was an error in the inner
6943 	 * portion of the packet when this
6944 	 * field is non-zero.
6945 	 */
6946 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_MASK			UINT32_C(0x1e00000)
6947 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_SFT			21
6948 	/*
6949 	 * No additional error occurred on the tunnel portion
6950 	 * or the packet of the packet does not have a tunnel.
6951 	 */
6952 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 21)
6953 	/*
6954 	 * Indicates that IP header version does not match
6955 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
6956 	 * option other than VFT was parsed on
6957 	 * FCoE packet.
6958 	 */
6959 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 21)
6960 	/*
6961 	 * indicates that header length is out of range. Valid for
6962 	 * IPv4 and RoCE
6963 	 */
6964 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 21)
6965 	/*
6966 	 * indicates that the IPv4 TTL or IPv6 hop limit check
6967 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6968 	 */
6969 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 21)
6970 	/*
6971 	 * Indicates that physical packet is shorter than that
6972 	 * claimed by the l3 header length. Valid for IPv4,
6973 	 * IPv6 packet or RoCE packets.
6974 	 */
6975 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 21)
6976 	/*
6977 	 * Indicates that the physical packet is shorter than that
6978 	 * claimed by the UDP header length for a UDP packet that is
6979 	 * not fragmented.
6980 	 */
6981 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 21)
6982 	/*
6983 	 * Indicates that TCP header length > IP payload. Valid for
6984 	 * TCP packets only.
6985 	 */
6986 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 21)
6987 	/* Indicates that TCP header length < 5. Valid for TCP. */
6988 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 21)
6989 	/*
6990 	 * Indicates that TCP option headers result in a TCP header
6991 	 * size that does not match data offset in TCP header. Valid
6992 	 * for TCP.
6993 	 */
6994 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 21)
6995 		#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
6996 	/*
6997 	 * This indicates that there was an error in the tunnel portion
6998 	 * of the packet when this field is non-zero.
6999 	 */
7000 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe000000)
7001 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_SFT			25
7002 	/*
7003 	 * No additional error occurred on the tunnel portion
7004 	 * of the packet or the packet does not have a tunnel.
7005 	 */
7006 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 25)
7007 	/*
7008 	 * Indicates that IP header version does not match expectation
7009 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
7010 	 */
7011 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 25)
7012 	/*
7013 	 * Indicates that header length is out of range in the tunnel
7014 	 * header. Valid for IPv4.
7015 	 */
7016 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 25)
7017 	/*
7018 	 * Indicates that physical packet is shorter than that claimed
7019 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
7020 	 * packet packets.
7021 	 */
7022 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 25)
7023 	/*
7024 	 * Indicates that the physical packet is shorter than that claimed
7025 	 * by the tunnel UDP header length for a tunnel UDP packet that is
7026 	 * not fragmented.
7027 	 */
7028 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 25)
7029 	/*
7030 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
7031 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
7032 	 */
7033 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 25)
7034 	/*
7035 	 * Indicates that the IP checksum failed its check in the tunnel
7036 	 * header.
7037 	 */
7038 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR		(UINT32_C(0x6) << 25)
7039 	/*
7040 	 * Indicates that the L4 checksum failed its check in the tunnel
7041 	 * header.
7042 	 */
7043 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR		(UINT32_C(0x7) << 25)
7044 		#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
7045 	/*
7046 	 * This indicates that there was a CRC error on either an FCoE
7047 	 * or RoCE packet. The itype indicates the packet type.
7048 	 */
7049 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_CRC_ERROR			UINT32_C(0x10000000)
7050 	/* unused1 is 3 b */
7051 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_MASK				UINT32_C(0xe0000000)
7052 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_SFT				29
7053 } rx_pkt_compress_cmpl_t, *prx_pkt_compress_cmpl_t;
7054 
7055 /*
7056  * This TPA completion structure is used on devices where the
7057  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7058  */
7059 /* rx_tpa_start_cmpl (size:128b/16B) */
7060 
7061 typedef struct rx_tpa_start_cmpl {
7062 	uint16_t	flags_type;
7063 	/*
7064 	 * This field indicates the exact type of the completion.
7065 	 * By convention, the LSB identifies the length of the
7066 	 * record in 16B units. Even values indicate 16B
7067 	 * records. Odd values indicate 32B
7068 	 * records.
7069 	 */
7070 	#define RX_TPA_START_CMPL_TYPE_MASK		UINT32_C(0x3f)
7071 	#define RX_TPA_START_CMPL_TYPE_SFT		0
7072 	/*
7073 	 * RX L2 TPA Start Completion:
7074 	 * Completion at the beginning of a TPA operation.
7075 	 * Length = 32B
7076 	 */
7077 		#define RX_TPA_START_CMPL_TYPE_RX_TPA_START	UINT32_C(0x13)
7078 		#define RX_TPA_START_CMPL_TYPE_LAST		RX_TPA_START_CMPL_TYPE_RX_TPA_START
7079 	#define RX_TPA_START_CMPL_FLAGS_MASK		UINT32_C(0xffc0)
7080 	#define RX_TPA_START_CMPL_FLAGS_SFT		6
7081 	/* This bit will always be '0' for TPA start completions. */
7082 	#define RX_TPA_START_CMPL_FLAGS_ERROR		UINT32_C(0x40)
7083 	/* This field indicates how the packet was placed in the buffer. */
7084 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK	UINT32_C(0x380)
7085 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT	7
7086 	/*
7087 	 * Jumbo:
7088 	 * TPA Packet was placed using jumbo algorithm. This means
7089 	 * that the first buffer will be filled with data before
7090 	 * moving to aggregation buffers. Each aggregation buffer
7091 	 * will be filled before moving to the next aggregation
7092 	 * buffer.
7093 	 */
7094 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO	(UINT32_C(0x1) << 7)
7095 	/*
7096 	 * Header/Data Separation:
7097 	 * Packet was placed using Header/Data separation algorithm.
7098 	 * The separation location is indicated by the itype field.
7099 	 */
7100 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS	(UINT32_C(0x2) << 7)
7101 	/*
7102 	 * GRO/Jumbo:
7103 	 * Packet will be placed using GRO/Jumbo where the first
7104 	 * packet is filled with data. Subsequent packets will be
7105 	 * placed such that any one packet does not span two
7106 	 * aggregation buffers unless it starts at the beginning of
7107 	 * an aggregation buffer.
7108 	 */
7109 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO   (UINT32_C(0x5) << 7)
7110 	/*
7111 	 * GRO/Header-Data Separation:
7112 	 * Packet will be placed using GRO/HDS where the header
7113 	 * is in the first packet.
7114 	 * Payload of each packet will be
7115 	 * placed such that any one packet does not span two
7116 	 * aggregation buffers unless it starts at the beginning of
7117 	 * an aggregation buffer.
7118 	 */
7119 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
7120 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST	RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
7121 	/* This bit is '1' if the RSS field in this completion is valid. */
7122 	#define RX_TPA_START_CMPL_FLAGS_RSS_VALID	UINT32_C(0x400)
7123 	/* unused is 1 b */
7124 	#define RX_TPA_START_CMPL_FLAGS_UNUSED		UINT32_C(0x800)
7125 	/*
7126 	 * This value indicates what the inner packet determined for the
7127 	 * packet was.
7128 	 */
7129 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK	UINT32_C(0xf000)
7130 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT	12
7131 	/*
7132 	 * TCP Packet:
7133 	 * Indicates that the packet was IP and TCP.
7134 	 */
7135 		#define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7136 		#define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST	RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
7137 	/*
7138 	 * This value indicates the amount of packet data written to the
7139 	 * buffer the opaque field in this completion corresponds to.
7140 	 */
7141 	uint16_t	len;
7142 	/*
7143 	 * This is a copy of the opaque field from the RX BD this completion
7144 	 * corresponds to.
7145 	 */
7146 	uint32_t	opaque;
7147 	/*
7148 	 * This value is written by the NIC such that it will be different
7149 	 * for each pass through the completion queue. The even passes
7150 	 * will write 1. The odd passes will write 0.
7151 	 */
7152 	uint8_t	v1;
7153 	/*
7154 	 * This value is written by the NIC such that it will be different
7155 	 * for each pass through the completion queue. The even passes
7156 	 * will write 1. The odd passes will write 0.
7157 	 */
7158 	#define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
7159 	#define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
7160 	/*
7161 	 * This is the RSS hash type for the packet. The value is packed
7162 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7163 	 *
7164 	 * The value of tuple_extrac_op provides the information about
7165 	 * what fields the hash was computed on.
7166 	 * * 0: The RSS hash was computed over source IP address,
7167 	 * destination IP address, source port, and destination port of inner
7168 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
7169 	 * the packet headers are considered inner packet headers for the RSS
7170 	 * hash computation purpose.
7171 	 * * 1: The RSS hash was computed over source IP address and destination
7172 	 * IP address of inner IP header. Note: For non-tunneled packets,
7173 	 * the packet headers are considered inner packet headers for the RSS
7174 	 * hash computation purpose.
7175 	 * * 2: The RSS hash was computed over source IP address,
7176 	 * destination IP address, source port, and destination port of
7177 	 * IP and TCP or UDP headers of outer tunnel headers.
7178 	 * Note: For non-tunneled packets, this value is not applicable.
7179 	 * * 3: The RSS hash was computed over source IP address and
7180 	 * destination IP address of IP header of outer tunnel headers.
7181 	 * Note: For non-tunneled packets, this value is not applicable.
7182 	 *
7183 	 * Note that 4-tuples values listed above are applicable
7184 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
7185 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
7186 	 * enabled for TCP traffic only, then the values of tuple_extract_op
7187 	 * corresponding to 4-tuples are only valid for TCP traffic.
7188 	 */
7189 	uint8_t	rss_hash_type;
7190 	/*
7191 	 * This is the aggregation ID that the completion is associated
7192 	 * with. Use this number to correlate the TPA start completion
7193 	 * with the TPA end completion.
7194 	 */
7195 	uint16_t	agg_id;
7196 	/* unused2 is 9 b */
7197 	#define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
7198 	#define RX_TPA_START_CMPL_UNUSED2_SFT 0
7199 	/*
7200 	 * This is the aggregation ID that the completion is associated
7201 	 * with. Use this number to correlate the TPA start completion
7202 	 * with the TPA end completion.
7203 	 */
7204 	#define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
7205 	#define RX_TPA_START_CMPL_AGG_ID_SFT  9
7206 	/*
7207 	 * This value is the RSS hash value calculated for the packet
7208 	 * based on the mode bits and key value in the VNIC.
7209 	 */
7210 	uint32_t	rss_hash;
7211 } rx_tpa_start_cmpl_t, *prx_tpa_start_cmpl_t;
7212 
7213 /*
7214  * Last 16 bytes of rx_tpa_start_cmpl.
7215  *
7216  * This TPA completion structure is used on devices where the
7217  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7218  */
7219 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
7220 
7221 typedef struct rx_tpa_start_cmpl_hi {
7222 	uint32_t	flags2;
7223 	/*
7224 	 * This indicates that the ip checksum was calculated for the
7225 	 * inner packet and that the sum passed for all segments
7226 	 * included in the aggregation.
7227 	 */
7228 	#define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC	UINT32_C(0x1)
7229 	/*
7230 	 * This indicates that the TCP, UDP or ICMP checksum was
7231 	 * calculated for the inner packet and that the sum passed
7232 	 * for all segments included in the aggregation.
7233 	 */
7234 	#define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC	UINT32_C(0x2)
7235 	/*
7236 	 * This indicates that the ip checksum was calculated for the
7237 	 * tunnel header and that the sum passed for all segments
7238 	 * included in the aggregation.
7239 	 */
7240 	#define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC	UINT32_C(0x4)
7241 	/*
7242 	 * This indicates that the UDP checksum was
7243 	 * calculated for the tunnel packet and that the sum passed for
7244 	 * all segments included in the aggregation.
7245 	 */
7246 	#define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC	UINT32_C(0x8)
7247 	/* This value indicates what format the metadata field is. */
7248 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
7249 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
7250 	/* No metadata information. Value is zero. */
7251 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE   (UINT32_C(0x0) << 4)
7252 	/*
7253 	 * The metadata field contains the VLAN tag and TPID value.
7254 	 * - metadata[11:0] contains the vlan VID value.
7255 	 * - metadata[12] contains the vlan DE value.
7256 	 * - metadata[15:13] contains the vlan PRI value.
7257 	 * - metadata[31:16] contains the vlan TPID value.
7258 	 */
7259 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN   (UINT32_C(0x1) << 4)
7260 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST  RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
7261 	/*
7262 	 * This field indicates the IP type for the inner-most IP header.
7263 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7264 	 */
7265 	#define RX_TPA_START_CMPL_FLAGS2_IP_TYPE	UINT32_C(0x100)
7266 	/*
7267 	 * This is data from the CFA block as indicated by the meta_format
7268 	 * field.
7269 	 */
7270 	uint32_t	metadata;
7271 	/* When meta_format=1, this value is the VLAN VID. */
7272 	#define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
7273 	#define RX_TPA_START_CMPL_METADATA_VID_SFT  0
7274 	/* When meta_format=1, this value is the VLAN DE. */
7275 	#define RX_TPA_START_CMPL_METADATA_DE	UINT32_C(0x1000)
7276 	/* When meta_format=1, this value is the VLAN PRI. */
7277 	#define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
7278 	#define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
7279 	/* When meta_format=1, this value is the VLAN TPID. */
7280 	#define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
7281 	#define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
7282 	uint16_t	v2;
7283 	/*
7284 	 * This value is written by the NIC such that it will be different
7285 	 * for each pass through the completion queue. The even passes
7286 	 * will write 1. The odd passes will write 0.
7287 	 */
7288 	#define RX_TPA_START_CMPL_V2	UINT32_C(0x1)
7289 	/*
7290 	 * This field identifies the CFA action rule that was used for this
7291 	 * packet.
7292 	 */
7293 	uint16_t	cfa_code;
7294 	/*
7295 	 * This is the size in bytes of the inner most L4 header.
7296 	 * This can be subtracted from the payload_offset to determine
7297 	 * the start of the inner most L4 header.
7298 	 */
7299 	uint32_t	inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
7300 	/*
7301 	 * This is the offset from the beginning of the packet in bytes for
7302 	 * the outer L3 header. If there is no outer L3 header, then this
7303 	 * value is zero.
7304 	 */
7305 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
7306 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
7307 	/*
7308 	 * This is the offset from the beginning of the packet in bytes for
7309 	 * the inner most L2 header.
7310 	 */
7311 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
7312 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
7313 	/*
7314 	 * This is the offset from the beginning of the packet in bytes for
7315 	 * the inner most L3 header.
7316 	 */
7317 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
7318 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
7319 	/*
7320 	 * This is the size in bytes of the inner most L4 header.
7321 	 * This can be subtracted from the payload_offset to determine
7322 	 * the start of the inner most L4 header.
7323 	 */
7324 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
7325 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
7326 } rx_tpa_start_cmpl_hi_t, *prx_tpa_start_cmpl_hi_t;
7327 
7328 /*
7329  * This TPA completion structure is used on devices where the
7330  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7331  * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
7332  * struct)
7333  */
7334 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
7335 
7336 typedef struct rx_tpa_start_v2_cmpl {
7337 	uint16_t	flags_type;
7338 	/*
7339 	 * This field indicates the exact type of the completion.
7340 	 * By convention, the LSB identifies the length of the
7341 	 * record in 16B units. Even values indicate 16B
7342 	 * records. Odd values indicate 32B
7343 	 * records.
7344 	 */
7345 	#define RX_TPA_START_V2_CMPL_TYPE_MASK			UINT32_C(0x3f)
7346 	#define RX_TPA_START_V2_CMPL_TYPE_SFT			0
7347 	/*
7348 	 * RX L2 TPA Start V2 Completion:
7349 	 * Completion at the beginning of a TPA operation.
7350 	 * Length = 32B
7351 	 * This is the new version of the RX_TPA_START completion used
7352 	 * in SR2 and later chips.
7353 	 */
7354 		#define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2		UINT32_C(0xd)
7355 		#define RX_TPA_START_V2_CMPL_TYPE_LAST			RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
7356 	#define RX_TPA_START_V2_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
7357 	#define RX_TPA_START_V2_CMPL_FLAGS_SFT			6
7358 	/*
7359 	 * When this bit is '1', it indicates a packet that has an error
7360 	 * of some type. Type of error is indicated in error_flags.
7361 	 */
7362 	#define RX_TPA_START_V2_CMPL_FLAGS_ERROR			UINT32_C(0x40)
7363 	/* This field indicates how the packet was placed in the buffer. */
7364 	#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
7365 	#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT		7
7366 	/*
7367 	 * Jumbo:
7368 	 * TPA Packet was placed using jumbo algorithm. This means
7369 	 * that the first buffer will be filled with data before
7370 	 * moving to aggregation buffers. Each aggregation buffer
7371 	 * will be filled before moving to the next aggregation
7372 	 * buffer.
7373 	 */
7374 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
7375 	/*
7376 	 * Header/Data Separation:
7377 	 * Packet was placed using Header/Data separation algorithm.
7378 	 * The separation location is indicated by the itype field.
7379 	 */
7380 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
7381 	/*
7382 	 * IOC/Jumbo:
7383 	 * Packet will be placed using In-Order Completion/Jumbo where
7384 	 * the first packet of the aggregation is placed using Jumbo
7385 	 * Placement. Subsequent packets will be placed such that each
7386 	 * packet starts at the beginning of an aggregation buffer.
7387 	 */
7388 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
7389 	/*
7390 	 * GRO/Jumbo:
7391 	 * Packet will be placed using GRO/Jumbo where the first
7392 	 * packet is filled with data. Subsequent packets will be
7393 	 * placed such that any one packet does not span two
7394 	 * aggregation buffers unless it starts at the beginning of
7395 	 * an aggregation buffer.
7396 	 */
7397 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
7398 	/*
7399 	 * GRO/Header-Data Separation:
7400 	 * Packet will be placed using GRO/HDS where the header
7401 	 * is in the first packet.
7402 	 * Payload of each packet will be
7403 	 * placed such that any one packet does not span two
7404 	 * aggregation buffers unless it starts at the beginning of
7405 	 * an aggregation buffer.
7406 	 */
7407 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
7408 	/*
7409 	 * IOC/Header-Data Separation:
7410 	 * Packet will be placed using In-Order Completion/HDS where
7411 	 * the header is in the first packet buffer. Payload of each
7412 	 * packet will be placed such that each packet starts at the
7413 	 * beginning of an aggregation buffer.
7414 	 */
7415 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
7416 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
7417 	/* This bit is '1' if the RSS field in this completion is valid. */
7418 	#define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
7419 	/*
7420 	 * This bit is '1' if metadata has been added to the end of the
7421 	 * packet in host memory. Metadata starts at the first 32B boundary
7422 	 * after the end of the packet for regular and jumbo placement. It
7423 	 * starts at the first 32B boundary after the end of the header for
7424 	 * HDS placement. The length of the metadata is indicated in the
7425 	 * metadata itself.
7426 	 */
7427 	#define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
7428 	/*
7429 	 * This value indicates what the inner packet determined for the
7430 	 * packet was.
7431 	 */
7432 	#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
7433 	#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT		12
7434 	/*
7435 	 * TCP Packet:
7436 	 * Indicates that the packet was IP and TCP.
7437 	 */
7438 		#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7439 		#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST		RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
7440 	/*
7441 	 * This value indicates the amount of packet data written to the
7442 	 * buffer the opaque field in this completion corresponds to.
7443 	 */
7444 	uint16_t	len;
7445 	/*
7446 	 * This is a copy of the opaque field from the RX BD this completion
7447 	 * corresponds to. If the VNIC is configured to not use an Rx BD for
7448 	 * the TPA Start completion, then this is a copy of the opaque field
7449 	 * from the first BD used to place the TPA Start packet.
7450 	 */
7451 	uint32_t	opaque;
7452 	/*
7453 	 * This value is written by the NIC such that it will be different
7454 	 * for each pass through the completion queue. The even passes
7455 	 * will write 1. The odd passes will write 0.
7456 	 */
7457 	uint8_t	v1;
7458 	/*
7459 	 * This value is written by the NIC such that it will be different
7460 	 * for each pass through the completion queue. The even passes
7461 	 * will write 1. The odd passes will write 0.
7462 	 */
7463 	#define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
7464 	#define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
7465 	/*
7466 	 * This is the RSS hash type for the packet. The value is packed
7467 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7468 	 *
7469 	 * The value of tuple_extrac_op provides the information about
7470 	 * what fields the hash was computed on.
7471 	 * * 0: The RSS hash was computed over source IP address,
7472 	 * destination IP address, source port, and destination port of inner
7473 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
7474 	 * the packet headers are considered inner packet headers for the RSS
7475 	 * hash computation purpose.
7476 	 * * 1: The RSS hash was computed over source IP address and destination
7477 	 * IP address of inner IP header. Note: For non-tunneled packets,
7478 	 * the packet headers are considered inner packet headers for the RSS
7479 	 * hash computation purpose.
7480 	 * * 2: The RSS hash was computed over source IP address,
7481 	 * destination IP address, source port, and destination port of
7482 	 * IP and TCP or UDP headers of outer tunnel headers.
7483 	 * Note: For non-tunneled packets, this value is not applicable.
7484 	 * * 3: The RSS hash was computed over source IP address and
7485 	 * destination IP address of IP header of outer tunnel headers.
7486 	 * Note: For non-tunneled packets, this value is not applicable.
7487 	 *
7488 	 * Note that 4-tuples values listed above are applicable
7489 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
7490 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
7491 	 * enabled for TCP traffic only, then the values of tuple_extract_op
7492 	 * corresponding to 4-tuples are only valid for TCP traffic.
7493 	 */
7494 	uint8_t	rss_hash_type;
7495 	/*
7496 	 * This is the aggregation ID that the completion is associated
7497 	 * with. Use this number to correlate the TPA start completion
7498 	 * with the TPA end completion.
7499 	 */
7500 	uint16_t	agg_id;
7501 	/*
7502 	 * This is the aggregation ID that the completion is associated
7503 	 * with. Use this number to correlate the TPA start completion
7504 	 * with the TPA end completion.
7505 	 */
7506 	#define RX_TPA_START_V2_CMPL_AGG_ID_MASK		UINT32_C(0xfff)
7507 	#define RX_TPA_START_V2_CMPL_AGG_ID_SFT		0
7508 	#define RX_TPA_START_V2_CMPL_METADATA1_MASK		UINT32_C(0xf000)
7509 	#define RX_TPA_START_V2_CMPL_METADATA1_SFT		12
7510 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
7511 	#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
7512 	#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT	12
7513 	/* 0x88a8 */
7514 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
7515 	/* 0x8100 */
7516 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
7517 	/* 0x9100 */
7518 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
7519 	/* 0x9200 */
7520 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
7521 	/* 0x9300 */
7522 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
7523 	/* Value programmed in CFA VLANTPID register. */
7524 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
7525 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST	RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
7526 	/* When meta_format != 0, this value is the VLAN valid. */
7527 	#define RX_TPA_START_V2_CMPL_METADATA1_VALID		UINT32_C(0x8000)
7528 	/*
7529 	 * This value is the RSS hash value calculated for the packet
7530 	 * based on the mode bits and key value in the VNIC.
7531 	 * When vee_cmpl_mode is set in VNIC context, this is the lower
7532 	 * 32b of the host address from the first BD used to place the packet.
7533 	 */
7534 	uint32_t	rss_hash;
7535 } rx_tpa_start_v2_cmpl_t, *prx_tpa_start_v2_cmpl_t;
7536 
7537 /*
7538  * Last 16 bytes of RX L2 TPA Start V2 Completion Record
7539  *
7540  * This TPA completion structure is used on devices where the
7541  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7542  */
7543 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
7544 
7545 typedef struct rx_tpa_start_v2_cmpl_hi {
7546 	uint32_t	flags2;
7547 	/* This indicates that the aggregation was done using GRO rules. */
7548 	#define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO			UINT32_C(0x4)
7549 	/*
7550 	 * When this bit is '0', the cs_ok field has the following definition:-
7551 	 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
7552 	 * in the delivered packet, counted from the outer-most header group to
7553 	 * the inner-most header group, stopping at the first error. -
7554 	 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
7555 	 * in the delivered packet, counted from the outer-most header group to
7556 	 * the inner-most header group, stopping at the first error. When this
7557 	 * bit is '1', the cs_ok field has the following definition: -
7558 	 * hdr_cnt[2:0] = The number of header groups that were parsed by the
7559 	 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
7560 	 * will be '1' if all the parsed header groups with an IP checksum are
7561 	 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
7562 	 * header groups with an L4 checksum are valid.
7563 	 */
7564 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
7565 	/* This value indicates what format the metadata field is. */
7566 	#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
7567 	#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT		4
7568 	/* There is no metadata information. Values are zero. */
7569 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
7570 	/*
7571 	 * The {metadata1, metadata0} fields contain the vtag
7572 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
7573 	 * de, vid[11:0]} The metadata2 field contains the table scope
7574 	 * and action record pointer. - metadata2[25:0] contains the
7575 	 * action record pointer. - metadata2[31:26] contains the table
7576 	 * scope.
7577 	 */
7578 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
7579 	/*
7580 	 * The {metadata1, metadata0} fields contain the vtag
7581 	 * information:
7582 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7583 	 * The metadata2 field contains the Tunnel ID
7584 	 * value, justified to LSB.
7585 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
7586 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
7587 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
7588 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
7589 	 * - IPv4 = 0 (not populated)
7590 	 * - IPv6 = Flow Label[19:0]
7591 	 * - PPPoE = sessionID[15:0]
7592 	 * - MPLs = Outer label[19:0]
7593 	 * - UPAR = Selected[31:0] with bit mask
7594 	 */
7595 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
7596 	/*
7597 	 * The {metadata1, metadata0} fields contain the vtag
7598 	 * information:
7599 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
7600 	 * The metadata2 field contains the 32b metadata from the prepended
7601 	 * header (chdr_data).
7602 	 */
7603 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
7604 	/*
7605 	 * The {metadata1, metadata0} fields contain the vtag
7606 	 * information:
7607 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7608 	 * The metadata2 field contains the outer_l3_offset,
7609 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
7610 	 * - metadata2[8:0] contains the outer_l3_offset.
7611 	 * - metadata2[17:9] contains the inner_l2_offset.
7612 	 * - metadata2[26:18] contains the inner_l3_offset.
7613 	 * - metadata2[31:27] contains the inner_l4_size.
7614 	 */
7615 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
7616 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
7617 	/*
7618 	 * This field indicates the IP type for the inner-most IP header.
7619 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7620 	 * This value is only valid if itype indicates a packet
7621 	 * with an IP header.
7622 	 */
7623 	#define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
7624 	/*
7625 	 * This indicates that the complete 1's complement checksum was
7626 	 * calculated for the packet in the affregation.
7627 	 */
7628 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
7629 	/*
7630 	 * This field indicates the status of IP and L4 CS calculations done
7631 	 * by the chip. The format of this field is indicated by the
7632 	 * cs_all_ok_mode bit.
7633 	 * CS status for TPA packets is always valid. This means that "all_ok"
7634 	 * status will always be set. The ok count status will be set
7635 	 * appropriately for the packet header, such that all existing CS
7636 	 * values are ok.
7637 	 */
7638 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
7639 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT		10
7640 	/*
7641 	 * This value is the complete 1's complement checksum calculated from
7642 	 * the start of the outer L3 header to the end of the packet (not
7643 	 * including the ethernet crc). It is valid when the
7644 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
7645 	 * the complete checksum is calculated for the first packet in the
7646 	 * aggregation only.
7647 	 */
7648 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
7649 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
7650 	/*
7651 	 * This is data from the CFA block as indicated by the meta_format
7652 	 * field.
7653 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
7654 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
7655 	 *   act_rec_ptr[25:0]}
7656 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
7657 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
7658 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
7659 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
7660 	 * of the host address from the first BD used to place the packet.
7661 	 */
7662 	uint32_t	metadata2;
7663 	uint16_t	errors_v2;
7664 	/*
7665 	 * This value is written by the NIC such that it will be different
7666 	 * for each pass through the completion queue. The even passes
7667 	 * will write 1. The odd passes will write 0.
7668 	 */
7669 	#define RX_TPA_START_V2_CMPL_V2				UINT32_C(0x1)
7670 	#define RX_TPA_START_V2_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
7671 	#define RX_TPA_START_V2_CMPL_ERRORS_SFT			1
7672 	/*
7673 	 * This error indicates that there was some sort of problem with
7674 	 * the BDs for the packetThe packet should be treated as
7675 	 * invalid.
7676 	 */
7677 	#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
7678 	#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT	1
7679 	/* No buffer error */
7680 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
7681 	/*
7682 	 * Did Not Fit:
7683 	 * Packet did not fit into packet buffer provided. This means
7684 	 * that the TPA Start packet was too big to be placed into the
7685 	 * per-packet maximum number of physical buffers configured for
7686 	 * the VNIC, or that it was too big to be placed into the
7687 	 * per-aggregation maximum number of physical buffers configured
7688 	 * for the VNIC. This error only occurs when the VNIC is
7689 	 * configured for variable size receive buffers.
7690 	 */
7691 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
7692 	/*
7693 	 * Bad Format:
7694 	 * BDs were not formatted correctly.
7695 	 */
7696 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
7697 	/*
7698 	 * Flush:
7699 	 * There was a bad_format error on the previous operation
7700 	 */
7701 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
7702 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7703 	/*
7704 	 * This is data from the CFA block as indicated by the meta_format
7705 	 * field.
7706 	 */
7707 	uint16_t	metadata0;
7708 	/* When meta_format != 0, this value is the VLAN VID. */
7709 	#define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
7710 	#define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
7711 	/* When meta_format != 0, this value is the VLAN DE. */
7712 	#define RX_TPA_START_V2_CMPL_METADATA0_DE	UINT32_C(0x1000)
7713 	/* When meta_format != 0, this value is the VLAN PRI. */
7714 	#define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
7715 	#define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
7716 	/*
7717 	 * This field contains the outer_l3_offset, inner_l2_offset,
7718 	 * inner_l3_offset, and inner_l4_size.
7719 	 *
7720 	 * hdr_offsets[8:0] contains the outer_l3_offset.
7721 	 * hdr_offsets[17:9] contains the inner_l2_offset.
7722 	 * hdr_offsets[26:18] contains the inner_l3_offset.
7723 	 * hdr_offsets[31:27] contains the inner_l4_size.
7724 	 */
7725 	uint32_t	hdr_offsets;
7726 } rx_tpa_start_v2_cmpl_hi_t, *prx_tpa_start_v2_cmpl_hi_t;
7727 
7728 /*
7729  * This TPA completion structure is used on devices where the
7730  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7731  * RX L2 TPA Start V3 Completion Record (32 bytes split to 2 16-byte
7732  * struct)
7733  */
7734 /* rx_tpa_start_v3_cmpl (size:128b/16B) */
7735 
7736 typedef struct rx_tpa_start_v3_cmpl {
7737 	uint16_t	flags_type;
7738 	/*
7739 	 * This field indicates the exact type of the completion.
7740 	 * By convention, the LSB identifies the length of the
7741 	 * record in 16B units. Even values indicate 16B
7742 	 * records. Odd values indicate 32B
7743 	 * records.
7744 	 */
7745 	#define RX_TPA_START_V3_CMPL_TYPE_MASK			UINT32_C(0x3f)
7746 	#define RX_TPA_START_V3_CMPL_TYPE_SFT			0
7747 	/*
7748 	 * RX L2 TPA Start V3 completion:
7749 	 * Completion at the beginning of a TPA operation.
7750 	 * Length = 32B
7751 	 * This is the new version of the RX_TPA_START completion used
7752 	 * in Thor2 and later chips.
7753 	 */
7754 		#define RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3		UINT32_C(0x19)
7755 		#define RX_TPA_START_V3_CMPL_TYPE_LAST			RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3
7756 	#define RX_TPA_START_V3_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
7757 	#define RX_TPA_START_V3_CMPL_FLAGS_SFT			6
7758 	/*
7759 	 * When this bit is '1', it indicates a packet that has an error
7760 	 * of some type. Type of error is indicated in error_flags.
7761 	 */
7762 	#define RX_TPA_START_V3_CMPL_FLAGS_ERROR			UINT32_C(0x40)
7763 	/* This field indicates how the packet was placed in the buffer. */
7764 	#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
7765 	#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_SFT		7
7766 	/*
7767 	 * Jumbo:
7768 	 * TPA Packet was placed using jumbo algorithm. This means
7769 	 * that the first buffer will be filled with data before
7770 	 * moving to aggregation buffers. Each aggregation buffer
7771 	 * will be filled before moving to the next aggregation
7772 	 * buffer.
7773 	 */
7774 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
7775 	/*
7776 	 * Header/Data Separation:
7777 	 * Packet was placed using Header/Data separation algorithm.
7778 	 * The separation location is indicated by the itype field.
7779 	 */
7780 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
7781 	/*
7782 	 * IOC/Jumbo:
7783 	 * Packet will be placed using In-Order Completion/Jumbo where
7784 	 * the first packet of the aggregation is placed using Jumbo
7785 	 * Placement. Subsequent packets will be placed such that each
7786 	 * packet starts at the beginning of an aggregation buffer.
7787 	 */
7788 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
7789 	/*
7790 	 * GRO/Jumbo:
7791 	 * Packet will be placed using GRO/Jumbo where the first
7792 	 * packet is filled with data. Subsequent packets will be
7793 	 * placed such that any one packet does not span two
7794 	 * aggregation buffers unless it starts at the beginning of
7795 	 * an aggregation buffer.
7796 	 */
7797 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
7798 	/*
7799 	 * GRO/Header-Data Separation:
7800 	 * Packet will be placed using GRO/HDS where the header
7801 	 * is in the first packet.
7802 	 * Payload of each packet will be
7803 	 * placed such that any one packet does not span two
7804 	 * aggregation buffers unless it starts at the beginning of
7805 	 * an aggregation buffer.
7806 	 */
7807 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
7808 	/*
7809 	 * IOC/Header-Data Separation:
7810 	 * Packet will be placed using In-Order Completion/HDS where
7811 	 * the header is in the first packet buffer. Payload of each
7812 	 * packet will be placed such that each packet starts at the
7813 	 * beginning of an aggregation buffer.
7814 	 */
7815 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
7816 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS
7817 	/* This bit is '1' if the RSS field in this completion is valid. */
7818 	#define RX_TPA_START_V3_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
7819 	/*
7820 	 * This bit is '1' if metadata has been added to the end of the
7821 	 * packet in host memory. Metadata starts at the first 32B boundary
7822 	 * after the end of the packet for regular and jumbo placement. It
7823 	 * starts at the first 32B boundary after the end of the header for
7824 	 * HDS placement. The length of the metadata is indicated in the
7825 	 * metadata itself.
7826 	 */
7827 	#define RX_TPA_START_V3_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
7828 	/*
7829 	 * This value indicates what the inner packet determined for the
7830 	 * packet was.
7831 	 */
7832 	#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
7833 	#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_SFT		12
7834 	/*
7835 	 * TCP Packet:
7836 	 * Indicates that the packet was IP and TCP.
7837 	 */
7838 		#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7839 		#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_LAST		RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP
7840 	/*
7841 	 * This value indicates the amount of packet data written to the
7842 	 * buffer the opaque field in this completion corresponds to.
7843 	 */
7844 	uint16_t	len;
7845 	/*
7846 	 * This is a copy of the opaque field from the RX BD this completion
7847 	 * corresponds to. If the VNIC is configured to not use an Rx BD for
7848 	 * the TPA Start completion, then this is a copy of the opaque field
7849 	 * from the first BD used to place the TPA Start packet.
7850 	 */
7851 	uint32_t	opaque;
7852 	uint16_t	rss_hash_type_v1;
7853 	/*
7854 	 * This value is written by the NIC such that it will be different
7855 	 * for each pass through the completion queue. The even passes
7856 	 * will write 1. The odd passes will write 0.
7857 	 */
7858 	#define RX_TPA_START_V3_CMPL_V1		UINT32_C(0x1)
7859 	/* unused1 is 6 b. */
7860 	#define RX_TPA_START_V3_CMPL_UNUSED1_MASK	UINT32_C(0x7e)
7861 	#define RX_TPA_START_V3_CMPL_UNUSED1_SFT	1
7862 	/*
7863 	 * This is the RSS hash type for the packet. The value is packed
7864 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7865 	 *
7866 	 * The value of tuple_extrac_op provides the information about
7867 	 * what fields the hash was computed on.
7868 	 * * 0: The RSS hash was computed over source IP address,
7869 	 * destination IP address, source port, and destination port of inner
7870 	 * IP and TCP or UDP headers.
7871 	 * * 1: The RSS hash was computed over source IP address and
7872 	 * destination IP address of inner IP header.
7873 	 * * 2: The RSS hash was computed over source IP address,
7874 	 * destination IP address, source port, and destination port of
7875 	 * IP and TCP or UDP headers of outer tunnel headers.
7876 	 * Note: For non-tunneled packets, this value is not applicable.
7877 	 * * 3: The RSS hash was computed over source IP address and
7878 	 * destination IP address of IP header of outer tunnel headers.
7879 	 * Note: For non-tunneled packets, this value is not applicable.
7880 	 * * 4: The RSS hash was computed over source IP address of the inner
7881 	 * IP header.
7882 	 * * 5: The RSS hash was computed over destination IP address of the
7883 	 * inner IP header.
7884 	 * * 6: The RSS hash was computed over source IP address of the outer
7885 	 * IP header. Note: For non-tunneled packets, this value is not
7886 	 * applicable
7887 	 * * 7: The RSS hash was computed over destination IP address of the
7888 	 * outer IP header.
7889 	 * Note: For non-tunneled packets, this value is not applicable.
7890 	 * * 8: The RSS hash was computed over source IP address, destination
7891 	 * IP address, and flow label of the inner IP header.
7892 	 * Note: For packets without an inner IPv6 header, this value is not
7893 	 * applicable.
7894 	 * * 9: The RSS hash was computed over the flow label of the inner
7895 	 * IP header.
7896 	 * Note: For packets without an inner IPv6 header, this value
7897 	 * is not applicable.
7898 	 * * 10: The RSS hash was computed over source IP address, destination
7899 	 * IP address, and flow label of the outer IP header.
7900 	 * Note: For packets without an outer IPv6 header, this value is not
7901 	 * applicable.
7902 	 * * 11: The RSS hash was computed over the flow label of the outer
7903 	 * IP header. Note: For packets without an outer IPv6 header, this
7904 	 * value is not applicable.
7905 	 *
7906 	 * Note that 4-tuples values listed above are applicable
7907 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
7908 	 * HWRM firmware, and drivers. For example, if RSS hash is supported
7909 	 * and enabled for TCP traffic only, then the values of
7910 	 * tuple_extract_op corresponding to 4-tuples are only valid for TCP
7911 	 * traffic
7912 	 */
7913 	#define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_MASK UINT32_C(0xff80)
7914 	#define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_SFT 7
7915 	/*
7916 	 * This is the aggregation ID that the completion is associated
7917 	 * with. Use this number to correlate the TPA start completion
7918 	 * with the TPA end completion.
7919 	 */
7920 	uint16_t	agg_id;
7921 	/*
7922 	 * This is the aggregation ID that the completion is associated
7923 	 * with. Use this number to correlate the TPA start completion
7924 	 * with the TPA end completion.
7925 	 */
7926 	#define RX_TPA_START_V3_CMPL_AGG_ID_MASK		UINT32_C(0xfff)
7927 	#define RX_TPA_START_V3_CMPL_AGG_ID_SFT		0
7928 	#define RX_TPA_START_V3_CMPL_METADATA1_MASK		UINT32_C(0xf000)
7929 	#define RX_TPA_START_V3_CMPL_METADATA1_SFT		12
7930 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
7931 	#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
7932 	#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_SFT	12
7933 	/* 0x88a8 */
7934 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
7935 	/* 0x8100 */
7936 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
7937 	/* 0x9100 */
7938 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
7939 	/* 0x9200 */
7940 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
7941 	/* 0x9300 */
7942 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
7943 	/* Value programmed in CFA VLANTPID register. */
7944 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
7945 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_LAST	RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
7946 	/* When meta_format != 0, this value is the VLAN valid. */
7947 	#define RX_TPA_START_V3_CMPL_METADATA1_VALID		UINT32_C(0x8000)
7948 	/*
7949 	 * This value is the RSS hash value calculated for the packet
7950 	 * based on the mode bits and key value in the VNIC.
7951 	 * When vee_cmpl_mode is set in VNIC context, this is the lower
7952 	 * 32b of the host address from the first BD used to place the packet.
7953 	 */
7954 	uint32_t	rss_hash;
7955 } rx_tpa_start_v3_cmpl_t, *prx_tpa_start_v3_cmpl_t;
7956 
7957 /*
7958  * Last 16 bytes of RX L2 TPA Start V3 Completion Record
7959  *
7960  * This TPA completion structure is used on devices where the
7961  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7962  */
7963 /* rx_tpa_start_v3_cmpl_hi (size:128b/16B) */
7964 
7965 typedef struct rx_tpa_start_v3_cmpl_hi {
7966 	uint32_t	flags2;
7967 	/*
7968 	 * This indicates that the ip checksum was calculated for the inner
7969 	 * packet and that the ip_cs_error field indicates if there was an
7970 	 * error.
7971 	 */
7972 	#define RX_TPA_START_V3_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
7973 	/*
7974 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
7975 	 * for the inner packet and that the l4_cs_error field indicates if
7976 	 * there was an error.
7977 	 */
7978 	#define RX_TPA_START_V3_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
7979 	/*
7980 	 * This indicates that the ip checksum was calculated for the tunnel
7981 	 * header and that the t_ip_cs_error field indicates if there was an
7982 	 * error.
7983 	 */
7984 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
7985 	/*
7986 	 * This indicates that the UDP checksum was calculated for the tunnel
7987 	 * packet and that the t_l4_cs_error field indicates if there was an
7988 	 * error.
7989 	 */
7990 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
7991 	/* This value indicates what format the metadata field is. */
7992 	#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
7993 	#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_SFT		4
7994 	/* There is no metadata information. Values are zero. */
7995 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
7996 	/*
7997 	 * The {metadata1, metadata0} fields contain the vtag
7998 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
7999 	 * de, vid[11:0]} The metadata2 field contains the table scope
8000 	 * and action record pointer. - metadata2[25:0] contains the
8001 	 * action record pointer. - metadata2[31:26] contains the table
8002 	 * scope.
8003 	 */
8004 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
8005 	/*
8006 	 * The {metadata1, metadata0} fields contain the vtag
8007 	 * information:
8008 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
8009 	 * The metadata2 field contains the Tunnel ID
8010 	 * value, justified to LSB.
8011 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
8012 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
8013 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
8014 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
8015 	 * - IPv4 = 0 (not populated)
8016 	 * - IPv6 = Flow Label[19:0]
8017 	 * - PPPoE = sessionID[15:0]
8018 	 * - MPLs = Outer label[19:0]
8019 	 * - UPAR = Selected[31:0] with bit mask
8020 	 */
8021 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
8022 	/*
8023 	 * The {metadata1, metadata0} fields contain the vtag
8024 	 * information:
8025 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
8026 	 * The metadata2 field contains the 32b metadata from the prepended
8027 	 * header (chdr_data).
8028 	 */
8029 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
8030 	/*
8031 	 * The {metadata1, metadata0} fields contain the vtag
8032 	 * information:
8033 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
8034 	 * The metadata2 field contains the outer_l3_offset,
8035 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
8036 	 * - metadata2[8:0] contains the outer_l3_offset.
8037 	 * - metadata2[17:9] contains the inner_l2_offset.
8038 	 * - metadata2[26:18] contains the inner_l3_offset.
8039 	 * - metadata2[31:27] contains the inner_l4_size.
8040 	 */
8041 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
8042 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
8043 	/*
8044 	 * This field indicates the IP type for the inner-most IP header.
8045 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
8046 	 * This value is only valid if itype indicates a packet
8047 	 * with an IP header.
8048 	 */
8049 	#define RX_TPA_START_V3_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
8050 	/*
8051 	 * This indicates that the complete 1's complement checksum was
8052 	 * calculated for the packet.
8053 	 */
8054 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
8055 	/*
8056 	 * This field indicates the status of IP and L4 CS calculations done
8057 	 * by the chip. The format of this field is indicated by the
8058 	 * cs_all_ok_mode bit.
8059 	 */
8060 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE		UINT32_C(0x400)
8061 	/* Indicates that the Tunnel IP type was IPv4 */
8062 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV4		(UINT32_C(0x0) << 10)
8063 	/* Indicates that the Tunnel IP type was IPv6 */
8064 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6		(UINT32_C(0x1) << 10)
8065 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_LAST		RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6
8066 	/* This indicates that the aggregation was done using GRO rules. */
8067 	#define RX_TPA_START_V3_CMPL_FLAGS2_AGG_GRO			UINT32_C(0x800)
8068 	/*
8069 	 * This value is the complete 1's complement checksum calculated from
8070 	 * the start of the outer L3 header to the end of the packet (not
8071 	 * including the ethernet crc). It is valid when the
8072 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
8073 	 * the complete checksum is calculated for the first packet in the
8074 	 * aggregation only.
8075 	 */
8076 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
8077 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
8078 	/*
8079 	 * This is data from the CFA block as indicated by the meta_format
8080 	 * field.
8081 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
8082 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
8083 	 *   act_rec_ptr[25:0]}
8084 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
8085 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
8086 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
8087 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
8088 	 * of the host address from the first BD used to place the packet.
8089 	 */
8090 	uint32_t	metadata2;
8091 	uint16_t	errors_v2;
8092 	/*
8093 	 * This value is written by the NIC such that it will be different
8094 	 * for each pass through the completion queue. The even passes
8095 	 * will write 1. The odd passes will write 0.
8096 	 */
8097 	#define RX_TPA_START_V3_CMPL_V2				UINT32_C(0x1)
8098 	#define RX_TPA_START_V3_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
8099 	#define RX_TPA_START_V3_CMPL_ERRORS_SFT			1
8100 	/*
8101 	 * This error indicates that there was some sort of problem with
8102 	 * the BDs for the packetThe packet should be treated as
8103 	 * invalid.
8104 	 */
8105 	#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8106 	#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8107 	/* No buffer error */
8108 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
8109 	/*
8110 	 * Did Not Fit:
8111 	 * Packet did not fit into packet buffer provided. This means
8112 	 * that the TPA Start packet was too big to be placed into the
8113 	 * per-packet maximum number of physical buffers configured for
8114 	 * the VNIC, or that it was too big to be placed into the
8115 	 * per-aggregation maximum number of physical buffers configured
8116 	 * for the VNIC. This error only occurs when the VNIC is
8117 	 * configured for variable size receive buffers.
8118 	 */
8119 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
8120 	/*
8121 	 * Bad Format:
8122 	 * BDs were not formatted correctly.
8123 	 */
8124 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
8125 	/*
8126 	 * Flush:
8127 	 * There was a bad_format error on the previous operation
8128 	 */
8129 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
8130 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8131 	/*
8132 	 * This is data from the CFA block as indicated by the meta_format
8133 	 * field.
8134 	 */
8135 	uint16_t	metadata0;
8136 	/* When meta_format != 0, this value is the VLAN VID. */
8137 	#define RX_TPA_START_V3_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
8138 	#define RX_TPA_START_V3_CMPL_METADATA0_VID_SFT 0
8139 	/* When meta_format != 0, this value is the VLAN DE. */
8140 	#define RX_TPA_START_V3_CMPL_METADATA0_DE	UINT32_C(0x1000)
8141 	/* When meta_format != 0, this value is the VLAN PRI. */
8142 	#define RX_TPA_START_V3_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
8143 	#define RX_TPA_START_V3_CMPL_METADATA0_PRI_SFT 13
8144 	/*
8145 	 * This field contains the outer_l3_offset, inner_l2_offset,
8146 	 * inner_l3_offset, and inner_l4_size.
8147 	 *
8148 	 * hdr_offsets[8:0] contains the outer_l3_offset.
8149 	 * hdr_offsets[17:9] contains the inner_l2_offset.
8150 	 * hdr_offsets[26:18] contains the inner_l3_offset.
8151 	 * hdr_offsets[31:27] contains the inner_l4_size.
8152 	 */
8153 	uint32_t	hdr_offsets;
8154 } rx_tpa_start_v3_cmpl_hi_t, *prx_tpa_start_v3_cmpl_hi_t;
8155 
8156 /*
8157  * This TPA completion structure is used on devices where the
8158  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8159  */
8160 /* rx_tpa_end_cmpl (size:128b/16B) */
8161 
8162 typedef struct rx_tpa_end_cmpl {
8163 	uint16_t	flags_type;
8164 	/*
8165 	 * This field indicates the exact type of the completion.
8166 	 * By convention, the LSB identifies the length of the
8167 	 * record in 16B units. Even values indicate 16B
8168 	 * records. Odd values indicate 32B
8169 	 * records.
8170 	 */
8171 	#define RX_TPA_END_CMPL_TYPE_MASK			UINT32_C(0x3f)
8172 	#define RX_TPA_END_CMPL_TYPE_SFT			0
8173 	/*
8174 	 * RX L2 TPA End Completion:
8175 	 * Completion at the end of a TPA operation.
8176 	 * Length = 32B
8177 	 */
8178 		#define RX_TPA_END_CMPL_TYPE_RX_TPA_END		UINT32_C(0x15)
8179 		#define RX_TPA_END_CMPL_TYPE_LAST			RX_TPA_END_CMPL_TYPE_RX_TPA_END
8180 	#define RX_TPA_END_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8181 	#define RX_TPA_END_CMPL_FLAGS_SFT			6
8182 	/*
8183 	 * When this bit is '1', it indicates a packet that has an
8184 	 * error of some type. Type of error is indicated in
8185 	 * error_flags.
8186 	 */
8187 	#define RX_TPA_END_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8188 	/* This field indicates how the packet was placed in the buffer. */
8189 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8190 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT		7
8191 	/*
8192 	 * Jumbo:
8193 	 * TPA Packet was placed using jumbo algorithm. This means
8194 	 * that the first buffer will be filled with data before
8195 	 * moving to aggregation buffers. Each aggregation buffer
8196 	 * will be filled before moving to the next aggregation
8197 	 * buffer.
8198 	 */
8199 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8200 	/*
8201 	 * Header/Data Separation:
8202 	 * Packet was placed using Header/Data separation algorithm.
8203 	 * The separation location is indicated by the itype field.
8204 	 */
8205 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8206 	/*
8207 	 * IOC/Jumbo:
8208 	 * Packet will be placed using In-Order Completion/Jumbo where
8209 	 * the first packet of the aggregation is placed using Jumbo
8210 	 * Placement. Subsequent packets will be placed such that each
8211 	 * packet starts at the beginning of an aggregation buffer.
8212 	 */
8213 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
8214 	/*
8215 	 * GRO/Jumbo:
8216 	 * Packet will be placed using GRO/Jumbo where the first
8217 	 * packet is filled with data. Subsequent packets will be
8218 	 * placed such that any one packet does not span two
8219 	 * aggregation buffers unless it starts at the beginning of
8220 	 * an aggregation buffer.
8221 	 */
8222 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8223 	/*
8224 	 * GRO/Header-Data Separation:
8225 	 * Packet will be placed using GRO/HDS where the header
8226 	 * is in the first packet.
8227 	 * Payload of each packet will be
8228 	 * placed such that any one packet does not span two
8229 	 * aggregation buffers unless it starts at the beginning of
8230 	 * an aggregation buffer.
8231 	 */
8232 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8233 	/*
8234 	 * IOC/Header-Data Separation:
8235 	 * Packet will be placed using In-Order Completion/HDS where
8236 	 * the header is in the first packet buffer. Payload of each
8237 	 * packet will be placed such that each packet starts at the
8238 	 * beginning of an aggregation buffer.
8239 	 */
8240 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
8241 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
8242 	/* When set, this bit indicates that the timestamp field is valid. */
8243 	#define RX_TPA_END_CMPL_FLAGS_TIMESTAMP_VALID	UINT32_C(0x400)
8244 	/*
8245 	 * This bit is '1' if metadata has been added to the end of the
8246 	 * packet in host memory. Metadata starts at the first 32B boundary
8247 	 * after the end of the packet for regular and jumbo placement.
8248 	 * It starts at the first 32B boundary after the end of the header
8249 	 * for HDS placement. The length of the metadata is indicated in the
8250 	 * metadata itself.
8251 	 */
8252 	#define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
8253 	/*
8254 	 * This value indicates what the inner packet determined for the
8255 	 * packet was.
8256 	 * - 2 TCP Packet
8257 	 *	Indicates that the packet was IP and TCP. This indicates
8258 	 *	that the ip_cs field is valid and that the tcp_udp_cs
8259 	 *	field is valid and contains the TCP checksum.
8260 	 *	This also indicates that the payload_offset field is valid.
8261 	 */
8262 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8263 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT		12
8264 	/*
8265 	 * This value is zero for TPA End completions.
8266 	 * There is no data in the buffer that corresponds to the opaque
8267 	 * value in this completion.
8268 	 */
8269 	uint16_t	len;
8270 	/*
8271 	 * This is a copy of the opaque field from the RX BD this completion
8272 	 * corresponds to.
8273 	 */
8274 	uint32_t	opaque;
8275 	/*
8276 	 * This value is written by the NIC such that it will be different
8277 	 * for each pass through the completion queue. The even passes
8278 	 * will write 1. The odd passes will write 0.
8279 	 */
8280 	uint8_t	agg_bufs_v1;
8281 	/*
8282 	 * This value is written by the NIC such that it will be different
8283 	 * for each pass through the completion queue. The even passes
8284 	 * will write 1. The odd passes will write 0.
8285 	 */
8286 	#define RX_TPA_END_CMPL_V1	UINT32_C(0x1)
8287 	/*
8288 	 * This value is the number of aggregation buffers that follow this
8289 	 * entry in the completion ring that are a part of this aggregation
8290 	 * packet.
8291 	 * If the value is zero, then the packet is completely contained
8292 	 * in the buffer space provided in the aggregation start completion.
8293 	 */
8294 	#define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
8295 	#define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
8296 	/* This value is the number of segments in the TPA operation. */
8297 	uint8_t	tpa_segs;
8298 	/*
8299 	 * This value indicates the offset in bytes from the beginning of the
8300 	 * packet where the inner payload starts. This value is valid for TCP,
8301 	 * UDP, FCoE, and RoCE packets.
8302 	 *
8303 	 * A value of zero indicates an offset of 256 bytes.
8304 	 */
8305 	uint8_t	payload_offset;
8306 	uint8_t	agg_id;
8307 	/* unused2 is 1 b */
8308 	#define RX_TPA_END_CMPL_UNUSED2	UINT32_C(0x1)
8309 	/*
8310 	 * This is the aggregation ID that the completion is associated
8311 	 * with. Use this number to correlate the TPA start completion
8312 	 * with the TPA end completion.
8313 	 */
8314 	#define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
8315 	#define RX_TPA_END_CMPL_AGG_ID_SFT  1
8316 	/*
8317 	 * For non-GRO packets, this value is the
8318 	 * timestamp delta between earliest and latest timestamp values for
8319 	 * TPA packet. If packets were not time stamped, then delta will be
8320 	 * zero.
8321 	 *
8322 	 * For GRO packets, this field is zero except for the following
8323 	 * sub-fields.
8324 	 * - tsdelta[31]
8325 	 *	Timestamp present indication. When '0', no Timestamp
8326 	 *	option is in the packet. When '1', then a Timestamp
8327 	 *	option is present in the packet.
8328 	 */
8329 	uint32_t	tsdelta;
8330 } rx_tpa_end_cmpl_t, *prx_tpa_end_cmpl_t;
8331 
8332 /*
8333  * Last 16 bytes of rx_tpa_end_cmpl.
8334  *
8335  * This TPA completion structure is used on devices where the
8336  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8337  */
8338 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
8339 
8340 typedef struct rx_tpa_end_cmpl_hi {
8341 	uint32_t	tpa_dup_acks;
8342 	/*
8343 	 * This value is the number of duplicate ACKs that have been
8344 	 * received as part of the TPA operation.
8345 	 */
8346 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
8347 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
8348 	/*
8349 	 * This value is the valid when TPA completion is active. It
8350 	 * indicates the length of the longest segment of the TPA operation
8351 	 * for LRO mode and the length of the first segment in GRO mode.
8352 	 *
8353 	 * This value may be used by GRO software to re-construct the original
8354 	 * packet stream from the TPA packet. This is the length of all
8355 	 * but the last segment for GRO. In LRO mode this value may be used
8356 	 * to indicate MSS size to the stack.
8357 	 */
8358 	uint16_t	tpa_seg_len;
8359 	/*
8360 	 * The lower 16b of the timestamp of the last packet added to the
8361 	 * aggregation. Only valid when flags.timestamp_valid is set.
8362 	 */
8363 	uint16_t	timestamp_lower;
8364 	uint16_t	errors_v2;
8365 	/*
8366 	 * This value is written by the NIC such that it will be different
8367 	 * for each pass through the completion queue. The even passes
8368 	 * will write 1. The odd passes will write 0.
8369 	 */
8370 	#define RX_TPA_END_CMPL_V2				UINT32_C(0x1)
8371 	#define RX_TPA_END_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
8372 	#define RX_TPA_END_CMPL_ERRORS_SFT			1
8373 	/*
8374 	 * This error indicates that there was some sort of problem with
8375 	 * the BDs for the packet that was found after part of the
8376 	 * packet was already placed. The packet should be treated as
8377 	 * invalid.
8378 	 */
8379 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8380 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8381 	/*
8382 	 * This error occurs when there is a fatal HW problem in
8383 	 * the chip only. It indicates that there were not
8384 	 * BDs on chip but that there was adequate reservation.
8385 	 * provided by the TPA block.
8386 	 */
8387 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP   (UINT32_C(0x2) << 1)
8388 	/*
8389 	 * This error occurs when TPA block was not configured to
8390 	 * reserve adequate BDs for TPA operations on this RX
8391 	 * ring. All data for the TPA operation was not placed.
8392 	 *
8393 	 * This error can also be generated when the number of
8394 	 * segments is not programmed correctly in TPA and the
8395 	 * 33 total aggregation buffers allowed for the TPA
8396 	 * operation has been exceeded.
8397 	 */
8398 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR	(UINT32_C(0x4) << 1)
8399 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
8400 	/*
8401 	 * The upper 16b of the timestamp of the last packet added to the
8402 	 * aggregation. Only valid when flags.timestamp_valid is set.
8403 	 */
8404 	uint16_t	timestamp_upper;
8405 	/*
8406 	 * This is the opaque value that was completed for the TPA start
8407 	 * completion that corresponds to this TPA end completion.
8408 	 */
8409 	uint32_t	start_opaque;
8410 } rx_tpa_end_cmpl_hi_t, *prx_tpa_end_cmpl_hi_t;
8411 
8412 /*
8413  * This TPA completion structure is used on devices where the
8414  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8415  */
8416 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
8417 
8418 typedef struct rx_tpa_v2_start_cmpl {
8419 	uint16_t	flags_type;
8420 	/*
8421 	 * This field indicates the exact type of the completion.
8422 	 * By convention, the LSB identifies the length of the
8423 	 * record in 16B units. Even values indicate 16B
8424 	 * records. Odd values indicate 32B
8425 	 * records.
8426 	 */
8427 	#define RX_TPA_V2_START_CMPL_TYPE_MASK			UINT32_C(0x3f)
8428 	#define RX_TPA_V2_START_CMPL_TYPE_SFT			0
8429 	/*
8430 	 * RX L2 TPA Start Completion:
8431 	 * Completion at the beginning of a TPA operation.
8432 	 * Length = 32B
8433 	 */
8434 		#define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START		UINT32_C(0x13)
8435 		#define RX_TPA_V2_START_CMPL_TYPE_LAST			RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
8436 	#define RX_TPA_V2_START_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8437 	#define RX_TPA_V2_START_CMPL_FLAGS_SFT			6
8438 	/* This bit will always be '0' for TPA start completions. */
8439 	#define RX_TPA_V2_START_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8440 	/* This field indicates how the packet was placed in the buffer. */
8441 	#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8442 	#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT		7
8443 	/*
8444 	 * Jumbo:
8445 	 * TPA Packet was placed using jumbo algorithm. This means
8446 	 * that the first buffer will be filled with data before
8447 	 * moving to aggregation buffers. Each aggregation buffer
8448 	 * will be filled before moving to the next aggregation
8449 	 * buffer.
8450 	 */
8451 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8452 	/*
8453 	 * Header/Data Separation:
8454 	 * Packet was placed using Header/Data separation algorithm.
8455 	 * The separation location is indicated by the itype field.
8456 	 */
8457 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8458 	/*
8459 	 * GRO/Jumbo:
8460 	 * Packet will be placed using GRO/Jumbo where the first
8461 	 * packet is filled with data. Subsequent packets will be
8462 	 * placed such that any one packet does not span two
8463 	 * aggregation buffers unless it starts at the beginning of
8464 	 * an aggregation buffer.
8465 	 */
8466 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8467 	/*
8468 	 * GRO/Header-Data Separation:
8469 	 * Packet will be placed using GRO/HDS where the header
8470 	 * is in the first packet.
8471 	 * Payload of each packet will be
8472 	 * placed such that any one packet does not span two
8473 	 * aggregation buffers unless it starts at the beginning of
8474 	 * an aggregation buffer.
8475 	 */
8476 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8477 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
8478 	/* This bit is '1' if the RSS field in this completion is valid. */
8479 	#define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
8480 	/*
8481 	 * For devices that support timestamps, when this bit is cleared the
8482 	 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8483 	 * field contains the 32b timestamp for
8484 	 * the packet from the MAC. When this bit is set, the
8485 	 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8486 	 * field contains the outer_l3_offset, inner_l2_offset,
8487 	 * inner_l3_offset, and inner_l4_size.
8488 	 */
8489 	#define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT	UINT32_C(0x800)
8490 	/*
8491 	 * This value indicates what the inner packet determined for the
8492 	 * packet was.
8493 	 */
8494 	#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8495 	#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT		12
8496 	/*
8497 	 * TCP Packet:
8498 	 * Indicates that the packet was IP and TCP.
8499 	 */
8500 		#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
8501 		#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST		RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
8502 	/*
8503 	 * This value indicates the amount of packet data written to the
8504 	 * buffer the opaque field in this completion corresponds to.
8505 	 */
8506 	uint16_t	len;
8507 	/*
8508 	 * This is a copy of the opaque field from the RX BD this completion
8509 	 * corresponds to.
8510 	 */
8511 	uint32_t	opaque;
8512 	/*
8513 	 * This value is written by the NIC such that it will be different
8514 	 * for each pass through the completion queue. The even passes
8515 	 * will write 1. The odd passes will write 0.
8516 	 */
8517 	uint8_t	v1;
8518 	/*
8519 	 * This value is written by the NIC such that it will be different
8520 	 * for each pass through the completion queue. The even passes
8521 	 * will write 1. The odd passes will write 0.
8522 	 */
8523 	#define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
8524 	#define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
8525 	/*
8526 	 * This is the RSS hash type for the packet. The value is packed
8527 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
8528 	 *
8529 	 * The value of tuple_extrac_op provides the information about
8530 	 * what fields the hash was computed on.
8531 	 * * 0: The RSS hash was computed over source IP address,
8532 	 * destination IP address, source port, and destination port of inner
8533 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
8534 	 * the packet headers are considered inner packet headers for the RSS
8535 	 * hash computation purpose.
8536 	 * * 1: The RSS hash was computed over source IP address and destination
8537 	 * IP address of inner IP header. Note: For non-tunneled packets,
8538 	 * the packet headers are considered inner packet headers for the RSS
8539 	 * hash computation purpose.
8540 	 * * 2: The RSS hash was computed over source IP address,
8541 	 * destination IP address, source port, and destination port of
8542 	 * IP and TCP or UDP headers of outer tunnel headers.
8543 	 * Note: For non-tunneled packets, this value is not applicable.
8544 	 * * 3: The RSS hash was computed over source IP address and
8545 	 * destination IP address of IP header of outer tunnel headers.
8546 	 * Note: For non-tunneled packets, this value is not applicable.
8547 	 *
8548 	 * Note that 4-tuples values listed above are applicable
8549 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
8550 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
8551 	 * enabled for TCP traffic only, then the values of tuple_extract_op
8552 	 * corresponding to 4-tuples are only valid for TCP traffic.
8553 	 */
8554 	uint8_t	rss_hash_type;
8555 	/*
8556 	 * This is the aggregation ID that the completion is associated
8557 	 * with. Use this number to correlate the TPA start completion
8558 	 * with the TPA end completion.
8559 	 */
8560 	uint16_t	agg_id;
8561 	/*
8562 	 * This value is the RSS hash value calculated for the packet
8563 	 * based on the mode bits and key value in the VNIC.
8564 	 */
8565 	uint32_t	rss_hash;
8566 } rx_tpa_v2_start_cmpl_t, *prx_tpa_v2_start_cmpl_t;
8567 
8568 /*
8569  * Last 16 bytes of rx_tpa_v2_start_cmpl.
8570  *
8571  * This TPA completion structure is used on devices where the
8572  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8573  */
8574 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
8575 
8576 typedef struct rx_tpa_v2_start_cmpl_hi {
8577 	uint32_t	flags2;
8578 	/*
8579 	 * This indicates that the ip checksum was calculated for the
8580 	 * inner packet and that the sum passed for all segments
8581 	 * included in the aggregation.
8582 	 */
8583 	#define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
8584 	/*
8585 	 * This indicates that the TCP, UDP or ICMP checksum was
8586 	 * calculated for the inner packet and that the sum passed
8587 	 * for all segments included in the aggregation.
8588 	 */
8589 	#define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
8590 	/*
8591 	 * This indicates that the ip checksum was calculated for the
8592 	 * tunnel header and that the sum passed for all segments
8593 	 * included in the aggregation.
8594 	 */
8595 	#define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
8596 	/*
8597 	 * This indicates that the UDP checksum was
8598 	 * calculated for the tunnel packet and that the sum passed for
8599 	 * all segments included in the aggregation.
8600 	 */
8601 	#define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
8602 	/* This value indicates what format the metadata field is. */
8603 	#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
8604 	#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT		4
8605 	/* No metadata informtaion. Value is zero. */
8606 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
8607 	/*
8608 	 * The metadata field contains the VLAN tag and TPID value.
8609 	 * - metadata[11:0] contains the vlan VID value.
8610 	 * - metadata[12] contains the vlan DE value.
8611 	 * - metadata[15:13] contains the vlan PRI value.
8612 	 * - metadata[31:16] contains the vlan TPID value.
8613 	 */
8614 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
8615 	/*
8616 	 * If ext_meta_format is equal to 1, the metadata field
8617 	 * contains the lower 16b of the tunnel ID value, justified
8618 	 * to LSB
8619 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
8620 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
8621 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
8622 	 * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
8623 	 * - IPV4 = 0 (not populated)
8624 	 * - IPV6 = Flow Label[19:0]
8625 	 * - PPPoE = sessionID[15:0]
8626 	 * - MPLs = Outer label[19:0]
8627 	 * - UPAR = Selected[31:0] with bit mask
8628 	 */
8629 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
8630 	/*
8631 	 * if ext_meta_format is equal to 1, metadata field contains
8632 	 * 16b metadata from the prepended header (chdr_data).
8633 	 */
8634 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
8635 	/*
8636 	 * If ext_meta_format is equal to 1, the metadata field contains
8637 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
8638 	 * inner_l4_size.
8639 	 * - metadata[8:0] contains the outer_l3_offset.
8640 	 * - metadata[17:9] contains the inner_l2_offset.
8641 	 * - metadata[26:18] contains the inner_l3_offset.
8642 	 * - metadata[31:27] contains the inner_l4_size.
8643 	 */
8644 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
8645 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
8646 	/*
8647 	 * This field indicates the IP type for the inner-most IP header.
8648 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
8649 	 */
8650 	#define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
8651 	/*
8652 	 * This indicates that the complete 1's complement checksum was
8653 	 * calculated for the packet.
8654 	 */
8655 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
8656 	/*
8657 	 * The combination of this value and meta_format indicated what
8658 	 * format the metadata field is.
8659 	 */
8660 	#define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
8661 	#define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT	10
8662 	/*
8663 	 * This value is the complete 1's complement checksum calculated from
8664 	 * the start of the outer L3 header to the end of the packet (not
8665 	 * including the ethernet crc). It is valid when the
8666 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
8667 	 * the complete checksum is calculated for the first packet in the
8668 	 * aggregation only.
8669 	 */
8670 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
8671 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
8672 	/*
8673 	 * This is data from the CFA block as indicated by the meta_format
8674 	 * field.
8675 	 */
8676 	uint32_t	metadata;
8677 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
8678 	#define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
8679 	#define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
8680 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
8681 	#define RX_TPA_V2_START_CMPL_METADATA_DE	UINT32_C(0x1000)
8682 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
8683 	#define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
8684 	#define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
8685 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
8686 	#define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
8687 	#define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
8688 	uint16_t	errors_v2;
8689 	/*
8690 	 * This value is written by the NIC such that it will be different
8691 	 * for each pass through the completion queue. The even passes
8692 	 * will write 1. The odd passes will write 0.
8693 	 */
8694 	#define RX_TPA_V2_START_CMPL_V2				UINT32_C(0x1)
8695 	#define RX_TPA_V2_START_CMPL_ERRORS_MASK		UINT32_C(0xfffe)
8696 	#define RX_TPA_V2_START_CMPL_ERRORS_SFT			1
8697 	/*
8698 	 * This error indicates that there was some sort of problem with
8699 	 * the BDs for the packet that was found after part of the
8700 	 * packet was already placed. The packet should be treated as
8701 	 * invalid.
8702 	 */
8703 	#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8704 	#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8705 	/* No buffer error */
8706 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
8707 	/*
8708 	 * Bad Format:
8709 	 * BDs were not formatted correctly.
8710 	 */
8711 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT   (UINT32_C(0x3) << 1)
8712 	/*
8713 	 * Flush:
8714 	 * There was a bad_format error on the previous operation
8715 	 */
8716 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
8717 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8718 	/*
8719 	 * This field identifies the CFA action rule that was used for this
8720 	 * packet.
8721 	 */
8722 	uint16_t	cfa_code;
8723 	/*
8724 	 * For devices that support timestamps this field is overridden
8725 	 * with the timestamp value. When `flags.timestamp_fld_format` is
8726 	 * cleared, this field contains the 32b timestamp for the packet from the
8727 	 * MAC.
8728 	 *
8729 	 * When `flags.timestamp_fld_format` is set, this field contains the
8730 	 * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
8731 	 * as defined below.
8732 	 */
8733 	uint32_t	inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
8734 	/*
8735 	 * This is the offset from the beginning of the packet in bytes for
8736 	 * the outer L3 header. If there is no outer L3 header, then this
8737 	 * value is zero.
8738 	 */
8739 	#define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
8740 	#define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
8741 	/*
8742 	 * This is the offset from the beginning of the packet in bytes for
8743 	 * the inner most L2 header.
8744 	 */
8745 	#define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
8746 	#define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
8747 	/*
8748 	 * This is the offset from the beginning of the packet in bytes for
8749 	 * the inner most L3 header.
8750 	 */
8751 	#define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
8752 	#define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
8753 	/*
8754 	 * This is the size in bytes of the inner most L4 header.
8755 	 * This can be subtracted from the payload_offset to determine
8756 	 * the start of the inner most L4 header.
8757 	 */
8758 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
8759 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
8760 } rx_tpa_v2_start_cmpl_hi_t, *prx_tpa_v2_start_cmpl_hi_t;
8761 
8762 /*
8763  * This TPA completion structure is used on devices where the
8764  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8765  */
8766 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
8767 
8768 typedef struct rx_tpa_v2_end_cmpl {
8769 	uint16_t	flags_type;
8770 	/*
8771 	 * This field indicates the exact type of the completion.
8772 	 * By convention, the LSB identifies the length of the
8773 	 * record in 16B units. Even values indicate 16B
8774 	 * records. Odd values indicate 32B
8775 	 * records.
8776 	 */
8777 	#define RX_TPA_V2_END_CMPL_TYPE_MASK			UINT32_C(0x3f)
8778 	#define RX_TPA_V2_END_CMPL_TYPE_SFT			0
8779 	/*
8780 	 * RX L2 TPA End Completion:
8781 	 * Completion at the end of a TPA operation.
8782 	 * Length = 32B
8783 	 */
8784 		#define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END		UINT32_C(0x15)
8785 		#define RX_TPA_V2_END_CMPL_TYPE_LAST			RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
8786 	#define RX_TPA_V2_END_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8787 	#define RX_TPA_V2_END_CMPL_FLAGS_SFT			6
8788 	/*
8789 	 * When this bit is '1', it indicates a packet that has an
8790 	 * error of some type. Type of error is indicated in
8791 	 * error_flags.
8792 	 */
8793 	#define RX_TPA_V2_END_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8794 	/* This field indicates how the packet was placed in the buffer. */
8795 	#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8796 	#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT		7
8797 	/*
8798 	 * Jumbo:
8799 	 * TPA Packet was placed using jumbo algorithm. This means
8800 	 * that the first buffer will be filled with data before
8801 	 * moving to aggregation buffers. Each aggregation buffer
8802 	 * will be filled before moving to the next aggregation
8803 	 * buffer.
8804 	 */
8805 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8806 	/*
8807 	 * Header/Data Separation:
8808 	 * Packet was placed using Header/Data separation algorithm.
8809 	 * The separation location is indicated by the itype field.
8810 	 */
8811 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8812 	/*
8813 	 * GRO/Jumbo:
8814 	 * Packet will be placed using GRO/Jumbo where the first
8815 	 * packet is filled with data. Subsequent packets will be
8816 	 * placed such that any one packet does not span two
8817 	 * aggregation buffers unless it starts at the beginning of
8818 	 * an aggregation buffer.
8819 	 */
8820 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8821 	/*
8822 	 * GRO/Header-Data Separation:
8823 	 * Packet will be placed using GRO/HDS where the header
8824 	 * is in the first packet.
8825 	 * Payload of each packet will be
8826 	 * placed such that any one packet does not span two
8827 	 * aggregation buffers unless it starts at the beginning of
8828 	 * an aggregation buffer.
8829 	 */
8830 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8831 	/*
8832 	 * IOC/Header-Data Separation:
8833 	 * Packet will be placed using In-Order Completion/HDS where
8834 	 * the header is in the first packet buffer. Payload of each
8835 	 * packet will be placed such that each packet starts at the
8836 	 * beginning of an aggregation buffer.
8837 	 */
8838 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
8839 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
8840 	/* unused is 1 b */
8841 	#define RX_TPA_V2_END_CMPL_FLAGS_UNUSED			UINT32_C(0x400)
8842 	/*
8843 	 * This bit is '1' if metadata has been added to the end of the
8844 	 * packet in host memory. Metadata starts at the first 32B boundary
8845 	 * after the end of the packet for regular and jumbo placement.
8846 	 * It starts at the first 32B boundary after the end of the header
8847 	 * for HDS placement. The length of the metadata is indicated in the
8848 	 * metadata itself.
8849 	 */
8850 	#define RX_TPA_V2_END_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
8851 	/*
8852 	 * This value indicates what the inner packet determined for the
8853 	 * packet was.
8854 	 * - 2 TCP Packet
8855 	 *	Indicates that the packet was IP and TCP. This indicates
8856 	 *	that the ip_cs field is valid and that the tcp_udp_cs
8857 	 *	field is valid and contains the TCP checksum.
8858 	 *	This also indicates that the payload_offset field is valid.
8859 	 */
8860 	#define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8861 	#define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT		12
8862 	/*
8863 	 * This value is zero for TPA End completions.
8864 	 * There is no data in the buffer that corresponds to the opaque
8865 	 * value in this completion.
8866 	 */
8867 	uint16_t	len;
8868 	/*
8869 	 * This is a copy of the opaque field from the RX BD this completion
8870 	 * corresponds to.
8871 	 */
8872 	uint32_t	opaque;
8873 	uint8_t	v1;
8874 	/*
8875 	 * This value is written by the NIC such that it will be different
8876 	 * for each pass through the completion queue. The even passes
8877 	 * will write 1. The odd passes will write 0.
8878 	 */
8879 	#define RX_TPA_V2_END_CMPL_V1	UINT32_C(0x1)
8880 	/* This value is the number of segments in the TPA operation. */
8881 	uint8_t	tpa_segs;
8882 	/*
8883 	 * This is the aggregation ID that the completion is associated
8884 	 * with. Use this number to correlate the TPA start completion
8885 	 * with the TPA end completion.
8886 	 */
8887 	uint16_t	agg_id;
8888 	/*
8889 	 * For non-GRO packets, this value is the
8890 	 * timestamp delta between earliest and latest timestamp values for
8891 	 * TPA packet. If packets were not time stamped, then delta will be
8892 	 * zero.
8893 	 *
8894 	 * For GRO packets, this field is zero except for the following
8895 	 * sub-fields.
8896 	 * - tsdelta[31]
8897 	 *	Timestamp present indication. When '0', no Timestamp
8898 	 *	option is in the packet. When '1', then a Timestamp
8899 	 *	option is present in the packet.
8900 	 */
8901 	uint32_t	tsdelta;
8902 } rx_tpa_v2_end_cmpl_t, *prx_tpa_v2_end_cmpl_t;
8903 
8904 /*
8905  * Last 16 bytes of rx_tpa_v2_end_cmpl.
8906  *
8907  * This TPA completion structure is used on devices where the
8908  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8909  */
8910 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
8911 
8912 typedef struct rx_tpa_v2_end_cmpl_hi {
8913 	/*
8914 	 * This value is the number of duplicate ACKs that have been
8915 	 * received as part of the TPA operation.
8916 	 */
8917 	uint16_t	tpa_dup_acks;
8918 	/*
8919 	 * This value is the number of duplicate ACKs that have been
8920 	 * received as part of the TPA operation.
8921 	 */
8922 	#define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
8923 	#define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
8924 	/*
8925 	 * This value indicated the offset in bytes from the beginning of
8926 	 * the packet where the inner payload starts. This value is valid
8927 	 * for TCP, UDP, FCoE and RoCE packets
8928 	 */
8929 	uint8_t	payload_offset;
8930 	/*
8931 	 * The value is the total number of aggregation buffers that were
8932 	 * used in the TPA operation. All TPA aggregation buffer completions
8933 	 * precede the TPA End completion. If the value is zero, then the
8934 	 * aggregation is completely contained in the buffer space provided
8935 	 * in the aggregation start completion.
8936 	 * Note that the field is simply provided as a cross check.
8937 	 */
8938 	uint8_t	tpa_agg_bufs;
8939 	/*
8940 	 * This value is the valid when TPA completion is active. It
8941 	 * indicates the length of the longest segment of the TPA operation
8942 	 * for LRO mode and the length of the first segment in GRO mode.
8943 	 *
8944 	 * This value may be used by GRO software to re-construct the original
8945 	 * packet stream from the TPA packet. This is the length of all
8946 	 * but the last segment for GRO. In LRO mode this value may be used
8947 	 * to indicate MSS size to the stack.
8948 	 */
8949 	uint16_t	tpa_seg_len;
8950 	uint16_t	unused_1;
8951 	uint16_t	errors_v2;
8952 	/*
8953 	 * This value is written by the NIC such that it will be different
8954 	 * for each pass through the completion queue. The even passes
8955 	 * will write 1. The odd passes will write 0.
8956 	 */
8957 	#define RX_TPA_V2_END_CMPL_V2				UINT32_C(0x1)
8958 	#define RX_TPA_V2_END_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
8959 	#define RX_TPA_V2_END_CMPL_ERRORS_SFT			1
8960 	/*
8961 	 * This error indicates that there was some sort of problem with
8962 	 * the BDs for the packet that was found after part of the
8963 	 * packet was already placed. The packet should be treated as
8964 	 * invalid.
8965 	 */
8966 	#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8967 	#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8968 	/* No buffer error */
8969 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
8970 	/*
8971 	 * This error occurs when there is a fatal HW problem in
8972 	 * the chip only. It indicates that there were not
8973 	 * BDs on chip but that there was adequate reservation.
8974 	 * provided by the TPA block.
8975 	 */
8976 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP   (UINT32_C(0x2) << 1)
8977 	/*
8978 	 * Bad Format:
8979 	 * BDs were not formatted correctly.
8980 	 */
8981 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
8982 	/*
8983 	 * This error occurs when TPA block was not configured to
8984 	 * reserve adequate BDs for TPA operations on this RX
8985 	 * ring. All data for the TPA operation was not placed.
8986 	 *
8987 	 * This error can also be generated when the number of
8988 	 * segments is not programmed correctly in TPA and the
8989 	 * 33 total aggregation buffers allowed for the TPA
8990 	 * operation has been exceeded.
8991 	 */
8992 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR	(UINT32_C(0x4) << 1)
8993 	/*
8994 	 * Flush:
8995 	 * There was a bad_format error on the previous operation
8996 	 */
8997 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
8998 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8999 	uint16_t	unused_2;
9000 	/*
9001 	 * This is the opaque value that was completed for the TPA start
9002 	 * completion that corresponds to this TPA end completion.
9003 	 */
9004 	uint32_t	start_opaque;
9005 } rx_tpa_v2_end_cmpl_hi_t, *prx_tpa_v2_end_cmpl_hi_t;
9006 
9007 /*
9008  * This TPA completion structure is used on devices where the
9009  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
9010  */
9011 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
9012 
9013 typedef struct rx_tpa_v2_abuf_cmpl {
9014 	uint16_t	type;
9015 	/*
9016 	 * This field indicates the exact type of the completion.
9017 	 * By convention, the LSB identifies the length of the
9018 	 * record in 16B units. Even values indicate 16B
9019 	 * records. Odd values indicate 32B
9020 	 * records.
9021 	 */
9022 	#define RX_TPA_V2_ABUF_CMPL_TYPE_MASK	UINT32_C(0x3f)
9023 	#define RX_TPA_V2_ABUF_CMPL_TYPE_SFT	0
9024 	/*
9025 	 * RX TPA Aggregation Buffer completion:
9026 	 * Completion of an L2 aggregation buffer in support of
9027 	 * TPA packet completion. Length = 16B
9028 	 */
9029 		#define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
9030 		#define RX_TPA_V2_ABUF_CMPL_TYPE_LAST	RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
9031 	/*
9032 	 * This is the length of the data for the packet stored in this
9033 	 * aggregation buffer identified by the opaque value. This does not
9034 	 * include the length of any
9035 	 * data placed in other aggregation BDs or in the packet or buffer
9036 	 * BDs. This length does not include any space added due to
9037 	 * hdr_offset register during HDS placement mode.
9038 	 */
9039 	uint16_t	len;
9040 	/*
9041 	 * This is a copy of the opaque field from the RX BD this aggregation
9042 	 * buffer corresponds to.
9043 	 */
9044 	uint32_t	opaque;
9045 	uint16_t	v;
9046 	/*
9047 	 * This value is written by the NIC such that it will be different
9048 	 * for each pass through the completion queue. The even passes
9049 	 * will write 1. The odd passes will write 0.
9050 	 */
9051 	#define RX_TPA_V2_ABUF_CMPL_V	UINT32_C(0x1)
9052 	/*
9053 	 * This is the aggregation ID that the completion is associated with. Use
9054 	 * this number to correlate the TPA agg completion with the TPA start
9055 	 * completion and the TPA end completion.
9056 	 */
9057 	uint16_t	agg_id;
9058 	uint32_t	unused_1;
9059 } rx_tpa_v2_abuf_cmpl_t, *prx_tpa_v2_abuf_cmpl_t;
9060 
9061 /* rx_abuf_cmpl (size:128b/16B) */
9062 
9063 typedef struct rx_abuf_cmpl {
9064 	uint16_t	type;
9065 	/*
9066 	 * This field indicates the exact type of the completion.
9067 	 * By convention, the LSB identifies the length of the
9068 	 * record in 16B units. Even values indicate 16B
9069 	 * records. Odd values indicate 32B
9070 	 * records.
9071 	 */
9072 	#define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
9073 	#define RX_ABUF_CMPL_TYPE_SFT   0
9074 	/*
9075 	 * RX Aggregation Buffer completion:
9076 	 * Completion of an L2 aggregation buffer in support of
9077 	 * TPA, HDS, or Jumbo packet completion. Length = 16B
9078 	 */
9079 		#define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
9080 		#define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
9081 	/*
9082 	 * This is the length of the data for the packet stored in this
9083 	 * aggregation buffer identified by the opaque value. This does not
9084 	 * include the length of any
9085 	 * data placed in other aggregation BDs or in the packet or buffer
9086 	 * BDs. This length does not include any space added due to
9087 	 * hdr_offset register during HDS placement mode.
9088 	 */
9089 	uint16_t	len;
9090 	/*
9091 	 * This is a copy of the opaque field from the RX BD this aggregation
9092 	 * buffer corresponds to.
9093 	 */
9094 	uint32_t	opaque;
9095 	uint32_t	v;
9096 	/*
9097 	 * This value is written by the NIC such that it will be different
9098 	 * for each pass through the completion queue. The even passes
9099 	 * will write 1. The odd passes will write 0.
9100 	 */
9101 	#define RX_ABUF_CMPL_V	UINT32_C(0x1)
9102 	/* unused3 is 32 b */
9103 	uint32_t	unused_2;
9104 } rx_abuf_cmpl_t, *prx_abuf_cmpl_t;
9105 
9106 /* VEE FLUSH Completion Record (16 bytes) */
9107 /* vee_flush (size:128b/16B) */
9108 
9109 typedef struct vee_flush {
9110 	uint32_t	downstream_path_type;
9111 	/*
9112 	 * This field indicates the exact type of the completion.
9113 	 * By convention, the LSB identifies the length of the
9114 	 * record in 16B units. Even values indicate 16B
9115 	 * records. Odd values indicate 32B
9116 	 * records.
9117 	 */
9118 	#define VEE_FLUSH_TYPE_MASK	UINT32_C(0x3f)
9119 	#define VEE_FLUSH_TYPE_SFT		0
9120 	/*
9121 	 * VEE Flush Completion:
9122 	 * This completion is inserted manually by the Primate and processed
9123 	 * by the VEE hardware to ensure that all completions on a VEE
9124 	 * function have been processed by the VEE hardware before FLR
9125 	 * process is completed.
9126 	 */
9127 		#define VEE_FLUSH_TYPE_VEE_FLUSH	UINT32_C(0x1c)
9128 		#define VEE_FLUSH_TYPE_LAST		VEE_FLUSH_TYPE_VEE_FLUSH
9129 	/* downstream_path is 1 b */
9130 	#define VEE_FLUSH_DOWNSTREAM_PATH	UINT32_C(0x40)
9131 	/* This completion is associated with VEE Transmit */
9132 		#define VEE_FLUSH_DOWNSTREAM_PATH_TX	(UINT32_C(0x0) << 6)
9133 	/* This completion is associated with VEE Receive */
9134 		#define VEE_FLUSH_DOWNSTREAM_PATH_RX	(UINT32_C(0x1) << 6)
9135 		#define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
9136 	/*
9137 	 * This is an opaque value that is passed through the completion
9138 	 * to the VEE handler SW and is used to indicate what VEE VQ or
9139 	 * function has completed FLR processing.
9140 	 */
9141 	uint32_t	opaque;
9142 	uint32_t	v;
9143 	/*
9144 	 * This value is written by the NIC such that it will be different
9145 	 * for each pass through the completion queue. The even passes will
9146 	 * write 1. The odd passes will write 0.
9147 	 */
9148 	#define VEE_FLUSH_V	UINT32_C(0x1)
9149 	/* unused3 is 32 b */
9150 	uint32_t	unused_3;
9151 } vee_flush_t, *pvee_flush_t;
9152 
9153 /* eject_cmpl (size:128b/16B) */
9154 
9155 typedef struct eject_cmpl {
9156 	uint16_t	type;
9157 	/*
9158 	 * This field indicates the exact type of the completion.
9159 	 * By convention, the LSB identifies the length of the
9160 	 * record in 16B units. Even values indicate 16B
9161 	 * records. Odd values indicate 32B
9162 	 * records.
9163 	 */
9164 	#define EJECT_CMPL_TYPE_MASK	UINT32_C(0x3f)
9165 	#define EJECT_CMPL_TYPE_SFT	0
9166 	/*
9167 	 * Statistics Ejection Completion:
9168 	 * Completion of statistics data ejection buffer.
9169 	 * Length = 16B
9170 	 */
9171 		#define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
9172 		#define EJECT_CMPL_TYPE_LAST	EJECT_CMPL_TYPE_STAT_EJECT
9173 	#define EJECT_CMPL_FLAGS_MASK	UINT32_C(0xffc0)
9174 	#define EJECT_CMPL_FLAGS_SFT	6
9175 	/*
9176 	 * When this bit is '1', it indicates a packet that has an
9177 	 * error of some type. Type of error is indicated in
9178 	 * error_flags.
9179 	 */
9180 	#define EJECT_CMPL_FLAGS_ERROR	UINT32_C(0x40)
9181 	/*
9182 	 * This is the length of the statistics data stored in this
9183 	 * buffer.
9184 	 */
9185 	uint16_t	len;
9186 	/*
9187 	 * This is a copy of the opaque field from the RX BD this ejection
9188 	 * buffer corresponds to.
9189 	 */
9190 	uint32_t	opaque;
9191 	uint16_t	v;
9192 	/*
9193 	 * This value is written by the NIC such that it will be different
9194 	 * for each pass through the completion queue. The even passes
9195 	 * will write 1. The odd passes will write 0.
9196 	 */
9197 	#define EJECT_CMPL_V				UINT32_C(0x1)
9198 	#define EJECT_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
9199 	#define EJECT_CMPL_ERRORS_SFT			1
9200 	/*
9201 	 * This error indicates that there was some sort of problem with
9202 	 * the BDs for statistics ejection. The statistics ejection should
9203 	 * be treated as invalid
9204 	 */
9205 	#define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
9206 	#define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT	1
9207 	/* No buffer error */
9208 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
9209 	/*
9210 	 * Did Not Fit:
9211 	 * Statistics did not fit into aggregation buffer provided.
9212 	 */
9213 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
9214 	/*
9215 	 * Bad Format:
9216 	 * BDs were not formatted correctly.
9217 	 */
9218 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
9219 	/*
9220 	 * Flush:
9221 	 * There was a bad_format error on the previous operation
9222 	 */
9223 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
9224 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST	EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
9225 	/* reserved16 is 16 b */
9226 	uint16_t	reserved16;
9227 	/* unused3 is 32 b */
9228 	uint32_t	unused_2;
9229 } eject_cmpl_t, *peject_cmpl_t;
9230 
9231 /* hwrm_cmpl (size:128b/16B) */
9232 
9233 typedef struct hwrm_cmpl {
9234 	uint16_t	type;
9235 	/*
9236 	 * This field indicates the exact type of the completion.
9237 	 * By convention, the LSB identifies the length of the
9238 	 * record in 16B units. Even values indicate 16B
9239 	 * records. Odd values indicate 32B
9240 	 * records.
9241 	 */
9242 	#define HWRM_CMPL_TYPE_MASK	UINT32_C(0x3f)
9243 	#define HWRM_CMPL_TYPE_SFT	0
9244 	/*
9245 	 * HWRM Command Completion:
9246 	 * Completion of an HWRM command.
9247 	 */
9248 		#define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
9249 		#define HWRM_CMPL_TYPE_LAST	HWRM_CMPL_TYPE_HWRM_DONE
9250 	/* This is the sequence_id of the HWRM command that has completed. */
9251 	uint16_t	sequence_id;
9252 	/* unused2 is 32 b */
9253 	uint32_t	unused_1;
9254 	uint32_t	v;
9255 	/*
9256 	 * This value is written by the NIC such that it will be different
9257 	 * for each pass through the completion queue. The even passes
9258 	 * will write 1. The odd passes will write 0.
9259 	 */
9260 	#define HWRM_CMPL_V	UINT32_C(0x1)
9261 	/* unused4 is 32 b */
9262 	uint32_t	unused_3;
9263 } hwrm_cmpl_t, *phwrm_cmpl_t;
9264 
9265 /* hwrm_fwd_req_cmpl (size:128b/16B) */
9266 
9267 typedef struct hwrm_fwd_req_cmpl {
9268 	/*
9269 	 * This field indicates the exact type of the completion.
9270 	 * By convention, the LSB identifies the length of the
9271 	 * record in 16B units. Even values indicate 16B
9272 	 * records. Odd values indicate 32B
9273 	 * records.
9274 	 */
9275 	uint16_t	req_len_type;
9276 	/*
9277 	 * This field indicates the exact type of the completion.
9278 	 * By convention, the LSB identifies the length of the
9279 	 * record in 16B units. Even values indicate 16B
9280 	 * records. Odd values indicate 32B
9281 	 * records.
9282 	 */
9283 	#define HWRM_FWD_REQ_CMPL_TYPE_MASK	UINT32_C(0x3f)
9284 	#define HWRM_FWD_REQ_CMPL_TYPE_SFT	0
9285 	/* Forwarded HWRM Request */
9286 		#define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
9287 		#define HWRM_FWD_REQ_CMPL_TYPE_LAST	HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
9288 	/* Length of forwarded request in bytes. */
9289 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK	UINT32_C(0xffc0)
9290 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT	6
9291 	/*
9292 	 * Source ID of this request.
9293 	 * Typically used in forwarding requests and responses.
9294 	 * 0x0 - 0xFFF8 - Used for function ids
9295 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
9296 	 * 0xFFFF - HWRM
9297 	 */
9298 	uint16_t	source_id;
9299 	/* unused1 is 32 b */
9300 	uint32_t	unused0;
9301 	/* Address of forwarded request. */
9302 	uint64_t	req_buf_addr_v;
9303 	/*
9304 	 * This value is written by the NIC such that it will be different
9305 	 * for each pass through the completion queue. The even passes
9306 	 * will write 1. The odd passes will write 0.
9307 	 */
9308 	#define HWRM_FWD_REQ_CMPL_V		UINT32_C(0x1)
9309 	/* Address of forwarded request. */
9310 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9311 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
9312 } hwrm_fwd_req_cmpl_t, *phwrm_fwd_req_cmpl_t;
9313 
9314 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
9315 
9316 typedef struct hwrm_fwd_resp_cmpl {
9317 	uint16_t	type;
9318 	/*
9319 	 * This field indicates the exact type of the completion.
9320 	 * By convention, the LSB identifies the length of the
9321 	 * record in 16B units. Even values indicate 16B
9322 	 * records. Odd values indicate 32B
9323 	 * records.
9324 	 */
9325 	#define HWRM_FWD_RESP_CMPL_TYPE_MASK	UINT32_C(0x3f)
9326 	#define HWRM_FWD_RESP_CMPL_TYPE_SFT	0
9327 	/* Forwarded HWRM Response */
9328 		#define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
9329 		#define HWRM_FWD_RESP_CMPL_TYPE_LAST	HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
9330 	/*
9331 	 * Source ID of this response.
9332 	 * Typically used in forwarding requests and responses.
9333 	 * 0x0 - 0xFFF8 - Used for function ids
9334 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
9335 	 * 0xFFFF - HWRM
9336 	 */
9337 	uint16_t	source_id;
9338 	/* Length of forwarded response in bytes. */
9339 	uint16_t	resp_len;
9340 	/* unused2 is 16 b */
9341 	uint16_t	unused_1;
9342 	/* Address of forwarded request. */
9343 	uint64_t	resp_buf_addr_v;
9344 	/*
9345 	 * This value is written by the NIC such that it will be different
9346 	 * for each pass through the completion queue. The even passes
9347 	 * will write 1. The odd passes will write 0.
9348 	 */
9349 	#define HWRM_FWD_RESP_CMPL_V		UINT32_C(0x1)
9350 	/* Address of forwarded request. */
9351 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9352 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
9353 } hwrm_fwd_resp_cmpl_t, *phwrm_fwd_resp_cmpl_t;
9354 
9355 /* hwrm_async_event_cmpl (size:128b/16B) */
9356 
9357 typedef struct hwrm_async_event_cmpl {
9358 	uint16_t	type;
9359 	/*
9360 	 * This field indicates the exact type of the completion.
9361 	 * By convention, the LSB identifies the length of the
9362 	 * record in 16B units. Even values indicate 16B
9363 	 * records. Odd values indicate 32B
9364 	 * records.
9365 	 */
9366 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK		UINT32_C(0x3f)
9367 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT		0
9368 	/* HWRM Asynchronous Event Information */
9369 		#define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9370 		#define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
9371 	/* Identifiers of events. */
9372 	uint16_t	event_id;
9373 	/* Link status changed */
9374 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE		UINT32_C(0x0)
9375 	/* Link MTU changed */
9376 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE		UINT32_C(0x1)
9377 	/* Link speed changed */
9378 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE		UINT32_C(0x2)
9379 	/* DCB Configuration changed */
9380 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE		UINT32_C(0x3)
9381 	/* Port connection not allowed */
9382 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED	UINT32_C(0x4)
9383 	/* Link speed configuration was not allowed */
9384 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED	UINT32_C(0x5)
9385 	/* Link speed configuration change */
9386 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE	UINT32_C(0x6)
9387 	/* Port PHY configuration change */
9388 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE		UINT32_C(0x7)
9389 	/* Reset notification to clients */
9390 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY			UINT32_C(0x8)
9391 	/* Master function selection event */
9392 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY		UINT32_C(0x9)
9393 	/*
9394 	 * An event signifying that a ring has been disabled by
9395 	 * hw due to error.
9396 	 */
9397 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG		UINT32_C(0xa)
9398 	/* Function driver unloaded */
9399 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD		UINT32_C(0x10)
9400 	/* Function driver loaded */
9401 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD		UINT32_C(0x11)
9402 	/* Function FLR related processing has completed */
9403 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT		UINT32_C(0x12)
9404 	/* PF driver unloaded */
9405 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD		UINT32_C(0x20)
9406 	/* PF driver loaded */
9407 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD			UINT32_C(0x21)
9408 	/* VF Function Level Reset (FLR) */
9409 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR			UINT32_C(0x30)
9410 	/* VF MAC Address Change */
9411 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE		UINT32_C(0x31)
9412 	/* PF-VF communication channel status change. */
9413 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE	UINT32_C(0x32)
9414 	/* VF Configuration Change */
9415 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE		UINT32_C(0x33)
9416 	/* LLFC/PFC Configuration Change */
9417 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE		UINT32_C(0x34)
9418 	/* Default VNIC Configuration Change */
9419 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE		UINT32_C(0x35)
9420 	/* HW flow aged */
9421 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED			UINT32_C(0x36)
9422 	/*
9423 	 * A debug notification being posted to the driver. These
9424 	 * notifications are purely for diagnostic purpose and should not be
9425 	 * used for functional purpose. The driver is not supposed to act
9426 	 * on these messages except to log/record it.
9427 	 */
9428 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION		UINT32_C(0x37)
9429 	/*
9430 	 * An EEM flow cached memory flush for all flows request event being
9431 	 * posted to the PF driver.
9432 	 */
9433 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ		UINT32_C(0x38)
9434 	/*
9435 	 * An EEM flow cache memory flush completion event being posted to the
9436 	 * firmware by the PF driver. This is indication that host EEM flush
9437 	 * has completed by the PF.
9438 	 */
9439 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE		UINT32_C(0x39)
9440 	/*
9441 	 * A tcp flag action change event being posted to the PF or trusted VF
9442 	 * driver by the firmware. The PF or trusted VF driver should query
9443 	 * the firmware for the new TCP flag action update after receiving
9444 	 * this async event.
9445 	 */
9446 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE	UINT32_C(0x3a)
9447 	/*
9448 	 * An EEM flow active event being posted to the PF or trusted VF driver
9449 	 * by the firmware. The PF or trusted VF driver should update the
9450 	 * flow's aging timer after receiving this async event.
9451 	 */
9452 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE		UINT32_C(0x3b)
9453 	/*
9454 	 * A eem cfg change event being posted to the trusted VF driver by the
9455 	 * firmware if the parent PF EEM configuration changed.
9456 	 */
9457 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE		UINT32_C(0x3c)
9458 	/*
9459 	 * Deprecated.
9460 	 * TFLIB unique default VNIC Configuration Change
9461 	 */
9462 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE	UINT32_C(0x3d)
9463 	/*
9464 	 * Deprecated.
9465 	 * TFLIB unique link status changed
9466 	 */
9467 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE	UINT32_C(0x3e)
9468 	/*
9469 	 * An event signifying completion for HWRM_FW_STATE_QUIESCE
9470 	 * (completion, timeout, or error)
9471 	 */
9472 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE			UINT32_C(0x3f)
9473 	/*
9474 	 * An event signifying a HWRM command is in progress and its
9475 	 * response will be deferred. This event is used on crypto controllers
9476 	 * only.
9477 	 */
9478 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE		UINT32_C(0x40)
9479 	/*
9480 	 * An event signifying that a PFC WatchDog configuration
9481 	 * has changed on any port / cos.
9482 	 */
9483 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE	UINT32_C(0x41)
9484 	/*
9485 	 * An echo request from the firmware. An echo response is expected by
9486 	 * the firmware.
9487 	 */
9488 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST			UINT32_C(0x42)
9489 	/*
9490 	 * An event from firmware indicating who has been selected as the
9491 	 * PHC Master or secondary. Also indicates the last time a failover
9492 	 * happens. Event will also be sent when PHC rolls over.
9493 	 */
9494 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE			UINT32_C(0x43)
9495 	/*
9496 	 * An event from firmware showing the last PPS timestamp that has been
9497 	 * latched.
9498 	 */
9499 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP		UINT32_C(0x44)
9500 	/*
9501 	 * An event from firmware indicating that an error has occurred.
9502 	 * The driver should log the event so that an administrator can be
9503 	 * aware that a problem has occurred that may need attention.
9504 	 */
9505 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT			UINT32_C(0x45)
9506 	/*
9507 	 * An event from firmware indicating that the programmed pacing
9508 	 * threshold for the doorbell global FIFO has been crossed. The driver
9509 	 * needs to take appropriate action to pace the doorbells when this
9510 	 * event is received from the firmware.
9511 	 */
9512 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_THRESHOLD	UINT32_C(0x46)
9513 	/*
9514 	 * An event from firmware indicating that the RSS capabilites have
9515 	 * changed.
9516 	 */
9517 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RSS_CHANGE			UINT32_C(0x47)
9518 	/*
9519 	 * An event from firmware indicating that list of nq ids used for
9520 	 * doorbell pacing DBQ event notification has been updated. The driver
9521 	 * needs to take appropriate action and retrieve the new list when this
9522 	 * event is received from the firmware.
9523 	 */
9524 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_NQ_UPDATE	UINT32_C(0x48)
9525 	/*
9526 	 * An event from firmware indicating that hardware ran into an error
9527 	 * while trying to read the host based doorbell copy region. The driver
9528 	 * needs to take the appropriate action and maintain the corresponding
9529 	 * doorbell copy region.
9530 	 */
9531 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR UINT32_C(0x49)
9532 	/* Maximum Registrable event id. */
9533 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID		UINT32_C(0x4a)
9534 	/*
9535 	 * A trace log message. This contains firmware trace logs string
9536 	 * embedded in the asynchronous message. This is an experimental
9537 	 * event, not meant for production use at this time.
9538 	 */
9539 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG			UINT32_C(0xfe)
9540 	/* HWRM Error */
9541 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR			UINT32_C(0xff)
9542 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
9543 	/* Event specific data */
9544 	uint32_t	event_data2;
9545 	uint8_t	opaque_v;
9546 	/*
9547 	 * This value is written by the NIC such that it will be different
9548 	 * for each pass through the completion queue. The even passes
9549 	 * will write 1. The odd passes will write 0.
9550 	 */
9551 	#define HWRM_ASYNC_EVENT_CMPL_V	UINT32_C(0x1)
9552 	/* opaque is 7 b */
9553 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
9554 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
9555 	/* 8-lsb timestamp from POR (100-msec resolution) */
9556 	uint8_t	timestamp_lo;
9557 	/* 16-lsb timestamp from POR (100-msec resolution) */
9558 	uint16_t	timestamp_hi;
9559 	/* Event specific data */
9560 	uint32_t	event_data1;
9561 } hwrm_async_event_cmpl_t, *phwrm_async_event_cmpl_t;
9562 
9563 #define GET_EVENT_ID(x) \
9564 	(((x) < 0x80) ? \
9565 	((x) == 0x0 ? "LINK_STATUS_CHANGE": \
9566 	((x) == 0x1 ? "LINK_MTU_CHANGE": \
9567 	((x) == 0x2 ? "LINK_SPEED_CHANGE": \
9568 	((x) == 0x3 ? "DCB_CONFIG_CHANGE": \
9569 	((x) == 0x4 ? "PORT_CONN_NOT_ALLOWED": \
9570 	((x) == 0x5 ? "LINK_SPEED_CFG_NOT_ALLOWED": \
9571 	((x) == 0x6 ? "LINK_SPEED_CFG_CHANGE": \
9572 	((x) == 0x7 ? "PORT_PHY_CFG_CHANGE": \
9573 	((x) == 0x8 ? "RESET_NOTIFY": \
9574 	((x) == 0x9 ? "ERROR_RECOVERY": \
9575 	((x) == 0xa ? "RING_MONITOR_MSG": \
9576 	((x) == 0x10 ? "FUNC_DRVR_UNLOAD": \
9577 	((x) == 0x11 ? "FUNC_DRVR_LOAD": \
9578 	((x) == 0x12 ? "FUNC_FLR_PROC_CMPLT": \
9579 	((x) == 0x20 ? "PF_DRVR_UNLOAD": \
9580 	((x) == 0x21 ? "PF_DRVR_LOAD": \
9581 	((x) == 0x30 ? "VF_FLR": \
9582 	((x) == 0x31 ? "VF_MAC_ADDR_CHANGE": \
9583 	((x) == 0x32 ? "PF_VF_COMM_STATUS_CHANGE": \
9584 	((x) == 0x33 ? "VF_CFG_CHANGE": \
9585 	((x) == 0x34 ? "LLFC_PFC_CHANGE": \
9586 	((x) == 0x35 ? "DEFAULT_VNIC_CHANGE": \
9587 	((x) == 0x36 ? "HW_FLOW_AGED": \
9588 	((x) == 0x37 ? "DEBUG_NOTIFICATION": \
9589 	((x) == 0x38 ? "EEM_CACHE_FLUSH_REQ": \
9590 	((x) == 0x39 ? "EEM_CACHE_FLUSH_DONE": \
9591 	((x) == 0x3a ? "TCP_FLAG_ACTION_CHANGE": \
9592 	((x) == 0x3b ? "EEM_FLOW_ACTIVE": \
9593 	((x) == 0x3c ? "EEM_CFG_CHANGE": \
9594 	((x) == 0x3d ? "TFLIB_DEFAULT_VNIC_CHANGE": \
9595 	((x) == 0x3e ? "TFLIB_LINK_STATUS_CHANGE": \
9596 	((x) == 0x3f ? "QUIESCE_DONE": \
9597 	((x) == 0x40 ? "DEFERRED_RESPONSE": \
9598 	((x) == 0x41 ? "PFC_WATCHDOG_CFG_CHANGE": \
9599 	((x) == 0x42 ? "ECHO_REQUEST": \
9600 	((x) == 0x43 ? "PHC_UPDATE": \
9601 	((x) == 0x44 ? "PPS_TIMESTAMP": \
9602 	((x) == 0x45 ? "ERROR_REPORT": \
9603 	((x) == 0x46 ? "DOORBELL_PACING_THRESHOLD": \
9604 	((x) == 0x47 ? "RSS_CHANGE": \
9605 	((x) == 0x48 ? "DOORBELL_PACING_NQ_UPDATE": \
9606 	((x) == 0x49 ? "HW_DOORBELL_RECOVERY_READ_ERROR": \
9607 	((x) == 0x4a ? "MAX_RGTR_EVENT_ID": \
9608 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))))))) : \
9609 	(((x) < 0x100) ? \
9610 	((x) == 0xfe ? "FW_TRACE_MSG": \
9611 	((x) == 0xff ? "HWRM_ERROR": \
9612 	"Unknown decode" )) : \
9613 	"Unknown decode" ))
9614 
9615 
9616 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
9617 
9618 typedef struct hwrm_async_event_cmpl_link_status_change {
9619 	uint16_t	type;
9620 	/*
9621 	 * This field indicates the exact type of the completion.
9622 	 * By convention, the LSB identifies the length of the
9623 	 * record in 16B units. Even values indicate 16B
9624 	 * records. Odd values indicate 32B
9625 	 * records.
9626 	 */
9627 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9628 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT		0
9629 	/* HWRM Asynchronous Event Information */
9630 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9631 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
9632 	/* Identifiers of events. */
9633 	uint16_t	event_id;
9634 	/* Link status changed */
9635 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
9636 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
9637 	/* Event specific data */
9638 	uint32_t	event_data2;
9639 	uint8_t	opaque_v;
9640 	/*
9641 	 * This value is written by the NIC such that it will be different
9642 	 * for each pass through the completion queue. The even passes
9643 	 * will write 1. The odd passes will write 0.
9644 	 */
9645 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V	UINT32_C(0x1)
9646 	/* opaque is 7 b */
9647 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9648 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
9649 	/* 8-lsb timestamp from POR (100-msec resolution) */
9650 	uint8_t	timestamp_lo;
9651 	/* 16-lsb timestamp from POR (100-msec resolution) */
9652 	uint16_t	timestamp_hi;
9653 	/* Event specific data */
9654 	uint32_t	event_data1;
9655 	/* Indicates link status change */
9656 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE	UINT32_C(0x1)
9657 	/*
9658 	 * If this bit set to 0, then it indicates that the link
9659 	 * was up and it went down.
9660 	 */
9661 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN  UINT32_C(0x0)
9662 	/*
9663 	 * If this bit is set to 1, then it indicates that the link
9664 	 * was down and it went up.
9665 	 */
9666 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP	UINT32_C(0x1)
9667 		#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
9668 	/* Indicates the physical port this link status change occur */
9669 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK	UINT32_C(0xe)
9670 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT	1
9671 	/* PORT ID */
9672 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK	UINT32_C(0xffff0)
9673 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT	4
9674 	/* Indicates the physical function this event occurred on. */
9675 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK	UINT32_C(0xff00000)
9676 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT	20
9677 } hwrm_async_event_cmpl_link_status_change_t, *phwrm_async_event_cmpl_link_status_change_t;
9678 
9679 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
9680 
9681 typedef struct hwrm_async_event_cmpl_link_mtu_change {
9682 	uint16_t	type;
9683 	/*
9684 	 * This field indicates the exact type of the completion.
9685 	 * By convention, the LSB identifies the length of the
9686 	 * record in 16B units. Even values indicate 16B
9687 	 * records. Odd values indicate 32B
9688 	 * records.
9689 	 */
9690 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9691 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT		0
9692 	/* HWRM Asynchronous Event Information */
9693 		#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9694 		#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
9695 	/* Identifiers of events. */
9696 	uint16_t	event_id;
9697 	/* Link MTU changed */
9698 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
9699 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
9700 	/* Event specific data */
9701 	uint32_t	event_data2;
9702 	uint8_t	opaque_v;
9703 	/*
9704 	 * This value is written by the NIC such that it will be different
9705 	 * for each pass through the completion queue. The even passes
9706 	 * will write 1. The odd passes will write 0.
9707 	 */
9708 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V	UINT32_C(0x1)
9709 	/* opaque is 7 b */
9710 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9711 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
9712 	/* 8-lsb timestamp from POR (100-msec resolution) */
9713 	uint8_t	timestamp_lo;
9714 	/* 16-lsb timestamp from POR (100-msec resolution) */
9715 	uint16_t	timestamp_hi;
9716 	/* Event specific data */
9717 	uint32_t	event_data1;
9718 	/* The new MTU of the link in bytes. */
9719 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK UINT32_C(0xffff)
9720 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
9721 } hwrm_async_event_cmpl_link_mtu_change_t, *phwrm_async_event_cmpl_link_mtu_change_t;
9722 
9723 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
9724 
9725 typedef struct hwrm_async_event_cmpl_link_speed_change {
9726 	uint16_t	type;
9727 	/*
9728 	 * This field indicates the exact type of the completion.
9729 	 * By convention, the LSB identifies the length of the
9730 	 * record in 16B units. Even values indicate 16B
9731 	 * records. Odd values indicate 32B
9732 	 * records.
9733 	 */
9734 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9735 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT		0
9736 	/* HWRM Asynchronous Event Information */
9737 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9738 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
9739 	/* Identifiers of events. */
9740 	uint16_t	event_id;
9741 	/* Link speed changed */
9742 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
9743 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
9744 	/* Event specific data */
9745 	uint32_t	event_data2;
9746 	uint8_t	opaque_v;
9747 	/*
9748 	 * This value is written by the NIC such that it will be different
9749 	 * for each pass through the completion queue. The even passes
9750 	 * will write 1. The odd passes will write 0.
9751 	 */
9752 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V	UINT32_C(0x1)
9753 	/* opaque is 7 b */
9754 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9755 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
9756 	/* 8-lsb timestamp from POR (100-msec resolution) */
9757 	uint8_t	timestamp_lo;
9758 	/* 16-lsb timestamp from POR (100-msec resolution) */
9759 	uint16_t	timestamp_hi;
9760 	/* Event specific data */
9761 	uint32_t	event_data1;
9762 	/*
9763 	 * When this bit is '1', the link was forced to the
9764 	 * force_link_speed value.
9765 	 */
9766 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE			UINT32_C(0x1)
9767 	/* The new link speed in 100 Mbps units. */
9768 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK UINT32_C(0xfffe)
9769 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT  1
9770 	/* 100Mb link speed */
9771 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB  (UINT32_C(0x1) << 1)
9772 	/* 1Gb link speed */
9773 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB	(UINT32_C(0xa) << 1)
9774 	/* 2Gb link speed */
9775 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB	(UINT32_C(0x14) << 1)
9776 	/* 25Gb link speed */
9777 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB  (UINT32_C(0x19) << 1)
9778 	/* 10Gb link speed */
9779 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB   (UINT32_C(0x64) << 1)
9780 	/* 20Mb link speed */
9781 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB   (UINT32_C(0xc8) << 1)
9782 	/* 25Gb link speed */
9783 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB   (UINT32_C(0xfa) << 1)
9784 	/* 40Gb link speed */
9785 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB   (UINT32_C(0x190) << 1)
9786 	/* 50Gb link speed */
9787 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB   (UINT32_C(0x1f4) << 1)
9788 	/* 100Gb link speed */
9789 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB  (UINT32_C(0x3e8) << 1)
9790 		#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
9791 	/* PORT ID */
9792 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff0000)
9793 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT		16
9794 } hwrm_async_event_cmpl_link_speed_change_t, *phwrm_async_event_cmpl_link_speed_change_t;
9795 
9796 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
9797 
9798 typedef struct hwrm_async_event_cmpl_dcb_config_change {
9799 	uint16_t	type;
9800 	/*
9801 	 * This field indicates the exact type of the completion.
9802 	 * By convention, the LSB identifies the length of the
9803 	 * record in 16B units. Even values indicate 16B
9804 	 * records. Odd values indicate 32B
9805 	 * records.
9806 	 */
9807 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9808 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT		0
9809 	/* HWRM Asynchronous Event Information */
9810 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9811 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9812 	/* Identifiers of events. */
9813 	uint16_t	event_id;
9814 	/* DCB Configuration changed */
9815 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
9816 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
9817 	/* Event specific data */
9818 	uint32_t	event_data2;
9819 	/* ETS configuration change */
9820 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS	UINT32_C(0x1)
9821 	/* PFC configuration change */
9822 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC	UINT32_C(0x2)
9823 	/* APP configuration change */
9824 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP	UINT32_C(0x4)
9825 	/* DSCP configuration change */
9826 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_DSCP	UINT32_C(0x8)
9827 	uint8_t	opaque_v;
9828 	/*
9829 	 * This value is written by the NIC such that it will be different
9830 	 * for each pass through the completion queue. The even passes
9831 	 * will write 1. The odd passes will write 0.
9832 	 */
9833 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V	UINT32_C(0x1)
9834 	/* opaque is 7 b */
9835 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9836 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
9837 	/* 8-lsb timestamp from POR (100-msec resolution) */
9838 	uint8_t	timestamp_lo;
9839 	/* 16-lsb timestamp from POR (100-msec resolution) */
9840 	uint16_t	timestamp_hi;
9841 	/* Event specific data */
9842 	uint32_t	event_data1;
9843 	/* PORT ID */
9844 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff)
9845 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT		0
9846 	/* Priority recommended for RoCE traffic */
9847 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK UINT32_C(0xff0000)
9848 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT 16
9849 	/* none is 255 */
9850 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE  (UINT32_C(0xff) << 16)
9851 		#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
9852 	/* Priority recommended for L2 traffic */
9853 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK  UINT32_C(0xff000000)
9854 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT   24
9855 	/* none is 255 */
9856 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE	(UINT32_C(0xff) << 24)
9857 		#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
9858 } hwrm_async_event_cmpl_dcb_config_change_t, *phwrm_async_event_cmpl_dcb_config_change_t;
9859 
9860 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
9861 
9862 typedef struct hwrm_async_event_cmpl_port_conn_not_allowed {
9863 	uint16_t	type;
9864 	/*
9865 	 * This field indicates the exact type of the completion.
9866 	 * By convention, the LSB identifies the length of the
9867 	 * record in 16B units. Even values indicate 16B
9868 	 * records. Odd values indicate 32B
9869 	 * records.
9870 	 */
9871 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK		UINT32_C(0x3f)
9872 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT		0
9873 	/* HWRM Asynchronous Event Information */
9874 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9875 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
9876 	/* Identifiers of events. */
9877 	uint16_t	event_id;
9878 	/* Port connection not allowed */
9879 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
9880 	#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
9881 	/* Event specific data */
9882 	uint32_t	event_data2;
9883 	uint8_t	opaque_v;
9884 	/*
9885 	 * This value is written by the NIC such that it will be different
9886 	 * for each pass through the completion queue. The even passes
9887 	 * will write 1. The odd passes will write 0.
9888 	 */
9889 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V	UINT32_C(0x1)
9890 	/* opaque is 7 b */
9891 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
9892 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
9893 	/* 8-lsb timestamp from POR (100-msec resolution) */
9894 	uint8_t	timestamp_lo;
9895 	/* 16-lsb timestamp from POR (100-msec resolution) */
9896 	uint16_t	timestamp_hi;
9897 	/* Event specific data */
9898 	uint32_t	event_data1;
9899 	/* PORT ID */
9900 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff)
9901 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT		0
9902 	/*
9903 	 * This value indicates the current port level enforcement policy
9904 	 * for the optics module when there is an optical module mismatch
9905 	 * and port is not connected.
9906 	 */
9907 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK	UINT32_C(0xff0000)
9908 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT	16
9909 	/* No enforcement */
9910 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE	(UINT32_C(0x0) << 16)
9911 	/* Disable Transmit side Laser. */
9912 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX   (UINT32_C(0x1) << 16)
9913 	/* Raise a warning message. */
9914 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG  (UINT32_C(0x2) << 16)
9915 	/* Power down the module. */
9916 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN	(UINT32_C(0x3) << 16)
9917 		#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
9918 } hwrm_async_event_cmpl_port_conn_not_allowed_t, *phwrm_async_event_cmpl_port_conn_not_allowed_t;
9919 
9920 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
9921 
9922 typedef struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
9923 	uint16_t	type;
9924 	/*
9925 	 * This field indicates the exact type of the completion.
9926 	 * By convention, the LSB identifies the length of the
9927 	 * record in 16B units. Even values indicate 16B
9928 	 * records. Odd values indicate 32B
9929 	 * records.
9930 	 */
9931 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK		UINT32_C(0x3f)
9932 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT		0
9933 	/* HWRM Asynchronous Event Information */
9934 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9935 		#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
9936 	/* Identifiers of events. */
9937 	uint16_t	event_id;
9938 	/* Link speed configuration was not allowed */
9939 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
9940 	#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
9941 	/* Event specific data */
9942 	uint32_t	event_data2;
9943 	uint8_t	opaque_v;
9944 	/*
9945 	 * This value is written by the NIC such that it will be different
9946 	 * for each pass through the completion queue. The even passes
9947 	 * will write 1. The odd passes will write 0.
9948 	 */
9949 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V	UINT32_C(0x1)
9950 	/* opaque is 7 b */
9951 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
9952 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
9953 	/* 8-lsb timestamp from POR (100-msec resolution) */
9954 	uint8_t	timestamp_lo;
9955 	/* 16-lsb timestamp from POR (100-msec resolution) */
9956 	uint16_t	timestamp_hi;
9957 	/* Event specific data */
9958 	uint32_t	event_data1;
9959 	/* PORT ID */
9960 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
9961 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
9962 } hwrm_async_event_cmpl_link_speed_cfg_not_allowed_t, *phwrm_async_event_cmpl_link_speed_cfg_not_allowed_t;
9963 
9964 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
9965 
9966 typedef struct hwrm_async_event_cmpl_link_speed_cfg_change {
9967 	uint16_t	type;
9968 	/*
9969 	 * This field indicates the exact type of the completion.
9970 	 * By convention, the LSB identifies the length of the
9971 	 * record in 16B units. Even values indicate 16B
9972 	 * records. Odd values indicate 32B
9973 	 * records.
9974 	 */
9975 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9976 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT		0
9977 	/* HWRM Asynchronous Event Information */
9978 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9979 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9980 	/* Identifiers of events. */
9981 	uint16_t	event_id;
9982 	/* Link speed configuration change */
9983 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
9984 	#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
9985 	/* Event specific data */
9986 	uint32_t	event_data2;
9987 	uint8_t	opaque_v;
9988 	/*
9989 	 * This value is written by the NIC such that it will be different
9990 	 * for each pass through the completion queue. The even passes
9991 	 * will write 1. The odd passes will write 0.
9992 	 */
9993 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V	UINT32_C(0x1)
9994 	/* opaque is 7 b */
9995 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9996 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
9997 	/* 8-lsb timestamp from POR (100-msec resolution) */
9998 	uint8_t	timestamp_lo;
9999 	/* 16-lsb timestamp from POR (100-msec resolution) */
10000 	uint16_t	timestamp_hi;
10001 	/* Event specific data */
10002 	uint32_t	event_data1;
10003 	/* PORT ID */
10004 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK			UINT32_C(0xffff)
10005 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT			0
10006 	/*
10007 	 * If set to 1, it indicates that the supported link speeds
10008 	 * configuration on the port has changed.
10009 	 * If set to 0, then there is no change in supported link speeds
10010 	 * configuration.
10011 	 */
10012 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE	UINT32_C(0x10000)
10013 	/*
10014 	 * If set to 1, it indicates that the link speed configuration
10015 	 * on the port has become illegal or invalid.
10016 	 * If set to 0, then the link speed configuration on the port is
10017 	 * legal or valid.
10018 	 */
10019 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG	UINT32_C(0x20000)
10020 } hwrm_async_event_cmpl_link_speed_cfg_change_t, *phwrm_async_event_cmpl_link_speed_cfg_change_t;
10021 
10022 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
10023 
10024 typedef struct hwrm_async_event_cmpl_port_phy_cfg_change {
10025 	uint16_t	type;
10026 	/*
10027 	 * This field indicates the exact type of the completion.
10028 	 * By convention, the LSB identifies the length of the
10029 	 * record in 16B units. Even values indicate 16B
10030 	 * records. Odd values indicate 32B
10031 	 * records.
10032 	 */
10033 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10034 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT		0
10035 	/* HWRM Asynchronous Event Information */
10036 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10037 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10038 	/* Identifiers of events. */
10039 	uint16_t	event_id;
10040 	/* Port PHY configuration change */
10041 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
10042 	#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
10043 	/* Event specific data */
10044 	uint32_t	event_data2;
10045 	uint8_t	opaque_v;
10046 	/*
10047 	 * This value is written by the NIC such that it will be different
10048 	 * for each pass through the completion queue. The even passes
10049 	 * will write 1. The odd passes will write 0.
10050 	 */
10051 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V	UINT32_C(0x1)
10052 	/* opaque is 7 b */
10053 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10054 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
10055 	/* 8-lsb timestamp from POR (100-msec resolution) */
10056 	uint8_t	timestamp_lo;
10057 	/* 16-lsb timestamp from POR (100-msec resolution) */
10058 	uint16_t	timestamp_hi;
10059 	/* Event specific data */
10060 	uint32_t	event_data1;
10061 	/* PORT ID */
10062 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK	UINT32_C(0xffff)
10063 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT	0
10064 	/*
10065 	 * If set to 1, it indicates that the FEC
10066 	 * configuration on the port has changed.
10067 	 * If set to 0, then there is no change in FEC configuration.
10068 	 */
10069 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE	UINT32_C(0x10000)
10070 	/*
10071 	 * If set to 1, it indicates that the EEE configuration
10072 	 * on the port has changed.
10073 	 * If set to 0, then there is no change in EEE configuration
10074 	 * on the port.
10075 	 */
10076 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE	UINT32_C(0x20000)
10077 	/*
10078 	 * If set to 1, it indicates that the pause configuration
10079 	 * on the PHY has changed.
10080 	 * If set to 0, then there is no change in the pause
10081 	 * configuration on the PHY.
10082 	 */
10083 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE	UINT32_C(0x40000)
10084 } hwrm_async_event_cmpl_port_phy_cfg_change_t, *phwrm_async_event_cmpl_port_phy_cfg_change_t;
10085 
10086 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
10087 
10088 typedef struct hwrm_async_event_cmpl_reset_notify {
10089 	uint16_t	type;
10090 	/*
10091 	 * This field indicates the exact type of the completion.
10092 	 * By convention, the LSB identifies the length of the
10093 	 * record in 16B units. Even values indicate 16B
10094 	 * records. Odd values indicate 32B
10095 	 * records.
10096 	 */
10097 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK		UINT32_C(0x3f)
10098 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT		0
10099 	/* HWRM Asynchronous Event Information */
10100 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10101 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
10102 	/* Identifiers of events. */
10103 	uint16_t	event_id;
10104 	/* Notify clients of imminent reset. */
10105 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY UINT32_C(0x8)
10106 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
10107 	/* Event specific data. The data is for internal debug use only. */
10108 	uint32_t	event_data2;
10109 	/*
10110 	 * These bits indicate the status as being reported by the firmware.
10111 	 * This value is exactly the same as status code in fw_status register.
10112 	 * If the status code is equal to 0x8000, then the reset is initiated
10113 	 * by the Host using the FW_RESET command when the FW is in a healthy
10114 	 * state. If the status code is not equal to 0x8000, then the reset is
10115 	 * initiated by the FW to recover from the error or FATAL state.
10116 	 */
10117 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK UINT32_C(0xffff)
10118 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_SFT 0
10119 	uint8_t	opaque_v;
10120 	/*
10121 	 * This value is written by the NIC such that it will be different
10122 	 * for each pass through the completion queue. The even passes
10123 	 * will write 1. The odd passes will write 0.
10124 	 */
10125 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V	UINT32_C(0x1)
10126 	/* opaque is 7 b */
10127 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
10128 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
10129 	/*
10130 	 * 8-lsb timestamp (100-msec resolution)
10131 	 * The Minimum time required for the Firmware readiness after sending
10132 	 * this notification to the driver instances.
10133 	 */
10134 	uint8_t	timestamp_lo;
10135 	/*
10136 	 * 16-lsb timestamp (100-msec resolution)
10137 	 * The Maximum Firmware Reset bail out value in the order of 100
10138 	 * milliseconds. The driver instances will use this value to reinitiate
10139 	 * the registration process again if the core firmware didn’t set the
10140 	 * state bit.
10141 	 */
10142 	uint16_t	timestamp_hi;
10143 	/* Event specific data */
10144 	uint32_t	event_data1;
10145 	/* Indicates driver action requested */
10146 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK		UINT32_C(0xff)
10147 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT		0
10148 	/*
10149 	 * If set to 1, it indicates that the l2 client should
10150 	 * stop sending in band traffic to Nitro.
10151 	 * if set to 0, there is no change in L2 client behavior.
10152 	 */
10153 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE	UINT32_C(0x1)
10154 	/*
10155 	 * If set to 1, it indicates that the L2 client should
10156 	 * bring down the interface.
10157 	 * If set to 0, then there is no change in L2 client behavior.
10158 	 */
10159 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN	UINT32_C(0x2)
10160 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST		HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
10161 	/* Indicates reason for reset. */
10162 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK			UINT32_C(0xff00)
10163 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT			8
10164 	/* A management client has requested reset. */
10165 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST  (UINT32_C(0x1) << 8)
10166 	/* A fatal firmware exception has occurred. */
10167 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL	(UINT32_C(0x2) << 8)
10168 	/* A non-fatal firmware exception has occurred. */
10169 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL	(UINT32_C(0x3) << 8)
10170 	/* Fast reset */
10171 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET		(UINT32_C(0x4) << 8)
10172 	/*
10173 	 * Reset was a result of a firmware activation. That is, the
10174 	 * fw_activation flag was set in a FW_RESET operation.
10175 	 */
10176 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION		(UINT32_C(0x5) << 8)
10177 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST			HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION
10178 	/*
10179 	 * Minimum time before driver should attempt access - units 100ms
10180 	 * ticks.
10181 	 * Range 0-65535
10182 	 */
10183 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK	UINT32_C(0xffff0000)
10184 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT		16
10185 } hwrm_async_event_cmpl_reset_notify_t, *phwrm_async_event_cmpl_reset_notify_t;
10186 
10187 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
10188 
10189 typedef struct hwrm_async_event_cmpl_error_recovery {
10190 	uint16_t	type;
10191 	/*
10192 	 * This field indicates the exact type of the completion.
10193 	 * By convention, the LSB identifies the length of the
10194 	 * record in 16B units. Even values indicate 16B
10195 	 * records. Odd values indicate 32B
10196 	 * records.
10197 	 */
10198 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK		UINT32_C(0x3f)
10199 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT		0
10200 	/* HWRM Asynchronous Event Information */
10201 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10202 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
10203 	/* Identifiers of events. */
10204 	uint16_t	event_id;
10205 	/*
10206 	 * This async notification message can be used for selecting or
10207 	 * deselecting master function for error recovery,
10208 	 * and to communicate to all the functions whether error recovery
10209 	 * was enabled/disabled.
10210 	 */
10211 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY UINT32_C(0x9)
10212 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
10213 	/* Event specific data */
10214 	uint32_t	event_data2;
10215 	uint8_t	opaque_v;
10216 	/*
10217 	 * This value is written by the NIC such that it will be different
10218 	 * for each pass through the completion queue. The even passes
10219 	 * will write 1. The odd passes will write 0.
10220 	 */
10221 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V	UINT32_C(0x1)
10222 	/* opaque is 7 b */
10223 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
10224 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
10225 	/* 8-lsb timestamp (100-msec resolution) */
10226 	uint8_t	timestamp_lo;
10227 	/* 16-lsb timestamp (100-msec resolution) */
10228 	uint16_t	timestamp_hi;
10229 	/* Event specific data */
10230 	uint32_t	event_data1;
10231 	/* Indicates driver action requested */
10232 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK		UINT32_C(0xff)
10233 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT		0
10234 	/*
10235 	 * If set to 1, this function is selected as Master function.
10236 	 * This function has responsibility to do 'chip reset' when it
10237 	 * detects a fatal error. If set to 0, master function functionality
10238 	 * is disabled on this function.
10239 	 */
10240 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC	UINT32_C(0x1)
10241 	/*
10242 	 * If set to 1, error recovery is enabled.
10243 	 * If set to 0, error recovery is disabled.
10244 	 */
10245 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED	UINT32_C(0x2)
10246 } hwrm_async_event_cmpl_error_recovery_t, *phwrm_async_event_cmpl_error_recovery_t;
10247 
10248 /* hwrm_async_event_cmpl_ring_monitor_msg (size:128b/16B) */
10249 
10250 typedef struct hwrm_async_event_cmpl_ring_monitor_msg {
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_RING_MONITOR_MSG_TYPE_MASK		UINT32_C(0x3f)
10260 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_SFT		0
10261 	/* HWRM Asynchronous Event Information */
10262 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10263 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT
10264 	/* Identifiers of events. */
10265 	uint16_t	event_id;
10266 	/* Ring Monitor Message. */
10267 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG UINT32_C(0xa)
10268 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG
10269 	/* Event specific data */
10270 	uint32_t	event_data2;
10271 	/* Type of Ring disabled. */
10272 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_MASK UINT32_C(0xff)
10273 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_SFT 0
10274 	/* tx ring disabled. */
10275 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_TX	UINT32_C(0x0)
10276 	/* rx ring disabled. */
10277 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_RX	UINT32_C(0x1)
10278 	/* cmpl ring disabled. */
10279 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL  UINT32_C(0x2)
10280 		#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
10281 	uint8_t	opaque_v;
10282 	/*
10283 	 * This value is written by the NIC such that it will be different
10284 	 * for each pass through the completion queue. The even passes
10285 	 * will write 1. The odd passes will write 0.
10286 	 */
10287 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_V	UINT32_C(0x1)
10288 	/* opaque is 7 b */
10289 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_MASK UINT32_C(0xfe)
10290 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_SFT 1
10291 	/* 8-lsb timestamp from POR (100-msec resolution) */
10292 	uint8_t	timestamp_lo;
10293 	/* 16-lsb timestamp from POR (100-msec resolution) */
10294 	uint16_t	timestamp_hi;
10295 	/*
10296 	 * Event specific data. If ring_type_disabled indicates a tx, rx or cmpl
10297 	 * then this field will indicate the ring id.
10298 	 */
10299 	uint32_t	event_data1;
10300 } hwrm_async_event_cmpl_ring_monitor_msg_t, *phwrm_async_event_cmpl_ring_monitor_msg_t;
10301 
10302 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
10303 
10304 typedef struct hwrm_async_event_cmpl_func_drvr_unload {
10305 	uint16_t	type;
10306 	/*
10307 	 * This field indicates the exact type of the completion.
10308 	 * By convention, the LSB identifies the length of the
10309 	 * record in 16B units. Even values indicate 16B
10310 	 * records. Odd values indicate 32B
10311 	 * records.
10312 	 */
10313 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK		UINT32_C(0x3f)
10314 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT		0
10315 	/* HWRM Asynchronous Event Information */
10316 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10317 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10318 	/* Identifiers of events. */
10319 	uint16_t	event_id;
10320 	/* Function driver unloaded */
10321 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
10322 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
10323 	/* Event specific data */
10324 	uint32_t	event_data2;
10325 	uint8_t	opaque_v;
10326 	/*
10327 	 * This value is written by the NIC such that it will be different
10328 	 * for each pass through the completion queue. The even passes
10329 	 * will write 1. The odd passes will write 0.
10330 	 */
10331 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V	UINT32_C(0x1)
10332 	/* opaque is 7 b */
10333 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
10334 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
10335 	/* 8-lsb timestamp from POR (100-msec resolution) */
10336 	uint8_t	timestamp_lo;
10337 	/* 16-lsb timestamp from POR (100-msec resolution) */
10338 	uint16_t	timestamp_hi;
10339 	/* Event specific data */
10340 	uint32_t	event_data1;
10341 	/* Function ID */
10342 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10343 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
10344 } hwrm_async_event_cmpl_func_drvr_unload_t, *phwrm_async_event_cmpl_func_drvr_unload_t;
10345 
10346 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
10347 
10348 typedef struct hwrm_async_event_cmpl_func_drvr_load {
10349 	uint16_t	type;
10350 	/*
10351 	 * This field indicates the exact type of the completion.
10352 	 * By convention, the LSB identifies the length of the
10353 	 * record in 16B units. Even values indicate 16B
10354 	 * records. Odd values indicate 32B
10355 	 * records.
10356 	 */
10357 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK		UINT32_C(0x3f)
10358 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT		0
10359 	/* HWRM Asynchronous Event Information */
10360 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10361 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10362 	/* Identifiers of events. */
10363 	uint16_t	event_id;
10364 	/* Function driver loaded */
10365 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
10366 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
10367 	/* Event specific data */
10368 	uint32_t	event_data2;
10369 	uint8_t	opaque_v;
10370 	/*
10371 	 * This value is written by the NIC such that it will be different
10372 	 * for each pass through the completion queue. The even passes
10373 	 * will write 1. The odd passes will write 0.
10374 	 */
10375 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V	UINT32_C(0x1)
10376 	/* opaque is 7 b */
10377 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10378 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
10379 	/* 8-lsb timestamp from POR (100-msec resolution) */
10380 	uint8_t	timestamp_lo;
10381 	/* 16-lsb timestamp from POR (100-msec resolution) */
10382 	uint16_t	timestamp_hi;
10383 	/* Event specific data */
10384 	uint32_t	event_data1;
10385 	/* Function ID */
10386 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10387 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10388 } hwrm_async_event_cmpl_func_drvr_load_t, *phwrm_async_event_cmpl_func_drvr_load_t;
10389 
10390 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
10391 
10392 typedef struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
10393 	uint16_t	type;
10394 	/*
10395 	 * This field indicates the exact type of the completion.
10396 	 * By convention, the LSB identifies the length of the
10397 	 * record in 16B units. Even values indicate 16B
10398 	 * records. Odd values indicate 32B
10399 	 * records.
10400 	 */
10401 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK		UINT32_C(0x3f)
10402 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT		0
10403 	/* HWRM Asynchronous Event Information */
10404 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10405 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
10406 	/* Identifiers of events. */
10407 	uint16_t	event_id;
10408 	/* Function FLR related processing has completed */
10409 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
10410 	#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
10411 	/* Event specific data */
10412 	uint32_t	event_data2;
10413 	uint8_t	opaque_v;
10414 	/*
10415 	 * This value is written by the NIC such that it will be different
10416 	 * for each pass through the completion queue. The even passes
10417 	 * will write 1. The odd passes will write 0.
10418 	 */
10419 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V	UINT32_C(0x1)
10420 	/* opaque is 7 b */
10421 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK UINT32_C(0xfe)
10422 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
10423 	/* 8-lsb timestamp from POR (100-msec resolution) */
10424 	uint8_t	timestamp_lo;
10425 	/* 16-lsb timestamp from POR (100-msec resolution) */
10426 	uint16_t	timestamp_hi;
10427 	/* Event specific data */
10428 	uint32_t	event_data1;
10429 	/* Function ID */
10430 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10431 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT 0
10432 } hwrm_async_event_cmpl_func_flr_proc_cmplt_t, *phwrm_async_event_cmpl_func_flr_proc_cmplt_t;
10433 
10434 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
10435 
10436 typedef struct hwrm_async_event_cmpl_pf_drvr_unload {
10437 	uint16_t	type;
10438 	/*
10439 	 * This field indicates the exact type of the completion.
10440 	 * By convention, the LSB identifies the length of the
10441 	 * record in 16B units. Even values indicate 16B
10442 	 * records. Odd values indicate 32B
10443 	 * records.
10444 	 */
10445 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK		UINT32_C(0x3f)
10446 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT		0
10447 	/* HWRM Asynchronous Event Information */
10448 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10449 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10450 	/* Identifiers of events. */
10451 	uint16_t	event_id;
10452 	/* PF driver unloaded */
10453 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
10454 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
10455 	/* Event specific data */
10456 	uint32_t	event_data2;
10457 	uint8_t	opaque_v;
10458 	/*
10459 	 * This value is written by the NIC such that it will be different
10460 	 * for each pass through the completion queue. The even passes
10461 	 * will write 1. The odd passes will write 0.
10462 	 */
10463 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V	UINT32_C(0x1)
10464 	/* opaque is 7 b */
10465 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
10466 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
10467 	/* 8-lsb timestamp from POR (100-msec resolution) */
10468 	uint8_t	timestamp_lo;
10469 	/* 16-lsb timestamp from POR (100-msec resolution) */
10470 	uint16_t	timestamp_hi;
10471 	/* Event specific data */
10472 	uint32_t	event_data1;
10473 	/* PF ID */
10474 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10475 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
10476 	/* Indicates the physical port this pf belongs to */
10477 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK   UINT32_C(0x70000)
10478 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT	16
10479 } hwrm_async_event_cmpl_pf_drvr_unload_t, *phwrm_async_event_cmpl_pf_drvr_unload_t;
10480 
10481 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
10482 
10483 typedef struct hwrm_async_event_cmpl_pf_drvr_load {
10484 	uint16_t	type;
10485 	/*
10486 	 * This field indicates the exact type of the completion.
10487 	 * By convention, the LSB identifies the length of the
10488 	 * record in 16B units. Even values indicate 16B
10489 	 * records. Odd values indicate 32B
10490 	 * records.
10491 	 */
10492 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK		UINT32_C(0x3f)
10493 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT		0
10494 	/* HWRM Asynchronous Event Information */
10495 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10496 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10497 	/* Identifiers of events. */
10498 	uint16_t	event_id;
10499 	/* PF driver loaded */
10500 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
10501 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
10502 	/* Event specific data */
10503 	uint32_t	event_data2;
10504 	uint8_t	opaque_v;
10505 	/*
10506 	 * This value is written by the NIC such that it will be different
10507 	 * for each pass through the completion queue. The even passes
10508 	 * will write 1. The odd passes will write 0.
10509 	 */
10510 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V	UINT32_C(0x1)
10511 	/* opaque is 7 b */
10512 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10513 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
10514 	/* 8-lsb timestamp from POR (100-msec resolution) */
10515 	uint8_t	timestamp_lo;
10516 	/* 16-lsb timestamp from POR (100-msec resolution) */
10517 	uint16_t	timestamp_hi;
10518 	/* Event specific data */
10519 	uint32_t	event_data1;
10520 	/* PF ID */
10521 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10522 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10523 	/* Indicates the physical port this pf belongs to */
10524 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK   UINT32_C(0x70000)
10525 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT	16
10526 } hwrm_async_event_cmpl_pf_drvr_load_t, *phwrm_async_event_cmpl_pf_drvr_load_t;
10527 
10528 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
10529 
10530 typedef struct hwrm_async_event_cmpl_vf_flr {
10531 	uint16_t	type;
10532 	/*
10533 	 * This field indicates the exact type of the completion.
10534 	 * By convention, the LSB identifies the length of the
10535 	 * record in 16B units. Even values indicate 16B
10536 	 * records. Odd values indicate 32B
10537 	 * records.
10538 	 */
10539 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK		UINT32_C(0x3f)
10540 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT		0
10541 	/* HWRM Asynchronous Event Information */
10542 		#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10543 		#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
10544 	/* Identifiers of events. */
10545 	uint16_t	event_id;
10546 	/* VF Function Level Reset (FLR) */
10547 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
10548 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST  HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
10549 	/* Event specific data */
10550 	uint32_t	event_data2;
10551 	uint8_t	opaque_v;
10552 	/*
10553 	 * This value is written by the NIC such that it will be different
10554 	 * for each pass through the completion queue. The even passes
10555 	 * will write 1. The odd passes will write 0.
10556 	 */
10557 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V	UINT32_C(0x1)
10558 	/* opaque is 7 b */
10559 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
10560 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
10561 	/* 8-lsb timestamp from POR (100-msec resolution) */
10562 	uint8_t	timestamp_lo;
10563 	/* 16-lsb timestamp from POR (100-msec resolution) */
10564 	uint16_t	timestamp_hi;
10565 	/* Event specific data */
10566 	uint32_t	event_data1;
10567 	/* VF ID */
10568 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
10569 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
10570 	/* Indicates the physical function this event occurred on. */
10571 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK UINT32_C(0xff0000)
10572 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
10573 } hwrm_async_event_cmpl_vf_flr_t, *phwrm_async_event_cmpl_vf_flr_t;
10574 
10575 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
10576 
10577 typedef struct hwrm_async_event_cmpl_vf_mac_addr_change {
10578 	uint16_t	type;
10579 	/*
10580 	 * This field indicates the exact type of the completion.
10581 	 * By convention, the LSB identifies the length of the
10582 	 * record in 16B units. Even values indicate 16B
10583 	 * records. Odd values indicate 32B
10584 	 * records.
10585 	 */
10586 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10587 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT		0
10588 	/* HWRM Asynchronous Event Information */
10589 		#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10590 		#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
10591 	/* Identifiers of events. */
10592 	uint16_t	event_id;
10593 	/* VF MAC Address Change */
10594 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
10595 	#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
10596 	/* Event specific data */
10597 	uint32_t	event_data2;
10598 	uint8_t	opaque_v;
10599 	/*
10600 	 * This value is written by the NIC such that it will be different
10601 	 * for each pass through the completion queue. The even passes
10602 	 * will write 1. The odd passes will write 0.
10603 	 */
10604 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V	UINT32_C(0x1)
10605 	/* opaque is 7 b */
10606 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10607 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
10608 	/* 8-lsb timestamp from POR (100-msec resolution) */
10609 	uint8_t	timestamp_lo;
10610 	/* 16-lsb timestamp from POR (100-msec resolution) */
10611 	uint16_t	timestamp_hi;
10612 	/* Event specific data */
10613 	uint32_t	event_data1;
10614 	/* VF ID */
10615 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
10616 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
10617 } hwrm_async_event_cmpl_vf_mac_addr_change_t, *phwrm_async_event_cmpl_vf_mac_addr_change_t;
10618 
10619 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
10620 
10621 typedef struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
10622 	uint16_t	type;
10623 	/*
10624 	 * This field indicates the exact type of the completion.
10625 	 * By convention, the LSB identifies the length of the
10626 	 * record in 16B units. Even values indicate 16B
10627 	 * records. Odd values indicate 32B
10628 	 * records.
10629 	 */
10630 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10631 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT		0
10632 	/* HWRM Asynchronous Event Information */
10633 		#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10634 		#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
10635 	/* Identifiers of events. */
10636 	uint16_t	event_id;
10637 	/* PF-VF communication channel status change. */
10638 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
10639 	#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
10640 	/* Event specific data */
10641 	uint32_t	event_data2;
10642 	uint8_t	opaque_v;
10643 	/*
10644 	 * This value is written by the NIC such that it will be different
10645 	 * for each pass through the completion queue. The even passes
10646 	 * will write 1. The odd passes will write 0.
10647 	 */
10648 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V	UINT32_C(0x1)
10649 	/* opaque is 7 b */
10650 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10651 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
10652 	/* 8-lsb timestamp from POR (100-msec resolution) */
10653 	uint8_t	timestamp_lo;
10654 	/* 16-lsb timestamp from POR (100-msec resolution) */
10655 	uint16_t	timestamp_hi;
10656 	/* Event specific data */
10657 	uint32_t	event_data1;
10658 	/*
10659 	 * If this bit is set to 1, then it indicates that the PF-VF
10660 	 * communication was lost and it is established.
10661 	 * If this bit set to 0, then it indicates that the PF-VF
10662 	 * communication was established and it is lost.
10663 	 */
10664 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED	UINT32_C(0x1)
10665 } hwrm_async_event_cmpl_pf_vf_comm_status_change_t, *phwrm_async_event_cmpl_pf_vf_comm_status_change_t;
10666 
10667 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
10668 
10669 typedef struct hwrm_async_event_cmpl_vf_cfg_change {
10670 	uint16_t	type;
10671 	/*
10672 	 * This field indicates the exact type of the completion.
10673 	 * By convention, the LSB identifies the length of the
10674 	 * record in 16B units. Even values indicate 16B
10675 	 * records. Odd values indicate 32B
10676 	 * records.
10677 	 */
10678 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10679 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT		0
10680 	/* HWRM Asynchronous Event Information */
10681 		#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10682 		#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10683 	/* Identifiers of events. */
10684 	uint16_t	event_id;
10685 	/* VF Configuration Change */
10686 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
10687 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
10688 	/* Event specific data */
10689 	uint32_t	event_data2;
10690 	/*
10691 	 * This value indicates the VF ID of the VF whose configuration
10692 	 * is changing if this async. event is sent to the parent PF.
10693 	 * The firmware supports sending this to the parent PF if the
10694 	 * `hwrm_func_qcaps.vf_cfg_async_for_pf_supported` value is 1.
10695 	 * This value is undefined when the async. event is sent to the
10696 	 * VF.
10697 	 */
10698 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_MASK UINT32_C(0xffff)
10699 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_SFT 0
10700 	uint8_t	opaque_v;
10701 	/*
10702 	 * This value is written by the NIC such that it will be different
10703 	 * for each pass through the completion queue. The even passes
10704 	 * will write 1. The odd passes will write 0.
10705 	 */
10706 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V	UINT32_C(0x1)
10707 	/* opaque is 7 b */
10708 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10709 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
10710 	/* 8-lsb timestamp from POR (100-msec resolution) */
10711 	uint8_t	timestamp_lo;
10712 	/* 16-lsb timestamp from POR (100-msec resolution) */
10713 	uint16_t	timestamp_hi;
10714 	/*
10715 	 * Each flag provided in this field indicates a specific VF
10716 	 * configuration change. At least one of these flags shall be set to 1
10717 	 * when an asynchronous event completion of this type is provided
10718 	 * by the HWRM.
10719 	 */
10720 	uint32_t	event_data1;
10721 	/*
10722 	 * If this bit is set to 1, then the value of MTU
10723 	 * was changed on this VF.
10724 	 * If set to 0, then this bit should be ignored.
10725 	 */
10726 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE		UINT32_C(0x1)
10727 	/*
10728 	 * If this bit is set to 1, then the value of MRU
10729 	 * was changed on this VF.
10730 	 * If set to 0, then this bit should be ignored.
10731 	 */
10732 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE		UINT32_C(0x2)
10733 	/*
10734 	 * If this bit is set to 1, then the value of default MAC
10735 	 * address was changed on this VF.
10736 	 * If set to 0, then this bit should be ignored.
10737 	 */
10738 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE	UINT32_C(0x4)
10739 	/*
10740 	 * If this bit is set to 1, then the value of default VLAN
10741 	 * was changed on this VF.
10742 	 * If set to 0, then this bit should be ignored.
10743 	 */
10744 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE	UINT32_C(0x8)
10745 	/*
10746 	 * If this bit is set to 1, then the value of trusted VF enable
10747 	 * was changed on this VF.
10748 	 * If set to 0, then this bit should be ignored.
10749 	 */
10750 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE	UINT32_C(0x10)
10751 } hwrm_async_event_cmpl_vf_cfg_change_t, *phwrm_async_event_cmpl_vf_cfg_change_t;
10752 
10753 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
10754 
10755 typedef struct hwrm_async_event_cmpl_llfc_pfc_change {
10756 	uint16_t	type;
10757 	/*
10758 	 * This field indicates the exact type of the completion.
10759 	 * By convention, the LSB identifies the length of the
10760 	 * record in 16B units. Even values indicate 16B
10761 	 * records. Odd values indicate 32B
10762 	 * records.
10763 	 */
10764 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10765 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT		0
10766 	/* HWRM Asynchronous Event Information */
10767 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10768 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
10769 	/* unused1 is 10 b */
10770 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK	UINT32_C(0xffc0)
10771 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT	6
10772 	/* Identifiers of events. */
10773 	uint16_t	event_id;
10774 	/* LLFC/PFC Configuration Change */
10775 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
10776 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
10777 	/* Event specific data */
10778 	uint32_t	event_data2;
10779 	uint8_t	opaque_v;
10780 	/*
10781 	 * This value is written by the NIC such that it will be different
10782 	 * for each pass through the completion queue. The even passes
10783 	 * will write 1. The odd passes will write 0.
10784 	 */
10785 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V	UINT32_C(0x1)
10786 	/* opaque is 7 b */
10787 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10788 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
10789 	/* 8-lsb timestamp from POR (100-msec resolution) */
10790 	uint8_t	timestamp_lo;
10791 	/* 16-lsb timestamp from POR (100-msec resolution) */
10792 	uint16_t	timestamp_hi;
10793 	/* Event specific data */
10794 	uint32_t	event_data1;
10795 	/* Indicates llfc pfc status change */
10796 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK UINT32_C(0x3)
10797 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT 0
10798 	/*
10799 	 * If this field set to 1, then it indicates that llfc is
10800 	 * enabled.
10801 	 */
10802 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC  UINT32_C(0x1)
10803 	/*
10804 	 * If this field is set to 2, then it indicates that pfc
10805 	 * is enabled.
10806 	 */
10807 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC   UINT32_C(0x2)
10808 		#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
10809 	/* Indicates the physical port this llfc pfc change occur */
10810 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK	UINT32_C(0x1c)
10811 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT	2
10812 	/* PORT ID */
10813 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0x1fffe0)
10814 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT  5
10815 } hwrm_async_event_cmpl_llfc_pfc_change_t, *phwrm_async_event_cmpl_llfc_pfc_change_t;
10816 
10817 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
10818 
10819 typedef struct hwrm_async_event_cmpl_default_vnic_change {
10820 	uint16_t	type;
10821 	/*
10822 	 * This field indicates the exact type of the completion.
10823 	 * By convention, the LSB identifies the length of the
10824 	 * record in 16B units. Even values indicate 16B
10825 	 * records. Odd values indicate 32B
10826 	 * records.
10827 	 */
10828 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10829 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT		0
10830 	/* HWRM Asynchronous Event Information */
10831 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10832 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
10833 	/* unused1 is 10 b */
10834 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK	UINT32_C(0xffc0)
10835 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT	6
10836 	/* Identifiers of events. */
10837 	uint16_t	event_id;
10838 	/* Notification of a default vnic allocation or free */
10839 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION UINT32_C(0x35)
10840 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
10841 	/* Event specific data */
10842 	uint32_t	event_data2;
10843 	uint8_t	opaque_v;
10844 	/*
10845 	 * This value is written by the NIC such that it will be different
10846 	 * for each pass through the completion queue. The even passes
10847 	 * will write 1. The odd passes will write 0.
10848 	 */
10849 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V	UINT32_C(0x1)
10850 	/* opaque is 7 b */
10851 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10852 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
10853 	/* 8-lsb timestamp from POR (100-msec resolution) */
10854 	uint8_t	timestamp_lo;
10855 	/* 16-lsb timestamp from POR (100-msec resolution) */
10856 	uint16_t	timestamp_hi;
10857 	/* Event specific data */
10858 	uint32_t	event_data1;
10859 	/* Indicates default vnic configuration change */
10860 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK	UINT32_C(0x3)
10861 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT	0
10862 	/*
10863 	 * If this field is set to 1, then it indicates that
10864 	 * a default VNIC has been allocate.
10865 	 */
10866 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC  UINT32_C(0x1)
10867 	/*
10868 	 * If this field is set to 2, then it indicates that
10869 	 * a default VNIC has been freed.
10870 	 */
10871 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE   UINT32_C(0x2)
10872 		#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
10873 	/* Indicates the physical function this event occurred on. */
10874 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK		UINT32_C(0x3fc)
10875 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT			2
10876 	/* Indicates the virtual function this event occurred on */
10877 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK		UINT32_C(0x3fffc00)
10878 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT			10
10879 } hwrm_async_event_cmpl_default_vnic_change_t, *phwrm_async_event_cmpl_default_vnic_change_t;
10880 
10881 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
10882 
10883 typedef struct hwrm_async_event_cmpl_hw_flow_aged {
10884 	uint16_t	type;
10885 	/*
10886 	 * This field indicates the exact type of the completion.
10887 	 * By convention, the LSB identifies the length of the
10888 	 * record in 16B units. Even values indicate 16B
10889 	 * records. Odd values indicate 32B
10890 	 * records.
10891 	 */
10892 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK		UINT32_C(0x3f)
10893 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT		0
10894 	/* HWRM Asynchronous Event Information */
10895 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10896 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
10897 	/* Identifiers of events. */
10898 	uint16_t	event_id;
10899 	/* Notification of a hw flow aged */
10900 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED UINT32_C(0x36)
10901 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
10902 	/* Event specific data */
10903 	uint32_t	event_data2;
10904 	uint8_t	opaque_v;
10905 	/*
10906 	 * This value is written by the NIC such that it will be different
10907 	 * for each pass through the completion queue. The even passes
10908 	 * will write 1. The odd passes will write 0.
10909 	 */
10910 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V	UINT32_C(0x1)
10911 	/* opaque is 7 b */
10912 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
10913 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
10914 	/* 8-lsb timestamp from POR (100-msec resolution) */
10915 	uint8_t	timestamp_lo;
10916 	/* 16-lsb timestamp from POR (100-msec resolution) */
10917 	uint16_t	timestamp_hi;
10918 	/* Event specific data */
10919 	uint32_t	event_data1;
10920 	/* Indicates flow ID this event occurred on. */
10921 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK	UINT32_C(0x7fffffff)
10922 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT	0
10923 	/* Indicates flow direction this event occurred on. */
10924 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION	UINT32_C(0x80000000)
10925 	/*
10926 	 * If this bit set to 0, then it indicates that the aged
10927 	 * event was rx flow.
10928 	 */
10929 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 31)
10930 	/*
10931 	 * If this bit is set to 1, then it indicates that the aged
10932 	 * event was tx flow.
10933 	 */
10934 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 31)
10935 		#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
10936 } hwrm_async_event_cmpl_hw_flow_aged_t, *phwrm_async_event_cmpl_hw_flow_aged_t;
10937 
10938 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
10939 
10940 typedef struct hwrm_async_event_cmpl_eem_cache_flush_req {
10941 	uint16_t	type;
10942 	/*
10943 	 * This field indicates the exact type of the completion.
10944 	 * By convention, the LSB identifies the length of the
10945 	 * record in 16B units. Even values indicate 16B
10946 	 * records. Odd values indicate 32B
10947 	 * records.
10948 	 */
10949 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK		UINT32_C(0x3f)
10950 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT		0
10951 	/* HWRM Asynchronous Event Information */
10952 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10953 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
10954 	/* Identifiers of events. */
10955 	uint16_t	event_id;
10956 	/* Notification of a eem_cache_flush request */
10957 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ UINT32_C(0x38)
10958 	#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
10959 	/* Event specific data */
10960 	uint32_t	event_data2;
10961 	uint8_t	opaque_v;
10962 	/*
10963 	 * This value is written by the NIC such that it will be different
10964 	 * for each pass through the completion queue. The even passes
10965 	 * will write 1. The odd passes will write 0.
10966 	 */
10967 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V	UINT32_C(0x1)
10968 	/* opaque is 7 b */
10969 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK UINT32_C(0xfe)
10970 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
10971 	/* 8-lsb timestamp from POR (100-msec resolution) */
10972 	uint8_t	timestamp_lo;
10973 	/* 16-lsb timestamp from POR (100-msec resolution) */
10974 	uint16_t	timestamp_hi;
10975 	/* Event specific data */
10976 	uint32_t	event_data1;
10977 } hwrm_async_event_cmpl_eem_cache_flush_req_t, *phwrm_async_event_cmpl_eem_cache_flush_req_t;
10978 
10979 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
10980 
10981 typedef struct hwrm_async_event_cmpl_eem_cache_flush_done {
10982 	uint16_t	type;
10983 	/*
10984 	 * This field indicates the exact type of the completion.
10985 	 * By convention, the LSB identifies the length of the
10986 	 * record in 16B units. Even values indicate 16B
10987 	 * records. Odd values indicate 32B
10988 	 * records.
10989 	 */
10990 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK		UINT32_C(0x3f)
10991 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT		0
10992 	/* HWRM Asynchronous Event Information */
10993 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10994 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
10995 	/* Identifiers of events. */
10996 	uint16_t	event_id;
10997 	/*
10998 	 * Notification of a host eem_cache_flush has completed. This event
10999 	 * is generated by the host driver.
11000 	 */
11001 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE UINT32_C(0x39)
11002 	#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
11003 	/* Event specific data */
11004 	uint32_t	event_data2;
11005 	uint8_t	opaque_v;
11006 	/*
11007 	 * This value is written by the NIC such that it will be different
11008 	 * for each pass through the completion queue. The even passes
11009 	 * will write 1. The odd passes will write 0.
11010 	 */
11011 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V	UINT32_C(0x1)
11012 	/* opaque is 7 b */
11013 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK UINT32_C(0xfe)
11014 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
11015 	/* 8-lsb timestamp from POR (100-msec resolution) */
11016 	uint8_t	timestamp_lo;
11017 	/* 16-lsb timestamp from POR (100-msec resolution) */
11018 	uint16_t	timestamp_hi;
11019 	/* Event specific data */
11020 	uint32_t	event_data1;
11021 	/* Indicates function ID that this event occurred on. */
11022 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK UINT32_C(0xffff)
11023 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT 0
11024 } hwrm_async_event_cmpl_eem_cache_flush_done_t, *phwrm_async_event_cmpl_eem_cache_flush_done_t;
11025 
11026 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
11027 
11028 typedef struct hwrm_async_event_cmpl_tcp_flag_action_change {
11029 	uint16_t	type;
11030 	/*
11031 	 * This field indicates the exact type of the completion.
11032 	 * By convention, the LSB identifies the length of the
11033 	 * record in 16B units. Even values indicate 16B
11034 	 * records. Odd values indicate 32B
11035 	 * records.
11036 	 */
11037 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11038 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT		0
11039 	/* HWRM Asynchronous Event Information */
11040 		#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11041 		#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
11042 	/* Identifiers of events. */
11043 	uint16_t	event_id;
11044 	/* Notification of tcp flag action change */
11045 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE UINT32_C(0x3a)
11046 	#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
11047 	/* Event specific data */
11048 	uint32_t	event_data2;
11049 	uint8_t	opaque_v;
11050 	/*
11051 	 * This value is written by the NIC such that it will be different
11052 	 * for each pass through the completion queue. The even passes
11053 	 * will write 1. The odd passes will write 0.
11054 	 */
11055 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V	UINT32_C(0x1)
11056 	/* opaque is 7 b */
11057 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11058 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
11059 	/* 8-lsb timestamp from POR (100-msec resolution) */
11060 	uint8_t	timestamp_lo;
11061 	/* 16-lsb timestamp from POR (100-msec resolution) */
11062 	uint16_t	timestamp_hi;
11063 	/* Event specific data */
11064 	uint32_t	event_data1;
11065 } hwrm_async_event_cmpl_tcp_flag_action_change_t, *phwrm_async_event_cmpl_tcp_flag_action_change_t;
11066 
11067 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
11068 
11069 typedef struct hwrm_async_event_cmpl_eem_flow_active {
11070 	uint16_t	type;
11071 	/*
11072 	 * This field indicates the exact type of the completion.
11073 	 * By convention, the LSB identifies the length of the
11074 	 * record in 16B units. Even values indicate 16B
11075 	 * records. Odd values indicate 32B
11076 	 * records.
11077 	 */
11078 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK		UINT32_C(0x3f)
11079 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT		0
11080 	/* HWRM Asynchronous Event Information */
11081 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11082 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
11083 	/* Identifiers of events. */
11084 	uint16_t	event_id;
11085 	/* Notification of an active eem flow */
11086 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE UINT32_C(0x3b)
11087 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
11088 	/* Event specific data */
11089 	uint32_t	event_data2;
11090 	/* Indicates the 2nd global id this event occurred on. */
11091 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK   UINT32_C(0x3fffffff)
11092 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT	0
11093 	/*
11094 	 * Indicates flow direction of the flow identified by
11095 	 * the global_id_2.
11096 	 */
11097 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION	UINT32_C(0x40000000)
11098 	/* If this bit is set to 0, then it indicates that this rx flow. */
11099 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 30)
11100 	/* If this bit is set to 1, then it indicates that this tx flow. */
11101 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 30)
11102 		#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
11103 	uint8_t	opaque_v;
11104 	/*
11105 	 * This value is written by the NIC such that it will be different
11106 	 * for each pass through the completion queue. The even passes
11107 	 * will write 1. The odd passes will write 0.
11108 	 */
11109 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V	UINT32_C(0x1)
11110 	/* opaque is 7 b */
11111 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK UINT32_C(0xfe)
11112 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
11113 	/* 8-lsb timestamp from POR (100-msec resolution) */
11114 	uint8_t	timestamp_lo;
11115 	/* 16-lsb timestamp from POR (100-msec resolution) */
11116 	uint16_t	timestamp_hi;
11117 	/* Event specific data */
11118 	uint32_t	event_data1;
11119 	/* Indicates the 1st global id this event occurred on. */
11120 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK   UINT32_C(0x3fffffff)
11121 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT	0
11122 	/*
11123 	 * Indicates flow direction of the flow identified by the
11124 	 * global_id_1.
11125 	 */
11126 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION	UINT32_C(0x40000000)
11127 	/* If this bit is set to 0, then it indicates that this is rx flow. */
11128 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 30)
11129 	/* If this bit is set to 1, then it indicates that this is tx flow. */
11130 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 30)
11131 		#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
11132 	/*
11133 	 * Indicates EEM flow aging mode this event occurred on. If
11134 	 * this bit is set to 0, the event_data1 is the EEM global
11135 	 * ID. If this bit is set to 1, the event_data1 is the number
11136 	 * of global ID in the context memory.
11137 	 */
11138 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE		UINT32_C(0x80000000)
11139 	/* EEM flow aging mode 0. */
11140 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0		(UINT32_C(0x0) << 31)
11141 	/* EEM flow aging mode 1. */
11142 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1		(UINT32_C(0x1) << 31)
11143 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
11144 } hwrm_async_event_cmpl_eem_flow_active_t, *phwrm_async_event_cmpl_eem_flow_active_t;
11145 
11146 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
11147 
11148 typedef struct hwrm_async_event_cmpl_eem_cfg_change {
11149 	uint16_t	type;
11150 	/*
11151 	 * This field indicates the exact type of the completion.
11152 	 * By convention, the LSB identifies the length of the
11153 	 * record in 16B units. Even values indicate 16B
11154 	 * records. Odd values indicate 32B
11155 	 * records.
11156 	 */
11157 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11158 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT		0
11159 	/* HWRM Asynchronous Event Information */
11160 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11161 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11162 	/* Identifiers of events. */
11163 	uint16_t	event_id;
11164 	/* Notification of EEM configuration change */
11165 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE UINT32_C(0x3c)
11166 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
11167 	/* Event specific data */
11168 	uint32_t	event_data2;
11169 	uint8_t	opaque_v;
11170 	/*
11171 	 * This value is written by the NIC such that it will be different
11172 	 * for each pass through the completion queue. The even passes
11173 	 * will write 1. The odd passes will write 0.
11174 	 */
11175 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V	UINT32_C(0x1)
11176 	/* opaque is 7 b */
11177 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11178 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
11179 	/* 8-lsb timestamp from POR (100-msec resolution) */
11180 	uint8_t	timestamp_lo;
11181 	/* 16-lsb timestamp from POR (100-msec resolution) */
11182 	uint16_t	timestamp_hi;
11183 	/* Event specific data */
11184 	uint32_t	event_data1;
11185 	/*
11186 	 * Value of 1 to indicate EEM TX configuration is enabled. Value of
11187 	 * 0 to indicate the EEM TX configuration is disabled.
11188 	 */
11189 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE	UINT32_C(0x1)
11190 	/*
11191 	 * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
11192 	 * to indicate the EEM RX configuration is disabled.
11193 	 */
11194 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE	UINT32_C(0x2)
11195 } hwrm_async_event_cmpl_eem_cfg_change_t, *phwrm_async_event_cmpl_eem_cfg_change_t;
11196 
11197 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
11198 
11199 typedef struct hwrm_async_event_cmpl_quiesce_done {
11200 	uint16_t	type;
11201 	/*
11202 	 * This field indicates the exact type of the completion.
11203 	 * By convention, the LSB identifies the length of the
11204 	 * record in 16B units. Even values indicate 16B
11205 	 * records. Odd values indicate 32B
11206 	 * records.
11207 	 */
11208 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK		UINT32_C(0x3f)
11209 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT		0
11210 	/* HWRM Asynchronous Event Information */
11211 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11212 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
11213 	/* Identifiers of events. */
11214 	uint16_t	event_id;
11215 	/* An event signifying completion of HWRM_FW_STATE_QUIESCE */
11216 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE UINT32_C(0x3f)
11217 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
11218 	/* Event specific data */
11219 	uint32_t	event_data2;
11220 	/* Status of HWRM_FW_STATE_QUIESCE completion */
11221 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK		UINT32_C(0xff)
11222 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT		0
11223 	/*
11224 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11225 	 * completed successfully.
11226 	 */
11227 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS		UINT32_C(0x0)
11228 	/*
11229 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
11230 	 * out.
11231 	 */
11232 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT		UINT32_C(0x1)
11233 	/*
11234 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11235 	 * encountered an error.
11236 	 */
11237 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR		UINT32_C(0x2)
11238 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST		HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
11239 	/* opaque is 8 b */
11240 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK			UINT32_C(0xff00)
11241 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT			8
11242 	/*
11243 	 * Additional information about internal hardware state related to
11244 	 * idle/quiesce state.  QUIESCE may succeed per quiesce_status
11245 	 * regardless of idle_state_flags.  If QUIESCE fails, the host may
11246 	 * inspect idle_state_flags to determine whether a retry is warranted.
11247 	 */
11248 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK		UINT32_C(0xff0000)
11249 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT		16
11250 	/*
11251 	 * Failure to quiesce is caused by host not updating the NQ consumer
11252 	 * index.
11253 	 */
11254 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ	UINT32_C(0x10000)
11255 	/* Flag 1 indicating partial non-idle state. */
11256 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1	UINT32_C(0x20000)
11257 	/* Flag 2 indicating partial non-idle state. */
11258 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2	UINT32_C(0x40000)
11259 	/* Flag 3 indicating partial non-idle state. */
11260 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3	UINT32_C(0x80000)
11261 	uint8_t	opaque_v;
11262 	/*
11263 	 * This value is written by the NIC such that it will be different
11264 	 * for each pass through the completion queue. The even passes
11265 	 * will write 1. The odd passes will write 0.
11266 	 */
11267 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V	UINT32_C(0x1)
11268 	/* opaque is 7 b */
11269 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
11270 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
11271 	/* 8-lsb timestamp from POR (100-msec resolution) */
11272 	uint8_t	timestamp_lo;
11273 	/* 16-lsb timestamp from POR (100-msec resolution) */
11274 	uint16_t	timestamp_hi;
11275 	/* Event specific data */
11276 	uint32_t	event_data1;
11277 	/* Time stamp for error event */
11278 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP	UINT32_C(0x1)
11279 } hwrm_async_event_cmpl_quiesce_done_t, *phwrm_async_event_cmpl_quiesce_done_t;
11280 
11281 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
11282 
11283 typedef struct hwrm_async_event_cmpl_deferred_response {
11284 	uint16_t	type;
11285 	/*
11286 	 * This field indicates the exact type of the completion.
11287 	 * By convention, the LSB identifies the length of the
11288 	 * record in 16B units. Even values indicate 16B
11289 	 * records. Odd values indicate 32B
11290 	 * records.
11291 	 */
11292 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_MASK		UINT32_C(0x3f)
11293 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT		0
11294 	/* HWRM Asynchronous Event Information */
11295 		#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11296 		#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
11297 	/* Identifiers of events. */
11298 	uint16_t	event_id;
11299 	/*
11300 	 * An event signifying a HWRM command is in progress and its
11301 	 * response will be deferred
11302 	 */
11303 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE UINT32_C(0x40)
11304 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
11305 	/* Event specific data */
11306 	uint32_t	event_data2;
11307 	/*
11308 	 * The PF's mailbox is clear to issue another command.
11309 	 * A command with this seq_id is still in progress
11310 	 * and will return a regular HWRM completion when done.
11311 	 * 'event_data1' field, if non-zero, contains the estimated
11312 	 * execution time for the command.
11313 	 */
11314 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK UINT32_C(0xffff)
11315 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT 0
11316 	uint8_t	opaque_v;
11317 	/*
11318 	 * This value is written by the NIC such that it will be different
11319 	 * for each pass through the completion queue. The even passes
11320 	 * will write 1. The odd passes will write 0.
11321 	 */
11322 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V	UINT32_C(0x1)
11323 	/* opaque is 7 b */
11324 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK UINT32_C(0xfe)
11325 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
11326 	/* 8-lsb timestamp from POR (100-msec resolution) */
11327 	uint8_t	timestamp_lo;
11328 	/* 16-lsb timestamp from POR (100-msec resolution) */
11329 	uint16_t	timestamp_hi;
11330 	/* Estimated remaining time of command execution in ms (if not zero) */
11331 	uint32_t	event_data1;
11332 } hwrm_async_event_cmpl_deferred_response_t, *phwrm_async_event_cmpl_deferred_response_t;
11333 
11334 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
11335 
11336 typedef struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
11337 	uint16_t	type;
11338 	/*
11339 	 * This field indicates the exact type of the completion.
11340 	 * By convention, the LSB identifies the length of the
11341 	 * record in 16B units. Even values indicate 16B
11342 	 * records. Odd values indicate 32B
11343 	 * records.
11344 	 */
11345 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11346 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT		0
11347 	/* HWRM Asynchronous Event Information */
11348 		#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11349 		#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11350 	/* Identifiers of events. */
11351 	uint16_t	event_id;
11352 	/* PFC watchdog configuration change for given port/cos */
11353 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE UINT32_C(0x41)
11354 	#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
11355 	/* Event specific data */
11356 	uint32_t	event_data2;
11357 	uint8_t	opaque_v;
11358 	/*
11359 	 * This value is written by the NIC such that it will be different
11360 	 * for each pass through the completion queue. The even passes
11361 	 * will write 1. The odd passes will write 0.
11362 	 */
11363 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V	UINT32_C(0x1)
11364 	/* opaque is 7 b */
11365 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11366 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
11367 	/* 8-lsb timestamp from POR (100-msec resolution) */
11368 	uint8_t	timestamp_lo;
11369 	/* 16-lsb timestamp from POR (100-msec resolution) */
11370 	uint16_t	timestamp_hi;
11371 	/* Event specific data */
11372 	uint32_t	event_data1;
11373 	/*
11374 	 * 1 in bit position X indicates PFC watchdog should
11375 	 * be on for COSX
11376 	 */
11377 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK		UINT32_C(0xff)
11378 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT		0
11379 	/* 1 means PFC WD for COS0 is on, 0 - off. */
11380 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0	UINT32_C(0x1)
11381 	/* 1 means PFC WD for COS1 is on, 0 - off. */
11382 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1	UINT32_C(0x2)
11383 	/* 1 means PFC WD for COS2 is on, 0 - off. */
11384 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2	UINT32_C(0x4)
11385 	/* 1 means PFC WD for COS3 is on, 0 - off. */
11386 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3	UINT32_C(0x8)
11387 	/* 1 means PFC WD for COS4 is on, 0 - off. */
11388 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4	UINT32_C(0x10)
11389 	/* 1 means PFC WD for COS5 is on, 0 - off. */
11390 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5	UINT32_C(0x20)
11391 	/* 1 means PFC WD for COS6 is on, 0 - off. */
11392 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6	UINT32_C(0x40)
11393 	/* 1 means PFC WD for COS7 is on, 0 - off. */
11394 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7	UINT32_C(0x80)
11395 	/* PORT ID */
11396 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff00)
11397 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT		8
11398 } hwrm_async_event_cmpl_pfc_watchdog_cfg_change_t, *phwrm_async_event_cmpl_pfc_watchdog_cfg_change_t;
11399 
11400 /* hwrm_async_event_cmpl_echo_request (size:128b/16B) */
11401 
11402 typedef struct hwrm_async_event_cmpl_echo_request {
11403 	uint16_t	type;
11404 	/*
11405 	 * This field indicates the exact type of the completion.
11406 	 * By convention, the LSB identifies the length of the
11407 	 * record in 16B units. Even values indicate 16B
11408 	 * records. Odd values indicate 32B
11409 	 * records.
11410 	 */
11411 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_MASK		UINT32_C(0x3f)
11412 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_SFT		0
11413 	/* HWRM Asynchronous Event Information */
11414 		#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11415 		#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT
11416 	/* Identifiers of events. */
11417 	uint16_t	event_id;
11418 	/*
11419 	 * An echo request from the firmware. An echo response is expected by
11420 	 * the firmware.
11421 	 */
11422 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST UINT32_C(0x42)
11423 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST
11424 	/* Event specific data that should be provided in the echo response */
11425 	uint32_t	event_data2;
11426 	uint8_t	opaque_v;
11427 	/*
11428 	 * This value is written by the NIC such that it will be different
11429 	 * for each pass through the completion queue. The even passes
11430 	 * will write 1. The odd passes will write 0.
11431 	 */
11432 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_V	UINT32_C(0x1)
11433 	/* opaque is 7 b */
11434 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_MASK UINT32_C(0xfe)
11435 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_SFT 1
11436 	/* 8-lsb timestamp from POR (100-msec resolution) */
11437 	uint8_t	timestamp_lo;
11438 	/* 16-lsb timestamp from POR (100-msec resolution) */
11439 	uint16_t	timestamp_hi;
11440 	/* Event specific data that should be provided in the echo response */
11441 	uint32_t	event_data1;
11442 } hwrm_async_event_cmpl_echo_request_t, *phwrm_async_event_cmpl_echo_request_t;
11443 
11444 /* hwrm_async_event_cmpl_phc_update (size:128b/16B) */
11445 
11446 typedef struct hwrm_async_event_cmpl_phc_update {
11447 	uint16_t	type;
11448 	/*
11449 	 * This field indicates the exact type of the completion.
11450 	 * By convention, the LSB identifies the length of the
11451 	 * record in 16B units. Even values indicate 16B
11452 	 * records. Odd values indicate 32B
11453 	 * records.
11454 	 */
11455 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_MASK		UINT32_C(0x3f)
11456 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_SFT		0
11457 	/* HWRM Asynchronous Event Information */
11458 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11459 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT
11460 	/* Identifiers of events. */
11461 	uint16_t	event_id;
11462 	/*
11463 	 * This async event is used to notify driver of changes
11464 	 * in PHC master. Only one master function can configure
11465 	 * PHC.
11466 	 */
11467 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE UINT32_C(0x43)
11468 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE
11469 	/* Event specific data */
11470 	uint32_t	event_data2;
11471 	/* This field provides the current master function. */
11472 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_MASK UINT32_C(0xffff)
11473 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_SFT 0
11474 	/* This field provides the current secondary function. */
11475 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_MASK   UINT32_C(0xffff0000)
11476 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_SFT	16
11477 	uint8_t	opaque_v;
11478 	/*
11479 	 * This value is written by the NIC such that it will be different
11480 	 * for each pass through the completion queue. The even passes
11481 	 * will write 1. The odd passes will write 0.
11482 	 */
11483 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_V	UINT32_C(0x1)
11484 	/* opaque is 7 b */
11485 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_MASK UINT32_C(0xfe)
11486 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_SFT 1
11487 	/* 8-lsb timestamp (100-msec resolution) */
11488 	uint8_t	timestamp_lo;
11489 	/* 16-lsb timestamp (100-msec resolution) */
11490 	uint16_t	timestamp_hi;
11491 	/* Event specific data */
11492 	uint32_t	event_data1;
11493 	/* Indicates to the driver the type of PHC event. */
11494 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_MASK	UINT32_C(0xf)
11495 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_SFT	0
11496 	/*
11497 	 * Indicates PHC Master selection event. The master fid is
11498 	 * specified in event_data2.phc_master_fid.
11499 	 */
11500 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_MASTER	UINT32_C(0x1)
11501 	/*
11502 	 * Indicates PHC Secondary selection event. The secondary fid is
11503 	 * specified in event_data2.phc_sec_fid.
11504 	 */
11505 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_SECONDARY   UINT32_C(0x2)
11506 	/*
11507 	 * Indicates PHC failover event. Failover happens from
11508 	 * event_data2.phc_master_fid to event_data2.phc_sec_fid.
11509 	 */
11510 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_FAILOVER	UINT32_C(0x3)
11511 	/*
11512 	 * Indicates that the 64bit Real time clock upper 16bits
11513 	 * have been updated due to PHC rollover. The updated
11514 	 * upper 16bits is in event_data1.phc_time_msb
11515 	 */
11516 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE  UINT32_C(0x4)
11517 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_LAST	HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE
11518 	/*
11519 	 * This field provides the upper 16bits of the 64bit real
11520 	 * time clock.
11521 	 */
11522 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_MASK   UINT32_C(0xffff0)
11523 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_SFT	4
11524 } hwrm_async_event_cmpl_phc_update_t, *phwrm_async_event_cmpl_phc_update_t;
11525 
11526 /* hwrm_async_event_cmpl_pps_timestamp (size:128b/16B) */
11527 
11528 typedef struct hwrm_async_event_cmpl_pps_timestamp {
11529 	uint16_t	type;
11530 	/*
11531 	 * This field indicates the exact type of the completion.
11532 	 * By convention, the LSB identifies the length of the
11533 	 * record in 16B units. Even values indicate 16B
11534 	 * records. Odd values indicate 32B
11535 	 * records.
11536 	 */
11537 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_MASK		UINT32_C(0x3f)
11538 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_SFT		0
11539 	/* HWRM Asynchronous Event Information */
11540 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11541 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT
11542 	/* Identifiers of events. */
11543 	uint16_t	event_id;
11544 	/*
11545 	 * This async notification message can be used to inform
11546 	 * driver of the latest PPS timestamp that has been latched.
11547 	 * When driver enables PPS event, Firmware will generate
11548 	 * PPS timestamps every second, Firmware informs driver
11549 	 * of this timestamp through the async event.
11550 	 */
11551 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP UINT32_C(0x44)
11552 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP
11553 	/* Event specific data */
11554 	uint32_t	event_data2;
11555 	/* Indicates the PPS event type */
11556 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE		UINT32_C(0x1)
11557 	/* This is an internal event. */
11558 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_INTERNAL	UINT32_C(0x0)
11559 	/* This is an external event. */
11560 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL	UINT32_C(0x1)
11561 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL
11562 	/*
11563 	 * Indicates the pin number on which the event is
11564 	 * received.
11565 	 */
11566 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_MASK	UINT32_C(0xe)
11567 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_SFT	1
11568 	/*
11569 	 * Contains bits[47:32] of the upper PPS timestamp.
11570 	 * Lower 32 bits are in event_data1. Together they
11571 	 * provide the 48 bit PPS timestamp.
11572 	 */
11573 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_MASK UINT32_C(0xffff0)
11574 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_SFT 4
11575 	uint8_t	opaque_v;
11576 	/*
11577 	 * This value is written by the NIC such that it will be different
11578 	 * for each pass through the completion queue. The even passes
11579 	 * will write 1. The odd passes will write 0.
11580 	 */
11581 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_V	UINT32_C(0x1)
11582 	/* opaque is 7 b */
11583 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_MASK UINT32_C(0xfe)
11584 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_SFT 1
11585 	/* 8-lsb timestamp (100-msec resolution) */
11586 	uint8_t	timestamp_lo;
11587 	/* 16-lsb timestamp (100-msec resolution) */
11588 	uint16_t	timestamp_hi;
11589 	/* Contains the lower 32 bits of the PPS timestamp. */
11590 	uint32_t	event_data1;
11591 	/* Contains the lower 32 bit PPS timestamp */
11592 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_MASK UINT32_C(0xffffffff)
11593 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_SFT 0
11594 } hwrm_async_event_cmpl_pps_timestamp_t, *phwrm_async_event_cmpl_pps_timestamp_t;
11595 
11596 /* hwrm_async_event_cmpl_error_report (size:128b/16B) */
11597 
11598 typedef struct hwrm_async_event_cmpl_error_report {
11599 	uint16_t	type;
11600 	/*
11601 	 * This field indicates the exact type of the completion.
11602 	 * By convention, the LSB identifies the length of the
11603 	 * record in 16B units. Even values indicate 16B
11604 	 * records. Odd values indicate 32B
11605 	 * records.
11606 	 */
11607 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_MASK		UINT32_C(0x3f)
11608 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_SFT		0
11609 	/* HWRM Asynchronous Event Information */
11610 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11611 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT
11612 	/* Identifiers of events. */
11613 	uint16_t	event_id;
11614 	/*
11615 	 * This async notification message is used to inform
11616 	 * the driver that an error has occurred which may need
11617 	 * the attention of the administrator.
11618 	 */
11619 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
11620 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT
11621 	/* Event specific data. */
11622 	uint32_t	event_data2;
11623 	uint8_t	opaque_v;
11624 	/*
11625 	 * This value is written by the NIC such that it will be different
11626 	 * for each pass through the completion queue. The even passes
11627 	 * will write 1. The odd passes will write 0.
11628 	 */
11629 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_V	UINT32_C(0x1)
11630 	/* opaque is 7 b */
11631 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_MASK UINT32_C(0xfe)
11632 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_SFT 1
11633 	/* 8-lsb timestamp (100-msec resolution) */
11634 	uint8_t	timestamp_lo;
11635 	/* 16-lsb timestamp (100-msec resolution) */
11636 	uint16_t	timestamp_hi;
11637 	/* Event specific data */
11638 	uint32_t	event_data1;
11639 	/*
11640 	 * Indicates the type of error being reported. See section on Error
11641 	 * Report event error_types for details on each error.
11642 	 */
11643 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_MASK UINT32_C(0xff)
11644 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_SFT 0
11645 } hwrm_async_event_cmpl_error_report_t, *phwrm_async_event_cmpl_error_report_t;
11646 
11647 /* hwrm_async_event_cmpl_doorbell_pacing_threshold (size:128b/16B) */
11648 
11649 typedef struct hwrm_async_event_cmpl_doorbell_pacing_threshold {
11650 	uint16_t	type;
11651 	/*
11652 	 * This field indicates the exact type of the completion.
11653 	 * By convention, the LSB identifies the length of the
11654 	 * record in 16B units. Even values indicate 16B
11655 	 * records. Odd values indicate 32B
11656 	 * records.
11657 	 */
11658 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_MASK		UINT32_C(0x3f)
11659 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_SFT		0
11660 	/* HWRM Asynchronous Event Information */
11661 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11662 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT
11663 	/* Identifiers of events. */
11664 	uint16_t	event_id;
11665 	/*
11666 	 * This async notification message is used to inform the driver
11667 	 * that the programmable pacing threshold for the doorbell FIFO is
11668 	 * reached. The driver will take appropriate action to pace the
11669 	 * doorbells when this async event is received from the firmware.
11670 	 */
11671 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD UINT32_C(0x46)
11672 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD
11673 	/* Event specific data. */
11674 	uint32_t	event_data2;
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_DOORBELL_PACING_THRESHOLD_V	UINT32_C(0x1)
11682 	/* opaque is 7 b */
11683 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_MASK UINT32_C(0xfe)
11684 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_SFT 1
11685 	/* 8-lsb timestamp (100-msec resolution) */
11686 	uint8_t	timestamp_lo;
11687 	/* 16-lsb timestamp (100-msec resolution) */
11688 	uint16_t	timestamp_hi;
11689 	/* Event specific data */
11690 	uint32_t	event_data1;
11691 } hwrm_async_event_cmpl_doorbell_pacing_threshold_t, *phwrm_async_event_cmpl_doorbell_pacing_threshold_t;
11692 
11693 /* hwrm_async_event_cmpl_rss_change (size:128b/16B) */
11694 
11695 typedef struct hwrm_async_event_cmpl_rss_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_RSS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11705 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_SFT		0
11706 	/* HWRM Asynchronous Event Information */
11707 		#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11708 		#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_HWRM_ASYNC_EVENT
11709 	/* Identifiers of events. */
11710 	uint16_t	event_id;
11711 	/*
11712 	 * This async notification message is used to inform the driver
11713 	 * that the RSS capabilities have changed. The driver will need
11714 	 * to query hwrm_vnic_qcaps.
11715 	 */
11716 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_RSS_CHANGE UINT32_C(0x47)
11717 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_RSS_CHANGE
11718 	/* Event specific data. */
11719 	uint32_t	event_data2;
11720 	uint8_t	opaque_v;
11721 	/*
11722 	 * This value is written by the NIC such that it will be different
11723 	 * for each pass through the completion queue. The even passes
11724 	 * will write 1. The odd passes will write 0.
11725 	 */
11726 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_V	UINT32_C(0x1)
11727 	/* opaque is 7 b */
11728 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11729 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_OPAQUE_SFT 1
11730 	/* 8-lsb timestamp (100-msec resolution) */
11731 	uint8_t	timestamp_lo;
11732 	/* 16-lsb timestamp (100-msec resolution) */
11733 	uint16_t	timestamp_hi;
11734 	/* Event specific data */
11735 	uint32_t	event_data1;
11736 } hwrm_async_event_cmpl_rss_change_t, *phwrm_async_event_cmpl_rss_change_t;
11737 
11738 /* hwrm_async_event_cmpl_doorbell_pacing_nq_update (size:128b/16B) */
11739 
11740 typedef struct hwrm_async_event_cmpl_doorbell_pacing_nq_update {
11741 	uint16_t	type;
11742 	/*
11743 	 * This field indicates the exact type of the completion.
11744 	 * By convention, the LSB identifies the length of the
11745 	 * record in 16B units. Even values indicate 16B
11746 	 * records. Odd values indicate 32B
11747 	 * records.
11748 	 */
11749 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_MASK		UINT32_C(0x3f)
11750 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_SFT		0
11751 	/* HWRM Asynchronous Event Information */
11752 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11753 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_HWRM_ASYNC_EVENT
11754 	/* Identifiers of events. */
11755 	uint16_t	event_id;
11756 	/*
11757 	 * An event from firmware indicating that list of nq ids used for
11758 	 * doorbell pacing DBQ event notification has been updated. The driver
11759 	 * needs to take appropriate action and retrieve the new list when this
11760 	 * event is received from the firmware.
11761 	 */
11762 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_EVENT_ID_DOORBELL_PACING_NQ_UPDATE UINT32_C(0x48)
11763 	#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
11764 	/* Event specific data. */
11765 	uint32_t	event_data2;
11766 	uint8_t	opaque_v;
11767 	/*
11768 	 * This value is written by the NIC such that it will be different
11769 	 * for each pass through the completion queue. The even passes
11770 	 * will write 1. The odd passes will write 0.
11771 	 */
11772 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_V	UINT32_C(0x1)
11773 	/* opaque is 7 b */
11774 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_OPAQUE_MASK UINT32_C(0xfe)
11775 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_OPAQUE_SFT 1
11776 	/* 8-lsb timestamp (100-msec resolution) */
11777 	uint8_t	timestamp_lo;
11778 	/* 16-lsb timestamp (100-msec resolution) */
11779 	uint16_t	timestamp_hi;
11780 	/* Event specific data */
11781 	uint32_t	event_data1;
11782 } hwrm_async_event_cmpl_doorbell_pacing_nq_update_t, *phwrm_async_event_cmpl_doorbell_pacing_nq_update_t;
11783 
11784 /* hwrm_async_event_cmpl_hw_doorbell_recovery_read_error (size:128b/16B) */
11785 
11786 typedef struct hwrm_async_event_cmpl_hw_doorbell_recovery_read_error {
11787 	uint16_t	type;
11788 	/*
11789 	 * This field indicates the exact type of the completion.
11790 	 * By convention, the LSB identifies the length of the
11791 	 * record in 16B units. Even values indicate 16B
11792 	 * records. Odd values indicate 32B
11793 	 * records.
11794 	 */
11795 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_MASK		UINT32_C(0x3f)
11796 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_SFT		0
11797 	/* HWRM Asynchronous Event Information */
11798 		#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11799 		#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
11800 	/* Identifiers of events. */
11801 	uint16_t	event_id;
11802 	/*
11803 	 * This async notification message is used to inform the driver
11804 	 * that hardware ran into an error while trying to read the host
11805 	 * based doorbell copy region. The driver will take the appropriate
11806 	 * action to maintain the corresponding functions doorbell copy
11807 	 * region in the correct format.
11808 	 */
11809 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR UINT32_C(0x49)
11810 	#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
11811 	/* Event specific data. */
11812 	uint32_t	event_data2;
11813 	uint8_t	opaque_v;
11814 	/*
11815 	 * This value is written by the NIC such that it will be different
11816 	 * for each pass through the completion queue. The even passes
11817 	 * will write 1. The odd passes will write 0.
11818 	 */
11819 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_V	UINT32_C(0x1)
11820 	/* opaque is 7 b */
11821 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_OPAQUE_MASK UINT32_C(0xfe)
11822 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_OPAQUE_SFT 1
11823 	/* 8-lsb timestamp (100-msec resolution) */
11824 	uint8_t	timestamp_lo;
11825 	/* 16-lsb timestamp (100-msec resolution) */
11826 	uint16_t	timestamp_hi;
11827 	/* Event specific data */
11828 	uint32_t	event_data1;
11829 	/*
11830 	 * Indicates that there is an error while reading the doorbell copy
11831 	 * regions.
11832 	 */
11833 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_MASK	UINT32_C(0xf)
11834 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SFT	0
11835 	/*
11836 	 * If set to 1, indicates that there is an error while reading the
11837 	 * SQ doorbell copy region for this function.
11838 	 */
11839 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SQ_ERR	UINT32_C(0x1)
11840 	/*
11841 	 * If set to 1, indicates that there is an error while reading the
11842 	 * RQ doorbell copy region for this function.
11843 	 */
11844 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_RQ_ERR	UINT32_C(0x2)
11845 	/*
11846 	 * If set to 1, indicates that there is an error while reading the
11847 	 * SRQ doorbell copy region for this function.
11848 	 */
11849 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SRQ_ERR	UINT32_C(0x4)
11850 	/*
11851 	 * If set to 1, indicates that there is an error while reading the
11852 	 * CQ doorbell copy region for this function.
11853 	 */
11854 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_CQ_ERR	UINT32_C(0x8)
11855 } hwrm_async_event_cmpl_hw_doorbell_recovery_read_error_t, *phwrm_async_event_cmpl_hw_doorbell_recovery_read_error_t;
11856 
11857 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
11858 
11859 typedef struct hwrm_async_event_cmpl_fw_trace_msg {
11860 	uint16_t	type;
11861 	/*
11862 	 * This field indicates the exact type of the completion.
11863 	 * By convention, the LSB identifies the length of the
11864 	 * record in 16B units. Even values indicate 16B
11865 	 * records. Odd values indicate 32B
11866 	 * records.
11867 	 */
11868 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK		UINT32_C(0x3f)
11869 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT		0
11870 	/* HWRM Asynchronous Event Information */
11871 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11872 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
11873 	/* Identifiers of events. */
11874 	uint16_t	event_id;
11875 	/* Firmware trace log message */
11876 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG UINT32_C(0xfe)
11877 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
11878 	/* Trace byte 0 to 3 */
11879 	uint32_t	event_data2;
11880 	/* Trace byte0 */
11881 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK UINT32_C(0xff)
11882 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
11883 	/* Trace byte1 */
11884 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK UINT32_C(0xff00)
11885 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
11886 	/* Trace byte2 */
11887 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK UINT32_C(0xff0000)
11888 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
11889 	/* Trace byte3 */
11890 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK UINT32_C(0xff000000)
11891 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
11892 	uint8_t	opaque_v;
11893 	/*
11894 	 * This value is written by the NIC such that it will be different
11895 	 * for each pass through the completion queue. The even passes
11896 	 * will write 1. The odd passes will write 0.
11897 	 */
11898 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V	UINT32_C(0x1)
11899 	/* opaque is 7 b */
11900 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
11901 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
11902 	/* Trace flags */
11903 	uint8_t	timestamp_lo;
11904 	/* Indicates if the string is partial or complete. */
11905 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING		UINT32_C(0x1)
11906 	/* Complete string */
11907 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE	UINT32_C(0x0)
11908 	/* Partial string */
11909 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL	UINT32_C(0x1)
11910 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
11911 	/* Indicates the firmware that sent the trace message. */
11912 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE	UINT32_C(0x2)
11913 	/* Primary firmware */
11914 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY	(UINT32_C(0x0) << 1)
11915 	/* Secondary firmware */
11916 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY  (UINT32_C(0x1) << 1)
11917 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
11918 	/* Trace byte 4 to 5 */
11919 	uint16_t	timestamp_hi;
11920 	/* Trace byte4 */
11921 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK UINT32_C(0xff)
11922 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
11923 	/* Trace byte5 */
11924 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK UINT32_C(0xff00)
11925 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
11926 	/* Trace byte 6 to 9 */
11927 	uint32_t	event_data1;
11928 	/* Trace byte6 */
11929 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK UINT32_C(0xff)
11930 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
11931 	/* Trace byte7 */
11932 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK UINT32_C(0xff00)
11933 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
11934 	/* Trace byte8 */
11935 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK UINT32_C(0xff0000)
11936 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
11937 	/* Trace byte9 */
11938 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK UINT32_C(0xff000000)
11939 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
11940 } hwrm_async_event_cmpl_fw_trace_msg_t, *phwrm_async_event_cmpl_fw_trace_msg_t;
11941 
11942 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
11943 
11944 typedef struct hwrm_async_event_cmpl_hwrm_error {
11945 	uint16_t	type;
11946 	/*
11947 	 * This field indicates the exact type of the completion.
11948 	 * By convention, the LSB identifies the length of the
11949 	 * record in 16B units. Even values indicate 16B
11950 	 * records. Odd values indicate 32B
11951 	 * records.
11952 	 */
11953 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK		UINT32_C(0x3f)
11954 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT		0
11955 	/* HWRM Asynchronous Event Information */
11956 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11957 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
11958 	/* Identifiers of events. */
11959 	uint16_t	event_id;
11960 	/* HWRM Error */
11961 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
11962 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
11963 	/* Event specific data */
11964 	uint32_t	event_data2;
11965 	/* Severity of HWRM Error */
11966 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK	UINT32_C(0xff)
11967 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT	0
11968 	/* Warning */
11969 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING   UINT32_C(0x0)
11970 	/* Non-fatal Error */
11971 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL  UINT32_C(0x1)
11972 	/* Fatal Error */
11973 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL	UINT32_C(0x2)
11974 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST	HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
11975 	uint8_t	opaque_v;
11976 	/*
11977 	 * This value is written by the NIC such that it will be different
11978 	 * for each pass through the completion queue. The even passes
11979 	 * will write 1. The odd passes will write 0.
11980 	 */
11981 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V	UINT32_C(0x1)
11982 	/* opaque is 7 b */
11983 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
11984 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
11985 	/* 8-lsb timestamp from POR (100-msec resolution) */
11986 	uint8_t	timestamp_lo;
11987 	/* 16-lsb timestamp from POR (100-msec resolution) */
11988 	uint16_t	timestamp_hi;
11989 	/* Event specific data */
11990 	uint32_t	event_data1;
11991 	/* Time stamp for error event */
11992 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP	UINT32_C(0x1)
11993 } hwrm_async_event_cmpl_hwrm_error_t, *phwrm_async_event_cmpl_hwrm_error_t;
11994 
11995 /* hwrm_async_event_cmpl_error_report_base (size:128b/16B) */
11996 
11997 typedef struct hwrm_async_event_cmpl_error_report_base {
11998 	uint16_t	type;
11999 	/*
12000 	 * This field indicates the exact type of the completion.
12001 	 * By convention, the LSB identifies the length of the
12002 	 * record in 16B units. Even values indicate 16B
12003 	 * records. Odd values indicate 32B
12004 	 * records.
12005 	 */
12006 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_MASK		UINT32_C(0x3f)
12007 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_SFT		0
12008 	/* HWRM Asynchronous Event Information */
12009 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12010 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT
12011 	/* Identifiers of events. */
12012 	uint16_t	event_id;
12013 	/*
12014 	 * This async notification message is used to inform
12015 	 * the driver that an error has occurred which may need
12016 	 * the attention of the administrator.
12017 	 */
12018 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12019 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT
12020 	/* Event specific data. */
12021 	uint32_t	event_data2;
12022 	uint8_t	opaque_v;
12023 	/*
12024 	 * This value is written by the NIC such that it will be different
12025 	 * for each pass through the completion queue. The even passes
12026 	 * will write 1. The odd passes will write 0.
12027 	 */
12028 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_V	UINT32_C(0x1)
12029 	/* opaque is 7 b */
12030 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_MASK UINT32_C(0xfe)
12031 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_SFT 1
12032 	/* 8-lsb timestamp (100-msec resolution) */
12033 	uint8_t	timestamp_lo;
12034 	/* 16-lsb timestamp (100-msec resolution) */
12035 	uint16_t	timestamp_hi;
12036 	/* Event specific data */
12037 	uint32_t	event_data1;
12038 	/* Indicates the type of error being reported. */
12039 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK		UINT32_C(0xff)
12040 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT			0
12041 	/* Reserved */
12042 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_RESERVED		UINT32_C(0x0)
12043 	/*
12044 	 * The NIC was subjected to an extended pause storm which caused it
12045 	 * to disable flow control in order to avoid stalling the Tx path.
12046 	 */
12047 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM		UINT32_C(0x1)
12048 	/*
12049 	 * The NIC received an interrupt storm on a TSIO pin being used as
12050 	 * PPS_IN which caused it to disable the interrupt. The signal
12051 	 * should be fixed to be a proper 1 PPS signal before re-enabling
12052 	 * it. The pin number on which this signal was received is stored
12053 	 * in event_data2 as pin_id.
12054 	 */
12055 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL	UINT32_C(0x2)
12056 	/*
12057 	 * There was a low level error with an NVM write or erase.
12058 	 * See nvm_err_type for more details.
12059 	 */
12060 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM			UINT32_C(0x3)
12061 	/*
12062 	 * This indicates doorbell drop threshold was hit. When this
12063 	 * threshold is crossed, it indicates one or more doorbells for
12064 	 * the function were dropped by hardware.
12065 	 */
12066 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD  UINT32_C(0x4)
12067 	/*
12068 	 * Indicates the NIC's temperature has crossed one of the thermal
12069 	 * thresholds.
12070 	 */
12071 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD	UINT32_C(0x5)
12072 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST			HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD
12073 } hwrm_async_event_cmpl_error_report_base_t, *phwrm_async_event_cmpl_error_report_base_t;
12074 
12075 #define GET_ERROR_REPORT_TYPE(x) \
12076 	(((x) < 0x80) ? \
12077 	((x) == 0x0 ? "RESERVED": \
12078 	((x) == 0x1 ? "PAUSE_STORM": \
12079 	((x) == 0x2 ? "INVALID_SIGNAL": \
12080 	((x) == 0x3 ? "NVM": \
12081 	((x) == 0x4 ? "DOORBELL_DROP_THRESHOLD": \
12082 	((x) == 0x5 ? "THERMAL_THRESHOLD": \
12083 	"Unknown decode" )))))) : \
12084 	"Unknown decode" )
12085 
12086 
12087 /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
12088 
12089 typedef struct hwrm_async_event_cmpl_error_report_pause_storm {
12090 	uint16_t	type;
12091 	/*
12092 	 * This field indicates the exact type of the completion.
12093 	 * By convention, the LSB identifies the length of the
12094 	 * record in 16B units. Even values indicate 16B
12095 	 * records. Odd values indicate 32B
12096 	 * records.
12097 	 */
12098 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_MASK		UINT32_C(0x3f)
12099 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_SFT		0
12100 	/* HWRM Asynchronous Event Information */
12101 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12102 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT
12103 	/* Identifiers of events. */
12104 	uint16_t	event_id;
12105 	/*
12106 	 * This async notification message is used to inform
12107 	 * the driver that an error has occurred which may need
12108 	 * the attention of the administrator.
12109 	 */
12110 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12111 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT
12112 	/* Event specific data. */
12113 	uint32_t	event_data2;
12114 	uint8_t	opaque_v;
12115 	/*
12116 	 * This value is written by the NIC such that it will be different
12117 	 * for each pass through the completion queue. The even passes
12118 	 * will write 1. The odd passes will write 0.
12119 	 */
12120 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_V	UINT32_C(0x1)
12121 	/* opaque is 7 b */
12122 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_MASK UINT32_C(0xfe)
12123 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_SFT 1
12124 	/* 8-lsb timestamp (100-msec resolution) */
12125 	uint8_t	timestamp_lo;
12126 	/* 16-lsb timestamp (100-msec resolution) */
12127 	uint16_t	timestamp_hi;
12128 	/* Event specific data */
12129 	uint32_t	event_data1;
12130 	/* Indicates the type of error being reported. */
12131 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12132 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_SFT	0
12133 	/*
12134 	 * The NIC was subjected to an extended pause storm which caused it
12135 	 * to disable flow control in order to avoid stalling the Tx path.
12136 	 */
12137 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM  UINT32_C(0x1)
12138 		#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
12139 } hwrm_async_event_cmpl_error_report_pause_storm_t, *phwrm_async_event_cmpl_error_report_pause_storm_t;
12140 
12141 /* hwrm_async_event_cmpl_error_report_invalid_signal (size:128b/16B) */
12142 
12143 typedef struct hwrm_async_event_cmpl_error_report_invalid_signal {
12144 	uint16_t	type;
12145 	/*
12146 	 * This field indicates the exact type of the completion.
12147 	 * By convention, the LSB identifies the length of the
12148 	 * record in 16B units. Even values indicate 16B
12149 	 * records. Odd values indicate 32B
12150 	 * records.
12151 	 */
12152 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_MASK		UINT32_C(0x3f)
12153 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_SFT		0
12154 	/* HWRM Asynchronous Event Information */
12155 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12156 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT
12157 	/* Identifiers of events. */
12158 	uint16_t	event_id;
12159 	/*
12160 	 * This async notification message is used to inform
12161 	 * the driver that an error has occurred which may need
12162 	 * the attention of the administrator.
12163 	 */
12164 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12165 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT
12166 	/* Event specific data. */
12167 	uint32_t	event_data2;
12168 	/* Indicates the TSIO pin on which invalid signal is detected. */
12169 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_MASK UINT32_C(0xff)
12170 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_SFT 0
12171 	uint8_t	opaque_v;
12172 	/*
12173 	 * This value is written by the NIC such that it will be different
12174 	 * for each pass through the completion queue. The even passes
12175 	 * will write 1. The odd passes will write 0.
12176 	 */
12177 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_V	UINT32_C(0x1)
12178 	/* opaque is 7 b */
12179 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_MASK UINT32_C(0xfe)
12180 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_SFT 1
12181 	/* 8-lsb timestamp (100-msec resolution) */
12182 	uint8_t	timestamp_lo;
12183 	/* 16-lsb timestamp (100-msec resolution) */
12184 	uint16_t	timestamp_hi;
12185 	/* Event specific data */
12186 	uint32_t	event_data1;
12187 	/* Indicates the type of error being reported. */
12188 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12189 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_SFT	0
12190 	/*
12191 	 * The NIC received an interrupt storm on a TSIO pin being used as
12192 	 * PPS_IN which caused it to disable the interrupt. The signal
12193 	 * should be fixed to be a proper 1 PPS signal before re-enabling
12194 	 * it. The pin number on which this signal was received is stored
12195 	 * in event_data2 as pin_id.
12196 	 */
12197 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL  UINT32_C(0x2)
12198 		#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
12199 } hwrm_async_event_cmpl_error_report_invalid_signal_t, *phwrm_async_event_cmpl_error_report_invalid_signal_t;
12200 
12201 /* hwrm_async_event_cmpl_error_report_nvm (size:128b/16B) */
12202 
12203 typedef struct hwrm_async_event_cmpl_error_report_nvm {
12204 	uint16_t	type;
12205 	/*
12206 	 * This field indicates the exact type of the completion.
12207 	 * By convention, the LSB identifies the length of the
12208 	 * record in 16B units. Even values indicate 16B
12209 	 * records. Odd values indicate 32B
12210 	 * records.
12211 	 */
12212 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_MASK		UINT32_C(0x3f)
12213 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_SFT		0
12214 	/* HWRM Asynchronous Event Information */
12215 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12216 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT
12217 	/* Identifiers of events. */
12218 	uint16_t	event_id;
12219 	/*
12220 	 * This async notification message is used to inform
12221 	 * the driver that an error has occurred which may need
12222 	 * the attention of the administrator.
12223 	 */
12224 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12225 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT
12226 	/* Event specific data. */
12227 	uint32_t	event_data2;
12228 	/* Indicates the address where error was detected */
12229 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_MASK UINT32_C(0xffffffff)
12230 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_SFT 0
12231 	uint8_t	opaque_v;
12232 	/*
12233 	 * This value is written by the NIC such that it will be different
12234 	 * for each pass through the completion queue. The even passes
12235 	 * will write 1. The odd passes will write 0.
12236 	 */
12237 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_V	UINT32_C(0x1)
12238 	/* opaque is 7 b */
12239 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_MASK UINT32_C(0xfe)
12240 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_SFT 1
12241 	/* 8-lsb timestamp (100-msec resolution) */
12242 	uint8_t	timestamp_lo;
12243 	/* 16-lsb timestamp (100-msec resolution) */
12244 	uint16_t	timestamp_hi;
12245 	/* Event specific data */
12246 	uint32_t	event_data1;
12247 	/* Indicates the type of error being reported. */
12248 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12249 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_SFT	0
12250 	/*
12251 	 * There was a low level error with an NVM operation.
12252 	 * See nvm_err_type for more details.
12253 	 */
12254 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_NVM_ERROR  UINT32_C(0x3)
12255 		#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
12256 	/* The specific type of NVM error */
12257 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_MASK   UINT32_C(0xff00)
12258 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_SFT	8
12259 	/*
12260 	 * There was a low level error with an NVM write operation.
12261 	 * Verification of written data did not match.
12262 	 * event_data2 will be the failing address.
12263 	 */
12264 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_WRITE	(UINT32_C(0x1) << 8)
12265 	/*
12266 	 * There was a low level error with an NVM erase operation.
12267 	 * All the bits were not erased.
12268 	 * event_data2 will be the failing address.
12269 	 */
12270 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE	(UINT32_C(0x2) << 8)
12271 		#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
12272 } hwrm_async_event_cmpl_error_report_nvm_t, *phwrm_async_event_cmpl_error_report_nvm_t;
12273 
12274 /* hwrm_async_event_cmpl_error_report_doorbell_drop_threshold (size:128b/16B) */
12275 
12276 typedef struct hwrm_async_event_cmpl_error_report_doorbell_drop_threshold {
12277 	uint16_t	type;
12278 	/*
12279 	 * This field indicates the exact type of the completion.
12280 	 * By convention, the LSB identifies the length of the
12281 	 * record in 16B units. Even values indicate 16B
12282 	 * records. Odd values indicate 32B
12283 	 * records.
12284 	 */
12285 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_MASK		UINT32_C(0x3f)
12286 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_SFT		0
12287 	/* HWRM Asynchronous Event Information */
12288 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12289 		#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
12290 	/* Identifiers of events. */
12291 	uint16_t	event_id;
12292 	/*
12293 	 * This async notification message is used to inform
12294 	 * the driver that an error has occurred which may need
12295 	 * the attention of the administrator.
12296 	 */
12297 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12298 	#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
12299 	/* Event specific data. */
12300 	uint32_t	event_data2;
12301 	uint8_t	opaque_v;
12302 	/*
12303 	 * This value is written by the NIC such that it will be different
12304 	 * for each pass through the completion queue. The even passes
12305 	 * will write 1. The odd passes will write 0.
12306 	 */
12307 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_V	UINT32_C(0x1)
12308 	/* opaque is 7 b */
12309 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_MASK UINT32_C(0xfe)
12310 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_SFT 1
12311 	/* 8-lsb timestamp (100-msec resolution) */
12312 	uint8_t	timestamp_lo;
12313 	/* 16-lsb timestamp (100-msec resolution) */
12314 	uint16_t	timestamp_hi;
12315 	/* Event specific data */
12316 	uint32_t	event_data1;
12317 	/* Indicates the type of error being reported. */
12318 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_MASK		UINT32_C(0xff)
12319 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_SFT			0
12320 	/*
12321 	 * This indicates doorbell drop threshold was hit. When this
12322 	 * threshold is crossed, it indicates one or more doorbells for
12323 	 * the function were dropped by hardware.
12324 	 */
12325 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD  UINT32_C(0x4)
12326 		#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
12327 	/*
12328 	 * The epoch value to be sent from firmware to the driver to track
12329 	 * a doorbell recovery cycle.
12330 	 */
12331 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_MASK			UINT32_C(0xffffff00)
12332 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_SFT			8
12333 } hwrm_async_event_cmpl_error_report_doorbell_drop_threshold_t, *phwrm_async_event_cmpl_error_report_doorbell_drop_threshold_t;
12334 
12335 /* hwrm_async_event_cmpl_error_report_thermal (size:128b/16B) */
12336 
12337 typedef struct hwrm_async_event_cmpl_error_report_thermal {
12338 	uint16_t	type;
12339 	/*
12340 	 * This field indicates the exact type of the completion.
12341 	 * By convention, the LSB identifies the length of the
12342 	 * record in 16B units. Even values indicate 16B
12343 	 * records. Odd values indicate 32B
12344 	 * records.
12345 	 */
12346 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_MASK		UINT32_C(0x3f)
12347 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_SFT		0
12348 	/* HWRM Asynchronous Event Information */
12349 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12350 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT
12351 	/* Identifiers of events. */
12352 	uint16_t	event_id;
12353 	/*
12354 	 * This async notification message is used to inform
12355 	 * the driver that an error has occurred which may need
12356 	 * the attention of the administrator.
12357 	 */
12358 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12359 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT
12360 	/* Event specific data. */
12361 	uint32_t	event_data2;
12362 	/* Current temperature.  In Celsius */
12363 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK  UINT32_C(0xff)
12364 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_SFT   0
12365 	/*
12366 	 * The temperature setting of the threshold that was just crossed.
12367 	 * In Celsius
12368 	 */
12369 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK UINT32_C(0xff00)
12370 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT 8
12371 	uint8_t	opaque_v;
12372 	/*
12373 	 * This value is written by the NIC such that it will be different
12374 	 * for each pass through the completion queue. The even passes
12375 	 * will write 1. The odd passes will write 0.
12376 	 */
12377 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_V	UINT32_C(0x1)
12378 	/* opaque is 7 b */
12379 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_MASK UINT32_C(0xfe)
12380 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_SFT 1
12381 	/* 8-lsb timestamp (100-msec resolution) */
12382 	uint8_t	timestamp_lo;
12383 	/* 16-lsb timestamp (100-msec resolution) */
12384 	uint16_t	timestamp_hi;
12385 	/* Event specific data */
12386 	uint32_t	event_data1;
12387 	/* Indicates the type of error being reported. */
12388 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12389 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_SFT	0
12390 	/*
12391 	 * There was thermal event. The type will be specified in the
12392 	 * field threshold_type. event_data2 will contain the current
12393 	 * temperature and the configured value for the threshold that
12394 	 * was just crossed. The threshold values are lower thresholds,
12395 	 * so the event will trigger with an active flag when the
12396 	 * temperature is on an increasing trajectory.
12397 	 */
12398 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT   UINT32_C(0x5)
12399 		#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
12400 	/* The specific type of thermal threshold error */
12401 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK	UINT32_C(0x700)
12402 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SFT	8
12403 	/* Warning thermal threshold was crossed */
12404 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN	(UINT32_C(0x0) << 8)
12405 	/* Critical thermal threshold was crossed */
12406 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL	(UINT32_C(0x1) << 8)
12407 	/* Fatal thermal threshold was crossed */
12408 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL	(UINT32_C(0x2) << 8)
12409 	/*
12410 	 * Thermal shutdown threshold was crossed and a shutdown is
12411 	 * imminent. This event will not occur if self shutdown
12412 	 * is disabled.
12413 	 */
12414 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN	(UINT32_C(0x3) << 8)
12415 		#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
12416 	/*
12417 	 * Indicates if the thermal crossing occurs while the temperature is
12418 	 * increasing or decreasing.
12419 	 */
12420 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR	UINT32_C(0x800)
12421 	/* Threshold is crossed while the temperature is falling. */
12422 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_DECREASING  (UINT32_C(0x0) << 11)
12423 	/* Threshold is crossed while the temperature is rising. */
12424 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING  (UINT32_C(0x1) << 11)
12425 		#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
12426 } hwrm_async_event_cmpl_error_report_thermal_t, *phwrm_async_event_cmpl_error_report_thermal_t;
12427 
12428 /* metadata_base_msg (size:64b/8B) */
12429 
12430 typedef struct metadata_base_msg {
12431 	uint16_t	md_type_link;
12432 	/* This field classifies the data present in the meta-data. */
12433 	#define METADATA_BASE_MSG_MD_TYPE_MASK	UINT32_C(0x1f)
12434 	#define METADATA_BASE_MSG_MD_TYPE_SFT	0
12435 	/* Meta data fields are not valid */
12436 		#define METADATA_BASE_MSG_MD_TYPE_NONE	UINT32_C(0x0)
12437 	/*
12438 	 * This setting is used when packets are coming in-order. Depending on
12439 	 * the state of the receive context, the meta-data will carry
12440 	 * different information.
12441 	 */
12442 		#define METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC  UINT32_C(0x1)
12443 	/*
12444 	 * With this setting HW passes the TCP sequence number of the TLS
12445 	 * record that it is requesting a resync on in the meta data.
12446 	 */
12447 		#define METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC  UINT32_C(0x2)
12448 	/* This setting is used for QUIC packets. */
12449 		#define METADATA_BASE_MSG_MD_TYPE_QUIC	UINT32_C(0x3)
12450 	/*
12451 	 * This setting is used for crypto packets with an unsupported
12452 	 * protocol.
12453 	 */
12454 		#define METADATA_BASE_MSG_MD_TYPE_ILLEGAL	UINT32_C(0x1f)
12455 		#define METADATA_BASE_MSG_MD_TYPE_LAST	METADATA_BASE_MSG_MD_TYPE_ILLEGAL
12456 	/*
12457 	 * This field indicates where the next metadata block starts, relative
12458 	 * to the current metadata block. It is the offset to the next metadata
12459 	 * header, counted in 16B units. A value of zero indicates that there is
12460 	 * no additional metadata, and that the current metadata block is the
12461 	 * last one.
12462 	 */
12463 	#define METADATA_BASE_MSG_LINK_MASK	UINT32_C(0x1e0)
12464 	#define METADATA_BASE_MSG_LINK_SFT	5
12465 	uint16_t	unused0;
12466 	uint32_t	unused1;
12467 } metadata_base_msg_t, *pmetadata_base_msg_t;
12468 
12469 /* tls_metadata_base_msg (size:64b/8B) */
12470 
12471 typedef struct tls_metadata_base_msg {
12472 	uint32_t	md_type_link_flags_kid_lo;
12473 	/* This field classifies the data present in the meta-data. */
12474 	#define TLS_METADATA_BASE_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
12475 	#define TLS_METADATA_BASE_MSG_MD_TYPE_SFT				0
12476 	/*
12477 	 * This setting is used when packets are coming in-order. Depending
12478 	 * on the state of the receive context, the meta-data will carry
12479 	 * different information.
12480 	 */
12481 		#define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC				UINT32_C(0x1)
12482 	/*
12483 	 * With this setting HW passes the TCP sequence number of the TLS
12484 	 * record that it is requesting a resync on in the meta data.
12485 	 */
12486 		#define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC				UINT32_C(0x2)
12487 		#define TLS_METADATA_BASE_MSG_MD_TYPE_LAST				TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
12488 	/*
12489 	 * This field indicates where the next metadata block starts. It is
12490 	 * counted in 16B units. A value of zero indicates that there is no
12491 	 * metadata.
12492 	 */
12493 	#define TLS_METADATA_BASE_MSG_LINK_MASK					UINT32_C(0x1e0)
12494 	#define TLS_METADATA_BASE_MSG_LINK_SFT					5
12495 	/* These are flags present in the metadata. */
12496 	#define TLS_METADATA_BASE_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
12497 	#define TLS_METADATA_BASE_MSG_FLAGS_SFT					9
12498 	/*
12499 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
12500 	 * the packet is passed on as it came in on the wire.
12501 	 */
12502 	#define TLS_METADATA_BASE_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
12503 	/*
12504 	 * This field indicates the state of the ghash field passed in the
12505 	 * meta-data.
12506 	 */
12507 	#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
12508 	#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_SFT				10
12509 	/*
12510 	 * This enumeration states that the ghash is not valid in the
12511 	 * meta-data.
12512 	 */
12513 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
12514 	/*
12515 	 * This enumeration indicates that this pkt contains the record's
12516 	 * tag and this pkt was received ooo, the partial_ghash field
12517 	 * contains the ghash.
12518 	 */
12519 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_CUR_REC				(UINT32_C(0x1) << 10)
12520 	/*
12521 	 * This enumeration indicates that the current record's tag wasn't
12522 	 * seen and the chip is moving on to the next record, the
12523 	 * partial_ghash field contains the ghash.
12524 	 */
12525 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC			(UINT32_C(0x2) << 10)
12526 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_LAST				TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC
12527 	/* This field indicates the status of tag authentication. */
12528 	#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
12529 	#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
12530 	/*
12531 	 * This enumeration is set when HW was not able to authenticate a
12532 	 * TAG.
12533 	 */
12534 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
12535 	/*
12536 	 * This enumeration states that there is at least one tag in the
12537 	 * packet and every tag is valid.
12538 	 */
12539 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS		(UINT32_C(0x1) << 12)
12540 	/*
12541 	 * This enumeration states that there is at least one tag in the
12542 	 * packet and at least one of the tag is invalid. The entire packet
12543 	 * is sent decrypted to the host.
12544 	 */
12545 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE		(UINT32_C(0x2) << 12)
12546 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
12547 	/*
12548 	 * A value of 1 indicates that this packet contains a record that
12549 	 * starts in the packet and extends beyond the packet.
12550 	 */
12551 	#define TLS_METADATA_BASE_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
12552 	/*
12553 	 * A value of 1 indicates that the packet experienced a context load
12554 	 * error. In this case, the packet is sent to the host without the
12555 	 * header or payload decrypted and the context is not updated.
12556 	 */
12557 	#define TLS_METADATA_BASE_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
12558 	/* This field indicates the packet operation state. */
12559 	#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
12560 	#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
12561 	/* Packet is in order. */
12562 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
12563 	/* Packet is out of order, no header loss. */
12564 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
12565 	/* Packet is header search (out of order with header loss). */
12566 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
12567 	/* Packet is resync (resync record ongoing). */
12568 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
12569 	/*
12570 	 * Packet is resync wait (resync record completes, waiting for
12571 	 * result).
12572 	 */
12573 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
12574 	/*
12575 	 * Packet is resync wait for partial tag (waiting for resync record
12576 	 * tag).
12577 	 */
12578 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
12579 	/* Packet is resync success (got resync record success). */
12580 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
12581 	/*
12582 	 * Packet is resync success wait (got midpath ACK, waiting for
12583 	 * resync record success).
12584 	 */
12585 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
12586 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
12587 	/*
12588 	 * This value indicates the lower 7-bit of the Crypto Key ID
12589 	 * associated with this operation.
12590 	 */
12591 	#define TLS_METADATA_BASE_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
12592 	#define TLS_METADATA_BASE_MSG_KID_LO_SFT				25
12593 	uint16_t	kid_hi;
12594 	/*
12595 	 * This value indicates the upper 13-bit of the Crypto Key ID
12596 	 * associated with this operation.
12597 	 */
12598 	#define TLS_METADATA_BASE_MSG_KID_HI_MASK UINT32_C(0x1fff)
12599 	#define TLS_METADATA_BASE_MSG_KID_HI_SFT 0
12600 	uint16_t	unused0;
12601 } tls_metadata_base_msg_t, *ptls_metadata_base_msg_t;
12602 
12603 /* tls_metadata_insync_msg (size:192b/24B) */
12604 
12605 typedef struct tls_metadata_insync_msg {
12606 	uint32_t	md_type_link_flags_kid_lo;
12607 	/* This field classifies the data present in the meta-data. */
12608 	#define TLS_METADATA_INSYNC_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
12609 	#define TLS_METADATA_INSYNC_MSG_MD_TYPE_SFT				0
12610 	/*
12611 	 * This setting is used when packets are coming in-order. Depending on
12612 	 * the state of the receive context, the meta-data will carry
12613 	 * different information.
12614 	 */
12615 		#define TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC				UINT32_C(0x1)
12616 		#define TLS_METADATA_INSYNC_MSG_MD_TYPE_LAST				TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC
12617 	/*
12618 	 * This field indicates where the next metadata block starts. It is
12619 	 * counted in 16B units. A value of zero indicates that there is no
12620 	 * metadata.
12621 	 */
12622 	#define TLS_METADATA_INSYNC_MSG_LINK_MASK					UINT32_C(0x1e0)
12623 	#define TLS_METADATA_INSYNC_MSG_LINK_SFT					5
12624 	/* These are flags present in the metadata. */
12625 	#define TLS_METADATA_INSYNC_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
12626 	#define TLS_METADATA_INSYNC_MSG_FLAGS_SFT					9
12627 	/*
12628 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
12629 	 * the packet is passed on as it came in on the wire.
12630 	 */
12631 	#define TLS_METADATA_INSYNC_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
12632 	/*
12633 	 * This field indicates the state of the ghash field passed in the
12634 	 * meta-data.
12635 	 */
12636 	#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
12637 	#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_SFT				10
12638 	/*
12639 	 * This enumeration states that the ghash is not valid in the
12640 	 * meta-data.
12641 	 */
12642 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
12643 	/*
12644 	 * This enumeration indicates that this pkt contains the record's
12645 	 * tag and this pkt was received ooo, the partial_ghash field
12646 	 * contains the ghash.
12647 	 */
12648 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_CUR_REC				(UINT32_C(0x1) << 10)
12649 	/*
12650 	 * This enumeration indicates that the current record's tag wasn't
12651 	 * seen and the chip is moving on to the next record, the
12652 	 * partial_ghash field contains the ghash.
12653 	 */
12654 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC			(UINT32_C(0x2) << 10)
12655 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_LAST				TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC
12656 	/* This field indicates the status of tag authentication. */
12657 	#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
12658 	#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
12659 	/*
12660 	 * This enumeration is set when HW was not able to authenticate a
12661 	 * TAG.
12662 	 */
12663 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
12664 	/*
12665 	 * This enumeration states that there is at least one tag in the
12666 	 * packet and every tag is valid.
12667 	 */
12668 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS		(UINT32_C(0x1) << 12)
12669 	/*
12670 	 * This enumeration states that there is at least one tag in the
12671 	 * packet and at least one of the tag is invalid. The entire packet
12672 	 * is sent decrypted to the host.
12673 	 */
12674 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE		(UINT32_C(0x2) << 12)
12675 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
12676 	/*
12677 	 * A value of 1 indicates that this packet contains a record that
12678 	 * starts in the packet and extends beyond the packet.
12679 	 */
12680 	#define TLS_METADATA_INSYNC_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
12681 	/*
12682 	 * A value of 1 indicates that the packet experienced a context load
12683 	 * error. In this case, the packet is sent to the host without the
12684 	 * header or payload decrypted and the context is not updated.
12685 	 */
12686 	#define TLS_METADATA_INSYNC_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
12687 	/* This field indicates the packet operation state. */
12688 	#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
12689 	#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
12690 	/* Packet is in order. */
12691 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
12692 	/* Packet is out of order, no header loss. */
12693 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
12694 	/* Packet is header search (out of order with header loss). */
12695 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
12696 	/* Packet is resync (resync record ongoing). */
12697 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
12698 	/*
12699 	 * Packet is resync wait (resync record completes, waiting for
12700 	 * result).
12701 	 */
12702 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
12703 	/*
12704 	 * Packet is resync wait for partial tag (waiting for resync record
12705 	 * tag).
12706 	 */
12707 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
12708 	/* Packet is resync success (got resync record success). */
12709 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
12710 	/*
12711 	 * Packet is resync success wait (got midpath ACK, waiting for
12712 	 * resync record success).
12713 	 */
12714 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
12715 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
12716 	/*
12717 	 * This value indicates the lower 7-bit of the Crypto Key ID
12718 	 * associated with this operation.
12719 	 */
12720 	#define TLS_METADATA_INSYNC_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
12721 	#define TLS_METADATA_INSYNC_MSG_KID_LO_SFT				25
12722 	uint16_t	kid_hi;
12723 	/*
12724 	 * This value indicates the upper 13-bit of the Crypto Key ID
12725 	 * associated with this operation.
12726 	 */
12727 	#define TLS_METADATA_INSYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
12728 	#define TLS_METADATA_INSYNC_MSG_KID_HI_SFT 0
12729 	/*
12730 	 * This field is only valid when md_type is set to tls_insync. This
12731 	 * field indicates the offset within the current TCP packet where the
12732 	 * TLS header starts. If there are multiple TLS headers in the packet,
12733 	 * this provides the offset of the last TLS header.
12734 	 *
12735 	 * The field is calculated by subtracting TCP sequence number of the
12736 	 * first byte of the TCP payload of the packet from the TCP sequence
12737 	 * number of the last TLS header in the packet.
12738 	 */
12739 	uint16_t	tls_header_offset;
12740 	/*
12741 	 * This is the sequence Number of the record that was processed by the HW.
12742 	 * If there are multiple records in a packet, this would be the sequence
12743 	 * number of the last record.
12744 	 */
12745 	uint64_t	record_seq_num;
12746 	/*
12747 	 * This field contains cumulative partial GHASH value of all the packets
12748 	 * decrypted by the HW associated with a TLS record. This field is valid
12749 	 * on when packets belonging to have arrived out-of-order and HW could
12750 	 * not decrypt every packet and authenticate the record. Partial GHASH is
12751 	 * only sent out with packet having the TAG field.
12752 	 */
12753 	uint8_t	partial_ghash[8];
12754 } tls_metadata_insync_msg_t, *ptls_metadata_insync_msg_t;
12755 
12756 /* tls_metadata_resync_msg (size:256b/32B) */
12757 
12758 typedef struct tls_metadata_resync_msg {
12759 	uint32_t	md_type_link_flags_kid_lo;
12760 	/* This field classifies the data present in the meta-data. */
12761 	#define TLS_METADATA_RESYNC_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
12762 	#define TLS_METADATA_RESYNC_MSG_MD_TYPE_SFT				0
12763 	/*
12764 	 * With this setting HW passes the TCP sequence number of the TLS
12765 	 * record that it is requesting a resync on in the meta data.
12766 	 */
12767 		#define TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC				UINT32_C(0x2)
12768 		#define TLS_METADATA_RESYNC_MSG_MD_TYPE_LAST				TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC
12769 	/*
12770 	 * This field indicates where the next metadata block starts. It is
12771 	 * counted in 16B units. A value of zero indicates that there is no
12772 	 * metadata.
12773 	 */
12774 	#define TLS_METADATA_RESYNC_MSG_LINK_MASK					UINT32_C(0x1e0)
12775 	#define TLS_METADATA_RESYNC_MSG_LINK_SFT					5
12776 	/* These are flags present in the metadata. */
12777 	#define TLS_METADATA_RESYNC_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
12778 	#define TLS_METADATA_RESYNC_MSG_FLAGS_SFT					9
12779 	/*
12780 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
12781 	 * the packet is passed on as it came in on the wire.
12782 	 */
12783 	#define TLS_METADATA_RESYNC_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
12784 	/*
12785 	 * This field indicates the state of the ghash field passed in the
12786 	 * meta-data.
12787 	 */
12788 	#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
12789 	#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_SFT				10
12790 	/*
12791 	 * This enumeration states that the ghash is not valid in the
12792 	 * meta-data.
12793 	 */
12794 		#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
12795 		#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_LAST				TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID
12796 	/* This field indicates the status of tag authentication. */
12797 	#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
12798 	#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
12799 	/*
12800 	 * This enumeration is set when HW was not able to authenticate a
12801 	 * TAG.
12802 	 */
12803 		#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
12804 		#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED
12805 	/*
12806 	 * A value of 1 indicates that this packet contains a record that
12807 	 * starts in the packet and extends beyond the packet.
12808 	 */
12809 	#define TLS_METADATA_RESYNC_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
12810 	/*
12811 	 * A value of 1 indicates that the packet experienced a context load
12812 	 * error. In this case, the packet is sent to the host without the
12813 	 * header or payload decrypted and the context is not updated.
12814 	 */
12815 	#define TLS_METADATA_RESYNC_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
12816 	/* This field indicates the packet operation state. */
12817 	#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
12818 	#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
12819 	/* Packet is in order. */
12820 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
12821 	/* Packet is out of order, no header loss. */
12822 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
12823 	/* Packet is header search (out of order with header loss). */
12824 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
12825 	/* Packet is resync (resync record ongoing). */
12826 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
12827 	/*
12828 	 * Packet is resync wait (resync record completes, waiting for
12829 	 * result).
12830 	 */
12831 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
12832 	/*
12833 	 * Packet is resync wait for partial tag (waiting for resync record
12834 	 * tag).
12835 	 */
12836 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
12837 	/* Packet is resync success (got resync record success). */
12838 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
12839 	/*
12840 	 * Packet is resync success wait (got midpath ACK, waiting for
12841 	 * resync record success).
12842 	 */
12843 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
12844 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
12845 	/*
12846 	 * This value indicates the lower 7-bit of the Crypto Key ID
12847 	 * associated with this operation.
12848 	 */
12849 	#define TLS_METADATA_RESYNC_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
12850 	#define TLS_METADATA_RESYNC_MSG_KID_LO_SFT				25
12851 	uint16_t	kid_hi;
12852 	/*
12853 	 * This value indicates the upper 13-bit of the Crypto Key ID
12854 	 * associated with this operation.
12855 	 */
12856 	#define TLS_METADATA_RESYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
12857 	#define TLS_METADATA_RESYNC_MSG_KID_HI_SFT 0
12858 	/* This field is unused in this context. */
12859 	uint16_t	metadata_0;
12860 	/*
12861 	 * This field indicates the TCP sequence number of the TLS record that HW
12862 	 * is requesting a resync on from the Driver. HW will keep a count of the
12863 	 * TLS records it found after this record (delta_records). Driver will
12864 	 * provide the TLS Record Sequence Number associated with the record. HW
12865 	 * will add the delta_records to the Record Sequence Number provided by
12866 	 * the driver and get back on sync.
12867 	 */
12868 	uint32_t	resync_record_tcp_seq_num;
12869 	uint32_t	unused0;
12870 	/* This field is unused in this context. */
12871 	uint64_t	metadata_2;
12872 	/* This field is unused in this context. */
12873 	uint64_t	metadata_3;
12874 } tls_metadata_resync_msg_t, *ptls_metadata_resync_msg_t;
12875 
12876 /* tx_doorbell (size:32b/4B) */
12877 
12878 typedef struct tx_doorbell {
12879 	uint32_t	key_idx;
12880 	/*
12881 	 * BD Index of next BD that will be used to transmit data
12882 	 * on the TX ring mapped to this door bell.  NIC may
12883 	 * read and process all BDs up to, but not including this
12884 	 * index.
12885 	 */
12886 	#define TX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
12887 	#define TX_DOORBELL_IDX_SFT 0
12888 	/*
12889 	 * This value indicates the type of door bell operation
12890 	 * that is begin requested.   This value is '0' for TX
12891 	 * door bell operations.
12892 	 */
12893 	#define TX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
12894 	#define TX_DOORBELL_KEY_SFT 28
12895 	/* TX Operation */
12896 		#define TX_DOORBELL_KEY_TX	(UINT32_C(0x0) << 28)
12897 		#define TX_DOORBELL_KEY_LAST TX_DOORBELL_KEY_TX
12898 } tx_doorbell_t, *ptx_doorbell_t;
12899 
12900 /* rx_doorbell (size:32b/4B) */
12901 
12902 typedef struct rx_doorbell {
12903 	uint32_t	key_idx;
12904 	/*
12905 	 * BD Index of next BD that will be used for an empty receive
12906 	 * buffer on the RX ring mapped to this door bell.  NIC may
12907 	 * read and process all BDs up to, but not including this
12908 	 * index.
12909 	 */
12910 	#define RX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
12911 	#define RX_DOORBELL_IDX_SFT 0
12912 	/*
12913 	 * This value indicates the type of door bell operation
12914 	 * that is begin requested.   This value is '1' for RX
12915 	 * door bell operations.
12916 	 */
12917 	#define RX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
12918 	#define RX_DOORBELL_KEY_SFT 28
12919 	/* RX Operation */
12920 		#define RX_DOORBELL_KEY_RX	(UINT32_C(0x1) << 28)
12921 		#define RX_DOORBELL_KEY_LAST RX_DOORBELL_KEY_RX
12922 } rx_doorbell_t, *prx_doorbell_t;
12923 
12924 /* cmpl_doorbell (size:32b/4B) */
12925 
12926 typedef struct cmpl_doorbell {
12927 	uint32_t	key_mask_valid_idx;
12928 	/*
12929 	 * BD Index of the most recently handed completion record
12930 	 * on the completion ring mapped to this door bell.
12931 	 * NIC may
12932 	 * write this location again with a new completion.
12933 	 */
12934 	#define CMPL_DOORBELL_IDX_MASK	UINT32_C(0xffffff)
12935 	#define CMPL_DOORBELL_IDX_SFT	0
12936 	/*
12937 	 * This indicates if the BDIDX value is valid for this
12938 	 * update when it is '1'.  When it is '0', the BDIDX
12939 	 * value should be ignored.
12940 	 */
12941 	#define CMPL_DOORBELL_IDX_VALID	UINT32_C(0x4000000)
12942 	/*
12943 	 * This bit indicates the new interrupt mask state for the
12944 	 * interrupt associated with the BDIDX.  A '1', means the
12945 	 * interrupt is to be masked.  A '0' indicates the interrupt
12946 	 * is to be unmasked.
12947 	 */
12948 	#define CMPL_DOORBELL_MASK	UINT32_C(0x8000000)
12949 	/*
12950 	 * This value indicates the type of door bell operation
12951 	 * that is begin requested.   This value is '2' for CMP
12952 	 * door bell operations.
12953 	 */
12954 	#define CMPL_DOORBELL_KEY_MASK	UINT32_C(0xf0000000)
12955 	#define CMPL_DOORBELL_KEY_SFT	28
12956 	/* Completion Operation */
12957 		#define CMPL_DOORBELL_KEY_CMPL	(UINT32_C(0x2) << 28)
12958 		#define CMPL_DOORBELL_KEY_LAST	CMPL_DOORBELL_KEY_CMPL
12959 } cmpl_doorbell_t, *pcmpl_doorbell_t;
12960 
12961 /* status_doorbell (size:32b/4B) */
12962 
12963 typedef struct status_doorbell {
12964 	uint32_t	key_idx;
12965 	/*
12966 	 * BD Index of the status record for which space is now
12967 	 * available to the NIC.
12968 	 */
12969 	/*
12970 	 * While there is no actual BD associated with the index,
12971 	 * the similar scheme is being used to communicate to
12972 	 * the NIC that space is available for status completions.
12973 	 */
12974 	#define STATUS_DOORBELL_IDX_MASK UINT32_C(0xffffff)
12975 	#define STATUS_DOORBELL_IDX_SFT 0
12976 	/*
12977 	 * This value indicates the type of door bell operation
12978 	 * that is begin requested.   This value is '3' for Status
12979 	 * door bell operations.
12980 	 */
12981 	#define STATUS_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
12982 	#define STATUS_DOORBELL_KEY_SFT 28
12983 	/* Status Operation */
12984 		#define STATUS_DOORBELL_KEY_STAT  (UINT32_C(0x3) << 28)
12985 		#define STATUS_DOORBELL_KEY_LAST STATUS_DOORBELL_KEY_STAT
12986 } status_doorbell_t, *pstatus_doorbell_t;
12987 
12988 /* push32_doorbell (size:1024b/128B) */
12989 
12990 typedef struct push32_doorbell {
12991 	uint32_t	key_sz_idx;
12992 	/*
12993 	 * This is the BD Index of last BD of the push packet
12994 	 * that will be used to transmit data on the TX ring mapped
12995 	 * to this door bell.
12996 	 */
12997 	#define PUSH32_DOORBELL_IDX_MASK UINT32_C(0xffffff)
12998 	#define PUSH32_DOORBELL_IDX_SFT 0
12999 	/*
13000 	 * This is the number of 16B BDs spaces consumed in the TX
13001 	 * Ring by the "backup" version of the packet being pushed.
13002 	 * A value of 1 is invalid since backup must start with a
13003 	 * long 32B BE.
13004 	 * A value of 2 indicates just the first 32B BE.
13005 	 * A value of 3 indicates 32B+16B BD.  etc.
13006 	 * A value of 0 indicates 16x16B BD spaces are consumed.
13007 	 */
13008 	#define PUSH32_DOORBELL_SZ_MASK UINT32_C(0xf000000)
13009 	#define PUSH32_DOORBELL_SZ_SFT  24
13010 	/*
13011 	 * This value indicates the type of door bell operation
13012 	 * that is begin requested.   This value is 4 for push
13013 	 * door bell operations.
13014 	 */
13015 	#define PUSH32_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
13016 	#define PUSH32_DOORBELL_KEY_SFT 28
13017 	/* Push Operation */
13018 		#define PUSH32_DOORBELL_KEY_PUSH  (UINT32_C(0x4) << 28)
13019 		#define PUSH32_DOORBELL_KEY_LAST PUSH32_DOORBELL_KEY_PUSH
13020 	uint16_t	flags_type;
13021 	/* This value identifies the type of buffer descriptor. */
13022 	#define PUSH32_DOORBELL_TYPE_MASK		UINT32_C(0x3f)
13023 	#define PUSH32_DOORBELL_TYPE_SFT		0
13024 	/*
13025 	 * Indicates that this BD is 32B long and is used for
13026 	 * normal L2 packet transmission.
13027 	 */
13028 		#define PUSH32_DOORBELL_TYPE_TX_BD_LONG	UINT32_C(0x10)
13029 		#define PUSH32_DOORBELL_TYPE_LAST		PUSH32_DOORBELL_TYPE_TX_BD_LONG
13030 	/*
13031 	 * All bits in this field must be valid on the first BD of a packet.
13032 	 * Only the packet_end bit must be valid for the remaining BDs
13033 	 * of a packet.
13034 	 */
13035 	#define PUSH32_DOORBELL_FLAGS_MASK	UINT32_C(0xffc0)
13036 	#define PUSH32_DOORBELL_FLAGS_SFT		6
13037 	/*
13038 	 * If set to 1, the packet ends with the data in the buffer
13039 	 * pointed to by this descriptor.  This flag must be
13040 	 * valid on every BD.
13041 	 *
13042 	 *	This bit must be set on all push doorbells.
13043 	 */
13044 	#define PUSH32_DOORBELL_FLAGS_PACKET_END	UINT32_C(0x40)
13045 	/*
13046 	 * If set to 1, the device will not generate a completion for
13047 	 * this transmit packet unless there is an error in it's
13048 	 * processing.
13049 	 * If this bit
13050 	 * is set to 0, then the packet will be completed normally.
13051 	 *
13052 	 * This bit must be valid only on the first BD of a packet.
13053 	 */
13054 	#define PUSH32_DOORBELL_FLAGS_NO_CMPL	UINT32_C(0x80)
13055 	/*
13056 	 * This value must match the sz field in the first
13057 	 * 32b of the push operation except that if
13058 	 * 16x16B BD locations
13059 	 * are consumed in the ring by this packet, then
13060 	 * this value must be 16 (not zero).
13061 	 */
13062 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
13063 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_SFT	8
13064 	/*
13065 	 * This value is a hint for the length of the entire packet.
13066 	 * It is used by the chip to optimize internal processing.
13067 	 *
13068 	 * The packet will be dropped if the hint is too short.
13069 	 *
13070 	 * This field is valid only on the first BD of a packet.
13071 	 */
13072 	#define PUSH32_DOORBELL_FLAGS_LHINT_MASK	UINT32_C(0x6000)
13073 	#define PUSH32_DOORBELL_FLAGS_LHINT_SFT	13
13074 	/* indicates packet length < 512B */
13075 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
13076 	/* indicates 512 <= packet length < 1KB */
13077 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
13078 	/* indicates 1KB <= packet length < 2KB */
13079 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
13080 	/* indicates packet length >= 2KB */
13081 		#define PUSH32_DOORBELL_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
13082 		#define PUSH32_DOORBELL_FLAGS_LHINT_LAST	PUSH32_DOORBELL_FLAGS_LHINT_GTE2K
13083 	/*
13084 	 * If set to 1, the device immediately updates the Send Consumer
13085 	 * Index after the buffer associated with this descriptor has
13086 	 * been transferred via DMA to NIC memory from host memory. An
13087 	 * interrupt may or may not be generated according to the state
13088 	 * of the interrupt avoidance mechanisms. If this bit
13089 	 * is set to 0, then the Consumer Index is only updated as soon
13090 	 * as one of the host interrupt coalescing conditions has been met.
13091 	 *
13092 	 * This bit must be valid on the first BD of a packet.
13093 	 */
13094 	#define PUSH32_DOORBELL_FLAGS_COAL_NOW	UINT32_C(0x8000)
13095 	/*
13096 	 * This is the length of the host physical buffer this BD describes
13097 	 * in bytes.
13098 	 *
13099 	 * This field must be valid on all BDs of a packet.
13100 	 */
13101 	uint16_t	len;
13102 	/*
13103 	 * The opaque data field is pass through to the completion and can be
13104 	 * used for any data that the driver wants to associate with the
13105 	 * transmit BD.
13106 	 *
13107 	 * This field must be valid on the first BD of a packet.
13108 	 */
13109 	uint32_t	opaque;
13110 	/*
13111 	 * All bits in this field must be valid on the first BD of a packet.
13112 	 * Their value on other BDs of the packet will be ignored.
13113 	 */
13114 	uint16_t	lflags;
13115 	/*
13116 	 * If set to 1, the controller replaces the TCP/UPD checksum
13117 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
13118 	 * checksum field of the encapsulated TCP/UDP packets with the
13119 	 * hardware calculated TCP/UDP checksum for the packet associated
13120 	 * with this descriptor. The flag is ignored if the LSO flag is set.
13121 	 *
13122 	 * This bit must be valid on the first BD of a packet.
13123 	 */
13124 	#define PUSH32_DOORBELL_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
13125 	/*
13126 	 * If set to 1, the controller replaces the IP checksum of the
13127 	 * normal packets, or the inner IP checksum of the encapsulated
13128 	 * packets with the hardware calculated IP checksum for the
13129 	 * packet associated with this descriptor.
13130 	 *
13131 	 * This bit must be valid on the first BD of a packet.
13132 	 */
13133 	#define PUSH32_DOORBELL_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
13134 	/*
13135 	 * If set to 1, the controller will not append an Ethernet CRC
13136 	 * to the end of the frame.
13137 	 *
13138 	 * This bit must be valid on the first BD of a packet.
13139 	 *
13140 	 * Packet must be 64B or longer when this flag is set.  It is not
13141 	 * useful to use this bit with any form of TX offload such as
13142 	 * CSO or LSO.  The intent is that the packet from the host already
13143 	 * has a valid Ethernet CRC on the packet.
13144 	 */
13145 	#define PUSH32_DOORBELL_LFLAGS_NOCRC		UINT32_C(0x4)
13146 	/*
13147 	 * If set to 1, the device will record the time at which the packet
13148 	 * was actually transmitted at the TX MAC.
13149 	 *
13150 	 * This bit must be valid on the first BD of a packet.
13151 	 */
13152 	#define PUSH32_DOORBELL_LFLAGS_STAMP		UINT32_C(0x8)
13153 	/*
13154 	 * If set to 1, The controller replaces the tunnel IP checksum
13155 	 * field with hardware calculated IP checksum for the IP header
13156 	 * of the packet associated with this descriptor.
13157 	 *
13158 	 * For outer UDP checksum, global outer UDP checksum TE_NIC register
13159 	 * needs to be enabled. If the global outer UDP checksum TE_NIC register
13160 	 * bit is set, outer UDP checksum will be calculated for the following
13161 	 * cases:
13162 	 * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
13163 	 * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
13164 	 * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
13165 	 * checksum will not be calculated.
13166 	 * 2. Packets with lso flag set which implies inner TCP checksum calculation
13167 	 * as part of LSO operation.
13168 	 */
13169 	#define PUSH32_DOORBELL_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
13170 	/*
13171 	 * If set to 1, the device will treat this packet with LSO(Large
13172 	 * Send Offload) processing for both normal or encapsulated
13173 	 * packets, which is a form of TCP segmentation.  When this bit
13174 	 * is 1, the hdr_size and mss fields must be valid. The driver
13175 	 * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
13176 	 * flags since the controller will replace the appropriate
13177 	 * checksum fields for segmented packets.
13178 	 *
13179 	 * When this bit is 1, the hdr_size and mss fields must be valid.
13180 	 */
13181 	#define PUSH32_DOORBELL_LFLAGS_LSO		UINT32_C(0x20)
13182 	/*
13183 	 * If set to zero when LSO is '1', then the IPID will be treated
13184 	 * as a 16b number and will be wrapped if it exceeds a value of
13185 	 * 0xffff.
13186 	 *
13187 	 * If set to one when LSO is '1', then the IPID will be treated
13188 	 * as a 15b number and will be wrapped if it exceeds a value 0f
13189 	 * 0x7fff.
13190 	 */
13191 	#define PUSH32_DOORBELL_LFLAGS_IPID_FMT	UINT32_C(0x40)
13192 	/*
13193 	 * If set to zero when LSO is '1', then the IPID of the tunnel
13194 	 * IP header will not be modified during LSO operations.
13195 	 *
13196 	 * If set to one when LSO is '1', then the IPID of the tunnel
13197 	 * IP header will be incremented for each subsequent segment of an
13198 	 * LSO operation.
13199 	 *
13200 	 * The flag is ignored if the LSO packet is a normal (non-tunneled)
13201 	 * TCP packet.
13202 	 */
13203 	#define PUSH32_DOORBELL_LFLAGS_T_IPID		UINT32_C(0x80)
13204 	/*
13205 	 * If set to '1', then the RoCE ICRC will be appended to the
13206 	 * packet.  Packet must be a valid RoCE format packet.
13207 	 */
13208 	#define PUSH32_DOORBELL_LFLAGS_ROCE_CRC	UINT32_C(0x100)
13209 	/*
13210 	 * If set to '1', then the FCoE CRC will be appended to the
13211 	 * packet.  Packet must be a valid FCoE format packet.
13212 	 */
13213 	#define PUSH32_DOORBELL_LFLAGS_FCOE_CRC	UINT32_C(0x200)
13214 	uint16_t	hdr_size;
13215 	/*
13216 	 * When LSO is '1', this field must contain the offset of the
13217 	 * TCP payload from the beginning of the packet in as
13218 	 * 16b words. In case of encapsulated/tunneling packet, this field
13219 	 * contains the offset of the inner TCP payload from beginning of the
13220 	 * packet as 16-bit words.
13221 	 *
13222 	 * This value must be valid on the first BD of a packet.
13223 	 */
13224 	#define PUSH32_DOORBELL_HDR_SIZE_MASK UINT32_C(0x1ff)
13225 	#define PUSH32_DOORBELL_HDR_SIZE_SFT 0
13226 	uint32_t	mss;
13227 	/*
13228 	 * This is the MSS value that will be used to do the LSO processing.
13229 	 * The value is the length in bytes of the TCP payload for each
13230 	 * segment generated by the LSO operation.
13231 	 *
13232 	 * This value must be valid on the first BD of a packet.
13233 	 */
13234 	#define PUSH32_DOORBELL_MSS_MASK UINT32_C(0x7fff)
13235 	#define PUSH32_DOORBELL_MSS_SFT 0
13236 	uint16_t	unused_2;
13237 	/*
13238 	 * This value selects a CFA action to perform on the packet.
13239 	 * Set this value to zero if no CFA action is desired.
13240 	 *
13241 	 * This value must be valid on the first BD of a packet.
13242 	 */
13243 	uint16_t	cfa_action;
13244 	/*
13245 	 * This value is action meta-data that defines CFA edit operations
13246 	 * that are done in addition to any action editing.
13247 	 */
13248 	uint32_t	cfa_meta;
13249 	/* When key=1, This is the VLAN tag VID value. */
13250 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
13251 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_SFT	0
13252 	/* When key=1, This is the VLAN tag DE value. */
13253 	#define PUSH32_DOORBELL_CFA_META_VLAN_DE	UINT32_C(0x1000)
13254 	/* When key=1, This is the VLAN tag PRI value. */
13255 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
13256 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_SFT	13
13257 	/* When key=1, This is the VLAN tag TPID select value. */
13258 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
13259 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_SFT	16
13260 	/* 0x88a8 */
13261 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
13262 	/* 0x8100 */
13263 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
13264 	/* 0x9100 */
13265 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
13266 	/* 0x9200 */
13267 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
13268 	/* 0x9300 */
13269 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
13270 	/* Value programmed in CFA VLANTPID register. */
13271 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
13272 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_LAST	PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG
13273 	/* When key=1, This is the VLAN tag TPID select value. */
13274 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
13275 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_SFT 19
13276 	/*
13277 	 * This field identifies the type of edit to be performed
13278 	 * on the packet.
13279 	 *
13280 	 * This value must be valid on the first BD of a packet.
13281 	 */
13282 	#define PUSH32_DOORBELL_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
13283 	#define PUSH32_DOORBELL_CFA_META_KEY_SFT	28
13284 	/* No editing */
13285 		#define PUSH32_DOORBELL_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
13286 	/*
13287 	 * - meta[17:16] - TPID select value (0 = 0x8100).
13288 	 * - meta[15:12] - PRI/DE value.
13289 	 * - meta[11:0] - VID value.
13290 	 */
13291 		#define PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
13292 		#define PUSH32_DOORBELL_CFA_META_KEY_LAST	PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG
13293 	/*
13294 	 * This is the data for the push packet.  If the packet
13295 	 * data does not fit in the first pass, data writing
13296 	 * can continue at offset 4 of the doorbell for up to 4 additional
13297 	 * passes for a total data size of 512B maximum.
13298 	 */
13299 	uint32_t	data[25];
13300 } push32_doorbell_t, *ppush32_doorbell_t;
13301 
13302 /*******************
13303  * hwrm_func_reset *
13304  *******************/
13305 
13306 
13307 /* hwrm_func_reset_input (size:192b/24B) */
13308 
13309 typedef struct hwrm_func_reset_input {
13310 	/* The HWRM command request type. */
13311 	uint16_t	req_type;
13312 	/*
13313 	 * The completion ring to send the completion event on. This should
13314 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13315 	 */
13316 	uint16_t	cmpl_ring;
13317 	/*
13318 	 * The sequence ID is used by the driver for tracking multiple
13319 	 * commands. This ID is treated as opaque data by the firmware and
13320 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13321 	 */
13322 	uint16_t	seq_id;
13323 	/*
13324 	 * The target ID of the command:
13325 	 * * 0x0-0xFFF8 - The function ID
13326 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13327 	 * * 0xFFFD - Reserved for user-space HWRM interface
13328 	 * * 0xFFFF - HWRM
13329 	 */
13330 	uint16_t	target_id;
13331 	/*
13332 	 * A physical address pointer pointing to a host buffer that the
13333 	 * command's response data will be written. This can be either a host
13334 	 * physical address (HPA) or a guest physical address (GPA) and must
13335 	 * point to a physically contiguous block of memory.
13336 	 */
13337 	uint64_t	resp_addr;
13338 	uint32_t	enables;
13339 	/*
13340 	 * This bit must be '1' for the vf_id_valid field to be
13341 	 * configured.
13342 	 */
13343 	#define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
13344 	/*
13345 	 * The ID of the VF that this PF is trying to reset.
13346 	 * Only the parent PF shall be allowed to reset a child VF.
13347 	 *
13348 	 * A parent PF driver shall use this field only when a specific child VF
13349 	 * is requested to be reset.
13350 	 */
13351 	uint16_t	vf_id;
13352 	/* This value indicates the level of a function reset. */
13353 	uint8_t	func_reset_level;
13354 	/*
13355 	 * Reset the caller function and its children VFs (if any). If no
13356 	 * children functions exist, then reset the caller function only.
13357 	 */
13358 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL	UINT32_C(0x0)
13359 	/* Reset the caller function only */
13360 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME	UINT32_C(0x1)
13361 	/*
13362 	 * Reset all children VFs of the caller function driver if the
13363 	 * caller is a PF driver.
13364 	 * It is an error to specify this level by a VF driver.
13365 	 * It is an error to specify this level by a PF driver with
13366 	 * no children VFs.
13367 	 */
13368 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN UINT32_C(0x2)
13369 	/*
13370 	 * Reset a specific VF of the caller function driver if the caller
13371 	 * is the parent PF driver.
13372 	 * It is an error to specify this level by a VF driver.
13373 	 * It is an error to specify this level by a PF driver that is not
13374 	 * the parent of the VF that is being requested to reset.
13375 	 */
13376 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF	UINT32_C(0x3)
13377 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST	HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
13378 	uint8_t	unused_0;
13379 } hwrm_func_reset_input_t, *phwrm_func_reset_input_t;
13380 
13381 /* hwrm_func_reset_output (size:128b/16B) */
13382 
13383 typedef struct hwrm_func_reset_output {
13384 	/* The specific error status for the command. */
13385 	uint16_t	error_code;
13386 	/* The HWRM command request type. */
13387 	uint16_t	req_type;
13388 	/* The sequence ID from the original command. */
13389 	uint16_t	seq_id;
13390 	/* The length of the response data in number of bytes. */
13391 	uint16_t	resp_len;
13392 	uint8_t	unused_0[7];
13393 	/*
13394 	 * This field is used in Output records to indicate that the output
13395 	 * is completely written to RAM.  This field should be read as '1'
13396 	 * to indicate that the output has been completely written.
13397 	 * When writing a command completion or response to an internal processor,
13398 	 * the order of writes has to be such that this field is written last.
13399 	 */
13400 	uint8_t	valid;
13401 } hwrm_func_reset_output_t, *phwrm_func_reset_output_t;
13402 
13403 /********************
13404  * hwrm_func_getfid *
13405  ********************/
13406 
13407 
13408 /* hwrm_func_getfid_input (size:192b/24B) */
13409 
13410 typedef struct hwrm_func_getfid_input {
13411 	/* The HWRM command request type. */
13412 	uint16_t	req_type;
13413 	/*
13414 	 * The completion ring to send the completion event on. This should
13415 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13416 	 */
13417 	uint16_t	cmpl_ring;
13418 	/*
13419 	 * The sequence ID is used by the driver for tracking multiple
13420 	 * commands. This ID is treated as opaque data by the firmware and
13421 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13422 	 */
13423 	uint16_t	seq_id;
13424 	/*
13425 	 * The target ID of the command:
13426 	 * * 0x0-0xFFF8 - The function ID
13427 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13428 	 * * 0xFFFD - Reserved for user-space HWRM interface
13429 	 * * 0xFFFF - HWRM
13430 	 */
13431 	uint16_t	target_id;
13432 	/*
13433 	 * A physical address pointer pointing to a host buffer that the
13434 	 * command's response data will be written. This can be either a host
13435 	 * physical address (HPA) or a guest physical address (GPA) and must
13436 	 * point to a physically contiguous block of memory.
13437 	 */
13438 	uint64_t	resp_addr;
13439 	uint32_t	enables;
13440 	/*
13441 	 * This bit must be '1' for the pci_id field to be
13442 	 * configured.
13443 	 */
13444 	#define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID	UINT32_C(0x1)
13445 	/*
13446 	 * This value is the PCI ID of the queried function.
13447 	 * If ARI is enabled, then it is
13448 	 * Bus Number (8b):Function Number(8b). Otherwise, it is
13449 	 * Bus Number (8b):Device Number (5b):Function Number(3b).
13450 	 */
13451 	uint16_t	pci_id;
13452 	uint8_t	unused_0[2];
13453 } hwrm_func_getfid_input_t, *phwrm_func_getfid_input_t;
13454 
13455 /* hwrm_func_getfid_output (size:128b/16B) */
13456 
13457 typedef struct hwrm_func_getfid_output {
13458 	/* The specific error status for the command. */
13459 	uint16_t	error_code;
13460 	/* The HWRM command request type. */
13461 	uint16_t	req_type;
13462 	/* The sequence ID from the original command. */
13463 	uint16_t	seq_id;
13464 	/* The length of the response data in number of bytes. */
13465 	uint16_t	resp_len;
13466 	/*
13467 	 * FID value.  This value is used to identify operations on the PCI
13468 	 * bus as belonging to a particular PCI function.
13469 	 */
13470 	uint16_t	fid;
13471 	uint8_t	unused_0[5];
13472 	/*
13473 	 * This field is used in Output records to indicate that the output
13474 	 * is completely written to RAM.  This field should be read as '1'
13475 	 * to indicate that the output has been completely written.
13476 	 * When writing a command completion or response to an internal processor,
13477 	 * the order of writes has to be such that this field is written last.
13478 	 */
13479 	uint8_t	valid;
13480 } hwrm_func_getfid_output_t, *phwrm_func_getfid_output_t;
13481 
13482 /**********************
13483  * hwrm_func_vf_alloc *
13484  **********************/
13485 
13486 
13487 /* hwrm_func_vf_alloc_input (size:192b/24B) */
13488 
13489 typedef struct hwrm_func_vf_alloc_input {
13490 	/* The HWRM command request type. */
13491 	uint16_t	req_type;
13492 	/*
13493 	 * The completion ring to send the completion event on. This should
13494 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13495 	 */
13496 	uint16_t	cmpl_ring;
13497 	/*
13498 	 * The sequence ID is used by the driver for tracking multiple
13499 	 * commands. This ID is treated as opaque data by the firmware and
13500 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13501 	 */
13502 	uint16_t	seq_id;
13503 	/*
13504 	 * The target ID of the command:
13505 	 * * 0x0-0xFFF8 - The function ID
13506 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13507 	 * * 0xFFFD - Reserved for user-space HWRM interface
13508 	 * * 0xFFFF - HWRM
13509 	 */
13510 	uint16_t	target_id;
13511 	/*
13512 	 * A physical address pointer pointing to a host buffer that the
13513 	 * command's response data will be written. This can be either a host
13514 	 * physical address (HPA) or a guest physical address (GPA) and must
13515 	 * point to a physically contiguous block of memory.
13516 	 */
13517 	uint64_t	resp_addr;
13518 	uint32_t	enables;
13519 	/*
13520 	 * This bit must be '1' for the first_vf_id field to be
13521 	 * configured.
13522 	 */
13523 	#define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
13524 	/*
13525 	 * This value is used to identify a Virtual Function (VF).
13526 	 * The scope of VF ID is local within a PF.
13527 	 */
13528 	uint16_t	first_vf_id;
13529 	/* The number of virtual functions requested. */
13530 	uint16_t	num_vfs;
13531 } hwrm_func_vf_alloc_input_t, *phwrm_func_vf_alloc_input_t;
13532 
13533 /* hwrm_func_vf_alloc_output (size:128b/16B) */
13534 
13535 typedef struct hwrm_func_vf_alloc_output {
13536 	/* The specific error status for the command. */
13537 	uint16_t	error_code;
13538 	/* The HWRM command request type. */
13539 	uint16_t	req_type;
13540 	/* The sequence ID from the original command. */
13541 	uint16_t	seq_id;
13542 	/* The length of the response data in number of bytes. */
13543 	uint16_t	resp_len;
13544 	/* The ID of the first VF allocated. */
13545 	uint16_t	first_vf_id;
13546 	uint8_t	unused_0[5];
13547 	/*
13548 	 * This field is used in Output records to indicate that the output
13549 	 * is completely written to RAM.  This field should be read as '1'
13550 	 * to indicate that the output has been completely written.
13551 	 * When writing a command completion or response to an internal processor,
13552 	 * the order of writes has to be such that this field is written last.
13553 	 */
13554 	uint8_t	valid;
13555 } hwrm_func_vf_alloc_output_t, *phwrm_func_vf_alloc_output_t;
13556 
13557 /*********************
13558  * hwrm_func_vf_free *
13559  *********************/
13560 
13561 
13562 /* hwrm_func_vf_free_input (size:192b/24B) */
13563 
13564 typedef struct hwrm_func_vf_free_input {
13565 	/* The HWRM command request type. */
13566 	uint16_t	req_type;
13567 	/*
13568 	 * The completion ring to send the completion event on. This should
13569 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13570 	 */
13571 	uint16_t	cmpl_ring;
13572 	/*
13573 	 * The sequence ID is used by the driver for tracking multiple
13574 	 * commands. This ID is treated as opaque data by the firmware and
13575 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13576 	 */
13577 	uint16_t	seq_id;
13578 	/*
13579 	 * The target ID of the command:
13580 	 * * 0x0-0xFFF8 - The function ID
13581 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13582 	 * * 0xFFFD - Reserved for user-space HWRM interface
13583 	 * * 0xFFFF - HWRM
13584 	 */
13585 	uint16_t	target_id;
13586 	/*
13587 	 * A physical address pointer pointing to a host buffer that the
13588 	 * command's response data will be written. This can be either a host
13589 	 * physical address (HPA) or a guest physical address (GPA) and must
13590 	 * point to a physically contiguous block of memory.
13591 	 */
13592 	uint64_t	resp_addr;
13593 	uint32_t	enables;
13594 	/*
13595 	 * This bit must be '1' for the first_vf_id field to be
13596 	 * configured.
13597 	 */
13598 	#define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
13599 	/*
13600 	 * This value is used to identify a Virtual Function (VF).
13601 	 * The scope of VF ID is local within a PF.
13602 	 */
13603 	uint16_t	first_vf_id;
13604 	/*
13605 	 * The number of virtual functions requested.
13606 	 * 0xFFFF - Cleanup all children of this PF.
13607 	 */
13608 	uint16_t	num_vfs;
13609 } hwrm_func_vf_free_input_t, *phwrm_func_vf_free_input_t;
13610 
13611 /* hwrm_func_vf_free_output (size:128b/16B) */
13612 
13613 typedef struct hwrm_func_vf_free_output {
13614 	/* The specific error status for the command. */
13615 	uint16_t	error_code;
13616 	/* The HWRM command request type. */
13617 	uint16_t	req_type;
13618 	/* The sequence ID from the original command. */
13619 	uint16_t	seq_id;
13620 	/* The length of the response data in number of bytes. */
13621 	uint16_t	resp_len;
13622 	uint8_t	unused_0[7];
13623 	/*
13624 	 * This field is used in Output records to indicate that the output
13625 	 * is completely written to RAM.  This field should be read as '1'
13626 	 * to indicate that the output has been completely written.
13627 	 * When writing a command completion or response to an internal processor,
13628 	 * the order of writes has to be such that this field is written last.
13629 	 */
13630 	uint8_t	valid;
13631 } hwrm_func_vf_free_output_t, *phwrm_func_vf_free_output_t;
13632 
13633 /********************
13634  * hwrm_func_vf_cfg *
13635  ********************/
13636 
13637 
13638 /* hwrm_func_vf_cfg_input (size:512b/64B) */
13639 
13640 typedef struct hwrm_func_vf_cfg_input {
13641 	/* The HWRM command request type. */
13642 	uint16_t	req_type;
13643 	/*
13644 	 * The completion ring to send the completion event on. This should
13645 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13646 	 */
13647 	uint16_t	cmpl_ring;
13648 	/*
13649 	 * The sequence ID is used by the driver for tracking multiple
13650 	 * commands. This ID is treated as opaque data by the firmware and
13651 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13652 	 */
13653 	uint16_t	seq_id;
13654 	/*
13655 	 * The target ID of the command:
13656 	 * * 0x0-0xFFF8 - The function ID
13657 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13658 	 * * 0xFFFD - Reserved for user-space HWRM interface
13659 	 * * 0xFFFF - HWRM
13660 	 */
13661 	uint16_t	target_id;
13662 	/*
13663 	 * A physical address pointer pointing to a host buffer that the
13664 	 * command's response data will be written. This can be either a host
13665 	 * physical address (HPA) or a guest physical address (GPA) and must
13666 	 * point to a physically contiguous block of memory.
13667 	 */
13668 	uint64_t	resp_addr;
13669 	uint32_t	enables;
13670 	/*
13671 	 * This bit must be '1' for the mtu field to be
13672 	 * configured.
13673 	 */
13674 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU		UINT32_C(0x1)
13675 	/*
13676 	 * This bit must be '1' for the guest_vlan field to be
13677 	 * configured.
13678 	 */
13679 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN	UINT32_C(0x2)
13680 	/*
13681 	 * This bit must be '1' for the async_event_cr field to be
13682 	 * configured.
13683 	 */
13684 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4)
13685 	/*
13686 	 * This bit must be '1' for the dflt_mac_addr field to be
13687 	 * configured.
13688 	 */
13689 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR	UINT32_C(0x8)
13690 	/*
13691 	 * This bit must be '1' for the num_rsscos_ctxs field to be
13692 	 * configured.
13693 	 */
13694 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS	UINT32_C(0x10)
13695 	/*
13696 	 * This bit must be '1' for the num_cmpl_rings field to be
13697 	 * configured.
13698 	 */
13699 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS	UINT32_C(0x20)
13700 	/*
13701 	 * This bit must be '1' for the num_tx_rings field to be
13702 	 * configured.
13703 	 */
13704 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS	UINT32_C(0x40)
13705 	/*
13706 	 * This bit must be '1' for the num_rx_rings field to be
13707 	 * configured.
13708 	 */
13709 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS	UINT32_C(0x80)
13710 	/*
13711 	 * This bit must be '1' for the num_l2_ctxs field to be
13712 	 * configured.
13713 	 */
13714 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS	UINT32_C(0x100)
13715 	/*
13716 	 * This bit must be '1' for the num_vnics field to be
13717 	 * configured.
13718 	 */
13719 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS		UINT32_C(0x200)
13720 	/*
13721 	 * This bit must be '1' for the num_stat_ctxs field to be
13722 	 * configured.
13723 	 */
13724 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS	UINT32_C(0x400)
13725 	/*
13726 	 * This bit must be '1' for the num_hw_ring_grps field to be
13727 	 * configured.
13728 	 */
13729 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS	UINT32_C(0x800)
13730 	/*
13731 	 * This bit must be '1' for the num_tx_key_ctxs field to be
13732 	 * configured.
13733 	 */
13734 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_KEY_CTXS	UINT32_C(0x1000)
13735 	/*
13736 	 * This bit must be '1' for the num_rx_key_ctxs field to be
13737 	 * configured.
13738 	 */
13739 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_KEY_CTXS	UINT32_C(0x2000)
13740 	/*
13741 	 * The maximum transmission unit requested on the function.
13742 	 * The HWRM should make sure that the mtu of
13743 	 * the function does not exceed the mtu of the physical
13744 	 * port that this function is associated with.
13745 	 *
13746 	 * In addition to requesting mtu per function, it is
13747 	 * possible to configure mtu per transmit ring.
13748 	 * By default, the mtu of each transmit ring associated
13749 	 * with a function is equal to the mtu of the function.
13750 	 * The HWRM should make sure that the mtu of each transmit
13751 	 * ring that is assigned to a function has a valid mtu.
13752 	 */
13753 	uint16_t	mtu;
13754 	/*
13755 	 * The guest VLAN for the function being configured.
13756 	 * This field's format is same as 802.1Q Tag's
13757 	 * Tag Control Information (TCI) format that includes both
13758 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
13759 	 */
13760 	uint16_t	guest_vlan;
13761 	/*
13762 	 * ID of the target completion ring for receiving asynchronous
13763 	 * event completions. If this field is not valid, then the
13764 	 * HWRM shall use the default completion ring of the function
13765 	 * that is being configured as the target completion ring for
13766 	 * providing any asynchronous event completions for that
13767 	 * function.
13768 	 * If this field is valid, then the HWRM shall use the
13769 	 * completion ring identified by this ID as the target
13770 	 * completion ring for providing any asynchronous event
13771 	 * completions for the function that is being configured.
13772 	 */
13773 	uint16_t	async_event_cr;
13774 	/*
13775 	 * This value is the current MAC address requested by the VF
13776 	 * driver to be configured on this VF. A value of
13777 	 * 00-00-00-00-00-00 indicates no MAC address configuration
13778 	 * is requested by the VF driver.
13779 	 * The parent PF driver may reject or overwrite this
13780 	 * MAC address.
13781 	 */
13782 	uint8_t	dflt_mac_addr[6];
13783 	uint32_t	flags;
13784 	/*
13785 	 * This bit requests that the firmware test to see if all the assets
13786 	 * requested in this command (i.e. number of TX rings) are available.
13787 	 * The firmware will return an error if the requested assets are
13788 	 * not available. The firmware will NOT reserve the assets if they
13789 	 * are available.
13790 	 */
13791 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST		UINT32_C(0x1)
13792 	/*
13793 	 * This bit requests that the firmware test to see if all the assets
13794 	 * requested in this command (i.e. number of RX rings) are available.
13795 	 * The firmware will return an error if the requested assets are
13796 	 * not available. The firmware will NOT reserve the assets if they
13797 	 * are available.
13798 	 */
13799 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST		UINT32_C(0x2)
13800 	/*
13801 	 * This bit requests that the firmware test to see if all the assets
13802 	 * requested in this command (i.e. number of CMPL rings) are available.
13803 	 * The firmware will return an error if the requested assets are
13804 	 * not available. The firmware will NOT reserve the assets if they
13805 	 * are available.
13806 	 */
13807 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST	UINT32_C(0x4)
13808 	/*
13809 	 * This bit requests that the firmware test to see if all the assets
13810 	 * requested in this command (i.e. number of RSS ctx) are available.
13811 	 * The firmware will return an error if the requested assets are
13812 	 * not available. The firmware will NOT reserve the assets if they
13813 	 * are available.
13814 	 */
13815 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST	UINT32_C(0x8)
13816 	/*
13817 	 * This bit requests that the firmware test to see if all the assets
13818 	 * requested in this command (i.e. number of ring groups) are available.
13819 	 * The firmware will return an error if the requested assets are
13820 	 * not available. The firmware will NOT reserve the assets if they
13821 	 * are available.
13822 	 */
13823 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST	UINT32_C(0x10)
13824 	/*
13825 	 * This bit requests that the firmware test to see if all the assets
13826 	 * requested in this command (i.e. number of stat ctx) are available.
13827 	 * The firmware will return an error if the requested assets are
13828 	 * not available. The firmware will NOT reserve the assets if they
13829 	 * are available.
13830 	 */
13831 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST	UINT32_C(0x20)
13832 	/*
13833 	 * This bit requests that the firmware test to see if all the assets
13834 	 * requested in this command (i.e. number of VNICs) are available.
13835 	 * The firmware will return an error if the requested assets are
13836 	 * not available. The firmware will NOT reserve the assets if they
13837 	 * are available.
13838 	 */
13839 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST	UINT32_C(0x40)
13840 	/*
13841 	 * This bit requests that the firmware test to see if all the assets
13842 	 * requested in this command (i.e. number of L2 ctx) are available.
13843 	 * The firmware will return an error if the requested assets are
13844 	 * not available. The firmware will NOT reserve the assets if they
13845 	 * are available.
13846 	 */
13847 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST	UINT32_C(0x80)
13848 	/*
13849 	 * If this bit is set to 1, the VF driver is requesting FW to enable
13850 	 * PPP TX PUSH feature on all the TX rings specified in the
13851 	 * num_tx_rings field. By default, the PPP TX push feature is
13852 	 * disabled for all the TX rings of the VF. This flag is ignored if
13853 	 * the num_tx_rings field is not specified or the VF doesn't support
13854 	 * PPP tx push feature.
13855 	 */
13856 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE	UINT32_C(0x100)
13857 	/*
13858 	 * If this bit is set to 1, the VF driver is requesting FW to disable
13859 	 * PPP TX PUSH feature on all the TX rings of the VF. This flag is
13860 	 * ignored if the VF doesn't support PPP tx push feature.
13861 	 */
13862 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE	UINT32_C(0x200)
13863 	/* The number of RSS/COS contexts requested for the VF. */
13864 	uint16_t	num_rsscos_ctxs;
13865 	/* The number of completion rings requested for the VF. */
13866 	uint16_t	num_cmpl_rings;
13867 	/* The number of transmit rings requested for the VF. */
13868 	uint16_t	num_tx_rings;
13869 	/* The number of receive rings requested for the VF. */
13870 	uint16_t	num_rx_rings;
13871 	/* The number of L2 contexts requested for the VF. */
13872 	uint16_t	num_l2_ctxs;
13873 	/* The number of vnics requested for the VF. */
13874 	uint16_t	num_vnics;
13875 	/* The number of statistic contexts requested for the VF. */
13876 	uint16_t	num_stat_ctxs;
13877 	/* The number of HW ring groups requested for the VF. */
13878 	uint16_t	num_hw_ring_grps;
13879 	/* Number of Tx Key Contexts requested. */
13880 	uint32_t	num_tx_key_ctxs;
13881 	/* Number of Rx Key Contexts requested. */
13882 	uint32_t	num_rx_key_ctxs;
13883 	uint8_t	unused[4];
13884 } hwrm_func_vf_cfg_input_t, *phwrm_func_vf_cfg_input_t;
13885 
13886 /* hwrm_func_vf_cfg_output (size:128b/16B) */
13887 
13888 typedef struct hwrm_func_vf_cfg_output {
13889 	/* The specific error status for the command. */
13890 	uint16_t	error_code;
13891 	/* The HWRM command request type. */
13892 	uint16_t	req_type;
13893 	/* The sequence ID from the original command. */
13894 	uint16_t	seq_id;
13895 	/* The length of the response data in number of bytes. */
13896 	uint16_t	resp_len;
13897 	uint8_t	unused_0[7];
13898 	/*
13899 	 * This field is used in Output records to indicate that the output
13900 	 * is completely written to RAM.  This field should be read as '1'
13901 	 * to indicate that the output has been completely written.
13902 	 * When writing a command completion or response to an internal processor,
13903 	 * the order of writes has to be such that this field is written last.
13904 	 */
13905 	uint8_t	valid;
13906 } hwrm_func_vf_cfg_output_t, *phwrm_func_vf_cfg_output_t;
13907 
13908 /*******************
13909  * hwrm_func_qcaps *
13910  *******************/
13911 
13912 
13913 /* hwrm_func_qcaps_input (size:192b/24B) */
13914 
13915 typedef struct hwrm_func_qcaps_input {
13916 	/* The HWRM command request type. */
13917 	uint16_t	req_type;
13918 	/*
13919 	 * The completion ring to send the completion event on. This should
13920 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
13921 	 */
13922 	uint16_t	cmpl_ring;
13923 	/*
13924 	 * The sequence ID is used by the driver for tracking multiple
13925 	 * commands. This ID is treated as opaque data by the firmware and
13926 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
13927 	 */
13928 	uint16_t	seq_id;
13929 	/*
13930 	 * The target ID of the command:
13931 	 * * 0x0-0xFFF8 - The function ID
13932 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13933 	 * * 0xFFFD - Reserved for user-space HWRM interface
13934 	 * * 0xFFFF - HWRM
13935 	 */
13936 	uint16_t	target_id;
13937 	/*
13938 	 * A physical address pointer pointing to a host buffer that the
13939 	 * command's response data will be written. This can be either a host
13940 	 * physical address (HPA) or a guest physical address (GPA) and must
13941 	 * point to a physically contiguous block of memory.
13942 	 */
13943 	uint64_t	resp_addr;
13944 	/*
13945 	 * Function ID of the function that is being queried.
13946 	 * 0xFF... (All Fs) if the query is for the requesting
13947 	 * function.
13948 	 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
13949 	 * to be used by a trusted VF to query its parent PF.
13950 	 */
13951 	uint16_t	fid;
13952 	uint8_t	unused_0[6];
13953 } hwrm_func_qcaps_input_t, *phwrm_func_qcaps_input_t;
13954 
13955 /* hwrm_func_qcaps_output (size:768b/96B) */
13956 
13957 typedef struct hwrm_func_qcaps_output {
13958 	/* The specific error status for the command. */
13959 	uint16_t	error_code;
13960 	/* The HWRM command request type. */
13961 	uint16_t	req_type;
13962 	/* The sequence ID from the original command. */
13963 	uint16_t	seq_id;
13964 	/* The length of the response data in number of bytes. */
13965 	uint16_t	resp_len;
13966 	/*
13967 	 * FID value.  This value is used to identify operations on the PCI
13968 	 * bus as belonging to a particular PCI function.
13969 	 */
13970 	uint16_t	fid;
13971 	/*
13972 	 * Port ID of port that this function is associated with.
13973 	 * Valid only for the PF.
13974 	 * 0xFF... (All Fs) if this function is not associated with
13975 	 * any port.
13976 	 * 0xFF... (All Fs) if this function is called from a VF.
13977 	 */
13978 	uint16_t	port_id;
13979 	uint32_t	flags;
13980 	/* If 1, then Push mode is supported on this function. */
13981 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED		UINT32_C(0x1)
13982 	/*
13983 	 * If 1, then the global MSI-X auto-masking is enabled for the
13984 	 * device.
13985 	 */
13986 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING		UINT32_C(0x2)
13987 	/*
13988 	 * If 1, then the Precision Time Protocol (PTP) processing
13989 	 * is supported on this function.
13990 	 * The HWRM should enable PTP on only a single Physical
13991 	 * Function (PF) per port.
13992 	 */
13993 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED			UINT32_C(0x4)
13994 	/*
13995 	 * If 1, then RDMA over Converged Ethernet (RoCE) v1
13996 	 * is supported on this function.
13997 	 */
13998 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED			UINT32_C(0x8)
13999 	/*
14000 	 * If 1, then RDMA over Converged Ethernet (RoCE) v2
14001 	 * is supported on this function.
14002 	 */
14003 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED			UINT32_C(0x10)
14004 	/*
14005 	 * If 1, then control and configuration of WoL magic packet
14006 	 * are supported on this function.
14007 	 */
14008 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED		UINT32_C(0x20)
14009 	/*
14010 	 * If 1, then control and configuration of bitmap pattern
14011 	 * packet are supported on this function.
14012 	 */
14013 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED			UINT32_C(0x40)
14014 	/*
14015 	 * If set to 1, then the control and configuration of rate limit
14016 	 * of an allocated TX ring on the queried function is supported.
14017 	 */
14018 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED		UINT32_C(0x80)
14019 	/*
14020 	 * If 1, then control and configuration of minimum and
14021 	 * maximum bandwidths are supported on the queried function.
14022 	 */
14023 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED		UINT32_C(0x100)
14024 	/*
14025 	 * If the query is for a VF, then this flag shall be ignored.
14026 	 * If this query is for a PF and this flag is set to 1,
14027 	 * then the PF has the capability to set the rate limits
14028 	 * on the TX rings of its children VFs.
14029 	 * If this query is for a PF and this flag is set to 0, then
14030 	 * the PF does not have the capability to set the rate limits
14031 	 * on the TX rings of its children VFs.
14032 	 */
14033 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED		UINT32_C(0x200)
14034 	/*
14035 	 * If the query is for a VF, then this flag shall be ignored.
14036 	 * If this query is for a PF and this flag is set to 1,
14037 	 * then the PF has the capability to set the minimum and/or
14038 	 * maximum bandwidths for its children VFs.
14039 	 * If this query is for a PF and this flag is set to 0, then
14040 	 * the PF does not have the capability to set the minimum or
14041 	 * maximum bandwidths for its children VFs.
14042 	 */
14043 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED		UINT32_C(0x400)
14044 	/*
14045 	 * Standard TX Ring mode is used for the allocation of TX ring
14046 	 * and underlying scheduling resources that allow bandwidth
14047 	 * reservation and limit settings on the queried function.
14048 	 * If set to 1, then standard TX ring mode is supported
14049 	 * on the queried function.
14050 	 * If set to 0, then standard TX ring mode is not available
14051 	 * on the queried function.
14052 	 */
14053 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED		UINT32_C(0x800)
14054 	/*
14055 	 * If the query is for a VF, then this flag shall be ignored,
14056 	 * If this query is for a PF and this flag is set to 1,
14057 	 * then the PF has the capability to detect GENEVE tunnel
14058 	 * flags.
14059 	 */
14060 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED		UINT32_C(0x1000)
14061 	/*
14062 	 * If the query is for a VF, then this flag shall be ignored,
14063 	 * If this query is for a PF and this flag is set to 1,
14064 	 * then the PF has the capability to detect NVGRE tunnel
14065 	 * flags.
14066 	 */
14067 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED		UINT32_C(0x2000)
14068 	/*
14069 	 * If the query is for a VF, then this flag shall be ignored,
14070 	 * If this query is for a PF and this flag is set to 1,
14071 	 * then the PF has the capability to detect GRE tunnel
14072 	 * flags.
14073 	 */
14074 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED		UINT32_C(0x4000)
14075 	/*
14076 	 * If the query is for a VF, then this flag shall be ignored,
14077 	 * If this query is for a PF and this flag is set to 1,
14078 	 * then the PF has the capability to detect MPLS tunnel
14079 	 * flags.
14080 	 */
14081 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED		UINT32_C(0x8000)
14082 	/*
14083 	 * If the query is for a VF, then this flag shall be ignored,
14084 	 * If this query is for a PF and this flag is set to 1,
14085 	 * then the PF has the capability to support pcie stats.
14086 	 */
14087 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED		UINT32_C(0x10000)
14088 	/*
14089 	 * If the query is for a VF, then this flag shall be ignored,
14090 	 * If this query is for a PF and this flag is set to 1,
14091 	 * then the PF has the capability to adopt the VF's belonging
14092 	 * to another PF.
14093 	 */
14094 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED		UINT32_C(0x20000)
14095 	/*
14096 	 * If the query is for a VF, then this flag shall be ignored,
14097 	 * If this query is for a PF and this flag is set to 1,
14098 	 * then the PF has the administrative privilege to configure another PF
14099 	 */
14100 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED			UINT32_C(0x40000)
14101 	/*
14102 	 * If the query is for a VF, then this flag shall be ignored.
14103 	 * If this query is for a PF and this flag is set to 1, then
14104 	 * the PF will know that the firmware has the capability to track
14105 	 * the virtual link status.
14106 	 */
14107 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED	UINT32_C(0x80000)
14108 	/*
14109 	 * If 1, then this function supports the push mode that uses
14110 	 * write combine buffers and the long inline tx buffer descriptor.
14111 	 */
14112 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE			UINT32_C(0x100000)
14113 	/*
14114 	 * If 1, then FW has capability to allocate TX rings dynamically
14115 	 * in ring alloc even if PF reserved pool is zero.
14116 	 * This bit will be used only for PFs.
14117 	 */
14118 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC		UINT32_C(0x200000)
14119 	/*
14120 	 * When this bit is '1', it indicates that core firmware is
14121 	 * capable of Hot Reset.
14122 	 */
14123 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE			UINT32_C(0x400000)
14124 	/*
14125 	 * This flag will be set to 1 by the FW if FW supports adapter error
14126 	 * recovery.
14127 	 */
14128 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE		UINT32_C(0x800000)
14129 	/*
14130 	 * If the query is for a VF, then this flag shall be ignored.
14131 	 * If this query is for a PF and this flag is set to 1, then
14132 	 * the PF has the capability to support extended stats.
14133 	 */
14134 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED		UINT32_C(0x1000000)
14135 	/*
14136 	 * If the query is for a VF, then this flag shall be ignored.
14137 	 * If this query is for a PF and this flag is set to 1, then host
14138 	 * must initiate reset or reload (or fastboot) the firmware image
14139 	 * upon detection of device shutdown state.
14140 	 */
14141 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD			UINT32_C(0x2000000)
14142 	/*
14143 	 * If the query is for a VF, then this flag (always set to 0) shall
14144 	 * be ignored. If this query is for a PF and this flag is set to 1,
14145 	 * host, when registered for the default vnic change async event,
14146 	 * receives async notification whenever a default vnic state is
14147 	 * changed for any of child or adopted VFs.
14148 	 */
14149 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED	UINT32_C(0x4000000)
14150 	/* If set to 1, then the vlan acceleration for TX is disabled. */
14151 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED	UINT32_C(0x8000000)
14152 	/*
14153 	 * When this bit is '1', it indicates that core firmware supports
14154 	 * DBG_COREDUMP_XXX commands.
14155 	 */
14156 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED		UINT32_C(0x10000000)
14157 	/*
14158 	 * When this bit is '1', it indicates that core firmware supports
14159 	 * DBG_CRASHDUMP_XXX commands.
14160 	 */
14161 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED		UINT32_C(0x20000000)
14162 	/*
14163 	 * If the query is for a VF, then this flag should be ignored.
14164 	 * If the query is for a PF and this flag is set to 1, then
14165 	 * the PF has the capability to support retrieval of
14166 	 * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
14167 	 * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
14168 	 * If this flag is set to 1, only that (supported) command should
14169 	 * be used for retrieval of PFC related statistics (rather than
14170 	 * hwrm_port_qstats_ext command, which could previously be used).
14171 	 */
14172 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED		UINT32_C(0x40000000)
14173 	/*
14174 	 * When this bit is '1', it indicates that core firmware supports
14175 	 * DBG_QCAPS command
14176 	 */
14177 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED		UINT32_C(0x80000000)
14178 	/*
14179 	 * This value is current MAC address configured for this
14180 	 * function. A value of 00-00-00-00-00-00 indicates no
14181 	 * MAC address is currently configured.
14182 	 */
14183 	uint8_t	mac_address[6];
14184 	/*
14185 	 * The maximum number of RSS/COS contexts that can be
14186 	 * allocated to the function.
14187 	 */
14188 	uint16_t	max_rsscos_ctx;
14189 	/*
14190 	 * The maximum number of completion rings that can be
14191 	 * allocated to the function.
14192 	 */
14193 	uint16_t	max_cmpl_rings;
14194 	/*
14195 	 * The maximum number of transmit rings that can be
14196 	 * allocated to the function.
14197 	 */
14198 	uint16_t	max_tx_rings;
14199 	/*
14200 	 * The maximum number of receive rings that can be
14201 	 * allocated to the function.
14202 	 */
14203 	uint16_t	max_rx_rings;
14204 	/*
14205 	 * The maximum number of L2 contexts that can be
14206 	 * allocated to the function.
14207 	 */
14208 	uint16_t	max_l2_ctxs;
14209 	/*
14210 	 * The maximum number of VNICs that can be
14211 	 * allocated to the function.
14212 	 */
14213 	uint16_t	max_vnics;
14214 	/*
14215 	 * The identifier for the first VF enabled on a PF. This
14216 	 * is valid only on the PF with SR-IOV enabled.
14217 	 * 0xFF... (All Fs) if this command is called on a PF with
14218 	 * SR-IOV disabled or on a VF.
14219 	 */
14220 	uint16_t	first_vf_id;
14221 	/*
14222 	 * The maximum number of VFs that can be
14223 	 * allocated to the function. This is valid only on the
14224 	 * PF with SR-IOV enabled. 0xFF... (All Fs) if this
14225 	 * command is called on a PF with SR-IOV disabled or
14226 	 * on a VF.
14227 	 */
14228 	uint16_t	max_vfs;
14229 	/*
14230 	 * The maximum number of statistic contexts that can be
14231 	 * allocated to the function.
14232 	 */
14233 	uint16_t	max_stat_ctx;
14234 	/*
14235 	 * The maximum number of Encapsulation records that can be
14236 	 * offloaded by this function.
14237 	 */
14238 	uint32_t	max_encap_records;
14239 	/*
14240 	 * The maximum number of decapsulation records that can
14241 	 * be offloaded by this function.
14242 	 */
14243 	uint32_t	max_decap_records;
14244 	/*
14245 	 * The maximum number of Exact Match (EM) flows that can be
14246 	 * offloaded by this function on the TX side.
14247 	 */
14248 	uint32_t	max_tx_em_flows;
14249 	/*
14250 	 * The maximum number of Wildcard Match (WM) flows that can
14251 	 * be offloaded by this function on the TX side.
14252 	 */
14253 	uint32_t	max_tx_wm_flows;
14254 	/*
14255 	 * The maximum number of Exact Match (EM) flows that can be
14256 	 * offloaded by this function on the RX side.
14257 	 */
14258 	uint32_t	max_rx_em_flows;
14259 	/*
14260 	 * The maximum number of Wildcard Match (WM) flows that can
14261 	 * be offloaded by this function on the RX side.
14262 	 */
14263 	uint32_t	max_rx_wm_flows;
14264 	/*
14265 	 * The maximum number of multicast filters that can
14266 	 * be supported by this function on the RX side.
14267 	 */
14268 	uint32_t	max_mcast_filters;
14269 	/*
14270 	 * The maximum value of flow_id that can be supported
14271 	 * in completion records.
14272 	 */
14273 	uint32_t	max_flow_id;
14274 	/*
14275 	 * The maximum number of HW ring groups that can be
14276 	 * supported on this function.
14277 	 */
14278 	uint32_t	max_hw_ring_grps;
14279 	/*
14280 	 * The maximum number of strict priority transmit rings
14281 	 * that can be allocated to the function.
14282 	 * This number indicates the maximum number of TX rings
14283 	 * that can be assigned strict priorities out of the
14284 	 * maximum number of TX rings that can be allocated
14285 	 * (max_tx_rings) to the function.
14286 	 */
14287 	uint16_t	max_sp_tx_rings;
14288 	/*
14289 	 * The maximum number of MSI-X vectors that may be allocated across
14290 	 * all VFs for the function. This is valid only on the PF with SR-IOV
14291 	 * enabled. Returns zero if this command is called on a PF with
14292 	 * SR-IOV disabled or on a VF.
14293 	 */
14294 	uint16_t	max_msix_vfs;
14295 	uint32_t	flags_ext;
14296 	/*
14297 	 * If 1, the device can be configured to set the ECN bits in the
14298 	 * IP header of received packets if the receive queue length
14299 	 * exceeds a given threshold.
14300 	 */
14301 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED			UINT32_C(0x1)
14302 	/*
14303 	 * If 1, the device can report the number of received packets
14304 	 * that it marked as having experienced congestion.
14305 	 */
14306 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED			UINT32_C(0x2)
14307 	/*
14308 	 * If 1, the device can report extended hw statistics (including
14309 	 * additional tpa statistics).
14310 	 */
14311 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED			UINT32_C(0x4)
14312 	/*
14313 	 * If set to 1, then the core firmware has support to enable/
14314 	 * disable hot reset support for interface dynamically through
14315 	 * HWRM_FUNC_CFG.
14316 	 */
14317 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT			UINT32_C(0x8)
14318 	/* If 1, the proxy mode is supported on this function */
14319 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT			UINT32_C(0x10)
14320 	/*
14321 	 * If 1, the tx rings source interface override feature is supported
14322 	 * on this function.
14323 	 */
14324 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT	UINT32_C(0x20)
14325 	/*
14326 	 * If 1, the device supports scheduler queues. SCHQs can be managed
14327 	 * using RING_SCHQ_ALLOC/CFG/FREE commands.
14328 	 */
14329 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED				UINT32_C(0x40)
14330 	/*
14331 	 * If set to 1, then this function supports the TX push mode that
14332 	 * uses ping-pong buffers from the push pages.
14333 	 */
14334 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED			UINT32_C(0x80)
14335 	/*
14336 	 * If set to 1, then this function doesn't have the privilege to
14337 	 * configure the EVB mode of the port it uses.
14338 	 */
14339 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EVB_MODE_CFG_NOT_SUPPORTED		UINT32_C(0x100)
14340 	/*
14341 	 * If set to 1, then the HW and FW support the SoC packet DMA
14342 	 * datapath between SoC and NIC. This function can act as the
14343 	 * HWRM communication transport agent on behalf of the SoC SPD
14344 	 * software module. This capability is only advertised to the
14345 	 * SoC PFs.
14346 	 */
14347 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SOC_SPD_SUPPORTED			UINT32_C(0x200)
14348 	/*
14349 	 * If set to 1, then this function supports FW_LIVEPATCH for
14350 	 * firmware livepatch commands.
14351 	 */
14352 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED			UINT32_C(0x400)
14353 	/*
14354 	 * When this bit is '1', it indicates that core firmware is
14355 	 * capable of fast Reset.
14356 	 */
14357 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FAST_RESET_CAPABLE			UINT32_C(0x800)
14358 	/*
14359 	 * When this bit is '1', it indicates that firmware and hardware
14360 	 * are capable of updating tx_metadata via hwrm_ring_cfg command.
14361 	 */
14362 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_METADATA_CFG_CAPABLE			UINT32_C(0x1000)
14363 	/*
14364 	 * If set to 1, then the device can report the action
14365 	 * needed to activate set nvm options.
14366 	 */
14367 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NVM_OPTION_ACTION_SUPPORTED		UINT32_C(0x2000)
14368 	/*
14369 	 * When this bit is '1', it indicates that the BD metadata feature
14370 	 * is supported for this function.
14371 	 */
14372 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BD_METADATA_SUPPORTED			UINT32_C(0x4000)
14373 	/*
14374 	 * When this bit is '1', it indicates that the echo request feature
14375 	 * is supported for this function. If the driver registers for the
14376 	 * echo request asynchronous event, then the firmware can send an
14377 	 * unsolicited echo request to the driver and expect an echo
14378 	 * response.
14379 	 */
14380 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECHO_REQUEST_SUPPORTED			UINT32_C(0x8000)
14381 	/*
14382 	 * When this bit is '1', it indicates that core firmware supports
14383 	 * NPAR 1.2 on this function.
14384 	 */
14385 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NPAR_1_2_SUPPORTED			UINT32_C(0x10000)
14386 	/* When this bit is '1', it indicates that PTM feature is supported. */
14387 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PTM_SUPPORTED			UINT32_C(0x20000)
14388 	/* When this bit is '1', it indicates that PPS feature is supported. */
14389 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PPS_SUPPORTED			UINT32_C(0x40000)
14390 	/*
14391 	 * When this bit is '1', it indicates that VF config. change
14392 	 * async event is supported on the parent PF if the async.
14393 	 * event is registered by the PF.
14394 	 */
14395 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_VF_CFG_ASYNC_FOR_PF_SUPPORTED		UINT32_C(0x80000)
14396 	/*
14397 	 * When this bit is '1', the NIC supports configuration of
14398 	 * partition_min_bw and partition_max_bw. Configuration of a
14399 	 * minimum guaranteed bandwidth is only supported if the
14400 	 * min_bw_supported flag is also set.
14401 	 */
14402 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PARTITION_BW_SUPPORTED			UINT32_C(0x100000)
14403 	/*
14404 	 * When this bit is '1', the FW supports configuration of
14405 	 * PCP and TPID values of the default VLAN.
14406 	 */
14407 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED		UINT32_C(0x200000)
14408 	/* When this bit is '1', it indicates that HW and FW support KTLS. */
14409 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_KTLS_SUPPORTED				UINT32_C(0x400000)
14410 	/*
14411 	 * When this bit is '1', the firmware supports HWRM_PORT_EP_TX_CFG
14412 	 * and HWRM_PORT_EP_TX_QCFG for endpoint rate control, and additions
14413 	 * to HWRM_QUEUE_GLOBAL_CFG and HWRM_QUEUE_GLOBAL_QCFG for receive
14414 	 * rate control. Configuration of a minimum guaranteed bandwidth
14415 	 * is only supported if the min_bw_supported flag is also set.
14416 	 */
14417 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EP_RATE_CONTROL				UINT32_C(0x800000)
14418 	/*
14419 	 * When this bit is '1', the firmware supports enforcement of
14420 	 * minimum guaranteed bandwidth. A minimum guaranteed bandwidth
14421 	 * could be configured for a partition or for an endpoint. Firmware
14422 	 * only sets this flag if one or both of the ep_rate_control and
14423 	 * partition_bw_supported flags are set.
14424 	 */
14425 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_MIN_BW_SUPPORTED				UINT32_C(0x1000000)
14426 	/*
14427 	 * When this bit is '1', HW supports TX coalesced completion
14428 	 * records.
14429 	 */
14430 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_COAL_CMPL_CAP				UINT32_C(0x2000000)
14431 	/*
14432 	 * When this bit is '1', it indicates the FW has full support
14433 	 * for all backing store types with the BACKING_STORE_CFG/QCFG
14434 	 * V2 APIs.
14435 	 */
14436 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_SUPPORTED				UINT32_C(0x4000000)
14437 	/*
14438 	 * When this bit is '1', it indicates the FW forces to use the
14439 	 * BACKING_STORE_CFG/QCFG V2 APIs.
14440 	 */
14441 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_REQUIRED				UINT32_C(0x8000000)
14442 	/*
14443 	 * When this bit is '1', it indicates that FW will support a single
14444 	 * 64bit real time clock for PTP.
14445 	 */
14446 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_64BIT_RTC_SUPPORTED			UINT32_C(0x10000000)
14447 	/*
14448 	 * When this bit is '1', it indicates the FW is capable of
14449 	 * supporting Doorbell Pacing.
14450 	 */
14451 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DBR_PACING_SUPPORTED			UINT32_C(0x20000000)
14452 	/*
14453 	 * When this bit is '1', it indicates the FW is capable of
14454 	 * supporting HW based doorbell drop recovery.
14455 	 */
14456 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HW_DBR_DROP_RECOV_SUPPORTED		UINT32_C(0x40000000)
14457 	/*
14458 	 * When this bit is '1', it indicates the driver can disable the CQ
14459 	 * overflow detection and can also skip the index updates for CQ.
14460 	 */
14461 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DISABLE_CQ_OVERFLOW_DETECTION_SUPPORTED	UINT32_C(0x80000000)
14462 	/* The maximum number of SCHQs supported by this device. */
14463 	uint8_t	max_schqs;
14464 	uint8_t	mpc_chnls_cap;
14465 	/*
14466 	 * When this bit is '1', it indicates that HW and firmware
14467 	 * supports the use of a MPC channel with destination set
14468 	 * to the TX crypto engine block.
14469 	 */
14470 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TCE	UINT32_C(0x1)
14471 	/*
14472 	 * When this bit is '1', it indicates that HW and firmware
14473 	 * supports the use of a MPC channel with destination set
14474 	 * to the RX crypto engine block.
14475 	 */
14476 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RCE	UINT32_C(0x2)
14477 	/*
14478 	 * When this bit is '1', it indicates that HW and firmware
14479 	 * supports the use of a MPC channel with destination set
14480 	 * to the TX configurable flow processing block.
14481 	 */
14482 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TE_CFA	UINT32_C(0x4)
14483 	/*
14484 	 * When this bit is '1', it indicates that HW and firmware
14485 	 * supports the use of a MPC channel with destination set
14486 	 * to the RX configurable flow processing block.
14487 	 */
14488 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RE_CFA	UINT32_C(0x8)
14489 	/*
14490 	 * When this bit is '1', it indicates that HW and firmware
14491 	 * supports the use of a MPC channel with destination set
14492 	 * to the primate processor block.
14493 	 */
14494 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_PRIMATE	UINT32_C(0x10)
14495 	/*
14496 	 * Maximum number of Key Contexts supported per HWRM
14497 	 * function call for allocating Key Contexts.
14498 	 */
14499 	uint16_t	max_key_ctxs_alloc;
14500 	uint32_t	flags_ext2;
14501 	/*
14502 	 * When this bit is '1', it indicates that FW will support
14503 	 * timestamping on all RX packets, not just PTP type packets.
14504 	 */
14505 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED	UINT32_C(0x1)
14506 	/* When this bit is '1', it indicates that HW and FW support QUIC. */
14507 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_QUIC_SUPPORTED			UINT32_C(0x2)
14508 	/*
14509 	 * When this bit is '1', it indicates that KDNet mode is
14510 	 * supported on the port for this function.  This bit is
14511 	 * never set for a VF.
14512 	 */
14513 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_KDNET_SUPPORTED			UINT32_C(0x4)
14514 	/*
14515 	 * When this bit is '1', it indicates the FW is capable of
14516 	 * supporting Enhanced Doorbell Pacing.
14517 	 */
14518 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_DBR_PACING_EXT_SUPPORTED		UINT32_C(0x8)
14519 	/*
14520 	 * When this bit is '1', it indicates that FW is capable of
14521 	 * supporting software based doorbell drop recovery.
14522 	 */
14523 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SW_DBR_DROP_RECOVERY_SUPPORTED	UINT32_C(0x10)
14524 	/*
14525 	 * When this bit is '1', it indicates the FW supports collection
14526 	 * and query of the generic statistics.
14527 	 */
14528 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_GENERIC_STATS_SUPPORTED		UINT32_C(0x20)
14529 	/*
14530 	 * When this bit is '1', it indicates that the HW is capable of
14531 	 * supporting UDP GSO on the function.
14532 	 */
14533 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED			UINT32_C(0x40)
14534 	/*
14535 	 * When this bit is '1', it indicates that SyncE feature is
14536 	 * supported.
14537 	 */
14538 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SYNCE_SUPPORTED			UINT32_C(0x80)
14539 	/*
14540 	 * When this bit is '1', it indicates the FW is capable of
14541 	 * supporting doorbell pacing version 0. As doorbell pacing
14542 	 * notification from hardware for Thor2 is completely different
14543 	 * from Thor1, this flag is used to differentiate the doorbell
14544 	 * pacing notification between Thor1 and Thor2. Thor1 uses
14545 	 * dbr_pacing_supported and dbr_pacing_ext_supported flags for
14546 	 * doorbell pacing whereas Thor2 uses dbr_pacing_v0_supported flag.
14547 	 * These flags will never be set at the same time for Thor2.
14548 	 * Based on this flag, host drivers assume doorbell pacing is needed
14549 	 * for Thor2.
14550 	 */
14551 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_DBR_PACING_V0_SUPPORTED		UINT32_C(0x100)
14552 	/*
14553 	 * When this bit is '1', it indicates that the HW supports
14554 	 * two-completion TX packet timestamp feature, a second completion
14555 	 * carrying packet TX timestamp in addition to the standard
14556 	 * completion returned for packets. Host driver should not use
14557 	 * HWRM port timestamp query (HWRM_PORT_TS_QUERY) command for
14558 	 * TX timestamp read when two-completion timestamp feature is
14559 	 * supported.
14560 	 */
14561 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TX_PKT_TS_CMPL_SUPPORTED		UINT32_C(0x200)
14562 	/*
14563 	 * When this bit is '1', it indicates that the hardware based
14564 	 * link aggregation group (L2 and RoCE) feature is supported.
14565 	 */
14566 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_HW_LAG_SUPPORTED			UINT32_C(0x400)
14567 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_ON_CHIP_CTX_SUPPORTED                 UINT32_C(0x800)
14568 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_STEERING_TAG_SUPPORTED                UINT32_C(0x1000)
14569 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_ENHANCED_VF_SCALE_SUPPORTED           UINT32_C(0x2000)
14570 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_KEY_XID_PARTITION_SUPPORTED           UINT32_C(0x4000)
14571 	uint16_t	tunnel_disable_flag;
14572 	/*
14573 	 * When this bit is '1', it indicates that the VXLAN parsing
14574 	 * is disabled in hardware
14575 	 */
14576 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN	UINT32_C(0x1)
14577 	/*
14578 	 * When this bit is '1', it indicates that the NGE parsing
14579 	 * is disabled in hardware
14580 	 */
14581 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NGE	UINT32_C(0x2)
14582 	/*
14583 	 * When this bit is '1', it indicates that the NVGRE parsing
14584 	 * is disabled in hardware
14585 	 */
14586 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NVGRE	UINT32_C(0x4)
14587 	/*
14588 	 * When this bit is '1', it indicates that the L2GRE parsing
14589 	 * is disabled in hardware
14590 	 */
14591 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_L2GRE	UINT32_C(0x8)
14592 	/*
14593 	 * When this bit is '1', it indicates that the GRE parsing
14594 	 * is disabled in hardware
14595 	 */
14596 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_GRE	UINT32_C(0x10)
14597 	/*
14598 	 * When this bit is '1', it indicates that the IPINIP parsing
14599 	 * is disabled in hardware
14600 	 */
14601 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_IPINIP	UINT32_C(0x20)
14602 	/*
14603 	 * When this bit is '1', it indicates that the MPLS parsing
14604 	 * is disabled in hardware
14605 	 */
14606 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_MPLS	UINT32_C(0x40)
14607 	/*
14608 	 * When this bit is '1', it indicates that the PPPOE parsing
14609 	 * is disabled in hardware
14610 	 */
14611 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_PPPOE	UINT32_C(0x80)
14612 	uint8_t	unused_1;
14613 	/*
14614 	 * This field is used in Output records to indicate that the output
14615 	 * is completely written to RAM.  This field should be read as '1'
14616 	 * to indicate that the output has been completely written.
14617 	 * When writing a command completion or response to an internal
14618 	 * processor, the order of writes has to be such that this field is
14619 	 * written last.
14620 	 */
14621 	uint8_t	valid;
14622 } hwrm_func_qcaps_output_t, *phwrm_func_qcaps_output_t;
14623 
14624 /******************
14625  * hwrm_func_qcfg *
14626  ******************/
14627 
14628 
14629 /* hwrm_func_qcfg_input (size:192b/24B) */
14630 
14631 typedef struct hwrm_func_qcfg_input {
14632 	/* The HWRM command request type. */
14633 	uint16_t	req_type;
14634 	/*
14635 	 * The completion ring to send the completion event on. This should
14636 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14637 	 */
14638 	uint16_t	cmpl_ring;
14639 	/*
14640 	 * The sequence ID is used by the driver for tracking multiple
14641 	 * commands. This ID is treated as opaque data by the firmware and
14642 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14643 	 */
14644 	uint16_t	seq_id;
14645 	/*
14646 	 * The target ID of the command:
14647 	 * * 0x0-0xFFF8 - The function ID
14648 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14649 	 * * 0xFFFD - Reserved for user-space HWRM interface
14650 	 * * 0xFFFF - HWRM
14651 	 */
14652 	uint16_t	target_id;
14653 	/*
14654 	 * A physical address pointer pointing to a host buffer that the
14655 	 * command's response data will be written. This can be either a host
14656 	 * physical address (HPA) or a guest physical address (GPA) and must
14657 	 * point to a physically contiguous block of memory.
14658 	 */
14659 	uint64_t	resp_addr;
14660 	/*
14661 	 * Function ID of the function that is being queried.
14662 	 * 0xFF... (All Fs) if the query is for the requesting
14663 	 * function.
14664 	 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
14665 	 * to be used by a trusted VF to query its parent PF.
14666 	 */
14667 	uint16_t	fid;
14668 	uint8_t	unused_0[6];
14669 } hwrm_func_qcfg_input_t, *phwrm_func_qcfg_input_t;
14670 
14671 /* hwrm_func_qcfg_output (size:1024b/128B) */
14672 
14673 typedef struct hwrm_func_qcfg_output {
14674 	/* The specific error status for the command. */
14675 	uint16_t	error_code;
14676 	/* The HWRM command request type. */
14677 	uint16_t	req_type;
14678 	/* The sequence ID from the original command. */
14679 	uint16_t	seq_id;
14680 	/* The length of the response data in number of bytes. */
14681 	uint16_t	resp_len;
14682 	/*
14683 	 * FID value.  This value is used to identify operations on the PCI
14684 	 * bus as belonging to a particular PCI function.
14685 	 */
14686 	uint16_t	fid;
14687 	/*
14688 	 * Port ID of port that this function is associated with.
14689 	 * 0xFF... (All Fs) if this function is not associated with
14690 	 * any port.
14691 	 */
14692 	uint16_t	port_id;
14693 	/*
14694 	 * This value is the current VLAN setting for this
14695 	 * function. The value of 0 for this field indicates
14696 	 * no priority tagging or VLAN is used.
14697 	 * This field's format is same as 802.1Q Tag's
14698 	 * Tag Control Information (TCI) format that includes both
14699 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
14700 	 */
14701 	uint16_t	vlan;
14702 	uint16_t	flags;
14703 	/*
14704 	 * If 1, then magic packet based Out-Of-Box WoL is enabled on
14705 	 * the port associated with this function.
14706 	 */
14707 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED	UINT32_C(0x1)
14708 	/*
14709 	 * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
14710 	 * on the port associated with this function.
14711 	 */
14712 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED	UINT32_C(0x2)
14713 	/*
14714 	 * If set to 1, then FW based DCBX agent is enabled and running on
14715 	 * the port associated with this function.
14716 	 * If set to 0, then DCBX agent is not running in the firmware.
14717 	 */
14718 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED	UINT32_C(0x4)
14719 	/*
14720 	 * Standard TX Ring mode is used for the allocation of TX ring
14721 	 * and underlying scheduling resources that allow bandwidth
14722 	 * reservation and limit settings on the queried function.
14723 	 * If set to 1, then standard TX ring mode is enabled
14724 	 * on the queried function.
14725 	 * If set to 0, then the standard TX ring mode is disabled
14726 	 * on the queried function. In this extended TX ring resource
14727 	 * mode, the minimum and maximum bandwidth settings are not
14728 	 * supported to allow the allocation of TX rings to span multiple
14729 	 * scheduler nodes.
14730 	 */
14731 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED	UINT32_C(0x8)
14732 	/*
14733 	 * If set to 1 then FW based LLDP agent is enabled and running on
14734 	 * the port associated with this function.
14735 	 * If set to 0 then the LLDP agent is not running in the firmware.
14736 	 */
14737 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED	UINT32_C(0x10)
14738 	/*
14739 	 * If set to 1, then multi-host mode is active for this function.
14740 	 * The NIC is attached to two or more independent host systems
14741 	 * through two or more PCIe endpoints.
14742 	 * If set to 0, then multi-host mode is inactive for this function
14743 	 * or not applicable for this device.
14744 	 */
14745 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST		UINT32_C(0x20)
14746 	/*
14747 	 * If the function that is being queried is a PF, then the HWRM shall
14748 	 * set this field to 0 and the HWRM client shall ignore this field.
14749 	 * If the function that is being queried is a VF, then the HWRM shall
14750 	 * set this field to 1 if the queried VF is trusted, otherwise the HWRM
14751 	 * shall set this field to 0.
14752 	 */
14753 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF		UINT32_C(0x40)
14754 	/*
14755 	 * If set to 1, then secure mode is enabled for this function or device.
14756 	 * If set to 0, then secure mode is disabled (or normal mode) for this
14757 	 * function or device.
14758 	 */
14759 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED	UINT32_C(0x80)
14760 	/*
14761 	 * If set to 1, then this PF is enabled with a preboot driver that
14762 	 * requires access to the legacy L2 ring model and legacy 32b
14763 	 * doorbells. If set to 0, then this PF is not allowed to use
14764 	 * the legacy L2 rings. This feature is not allowed on VFs and
14765 	 * is only relevant for devices that require a context backing
14766 	 * store.
14767 	 */
14768 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS	UINT32_C(0x100)
14769 	/*
14770 	 * If set to 1, then the firmware and all currently registered driver
14771 	 * instances support hot reset. The hot reset support will be updated
14772 	 * dynamically based on the driver interface advertisement.
14773 	 * If set to 0, then the adapter is not currently able to initiate
14774 	 * hot reset.
14775 	 */
14776 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED		UINT32_C(0x200)
14777 	/*
14778 	 * If set to 1, then the PPP tx push mode is enabled for all the
14779 	 * reserved TX rings of this function. If set to 0, then PPP tx push
14780 	 * mode is disabled for all the reserved TX rings of this function.
14781 	 */
14782 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED	UINT32_C(0x400)
14783 	/*
14784 	 * If set to 1, then the firmware will notify driver using async
14785 	 * event when a ring is disabled due to a Hardware error.
14786 	 */
14787 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_RING_MONITOR_ENABLED	UINT32_C(0x800)
14788 	/*
14789 	 * If set to 1, then the firmware and all currently registered driver
14790 	 * instances support fast reset. The fast reset support will be
14791 	 * updated dynamically based on the driver interface advertisement.
14792 	 * If set to 0, then the adapter is not currently able to initiate
14793 	 * fast reset.
14794 	 */
14795 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FAST_RESET_ALLOWED	UINT32_C(0x1000)
14796 	/*
14797 	 * If set to 1, then multi-root mode is active for this function.
14798 	 * The NIC is attached to a single host with a single operating
14799 	 * system, but through two or more PCIe endpoints.
14800 	 * If set to 0, then multi-root mode is inactive for this function
14801 	 * or not applicable for this device.
14802 	 */
14803 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_ROOT		UINT32_C(0x2000)
14804 	/*
14805 	 * This flag indicates RDMA support for child VFS of
14806 	 * a physical function.
14807 	 * If set to 1, RoCE is supported on all child VFs.
14808 	 * If set to 0, RoCE is disabled on all child VFs.
14809 	 */
14810 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_ENABLE_RDMA_SRIOV		UINT32_C(0x4000)
14811 	/*
14812 	 * This value is current MAC address configured for this
14813 	 * function. A value of 00-00-00-00-00-00 indicates no
14814 	 * MAC address is currently configured.
14815 	 */
14816 	uint8_t	mac_address[6];
14817 	/*
14818 	 * This value is current PCI ID of this
14819 	 * function. If ARI is enabled, then it is
14820 	 * Bus Number (8b):Function Number(8b). Otherwise, it is
14821 	 * Bus Number (8b):Device Number (4b):Function Number(4b).
14822 	 * If multi-host mode is active, the 4 lsb will indicate
14823 	 * the PF index for this function.
14824 	 */
14825 	uint16_t	pci_id;
14826 	/*
14827 	 * The number of RSS/COS contexts currently
14828 	 * allocated to the function.
14829 	 */
14830 	uint16_t	alloc_rsscos_ctx;
14831 	/*
14832 	 * The number of completion rings currently allocated to
14833 	 * the function. This does not include the rings allocated
14834 	 * to any children functions if any.
14835 	 */
14836 	uint16_t	alloc_cmpl_rings;
14837 	/*
14838 	 * The number of transmit rings currently allocated to
14839 	 * the function. This does not include the rings allocated
14840 	 * to any children functions if any.
14841 	 */
14842 	uint16_t	alloc_tx_rings;
14843 	/*
14844 	 * The number of receive rings currently allocated to
14845 	 * the function. This does not include the rings allocated
14846 	 * to any children functions if any.
14847 	 */
14848 	uint16_t	alloc_rx_rings;
14849 	/* The allocated number of L2 contexts to the function. */
14850 	uint16_t	alloc_l2_ctx;
14851 	/* The allocated number of vnics to the function. */
14852 	uint16_t	alloc_vnics;
14853 	/*
14854 	 * The maximum transmission unit of the function
14855 	 * configured by the admin pf.
14856 	 * If the reported mtu value is non-zero then it will be used for the
14857 	 * rings allocated on this function, otherwise the default
14858 	 * value is used if ring MTU is not specified.
14859 	 * The driver cannot use any MTU bigger than this value
14860 	 * if it is non-zero.
14861 	 */
14862 	uint16_t	admin_mtu;
14863 	/*
14864 	 * The maximum receive unit of the function.
14865 	 * For vnics allocated on this function, this default
14866 	 * value is used if vnic MRU is not specified.
14867 	 */
14868 	uint16_t	mru;
14869 	/* The statistics context assigned to a function. */
14870 	uint16_t	stat_ctx_id;
14871 	/*
14872 	 * The HWRM shall return Unknown value for this field
14873 	 * when this command is used to query VF's configuration.
14874 	 */
14875 	uint8_t	port_partition_type;
14876 	/* Single physical function */
14877 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF	UINT32_C(0x0)
14878 	/* Multiple physical functions */
14879 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS	UINT32_C(0x1)
14880 	/* Network Partitioning 1.0 */
14881 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
14882 	/* Network Partitioning 1.5 */
14883 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
14884 	/* Network Partitioning 2.0 */
14885 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
14886 	/* Network Partitioning 1.2 */
14887 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_2 UINT32_C(0x5)
14888 	/* Unknown */
14889 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
14890 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST   HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
14891 	/*
14892 	 * This field will indicate number of physical functions on this port_partition.
14893 	 * HWRM shall return unavail (i.e. value of 0) for this field
14894 	 * when this command is used to query VF's configuration or
14895 	 * from older firmware that doesn't support this field.
14896 	 */
14897 	uint8_t	port_pf_cnt;
14898 	/* number of PFs is not available */
14899 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
14900 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST   HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
14901 	/*
14902 	 * The default VNIC ID assigned to a function that is
14903 	 * being queried.
14904 	 */
14905 	uint16_t	dflt_vnic_id;
14906 	uint16_t	max_mtu_configured;
14907 	/*
14908 	 * Minimum guaranteed transmit bandwidth for this function. When
14909 	 * specified for a PF, does not affect traffic from the PF's child VFs.
14910 	 * A value of 0 indicates the minimum bandwidth is not configured.
14911 	 */
14912 	uint32_t	min_bw;
14913 	/* The bandwidth value. */
14914 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
14915 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT		0
14916 	/* The granularity of the value (bits or bytes). */
14917 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE			UINT32_C(0x10000000)
14918 	/* Value is in bits. */
14919 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
14920 	/* Value is in bytes. */
14921 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
14922 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
14923 	/* bw_value_unit is 3 b */
14924 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
14925 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
14926 	/* Value is in Mb or MB (base 10). */
14927 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
14928 	/* Value is in Kb or KB (base 10). */
14929 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
14930 	/* Value is in bits or bytes. */
14931 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
14932 	/* Value is in Gb or GB (base 10). */
14933 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
14934 	/* Value is in 1/100th of a percentage of link bandwidth. */
14935 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
14936 	/* Invalid unit */
14937 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
14938 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
14939 	/*
14940 	 * Maximum transmit rate for this function. When specified for a PF,
14941 	 * does not affect traffic from the PF's child VFs.
14942 	 * A value of 0 indicates that the maximum bandwidth is not configured.
14943 	 */
14944 	uint32_t	max_bw;
14945 	/* The bandwidth value. */
14946 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
14947 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT		0
14948 	/* The granularity of the value (bits or bytes). */
14949 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
14950 	/* Value is in bits. */
14951 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
14952 	/* Value is in bytes. */
14953 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
14954 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
14955 	/* bw_value_unit is 3 b */
14956 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
14957 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
14958 	/* Value is in Mb or MB (base 10). */
14959 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
14960 	/* Value is in Kb or KB (base 10). */
14961 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
14962 	/* Value is in bits or bytes. */
14963 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
14964 	/* Value is in Gb or GB (base 10). */
14965 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
14966 	/* Value is in 1/100th of a percentage of link bandwidth. */
14967 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
14968 	/* Invalid unit */
14969 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
14970 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
14971 	/*
14972 	 * This value indicates the Edge virtual bridge mode for the
14973 	 * domain that this function belongs to.
14974 	 */
14975 	uint8_t	evb_mode;
14976 	/* No Edge Virtual Bridging (EVB) */
14977 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
14978 	/* Virtual Ethernet Bridge (VEB) */
14979 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB	UINT32_C(0x1)
14980 	/* Virtual Ethernet Port Aggregator (VEPA) */
14981 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
14982 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST  HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
14983 	uint8_t	options;
14984 	/*
14985 	 * This value indicates the PCIE device cache line size.
14986 	 * The cache line size allows the DMA writes to terminate and
14987 	 * start at the cache boundary.
14988 	 */
14989 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK	UINT32_C(0x3)
14990 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT	0
14991 	/* Cache Line Size 64 bytes */
14992 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64	UINT32_C(0x0)
14993 	/* Cache Line Size 128 bytes */
14994 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128	UINT32_C(0x1)
14995 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST	HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
14996 	/* This value is the virtual link admin state setting. */
14997 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK	UINT32_C(0xc)
14998 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT	2
14999 	/* Admin link state is in forced down mode. */
15000 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN  (UINT32_C(0x0) << 2)
15001 	/* Admin link state is in forced up mode. */
15002 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP	(UINT32_C(0x1) << 2)
15003 	/* Admin link state is in auto mode  - follows the physical link state. */
15004 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO	(UINT32_C(0x2) << 2)
15005 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST	HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
15006 	/* Reserved for future. */
15007 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK		UINT32_C(0xf0)
15008 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT			4
15009 	/*
15010 	 * The number of VFs that are allocated to the function.
15011 	 * This is valid only on the PF with SR-IOV enabled.
15012 	 * 0xFF... (All Fs) if this command is called on a PF with
15013 	 * SR-IOV disabled or on a VF.
15014 	 */
15015 	uint16_t	alloc_vfs;
15016 	/*
15017 	 * The number of allocated multicast filters for this
15018 	 * function on the RX side.
15019 	 */
15020 	uint32_t	alloc_mcast_filters;
15021 	/*
15022 	 * The number of allocated HW ring groups for this
15023 	 * function.
15024 	 */
15025 	uint32_t	alloc_hw_ring_grps;
15026 	/*
15027 	 * The number of strict priority transmit rings out of
15028 	 * currently allocated TX rings to the function
15029 	 * (alloc_tx_rings).
15030 	 */
15031 	uint16_t	alloc_sp_tx_rings;
15032 	/*
15033 	 * The number of statistics contexts
15034 	 * currently reserved for the function.
15035 	 */
15036 	uint16_t	alloc_stat_ctx;
15037 	/*
15038 	 * This field specifies how many NQs are reserved for the PF.
15039 	 * Remaining NQs that belong to the PF are available for VFs.
15040 	 * Once a PF has created VFs, it cannot change how many NQs are
15041 	 * reserved for itself (since the NQs must be contiguous in HW).
15042 	 */
15043 	uint16_t	alloc_msix;
15044 	/*
15045 	 * The number of registered VF’s associated with the PF. This field
15046 	 * should be ignored when the request received on the VF interface.
15047 	 * This field will be updated on the PF interface to initiate
15048 	 * the unregister request on PF in the HOT Reset Process.
15049 	 */
15050 	uint16_t	registered_vfs;
15051 	/*
15052 	 * The size of the doorbell BAR in KBytes reserved for L2 including
15053 	 * any area that is shared between L2 and RoCE.  The L2 driver
15054 	 * should only map the L2 portion of the doorbell BAR.  Any rounding
15055 	 * of the BAR size to the native CPU page size should be performed
15056 	 * by the driver.  If the value is zero, no special partitioning
15057 	 * of the doorbell BAR between L2 and RoCE is required.
15058 	 */
15059 	uint16_t	l2_doorbell_bar_size_kb;
15060 	uint8_t	unused_1;
15061 	/*
15062 	 * For backward compatibility this field must be set to 1.
15063 	 * Older drivers might look for this field to be 1 before
15064 	 * processing the message.
15065 	 */
15066 	uint8_t	always_1;
15067 	/*
15068 	 * This GRC address location is used by the Host driver interfaces to poll
15069 	 * the adapter ready state to re-initiate the registration process again
15070 	 * after receiving the RESET Notify event.
15071 	 */
15072 	uint32_t	reset_addr_poll;
15073 	/*
15074 	 * This field specifies legacy L2 doorbell size in KBytes. Drivers should use
15075 	 * this value to find out the doorbell page offset from the BAR.
15076 	 */
15077 	uint16_t	legacy_l2_db_size_kb;
15078 	uint16_t	svif_info;
15079 	/*
15080 	 * This field specifies the source virtual interface of the function being
15081 	 * queried. Drivers can use this to program svif field in the L2 context
15082 	 * table
15083 	 */
15084 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK	UINT32_C(0x7fff)
15085 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT	0
15086 	/* This field specifies whether svif is valid or not */
15087 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID	UINT32_C(0x8000)
15088 	uint8_t	mpc_chnls;
15089 	/*
15090 	 * When this bit is '1', it indicates that a MPC channel with
15091 	 * destination set to the TX crypto engine block is enabled.
15092 	 */
15093 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TCE_ENABLED	UINT32_C(0x1)
15094 	/*
15095 	 * When this bit is '1', it indicates that a MPC channel with
15096 	 * destination set to the RX crypto engine block is enabled.
15097 	 */
15098 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RCE_ENABLED	UINT32_C(0x2)
15099 	/*
15100 	 * When this bit is '1', it indicates that a MPC channel with
15101 	 * destination set to the TX configurable flow processing block is
15102 	 * enabled.
15103 	 */
15104 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TE_CFA_ENABLED	UINT32_C(0x4)
15105 	/*
15106 	 * When this bit is '1', it indicates that a MPC channel with
15107 	 * destination set to the RX configurable flow processing block is
15108 	 * enabled.
15109 	 */
15110 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RE_CFA_ENABLED	UINT32_C(0x8)
15111 	/*
15112 	 * When this bit is '1', it indicates that a MPC channel with
15113 	 * destination set to the primate processor block is enabled.
15114 	 */
15115 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_PRIMATE_ENABLED	UINT32_C(0x10)
15116 	/*
15117 	 * Configured doorbell page size for this function.
15118 	 * This field is valid for PF only.
15119 	 */
15120 	uint8_t	db_page_size;
15121 	/* DB page size is 4KB. */
15122 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4KB   UINT32_C(0x0)
15123 	/* DB page size is 8KB. */
15124 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_8KB   UINT32_C(0x1)
15125 	/* DB page size is 16KB. */
15126 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_16KB  UINT32_C(0x2)
15127 	/* DB page size is 32KB. */
15128 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_32KB  UINT32_C(0x3)
15129 	/* DB page size is 64KB. */
15130 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_64KB  UINT32_C(0x4)
15131 	/* DB page size is 128KB. */
15132 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_128KB UINT32_C(0x5)
15133 	/* DB page size is 256KB. */
15134 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_256KB UINT32_C(0x6)
15135 	/* DB page size is 512KB. */
15136 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_512KB UINT32_C(0x7)
15137 	/* DB page size is 1MB. */
15138 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_1MB   UINT32_C(0x8)
15139 	/* DB page size is 2MB. */
15140 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_2MB   UINT32_C(0x9)
15141 	/* DB page size is 4MB. */
15142 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4MB   UINT32_C(0xa)
15143 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_LAST HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4MB
15144 	uint8_t	unused_2[2];
15145 	/*
15146 	 * Minimum guaranteed bandwidth for the network partition made up
15147 	 * of the caller physical function and all its child virtual
15148 	 * functions. The rate is specified as a percentage of the bandwidth
15149 	 * of the link the partition is associated with. A value of 0
15150 	 * indicates that no minimum bandwidth is configured.
15151 	 * The format of this field is defined to match min_bw, even though
15152 	 * the partition minimum rate is always specified as a percentage.
15153 	 */
15154 	uint32_t	partition_min_bw;
15155 	/* The bandwidth value. */
15156 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
15157 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_SFT		0
15158 	/*
15159 	 * The granularity of the value (bits or bytes). Firmware never sets
15160 	 * this field.
15161 	 */
15162 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE			UINT32_C(0x10000000)
15163 	/* Value is in bits. */
15164 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
15165 	/* Value is in bytes. */
15166 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
15167 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES
15168 	/* Always percentage of link bandwidth. */
15169 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
15170 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT	29
15171 	/* Bandwidth value is in hundredths of a percent of link bandwidth. */
15172 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
15173 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
15174 	/*
15175 	 * The maximum bandwidth that may be used by the network partition
15176 	 * made up of the caller physical function and all its child virtual
15177 	 * functions. The rate is specified as a percentage of the bandwidth
15178 	 * of the link the partition is associated with. A value of 0
15179 	 * indicates that no maximum bandwidth is configured.
15180 	 * The format of this field is defined to match max_bw, even though
15181 	 * the partition bandwidth must be specified as a percentage.
15182 	 */
15183 	uint32_t	partition_max_bw;
15184 	/* The bandwidth value. */
15185 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
15186 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_SFT		0
15187 	/*
15188 	 * The granularity of the value (bits or bytes). Firmware never sets
15189 	 * this field.
15190 	 */
15191 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE			UINT32_C(0x10000000)
15192 	/* Value is in bits. */
15193 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
15194 	/* Value is in bytes. */
15195 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
15196 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES
15197 	/* Always a percentage of link bandwidth. */
15198 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
15199 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT	29
15200 	/* Value is in hundredths of a percent of link bandwidth. */
15201 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
15202 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
15203 	/*
15204 	 * The maximum transmission unit of the function
15205 	 * configured by the host pf/vf.
15206 	 * If the reported mtu value is non-zero then it will be used for the
15207 	 * rings allocated on this function, otherwise the default
15208 	 * value is used if ring MTU is not specified.
15209 	 */
15210 	uint16_t	host_mtu;
15211 	uint8_t	unused_3[2];
15212 	uint8_t	unused_4[2];
15213 	/*
15214 	 * KDNet mode for the port for this function.  If a VF, KDNet
15215 	 * mode is always disabled.
15216 	 */
15217 	uint8_t	port_kdnet_mode;
15218 	/* KDNet mode is not enabled on the port for this function. */
15219 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_DISABLED UINT32_C(0x0)
15220 	/* KDNet mode is enabled on the port for this function. */
15221 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_ENABLED  UINT32_C(0x1)
15222 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_LAST	HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_ENABLED
15223 	/*
15224 	 * If KDNet mode is enabled, the PCI function number of the
15225 	 * KDNet partition.
15226 	 */
15227 	uint8_t	kdnet_pcie_function;
15228 	/*
15229 	 * Function ID of the KDNET function on this port.  If the
15230 	 * KDNET partition does not exist and the FW supports this
15231 	 * feature, 0xffff will be returned.
15232 	 */
15233 	uint16_t	port_kdnet_fid;
15234 	uint8_t	unused_5[2];
15235 	/* Number of Tx Key Contexts allocated. */
15236 	uint32_t	alloc_tx_key_ctxs;
15237 	/* Number of Rx Key Contexts allocated. */
15238 	uint32_t	alloc_rx_key_ctxs;
15239 	uint8_t	unused_6[7];
15240 	/*
15241 	 * This field is used in Output records to indicate that the output
15242 	 * is completely written to RAM.  This field should be read as '1'
15243 	 * to indicate that the output has been completely written.
15244 	 * When writing a command completion or response to an internal processor,
15245 	 * the order of writes has to be such that this field is written last.
15246 	 */
15247 	uint8_t	valid;
15248 } hwrm_func_qcfg_output_t, *phwrm_func_qcfg_output_t;
15249 
15250 /*****************
15251  * hwrm_func_cfg *
15252  *****************/
15253 
15254 
15255 /* hwrm_func_cfg_input (size:1024b/128B) */
15256 
15257 typedef struct hwrm_func_cfg_input {
15258 	/* The HWRM command request type. */
15259 	uint16_t	req_type;
15260 	/*
15261 	 * The completion ring to send the completion event on. This should
15262 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
15263 	 */
15264 	uint16_t	cmpl_ring;
15265 	/*
15266 	 * The sequence ID is used by the driver for tracking multiple
15267 	 * commands. This ID is treated as opaque data by the firmware and
15268 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
15269 	 */
15270 	uint16_t	seq_id;
15271 	/*
15272 	 * The target ID of the command:
15273 	 * * 0x0-0xFFF8 - The function ID
15274 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15275 	 * * 0xFFFD - Reserved for user-space HWRM interface
15276 	 * * 0xFFFF - HWRM
15277 	 */
15278 	uint16_t	target_id;
15279 	/*
15280 	 * A physical address pointer pointing to a host buffer that the
15281 	 * command's response data will be written. This can be either a host
15282 	 * physical address (HPA) or a guest physical address (GPA) and must
15283 	 * point to a physically contiguous block of memory.
15284 	 */
15285 	uint64_t	resp_addr;
15286 	/*
15287 	 * Function ID of the function that is being
15288 	 * configured.
15289 	 * If set to 0xFF... (All Fs), then the configuration is
15290 	 * for the requesting function.
15291 	 */
15292 	uint16_t	fid;
15293 	/*
15294 	 * This field specifies how many NQs will be reserved for the PF.
15295 	 * Remaining NQs that belong to the PF become available for VFs.
15296 	 * Once a PF has created VFs, it cannot change how many NQs are
15297 	 * reserved for itself (since the NQs must be contiguous in HW).
15298 	 */
15299 	uint16_t	num_msix;
15300 	uint32_t	flags;
15301 	/*
15302 	 * When this bit is '1', the function is disabled with
15303 	 * source MAC address check.
15304 	 * This is an anti-spoofing check. If this flag is set,
15305 	 * then the function shall be configured to disallow
15306 	 * transmission of frames with the source MAC address that
15307 	 * is configured for this function.
15308 	 */
15309 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE	UINT32_C(0x1)
15310 	/*
15311 	 * When this bit is '1', the function is enabled with
15312 	 * source MAC address check.
15313 	 * This is an anti-spoofing check. If this flag is set,
15314 	 * then the function shall be configured to allow
15315 	 * transmission of frames with the source MAC address that
15316 	 * is configured for this function.
15317 	 */
15318 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE	UINT32_C(0x2)
15319 	/* reserved. */
15320 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK			UINT32_C(0x1fc)
15321 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT			2
15322 	/*
15323 	 * Standard TX Ring mode is used for the allocation of TX ring
15324 	 * and underlying scheduling resources that allow bandwidth
15325 	 * reservation and limit settings on the queried function.
15326 	 * If set to 1, then standard TX ring mode is requested to be
15327 	 * enabled on the function being configured.
15328 	 */
15329 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE	UINT32_C(0x200)
15330 	/*
15331 	 * Standard TX Ring mode is used for the allocation of TX ring
15332 	 * and underlying scheduling resources that allow bandwidth
15333 	 * reservation and limit settings on the queried function.
15334 	 * If set to 1, then the standard TX ring mode is requested to
15335 	 * be disabled on the function being configured. In this extended
15336 	 * TX ring resource mode, the minimum and maximum bandwidth settings
15337 	 * are not supported to allow the allocation of TX rings to
15338 	 * span multiple scheduler nodes.
15339 	 */
15340 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE	UINT32_C(0x400)
15341 	/*
15342 	 * If this bit is set, virtual mac address configured
15343 	 * in this command will be persistent over warm boot.
15344 	 */
15345 	#define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST		UINT32_C(0x800)
15346 	/*
15347 	 * This bit only applies to the VF. If this bit is set, the statistic
15348 	 * context counters will not be cleared when the statistic context is freed
15349 	 * or a function reset is called on VF. This bit will be cleared when the PF
15350 	 * is unloaded or a function reset is called on the PF.
15351 	 */
15352 	#define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC	UINT32_C(0x1000)
15353 	/*
15354 	 * This bit requests that the firmware test to see if all the assets
15355 	 * requested in this command (i.e. number of TX rings) are available.
15356 	 * The firmware will return an error if the requested assets are
15357 	 * not available. The firmware will NOT reserve the assets if they
15358 	 * are available.
15359 	 */
15360 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST		UINT32_C(0x2000)
15361 	/*
15362 	 * This bit requests that the firmware test to see if all the assets
15363 	 * requested in this command (i.e. number of RX rings) are available.
15364 	 * The firmware will return an error if the requested assets are
15365 	 * not available. The firmware will NOT reserve the assets if they
15366 	 * are available.
15367 	 */
15368 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST		UINT32_C(0x4000)
15369 	/*
15370 	 * This bit requests that the firmware test to see if all the assets
15371 	 * requested in this command (i.e. number of CMPL rings) are available.
15372 	 * The firmware will return an error if the requested assets are
15373 	 * not available. The firmware will NOT reserve the assets if they
15374 	 * are available.
15375 	 */
15376 	#define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST		UINT32_C(0x8000)
15377 	/*
15378 	 * This bit requests that the firmware test to see if all the assets
15379 	 * requested in this command (i.e. number of RSS ctx) are available.
15380 	 * The firmware will return an error if the requested assets are
15381 	 * not available. The firmware will NOT reserve the assets if they
15382 	 * are available.
15383 	 */
15384 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST	UINT32_C(0x10000)
15385 	/*
15386 	 * This bit requests that the firmware test to see if all the assets
15387 	 * requested in this command (i.e. number of ring groups) are available.
15388 	 * The firmware will return an error if the requested assets are
15389 	 * not available. The firmware will NOT reserve the assets if they
15390 	 * are available.
15391 	 */
15392 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST	UINT32_C(0x20000)
15393 	/*
15394 	 * This bit requests that the firmware test to see if all the assets
15395 	 * requested in this command (i.e. number of stat ctx) are available.
15396 	 * The firmware will return an error if the requested assets are
15397 	 * not available. The firmware will NOT reserve the assets if they
15398 	 * are available.
15399 	 */
15400 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST	UINT32_C(0x40000)
15401 	/*
15402 	 * This bit requests that the firmware test to see if all the assets
15403 	 * requested in this command (i.e. number of VNICs) are available.
15404 	 * The firmware will return an error if the requested assets are
15405 	 * not available. The firmware will NOT reserve the assets if they
15406 	 * are available.
15407 	 */
15408 	#define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST		UINT32_C(0x80000)
15409 	/*
15410 	 * This bit requests that the firmware test to see if all the assets
15411 	 * requested in this command (i.e. number of L2 ctx) are available.
15412 	 * The firmware will return an error if the requested assets are
15413 	 * not available. The firmware will NOT reserve the assets if they
15414 	 * are available.
15415 	 */
15416 	#define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST		UINT32_C(0x100000)
15417 	/*
15418 	 * This configuration change can be initiated by a PF driver. This
15419 	 * configuration request shall be targeted to a VF. From local host
15420 	 * resident HWRM clients, only the parent PF driver shall be allowed
15421 	 * to initiate this change on one of its children VFs. If this bit is
15422 	 * set to 1, then the VF that is being configured is requested to be
15423 	 * trusted.
15424 	 */
15425 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE		UINT32_C(0x200000)
15426 	/*
15427 	 * When this bit it set, even if PF reserved pool size is zero,
15428 	 * FW will allow driver to create TX rings in ring alloc,
15429 	 * by reserving TX ring, S3 node dynamically.
15430 	 */
15431 	#define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC	UINT32_C(0x400000)
15432 	/*
15433 	 * This bit requests that the firmware test to see if all the assets
15434 	 * requested in this command (i.e. number of NQ rings) are available.
15435 	 * The firmware will return an error if the requested assets are
15436 	 * not available. The firmware will NOT reserve the assets if they
15437 	 * are available.
15438 	 */
15439 	#define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST		UINT32_C(0x800000)
15440 	/*
15441 	 * This configuration change can be initiated by a PF driver. This
15442 	 * configuration request shall be targeted to a VF. From local host
15443 	 * resident HWRM clients, only the parent PF driver shall be allowed
15444 	 * to initiate this change on one of its children VFs. If this bit is
15445 	 * set to 1, then the VF that is being configured is requested to be
15446 	 * untrusted.
15447 	 */
15448 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE		UINT32_C(0x1000000)
15449 	/*
15450 	 * This bit is used by preboot drivers on a PF that require access
15451 	 * to the legacy L2 ring model and legacy 32b doorbells. This
15452 	 * feature is not allowed on VFs and is only relevant for devices
15453 	 * that require a context backing store.
15454 	 */
15455 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS	UINT32_C(0x2000000)
15456 	/*
15457 	 * If this bit is set to 0, then the interface does not support hot
15458 	 * reset capability which it advertised with the hot_reset_support
15459 	 * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
15460 	 * flag to 0, adapter cannot do the hot reset. In this state, if the
15461 	 * firmware receives a hot reset request, firmware must fail the
15462 	 * request. If this bit is set to 1, then interface is renabling the
15463 	 * hot reset capability.
15464 	 */
15465 	#define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS		UINT32_C(0x4000000)
15466 	/*
15467 	 * If this bit is set to 1, the PF driver is requesting FW
15468 	 * to enable PPP TX PUSH feature on all the TX rings specified in
15469 	 * the num_tx_rings field. By default, the PPP TX push feature is
15470 	 * disabled for all the TX rings of the function. This flag is
15471 	 * ignored if num_tx_rings field is not specified or the function
15472 	 * doesn't support PPP tx push feature.
15473 	 */
15474 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE	UINT32_C(0x8000000)
15475 	/*
15476 	 * If this bit is set to 1, the PF driver is requesting FW
15477 	 * to disable PPP TX PUSH feature on all the TX rings specified in
15478 	 * the num_tx_rings field. This flag is ignored if num_tx_rings
15479 	 * field is not specified or the function doesn't support PPP tx
15480 	 * push feature.
15481 	 */
15482 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE	UINT32_C(0x10000000)
15483 	/*
15484 	 * If this bit is set to 1, the driver is requesting FW to enable
15485 	 * the BD_METADATA feature for this function. The FW returns error
15486 	 * on this request if the TX_METADATA is enabled for this function.
15487 	 */
15488 	#define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_ENABLE		UINT32_C(0x20000000)
15489 	/*
15490 	 * If this bit is set to 1, the driver is requesting FW to disable
15491 	 * the BD_METADATA feature for this function. The FW returns error
15492 	 * on this request if the TX_METADATA is enabled for this function.
15493 	 */
15494 	#define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_DISABLE		UINT32_C(0x40000000)
15495 	/*
15496 	 * If this bit is set to 1, the driver is requesting FW to see if
15497 	 * all the assets requested in this command (i.e. number of KTLS/
15498 	 * QUIC key contexts) are available. The firmware will return an
15499 	 * error if the requested assets are not available. The firmware
15500 	 * will NOT reserve the assets if they are available.
15501 	 */
15502 	#define HWRM_FUNC_CFG_INPUT_FLAGS_KEY_CTX_ASSETS_TEST		UINT32_C(0x80000000)
15503 	uint32_t	enables;
15504 	/*
15505 	 * This bit must be '1' for the admin_mtu field to be
15506 	 * configured.
15507 	 */
15508 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_MTU		UINT32_C(0x1)
15509 	/*
15510 	 * This bit must be '1' for the mru field to be
15511 	 * configured.
15512 	 */
15513 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x2)
15514 	/*
15515 	 * This bit must be '1' for the num_rsscos_ctxs field to be
15516 	 * configured.
15517 	 */
15518 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS	UINT32_C(0x4)
15519 	/*
15520 	 * This bit must be '1' for the num_cmpl_rings field to be
15521 	 * configured.
15522 	 */
15523 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS	UINT32_C(0x8)
15524 	/*
15525 	 * This bit must be '1' for the num_tx_rings field to be
15526 	 * configured.
15527 	 */
15528 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS		UINT32_C(0x10)
15529 	/*
15530 	 * This bit must be '1' for the num_rx_rings field to be
15531 	 * configured.
15532 	 */
15533 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS		UINT32_C(0x20)
15534 	/*
15535 	 * This bit must be '1' for the num_l2_ctxs field to be
15536 	 * configured.
15537 	 */
15538 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS		UINT32_C(0x40)
15539 	/*
15540 	 * This bit must be '1' for the num_vnics field to be
15541 	 * configured.
15542 	 */
15543 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS		UINT32_C(0x80)
15544 	/*
15545 	 * This bit must be '1' for the num_stat_ctxs field to be
15546 	 * configured.
15547 	 */
15548 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS		UINT32_C(0x100)
15549 	/*
15550 	 * This bit must be '1' for the dflt_mac_addr field to be
15551 	 * configured.
15552 	 */
15553 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR		UINT32_C(0x200)
15554 	/*
15555 	 * This bit must be '1' for the dflt_vlan field to be
15556 	 * configured.
15557 	 */
15558 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN		UINT32_C(0x400)
15559 	/*
15560 	 * This bit must be '1' for the dflt_ip_addr field to be
15561 	 * configured.
15562 	 */
15563 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR		UINT32_C(0x800)
15564 	/*
15565 	 * This bit must be '1' for the min_bw field to be
15566 	 * configured.
15567 	 */
15568 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW		UINT32_C(0x1000)
15569 	/*
15570 	 * This bit must be '1' for the max_bw field to be
15571 	 * configured.
15572 	 */
15573 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW		UINT32_C(0x2000)
15574 	/*
15575 	 * This bit must be '1' for the async_event_cr field to be
15576 	 * configured.
15577 	 */
15578 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4000)
15579 	/*
15580 	 * This bit must be '1' for the vlan_antispoof_mode field to be
15581 	 * configured.
15582 	 */
15583 	#define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE	UINT32_C(0x8000)
15584 	/*
15585 	 * This bit must be '1' for the allowed_vlan_pris field to be
15586 	 * configured.
15587 	 */
15588 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS	UINT32_C(0x10000)
15589 	/*
15590 	 * This bit must be '1' for the evb_mode field to be
15591 	 * configured.
15592 	 */
15593 	#define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE		UINT32_C(0x20000)
15594 	/*
15595 	 * This bit must be '1' for the num_mcast_filters field to be
15596 	 * configured.
15597 	 */
15598 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS	UINT32_C(0x40000)
15599 	/*
15600 	 * This bit must be '1' for the num_hw_ring_grps field to be
15601 	 * configured.
15602 	 */
15603 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS	UINT32_C(0x80000)
15604 	/*
15605 	 * This bit must be '1' for the cache_linesize field to be
15606 	 * configured.
15607 	 */
15608 	#define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE	UINT32_C(0x100000)
15609 	/*
15610 	 * This bit must be '1' for the num_msix field to be
15611 	 * configured.
15612 	 */
15613 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX		UINT32_C(0x200000)
15614 	/*
15615 	 * This bit must be '1' for the link admin state field to be
15616 	 * configured.
15617 	 */
15618 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE	UINT32_C(0x400000)
15619 	/*
15620 	 * This bit must be '1' for the hot_reset_if_en_dis field to be
15621 	 * configured.
15622 	 */
15623 	#define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT	UINT32_C(0x800000)
15624 	/*
15625 	 * This bit must be '1' for the schq_id field to be
15626 	 * configured.
15627 	 */
15628 	#define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID		UINT32_C(0x1000000)
15629 	/*
15630 	 * This bit must be '1' for the mpc_chnls field to be
15631 	 * configured.
15632 	 */
15633 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MPC_CHNLS		UINT32_C(0x2000000)
15634 	/*
15635 	 * This bit must be '1' for the partition_min_bw field to be
15636 	 * configured.
15637 	 */
15638 	#define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MIN_BW	UINT32_C(0x4000000)
15639 	/*
15640 	 * This bit must be '1' for the partition_max_bw field to be
15641 	 * configured.
15642 	 */
15643 	#define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MAX_BW	UINT32_C(0x8000000)
15644 	/*
15645 	 * This bit must be '1' for the tpid field to be
15646 	 * configured. This bit is only valid when dflt_vlan enable
15647 	 * bit is set.
15648 	 */
15649 	#define HWRM_FUNC_CFG_INPUT_ENABLES_TPID			UINT32_C(0x10000000)
15650 	/*
15651 	 * This bit must be '1' for the host_mtu field to be
15652 	 * configured.
15653 	 */
15654 	#define HWRM_FUNC_CFG_INPUT_ENABLES_HOST_MTU		UINT32_C(0x20000000)
15655 	/*
15656 	 * This bit must be '1' for the number of Tx Key Contexts
15657 	 * field to be configured.
15658 	 */
15659 	#define HWRM_FUNC_CFG_INPUT_ENABLES_TX_KEY_CTXS		UINT32_C(0x40000000)
15660 	/*
15661 	 * This bit must be '1' for the number of Rx Key Contexts
15662 	 * field to be configured.
15663 	 */
15664 	#define HWRM_FUNC_CFG_INPUT_ENABLES_RX_KEY_CTXS		UINT32_C(0x80000000)
15665 	/*
15666 	 * This field can be used by the admin PF to configure
15667 	 * mtu of foster PFs.
15668 	 * The maximum transmission unit of the function.
15669 	 * The HWRM should make sure that the mtu of
15670 	 * the function does not exceed the mtu of the physical
15671 	 * port that this function is associated with.
15672 	 *
15673 	 * In addition to configuring mtu per function, it is
15674 	 * possible to configure mtu per transmit ring.
15675 	 * By default, the mtu of each transmit ring associated
15676 	 * with a function is equal to the mtu of the function.
15677 	 * The HWRM should make sure that the mtu of each transmit
15678 	 * ring that is assigned to a function has a valid mtu.
15679 	 */
15680 	uint16_t	admin_mtu;
15681 	/*
15682 	 * The maximum receive unit of the function.
15683 	 * The HWRM should make sure that the mru of
15684 	 * the function does not exceed the mru of the physical
15685 	 * port that this function is associated with.
15686 	 *
15687 	 * In addition to configuring mru per function, it is
15688 	 * possible to configure mru per vnic.
15689 	 * By default, the mru of each vnic associated
15690 	 * with a function is equal to the mru of the function.
15691 	 * The HWRM should make sure that the mru of each vnic
15692 	 * that is assigned to a function has a valid mru.
15693 	 */
15694 	uint16_t	mru;
15695 	/*
15696 	 * The number of RSS/COS contexts requested for the
15697 	 * function.
15698 	 */
15699 	uint16_t	num_rsscos_ctxs;
15700 	/*
15701 	 * The number of completion rings requested for the
15702 	 * function. This does not include the rings allocated
15703 	 * to any children functions if any.
15704 	 */
15705 	uint16_t	num_cmpl_rings;
15706 	/*
15707 	 * The number of transmit rings requested for the function.
15708 	 * This does not include the rings allocated to any
15709 	 * children functions if any.
15710 	 */
15711 	uint16_t	num_tx_rings;
15712 	/*
15713 	 * The number of receive rings requested for the function.
15714 	 * This does not include the rings allocated
15715 	 * to any children functions if any.
15716 	 */
15717 	uint16_t	num_rx_rings;
15718 	/* The requested number of L2 contexts for the function. */
15719 	uint16_t	num_l2_ctxs;
15720 	/* The requested number of vnics for the function. */
15721 	uint16_t	num_vnics;
15722 	/* The requested number of statistic contexts for the function. */
15723 	uint16_t	num_stat_ctxs;
15724 	/*
15725 	 * The number of HW ring groups that should
15726 	 * be reserved for this function.
15727 	 */
15728 	uint16_t	num_hw_ring_grps;
15729 	/* The default MAC address for the function being configured. */
15730 	uint8_t	dflt_mac_addr[6];
15731 	/*
15732 	 * The default VLAN for the function being configured.
15733 	 * This field's format is same as 802.1Q Tag's
15734 	 * Tag Control Information (TCI) format that includes both
15735 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
15736 	 */
15737 	uint16_t	dflt_vlan;
15738 	/*
15739 	 * The default IP address for the function being configured.
15740 	 * This address is only used in enabling source property check.
15741 	 */
15742 	uint32_t	dflt_ip_addr[4];
15743 	/*
15744 	 * Minimum guaranteed transmit bandwidth for this function. When
15745 	 * specified for a PF, does not affect traffic from the PF's child VFs.
15746 	 * A value of 0 indicates the minimum bandwidth is not configured.
15747 	 */
15748 	uint32_t	min_bw;
15749 	/* The bandwidth value. */
15750 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
15751 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT		0
15752 	/* The granularity of the value (bits or bytes). */
15753 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE			UINT32_C(0x10000000)
15754 	/* Value is in bits. */
15755 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
15756 	/* Value is in bytes. */
15757 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
15758 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
15759 	/* bw_value_unit is 3 b */
15760 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
15761 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
15762 	/* Value is in Mb or MB (base 10). */
15763 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
15764 	/* Value is in Kb or KB (base 10). */
15765 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
15766 	/* Value is in bits or bytes. */
15767 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
15768 	/* Value is in Gb or GB (base 10). */
15769 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
15770 	/* Value is in 1/100th of a percentage of total bandwidth. */
15771 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
15772 	/* Invalid unit */
15773 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
15774 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
15775 	/*
15776 	 * Maximum transmit rate for this function. When specified for a PF,
15777 	 * does not affect traffic from the PF's child VFs.
15778 	 * A value of 0 indicates that the maximum bandwidth is not configured.
15779 	 */
15780 	uint32_t	max_bw;
15781 	/* The bandwidth value. */
15782 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
15783 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT		0
15784 	/* The granularity of the value (bits or bytes). */
15785 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
15786 	/* Value is in bits. */
15787 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
15788 	/* Value is in bytes. */
15789 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
15790 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
15791 	/* bw_value_unit is 3 b */
15792 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
15793 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
15794 	/* Value is in Mb or MB (base 10). */
15795 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
15796 	/* Value is in Kb or KB (base 10). */
15797 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
15798 	/* Value is in bits or bytes. */
15799 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
15800 	/* Value is in Gb or GB (base 10). */
15801 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
15802 	/* Value is in 1/100th of a percentage of total bandwidth. */
15803 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
15804 	/* Invalid unit */
15805 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
15806 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
15807 	/*
15808 	 * ID of the target completion ring for receiving asynchronous
15809 	 * event completions. If this field is not valid, then the
15810 	 * HWRM shall use the default completion ring of the function
15811 	 * that is being configured as the target completion ring for
15812 	 * providing any asynchronous event completions for that
15813 	 * function.
15814 	 * If this field is valid, then the HWRM shall use the
15815 	 * completion ring identified by this ID as the target
15816 	 * completion ring for providing any asynchronous event
15817 	 * completions for the function that is being configured.
15818 	 */
15819 	uint16_t	async_event_cr;
15820 	/* VLAN Anti-spoofing mode. */
15821 	uint8_t	vlan_antispoof_mode;
15822 	/* No VLAN anti-spoofing checks are enabled */
15823 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK		UINT32_C(0x0)
15824 	/* Validate VLAN against the configured VLAN(s) */
15825 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN	UINT32_C(0x1)
15826 	/* Insert VLAN if it does not exist, otherwise discard */
15827 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE	UINT32_C(0x2)
15828 	/* Insert VLAN if it does not exist, override VLAN if it exists */
15829 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN UINT32_C(0x3)
15830 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST		HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
15831 	/*
15832 	 * This bit field defines VLAN PRIs that are allowed on
15833 	 * this function.
15834 	 * If nth bit is set, then VLAN PRI n is allowed on this
15835 	 * function.
15836 	 */
15837 	uint8_t	allowed_vlan_pris;
15838 	/*
15839 	 * The evb_mode is configured on a per port basis. The default evb_mode
15840 	 * is configured based on the NVM EVB mode setting upon firmware
15841 	 * initialization. The HWRM allows a PF driver to change EVB mode for a
15842 	 * port used by the PF only when one of the following conditions is
15843 	 * satisfied.
15844 	 * 1. The current operating mode is single function mode.
15845 	 *	(ie. one PF per port)
15846 	 * 2. For SmartNIC, any one of the PAXC PFs is permitted to change the
15847 	 *	EVB mode of the port used by the PAXC PF. None of the X86 PFs
15848 	 *	should have privileges.
15849 	 * The HWRM doesn't permit any PFs to change the underlying EVB mode
15850 	 * when running as MHB or NPAR mode in performance NIC configuration.
15851 	 * The HWRM doesn't permit a VF driver to change the EVB mode.
15852 	 * Once the HWRM determines a function doesn't meet the conditions
15853 	 * to configure the EVB mode, it sets the evb_mode_cfg_not_supported
15854 	 * flag in HWRM_FUNC_QCAPS command response for the function.
15855 	 * The HWRM takes into account the switching of EVB mode from one to
15856 	 * another and reconfigure hardware resources as reqiured. The
15857 	 * switching from VEB to VEPA mode requires the disabling of the
15858 	 * loopback traffic. Additionally, source knockouts are handled
15859 	 * differently in VEB and VEPA modes.
15860 	 */
15861 	uint8_t	evb_mode;
15862 	/* No Edge Virtual Bridging (EVB) */
15863 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
15864 	/* Virtual Ethernet Bridge (VEB) */
15865 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB	UINT32_C(0x1)
15866 	/* Virtual Ethernet Port Aggregator (VEPA) */
15867 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
15868 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST  HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
15869 	uint8_t	options;
15870 	/*
15871 	 * This value indicates the PCIE device cache line size.
15872 	 * The cache line size allows the DMA writes to terminate and
15873 	 * start at the cache boundary.
15874 	 */
15875 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK	UINT32_C(0x3)
15876 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT	0
15877 	/* Cache Line Size 64 bytes */
15878 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64	UINT32_C(0x0)
15879 	/* Cache Line Size 128 bytes */
15880 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128	UINT32_C(0x1)
15881 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST	HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
15882 	/* This value is the virtual link admin state setting. */
15883 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK	UINT32_C(0xc)
15884 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT	2
15885 	/* Admin state is forced down. */
15886 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN  (UINT32_C(0x0) << 2)
15887 	/* Admin state is forced up. */
15888 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP	(UINT32_C(0x1) << 2)
15889 	/* Admin state is in auto mode - is to follow the physical link state. */
15890 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO	(UINT32_C(0x2) << 2)
15891 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST	HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
15892 	/* Reserved for future. */
15893 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK		UINT32_C(0xf0)
15894 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT			4
15895 	/*
15896 	 * The number of multicast filters that should
15897 	 * be reserved for this function on the RX side.
15898 	 */
15899 	uint16_t	num_mcast_filters;
15900 	/* Used by a PF driver to associate a SCHQ with a VF. */
15901 	uint16_t	schq_id;
15902 	uint16_t	mpc_chnls;
15903 	/*
15904 	 * When this bit is '1', the caller requests to enable a MPC
15905 	 * channel with destination to the TX crypto engine block.
15906 	 * When this bit is ‘0’, this flag has no effect.
15907 	 */
15908 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_ENABLE	UINT32_C(0x1)
15909 	/*
15910 	 * When this bit is '1', the caller requests to disable a MPC
15911 	 * channel with destination to the TX crypto engine block.
15912 	 * When this bit is ‘0’, this flag has no effect.
15913 	 */
15914 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_DISABLE	UINT32_C(0x2)
15915 	/*
15916 	 * When this bit is '1', the caller requests to enable a MPC
15917 	 * channel with destination to the RX crypto engine block.
15918 	 * When this bit is ‘0’, this flag has no effect.
15919 	 */
15920 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_ENABLE	UINT32_C(0x4)
15921 	/*
15922 	 * When this bit is '1', the caller requests to disable a MPC
15923 	 * channel with destination to the RX crypto engine block.
15924 	 * When this bit is ‘0’, this flag has no effect.
15925 	 */
15926 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_DISABLE	UINT32_C(0x8)
15927 	/*
15928 	 * When this bit is '1', the caller requests to enable a MPC
15929 	 * channel with destination to the TX configurable flow processing
15930 	 * block. When this bit is ‘0’, this flag has no effect.
15931 	 */
15932 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_ENABLE	UINT32_C(0x10)
15933 	/*
15934 	 * When this bit is '1', the caller requests to disable a MPC
15935 	 * channel with destination to the TX configurable flow processing
15936 	 * block. When this bit is ‘0’, this flag has no effect.
15937 	 */
15938 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_DISABLE	UINT32_C(0x20)
15939 	/*
15940 	 * When this bit is '1', the caller requests to enable a MPC
15941 	 * channel with destination to the RX configurable flow processing
15942 	 * block. When this bit is ‘0’, this flag has no effect.
15943 	 */
15944 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_ENABLE	UINT32_C(0x40)
15945 	/*
15946 	 * When this bit is '1', the caller requests to disable a MPC
15947 	 * channel with destination to the RX configurable flow processing
15948 	 * block. When this bit is ‘0’, this flag has no effect.
15949 	 */
15950 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_DISABLE	UINT32_C(0x80)
15951 	/*
15952 	 * When this bit is '1', the caller requests to enable a MPC
15953 	 * channel with destination to the primate processor block.
15954 	 * When this bit is ‘0’, this flag has no effect.
15955 	 */
15956 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_ENABLE	UINT32_C(0x100)
15957 	/*
15958 	 * When this bit is '1', the caller requests to disable a MPC
15959 	 * channel with destination to the primate processor block.
15960 	 * When this bit is ‘0’, this flag has no effect.
15961 	 */
15962 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_DISABLE	UINT32_C(0x200)
15963 	/*
15964 	 * Minimum guaranteed bandwidth for the network partition made up
15965 	 * of the caller physical function and all its child virtual
15966 	 * functions. The rate is specified as a percentage of the bandwidth
15967 	 * of the link the partition is associated with. A value of 0
15968 	 * indicates that no minimum bandwidth is configured. The sum of the
15969 	 * minimum bandwidths for all partitions on a link must not exceed
15970 	 * 100%.
15971 	 * The format of this field is defined to match min_bw, even though
15972 	 * it does not allow all the options for min_bw at this time.
15973 	 */
15974 	uint32_t	partition_min_bw;
15975 	/* The bandwidth value. */
15976 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
15977 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_SFT		0
15978 	/*
15979 	 * The granularity of the value (bits or bytes). Firmware ignores
15980 	 * this field.
15981 	 */
15982 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE			UINT32_C(0x10000000)
15983 	/* Value is in bits. */
15984 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
15985 	/* Value is in bytes. */
15986 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
15987 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES
15988 	/* Bandwidth units. Must be set to percent1_100. */
15989 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
15990 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT	29
15991 	/* Value is in hundredths of a percent of link bandwidth. */
15992 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
15993 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
15994 	/*
15995 	 * The maximum bandwidth that may be used by the network partition
15996 	 * made up of the caller physical function and all its child virtual
15997 	 * functions. The rate is specified as a percentage of the bandwidth
15998 	 * of the link the partition is associated with. A value of 0
15999 	 * indicates that no maximum bandwidth is configured.
16000 	 * The format of this field is defined to match max_bw, even though it
16001 	 * does not allow all the options for max_bw at this time.
16002 	 */
16003 	uint32_t	partition_max_bw;
16004 	/* The bandwidth value. */
16005 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16006 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_SFT		0
16007 	/*
16008 	 * The granularity of the value (bits or bytes). Firmware ignores
16009 	 * this field.
16010 	 */
16011 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE			UINT32_C(0x10000000)
16012 	/* Value is in bits. */
16013 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16014 	/* Value is in bytes. */
16015 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16016 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES
16017 	/* Bandwidth units. Must be set to percent1_100. */
16018 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16019 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT	29
16020 	/* Value is in hundredths of a percent of link bandwidth. */
16021 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16022 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
16023 	/*
16024 	 * The TPID for the function for which default VLAN
16025 	 * is configured. If the dflt_vlan is not specified
16026 	 * with the TPID, FW returns error. If the TPID is
16027 	 * not specified with dflt_vlan, the default TPID of
16028 	 * 0x8100 will be used. This field is specified in
16029 	 * network byte order.
16030 	 */
16031 	uint16_t	tpid;
16032 	/*
16033 	 * This field can be used by the host PF to configure
16034 	 * mtu value.
16035 	 * The maximum transmission unit of the function.
16036 	 * The HWRM should make sure that the mtu of
16037 	 * the function does not exceed the mtu of the physical
16038 	 * port that this function is associated with.
16039 	 *
16040 	 * In addition to configuring mtu per function, it is
16041 	 * possible to configure mtu per transmit ring.
16042 	 * By default, the mtu of each transmit ring associated
16043 	 * with a function is equal to the mtu of the function.
16044 	 * The HWRM should make sure that the mtu of each transmit
16045 	 * ring that is assigned to a function has a valid mtu.
16046 	 */
16047 	uint16_t	host_mtu;
16048 	uint8_t	unused_0[4];
16049 	uint32_t	enables2;
16050 	/*
16051 	 * This bit must be '1' for the kdnet_mode field to be
16052 	 * configured.
16053 	 */
16054 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_KDNET		UINT32_C(0x1)
16055 	/*
16056 	 * This bit must be '1' for the db_page_size field to be
16057 	 * configured. Legacy controller core FW may silently ignore
16058 	 * the db_page_size programming request through this command.
16059 	 */
16060 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_DB_PAGE_SIZE	UINT32_C(0x2)
16061 	/*
16062 	 * KDNet mode for the port for this function.  If NPAR is
16063 	 * also configured on this port, it takes precedence.  KDNet
16064 	 * mode is ignored for a VF.
16065 	 */
16066 	uint8_t	port_kdnet_mode;
16067 	/* KDNet mode is not enabled. */
16068 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_DISABLED UINT32_C(0x0)
16069 	/* KDNet mode enabled. */
16070 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_ENABLED  UINT32_C(0x1)
16071 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_LAST	HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_ENABLED
16072 	/*
16073 	 * This field can be used by the PF driver to configure the doorbell
16074 	 * page size. L2 driver can use different pages to ring the doorbell
16075 	 * for L2 push operation. The doorbell page size should be configured
16076 	 * to match the native CPU page size for proper RoCE and L2 doorbell
16077 	 * operations. This value supersedes the older method of configuring
16078 	 * the doorbell page size by the RoCE driver using the command queue
16079 	 * method. The default is 4K.
16080 	 */
16081 	uint8_t	db_page_size;
16082 	/* DB page size is 4KB. */
16083 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4KB   UINT32_C(0x0)
16084 	/* DB page size is 8KB. */
16085 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_8KB   UINT32_C(0x1)
16086 	/* DB page size is 16KB. */
16087 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_16KB  UINT32_C(0x2)
16088 	/* DB page size is 32KB. */
16089 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_32KB  UINT32_C(0x3)
16090 	/* DB page size is 64KB. */
16091 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_64KB  UINT32_C(0x4)
16092 	/* DB page size is 128KB. */
16093 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_128KB UINT32_C(0x5)
16094 	/* DB page size is 256KB. */
16095 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_256KB UINT32_C(0x6)
16096 	/* DB page size is 512KB. */
16097 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_512KB UINT32_C(0x7)
16098 	/* DB page size is 1MB. */
16099 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_1MB   UINT32_C(0x8)
16100 	/* DB page size is 2MB. */
16101 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_2MB   UINT32_C(0x9)
16102 	/* DB page size is 4MB. */
16103 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4MB   UINT32_C(0xa)
16104 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_LAST HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4MB
16105 	uint8_t	unused_1[2];
16106 	/* Number of Tx Key Contexts requested. */
16107 	uint32_t	num_tx_key_ctxs;
16108 	/* Number of Rx Key Contexts requested. */
16109 	uint32_t	num_rx_key_ctxs;
16110 	uint8_t	unused_2[4];
16111 } hwrm_func_cfg_input_t, *phwrm_func_cfg_input_t;
16112 
16113 /* hwrm_func_cfg_output (size:128b/16B) */
16114 
16115 typedef struct hwrm_func_cfg_output {
16116 	/* The specific error status for the command. */
16117 	uint16_t	error_code;
16118 	/* The HWRM command request type. */
16119 	uint16_t	req_type;
16120 	/* The sequence ID from the original command. */
16121 	uint16_t	seq_id;
16122 	/* The length of the response data in number of bytes. */
16123 	uint16_t	resp_len;
16124 	uint8_t	unused_0[7];
16125 	/*
16126 	 * This field is used in Output records to indicate that the output
16127 	 * is completely written to RAM.  This field should be read as '1'
16128 	 * to indicate that the output has been completely written.
16129 	 * When writing a command completion or response to an internal processor,
16130 	 * the order of writes has to be such that this field is written last.
16131 	 */
16132 	uint8_t	valid;
16133 } hwrm_func_cfg_output_t, *phwrm_func_cfg_output_t;
16134 
16135 /* hwrm_func_cfg_cmd_err (size:64b/8B) */
16136 
16137 typedef struct hwrm_func_cfg_cmd_err {
16138 	/* command specific error codes for the cmd_err field in hwrm_err_output */
16139 	uint8_t	code;
16140 	/* Unknown error. */
16141 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_UNKNOWN			UINT32_C(0x0)
16142 	/* The partition minimum bandwidth is out of range. */
16143 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_RANGE	UINT32_C(0x1)
16144 	/* The minimum bandwidth is more than the maximum bandwidth. */
16145 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_MORE_THAN_MAX  UINT32_C(0x2)
16146 	/*
16147 	 * The NIC does not support enforcement of a minimum guaranteed
16148 	 * bandwidth for a partition.
16149 	 */
16150 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_UNSUPPORTED UINT32_C(0x3)
16151 	/* Partition bandwidths must be specified as a percentage. */
16152 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT	UINT32_C(0x4)
16153 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_LAST			HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT
16154 	uint8_t	unused_0[7];
16155 } hwrm_func_cfg_cmd_err_t, *phwrm_func_cfg_cmd_err_t;
16156 
16157 /********************
16158  * hwrm_func_qstats *
16159  ********************/
16160 
16161 
16162 /* hwrm_func_qstats_input (size:192b/24B) */
16163 
16164 typedef struct hwrm_func_qstats_input {
16165 	/* The HWRM command request type. */
16166 	uint16_t	req_type;
16167 	/*
16168 	 * The completion ring to send the completion event on. This should
16169 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16170 	 */
16171 	uint16_t	cmpl_ring;
16172 	/*
16173 	 * The sequence ID is used by the driver for tracking multiple
16174 	 * commands. This ID is treated as opaque data by the firmware and
16175 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16176 	 */
16177 	uint16_t	seq_id;
16178 	/*
16179 	 * The target ID of the command:
16180 	 * * 0x0-0xFFF8 - The function ID
16181 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16182 	 * * 0xFFFD - Reserved for user-space HWRM interface
16183 	 * * 0xFFFF - HWRM
16184 	 */
16185 	uint16_t	target_id;
16186 	/*
16187 	 * A physical address pointer pointing to a host buffer that the
16188 	 * command's response data will be written. This can be either a host
16189 	 * physical address (HPA) or a guest physical address (GPA) and must
16190 	 * point to a physically contiguous block of memory.
16191 	 */
16192 	uint64_t	resp_addr;
16193 	/*
16194 	 * Function ID of the function that is being queried.
16195 	 * 0xFF... (All Fs) if the query is for the requesting
16196 	 * function.
16197 	 * A privileged PF can query for other function's statistics.
16198 	 */
16199 	uint16_t	fid;
16200 	uint8_t	flags;
16201 	/*
16202 	 * This bit should be set to 1 when request is for only RoCE
16203 	 * statistics. This will be honored only if the caller_fid is
16204 	 * a privileged PF. In all other cases FID and caller_fid should
16205 	 * be the same.
16206 	 */
16207 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY	UINT32_C(0x1)
16208 	/*
16209 	 * This bit should be set to 1 when request is for the counter mask,
16210 	 * representing the width of each of the stats counters, rather
16211 	 * than counters themselves.
16212 	 */
16213 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x2)
16214 	/*
16215 	 * This bit should be set to 1 when request is for only L2
16216 	 * statistics. This will be honored only if the caller_fid is
16217 	 * a privileged PF. In all other cases FID and caller_fid should
16218 	 * be the same.
16219 	 */
16220 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_L2_ONLY	UINT32_C(0x4)
16221 	uint8_t	unused_0[5];
16222 } hwrm_func_qstats_input_t, *phwrm_func_qstats_input_t;
16223 
16224 /* hwrm_func_qstats_output (size:1408b/176B) */
16225 
16226 typedef struct hwrm_func_qstats_output {
16227 	/* The specific error status for the command. */
16228 	uint16_t	error_code;
16229 	/* The HWRM command request type. */
16230 	uint16_t	req_type;
16231 	/* The sequence ID from the original command. */
16232 	uint16_t	seq_id;
16233 	/* The length of the response data in number of bytes. */
16234 	uint16_t	resp_len;
16235 	/* Number of transmitted unicast packets on the function. */
16236 	uint64_t	tx_ucast_pkts;
16237 	/* Number of transmitted multicast packets on the function. */
16238 	uint64_t	tx_mcast_pkts;
16239 	/* Number of transmitted broadcast packets on the function. */
16240 	uint64_t	tx_bcast_pkts;
16241 	/*
16242 	 * Number of transmitted packets that were discarded due to
16243 	 * internal NIC resource problems.  For transmit, this
16244 	 * can only happen if TMP is configured to allow dropping
16245 	 * in HOL blocking conditions, which is not a normal
16246 	 * configuration.
16247 	 */
16248 	uint64_t	tx_discard_pkts;
16249 	/*
16250 	 * Number of dropped packets on transmit path on the function.
16251 	 * These are packets that have been marked for drop by
16252 	 * the TE CFA block or are packets that exceeded the
16253 	 * transmit MTU limit for the function.
16254 	 */
16255 	uint64_t	tx_drop_pkts;
16256 	/* Number of transmitted bytes for unicast traffic on the function. */
16257 	uint64_t	tx_ucast_bytes;
16258 	/* Number of transmitted bytes for multicast traffic on the function. */
16259 	uint64_t	tx_mcast_bytes;
16260 	/* Number of transmitted bytes for broadcast traffic on the function. */
16261 	uint64_t	tx_bcast_bytes;
16262 	/* Number of received unicast packets on the function. */
16263 	uint64_t	rx_ucast_pkts;
16264 	/* Number of received multicast packets on the function. */
16265 	uint64_t	rx_mcast_pkts;
16266 	/* Number of received broadcast packets on the function. */
16267 	uint64_t	rx_bcast_pkts;
16268 	/*
16269 	 * Number of received packets that were discarded on the function
16270 	 * due to resource limitations.  This can happen for 3 reasons.
16271 	 * # The BD used for the packet has a bad format.
16272 	 * # There were no BDs available in the ring for the packet.
16273 	 * # There were no BDs available on-chip for the packet.
16274 	 */
16275 	uint64_t	rx_discard_pkts;
16276 	/*
16277 	 * Number of dropped packets on received path on the function.
16278 	 * These are packets that have been marked for drop by the
16279 	 * RE CFA.
16280 	 */
16281 	uint64_t	rx_drop_pkts;
16282 	/* Number of received bytes for unicast traffic on the function. */
16283 	uint64_t	rx_ucast_bytes;
16284 	/* Number of received bytes for multicast traffic on the function. */
16285 	uint64_t	rx_mcast_bytes;
16286 	/* Number of received bytes for broadcast traffic on the function. */
16287 	uint64_t	rx_bcast_bytes;
16288 	/* Number of aggregated unicast packets on the function. */
16289 	uint64_t	rx_agg_pkts;
16290 	/* Number of aggregated unicast bytes on the function. */
16291 	uint64_t	rx_agg_bytes;
16292 	/* Number of aggregation events on the function. */
16293 	uint64_t	rx_agg_events;
16294 	/* Number of aborted aggregations on the function. */
16295 	uint64_t	rx_agg_aborts;
16296 	/*
16297 	 * This field is the sequence of the statistics of a function being
16298 	 * cleared. Firmware starts the sequence from zero. It increments
16299 	 * the sequence number every time the statistics of the function
16300 	 * are cleared, which can be triggered by a clear statistics request
16301 	 * or by freeing all statistics contexts of the function. If an user
16302 	 * is interested in knowing if the statistics have been cleared
16303 	 * since the last query, it can keep track of this sequence number
16304 	 * between queries.
16305 	 */
16306 	uint8_t	clear_seq;
16307 	uint8_t	unused_0[6];
16308 	/*
16309 	 * This field is used in Output records to indicate that the output
16310 	 * is completely written to RAM.  This field should be read as '1'
16311 	 * to indicate that the output has been completely written.
16312 	 * When writing a command completion or response to an internal processor,
16313 	 * the order of writes has to be such that this field is written last.
16314 	 */
16315 	uint8_t	valid;
16316 } hwrm_func_qstats_output_t, *phwrm_func_qstats_output_t;
16317 
16318 /************************
16319  * hwrm_func_qstats_ext *
16320  ************************/
16321 
16322 
16323 /* hwrm_func_qstats_ext_input (size:256b/32B) */
16324 
16325 typedef struct hwrm_func_qstats_ext_input {
16326 	/* The HWRM command request type. */
16327 	uint16_t	req_type;
16328 	/*
16329 	 * The completion ring to send the completion event on. This should
16330 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16331 	 */
16332 	uint16_t	cmpl_ring;
16333 	/*
16334 	 * The sequence ID is used by the driver for tracking multiple
16335 	 * commands. This ID is treated as opaque data by the firmware and
16336 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16337 	 */
16338 	uint16_t	seq_id;
16339 	/*
16340 	 * The target ID of the command:
16341 	 * * 0x0-0xFFF8 - The function ID
16342 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16343 	 * * 0xFFFD - Reserved for user-space HWRM interface
16344 	 * * 0xFFFF - HWRM
16345 	 */
16346 	uint16_t	target_id;
16347 	/*
16348 	 * A physical address pointer pointing to a host buffer that the
16349 	 * command's response data will be written. This can be either a host
16350 	 * physical address (HPA) or a guest physical address (GPA) and must
16351 	 * point to a physically contiguous block of memory.
16352 	 */
16353 	uint64_t	resp_addr;
16354 	/*
16355 	 * Function ID of the function that is being queried.
16356 	 * 0xFF... (All Fs) if the query is for the requesting
16357 	 * function.
16358 	 * A privileged PF can query for other function's statistics.
16359 	 */
16360 	uint16_t	fid;
16361 	uint8_t	flags;
16362 	/*
16363 	 * This bit should be set to 1 when request is for only RoCE
16364 	 * statistics. This will be honored only if the caller_fid is
16365 	 * a privileged PF. In all other cases FID and caller_fid should
16366 	 * be the same.
16367 	 */
16368 	#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY	UINT32_C(0x1)
16369 	/*
16370 	 * This bit should be set to 1 when request is for the counter mask
16371 	 * representing the width of each of the stats counters, rather
16372 	 * than counters themselves.
16373 	 */
16374 	#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x2)
16375 	uint8_t	unused_0[1];
16376 	uint32_t	enables;
16377 	/*
16378 	 * This bit must be '1' for the schq_id and traffic_class fields to
16379 	 * be configured.
16380 	 */
16381 	#define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID	UINT32_C(0x1)
16382 	/* Specifies the SCHQ for which to gather statistics */
16383 	uint16_t	schq_id;
16384 	/*
16385 	 * Specifies the traffic class for which to gather statistics. Valid
16386 	 * values are 0 through (max_configurable_queues - 1), where
16387 	 * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
16388 	 */
16389 	uint16_t	traffic_class;
16390 	uint8_t	unused_1[4];
16391 } hwrm_func_qstats_ext_input_t, *phwrm_func_qstats_ext_input_t;
16392 
16393 /* hwrm_func_qstats_ext_output (size:1536b/192B) */
16394 
16395 typedef struct hwrm_func_qstats_ext_output {
16396 	/* The specific error status for the command. */
16397 	uint16_t	error_code;
16398 	/* The HWRM command request type. */
16399 	uint16_t	req_type;
16400 	/* The sequence ID from the original command. */
16401 	uint16_t	seq_id;
16402 	/* The length of the response data in number of bytes. */
16403 	uint16_t	resp_len;
16404 	/* Number of received unicast packets */
16405 	uint64_t	rx_ucast_pkts;
16406 	/* Number of received multicast packets */
16407 	uint64_t	rx_mcast_pkts;
16408 	/* Number of received broadcast packets */
16409 	uint64_t	rx_bcast_pkts;
16410 	/* Number of discarded packets on received path */
16411 	uint64_t	rx_discard_pkts;
16412 	/* Number of packets on receive path with error */
16413 	uint64_t	rx_error_pkts;
16414 	/* Number of received bytes for unicast traffic */
16415 	uint64_t	rx_ucast_bytes;
16416 	/* Number of received bytes for multicast traffic */
16417 	uint64_t	rx_mcast_bytes;
16418 	/* Number of received bytes for broadcast traffic */
16419 	uint64_t	rx_bcast_bytes;
16420 	/* Number of transmitted unicast packets */
16421 	uint64_t	tx_ucast_pkts;
16422 	/* Number of transmitted multicast packets */
16423 	uint64_t	tx_mcast_pkts;
16424 	/* Number of transmitted broadcast packets */
16425 	uint64_t	tx_bcast_pkts;
16426 	/* Number of packets on transmit path with error */
16427 	uint64_t	tx_error_pkts;
16428 	/* Number of discarded packets on transmit path */
16429 	uint64_t	tx_discard_pkts;
16430 	/* Number of transmitted bytes for unicast traffic */
16431 	uint64_t	tx_ucast_bytes;
16432 	/* Number of transmitted bytes for multicast traffic */
16433 	uint64_t	tx_mcast_bytes;
16434 	/* Number of transmitted bytes for broadcast traffic */
16435 	uint64_t	tx_bcast_bytes;
16436 	/* Number of TPA eligible packets */
16437 	uint64_t	rx_tpa_eligible_pkt;
16438 	/* Number of TPA eligible bytes */
16439 	uint64_t	rx_tpa_eligible_bytes;
16440 	/* Number of TPA packets */
16441 	uint64_t	rx_tpa_pkt;
16442 	/* Number of TPA bytes */
16443 	uint64_t	rx_tpa_bytes;
16444 	/* Number of TPA errors */
16445 	uint64_t	rx_tpa_errors;
16446 	/* Number of TPA errors */
16447 	uint64_t	rx_tpa_events;
16448 	uint8_t	unused_0[7];
16449 	/*
16450 	 * This field is used in Output records to indicate that the output
16451 	 * is completely written to RAM.  This field should be read as '1'
16452 	 * to indicate that the output has been completely written.
16453 	 * When writing a command completion or response to an internal processor,
16454 	 * the order of writes has to be such that this field is written last.
16455 	 */
16456 	uint8_t	valid;
16457 } hwrm_func_qstats_ext_output_t, *phwrm_func_qstats_ext_output_t;
16458 
16459 /***********************
16460  * hwrm_func_clr_stats *
16461  ***********************/
16462 
16463 
16464 /* hwrm_func_clr_stats_input (size:192b/24B) */
16465 
16466 typedef struct hwrm_func_clr_stats_input {
16467 	/* The HWRM command request type. */
16468 	uint16_t	req_type;
16469 	/*
16470 	 * The completion ring to send the completion event on. This should
16471 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16472 	 */
16473 	uint16_t	cmpl_ring;
16474 	/*
16475 	 * The sequence ID is used by the driver for tracking multiple
16476 	 * commands. This ID is treated as opaque data by the firmware and
16477 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16478 	 */
16479 	uint16_t	seq_id;
16480 	/*
16481 	 * The target ID of the command:
16482 	 * * 0x0-0xFFF8 - The function ID
16483 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16484 	 * * 0xFFFD - Reserved for user-space HWRM interface
16485 	 * * 0xFFFF - HWRM
16486 	 */
16487 	uint16_t	target_id;
16488 	/*
16489 	 * A physical address pointer pointing to a host buffer that the
16490 	 * command's response data will be written. This can be either a host
16491 	 * physical address (HPA) or a guest physical address (GPA) and must
16492 	 * point to a physically contiguous block of memory.
16493 	 */
16494 	uint64_t	resp_addr;
16495 	/*
16496 	 * Function ID of the function.
16497 	 * 0xFF... (All Fs) if the query is for the requesting
16498 	 * function.
16499 	 */
16500 	uint16_t	fid;
16501 	uint8_t	unused_0[6];
16502 } hwrm_func_clr_stats_input_t, *phwrm_func_clr_stats_input_t;
16503 
16504 /* hwrm_func_clr_stats_output (size:128b/16B) */
16505 
16506 typedef struct hwrm_func_clr_stats_output {
16507 	/* The specific error status for the command. */
16508 	uint16_t	error_code;
16509 	/* The HWRM command request type. */
16510 	uint16_t	req_type;
16511 	/* The sequence ID from the original command. */
16512 	uint16_t	seq_id;
16513 	/* The length of the response data in number of bytes. */
16514 	uint16_t	resp_len;
16515 	uint8_t	unused_0[7];
16516 	/*
16517 	 * This field is used in Output records to indicate that the output
16518 	 * is completely written to RAM.  This field should be read as '1'
16519 	 * to indicate that the output has been completely written.
16520 	 * When writing a command completion or response to an internal processor,
16521 	 * the order of writes has to be such that this field is written last.
16522 	 */
16523 	uint8_t	valid;
16524 } hwrm_func_clr_stats_output_t, *phwrm_func_clr_stats_output_t;
16525 
16526 /**************************
16527  * hwrm_func_vf_resc_free *
16528  **************************/
16529 
16530 
16531 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
16532 
16533 typedef struct hwrm_func_vf_resc_free_input {
16534 	/* The HWRM command request type. */
16535 	uint16_t	req_type;
16536 	/*
16537 	 * The completion ring to send the completion event on. This should
16538 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16539 	 */
16540 	uint16_t	cmpl_ring;
16541 	/*
16542 	 * The sequence ID is used by the driver for tracking multiple
16543 	 * commands. This ID is treated as opaque data by the firmware and
16544 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16545 	 */
16546 	uint16_t	seq_id;
16547 	/*
16548 	 * The target ID of the command:
16549 	 * * 0x0-0xFFF8 - The function ID
16550 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16551 	 * * 0xFFFD - Reserved for user-space HWRM interface
16552 	 * * 0xFFFF - HWRM
16553 	 */
16554 	uint16_t	target_id;
16555 	/*
16556 	 * A physical address pointer pointing to a host buffer that the
16557 	 * command's response data will be written. This can be either a host
16558 	 * physical address (HPA) or a guest physical address (GPA) and must
16559 	 * point to a physically contiguous block of memory.
16560 	 */
16561 	uint64_t	resp_addr;
16562 	/*
16563 	 * This value is used to identify a Virtual Function (VF).
16564 	 * The scope of VF ID is local within a PF.
16565 	 */
16566 	uint16_t	vf_id;
16567 	uint8_t	unused_0[6];
16568 } hwrm_func_vf_resc_free_input_t, *phwrm_func_vf_resc_free_input_t;
16569 
16570 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
16571 
16572 typedef struct hwrm_func_vf_resc_free_output {
16573 	/* The specific error status for the command. */
16574 	uint16_t	error_code;
16575 	/* The HWRM command request type. */
16576 	uint16_t	req_type;
16577 	/* The sequence ID from the original command. */
16578 	uint16_t	seq_id;
16579 	/* The length of the response data in number of bytes. */
16580 	uint16_t	resp_len;
16581 	uint8_t	unused_0[7];
16582 	/*
16583 	 * This field is used in Output records to indicate that the output
16584 	 * is completely written to RAM.  This field should be read as '1'
16585 	 * to indicate that the output has been completely written.
16586 	 * When writing a command completion or response to an internal processor,
16587 	 * the order of writes has to be such that this field is written last.
16588 	 */
16589 	uint8_t	valid;
16590 } hwrm_func_vf_resc_free_output_t, *phwrm_func_vf_resc_free_output_t;
16591 
16592 /**********************
16593  * hwrm_func_drv_rgtr *
16594  **********************/
16595 
16596 
16597 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
16598 
16599 typedef struct hwrm_func_drv_rgtr_input {
16600 	/* The HWRM command request type. */
16601 	uint16_t	req_type;
16602 	/*
16603 	 * The completion ring to send the completion event on. This should
16604 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16605 	 */
16606 	uint16_t	cmpl_ring;
16607 	/*
16608 	 * The sequence ID is used by the driver for tracking multiple
16609 	 * commands. This ID is treated as opaque data by the firmware and
16610 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16611 	 */
16612 	uint16_t	seq_id;
16613 	/*
16614 	 * The target ID of the command:
16615 	 * * 0x0-0xFFF8 - The function ID
16616 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16617 	 * * 0xFFFD - Reserved for user-space HWRM interface
16618 	 * * 0xFFFF - HWRM
16619 	 */
16620 	uint16_t	target_id;
16621 	/*
16622 	 * A physical address pointer pointing to a host buffer that the
16623 	 * command's response data will be written. This can be either a host
16624 	 * physical address (HPA) or a guest physical address (GPA) and must
16625 	 * point to a physically contiguous block of memory.
16626 	 */
16627 	uint64_t	resp_addr;
16628 	uint32_t	flags;
16629 	/*
16630 	 * When this bit is '1', the function driver is requesting
16631 	 * all requests from its children VF drivers to be
16632 	 * forwarded to itself.
16633 	 * This flag can only be set by the PF driver.
16634 	 * If a VF driver sets this flag, it should be ignored
16635 	 * by the HWRM.
16636 	 */
16637 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE			UINT32_C(0x1)
16638 	/*
16639 	 * When this bit is '1', the function is requesting none of
16640 	 * the requests from its children VF drivers to be
16641 	 * forwarded to itself.
16642 	 * This flag can only be set by the PF driver.
16643 	 * If a VF driver sets this flag, it should be ignored
16644 	 * by the HWRM.
16645 	 */
16646 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE			UINT32_C(0x2)
16647 	/*
16648 	 * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
16649 	 * fields shall be ignored and ver_maj, ver_min, ver_upd
16650 	 * and ver_patch shall be used for the driver version information.
16651 	 * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
16652 	 * fields shall be used for the driver version information and
16653 	 * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
16654 	 */
16655 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE		UINT32_C(0x4)
16656 	/*
16657 	 * When this bit is '1', the function is indicating support of
16658 	 * 64bit flow handle.  The firmware that only supports 64bit flow
16659 	 * handle should check this bit before allowing processing of
16660 	 * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
16661 	 * with 64bit flow handle support can only be compatible with drivers
16662 	 * that support 64bit flow handle. The legacy drivers that don't support
16663 	 * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
16664 	 * running with new firmware that only supports 64bit flow handle. The new
16665 	 * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
16666 	 * status to the legacy driver when encounters these commands.
16667 	 */
16668 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE	UINT32_C(0x8)
16669 	/*
16670 	 * When this bit is '1', the function is indicating support of
16671 	 * Hot Reset. The driver interface will destroy the resources,
16672 	 * unregister the function and register again up on receiving
16673 	 * the RESET_NOTIFY Async notification from the core firmware.
16674 	 * The core firmware will this use flag and trigger the Hot Reset
16675 	 * process only if all the registered driver instances are capable
16676 	 * of this support.
16677 	 */
16678 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT		UINT32_C(0x10)
16679 	/*
16680 	 * When this bit is 1, the function is indicating the support of the
16681 	 * error recovery capability. Error recovery support will be used by
16682 	 * firmware only if all the driver instances support error recovery
16683 	 * process. By setting this bit, driver is indicating support for
16684 	 * corresponding async event completion message. These will be
16685 	 * delivered to the driver even if they did not register for it.
16686 	 * If supported, after receiving reset notify async event with fatal
16687 	 * flag set in event data1, then all the drivers have to tear down
16688 	 * their resources without sending any HWRM commands to FW.
16689 	 */
16690 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT	UINT32_C(0x20)
16691 	/*
16692 	 * When this bit is 1, the function is indicating the support of the
16693 	 * Master capability. The Firmware will use this capability to select the
16694 	 * Master function. The master function will be used to initiate
16695 	 * designated functionality like error recovery etc… If none of the
16696 	 * registered PF’s or trusted VF’s indicate this support, then
16697 	 * firmware will select the 1st registered PF as Master capable instance.
16698 	 */
16699 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT		UINT32_C(0x40)
16700 	/*
16701 	 * When this bit is 1, the function is indicating the support of the
16702 	 * fast reset capability. Fast reset support will be used by
16703 	 * firmware only if all the driver instances support fast reset
16704 	 * process. By setting this bit, driver is indicating support for
16705 	 * corresponding async event completion message. These will be
16706 	 * delivered to the driver even if they did not register for it.
16707 	 * If supported, after receiving reset notify async event with fast
16708 	 * reset flag set in event data1, then all the drivers have to tear
16709 	 * down their resources without sending any HWRM commands to FW.
16710 	 */
16711 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FAST_RESET_SUPPORT		UINT32_C(0x80)
16712 	/*
16713 	 * When this bit is 1, the function's driver is indicating the
16714 	 * support of handling the vnic_rss_cfg's INVALID_PARAM error
16715 	 * returned by firmware. Firmware returns error, if host driver
16716 	 * configures the invalid hash_types bit combination for a given
16717 	 * IP version.
16718 	 */
16719 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_RSS_STRICT_HASH_TYPE_SUPPORT	UINT32_C(0x100)
16720 	/*
16721 	 * When this bit is 1, the function's driver is indicating the
16722 	 * support of handling the NPAR 1.2 feature where the s-tag may be
16723 	 * a value other than 0x8100 or 0x88a8.
16724 	 */
16725 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_NPAR_1_2_SUPPORT		UINT32_C(0x200)
16726 	/*
16727 	 * When this bit is 1, the function's driver is indicating the
16728 	 * support for asymmetric queue configuration, such that queue
16729 	 * ids and service profiles on TX side are not the same as the
16730 	 * corresponding queue configuration on the RX side
16731 	 */
16732 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ASYM_QUEUE_CFG_SUPPORT	UINT32_C(0x400)
16733 	uint32_t	enables;
16734 	/*
16735 	 * This bit must be '1' for the os_type field to be
16736 	 * configured.
16737 	 */
16738 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE		UINT32_C(0x1)
16739 	/*
16740 	 * This bit must be '1' for the ver field to be
16741 	 * configured.
16742 	 */
16743 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER		UINT32_C(0x2)
16744 	/*
16745 	 * This bit must be '1' for the timestamp field to be
16746 	 * configured.
16747 	 */
16748 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP	UINT32_C(0x4)
16749 	/*
16750 	 * This bit must be '1' for the vf_req_fwd field to be
16751 	 * configured.
16752 	 */
16753 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD	UINT32_C(0x8)
16754 	/*
16755 	 * This bit must be '1' for the async_event_fwd field to be
16756 	 * configured.
16757 	 */
16758 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD	UINT32_C(0x10)
16759 	/* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
16760 	uint16_t	os_type;
16761 	/* Unknown */
16762 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
16763 	/* Other OS not listed below. */
16764 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER	UINT32_C(0x1)
16765 	/* MSDOS OS. */
16766 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS	UINT32_C(0xe)
16767 	/* Windows OS. */
16768 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
16769 	/* Solaris OS. */
16770 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
16771 	/* Linux OS. */
16772 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX	UINT32_C(0x24)
16773 	/* FreeBSD OS. */
16774 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
16775 	/* VMware ESXi OS. */
16776 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI	UINT32_C(0x68)
16777 	/* Microsoft Windows 8 64-bit OS. */
16778 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864	UINT32_C(0x73)
16779 	/* Microsoft Windows Server 2012 R2 OS. */
16780 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
16781 	/* UEFI driver. */
16782 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI	UINT32_C(0x8000)
16783 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST	HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
16784 	/* This is the 8bit major version of the driver. */
16785 	uint8_t	ver_maj_8b;
16786 	/* This is the 8bit minor version of the driver. */
16787 	uint8_t	ver_min_8b;
16788 	/* This is the 8bit update version of the driver. */
16789 	uint8_t	ver_upd_8b;
16790 	uint8_t	unused_0[3];
16791 	/*
16792 	 * This is a 32-bit timestamp provided by the driver for
16793 	 * keep alive.
16794 	 * The timestamp is in multiples of 1ms.
16795 	 */
16796 	uint32_t	timestamp;
16797 	uint8_t	unused_1[4];
16798 	/*
16799 	 * This is a 256-bit bit mask provided by the PF driver for
16800 	 * letting the HWRM know what commands issued by the VF driver
16801 	 * to the HWRM should be forwarded to the PF driver.
16802 	 * Nth bit refers to the Nth req_type.
16803 	 *
16804 	 * Setting Nth bit to 1 indicates that requests from the
16805 	 * VF driver with req_type equal to N shall be forwarded to
16806 	 * the parent PF driver.
16807 	 *
16808 	 * This field is not valid for the VF driver.
16809 	 */
16810 	uint32_t	vf_req_fwd[8];
16811 	/*
16812 	 * This is a 256-bit bit mask provided by the function driver
16813 	 * (PF or VF driver) to indicate the list of asynchronous event
16814 	 * completions to be forwarded.
16815 	 *
16816 	 * Nth bit refers to the Nth event_id.
16817 	 *
16818 	 * Setting Nth bit to 1 by the function driver shall result in
16819 	 * the HWRM forwarding asynchronous event completion with
16820 	 * event_id equal to N.
16821 	 *
16822 	 * If all bits are set to 0 (value of 0), then the HWRM shall
16823 	 * not forward any asynchronous event completion to this
16824 	 * function driver.
16825 	 */
16826 	uint32_t	async_event_fwd[8];
16827 	/* This is the 16bit major version of the driver. */
16828 	uint16_t	ver_maj;
16829 	/* This is the 16bit minor version of the driver. */
16830 	uint16_t	ver_min;
16831 	/* This is the 16bit update version of the driver. */
16832 	uint16_t	ver_upd;
16833 	/* This is the 16bit patch version of the driver. */
16834 	uint16_t	ver_patch;
16835 } hwrm_func_drv_rgtr_input_t, *phwrm_func_drv_rgtr_input_t;
16836 
16837 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
16838 
16839 typedef struct hwrm_func_drv_rgtr_output {
16840 	/* The specific error status for the command. */
16841 	uint16_t	error_code;
16842 	/* The HWRM command request type. */
16843 	uint16_t	req_type;
16844 	/* The sequence ID from the original command. */
16845 	uint16_t	seq_id;
16846 	/* The length of the response data in number of bytes. */
16847 	uint16_t	resp_len;
16848 	uint32_t	flags;
16849 	/*
16850 	 * When this bit is '1', it indicates that the
16851 	 * HWRM_FUNC_DRV_IF_CHANGE call is supported.
16852 	 */
16853 	#define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED	UINT32_C(0x1)
16854 	uint8_t	unused_0[3];
16855 	/*
16856 	 * This field is used in Output records to indicate that the output
16857 	 * is completely written to RAM.  This field should be read as '1'
16858 	 * to indicate that the output has been completely written.
16859 	 * When writing a command completion or response to an internal processor,
16860 	 * the order of writes has to be such that this field is written last.
16861 	 */
16862 	uint8_t	valid;
16863 } hwrm_func_drv_rgtr_output_t, *phwrm_func_drv_rgtr_output_t;
16864 
16865 /************************
16866  * hwrm_func_drv_unrgtr *
16867  ************************/
16868 
16869 
16870 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
16871 
16872 typedef struct hwrm_func_drv_unrgtr_input {
16873 	/* The HWRM command request type. */
16874 	uint16_t	req_type;
16875 	/*
16876 	 * The completion ring to send the completion event on. This should
16877 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16878 	 */
16879 	uint16_t	cmpl_ring;
16880 	/*
16881 	 * The sequence ID is used by the driver for tracking multiple
16882 	 * commands. This ID is treated as opaque data by the firmware and
16883 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16884 	 */
16885 	uint16_t	seq_id;
16886 	/*
16887 	 * The target ID of the command:
16888 	 * * 0x0-0xFFF8 - The function ID
16889 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16890 	 * * 0xFFFD - Reserved for user-space HWRM interface
16891 	 * * 0xFFFF - HWRM
16892 	 */
16893 	uint16_t	target_id;
16894 	/*
16895 	 * A physical address pointer pointing to a host buffer that the
16896 	 * command's response data will be written. This can be either a host
16897 	 * physical address (HPA) or a guest physical address (GPA) and must
16898 	 * point to a physically contiguous block of memory.
16899 	 */
16900 	uint64_t	resp_addr;
16901 	uint32_t	flags;
16902 	/*
16903 	 * When this bit is '1', the function driver is notifying
16904 	 * the HWRM to prepare for the shutdown.
16905 	 */
16906 	#define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN	UINT32_C(0x1)
16907 	uint8_t	unused_0[4];
16908 } hwrm_func_drv_unrgtr_input_t, *phwrm_func_drv_unrgtr_input_t;
16909 
16910 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
16911 
16912 typedef struct hwrm_func_drv_unrgtr_output {
16913 	/* The specific error status for the command. */
16914 	uint16_t	error_code;
16915 	/* The HWRM command request type. */
16916 	uint16_t	req_type;
16917 	/* The sequence ID from the original command. */
16918 	uint16_t	seq_id;
16919 	/* The length of the response data in number of bytes. */
16920 	uint16_t	resp_len;
16921 	uint8_t	unused_0[7];
16922 	/*
16923 	 * This field is used in Output records to indicate that the output
16924 	 * is completely written to RAM.  This field should be read as '1'
16925 	 * to indicate that the output has been completely written.
16926 	 * When writing a command completion or response to an internal processor,
16927 	 * the order of writes has to be such that this field is written last.
16928 	 */
16929 	uint8_t	valid;
16930 } hwrm_func_drv_unrgtr_output_t, *phwrm_func_drv_unrgtr_output_t;
16931 
16932 /**********************
16933  * hwrm_func_buf_rgtr *
16934  **********************/
16935 
16936 
16937 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
16938 
16939 typedef struct hwrm_func_buf_rgtr_input {
16940 	/* The HWRM command request type. */
16941 	uint16_t	req_type;
16942 	/*
16943 	 * The completion ring to send the completion event on. This should
16944 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16945 	 */
16946 	uint16_t	cmpl_ring;
16947 	/*
16948 	 * The sequence ID is used by the driver for tracking multiple
16949 	 * commands. This ID is treated as opaque data by the firmware and
16950 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16951 	 */
16952 	uint16_t	seq_id;
16953 	/*
16954 	 * The target ID of the command:
16955 	 * * 0x0-0xFFF8 - The function ID
16956 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16957 	 * * 0xFFFD - Reserved for user-space HWRM interface
16958 	 * * 0xFFFF - HWRM
16959 	 */
16960 	uint16_t	target_id;
16961 	/*
16962 	 * A physical address pointer pointing to a host buffer that the
16963 	 * command's response data will be written. This can be either a host
16964 	 * physical address (HPA) or a guest physical address (GPA) and must
16965 	 * point to a physically contiguous block of memory.
16966 	 */
16967 	uint64_t	resp_addr;
16968 	uint32_t	enables;
16969 	/*
16970 	 * This bit must be '1' for the vf_id field to be
16971 	 * configured.
16972 	 */
16973 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID		UINT32_C(0x1)
16974 	/*
16975 	 * This bit must be '1' for the err_buf_addr field to be
16976 	 * configured.
16977 	 */
16978 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR	UINT32_C(0x2)
16979 	/*
16980 	 * This value is used to identify a Virtual Function (VF).
16981 	 * The scope of VF ID is local within a PF.
16982 	 */
16983 	uint16_t	vf_id;
16984 	/*
16985 	 * This field represents the number of pages used for request
16986 	 * buffer(s).
16987 	 */
16988 	uint16_t	req_buf_num_pages;
16989 	/*
16990 	 * This field represents the page size used for request
16991 	 * buffer(s).
16992 	 */
16993 	uint16_t	req_buf_page_size;
16994 	/* 16 bytes */
16995 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
16996 	/* 4 Kbytes */
16997 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
16998 	/* 8 Kbytes */
16999 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
17000 	/* 64 Kbytes */
17001 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
17002 	/* 2 Mbytes */
17003 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
17004 	/* 4 Mbytes */
17005 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
17006 	/* 1 Gbytes */
17007 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
17008 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
17009 	/* The length of the request buffer per VF in bytes. */
17010 	uint16_t	req_buf_len;
17011 	/* The length of the response buffer in bytes. */
17012 	uint16_t	resp_buf_len;
17013 	uint8_t	unused_0[2];
17014 	/* This field represents the page address of page #0. */
17015 	uint64_t	req_buf_page_addr0;
17016 	/* This field represents the page address of page #1. */
17017 	uint64_t	req_buf_page_addr1;
17018 	/* This field represents the page address of page #2. */
17019 	uint64_t	req_buf_page_addr2;
17020 	/* This field represents the page address of page #3. */
17021 	uint64_t	req_buf_page_addr3;
17022 	/* This field represents the page address of page #4. */
17023 	uint64_t	req_buf_page_addr4;
17024 	/* This field represents the page address of page #5. */
17025 	uint64_t	req_buf_page_addr5;
17026 	/* This field represents the page address of page #6. */
17027 	uint64_t	req_buf_page_addr6;
17028 	/* This field represents the page address of page #7. */
17029 	uint64_t	req_buf_page_addr7;
17030 	/* This field represents the page address of page #8. */
17031 	uint64_t	req_buf_page_addr8;
17032 	/* This field represents the page address of page #9. */
17033 	uint64_t	req_buf_page_addr9;
17034 	/*
17035 	 * This field is used to receive the error reporting from
17036 	 * the chipset. Only applicable for PFs.
17037 	 */
17038 	uint64_t	error_buf_addr;
17039 	/*
17040 	 * This field is used to receive the response forwarded by the
17041 	 * HWRM.
17042 	 */
17043 	uint64_t	resp_buf_addr;
17044 } hwrm_func_buf_rgtr_input_t, *phwrm_func_buf_rgtr_input_t;
17045 
17046 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
17047 
17048 typedef struct hwrm_func_buf_rgtr_output {
17049 	/* The specific error status for the command. */
17050 	uint16_t	error_code;
17051 	/* The HWRM command request type. */
17052 	uint16_t	req_type;
17053 	/* The sequence ID from the original command. */
17054 	uint16_t	seq_id;
17055 	/* The length of the response data in number of bytes. */
17056 	uint16_t	resp_len;
17057 	uint8_t	unused_0[7];
17058 	/*
17059 	 * This field is used in Output records to indicate that the output
17060 	 * is completely written to RAM.  This field should be read as '1'
17061 	 * to indicate that the output has been completely written.
17062 	 * When writing a command completion or response to an internal processor,
17063 	 * the order of writes has to be such that this field is written last.
17064 	 */
17065 	uint8_t	valid;
17066 } hwrm_func_buf_rgtr_output_t, *phwrm_func_buf_rgtr_output_t;
17067 
17068 /************************
17069  * hwrm_func_buf_unrgtr *
17070  ************************/
17071 
17072 
17073 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
17074 
17075 typedef struct hwrm_func_buf_unrgtr_input {
17076 	/* The HWRM command request type. */
17077 	uint16_t	req_type;
17078 	/*
17079 	 * The completion ring to send the completion event on. This should
17080 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17081 	 */
17082 	uint16_t	cmpl_ring;
17083 	/*
17084 	 * The sequence ID is used by the driver for tracking multiple
17085 	 * commands. This ID is treated as opaque data by the firmware and
17086 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17087 	 */
17088 	uint16_t	seq_id;
17089 	/*
17090 	 * The target ID of the command:
17091 	 * * 0x0-0xFFF8 - The function ID
17092 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17093 	 * * 0xFFFD - Reserved for user-space HWRM interface
17094 	 * * 0xFFFF - HWRM
17095 	 */
17096 	uint16_t	target_id;
17097 	/*
17098 	 * A physical address pointer pointing to a host buffer that the
17099 	 * command's response data will be written. This can be either a host
17100 	 * physical address (HPA) or a guest physical address (GPA) and must
17101 	 * point to a physically contiguous block of memory.
17102 	 */
17103 	uint64_t	resp_addr;
17104 	uint32_t	enables;
17105 	/*
17106 	 * This bit must be '1' for the vf_id field to be
17107 	 * configured.
17108 	 */
17109 	#define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID	UINT32_C(0x1)
17110 	/*
17111 	 * This value is used to identify a Virtual Function (VF).
17112 	 * The scope of VF ID is local within a PF.
17113 	 */
17114 	uint16_t	vf_id;
17115 	uint8_t	unused_0[2];
17116 } hwrm_func_buf_unrgtr_input_t, *phwrm_func_buf_unrgtr_input_t;
17117 
17118 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
17119 
17120 typedef struct hwrm_func_buf_unrgtr_output {
17121 	/* The specific error status for the command. */
17122 	uint16_t	error_code;
17123 	/* The HWRM command request type. */
17124 	uint16_t	req_type;
17125 	/* The sequence ID from the original command. */
17126 	uint16_t	seq_id;
17127 	/* The length of the response data in number of bytes. */
17128 	uint16_t	resp_len;
17129 	uint8_t	unused_0[7];
17130 	/*
17131 	 * This field is used in Output records to indicate that the output
17132 	 * is completely written to RAM.  This field should be read as '1'
17133 	 * to indicate that the output has been completely written.
17134 	 * When writing a command completion or response to an internal processor,
17135 	 * the order of writes has to be such that this field is written last.
17136 	 */
17137 	uint8_t	valid;
17138 } hwrm_func_buf_unrgtr_output_t, *phwrm_func_buf_unrgtr_output_t;
17139 
17140 /**********************
17141  * hwrm_func_drv_qver *
17142  **********************/
17143 
17144 
17145 /* hwrm_func_drv_qver_input (size:192b/24B) */
17146 
17147 typedef struct hwrm_func_drv_qver_input {
17148 	/* The HWRM command request type. */
17149 	uint16_t	req_type;
17150 	/*
17151 	 * The completion ring to send the completion event on. This should
17152 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17153 	 */
17154 	uint16_t	cmpl_ring;
17155 	/*
17156 	 * The sequence ID is used by the driver for tracking multiple
17157 	 * commands. This ID is treated as opaque data by the firmware and
17158 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17159 	 */
17160 	uint16_t	seq_id;
17161 	/*
17162 	 * The target ID of the command:
17163 	 * * 0x0-0xFFF8 - The function ID
17164 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17165 	 * * 0xFFFD - Reserved for user-space HWRM interface
17166 	 * * 0xFFFF - HWRM
17167 	 */
17168 	uint16_t	target_id;
17169 	/*
17170 	 * A physical address pointer pointing to a host buffer that the
17171 	 * command's response data will be written. This can be either a host
17172 	 * physical address (HPA) or a guest physical address (GPA) and must
17173 	 * point to a physically contiguous block of memory.
17174 	 */
17175 	uint64_t	resp_addr;
17176 	/* Reserved for future use. */
17177 	uint32_t	reserved;
17178 	/*
17179 	 * Function ID of the function that is being queried.
17180 	 * 0xFF... (All Fs) if the query is for the requesting
17181 	 * function.
17182 	 */
17183 	uint16_t	fid;
17184 	uint8_t	unused_0[2];
17185 } hwrm_func_drv_qver_input_t, *phwrm_func_drv_qver_input_t;
17186 
17187 /* hwrm_func_drv_qver_output (size:256b/32B) */
17188 
17189 typedef struct hwrm_func_drv_qver_output {
17190 	/* The specific error status for the command. */
17191 	uint16_t	error_code;
17192 	/* The HWRM command request type. */
17193 	uint16_t	req_type;
17194 	/* The sequence ID from the original command. */
17195 	uint16_t	seq_id;
17196 	/* The length of the response data in number of bytes. */
17197 	uint16_t	resp_len;
17198 	/* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
17199 	uint16_t	os_type;
17200 	/* Unknown */
17201 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
17202 	/* Other OS not listed below. */
17203 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER	UINT32_C(0x1)
17204 	/* MSDOS OS. */
17205 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS	UINT32_C(0xe)
17206 	/* Windows OS. */
17207 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
17208 	/* Solaris OS. */
17209 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
17210 	/* Linux OS. */
17211 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX	UINT32_C(0x24)
17212 	/* FreeBSD OS. */
17213 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
17214 	/* VMware ESXi OS. */
17215 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI	UINT32_C(0x68)
17216 	/* Microsoft Windows 8 64-bit OS. */
17217 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864	UINT32_C(0x73)
17218 	/* Microsoft Windows Server 2012 R2 OS. */
17219 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
17220 	/* UEFI driver. */
17221 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI	UINT32_C(0x8000)
17222 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST	HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
17223 	/* This is the 8bit major version of the driver. */
17224 	uint8_t	ver_maj_8b;
17225 	/* This is the 8bit minor version of the driver. */
17226 	uint8_t	ver_min_8b;
17227 	/* This is the 8bit update version of the driver. */
17228 	uint8_t	ver_upd_8b;
17229 	uint8_t	unused_0[3];
17230 	/* This is the 16bit major version of the driver. */
17231 	uint16_t	ver_maj;
17232 	/* This is the 16bit minor version of the driver. */
17233 	uint16_t	ver_min;
17234 	/* This is the 16bit update version of the driver. */
17235 	uint16_t	ver_upd;
17236 	/* This is the 16bit patch version of the driver. */
17237 	uint16_t	ver_patch;
17238 	uint8_t	unused_1[7];
17239 	/*
17240 	 * This field is used in Output records to indicate that the output
17241 	 * is completely written to RAM.  This field should be read as '1'
17242 	 * to indicate that the output has been completely written.
17243 	 * When writing a command completion or response to an internal processor,
17244 	 * the order of writes has to be such that this field is written last.
17245 	 */
17246 	uint8_t	valid;
17247 } hwrm_func_drv_qver_output_t, *phwrm_func_drv_qver_output_t;
17248 
17249 /****************************
17250  * hwrm_func_resource_qcaps *
17251  ****************************/
17252 
17253 
17254 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
17255 
17256 typedef struct hwrm_func_resource_qcaps_input {
17257 	/* The HWRM command request type. */
17258 	uint16_t	req_type;
17259 	/*
17260 	 * The completion ring to send the completion event on. This should
17261 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17262 	 */
17263 	uint16_t	cmpl_ring;
17264 	/*
17265 	 * The sequence ID is used by the driver for tracking multiple
17266 	 * commands. This ID is treated as opaque data by the firmware and
17267 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17268 	 */
17269 	uint16_t	seq_id;
17270 	/*
17271 	 * The target ID of the command:
17272 	 * * 0x0-0xFFF8 - The function ID
17273 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17274 	 * * 0xFFFD - Reserved for user-space HWRM interface
17275 	 * * 0xFFFF - HWRM
17276 	 */
17277 	uint16_t	target_id;
17278 	/*
17279 	 * A physical address pointer pointing to a host buffer that the
17280 	 * command's response data will be written. This can be either a host
17281 	 * physical address (HPA) or a guest physical address (GPA) and must
17282 	 * point to a physically contiguous block of memory.
17283 	 */
17284 	uint64_t	resp_addr;
17285 	/*
17286 	 * Function ID of the function that is being queried.
17287 	 * 0xFF... (All Fs) if the query is for the requesting
17288 	 * function.
17289 	 */
17290 	uint16_t	fid;
17291 	uint8_t	unused_0[6];
17292 } hwrm_func_resource_qcaps_input_t, *phwrm_func_resource_qcaps_input_t;
17293 
17294 /* hwrm_func_resource_qcaps_output (size:576b/72B) */
17295 
17296 typedef struct hwrm_func_resource_qcaps_output {
17297 	/* The specific error status for the command. */
17298 	uint16_t	error_code;
17299 	/* The HWRM command request type. */
17300 	uint16_t	req_type;
17301 	/* The sequence ID from the original command. */
17302 	uint16_t	seq_id;
17303 	/* The length of the response data in number of bytes. */
17304 	uint16_t	resp_len;
17305 	/* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
17306 	uint16_t	max_vfs;
17307 	/* Maximum guaranteed number of MSI-X vectors supported by function */
17308 	uint16_t	max_msix;
17309 	/* Hint of strategy to be used by PF driver to reserve resources for its VF */
17310 	uint16_t	vf_reservation_strategy;
17311 	/* The PF driver should evenly divide its remaining resources among all VFs. */
17312 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL	UINT32_C(0x0)
17313 	/* The PF driver should only reserve minimal resources for each VF. */
17314 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL	UINT32_C(0x1)
17315 	/*
17316 	 * The PF driver should not reserve any resources for each VF until
17317 	 * the VF interface is brought up.
17318 	 */
17319 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC UINT32_C(0x2)
17320 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST	HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
17321 	/* Minimum guaranteed number of RSS/COS contexts */
17322 	uint16_t	min_rsscos_ctx;
17323 	/* Maximum non-guaranteed number of RSS/COS contexts */
17324 	uint16_t	max_rsscos_ctx;
17325 	/* Minimum guaranteed number of completion rings */
17326 	uint16_t	min_cmpl_rings;
17327 	/* Maximum non-guaranteed number of completion rings */
17328 	uint16_t	max_cmpl_rings;
17329 	/* Minimum guaranteed number of transmit rings */
17330 	uint16_t	min_tx_rings;
17331 	/* Maximum non-guaranteed number of transmit rings */
17332 	uint16_t	max_tx_rings;
17333 	/* Minimum guaranteed number of receive rings */
17334 	uint16_t	min_rx_rings;
17335 	/* Maximum non-guaranteed number of receive rings */
17336 	uint16_t	max_rx_rings;
17337 	/* Minimum guaranteed number of L2 contexts */
17338 	uint16_t	min_l2_ctxs;
17339 	/* Maximum non-guaranteed number of L2 contexts */
17340 	uint16_t	max_l2_ctxs;
17341 	/* Minimum guaranteed number of VNICs */
17342 	uint16_t	min_vnics;
17343 	/* Maximum non-guaranteed number of VNICs */
17344 	uint16_t	max_vnics;
17345 	/* Minimum guaranteed number of statistic contexts */
17346 	uint16_t	min_stat_ctx;
17347 	/* Maximum non-guaranteed number of statistic contexts */
17348 	uint16_t	max_stat_ctx;
17349 	/* Minimum guaranteed number of ring groups */
17350 	uint16_t	min_hw_ring_grps;
17351 	/* Maximum non-guaranteed number of ring groups */
17352 	uint16_t	max_hw_ring_grps;
17353 	/*
17354 	 * Maximum number of inputs into the transmit scheduler for this function.
17355 	 * The number of TX rings assigned to the function cannot exceed this value.
17356 	 */
17357 	uint16_t	max_tx_scheduler_inputs;
17358 	uint16_t	flags;
17359 	/*
17360 	 * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
17361 	 * feature to reserve all minimum resources when minimum >= 1, otherwise
17362 	 * returns an error.
17363 	 */
17364 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED	UINT32_C(0x1)
17365 	uint8_t	unused_0[2];
17366 	/* Minimum guaranteed number of Tx Key Contexts */
17367 	uint32_t	min_tx_key_ctxs;
17368 	/* Maximum non-guaranteed number of Tx Key Contexts */
17369 	uint32_t	max_tx_key_ctxs;
17370 	/* Minimum guaranteed number of Rx Key Contexts */
17371 	uint32_t	min_rx_key_ctxs;
17372 	/* Maximum non-guaranteed number of Rx Key Contexts */
17373 	uint32_t	max_rx_key_ctxs;
17374 	uint8_t	unused_1[3];
17375 	/*
17376 	 * This field is used in Output records to indicate that the output
17377 	 * is completely written to RAM.  This field should be read as '1'
17378 	 * to indicate that the output has been completely written.
17379 	 * When writing a command completion or response to an internal processor,
17380 	 * the order of writes has to be such that this field is written last.
17381 	 */
17382 	uint8_t	valid;
17383 } hwrm_func_resource_qcaps_output_t, *phwrm_func_resource_qcaps_output_t;
17384 
17385 /*****************************
17386  * hwrm_func_vf_resource_cfg *
17387  *****************************/
17388 
17389 
17390 /* hwrm_func_vf_resource_cfg_input (size:576b/72B) */
17391 
17392 typedef struct hwrm_func_vf_resource_cfg_input {
17393 	/* The HWRM command request type. */
17394 	uint16_t	req_type;
17395 	/*
17396 	 * The completion ring to send the completion event on. This should
17397 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17398 	 */
17399 	uint16_t	cmpl_ring;
17400 	/*
17401 	 * The sequence ID is used by the driver for tracking multiple
17402 	 * commands. This ID is treated as opaque data by the firmware and
17403 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17404 	 */
17405 	uint16_t	seq_id;
17406 	/*
17407 	 * The target ID of the command:
17408 	 * * 0x0-0xFFF8 - The function ID
17409 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17410 	 * * 0xFFFD - Reserved for user-space HWRM interface
17411 	 * * 0xFFFF - HWRM
17412 	 */
17413 	uint16_t	target_id;
17414 	/*
17415 	 * A physical address pointer pointing to a host buffer that the
17416 	 * command's response data will be written. This can be either a host
17417 	 * physical address (HPA) or a guest physical address (GPA) and must
17418 	 * point to a physically contiguous block of memory.
17419 	 */
17420 	uint64_t	resp_addr;
17421 	/* VF ID that is being configured by PF */
17422 	uint16_t	vf_id;
17423 	/* Maximum guaranteed number of MSI-X vectors for the function */
17424 	uint16_t	max_msix;
17425 	/* Minimum guaranteed number of RSS/COS contexts */
17426 	uint16_t	min_rsscos_ctx;
17427 	/* Maximum non-guaranteed number of RSS/COS contexts */
17428 	uint16_t	max_rsscos_ctx;
17429 	/* Minimum guaranteed number of completion rings */
17430 	uint16_t	min_cmpl_rings;
17431 	/* Maximum non-guaranteed number of completion rings */
17432 	uint16_t	max_cmpl_rings;
17433 	/* Minimum guaranteed number of transmit rings */
17434 	uint16_t	min_tx_rings;
17435 	/* Maximum non-guaranteed number of transmit rings */
17436 	uint16_t	max_tx_rings;
17437 	/* Minimum guaranteed number of receive rings */
17438 	uint16_t	min_rx_rings;
17439 	/* Maximum non-guaranteed number of receive rings */
17440 	uint16_t	max_rx_rings;
17441 	/* Minimum guaranteed number of L2 contexts */
17442 	uint16_t	min_l2_ctxs;
17443 	/* Maximum non-guaranteed number of L2 contexts */
17444 	uint16_t	max_l2_ctxs;
17445 	/* Minimum guaranteed number of VNICs */
17446 	uint16_t	min_vnics;
17447 	/* Maximum non-guaranteed number of VNICs */
17448 	uint16_t	max_vnics;
17449 	/* Minimum guaranteed number of statistic contexts */
17450 	uint16_t	min_stat_ctx;
17451 	/* Maximum non-guaranteed number of statistic contexts */
17452 	uint16_t	max_stat_ctx;
17453 	/* Minimum guaranteed number of ring groups */
17454 	uint16_t	min_hw_ring_grps;
17455 	/* Maximum non-guaranteed number of ring groups */
17456 	uint16_t	max_hw_ring_grps;
17457 	uint16_t	flags;
17458 	/*
17459 	 * If this bit is set, all minimum resources requested should be
17460 	 * reserved if minimum >= 1, otherwise return error. In case of
17461 	 * error, keep all existing reservations before the call.
17462 	 */
17463 	#define HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED	UINT32_C(0x1)
17464 	uint8_t	unused_0[2];
17465 	/* Minimum guaranteed number of Tx Key Contexts */
17466 	uint32_t	min_tx_key_ctxs;
17467 	/* Maximum non-guaranteed number of Tx Key Contexts */
17468 	uint32_t	max_tx_key_ctxs;
17469 	/* Minimum guaranteed number of Rx Key Contexts */
17470 	uint32_t	min_rx_key_ctxs;
17471 	/* Maximum non-guaranteed number of Rx Key Contexts */
17472 	uint32_t	max_rx_key_ctxs;
17473 } hwrm_func_vf_resource_cfg_input_t, *phwrm_func_vf_resource_cfg_input_t;
17474 
17475 /* hwrm_func_vf_resource_cfg_output (size:320b/40B) */
17476 
17477 typedef struct hwrm_func_vf_resource_cfg_output {
17478 	/* The specific error status for the command. */
17479 	uint16_t	error_code;
17480 	/* The HWRM command request type. */
17481 	uint16_t	req_type;
17482 	/* The sequence ID from the original command. */
17483 	uint16_t	seq_id;
17484 	/* The length of the response data in number of bytes. */
17485 	uint16_t	resp_len;
17486 	/* Reserved number of RSS/COS contexts */
17487 	uint16_t	reserved_rsscos_ctx;
17488 	/* Reserved number of completion rings */
17489 	uint16_t	reserved_cmpl_rings;
17490 	/* Reserved number of transmit rings */
17491 	uint16_t	reserved_tx_rings;
17492 	/* Reserved number of receive rings */
17493 	uint16_t	reserved_rx_rings;
17494 	/* Reserved number of L2 contexts */
17495 	uint16_t	reserved_l2_ctxs;
17496 	/* Reserved number of VNICs */
17497 	uint16_t	reserved_vnics;
17498 	/* Reserved number of statistic contexts */
17499 	uint16_t	reserved_stat_ctx;
17500 	/* Reserved number of ring groups */
17501 	uint16_t	reserved_hw_ring_grps;
17502 	/* Actual number of Tx Key Contexts reserved */
17503 	uint32_t	reserved_tx_key_ctxs;
17504 	/* Actual number of Rx Key Contexts reserved */
17505 	uint32_t	reserved_rx_key_ctxs;
17506 	uint8_t	unused_0[7];
17507 	/*
17508 	 * This field is used in Output records to indicate that the output
17509 	 * is completely written to RAM.  This field should be read as '1'
17510 	 * to indicate that the output has been completely written.
17511 	 * When writing a command completion or response to an internal processor,
17512 	 * the order of writes has to be such that this field is written last.
17513 	 */
17514 	uint8_t	valid;
17515 } hwrm_func_vf_resource_cfg_output_t, *phwrm_func_vf_resource_cfg_output_t;
17516 
17517 /*********************************
17518  * hwrm_func_backing_store_qcaps *
17519  *********************************/
17520 
17521 
17522 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
17523 
17524 typedef struct hwrm_func_backing_store_qcaps_input {
17525 	/* The HWRM command request type. */
17526 	uint16_t	req_type;
17527 	/*
17528 	 * The completion ring to send the completion event on. This should
17529 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17530 	 */
17531 	uint16_t	cmpl_ring;
17532 	/*
17533 	 * The sequence ID is used by the driver for tracking multiple
17534 	 * commands. This ID is treated as opaque data by the firmware and
17535 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17536 	 */
17537 	uint16_t	seq_id;
17538 	/*
17539 	 * The target ID of the command:
17540 	 * * 0x0-0xFFF8 - The function ID
17541 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17542 	 * * 0xFFFD - Reserved for user-space HWRM interface
17543 	 * * 0xFFFF - HWRM
17544 	 */
17545 	uint16_t	target_id;
17546 	/*
17547 	 * A physical address pointer pointing to a host buffer that the
17548 	 * command's response data will be written. This can be either a host
17549 	 * physical address (HPA) or a guest physical address (GPA) and must
17550 	 * point to a physically contiguous block of memory.
17551 	 */
17552 	uint64_t	resp_addr;
17553 } hwrm_func_backing_store_qcaps_input_t, *phwrm_func_backing_store_qcaps_input_t;
17554 
17555 /* hwrm_func_backing_store_qcaps_output (size:832b/104B) */
17556 
17557 typedef struct hwrm_func_backing_store_qcaps_output {
17558 	/* The specific error status for the command. */
17559 	uint16_t	error_code;
17560 	/* The HWRM command request type. */
17561 	uint16_t	req_type;
17562 	/* The sequence ID from the original command. */
17563 	uint16_t	seq_id;
17564 	/* The length of the response data in number of bytes. */
17565 	uint16_t	resp_len;
17566 	/* Maximum number of QP context entries supported for this function. */
17567 	uint32_t	qp_max_entries;
17568 	/*
17569 	 * Minimum number of QP context entries that are needed to be reserved
17570 	 * for QP1 for the PF and its VFs. PF drivers must allocate at least
17571 	 * this many QP context entries, even if RoCE will not be used.
17572 	 */
17573 	uint16_t	qp_min_qp1_entries;
17574 	/*
17575 	 * Maximum number of QP context entries that can be used for L2 and
17576 	 * mid-path.
17577 	 */
17578 	uint16_t	qp_max_l2_entries;
17579 	/* Number of bytes that must be allocated for each context entry. */
17580 	uint16_t	qp_entry_size;
17581 	/* Maximum number of SRQ context entries that can be used for L2. */
17582 	uint16_t	srq_max_l2_entries;
17583 	/* Maximum number of SRQ context entries supported for this function. */
17584 	uint32_t	srq_max_entries;
17585 	/* Number of bytes that must be allocated for each context entry. */
17586 	uint16_t	srq_entry_size;
17587 	/* Maximum number of CQ context entries that can be used for L2. */
17588 	uint16_t	cq_max_l2_entries;
17589 	/* Maximum number of CQ context entries supported for this function. */
17590 	uint32_t	cq_max_entries;
17591 	/* Number of bytes that must be allocated for each context entry. */
17592 	uint16_t	cq_entry_size;
17593 	/* Maximum number of VNIC context entries supported for this function. */
17594 	uint16_t	vnic_max_vnic_entries;
17595 	/* Maximum number of Ring table context entries supported for this function. */
17596 	uint16_t	vnic_max_ring_table_entries;
17597 	/* Number of bytes that must be allocated for each context entry. */
17598 	uint16_t	vnic_entry_size;
17599 	/* Maximum number of statistic context entries supported for this function. */
17600 	uint32_t	stat_max_entries;
17601 	/* Number of bytes that must be allocated for each context entry. */
17602 	uint16_t	stat_entry_size;
17603 	/* Number of bytes that must be allocated for each context entry. */
17604 	uint16_t	tqm_entry_size;
17605 	/* Minimum number of TQM context entries required per ring. */
17606 	uint32_t	tqm_min_entries_per_ring;
17607 	/*
17608 	 * Maximum number of TQM context entries supported per ring. This is
17609 	 * actually a recommended TQM queue size based on worst case usage of
17610 	 * the TQM queue.
17611 	 *
17612 	 * TQM fastpath rings should be sized large enough to accommodate the
17613 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
17614 	 * that can be enqueued to the TQM ring.
17615 	 *
17616 	 * TQM slowpath rings should be sized as follows:
17617 	 *
17618 	 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
17619 	 *
17620 	 * Where:
17621 	 *   num_vnics is the number of VNICs allocated in the VNIC backing store
17622 	 *   num_l2_tx_rings is the number of L2 rings in the QP backing store
17623 	 *   num_roce_qps is the number of RoCE QPs in the QP backing store
17624 	 *   tqm_min_size is tqm_min_entries_per_ring reported by
17625 	 *	HWRM_FUNC_BACKING_STORE_QCAPS
17626 	 *
17627 	 * Note that TQM ring sizes cannot be extended while the system is
17628 	 * operational. If a PF driver needs to extend a TQM ring, it needs
17629 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
17630 	 * the backing store.
17631 	 */
17632 	uint32_t	tqm_max_entries_per_ring;
17633 	/*
17634 	 * Maximum number of MR plus AV context entries supported for this
17635 	 * function.
17636 	 */
17637 	uint32_t	mrav_max_entries;
17638 	/* Number of bytes that must be allocated for each context entry. */
17639 	uint16_t	mrav_entry_size;
17640 	/* Number of bytes that must be allocated for each context entry. */
17641 	uint16_t	tim_entry_size;
17642 	/* Maximum number of Timer context entries supported for this function. */
17643 	uint32_t	tim_max_entries;
17644 	/*
17645 	 * When this field is zero, the 32b `mrav_num_entries` field in the
17646 	 * `backing_store_cfg` and `backing_store_qcfg` commands represents
17647 	 * the total number of MR plus AV entries allowed in the MR/AV backing
17648 	 * store PBL.
17649 	 *
17650 	 * When this field is non-zero, the 32b `mrav_num_entries` field in
17651 	 * the `backing_store_cfg` and `backing_store_qcfg` commands is
17652 	 * logically divided into two 16b fields. Bits `[31:16]` represents
17653 	 * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
17654 	 * Both of these values are represented in a unit granularity
17655 	 * specified by this field. For example, if this field is 16 and
17656 	 * `mrav_num_entries` is `0x02000100`, then the number of MR entries
17657 	 * is 8192 and the number of AV entries is 4096.
17658 	 */
17659 	uint16_t	mrav_num_entries_units;
17660 	/*
17661 	 * The number of entries specified for any TQM ring must be a
17662 	 * multiple of this value to prevent any resource allocation
17663 	 * limitations.
17664 	 */
17665 	uint8_t	tqm_entries_multiple;
17666 	/*
17667 	 * Initializer to be used by drivers
17668 	 * to initialize context memory to ensure
17669 	 * context subsystem flags an error for an attack
17670 	 * before the first time context load.
17671 	 */
17672 	uint8_t	ctx_kind_initializer;
17673 	/*
17674 	 * Specifies which context kinds need to be initialized with the
17675 	 * ctx_kind_initializer.
17676 	 */
17677 	uint16_t	ctx_init_mask;
17678 	/*
17679 	 * If this bit is '1' then this context type should be initialized
17680 	 * with the ctx_kind_initializer at the specified offset.
17681 	 */
17682 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_QP	UINT32_C(0x1)
17683 	/*
17684 	 * If this bit is '1' then this context type should be initialized
17685 	 * with the ctx_kind_initializer at the specified offset.
17686 	 */
17687 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_SRQ	UINT32_C(0x2)
17688 	/*
17689 	 * If this bit is '1' then this context type should be initialized
17690 	 * with the ctx_kind_initializer at the specified offset.
17691 	 */
17692 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_CQ	UINT32_C(0x4)
17693 	/*
17694 	 * If this bit is '1' then this context type should be initialized
17695 	 * with the ctx_kind_initializer at the specified offset.
17696 	 */
17697 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_VNIC	UINT32_C(0x8)
17698 	/*
17699 	 * If this bit is '1' then this context type should be initialized
17700 	 * with the ctx_kind_initializer at the specified offset.
17701 	 */
17702 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_STAT	UINT32_C(0x10)
17703 	/*
17704 	 * If this bit is '1' then this context type should be initialized
17705 	 * with the ctx_kind_initializer at the specified offset.
17706 	 */
17707 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_MRAV	UINT32_C(0x20)
17708 	/*
17709 	 * If this bit is '1' then the Tx KTLS context type should be
17710 	 * initialized with the ctx_kind_initializer at the specified offset.
17711 	 */
17712 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_TKC	UINT32_C(0x40)
17713 	/*
17714 	 * If this bit is '1' then the Rx KTLS context type should be
17715 	 * initialized with the ctx_kind_initializer at the specified offset.
17716 	 */
17717 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_RKC	UINT32_C(0x80)
17718 	/*
17719 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17720 	 * context type.
17721 	 */
17722 	uint8_t	qp_init_offset;
17723 	/*
17724 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17725 	 * context type.
17726 	 */
17727 	uint8_t	srq_init_offset;
17728 	/*
17729 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17730 	 * context type.
17731 	 */
17732 	uint8_t	cq_init_offset;
17733 	/*
17734 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17735 	 * context type.
17736 	 */
17737 	uint8_t	vnic_init_offset;
17738 	/*
17739 	 * Count of TQM fastpath rings to be used for allocating backing store.
17740 	 * Backing store configuration must be specified for each TQM ring from
17741 	 * this count in `backing_store_cfg`.
17742 	 * Only first 8 TQM FP rings will be advertised with this field.
17743 	 */
17744 	uint8_t	tqm_fp_rings_count;
17745 	/*
17746 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17747 	 * context type.
17748 	 */
17749 	uint8_t	stat_init_offset;
17750 	/*
17751 	 * Specifies the doubleword offset of ctx_kind_initializer for this
17752 	 * context type.
17753 	 */
17754 	uint8_t	mrav_init_offset;
17755 	/*
17756 	 * Count of TQM extended fastpath rings to be used for allocating
17757 	 * backing store beyond 8 rings(rings 9,10,11)
17758 	 * Backing store configuration must be specified for each TQM ring from
17759 	 * this count in `backing_store_cfg`.
17760 	 */
17761 	uint8_t	tqm_fp_rings_count_ext;
17762 	/*
17763 	 * Specifies the doubleword offset of ctx_kind_initializer for Tx
17764 	 * KTLS context type.
17765 	 */
17766 	uint8_t	tkc_init_offset;
17767 	/*
17768 	 * Specifies the doubleword offset of ctx_kind_initializer for Rx
17769 	 * KTLS context type.
17770 	 */
17771 	uint8_t	rkc_init_offset;
17772 	/* Tx KTLS context entry size in bytes. */
17773 	uint16_t	tkc_entry_size;
17774 	/* Rx KTLS context entry size in bytes. */
17775 	uint16_t	rkc_entry_size;
17776 	/*
17777 	 * Maximum number of Tx KTLS context entries supported for this
17778 	 * function.
17779 	 */
17780 	uint32_t	tkc_max_entries;
17781 	/*
17782 	 * Maximum number of Rx KTLS context entries supported for this
17783 	 * function.
17784 	 */
17785 	uint32_t	rkc_max_entries;
17786 	/* Reserved for future. */
17787 	uint8_t	rsvd1[7];
17788 	/*
17789 	 * This field is used in Output records to indicate that the output
17790 	 * is completely written to RAM.  This field should be read as '1'
17791 	 * to indicate that the output has been completely written.
17792 	 * When writing a command completion or response to an internal processor,
17793 	 * the order of writes has to be such that this field is written last.
17794 	 */
17795 	uint8_t	valid;
17796 } hwrm_func_backing_store_qcaps_output_t, *phwrm_func_backing_store_qcaps_output_t;
17797 
17798 /* tqm_fp_ring_cfg (size:128b/16B) */
17799 
17800 typedef struct tqm_fp_ring_cfg {
17801 	/* TQM ring page size and level. */
17802 	uint8_t	tqm_ring_pg_size_tqm_ring_lvl;
17803 	/* TQM ring PBL indirect levels. */
17804 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_MASK	UINT32_C(0xf)
17805 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_SFT	0
17806 	/* PBL pointer is physical start address. */
17807 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
17808 	/* PBL pointer points to PTE table. */
17809 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
17810 	/*
17811 	 * PBL pointer points to PDE table with each entry pointing to
17812 	 * PTE tables.
17813 	 */
17814 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
17815 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LAST	TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2
17816 	/* TQM ring page size. */
17817 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
17818 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_SFT   4
17819 	/* 4KB. */
17820 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
17821 	/* 8KB. */
17822 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
17823 	/* 64KB. */
17824 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
17825 	/* 2MB. */
17826 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
17827 	/* 8MB. */
17828 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
17829 	/* 1GB. */
17830 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
17831 		#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
17832 	uint8_t	unused[3];
17833 	/* Number of TQM ring entries. */
17834 	uint32_t	tqm_ring_num_entries;
17835 	/* TQM ring page directory. */
17836 	uint64_t	tqm_ring_page_dir;
17837 } tqm_fp_ring_cfg_t, *ptqm_fp_ring_cfg_t;
17838 
17839 /*******************************
17840  * hwrm_func_backing_store_cfg *
17841  *******************************/
17842 
17843 
17844 /* hwrm_func_backing_store_cfg_input (size:2688b/336B) */
17845 
17846 typedef struct hwrm_func_backing_store_cfg_input {
17847 	/* The HWRM command request type. */
17848 	uint16_t	req_type;
17849 	/*
17850 	 * The completion ring to send the completion event on. This should
17851 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17852 	 */
17853 	uint16_t	cmpl_ring;
17854 	/*
17855 	 * The sequence ID is used by the driver for tracking multiple
17856 	 * commands. This ID is treated as opaque data by the firmware and
17857 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17858 	 */
17859 	uint16_t	seq_id;
17860 	/*
17861 	 * The target ID of the command:
17862 	 * * 0x0-0xFFF8 - The function ID
17863 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17864 	 * * 0xFFFD - Reserved for user-space HWRM interface
17865 	 * * 0xFFFF - HWRM
17866 	 */
17867 	uint16_t	target_id;
17868 	/*
17869 	 * A physical address pointer pointing to a host buffer that the
17870 	 * command's response data will be written. This can be either a host
17871 	 * physical address (HPA) or a guest physical address (GPA) and must
17872 	 * point to a physically contiguous block of memory.
17873 	 */
17874 	uint64_t	resp_addr;
17875 	uint32_t	flags;
17876 	/*
17877 	 * When set, the firmware only uses on-chip resources and does not
17878 	 * expect any backing store to be provided by the host driver. This
17879 	 * mode provides minimal L2 functionality (e.g. limited L2 resources,
17880 	 * no RoCE).
17881 	 */
17882 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE		UINT32_C(0x1)
17883 	/*
17884 	 * When set, the 32b `mrav_num_entries` field is logically divided
17885 	 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
17886 	 */
17887 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x2)
17888 	uint32_t	enables;
17889 	/*
17890 	 * This bit must be '1' for the qp fields to be
17891 	 * configured.
17892 	 */
17893 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP		UINT32_C(0x1)
17894 	/*
17895 	 * This bit must be '1' for the srq fields to be
17896 	 * configured.
17897 	 */
17898 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ		UINT32_C(0x2)
17899 	/*
17900 	 * This bit must be '1' for the cq fields to be
17901 	 * configured.
17902 	 */
17903 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ		UINT32_C(0x4)
17904 	/*
17905 	 * This bit must be '1' for the vnic fields to be
17906 	 * configured.
17907 	 */
17908 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC	UINT32_C(0x8)
17909 	/*
17910 	 * This bit must be '1' for the stat fields to be
17911 	 * configured.
17912 	 */
17913 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT	UINT32_C(0x10)
17914 	/*
17915 	 * This bit must be '1' for the tqm_sp fields to be
17916 	 * configured.
17917 	 */
17918 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP	UINT32_C(0x20)
17919 	/*
17920 	 * This bit must be '1' for the tqm_ring0 fields to be
17921 	 * configured.
17922 	 */
17923 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0	UINT32_C(0x40)
17924 	/*
17925 	 * This bit must be '1' for the tqm_ring1 fields to be
17926 	 * configured.
17927 	 */
17928 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1	UINT32_C(0x80)
17929 	/*
17930 	 * This bit must be '1' for the tqm_ring2 fields to be
17931 	 * configured.
17932 	 */
17933 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2	UINT32_C(0x100)
17934 	/*
17935 	 * This bit must be '1' for the tqm_ring3 fields to be
17936 	 * configured.
17937 	 */
17938 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3	UINT32_C(0x200)
17939 	/*
17940 	 * This bit must be '1' for the tqm_ring4 fields to be
17941 	 * configured.
17942 	 */
17943 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4	UINT32_C(0x400)
17944 	/*
17945 	 * This bit must be '1' for the tqm_ring5 fields to be
17946 	 * configured.
17947 	 */
17948 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5	UINT32_C(0x800)
17949 	/*
17950 	 * This bit must be '1' for the tqm_ring6 fields to be
17951 	 * configured.
17952 	 */
17953 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6	UINT32_C(0x1000)
17954 	/*
17955 	 * This bit must be '1' for the tqm_ring7 fields to be
17956 	 * configured.
17957 	 */
17958 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7	UINT32_C(0x2000)
17959 	/*
17960 	 * This bit must be '1' for the mrav fields to be
17961 	 * configured.
17962 	 */
17963 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV	UINT32_C(0x4000)
17964 	/*
17965 	 * This bit must be '1' for the tim fields to be
17966 	 * configured.
17967 	 */
17968 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM		UINT32_C(0x8000)
17969 	/*
17970 	 * This bit must be '1' for the tqm_ring8 fields to be
17971 	 * configured.
17972 	 */
17973 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING8	UINT32_C(0x10000)
17974 	/*
17975 	 * This bit must be '1' for the tqm_ring9 fields to be
17976 	 * configured.
17977 	 */
17978 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING9	UINT32_C(0x20000)
17979 	/*
17980 	 * This bit must be '1' for the tqm_ring10 fields to be
17981 	 * configured.
17982 	 */
17983 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING10	UINT32_C(0x40000)
17984 	/*
17985 	 * This bit must be '1' for the Tx KTLS context
17986 	 * fields to be configured.
17987 	 */
17988 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TKC		UINT32_C(0x80000)
17989 	/*
17990 	 * This bit must be '1' for the Rx KTLS context
17991 	 * fields to be configured.
17992 	 */
17993 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_RKC		UINT32_C(0x100000)
17994 	/* QPC page size and level. */
17995 	uint8_t	qpc_pg_size_qpc_lvl;
17996 	/* QPC PBL indirect levels. */
17997 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK	UINT32_C(0xf)
17998 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT	0
17999 	/* PBL pointer is physical start address. */
18000 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0	UINT32_C(0x0)
18001 	/* PBL pointer points to PTE table. */
18002 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1	UINT32_C(0x1)
18003 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18004 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2	UINT32_C(0x2)
18005 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
18006 	/* QPC page size. */
18007 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
18008 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
18009 	/* 4KB. */
18010 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18011 	/* 8KB. */
18012 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18013 	/* 64KB. */
18014 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18015 	/* 2MB. */
18016 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18017 	/* 8MB. */
18018 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18019 	/* 1GB. */
18020 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18021 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
18022 	/* SRQ page size and level. */
18023 	uint8_t	srq_pg_size_srq_lvl;
18024 	/* SRQ PBL indirect levels. */
18025 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK	UINT32_C(0xf)
18026 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT	0
18027 	/* PBL pointer is physical start address. */
18028 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0	UINT32_C(0x0)
18029 	/* PBL pointer points to PTE table. */
18030 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1	UINT32_C(0x1)
18031 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18032 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2	UINT32_C(0x2)
18033 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
18034 	/* SRQ page size. */
18035 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
18036 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
18037 	/* 4KB. */
18038 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18039 	/* 8KB. */
18040 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18041 	/* 64KB. */
18042 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18043 	/* 2MB. */
18044 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18045 	/* 8MB. */
18046 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18047 	/* 1GB. */
18048 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18049 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
18050 	/* CQ page size and level. */
18051 	uint8_t	cq_pg_size_cq_lvl;
18052 	/* CQ PBL indirect levels. */
18053 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK	UINT32_C(0xf)
18054 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT	0
18055 	/* PBL pointer is physical start address. */
18056 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0	UINT32_C(0x0)
18057 	/* PBL pointer points to PTE table. */
18058 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1	UINT32_C(0x1)
18059 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18060 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2	UINT32_C(0x2)
18061 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
18062 	/* CQ page size. */
18063 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
18064 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
18065 	/* 4KB. */
18066 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18067 	/* 8KB. */
18068 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18069 	/* 64KB. */
18070 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18071 	/* 2MB. */
18072 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18073 	/* 8MB. */
18074 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18075 	/* 1GB. */
18076 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18077 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
18078 	/* VNIC page size and level. */
18079 	uint8_t	vnic_pg_size_vnic_lvl;
18080 	/* VNIC PBL indirect levels. */
18081 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK	UINT32_C(0xf)
18082 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT	0
18083 	/* PBL pointer is physical start address. */
18084 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0	UINT32_C(0x0)
18085 	/* PBL pointer points to PTE table. */
18086 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1	UINT32_C(0x1)
18087 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18088 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2	UINT32_C(0x2)
18089 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
18090 	/* VNIC page size. */
18091 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK  UINT32_C(0xf0)
18092 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
18093 	/* 4KB. */
18094 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18095 	/* 8KB. */
18096 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18097 	/* 64KB. */
18098 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18099 	/* 2MB. */
18100 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18101 	/* 8MB. */
18102 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18103 	/* 1GB. */
18104 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18105 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
18106 	/* Stat page size and level. */
18107 	uint8_t	stat_pg_size_stat_lvl;
18108 	/* Stat PBL indirect levels. */
18109 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK	UINT32_C(0xf)
18110 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT	0
18111 	/* PBL pointer is physical start address. */
18112 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0	UINT32_C(0x0)
18113 	/* PBL pointer points to PTE table. */
18114 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1	UINT32_C(0x1)
18115 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18116 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2	UINT32_C(0x2)
18117 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
18118 	/* Stat page size. */
18119 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK  UINT32_C(0xf0)
18120 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
18121 	/* 4KB. */
18122 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18123 	/* 8KB. */
18124 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18125 	/* 64KB. */
18126 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18127 	/* 2MB. */
18128 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18129 	/* 8MB. */
18130 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18131 	/* 1GB. */
18132 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18133 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
18134 	/* TQM slow path page size and level. */
18135 	uint8_t	tqm_sp_pg_size_tqm_sp_lvl;
18136 	/* TQM slow path PBL indirect levels. */
18137 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK	UINT32_C(0xf)
18138 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT	0
18139 	/* PBL pointer is physical start address. */
18140 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0	UINT32_C(0x0)
18141 	/* PBL pointer points to PTE table. */
18142 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1	UINT32_C(0x1)
18143 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18144 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2	UINT32_C(0x2)
18145 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
18146 	/* TQM slow path page size. */
18147 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK  UINT32_C(0xf0)
18148 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
18149 	/* 4KB. */
18150 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18151 	/* 8KB. */
18152 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18153 	/* 64KB. */
18154 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18155 	/* 2MB. */
18156 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18157 	/* 8MB. */
18158 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18159 	/* 1GB. */
18160 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18161 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
18162 	/* TQM ring 0 page size and level. */
18163 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
18164 	/* TQM ring 0 PBL indirect levels. */
18165 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
18166 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT	0
18167 	/* PBL pointer is physical start address. */
18168 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
18169 	/* PBL pointer points to PTE table. */
18170 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
18171 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18172 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
18173 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
18174 	/* TQM ring 0 page size. */
18175 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
18176 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
18177 	/* 4KB. */
18178 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18179 	/* 8KB. */
18180 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18181 	/* 64KB. */
18182 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18183 	/* 2MB. */
18184 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18185 	/* 8MB. */
18186 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18187 	/* 1GB. */
18188 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18189 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
18190 	/* TQM ring 1 page size and level. */
18191 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
18192 	/* TQM ring 1 PBL indirect levels. */
18193 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
18194 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT	0
18195 	/* PBL pointer is physical start address. */
18196 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
18197 	/* PBL pointer points to PTE table. */
18198 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
18199 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18200 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
18201 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
18202 	/* TQM ring 1 page size. */
18203 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
18204 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
18205 	/* 4KB. */
18206 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18207 	/* 8KB. */
18208 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18209 	/* 64KB. */
18210 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18211 	/* 2MB. */
18212 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18213 	/* 8MB. */
18214 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18215 	/* 1GB. */
18216 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18217 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
18218 	/* TQM ring 2 page size and level. */
18219 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
18220 	/* TQM ring 2 PBL indirect levels. */
18221 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
18222 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT	0
18223 	/* PBL pointer is physical start address. */
18224 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
18225 	/* PBL pointer points to PTE table. */
18226 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
18227 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18228 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
18229 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
18230 	/* TQM ring 2 page size. */
18231 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
18232 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
18233 	/* 4KB. */
18234 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18235 	/* 8KB. */
18236 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18237 	/* 64KB. */
18238 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18239 	/* 2MB. */
18240 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18241 	/* 8MB. */
18242 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18243 	/* 1GB. */
18244 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18245 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
18246 	/* TQM ring 3 page size and level. */
18247 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
18248 	/* TQM ring 3 PBL indirect levels. */
18249 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
18250 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT	0
18251 	/* PBL pointer is physical start address. */
18252 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
18253 	/* PBL pointer points to PTE table. */
18254 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
18255 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18256 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
18257 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
18258 	/* TQM ring 3 page size. */
18259 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
18260 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
18261 	/* 4KB. */
18262 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18263 	/* 8KB. */
18264 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18265 	/* 64KB. */
18266 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18267 	/* 2MB. */
18268 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18269 	/* 8MB. */
18270 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18271 	/* 1GB. */
18272 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18273 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
18274 	/* TQM ring 4 page size and level. */
18275 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
18276 	/* TQM ring 4 PBL indirect levels. */
18277 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
18278 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT	0
18279 	/* PBL pointer is physical start address. */
18280 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
18281 	/* PBL pointer points to PTE table. */
18282 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
18283 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18284 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
18285 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
18286 	/* TQM ring 4 page size. */
18287 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
18288 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
18289 	/* 4KB. */
18290 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18291 	/* 8KB. */
18292 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18293 	/* 64KB. */
18294 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18295 	/* 2MB. */
18296 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18297 	/* 8MB. */
18298 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18299 	/* 1GB. */
18300 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18301 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
18302 	/* TQM ring 5 page size and level. */
18303 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
18304 	/* TQM ring 5 PBL indirect levels. */
18305 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
18306 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT	0
18307 	/* PBL pointer is physical start address. */
18308 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
18309 	/* PBL pointer points to PTE table. */
18310 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
18311 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18312 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
18313 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
18314 	/* TQM ring 5 page size. */
18315 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
18316 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
18317 	/* 4KB. */
18318 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18319 	/* 8KB. */
18320 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18321 	/* 64KB. */
18322 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18323 	/* 2MB. */
18324 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18325 	/* 8MB. */
18326 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18327 	/* 1GB. */
18328 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18329 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
18330 	/* TQM ring 6 page size and level. */
18331 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
18332 	/* TQM ring 6 PBL indirect levels. */
18333 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
18334 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT	0
18335 	/* PBL pointer is physical start address. */
18336 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
18337 	/* PBL pointer points to PTE table. */
18338 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
18339 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18340 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
18341 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
18342 	/* TQM ring 6 page size. */
18343 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
18344 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
18345 	/* 4KB. */
18346 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18347 	/* 8KB. */
18348 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18349 	/* 64KB. */
18350 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18351 	/* 2MB. */
18352 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18353 	/* 8MB. */
18354 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18355 	/* 1GB. */
18356 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18357 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
18358 	/* TQM ring 7 page size and level. */
18359 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
18360 	/* TQM ring 7 PBL indirect levels. */
18361 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
18362 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT	0
18363 	/* PBL pointer is physical start address. */
18364 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
18365 	/* PBL pointer points to PTE table. */
18366 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
18367 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18368 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
18369 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
18370 	/* TQM ring 7 page size. */
18371 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
18372 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
18373 	/* 4KB. */
18374 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18375 	/* 8KB. */
18376 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18377 	/* 64KB. */
18378 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18379 	/* 2MB. */
18380 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18381 	/* 8MB. */
18382 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18383 	/* 1GB. */
18384 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18385 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
18386 	/* MR/AV page size and level. */
18387 	uint8_t	mrav_pg_size_mrav_lvl;
18388 	/* MR/AV PBL indirect levels. */
18389 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK	UINT32_C(0xf)
18390 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT	0
18391 	/* PBL pointer is physical start address. */
18392 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0	UINT32_C(0x0)
18393 	/* PBL pointer points to PTE table. */
18394 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1	UINT32_C(0x1)
18395 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18396 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2	UINT32_C(0x2)
18397 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
18398 	/* MR/AV page size. */
18399 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK  UINT32_C(0xf0)
18400 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
18401 	/* 4KB. */
18402 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18403 	/* 8KB. */
18404 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18405 	/* 64KB. */
18406 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18407 	/* 2MB. */
18408 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18409 	/* 8MB. */
18410 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18411 	/* 1GB. */
18412 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18413 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
18414 	/* Timer page size and level. */
18415 	uint8_t	tim_pg_size_tim_lvl;
18416 	/* Timer PBL indirect levels. */
18417 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK	UINT32_C(0xf)
18418 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT	0
18419 	/* PBL pointer is physical start address. */
18420 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0	UINT32_C(0x0)
18421 	/* PBL pointer points to PTE table. */
18422 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1	UINT32_C(0x1)
18423 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18424 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2	UINT32_C(0x2)
18425 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
18426 	/* Timer page size. */
18427 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
18428 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
18429 	/* 4KB. */
18430 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18431 	/* 8KB. */
18432 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18433 	/* 64KB. */
18434 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18435 	/* 2MB. */
18436 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18437 	/* 8MB. */
18438 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18439 	/* 1GB. */
18440 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18441 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
18442 	/* QP page directory. */
18443 	uint64_t	qpc_page_dir;
18444 	/* SRQ page directory. */
18445 	uint64_t	srq_page_dir;
18446 	/* CQ page directory. */
18447 	uint64_t	cq_page_dir;
18448 	/* VNIC page directory. */
18449 	uint64_t	vnic_page_dir;
18450 	/* Stat page directory. */
18451 	uint64_t	stat_page_dir;
18452 	/* TQM slowpath page directory. */
18453 	uint64_t	tqm_sp_page_dir;
18454 	/* TQM ring 0 page directory. */
18455 	uint64_t	tqm_ring0_page_dir;
18456 	/* TQM ring 1 page directory. */
18457 	uint64_t	tqm_ring1_page_dir;
18458 	/* TQM ring 2 page directory. */
18459 	uint64_t	tqm_ring2_page_dir;
18460 	/* TQM ring 3 page directory. */
18461 	uint64_t	tqm_ring3_page_dir;
18462 	/* TQM ring 4 page directory. */
18463 	uint64_t	tqm_ring4_page_dir;
18464 	/* TQM ring 5 page directory. */
18465 	uint64_t	tqm_ring5_page_dir;
18466 	/* TQM ring 6 page directory. */
18467 	uint64_t	tqm_ring6_page_dir;
18468 	/* TQM ring 7 page directory. */
18469 	uint64_t	tqm_ring7_page_dir;
18470 	/* MR/AV page directory. */
18471 	uint64_t	mrav_page_dir;
18472 	/* Timer page directory. */
18473 	uint64_t	tim_page_dir;
18474 	/* Number of QPs. */
18475 	uint32_t	qp_num_entries;
18476 	/* Number of SRQs. */
18477 	uint32_t	srq_num_entries;
18478 	/* Number of CQs. */
18479 	uint32_t	cq_num_entries;
18480 	/* Number of Stats. */
18481 	uint32_t	stat_num_entries;
18482 	/*
18483 	 * Number of TQM slowpath entries.
18484 	 *
18485 	 * TQM slowpath rings should be sized as follows:
18486 	 *
18487 	 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
18488 	 *
18489 	 * Where:
18490 	 *   num_vnics is the number of VNICs allocated in the VNIC backing store
18491 	 *   num_l2_tx_rings is the number of L2 rings in the QP backing store
18492 	 *   num_roce_qps is the number of RoCE QPs in the QP backing store
18493 	 *   tqm_min_size is tqm_min_entries_per_ring reported by
18494 	 *	HWRM_FUNC_BACKING_STORE_QCAPS
18495 	 *
18496 	 * Note that TQM ring sizes cannot be extended while the system is
18497 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18498 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18499 	 * the backing store.
18500 	 */
18501 	uint32_t	tqm_sp_num_entries;
18502 	/*
18503 	 * Number of TQM ring 0 entries.
18504 	 *
18505 	 * TQM fastpath rings should be sized large enough to accommodate the
18506 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18507 	 * that can be enqueued to the TQM ring.
18508 	 *
18509 	 * Note that TQM ring sizes cannot be extended while the system is
18510 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18511 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18512 	 * the backing store.
18513 	 */
18514 	uint32_t	tqm_ring0_num_entries;
18515 	/*
18516 	 * Number of TQM ring 1 entries.
18517 	 *
18518 	 * TQM fastpath rings should be sized large enough to accommodate the
18519 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18520 	 * that can be enqueued to the TQM ring.
18521 	 *
18522 	 * Note that TQM ring sizes cannot be extended while the system is
18523 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18524 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18525 	 * the backing store.
18526 	 */
18527 	uint32_t	tqm_ring1_num_entries;
18528 	/*
18529 	 * Number of TQM ring 2 entries.
18530 	 *
18531 	 * TQM fastpath rings should be sized large enough to accommodate the
18532 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18533 	 * that can be enqueued to the TQM ring.
18534 	 *
18535 	 * Note that TQM ring sizes cannot be extended while the system is
18536 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18537 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18538 	 * the backing store.
18539 	 */
18540 	uint32_t	tqm_ring2_num_entries;
18541 	/*
18542 	 * Number of TQM ring 3 entries.
18543 	 *
18544 	 * TQM fastpath rings should be sized large enough to accommodate the
18545 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18546 	 * that can be enqueued to the TQM ring.
18547 	 *
18548 	 * Note that TQM ring sizes cannot be extended while the system is
18549 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18550 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18551 	 * the backing store.
18552 	 */
18553 	uint32_t	tqm_ring3_num_entries;
18554 	/*
18555 	 * Number of TQM ring 4 entries.
18556 	 *
18557 	 * TQM fastpath rings should be sized large enough to accommodate the
18558 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18559 	 * that can be enqueued to the TQM ring.
18560 	 *
18561 	 * Note that TQM ring sizes cannot be extended while the system is
18562 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18563 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18564 	 * the backing store.
18565 	 */
18566 	uint32_t	tqm_ring4_num_entries;
18567 	/*
18568 	 * Number of TQM ring 5 entries.
18569 	 *
18570 	 * TQM fastpath rings should be sized large enough to accommodate the
18571 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18572 	 * that can be enqueued to the TQM ring.
18573 	 *
18574 	 * Note that TQM ring sizes cannot be extended while the system is
18575 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18576 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18577 	 * the backing store.
18578 	 */
18579 	uint32_t	tqm_ring5_num_entries;
18580 	/*
18581 	 * Number of TQM ring 6 entries.
18582 	 *
18583 	 * TQM fastpath rings should be sized large enough to accommodate the
18584 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18585 	 * that can be enqueued to the TQM ring.
18586 	 *
18587 	 * Note that TQM ring sizes cannot be extended while the system is
18588 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18589 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18590 	 * the backing store.
18591 	 */
18592 	uint32_t	tqm_ring6_num_entries;
18593 	/*
18594 	 * Number of TQM ring 7 entries.
18595 	 *
18596 	 * TQM fastpath rings should be sized large enough to accommodate the
18597 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18598 	 * that can be enqueued to the TQM ring.
18599 	 *
18600 	 * Note that TQM ring sizes cannot be extended while the system is
18601 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18602 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18603 	 * the backing store.
18604 	 */
18605 	uint32_t	tqm_ring7_num_entries;
18606 	/*
18607 	 * If the MR/AV split reservation flag is not set, then this field
18608 	 * represents the total number of MR plus AV entries. For versions
18609 	 * of firmware that support the split reservation, when it is not
18610 	 * specified half of the entries will be reserved for MRs and the
18611 	 * other half for AVs.
18612 	 *
18613 	 * If the MR/AV split reservation flag is set, then this
18614 	 * field is logically divided into two 16b fields. Bits `[31:16]`
18615 	 * represents the `mr_num_entries` and bits `[15:0]` represents
18616 	 * `av_num_entries`. The granularity of these values is defined by
18617 	 * the `mrav_num_entries_unit` field returned by the
18618 	 * `backing_store_qcaps` command.
18619 	 */
18620 	uint32_t	mrav_num_entries;
18621 	/* Number of Timer entries. */
18622 	uint32_t	tim_num_entries;
18623 	/* Number of entries to reserve for QP1 */
18624 	uint16_t	qp_num_qp1_entries;
18625 	/* Number of entries to reserve for L2 */
18626 	uint16_t	qp_num_l2_entries;
18627 	/* Number of bytes that have been allocated for each context entry. */
18628 	uint16_t	qp_entry_size;
18629 	/* Number of entries to reserve for L2 */
18630 	uint16_t	srq_num_l2_entries;
18631 	/* Number of bytes that have been allocated for each context entry. */
18632 	uint16_t	srq_entry_size;
18633 	/* Number of entries to reserve for L2 */
18634 	uint16_t	cq_num_l2_entries;
18635 	/* Number of bytes that have been allocated for each context entry. */
18636 	uint16_t	cq_entry_size;
18637 	/* Number of entries to reserve for VNIC entries */
18638 	uint16_t	vnic_num_vnic_entries;
18639 	/* Number of entries to reserve for Ring table entries */
18640 	uint16_t	vnic_num_ring_table_entries;
18641 	/* Number of bytes that have been allocated for each context entry. */
18642 	uint16_t	vnic_entry_size;
18643 	/* Number of bytes that have been allocated for each context entry. */
18644 	uint16_t	stat_entry_size;
18645 	/* Number of bytes that have been allocated for each context entry. */
18646 	uint16_t	tqm_entry_size;
18647 	/* Number of bytes that have been allocated for each context entry. */
18648 	uint16_t	mrav_entry_size;
18649 	/* Number of bytes that have been allocated for each context entry. */
18650 	uint16_t	tim_entry_size;
18651 	/* TQM ring page size and level. */
18652 	uint8_t	tqm_ring8_pg_size_tqm_ring_lvl;
18653 	/* TQM ring PBL indirect levels. */
18654 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_MASK	UINT32_C(0xf)
18655 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_SFT	0
18656 	/* PBL pointer is physical start address. */
18657 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
18658 	/* PBL pointer points to PTE table. */
18659 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
18660 	/*
18661 	 * PBL pointer points to PDE table with each entry pointing to
18662 	 * PTE tables.
18663 	 */
18664 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
18665 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2
18666 	/* TQM ring page size. */
18667 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
18668 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_SFT   4
18669 	/* 4KB. */
18670 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18671 	/* 8KB. */
18672 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18673 	/* 64KB. */
18674 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18675 	/* 2MB. */
18676 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18677 	/* 8MB. */
18678 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18679 	/* 1GB. */
18680 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18681 		#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
18682 	uint8_t	ring8_unused[3];
18683 	/* Number of TQM ring entries. */
18684 	uint32_t	tqm_ring8_num_entries;
18685 	/* TQM ring page directory. */
18686 	uint64_t	tqm_ring8_page_dir;
18687 	/* TQM ring page size and level. */
18688 	uint8_t	tqm_ring9_pg_size_tqm_ring_lvl;
18689 	/* TQM ring PBL indirect levels. */
18690 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_MASK	UINT32_C(0xf)
18691 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_SFT	0
18692 	/* PBL pointer is physical start address. */
18693 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
18694 	/* PBL pointer points to PTE table. */
18695 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
18696 	/*
18697 	 * PBL pointer points to PDE table with each entry pointing to
18698 	 * PTE tables.
18699 	 */
18700 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
18701 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2
18702 	/* TQM ring page size. */
18703 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
18704 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_SFT   4
18705 	/* 4KB. */
18706 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18707 	/* 8KB. */
18708 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18709 	/* 64KB. */
18710 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18711 	/* 2MB. */
18712 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18713 	/* 8MB. */
18714 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18715 	/* 1GB. */
18716 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18717 		#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
18718 	uint8_t	ring9_unused[3];
18719 	/* Number of TQM ring entries. */
18720 	uint32_t	tqm_ring9_num_entries;
18721 	/* TQM ring page directory. */
18722 	uint64_t	tqm_ring9_page_dir;
18723 	/* TQM ring page size and level. */
18724 	uint8_t	tqm_ring10_pg_size_tqm_ring_lvl;
18725 	/* TQM ring PBL indirect levels. */
18726 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_MASK	UINT32_C(0xf)
18727 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_SFT	0
18728 	/* PBL pointer is physical start address. */
18729 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
18730 	/* PBL pointer points to PTE table. */
18731 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
18732 	/*
18733 	 * PBL pointer points to PDE table with each entry pointing to
18734 	 * PTE tables.
18735 	 */
18736 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
18737 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2
18738 	/* TQM ring page size. */
18739 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
18740 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_SFT   4
18741 	/* 4KB. */
18742 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18743 	/* 8KB. */
18744 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18745 	/* 64KB. */
18746 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18747 	/* 2MB. */
18748 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18749 	/* 8MB. */
18750 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18751 	/* 1GB. */
18752 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18753 		#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
18754 	uint8_t	ring10_unused[3];
18755 	/* Number of TQM ring entries. */
18756 	uint32_t	tqm_ring10_num_entries;
18757 	/* TQM ring page directory. */
18758 	uint64_t	tqm_ring10_page_dir;
18759 	/* Number of Tx KTLS context entries allocated. */
18760 	uint32_t	tkc_num_entries;
18761 	/* Number of Rx KTLS context entries allocated. */
18762 	uint32_t	rkc_num_entries;
18763 	/* Tx KTLS context page directory. */
18764 	uint64_t	tkc_page_dir;
18765 	/* Rx KTLS context page directory. */
18766 	uint64_t	rkc_page_dir;
18767 	/* Number of bytes allocated for each Tx KTLS context entry. */
18768 	uint16_t	tkc_entry_size;
18769 	/* Number of bytes allocated for each Rx KTLS context entry. */
18770 	uint16_t	rkc_entry_size;
18771 	/* Tx KTLS context page size and level. */
18772 	uint8_t	tkc_pg_size_tkc_lvl;
18773 	/* Tx KTLS context PBL indirect levels. */
18774 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_MASK	UINT32_C(0xf)
18775 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_SFT	0
18776 	/* PBL pointer is physical start address. */
18777 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_0	UINT32_C(0x0)
18778 	/* PBL pointer points to PTE table. */
18779 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_1	UINT32_C(0x1)
18780 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18781 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2	UINT32_C(0x2)
18782 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2
18783 	/* Tx KTLS context page size. */
18784 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_MASK  UINT32_C(0xf0)
18785 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_SFT   4
18786 	/* 4KB. */
18787 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18788 	/* 8KB. */
18789 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18790 	/* 64KB. */
18791 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18792 	/* 2MB. */
18793 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18794 	/* 8MB. */
18795 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18796 	/* 1GB. */
18797 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18798 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G
18799 	/* Rx KTLS context page size and level. */
18800 	uint8_t	rkc_pg_size_rkc_lvl;
18801 	/* Rx KTLS context PBL indirect levels. */
18802 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_MASK	UINT32_C(0xf)
18803 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_SFT	0
18804 	/* PBL pointer is physical start address. */
18805 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_0	UINT32_C(0x0)
18806 	/* PBL pointer points to PTE table. */
18807 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_1	UINT32_C(0x1)
18808 	/*
18809 	 * PBL pointer points to PDE table with each entry pointing to
18810 	 * PTE tables.
18811 	 */
18812 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2	UINT32_C(0x2)
18813 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2
18814 	/* Rx KTLS context page size. */
18815 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_MASK  UINT32_C(0xf0)
18816 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_SFT   4
18817 	/* 4KB. */
18818 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
18819 	/* 8KB. */
18820 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
18821 	/* 64KB. */
18822 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
18823 	/* 2MB. */
18824 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
18825 	/* 8MB. */
18826 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
18827 	/* 1GB. */
18828 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
18829 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G
18830 	/* Reserved for future. */
18831 	uint8_t	rsvd[2];
18832 } hwrm_func_backing_store_cfg_input_t, *phwrm_func_backing_store_cfg_input_t;
18833 
18834 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
18835 
18836 typedef struct hwrm_func_backing_store_cfg_output {
18837 	/* The specific error status for the command. */
18838 	uint16_t	error_code;
18839 	/* The HWRM command request type. */
18840 	uint16_t	req_type;
18841 	/* The sequence ID from the original command. */
18842 	uint16_t	seq_id;
18843 	/* The length of the response data in number of bytes. */
18844 	uint16_t	resp_len;
18845 	uint8_t	unused_0[7];
18846 	/*
18847 	 * This field is used in Output records to indicate that the output
18848 	 * is completely written to RAM.  This field should be read as '1'
18849 	 * to indicate that the output has been completely written.
18850 	 * When writing a command completion or response to an internal processor,
18851 	 * the order of writes has to be such that this field is written last.
18852 	 */
18853 	uint8_t	valid;
18854 } hwrm_func_backing_store_cfg_output_t, *phwrm_func_backing_store_cfg_output_t;
18855 
18856 /********************************
18857  * hwrm_func_backing_store_qcfg *
18858  ********************************/
18859 
18860 
18861 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
18862 
18863 typedef struct hwrm_func_backing_store_qcfg_input {
18864 	/* The HWRM command request type. */
18865 	uint16_t	req_type;
18866 	/*
18867 	 * The completion ring to send the completion event on. This should
18868 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18869 	 */
18870 	uint16_t	cmpl_ring;
18871 	/*
18872 	 * The sequence ID is used by the driver for tracking multiple
18873 	 * commands. This ID is treated as opaque data by the firmware and
18874 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18875 	 */
18876 	uint16_t	seq_id;
18877 	/*
18878 	 * The target ID of the command:
18879 	 * * 0x0-0xFFF8 - The function ID
18880 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18881 	 * * 0xFFFD - Reserved for user-space HWRM interface
18882 	 * * 0xFFFF - HWRM
18883 	 */
18884 	uint16_t	target_id;
18885 	/*
18886 	 * A physical address pointer pointing to a host buffer that the
18887 	 * command's response data will be written. This can be either a host
18888 	 * physical address (HPA) or a guest physical address (GPA) and must
18889 	 * point to a physically contiguous block of memory.
18890 	 */
18891 	uint64_t	resp_addr;
18892 } hwrm_func_backing_store_qcfg_input_t, *phwrm_func_backing_store_qcfg_input_t;
18893 
18894 /* hwrm_func_backing_store_qcfg_output (size:2496b/312B) */
18895 
18896 typedef struct hwrm_func_backing_store_qcfg_output {
18897 	/* The specific error status for the command. */
18898 	uint16_t	error_code;
18899 	/* The HWRM command request type. */
18900 	uint16_t	req_type;
18901 	/* The sequence ID from the original command. */
18902 	uint16_t	seq_id;
18903 	/* The length of the response data in number of bytes. */
18904 	uint16_t	resp_len;
18905 	uint32_t	flags;
18906 	/*
18907 	 * When set, the firmware only uses on-chip resources and does not
18908 	 * expect any backing store to be provided by the host driver. This
18909 	 * mode provides minimal L2 functionality (e.g. limited L2 resources,
18910 	 * no RoCE).
18911 	 */
18912 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE		UINT32_C(0x1)
18913 	/*
18914 	 * When set, the 32b `mrav_num_entries` field is logically divided
18915 	 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
18916 	 */
18917 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x2)
18918 	uint32_t	enables;
18919 	/*
18920 	 * This bit must be '1' for the qp fields to be
18921 	 * configured.
18922 	 */
18923 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP		UINT32_C(0x1)
18924 	/*
18925 	 * This bit must be '1' for the srq fields to be
18926 	 * configured.
18927 	 */
18928 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_SRQ		UINT32_C(0x2)
18929 	/*
18930 	 * This bit must be '1' for the cq fields to be
18931 	 * configured.
18932 	 */
18933 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_CQ		UINT32_C(0x4)
18934 	/*
18935 	 * This bit must be '1' for the vnic fields to be
18936 	 * configured.
18937 	 */
18938 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_VNIC	UINT32_C(0x8)
18939 	/*
18940 	 * This bit must be '1' for the stat fields to be
18941 	 * configured.
18942 	 */
18943 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_STAT	UINT32_C(0x10)
18944 	/*
18945 	 * This bit must be '1' for the tqm_sp fields to be
18946 	 * configured.
18947 	 */
18948 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_SP	UINT32_C(0x20)
18949 	/*
18950 	 * This bit must be '1' for the tqm_ring0 fields to be
18951 	 * configured.
18952 	 */
18953 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING0	UINT32_C(0x40)
18954 	/*
18955 	 * This bit must be '1' for the tqm_ring1 fields to be
18956 	 * configured.
18957 	 */
18958 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING1	UINT32_C(0x80)
18959 	/*
18960 	 * This bit must be '1' for the tqm_ring2 fields to be
18961 	 * configured.
18962 	 */
18963 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING2	UINT32_C(0x100)
18964 	/*
18965 	 * This bit must be '1' for the tqm_ring3 fields to be
18966 	 * configured.
18967 	 */
18968 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING3	UINT32_C(0x200)
18969 	/*
18970 	 * This bit must be '1' for the tqm_ring4 fields to be
18971 	 * configured.
18972 	 */
18973 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING4	UINT32_C(0x400)
18974 	/*
18975 	 * This bit must be '1' for the tqm_ring5 fields to be
18976 	 * configured.
18977 	 */
18978 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING5	UINT32_C(0x800)
18979 	/*
18980 	 * This bit must be '1' for the tqm_ring6 fields to be
18981 	 * configured.
18982 	 */
18983 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING6	UINT32_C(0x1000)
18984 	/*
18985 	 * This bit must be '1' for the tqm_ring7 fields to be
18986 	 * configured.
18987 	 */
18988 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING7	UINT32_C(0x2000)
18989 	/*
18990 	 * This bit must be '1' for the mrav fields to be
18991 	 * configured.
18992 	 */
18993 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_MRAV	UINT32_C(0x4000)
18994 	/*
18995 	 * This bit must be '1' for the tim fields to be
18996 	 * configured.
18997 	 */
18998 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TIM		UINT32_C(0x8000)
18999 	/*
19000 	 * This bit must be '1' for the tqm_ring8 fields to be
19001 	 * configured.
19002 	 */
19003 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING8	UINT32_C(0x10000)
19004 	/*
19005 	 * This bit must be '1' for the tqm_ring9 fields to be
19006 	 * configured.
19007 	 */
19008 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING9	UINT32_C(0x20000)
19009 	/*
19010 	 * This bit must be '1' for the tqm_ring10 fields to be
19011 	 * configured.
19012 	 */
19013 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING10	UINT32_C(0x40000)
19014 	/*
19015 	 * This bit must be '1' for the Tx KTLS context
19016 	 * fields to be configured.
19017 	 */
19018 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TKC		UINT32_C(0x80000)
19019 	/*
19020 	 * This bit must be '1' for the Rx KTLS context
19021 	 * fields to be configured.
19022 	 */
19023 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_RKC		UINT32_C(0x100000)
19024 	/* QPC page size and level. */
19025 	uint8_t	qpc_pg_size_qpc_lvl;
19026 	/* QPC PBL indirect levels. */
19027 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK	UINT32_C(0xf)
19028 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT	0
19029 	/* PBL pointer is physical start address. */
19030 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0	UINT32_C(0x0)
19031 	/* PBL pointer points to PTE table. */
19032 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1	UINT32_C(0x1)
19033 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19034 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2	UINT32_C(0x2)
19035 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
19036 	/* QPC page size. */
19037 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
19038 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
19039 	/* 4KB. */
19040 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19041 	/* 8KB. */
19042 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19043 	/* 64KB. */
19044 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19045 	/* 2MB. */
19046 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19047 	/* 8MB. */
19048 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19049 	/* 1GB. */
19050 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19051 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
19052 	/* SRQ page size and level. */
19053 	uint8_t	srq_pg_size_srq_lvl;
19054 	/* SRQ PBL indirect levels. */
19055 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK	UINT32_C(0xf)
19056 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT	0
19057 	/* PBL pointer is physical start address. */
19058 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0	UINT32_C(0x0)
19059 	/* PBL pointer points to PTE table. */
19060 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1	UINT32_C(0x1)
19061 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19062 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2	UINT32_C(0x2)
19063 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
19064 	/* SRQ page size. */
19065 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
19066 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
19067 	/* 4KB. */
19068 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19069 	/* 8KB. */
19070 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19071 	/* 64KB. */
19072 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19073 	/* 2MB. */
19074 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19075 	/* 8MB. */
19076 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19077 	/* 1GB. */
19078 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19079 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
19080 	/* CQ page size and level. */
19081 	uint8_t	cq_pg_size_cq_lvl;
19082 	/* CQ PBL indirect levels. */
19083 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK	UINT32_C(0xf)
19084 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT	0
19085 	/* PBL pointer is physical start address. */
19086 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0	UINT32_C(0x0)
19087 	/* PBL pointer points to PTE table. */
19088 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1	UINT32_C(0x1)
19089 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19090 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2	UINT32_C(0x2)
19091 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
19092 	/* CQ page size. */
19093 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
19094 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
19095 	/* 4KB. */
19096 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19097 	/* 8KB. */
19098 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19099 	/* 64KB. */
19100 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19101 	/* 2MB. */
19102 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19103 	/* 8MB. */
19104 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19105 	/* 1GB. */
19106 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19107 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
19108 	/* VNIC page size and level. */
19109 	uint8_t	vnic_pg_size_vnic_lvl;
19110 	/* VNIC PBL indirect levels. */
19111 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK	UINT32_C(0xf)
19112 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT	0
19113 	/* PBL pointer is physical start address. */
19114 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0	UINT32_C(0x0)
19115 	/* PBL pointer points to PTE table. */
19116 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1	UINT32_C(0x1)
19117 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19118 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2	UINT32_C(0x2)
19119 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
19120 	/* VNIC page size. */
19121 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK  UINT32_C(0xf0)
19122 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
19123 	/* 4KB. */
19124 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19125 	/* 8KB. */
19126 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19127 	/* 64KB. */
19128 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19129 	/* 2MB. */
19130 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19131 	/* 8MB. */
19132 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19133 	/* 1GB. */
19134 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19135 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
19136 	/* Stat page size and level. */
19137 	uint8_t	stat_pg_size_stat_lvl;
19138 	/* Stat PBL indirect levels. */
19139 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK	UINT32_C(0xf)
19140 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT	0
19141 	/* PBL pointer is physical start address. */
19142 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0	UINT32_C(0x0)
19143 	/* PBL pointer points to PTE table. */
19144 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1	UINT32_C(0x1)
19145 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19146 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2	UINT32_C(0x2)
19147 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
19148 	/* Stat page size. */
19149 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK  UINT32_C(0xf0)
19150 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
19151 	/* 4KB. */
19152 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19153 	/* 8KB. */
19154 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19155 	/* 64KB. */
19156 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19157 	/* 2MB. */
19158 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19159 	/* 8MB. */
19160 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19161 	/* 1GB. */
19162 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19163 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
19164 	/* TQM slow path page size and level. */
19165 	uint8_t	tqm_sp_pg_size_tqm_sp_lvl;
19166 	/* TQM slow path PBL indirect levels. */
19167 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK	UINT32_C(0xf)
19168 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT	0
19169 	/* PBL pointer is physical start address. */
19170 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0	UINT32_C(0x0)
19171 	/* PBL pointer points to PTE table. */
19172 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1	UINT32_C(0x1)
19173 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19174 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2	UINT32_C(0x2)
19175 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
19176 	/* TQM slow path page size. */
19177 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK  UINT32_C(0xf0)
19178 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
19179 	/* 4KB. */
19180 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19181 	/* 8KB. */
19182 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19183 	/* 64KB. */
19184 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19185 	/* 2MB. */
19186 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19187 	/* 8MB. */
19188 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19189 	/* 1GB. */
19190 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19191 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
19192 	/* TQM ring 0 page size and level. */
19193 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
19194 	/* TQM ring 0 PBL indirect levels. */
19195 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
19196 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT	0
19197 	/* PBL pointer is physical start address. */
19198 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
19199 	/* PBL pointer points to PTE table. */
19200 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
19201 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19202 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
19203 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
19204 	/* TQM ring 0 page size. */
19205 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
19206 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
19207 	/* 4KB. */
19208 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19209 	/* 8KB. */
19210 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19211 	/* 64KB. */
19212 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19213 	/* 2MB. */
19214 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19215 	/* 8MB. */
19216 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19217 	/* 1GB. */
19218 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19219 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
19220 	/* TQM ring 1 page size and level. */
19221 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
19222 	/* TQM ring 1 PBL indirect levels. */
19223 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
19224 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT	0
19225 	/* PBL pointer is physical start address. */
19226 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
19227 	/* PBL pointer points to PTE table. */
19228 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
19229 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19230 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
19231 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
19232 	/* TQM ring 1 page size. */
19233 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
19234 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
19235 	/* 4KB. */
19236 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19237 	/* 8KB. */
19238 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19239 	/* 64KB. */
19240 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19241 	/* 2MB. */
19242 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19243 	/* 8MB. */
19244 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19245 	/* 1GB. */
19246 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19247 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
19248 	/* TQM ring 2 page size and level. */
19249 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
19250 	/* TQM ring 2 PBL indirect levels. */
19251 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
19252 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT	0
19253 	/* PBL pointer is physical start address. */
19254 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
19255 	/* PBL pointer points to PTE table. */
19256 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
19257 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19258 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
19259 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
19260 	/* TQM ring 2 page size. */
19261 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
19262 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
19263 	/* 4KB. */
19264 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19265 	/* 8KB. */
19266 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19267 	/* 64KB. */
19268 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19269 	/* 2MB. */
19270 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19271 	/* 8MB. */
19272 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19273 	/* 1GB. */
19274 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19275 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
19276 	/* TQM ring 3 page size and level. */
19277 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
19278 	/* TQM ring 3 PBL indirect levels. */
19279 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
19280 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT	0
19281 	/* PBL pointer is physical start address. */
19282 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
19283 	/* PBL pointer points to PTE table. */
19284 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
19285 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19286 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
19287 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
19288 	/* TQM ring 3 page size. */
19289 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
19290 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
19291 	/* 4KB. */
19292 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19293 	/* 8KB. */
19294 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19295 	/* 64KB. */
19296 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19297 	/* 2MB. */
19298 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19299 	/* 8MB. */
19300 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19301 	/* 1GB. */
19302 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19303 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
19304 	/* TQM ring 4 page size and level. */
19305 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
19306 	/* TQM ring 4 PBL indirect levels. */
19307 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
19308 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT	0
19309 	/* PBL pointer is physical start address. */
19310 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
19311 	/* PBL pointer points to PTE table. */
19312 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
19313 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19314 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
19315 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
19316 	/* TQM ring 4 page size. */
19317 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
19318 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
19319 	/* 4KB. */
19320 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19321 	/* 8KB. */
19322 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19323 	/* 64KB. */
19324 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19325 	/* 2MB. */
19326 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19327 	/* 8MB. */
19328 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19329 	/* 1GB. */
19330 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19331 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
19332 	/* TQM ring 5 page size and level. */
19333 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
19334 	/* TQM ring 5 PBL indirect levels. */
19335 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
19336 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT	0
19337 	/* PBL pointer is physical start address. */
19338 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
19339 	/* PBL pointer points to PTE table. */
19340 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
19341 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19342 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
19343 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
19344 	/* TQM ring 5 page size. */
19345 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
19346 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
19347 	/* 4KB. */
19348 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19349 	/* 8KB. */
19350 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19351 	/* 64KB. */
19352 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19353 	/* 2MB. */
19354 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19355 	/* 8MB. */
19356 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19357 	/* 1GB. */
19358 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19359 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
19360 	/* TQM ring 6 page size and level. */
19361 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
19362 	/* TQM ring 6 PBL indirect levels. */
19363 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
19364 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT	0
19365 	/* PBL pointer is physical start address. */
19366 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
19367 	/* PBL pointer points to PTE table. */
19368 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
19369 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19370 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
19371 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
19372 	/* TQM ring 6 page size. */
19373 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
19374 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
19375 	/* 4KB. */
19376 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19377 	/* 8KB. */
19378 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19379 	/* 64KB. */
19380 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19381 	/* 2MB. */
19382 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19383 	/* 8MB. */
19384 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19385 	/* 1GB. */
19386 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19387 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
19388 	/* TQM ring 7 page size and level. */
19389 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
19390 	/* TQM ring 7 PBL indirect levels. */
19391 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
19392 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT	0
19393 	/* PBL pointer is physical start address. */
19394 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
19395 	/* PBL pointer points to PTE table. */
19396 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
19397 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19398 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
19399 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
19400 	/* TQM ring 7 page size. */
19401 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
19402 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
19403 	/* 4KB. */
19404 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19405 	/* 8KB. */
19406 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19407 	/* 64KB. */
19408 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19409 	/* 2MB. */
19410 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19411 	/* 8MB. */
19412 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19413 	/* 1GB. */
19414 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19415 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
19416 	/* MR/AV page size and level. */
19417 	uint8_t	mrav_pg_size_mrav_lvl;
19418 	/* MR/AV PBL indirect levels. */
19419 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK	UINT32_C(0xf)
19420 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT	0
19421 	/* PBL pointer is physical start address. */
19422 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0	UINT32_C(0x0)
19423 	/* PBL pointer points to PTE table. */
19424 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1	UINT32_C(0x1)
19425 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19426 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2	UINT32_C(0x2)
19427 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
19428 	/* MR/AV page size. */
19429 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK  UINT32_C(0xf0)
19430 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
19431 	/* 4KB. */
19432 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19433 	/* 8KB. */
19434 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19435 	/* 64KB. */
19436 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19437 	/* 2MB. */
19438 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19439 	/* 8MB. */
19440 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19441 	/* 1GB. */
19442 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19443 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
19444 	/* Timer page size and level. */
19445 	uint8_t	tim_pg_size_tim_lvl;
19446 	/* Timer PBL indirect levels. */
19447 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK	UINT32_C(0xf)
19448 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT	0
19449 	/* PBL pointer is physical start address. */
19450 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0	UINT32_C(0x0)
19451 	/* PBL pointer points to PTE table. */
19452 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1	UINT32_C(0x1)
19453 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19454 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2	UINT32_C(0x2)
19455 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
19456 	/* Timer page size. */
19457 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
19458 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
19459 	/* 4KB. */
19460 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19461 	/* 8KB. */
19462 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19463 	/* 64KB. */
19464 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19465 	/* 2MB. */
19466 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19467 	/* 8MB. */
19468 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19469 	/* 1GB. */
19470 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19471 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
19472 	/* QP page directory. */
19473 	uint64_t	qpc_page_dir;
19474 	/* SRQ page directory. */
19475 	uint64_t	srq_page_dir;
19476 	/* CQ page directory. */
19477 	uint64_t	cq_page_dir;
19478 	/* VNIC page directory. */
19479 	uint64_t	vnic_page_dir;
19480 	/* Stat page directory. */
19481 	uint64_t	stat_page_dir;
19482 	/* TQM slowpath page directory. */
19483 	uint64_t	tqm_sp_page_dir;
19484 	/* TQM ring 0 page directory. */
19485 	uint64_t	tqm_ring0_page_dir;
19486 	/* TQM ring 1 page directory. */
19487 	uint64_t	tqm_ring1_page_dir;
19488 	/* TQM ring 2 page directory. */
19489 	uint64_t	tqm_ring2_page_dir;
19490 	/* TQM ring 3 page directory. */
19491 	uint64_t	tqm_ring3_page_dir;
19492 	/* TQM ring 4 page directory. */
19493 	uint64_t	tqm_ring4_page_dir;
19494 	/* TQM ring 5 page directory. */
19495 	uint64_t	tqm_ring5_page_dir;
19496 	/* TQM ring 6 page directory. */
19497 	uint64_t	tqm_ring6_page_dir;
19498 	/* TQM ring 7 page directory. */
19499 	uint64_t	tqm_ring7_page_dir;
19500 	/* MR/AV page directory. */
19501 	uint64_t	mrav_page_dir;
19502 	/* Timer page directory. */
19503 	uint64_t	tim_page_dir;
19504 	/* Number of entries to reserve for QP1 */
19505 	uint16_t	qp_num_qp1_entries;
19506 	/* Number of entries to reserve for L2 */
19507 	uint16_t	qp_num_l2_entries;
19508 	/* Number of QPs. */
19509 	uint32_t	qp_num_entries;
19510 	/* Number of SRQs. */
19511 	uint32_t	srq_num_entries;
19512 	/* Number of entries to reserve for L2 */
19513 	uint16_t	srq_num_l2_entries;
19514 	/* Number of entries to reserve for L2 */
19515 	uint16_t	cq_num_l2_entries;
19516 	/* Number of CQs. */
19517 	uint32_t	cq_num_entries;
19518 	/* Number of entries to reserve for VNIC entries */
19519 	uint16_t	vnic_num_vnic_entries;
19520 	/* Number of entries to reserve for Ring table entries */
19521 	uint16_t	vnic_num_ring_table_entries;
19522 	/* Number of Stats. */
19523 	uint32_t	stat_num_entries;
19524 	/* Number of TQM slowpath entries. */
19525 	uint32_t	tqm_sp_num_entries;
19526 	/* Number of TQM ring 0 entries. */
19527 	uint32_t	tqm_ring0_num_entries;
19528 	/* Number of TQM ring 1 entries. */
19529 	uint32_t	tqm_ring1_num_entries;
19530 	/* Number of TQM ring 2 entries. */
19531 	uint32_t	tqm_ring2_num_entries;
19532 	/* Number of TQM ring 3 entries. */
19533 	uint32_t	tqm_ring3_num_entries;
19534 	/* Number of TQM ring 4 entries. */
19535 	uint32_t	tqm_ring4_num_entries;
19536 	/* Number of TQM ring 5 entries. */
19537 	uint32_t	tqm_ring5_num_entries;
19538 	/* Number of TQM ring 6 entries. */
19539 	uint32_t	tqm_ring6_num_entries;
19540 	/* Number of TQM ring 7 entries. */
19541 	uint32_t	tqm_ring7_num_entries;
19542 	/*
19543 	 * If the MR/AV split reservation flag is not set, then this field
19544 	 * represents the total number of MR plus AV entries. For versions
19545 	 * of firmware that support the split reservation, when it is not
19546 	 * specified half of the entries will be reserved for MRs and the
19547 	 * other half for AVs.
19548 	 *
19549 	 * If the MR/AV split reservation flag is set, then this
19550 	 * field is logically divided into two 16b fields. Bits `[31:16]`
19551 	 * represents the `mr_num_entries` and bits `[15:0]` represents
19552 	 * `av_num_entries`. The granularity of these values is defined by
19553 	 * the `mrav_num_entries_unit` field returned by the
19554 	 * `backing_store_qcaps` command.
19555 	 */
19556 	uint32_t	mrav_num_entries;
19557 	/* Number of Timer entries. */
19558 	uint32_t	tim_num_entries;
19559 	/* TQM ring page size and level. */
19560 	uint8_t	tqm_ring8_pg_size_tqm_ring_lvl;
19561 	/* TQM ring PBL indirect levels. */
19562 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_MASK	UINT32_C(0xf)
19563 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_SFT	0
19564 	/* PBL pointer is physical start address. */
19565 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
19566 	/* PBL pointer points to PTE table. */
19567 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
19568 	/*
19569 	 * PBL pointer points to PDE table with each entry pointing to
19570 	 * PTE tables.
19571 	 */
19572 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
19573 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2
19574 	/* TQM ring page size. */
19575 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
19576 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_SFT   4
19577 	/* 4KB. */
19578 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19579 	/* 8KB. */
19580 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19581 	/* 64KB. */
19582 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19583 	/* 2MB. */
19584 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19585 	/* 8MB. */
19586 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19587 	/* 1GB. */
19588 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19589 		#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
19590 	uint8_t	ring8_unused[3];
19591 	/* Number of TQM ring entries. */
19592 	uint32_t	tqm_ring8_num_entries;
19593 	/* TQM ring page directory. */
19594 	uint64_t	tqm_ring8_page_dir;
19595 	/* TQM ring page size and level. */
19596 	uint8_t	tqm_ring9_pg_size_tqm_ring_lvl;
19597 	/* TQM ring PBL indirect levels. */
19598 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_MASK	UINT32_C(0xf)
19599 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_SFT	0
19600 	/* PBL pointer is physical start address. */
19601 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
19602 	/* PBL pointer points to PTE table. */
19603 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
19604 	/*
19605 	 * PBL pointer points to PDE table with each entry pointing to
19606 	 * PTE tables.
19607 	 */
19608 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
19609 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2
19610 	/* TQM ring page size. */
19611 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
19612 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_SFT   4
19613 	/* 4KB. */
19614 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19615 	/* 8KB. */
19616 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19617 	/* 64KB. */
19618 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19619 	/* 2MB. */
19620 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19621 	/* 8MB. */
19622 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19623 	/* 1GB. */
19624 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19625 		#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
19626 	uint8_t	ring9_unused[3];
19627 	/* Number of TQM ring entries. */
19628 	uint32_t	tqm_ring9_num_entries;
19629 	/* TQM ring page directory. */
19630 	uint64_t	tqm_ring9_page_dir;
19631 	/* TQM ring page size and level. */
19632 	uint8_t	tqm_ring10_pg_size_tqm_ring_lvl;
19633 	/* TQM ring PBL indirect levels. */
19634 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_MASK	UINT32_C(0xf)
19635 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_SFT	0
19636 	/* PBL pointer is physical start address. */
19637 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
19638 	/* PBL pointer points to PTE table. */
19639 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
19640 	/*
19641 	 * PBL pointer points to PDE table with each entry pointing to
19642 	 * PTE tables.
19643 	 */
19644 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
19645 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2
19646 	/* TQM ring page size. */
19647 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
19648 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_SFT   4
19649 	/* 4KB. */
19650 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19651 	/* 8KB. */
19652 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19653 	/* 64KB. */
19654 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19655 	/* 2MB. */
19656 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19657 	/* 8MB. */
19658 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19659 	/* 1GB. */
19660 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19661 		#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
19662 	uint8_t	ring10_unused[3];
19663 	/* Number of TQM ring entries. */
19664 	uint32_t	tqm_ring10_num_entries;
19665 	/* TQM ring page directory. */
19666 	uint64_t	tqm_ring10_page_dir;
19667 	/* Number of Tx KTLS context entries. */
19668 	uint32_t	tkc_num_entries;
19669 	/* Number of Rx KTLS context entries. */
19670 	uint32_t	rkc_num_entries;
19671 	/* Tx KTLS context page directory. */
19672 	uint64_t	tkc_page_dir;
19673 	/* Rx KTLS context page directory. */
19674 	uint64_t	rkc_page_dir;
19675 	/* Tx KTLS context page size and level. */
19676 	uint8_t	tkc_pg_size_tkc_lvl;
19677 	/* Tx KTLS context PBL indirect levels. */
19678 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_MASK	UINT32_C(0xf)
19679 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_SFT	0
19680 	/* PBL pointer is physical start address. */
19681 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_0	UINT32_C(0x0)
19682 	/* PBL pointer points to PTE table. */
19683 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_1	UINT32_C(0x1)
19684 	/*
19685 	 * PBL pointer points to PDE table with each entry pointing to
19686 	 * PTE tables.
19687 	 */
19688 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2	UINT32_C(0x2)
19689 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2
19690 	/* Tx KTLS context page size. */
19691 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_MASK  UINT32_C(0xf0)
19692 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_SFT   4
19693 	/* 4KB. */
19694 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19695 	/* 8KB. */
19696 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19697 	/* 64KB. */
19698 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19699 	/* 2MB. */
19700 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19701 	/* 8MB. */
19702 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19703 	/* 1GB. */
19704 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19705 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G
19706 	/* Rx KTLS context page size and level. */
19707 	uint8_t	rkc_pg_size_rkc_lvl;
19708 	/* Rx KTLS context PBL indirect levels. */
19709 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_MASK	UINT32_C(0xf)
19710 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_SFT	0
19711 	/* PBL pointer is physical start address. */
19712 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_0	UINT32_C(0x0)
19713 	/* PBL pointer points to PTE table. */
19714 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_1	UINT32_C(0x1)
19715 	/*
19716 	 * PBL pointer points to PDE table with each entry pointing to
19717 	 * PTE tables.
19718 	 */
19719 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2	UINT32_C(0x2)
19720 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2
19721 	/* Rx KTLS context page size. */
19722 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_MASK  UINT32_C(0xf0)
19723 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_SFT   4
19724 	/* 4KB. */
19725 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19726 	/* 8KB. */
19727 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19728 	/* 64KB. */
19729 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19730 	/* 2MB. */
19731 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19732 	/* 8MB. */
19733 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19734 	/* 1GB. */
19735 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19736 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G
19737 	uint8_t	unused_1[5];
19738 	/*
19739 	 * This field is used in Output records to indicate that the output
19740 	 * is completely written to RAM.  This field should be read as 1
19741 	 * to indicate that the output has been completely written.
19742 	 * When writing a command completion or response to an internal
19743 	 * processor, the order of writes has to be such that this field
19744 	 * is written last.
19745 	 */
19746 	uint8_t	valid;
19747 } hwrm_func_backing_store_qcfg_output_t, *phwrm_func_backing_store_qcfg_output_t;
19748 
19749 /****************************
19750  * hwrm_error_recovery_qcfg *
19751  ****************************/
19752 
19753 
19754 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
19755 
19756 typedef struct hwrm_error_recovery_qcfg_input {
19757 	/* The HWRM command request type. */
19758 	uint16_t	req_type;
19759 	/*
19760 	 * The completion ring to send the completion event on. This should
19761 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
19762 	 */
19763 	uint16_t	cmpl_ring;
19764 	/*
19765 	 * The sequence ID is used by the driver for tracking multiple
19766 	 * commands. This ID is treated as opaque data by the firmware and
19767 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
19768 	 */
19769 	uint16_t	seq_id;
19770 	/*
19771 	 * The target ID of the command:
19772 	 * * 0x0-0xFFF8 - The function ID
19773 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19774 	 * * 0xFFFD - Reserved for user-space HWRM interface
19775 	 * * 0xFFFF - HWRM
19776 	 */
19777 	uint16_t	target_id;
19778 	/*
19779 	 * A physical address pointer pointing to a host buffer that the
19780 	 * command's response data will be written. This can be either a host
19781 	 * physical address (HPA) or a guest physical address (GPA) and must
19782 	 * point to a physically contiguous block of memory.
19783 	 */
19784 	uint64_t	resp_addr;
19785 	uint8_t	unused_0[8];
19786 } hwrm_error_recovery_qcfg_input_t, *phwrm_error_recovery_qcfg_input_t;
19787 
19788 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
19789 
19790 typedef struct hwrm_error_recovery_qcfg_output {
19791 	/* The specific error status for the command. */
19792 	uint16_t	error_code;
19793 	/* The HWRM command request type. */
19794 	uint16_t	req_type;
19795 	/* The sequence ID from the original command. */
19796 	uint16_t	seq_id;
19797 	/* The length of the response data in number of bytes. */
19798 	uint16_t	resp_len;
19799 	uint32_t	flags;
19800 	/*
19801 	 * When this flag is set to 1, error recovery will be initiated
19802 	 * through master function driver.
19803 	 */
19804 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST	UINT32_C(0x1)
19805 	/*
19806 	 * When this flag is set to 1, error recovery will be performed
19807 	 * through Co processor.
19808 	 */
19809 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU	UINT32_C(0x2)
19810 	/*
19811 	 * Driver Polling frequency. This value is in units of 100msec.
19812 	 * Typical value would be 10 to indicate 1sec.
19813 	 * Drivers can poll FW health status, Heartbeat, reset_counter with
19814 	 * this frequency.
19815 	 */
19816 	uint32_t	driver_polling_freq;
19817 	/*
19818 	 * This value is in units of 100msec.
19819 	 * Typical value would be 30 to indicate 3sec.
19820 	 * Master function wait period from detecting a fatal error to
19821 	 * initiating reset. In this time period Master PF expects every
19822 	 * active driver will detect fatal error.
19823 	 */
19824 	uint32_t	master_func_wait_period;
19825 	/*
19826 	 * This value is in units of 100msec.
19827 	 * Typical value would be 50 to indicate 5sec.
19828 	 * Normal function wait period from fatal error detection to
19829 	 * polling FW health status. In this time period, drivers should not
19830 	 * do any PCIe MMIO transaction and should not send any HWRM commands.
19831 	 */
19832 	uint32_t	normal_func_wait_period;
19833 	/*
19834 	 * This value is in units of 100msec.
19835 	 * Typical value would be 20 to indicate 2sec.
19836 	 * This field indicates that, master function wait period after chip
19837 	 * reset. After this time, master function should reinitialize with
19838 	 * FW.
19839 	 */
19840 	uint32_t	master_func_wait_period_after_reset;
19841 	/*
19842 	 * This value is in units of 100msec.
19843 	 * Typical value would be 60 to indicate 6sec.
19844 	 * This field is applicable to both master and normal functions.
19845 	 * Even after chip reset, if FW status not changed to ready,
19846 	 * then all the functions can poll for this much time and bailout.
19847 	 */
19848 	uint32_t	max_bailout_time_after_reset;
19849 	/*
19850 	 * FW health status register.
19851 	 * Lower 2 bits indicates address space location and upper 30 bits
19852 	 * indicates upper 30bits of the register address.
19853 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
19854 	 */
19855 	uint32_t	fw_health_status_reg;
19856 	/* Lower 2 bits indicates address space location. */
19857 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
19858 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT	0
19859 	/*
19860 	 * If value is 0, this register is located in PCIe config space.
19861 	 * Drivers have to map appropriate window to access this
19862 	 * register.
19863 	 */
19864 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
19865 	/*
19866 	 * If value is 1, this register is located in GRC address space.
19867 	 * Drivers have to map appropriate window to access this
19868 	 * register.
19869 	 */
19870 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
19871 	/*
19872 	 * If value is 2, this register is located in first BAR address
19873 	 * space. Drivers have to map appropriate window to access this
19874 	 * register.
19875 	 */
19876 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
19877 	/*
19878 	 * If value is 3, this register is located in second BAR address
19879 	 * space. Drivers have to map appropriate window to access this
19880 	 * Drivers have to map appropriate window to access this
19881 	 * register.
19882 	 */
19883 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
19884 		#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
19885 	/* Upper 30bits of the register address. */
19886 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK	UINT32_C(0xfffffffc)
19887 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT	2
19888 	/*
19889 	 * FW HeartBeat register.
19890 	 * Lower 2 bits indicates address space location and upper 30 bits
19891 	 * indicates actual address.
19892 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
19893 	 */
19894 	uint32_t	fw_heartbeat_reg;
19895 	/* Lower 2 bits indicates address space location. */
19896 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
19897 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT	0
19898 	/*
19899 	 * If value is 0, this register is located in PCIe config space.
19900 	 * Drivers have to map appropriate window to access this
19901 	 * register.
19902 	 */
19903 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
19904 	/*
19905 	 * If value is 1, this register is located in GRC address space.
19906 	 * Drivers have to map appropriate window to access this
19907 	 * register.
19908 	 */
19909 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
19910 	/*
19911 	 * If value is 2, this register is located in first BAR address
19912 	 * space. Drivers have to map appropriate window to access this
19913 	 * register.
19914 	 */
19915 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
19916 	/*
19917 	 * If value is 3, this register is located in second BAR address
19918 	 * space. Drivers have to map appropriate window to access this
19919 	 * register.
19920 	 */
19921 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
19922 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
19923 	/* Upper 30bits of the register address. */
19924 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
19925 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT	2
19926 	/*
19927 	 * FW reset counter.
19928 	 * Lower 2 bits indicates address space location and upper 30 bits
19929 	 * indicates actual address.
19930 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
19931 	 */
19932 	uint32_t	fw_reset_cnt_reg;
19933 	/* Lower 2 bits indicates address space location. */
19934 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
19935 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT	0
19936 	/*
19937 	 * If value is 0, this register is located in PCIe config space.
19938 	 * Drivers have to map appropriate window to access this
19939 	 * register.
19940 	 */
19941 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
19942 	/*
19943 	 * If value is 1, this register is located in GRC address space.
19944 	 * Drivers have to map appropriate window to access this
19945 	 * register.
19946 	 */
19947 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
19948 	/*
19949 	 * If value is 2, this register is located in first BAR address
19950 	 * space. Drivers have to map appropriate window to access this
19951 	 * register.
19952 	 */
19953 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
19954 	/*
19955 	 * If value is 3, this register is located in second BAR address
19956 	 * space. Drivers have to map appropriate window to access this
19957 	 * register.
19958 	 */
19959 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
19960 		#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
19961 	/* Upper 30bits of the register address. */
19962 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
19963 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT	2
19964 	/*
19965 	 * Reset Inprogress Register address for PFs.
19966 	 * Lower 2 bits indicates address space location and upper 30 bits
19967 	 * indicates actual address.
19968 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
19969 	 */
19970 	uint32_t	reset_inprogress_reg;
19971 	/* Lower 2 bits indicates address space location. */
19972 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
19973 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT	0
19974 	/*
19975 	 * If value is 0, this register is located in PCIe config space.
19976 	 * Drivers have to map appropriate window to access this
19977 	 * register.
19978 	 */
19979 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
19980 	/*
19981 	 * If value is 1, this register is located in GRC address space.
19982 	 * Drivers have to map appropriate window to access this
19983 	 * register.
19984 	 */
19985 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
19986 	/*
19987 	 * If value is 2, this register is located in first BAR address
19988 	 * space. Drivers have to map appropriate window to access this
19989 	 * register.
19990 	 */
19991 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
19992 	/*
19993 	 * If value is 3, this register is located in second BAR address
19994 	 * space. Drivers have to map appropriate window to access this
19995 	 * register.
19996 	 */
19997 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
19998 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
19999 	/* Upper 30bits of the register address. */
20000 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK	UINT32_C(0xfffffffc)
20001 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT	2
20002 	/* This field indicates the mask value for reset_inprogress_reg. */
20003 	uint32_t	reset_inprogress_reg_mask;
20004 	uint8_t	unused_0[3];
20005 	/*
20006 	 * Array of registers and value count to reset the Chip
20007 	 * Each array count has reset_reg, reset_reg_val, delay_after_reset
20008 	 * in TLV format. Depending upon Chip type, number of reset registers
20009 	 * will vary. Drivers have to write reset_reg_val in the reset_reg
20010 	 * location in the same sequence in order to recover from a fatal
20011 	 * error.
20012 	 */
20013 	uint8_t	reg_array_cnt;
20014 	/*
20015 	 * Reset register.
20016 	 * Lower 2 bits indicates address space location and upper 30 bits
20017 	 * indicates actual address.
20018 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
20019 	 */
20020 	uint32_t	reset_reg[16];
20021 	/* Lower 2 bits indicates address space location. */
20022 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
20023 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT	0
20024 	/*
20025 	 * If value is 0, this register is located in PCIe config space.
20026 	 * Drivers have to map appropriate window to access this
20027 	 * register.
20028 	 */
20029 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
20030 	/*
20031 	 * If value is 1, this register is located in GRC address space.
20032 	 * Drivers have to map appropriate window to access this
20033 	 * register.
20034 	 */
20035 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
20036 	/*
20037 	 * If value is 2, this register is located in first BAR address
20038 	 * space. Drivers have to map appropriate window to access this
20039 	 * register.
20040 	 */
20041 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
20042 	/*
20043 	 * If value is 3, this register is located in second BAR address
20044 	 * space. Drivers have to map appropriate window to access this
20045 	 * register.
20046 	 */
20047 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
20048 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
20049 	/* Upper 30bits of the register address. */
20050 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK	UINT32_C(0xfffffffc)
20051 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT	2
20052 	/* Value to be written in reset_reg to reset the controller. */
20053 	uint32_t	reset_reg_val[16];
20054 	/*
20055 	 * This value is in units of 1msec.
20056 	 * Typical value would be 10 to indicate 10msec.
20057 	 * Some of the operations like Core reset require delay before
20058 	 * accessing PCIE MMIO register space.
20059 	 * If this value is non-zero, drivers have to wait for
20060 	 * this much time after writing reset_reg_val in reset_reg.
20061 	 */
20062 	uint8_t	delay_after_reset[16];
20063 	/*
20064 	 * Error recovery counter.
20065 	 * Lower 2 bits indicates address space location and upper 30 bits
20066 	 * indicates actual address.
20067 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
20068 	 */
20069 	uint32_t	err_recovery_cnt_reg;
20070 	/* Lower 2 bits indicates address space location. */
20071 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
20072 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT	0
20073 	/*
20074 	 * If value is 0, this register is located in PCIe config space.
20075 	 * Drivers have to map appropriate window to access this
20076 	 * register.
20077 	 */
20078 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
20079 	/*
20080 	 * If value is 1, this register is located in GRC address space.
20081 	 * Drivers have to map appropriate window to access this
20082 	 * register.
20083 	 */
20084 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
20085 	/*
20086 	 * If value is 2, this register is located in first BAR address
20087 	 * space. Drivers have to map appropriate window to access this
20088 	 * register.
20089 	 */
20090 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
20091 	/*
20092 	 * If value is 3, this register is located in second BAR address
20093 	 * space. Drivers have to map appropriate window to access this
20094 	 * register.
20095 	 */
20096 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
20097 		#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
20098 	/* Upper 30bits of the register address. */
20099 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
20100 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT	2
20101 	uint8_t	unused_1[3];
20102 	/*
20103 	 * This field is used in Output records to indicate that the output
20104 	 * is completely written to RAM.  This field should be read as '1'
20105 	 * to indicate that the output has been completely written.
20106 	 * When writing a command completion or response to an internal
20107 	 * processor, the order of writes has to be such that this field
20108 	 * is written last.
20109 	 */
20110 	uint8_t	valid;
20111 } hwrm_error_recovery_qcfg_output_t, *phwrm_error_recovery_qcfg_output_t;
20112 
20113 /***************************
20114  * hwrm_func_echo_response *
20115  ***************************/
20116 
20117 
20118 /* hwrm_func_echo_response_input (size:192b/24B) */
20119 
20120 typedef struct hwrm_func_echo_response_input {
20121 	/* The HWRM command request type. */
20122 	uint16_t	req_type;
20123 	/*
20124 	 * The completion ring to send the completion event on. This should
20125 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20126 	 */
20127 	uint16_t	cmpl_ring;
20128 	/*
20129 	 * The sequence ID is used by the driver for tracking multiple
20130 	 * commands. This ID is treated as opaque data by the firmware and
20131 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20132 	 */
20133 	uint16_t	seq_id;
20134 	/*
20135 	 * The target ID of the command:
20136 	 * * 0x0-0xFFF8 - The function ID
20137 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20138 	 * * 0xFFFD - Reserved for user-space HWRM interface
20139 	 * * 0xFFFF - HWRM
20140 	 */
20141 	uint16_t	target_id;
20142 	/*
20143 	 * A physical address pointer pointing to a host buffer that the
20144 	 * command's response data will be written. This can be either a host
20145 	 * physical address (HPA) or a guest physical address (GPA) and must
20146 	 * point to a physically contiguous block of memory.
20147 	 */
20148 	uint64_t	resp_addr;
20149 	uint32_t	event_data1;
20150 	uint32_t	event_data2;
20151 } hwrm_func_echo_response_input_t, *phwrm_func_echo_response_input_t;
20152 
20153 /* hwrm_func_echo_response_output (size:128b/16B) */
20154 
20155 typedef struct hwrm_func_echo_response_output {
20156 	/* The specific error status for the command. */
20157 	uint16_t	error_code;
20158 	/* The HWRM command request type. */
20159 	uint16_t	req_type;
20160 	/* The sequence ID from the original command. */
20161 	uint16_t	seq_id;
20162 	/* The length of the response data in number of bytes. */
20163 	uint16_t	resp_len;
20164 	uint8_t	unused_0[7];
20165 	/*
20166 	 * This field is used in Output records to indicate that the output
20167 	 * is completely written to RAM.  This field should be read as '1'
20168 	 * to indicate that the output has been completely written.
20169 	 * When writing a command completion or response to an internal processor,
20170 	 * the order of writes has to be such that this field is written last.
20171 	 */
20172 	uint8_t	valid;
20173 } hwrm_func_echo_response_output_t, *phwrm_func_echo_response_output_t;
20174 
20175 /**************************
20176  * hwrm_func_ptp_pin_qcfg *
20177  **************************/
20178 
20179 
20180 /* hwrm_func_ptp_pin_qcfg_input (size:192b/24B) */
20181 
20182 typedef struct hwrm_func_ptp_pin_qcfg_input {
20183 	/* The HWRM command request type. */
20184 	uint16_t	req_type;
20185 	/*
20186 	 * The completion ring to send the completion event on. This should
20187 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20188 	 */
20189 	uint16_t	cmpl_ring;
20190 	/*
20191 	 * The sequence ID is used by the driver for tracking multiple
20192 	 * commands. This ID is treated as opaque data by the firmware and
20193 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20194 	 */
20195 	uint16_t	seq_id;
20196 	/*
20197 	 * The target ID of the command:
20198 	 * * 0x0-0xFFF8 - The function ID
20199 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20200 	 * * 0xFFFD - Reserved for user-space HWRM interface
20201 	 * * 0xFFFF - HWRM
20202 	 */
20203 	uint16_t	target_id;
20204 	/*
20205 	 * A physical address pointer pointing to a host buffer that the
20206 	 * command's response data will be written. This can be either a host
20207 	 * physical address (HPA) or a guest physical address (GPA) and must
20208 	 * point to a physically contiguous block of memory.
20209 	 */
20210 	uint64_t	resp_addr;
20211 	uint8_t	unused_0[8];
20212 } hwrm_func_ptp_pin_qcfg_input_t, *phwrm_func_ptp_pin_qcfg_input_t;
20213 
20214 /* hwrm_func_ptp_pin_qcfg_output (size:128b/16B) */
20215 
20216 typedef struct hwrm_func_ptp_pin_qcfg_output {
20217 	/* The specific error status for the command. */
20218 	uint16_t	error_code;
20219 	/* The HWRM command request type. */
20220 	uint16_t	req_type;
20221 	/* The sequence ID from the original command. */
20222 	uint16_t	seq_id;
20223 	/* The length of the response data in number of bytes. */
20224 	uint16_t	resp_len;
20225 	/*
20226 	 * The number of TSIO pins that are configured on this board
20227 	 * Up to 4 pins can be returned in the response.
20228 	 */
20229 	uint8_t	num_pins;
20230 	/* Pin state */
20231 	uint8_t	state;
20232 	/*
20233 	 * When this bit is '1', TSIO pin 0 is enabled.
20234 	 * When this bit is '0', TSIO pin 0 is disabled.
20235 	 */
20236 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN0_ENABLED	UINT32_C(0x1)
20237 	/*
20238 	 * When this bit is '1', TSIO pin 1 is enabled.
20239 	 * When this bit is '0', TSIO pin 1 is disabled.
20240 	 */
20241 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN1_ENABLED	UINT32_C(0x2)
20242 	/*
20243 	 * When this bit is '1', TSIO pin 2 is enabled.
20244 	 * When this bit is '0', TSIO pin 2 is disabled.
20245 	 */
20246 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN2_ENABLED	UINT32_C(0x4)
20247 	/*
20248 	 * When this bit is '1', TSIO pin 3 is enabled.
20249 	 * When this bit is '0', TSIO pin 3 is disabled.
20250 	 */
20251 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN3_ENABLED	UINT32_C(0x8)
20252 	/* Type of function for Pin #0. */
20253 	uint8_t	pin0_usage;
20254 	/* No function is configured. */
20255 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_NONE	UINT32_C(0x0)
20256 	/* PPS IN is configured. */
20257 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
20258 	/* PPS OUT is configured. */
20259 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
20260 	/* SYNC IN is configured. */
20261 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
20262 	/* SYNC OUT is configured. */
20263 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
20264 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_LAST	HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT
20265 	/* Type of function for Pin #1. */
20266 	uint8_t	pin1_usage;
20267 	/* No function is configured. */
20268 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_NONE	UINT32_C(0x0)
20269 	/* PPS IN is configured. */
20270 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
20271 	/* PPS OUT is configured. */
20272 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
20273 	/* SYNC IN is configured. */
20274 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
20275 	/* SYNC OUT is configured. */
20276 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
20277 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_LAST	HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT
20278 	/* Type of function for Pin #2. */
20279 	uint8_t	pin2_usage;
20280 	/* No function is configured. */
20281 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_NONE			UINT32_C(0x0)
20282 	/* PPS IN is configured. */
20283 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_IN			UINT32_C(0x1)
20284 	/* PPS OUT is configured. */
20285 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_OUT		UINT32_C(0x2)
20286 	/* SYNC IN is configured. */
20287 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_IN		UINT32_C(0x3)
20288 	/* SYNC OUT is configured. */
20289 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT		UINT32_C(0x4)
20290 	/* SYNCE primary clock OUT is configured. */
20291 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
20292 	/* SYNCE secondary clock OUT is configured. */
20293 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
20294 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_LAST			HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
20295 	/* Type of function for Pin #3. */
20296 	uint8_t	pin3_usage;
20297 	/* No function is configured. */
20298 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_NONE			UINT32_C(0x0)
20299 	/* PPS IN is configured. */
20300 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_IN			UINT32_C(0x1)
20301 	/* PPS OUT is configured. */
20302 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_OUT		UINT32_C(0x2)
20303 	/* SYNC IN is configured. */
20304 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_IN		UINT32_C(0x3)
20305 	/* SYNC OUT is configured. */
20306 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT		UINT32_C(0x4)
20307 	/* SYNCE primary clock OUT is configured. */
20308 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
20309 	/* SYNCE secondary OUT is configured. */
20310 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
20311 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_LAST			HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
20312 	uint8_t	unused_0;
20313 	/*
20314 	 * This field is used in Output records to indicate that the output
20315 	 * is completely written to RAM.  This field should be read as '1'
20316 	 * to indicate that the output has been completely written.
20317 	 * When writing a command completion or response to an internal processor,
20318 	 * the order of writes has to be such that this field is written last.
20319 	 */
20320 	uint8_t	valid;
20321 } hwrm_func_ptp_pin_qcfg_output_t, *phwrm_func_ptp_pin_qcfg_output_t;
20322 
20323 /*************************
20324  * hwrm_func_ptp_pin_cfg *
20325  *************************/
20326 
20327 
20328 /* hwrm_func_ptp_pin_cfg_input (size:256b/32B) */
20329 
20330 typedef struct hwrm_func_ptp_pin_cfg_input {
20331 	/* The HWRM command request type. */
20332 	uint16_t	req_type;
20333 	/*
20334 	 * The completion ring to send the completion event on. This should
20335 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20336 	 */
20337 	uint16_t	cmpl_ring;
20338 	/*
20339 	 * The sequence ID is used by the driver for tracking multiple
20340 	 * commands. This ID is treated as opaque data by the firmware and
20341 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20342 	 */
20343 	uint16_t	seq_id;
20344 	/*
20345 	 * The target ID of the command:
20346 	 * * 0x0-0xFFF8 - The function ID
20347 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20348 	 * * 0xFFFD - Reserved for user-space HWRM interface
20349 	 * * 0xFFFF - HWRM
20350 	 */
20351 	uint16_t	target_id;
20352 	/*
20353 	 * A physical address pointer pointing to a host buffer that the
20354 	 * command's response data will be written. This can be either a host
20355 	 * physical address (HPA) or a guest physical address (GPA) and must
20356 	 * point to a physically contiguous block of memory.
20357 	 */
20358 	uint64_t	resp_addr;
20359 	uint32_t	enables;
20360 	/*
20361 	 * This bit must be '1' for the pin0_state field to be
20362 	 * configured.
20363 	 */
20364 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_STATE	UINT32_C(0x1)
20365 	/*
20366 	 * This bit must be '1' for the pin0_usage field to be
20367 	 * configured.
20368 	 */
20369 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_USAGE	UINT32_C(0x2)
20370 	/*
20371 	 * This bit must be '1' for the pin1_state field to be
20372 	 * configured.
20373 	 */
20374 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_STATE	UINT32_C(0x4)
20375 	/*
20376 	 * This bit must be '1' for the pin1_usage field to be
20377 	 * configured.
20378 	 */
20379 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_USAGE	UINT32_C(0x8)
20380 	/*
20381 	 * This bit must be '1' for the pin2_state field to be
20382 	 * configured.
20383 	 */
20384 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_STATE	UINT32_C(0x10)
20385 	/*
20386 	 * This bit must be '1' for the pin2_usage field to be
20387 	 * configured.
20388 	 */
20389 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_USAGE	UINT32_C(0x20)
20390 	/*
20391 	 * This bit must be '1' for the pin3_state field to be
20392 	 * configured.
20393 	 */
20394 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_STATE	UINT32_C(0x40)
20395 	/*
20396 	 * This bit must be '1' for the pin3_usage field to be
20397 	 * configured.
20398 	 */
20399 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_USAGE	UINT32_C(0x80)
20400 	/* Enable or disable functionality of Pin #0. */
20401 	uint8_t	pin0_state;
20402 	/* Disabled */
20403 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_DISABLED UINT32_C(0x0)
20404 	/* Enabled */
20405 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED  UINT32_C(0x1)
20406 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED
20407 	/* Configure function for TSIO pin#0. */
20408 	uint8_t	pin0_usage;
20409 	/* No function is configured. */
20410 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_NONE	UINT32_C(0x0)
20411 	/* PPS IN is configured. */
20412 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
20413 	/* PPS OUT is configured. */
20414 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
20415 	/* SYNC IN is configured. */
20416 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
20417 	/* SYNC OUT is configured. */
20418 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
20419 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT
20420 	/* Enable or disable functionality of Pin #1. */
20421 	uint8_t	pin1_state;
20422 	/* Disabled */
20423 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_DISABLED UINT32_C(0x0)
20424 	/* Enabled */
20425 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED  UINT32_C(0x1)
20426 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED
20427 	/* Configure function for TSIO pin#1. */
20428 	uint8_t	pin1_usage;
20429 	/* No function is configured. */
20430 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_NONE	UINT32_C(0x0)
20431 	/* PPS IN is configured. */
20432 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
20433 	/* PPS OUT is configured. */
20434 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
20435 	/* SYNC IN is configured. */
20436 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
20437 	/* SYNC OUT is configured. */
20438 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
20439 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT
20440 	/* Enable or disable functionality of Pin #2. */
20441 	uint8_t	pin2_state;
20442 	/* Disabled */
20443 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_DISABLED UINT32_C(0x0)
20444 	/* Enabled */
20445 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED  UINT32_C(0x1)
20446 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED
20447 	/* Configure function for TSIO pin#2. */
20448 	uint8_t	pin2_usage;
20449 	/* No function is configured. */
20450 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_NONE			UINT32_C(0x0)
20451 	/* PPS IN is configured. */
20452 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_IN			UINT32_C(0x1)
20453 	/* PPS OUT is configured. */
20454 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_OUT		UINT32_C(0x2)
20455 	/* SYNC IN is configured. */
20456 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_IN		UINT32_C(0x3)
20457 	/* SYNC OUT is configured. */
20458 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT		UINT32_C(0x4)
20459 	/* SYNCE primary clock OUT is configured. */
20460 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
20461 	/* SYNCE secondary clock OUT is configured. */
20462 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
20463 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_LAST			HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
20464 	/* Enable or disable functionality of Pin #3. */
20465 	uint8_t	pin3_state;
20466 	/* Disabled */
20467 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_DISABLED UINT32_C(0x0)
20468 	/* Enabled */
20469 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED  UINT32_C(0x1)
20470 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED
20471 	/* Configure function for TSIO pin#3. */
20472 	uint8_t	pin3_usage;
20473 	/* No function is configured. */
20474 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_NONE			UINT32_C(0x0)
20475 	/* PPS IN is configured. */
20476 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_IN			UINT32_C(0x1)
20477 	/* PPS OUT is configured. */
20478 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_OUT		UINT32_C(0x2)
20479 	/* SYNC IN is configured. */
20480 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_IN		UINT32_C(0x3)
20481 	/* SYNC OUT is configured. */
20482 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT		UINT32_C(0x4)
20483 	/* SYNCE primary clock OUT is configured. */
20484 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
20485 	/* SYNCE secondary clock OUT is configured. */
20486 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
20487 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_LAST			HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
20488 	uint8_t	unused_0[4];
20489 } hwrm_func_ptp_pin_cfg_input_t, *phwrm_func_ptp_pin_cfg_input_t;
20490 
20491 /* hwrm_func_ptp_pin_cfg_output (size:128b/16B) */
20492 
20493 typedef struct hwrm_func_ptp_pin_cfg_output {
20494 	/* The specific error status for the command. */
20495 	uint16_t	error_code;
20496 	/* The HWRM command request type. */
20497 	uint16_t	req_type;
20498 	/* The sequence ID from the original command. */
20499 	uint16_t	seq_id;
20500 	/* The length of the response data in number of bytes. */
20501 	uint16_t	resp_len;
20502 	uint8_t	unused_0[7];
20503 	/*
20504 	 * This field is used in Output records to indicate that the output
20505 	 * is completely written to RAM.  This field should be read as '1'
20506 	 * to indicate that the output has been completely written.
20507 	 * When writing a command completion or response to an internal processor,
20508 	 * the order of writes has to be such that this field is written last.
20509 	 */
20510 	uint8_t	valid;
20511 } hwrm_func_ptp_pin_cfg_output_t, *phwrm_func_ptp_pin_cfg_output_t;
20512 
20513 /*********************
20514  * hwrm_func_ptp_cfg *
20515  *********************/
20516 
20517 
20518 /* hwrm_func_ptp_cfg_input (size:384b/48B) */
20519 
20520 typedef struct hwrm_func_ptp_cfg_input {
20521 	/* The HWRM command request type. */
20522 	uint16_t	req_type;
20523 	/*
20524 	 * The completion ring to send the completion event on. This should
20525 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20526 	 */
20527 	uint16_t	cmpl_ring;
20528 	/*
20529 	 * The sequence ID is used by the driver for tracking multiple
20530 	 * commands. This ID is treated as opaque data by the firmware and
20531 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20532 	 */
20533 	uint16_t	seq_id;
20534 	/*
20535 	 * The target ID of the command:
20536 	 * * 0x0-0xFFF8 - The function ID
20537 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20538 	 * * 0xFFFD - Reserved for user-space HWRM interface
20539 	 * * 0xFFFF - HWRM
20540 	 */
20541 	uint16_t	target_id;
20542 	/*
20543 	 * A physical address pointer pointing to a host buffer that the
20544 	 * command's response data will be written. This can be either a host
20545 	 * physical address (HPA) or a guest physical address (GPA) and must
20546 	 * point to a physically contiguous block of memory.
20547 	 */
20548 	uint64_t	resp_addr;
20549 	uint16_t	enables;
20550 	/*
20551 	 * This bit must be '1' for the ptp_pps_event field to be
20552 	 * configured.
20553 	 */
20554 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_PPS_EVENT		UINT32_C(0x1)
20555 	/*
20556 	 * This bit must be '1' for the ptp_freq_adj_dll_source field to be
20557 	 * configured.
20558 	 */
20559 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_SOURCE	UINT32_C(0x2)
20560 	/*
20561 	 * This bit must be '1' for the ptp_freq_adj_dll_phase field to be
20562 	 * configured.
20563 	 */
20564 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_PHASE	UINT32_C(0x4)
20565 	/*
20566 	 * This bit must be '1' for the ptp_freq_adj_ext_period field to be
20567 	 * configured.
20568 	 */
20569 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PERIOD	UINT32_C(0x8)
20570 	/*
20571 	 * This bit must be '1' for the ptp_freq_adj_ext_up field to be
20572 	 * configured.
20573 	 */
20574 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_UP	UINT32_C(0x10)
20575 	/*
20576 	 * This bit must be '1' for the ptp_freq_adj_ext_phase field to be
20577 	 * configured.
20578 	 */
20579 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PHASE	UINT32_C(0x20)
20580 	/* This bit must be '1' for ptp_set_time field to be configured. */
20581 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_SET_TIME		UINT32_C(0x40)
20582 	/* This field is used to enable interrupt for a specific PPS event. */
20583 	uint8_t	ptp_pps_event;
20584 	/*
20585 	 * When this bit is set to '1', interrupt is enabled for internal
20586 	 * PPS event. Latches timestamp on PPS_OUT TSIO Pin. If user does
20587 	 * not configure PPS_OUT on a TSIO pin, then firmware will allocate
20588 	 * PPS_OUT to an unallocated pin.
20589 	 */
20590 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_INTERNAL	UINT32_C(0x1)
20591 	/*
20592 	 * When this bit is set to '1', interrupt is enabled for external
20593 	 * PPS event. Latches timestamp on PPS_IN TSIO pin.
20594 	 */
20595 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_EXTERNAL	UINT32_C(0x2)
20596 	/*
20597 	 * This field is used to set the source signal used to discipline
20598 	 * PHC (PTP Hardware Clock)
20599 	 */
20600 	uint8_t	ptp_freq_adj_dll_source;
20601 	/* No source is selected. Use servo to discipline PHC */
20602 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_NONE	UINT32_C(0x0)
20603 	/* TSIO Pin #0 is selected as source signal. */
20604 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_0  UINT32_C(0x1)
20605 	/* TSIO Pin #1 is selected as source signal. */
20606 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_1  UINT32_C(0x2)
20607 	/* TSIO Pin #2 is selected as source signal. */
20608 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_2  UINT32_C(0x3)
20609 	/* TSIO Pin #3 is selected as source signal. */
20610 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_3  UINT32_C(0x4)
20611 	/* Port #0 is selected as source signal. */
20612 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_0  UINT32_C(0x5)
20613 	/* Port #1 is selected as source signal. */
20614 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_1  UINT32_C(0x6)
20615 	/* Port #2 is selected as source signal. */
20616 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_2  UINT32_C(0x7)
20617 	/* Port #3 is selected as source signal. */
20618 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_3  UINT32_C(0x8)
20619 	/* Invalid signal. */
20620 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID UINT32_C(0xff)
20621 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_LAST   HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID
20622 	/*
20623 	 * This field is used to provide phase adjustment for DLL
20624 	 * used to discipline PHC (PTP Hardware clock)
20625 	 */
20626 	uint8_t	ptp_freq_adj_dll_phase;
20627 	/* No Phase adjustment. */
20628 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_NONE UINT32_C(0x0)
20629 	/* 4Khz sync in frequency. */
20630 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_4K   UINT32_C(0x1)
20631 	/* 8Khz sync in frequency. */
20632 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_8K   UINT32_C(0x2)
20633 	/* 10Mhz sync in frequency. */
20634 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M  UINT32_C(0x3)
20635 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_LAST HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M
20636 	uint8_t	unused_0[3];
20637 	/*
20638 	 * Period in nanoseconds (ns) for external signal
20639 	 * input.
20640 	 */
20641 	uint32_t	ptp_freq_adj_ext_period;
20642 	/*
20643 	 * Up time in nanoseconds (ns) of the duty cycle
20644 	 * of the external signal. This value should be
20645 	 * less than ptp_freq_adj_ext_period.
20646 	 */
20647 	uint32_t	ptp_freq_adj_ext_up;
20648 	/*
20649 	 * Phase value is provided. This field provides the
20650 	 * least significant 32 bits of the phase input. The
20651 	 * most significant 16 bits come from
20652 	 * ptp_freq_adj_ext_phase_upper field. Setting this
20653 	 * field requires setting ptp_freq_adj_ext_period
20654 	 * field as well to identify the external signal
20655 	 * pin.
20656 	 */
20657 	uint32_t	ptp_freq_adj_ext_phase_lower;
20658 	/*
20659 	 * Phase value is provided. The lower 16 bits of this field is used
20660 	 * with the 32 bit value from ptp_freq_adj_ext_phase_lower
20661 	 * to provide a 48 bit value input for Phase.
20662 	 */
20663 	uint32_t	ptp_freq_adj_ext_phase_upper;
20664 	/*
20665 	 * Allows driver to set the full 64bit time in FW. The upper 16 bits
20666 	 * will be stored in FW and the lower 48bits will be programmed in
20667 	 * PHC. Firmware will send a broadcast async event to all functions
20668 	 * to indicate the programmed upper 16 bits.
20669 	 */
20670 	uint64_t	ptp_set_time;
20671 } hwrm_func_ptp_cfg_input_t, *phwrm_func_ptp_cfg_input_t;
20672 
20673 /* hwrm_func_ptp_cfg_output (size:128b/16B) */
20674 
20675 typedef struct hwrm_func_ptp_cfg_output {
20676 	/* The specific error status for the command. */
20677 	uint16_t	error_code;
20678 	/* The HWRM command request type. */
20679 	uint16_t	req_type;
20680 	/* The sequence ID from the original command. */
20681 	uint16_t	seq_id;
20682 	/* The length of the response data in number of bytes. */
20683 	uint16_t	resp_len;
20684 	uint8_t	unused_0[7];
20685 	/*
20686 	 * This field is used in Output records to indicate that the output
20687 	 * is completely written to RAM.  This field should be read as '1'
20688 	 * to indicate that the output has been completely written.
20689 	 * When writing a command completion or response to an internal processor,
20690 	 * the order of writes has to be such that this field is written last.
20691 	 */
20692 	uint8_t	valid;
20693 } hwrm_func_ptp_cfg_output_t, *phwrm_func_ptp_cfg_output_t;
20694 
20695 /**************************
20696  * hwrm_func_ptp_ts_query *
20697  **************************/
20698 
20699 
20700 /* hwrm_func_ptp_ts_query_input (size:192b/24B) */
20701 
20702 typedef struct hwrm_func_ptp_ts_query_input {
20703 	/* The HWRM command request type. */
20704 	uint16_t	req_type;
20705 	/*
20706 	 * The completion ring to send the completion event on. This should
20707 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20708 	 */
20709 	uint16_t	cmpl_ring;
20710 	/*
20711 	 * The sequence ID is used by the driver for tracking multiple
20712 	 * commands. This ID is treated as opaque data by the firmware and
20713 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20714 	 */
20715 	uint16_t	seq_id;
20716 	/*
20717 	 * The target ID of the command:
20718 	 * * 0x0-0xFFF8 - The function ID
20719 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20720 	 * * 0xFFFD - Reserved for user-space HWRM interface
20721 	 * * 0xFFFF - HWRM
20722 	 */
20723 	uint16_t	target_id;
20724 	/*
20725 	 * A physical address pointer pointing to a host buffer that the
20726 	 * command's response data will be written. This can be either a host
20727 	 * physical address (HPA) or a guest physical address (GPA) and must
20728 	 * point to a physically contiguous block of memory.
20729 	 */
20730 	uint64_t	resp_addr;
20731 	uint32_t	flags;
20732 	/* If set, the response includes PPS event timestamps */
20733 	#define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PPS_TIME	UINT32_C(0x1)
20734 	/* If set, the response includes PTM timestamps */
20735 	#define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PTM_TIME	UINT32_C(0x2)
20736 	uint8_t	unused_0[4];
20737 } hwrm_func_ptp_ts_query_input_t, *phwrm_func_ptp_ts_query_input_t;
20738 
20739 /* hwrm_func_ptp_ts_query_output (size:320b/40B) */
20740 
20741 typedef struct hwrm_func_ptp_ts_query_output {
20742 	/* The specific error status for the command. */
20743 	uint16_t	error_code;
20744 	/* The HWRM command request type. */
20745 	uint16_t	req_type;
20746 	/* The sequence ID from the original command. */
20747 	uint16_t	seq_id;
20748 	/* The length of the response data in number of bytes. */
20749 	uint16_t	resp_len;
20750 	/* Timestamp value of last PPS event latched. */
20751 	uint64_t	pps_event_ts;
20752 	/*
20753 	 * PHC timestamp value when PTM responseD request is received
20754 	 * at downstream port (t4'). This is a 48 bit timestamp in nanoseconds.
20755 	 */
20756 	uint64_t	ptm_local_ts;
20757 	/*
20758 	 * PTM System timestamp value corresponding to t4' at
20759 	 * root complex (T4'). Together with ptm_local_ts, these
20760 	 * two timestamps provide the cross-trigger timestamps.
20761 	 * Driver can directly use these values for cross-trigger.
20762 	 * This is a 48 bit timestamp in nanoseconds.
20763 	 */
20764 	uint64_t	ptm_system_ts;
20765 	/*
20766 	 * PTM Link delay. This is the time taken at root complex (RC)
20767 	 * between receiving PTM request and sending PTM response to
20768 	 * downstream port. This is a 32 bit value in nanoseconds.
20769 	 */
20770 	uint32_t	ptm_link_delay;
20771 	uint8_t	unused_0[3];
20772 	/*
20773 	 * This field is used in Output records to indicate that the output
20774 	 * is completely written to RAM.  This field should be read as '1'
20775 	 * to indicate that the output has been completely written.
20776 	 * When writing a command completion or response to an internal processor,
20777 	 * the order of writes has to be such that this field is written last.
20778 	 */
20779 	uint8_t	valid;
20780 } hwrm_func_ptp_ts_query_output_t, *phwrm_func_ptp_ts_query_output_t;
20781 
20782 /*************************
20783  * hwrm_func_ptp_ext_cfg *
20784  *************************/
20785 
20786 
20787 /* hwrm_func_ptp_ext_cfg_input (size:256b/32B) */
20788 
20789 typedef struct hwrm_func_ptp_ext_cfg_input {
20790 	/* The HWRM command request type. */
20791 	uint16_t	req_type;
20792 	/*
20793 	 * The completion ring to send the completion event on. This should
20794 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20795 	 */
20796 	uint16_t	cmpl_ring;
20797 	/*
20798 	 * The sequence ID is used by the driver for tracking multiple
20799 	 * commands. This ID is treated as opaque data by the firmware and
20800 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20801 	 */
20802 	uint16_t	seq_id;
20803 	/*
20804 	 * The target ID of the command:
20805 	 * * 0x0-0xFFF8 - The function ID
20806 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20807 	 * * 0xFFFD - Reserved for user-space HWRM interface
20808 	 * * 0xFFFF - HWRM
20809 	 */
20810 	uint16_t	target_id;
20811 	/*
20812 	 * A physical address pointer pointing to a host buffer that the
20813 	 * command's response data will be written. This can be either a host
20814 	 * physical address (HPA) or a guest physical address (GPA) and must
20815 	 * point to a physically contiguous block of memory.
20816 	 */
20817 	uint64_t	resp_addr;
20818 	uint16_t	enables;
20819 	/*
20820 	 * This bit must be '1' for the phc_master_fid field to be
20821 	 * configured.
20822 	 */
20823 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_MASTER_FID	UINT32_C(0x1)
20824 	/*
20825 	 * This bit must be '1' for the phc_sec_fid field to be
20826 	 * configured.
20827 	 */
20828 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_FID	UINT32_C(0x2)
20829 	/*
20830 	 * This bit must be '1' for the phc_sec_mode field to be
20831 	 * configured.
20832 	 */
20833 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_MODE	UINT32_C(0x4)
20834 	/*
20835 	 * This bit must be '1' for the failover_timer field to be
20836 	 * configured.
20837 	 */
20838 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_FAILOVER_TIMER	UINT32_C(0x8)
20839 	/*
20840 	 * This field is used to configure the Master function. Only this
20841 	 * function can modify or condition the PHC. Only driver calls from
20842 	 * this function are allowed to adjust frequency of PHC or configure
20843 	 * PPS functionality.
20844 	 * If driver does not specify this FID, then firmware will auto select
20845 	 * the first function that makes the call to modify PHC as the Master.
20846 	 */
20847 	uint16_t	phc_master_fid;
20848 	/*
20849 	 * This field is used to configure the secondary function. This
20850 	 * function becomes the Master function in case of failover from
20851 	 * Master function.
20852 	 * If driver does not specify this FID, firmware will auto select
20853 	 * the last non-master function to make a call to condition PHC as
20854 	 * secondary.
20855 	 */
20856 	uint16_t	phc_sec_fid;
20857 	/*
20858 	 * This field is used to configure conditions under which a function
20859 	 * can become a secondary function.
20860 	 */
20861 	uint8_t	phc_sec_mode;
20862 	/*
20863 	 * Immediately failover to the current secondary function. If there
20864 	 * is no secondary function available, failover does not happen.
20865 	 */
20866 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_SWITCH  UINT32_C(0x0)
20867 	/*
20868 	 * All functions (PF and VF) can be used during auto selection
20869 	 * of a secondary function. This is not used in case of admin
20870 	 * configured secondary function.
20871 	 */
20872 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_ALL	UINT32_C(0x1)
20873 	/*
20874 	 * Only PF's can be selected as a secondary function during auto
20875 	 * selection. This is not used in case of admin configured secondary
20876 	 * function.
20877 	 */
20878 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY UINT32_C(0x2)
20879 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_LAST   HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY
20880 	uint8_t	unused_0;
20881 	/*
20882 	 * This field indicates the failover time is milliseconds. If the
20883 	 * timeout expires, firmware will failover PTP configurability from
20884 	 * current master to secondary fid.
20885 	 * 0 - Failover timer is automatically selected based on the last
20886 	 * adjFreq() call. If adjFreq() is not called for 3 * (last interval)
20887 	 * the failover kicks in. For example, if last interval between
20888 	 * adjFreq() calls was 2 seconds and the next adjFreq() is not made for
20889 	 * at least 6 seconds, then secondary takes over as master to condition
20890 	 * PHC. Firmware rounds up the failover timer to be a multiple of 250
20891 	 * ms. Firmware checks every 250 ms to see if timer expired.
20892 	 * 0xFFFFFFFF - If driver specifies this value, then failover never
20893 	 * happens. Admin or auto selected Master will always be used for
20894 	 * conditioning PHC.
20895 	 * X - If driver specifies any other value, this is admin indicated
20896 	 * failover timeout. If no adjFreq() call is made within this timeout
20897 	 * value, then failover happens. This value should be a multiple of
20898 	 * 250 ms. Firmware checks every 250 ms to see if timer expired.
20899 	 */
20900 	uint32_t	failover_timer;
20901 	uint8_t	unused_1[4];
20902 } hwrm_func_ptp_ext_cfg_input_t, *phwrm_func_ptp_ext_cfg_input_t;
20903 
20904 /* hwrm_func_ptp_ext_cfg_output (size:128b/16B) */
20905 
20906 typedef struct hwrm_func_ptp_ext_cfg_output {
20907 	/* The specific error status for the command. */
20908 	uint16_t	error_code;
20909 	/* The HWRM command request type. */
20910 	uint16_t	req_type;
20911 	/* The sequence ID from the original command. */
20912 	uint16_t	seq_id;
20913 	/* The length of the response data in number of bytes. */
20914 	uint16_t	resp_len;
20915 	uint8_t	unused_0[7];
20916 	/*
20917 	 * This field is used in Output records to indicate that the output
20918 	 * is completely written to RAM.  This field should be read as '1'
20919 	 * to indicate that the output has been completely written.
20920 	 * When writing a command completion or response to an internal processor,
20921 	 * the order of writes has to be such that this field is written last.
20922 	 */
20923 	uint8_t	valid;
20924 } hwrm_func_ptp_ext_cfg_output_t, *phwrm_func_ptp_ext_cfg_output_t;
20925 
20926 /**************************
20927  * hwrm_func_ptp_ext_qcfg *
20928  **************************/
20929 
20930 
20931 /* hwrm_func_ptp_ext_qcfg_input (size:192b/24B) */
20932 
20933 typedef struct hwrm_func_ptp_ext_qcfg_input {
20934 	/* The HWRM command request type. */
20935 	uint16_t	req_type;
20936 	/*
20937 	 * The completion ring to send the completion event on. This should
20938 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20939 	 */
20940 	uint16_t	cmpl_ring;
20941 	/*
20942 	 * The sequence ID is used by the driver for tracking multiple
20943 	 * commands. This ID is treated as opaque data by the firmware and
20944 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20945 	 */
20946 	uint16_t	seq_id;
20947 	/*
20948 	 * The target ID of the command:
20949 	 * * 0x0-0xFFF8 - The function ID
20950 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20951 	 * * 0xFFFD - Reserved for user-space HWRM interface
20952 	 * * 0xFFFF - HWRM
20953 	 */
20954 	uint16_t	target_id;
20955 	/*
20956 	 * A physical address pointer pointing to a host buffer that the
20957 	 * command's response data will be written. This can be either a host
20958 	 * physical address (HPA) or a guest physical address (GPA) and must
20959 	 * point to a physically contiguous block of memory.
20960 	 */
20961 	uint64_t	resp_addr;
20962 	uint8_t	unused_0[8];
20963 } hwrm_func_ptp_ext_qcfg_input_t, *phwrm_func_ptp_ext_qcfg_input_t;
20964 
20965 /* hwrm_func_ptp_ext_qcfg_output (size:256b/32B) */
20966 
20967 typedef struct hwrm_func_ptp_ext_qcfg_output {
20968 	/* The specific error status for the command. */
20969 	uint16_t	error_code;
20970 	/* The HWRM command request type. */
20971 	uint16_t	req_type;
20972 	/* The sequence ID from the original command. */
20973 	uint16_t	seq_id;
20974 	/* The length of the response data in number of bytes. */
20975 	uint16_t	resp_len;
20976 	/*
20977 	 * Firmware returns the current PHC master function. This function
20978 	 * could either be admin selected or auto selected.
20979 	 */
20980 	uint16_t	phc_master_fid;
20981 	/*
20982 	 * Firmware returns the current PHC secondary function. This function
20983 	 * could either be admin selected or auto selected.
20984 	 */
20985 	uint16_t	phc_sec_fid;
20986 	/*
20987 	 * Firmware returns the last non-master/non-secondary function to
20988 	 * make a call to condition PHC.
20989 	 */
20990 	uint16_t	phc_active_fid0;
20991 	/*
20992 	 * Firmware returns the second last non-master/non-secondary function
20993 	 * to make a call to condition PHC.
20994 	 */
20995 	uint16_t	phc_active_fid1;
20996 	/*
20997 	 * Timestamp indicating the last time a failover happened. The master
20998 	 * and secondary functions in the failover event is indicated in the
20999 	 * next two fields.
21000 	 */
21001 	uint32_t	last_failover_event;
21002 	/*
21003 	 * Last failover happened from this function. This was the master
21004 	 * function at the time of failover.
21005 	 */
21006 	uint16_t	from_fid;
21007 	/*
21008 	 * Last failover happened to this function. This was the secondary
21009 	 * function at the time of failover.
21010 	 */
21011 	uint16_t	to_fid;
21012 	uint8_t	unused_0[7];
21013 	/*
21014 	 * This field is used in Output records to indicate that the output
21015 	 * is completely written to RAM.  This field should be read as '1'
21016 	 * to indicate that the output has been completely written.
21017 	 * When writing a command completion or response to an internal processor,
21018 	 * the order of writes has to be such that this field is written last.
21019 	 */
21020 	uint8_t	valid;
21021 } hwrm_func_ptp_ext_qcfg_output_t, *phwrm_func_ptp_ext_qcfg_output_t;
21022 
21023 /***************************
21024  * hwrm_func_key_ctx_alloc *
21025  ***************************/
21026 
21027 
21028 /* hwrm_func_key_ctx_alloc_input (size:320b/40B) */
21029 
21030 typedef struct hwrm_func_key_ctx_alloc_input {
21031 	/* The HWRM command request type. */
21032 	uint16_t	req_type;
21033 	/*
21034 	 * The completion ring to send the completion event on. This should
21035 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21036 	 */
21037 	uint16_t	cmpl_ring;
21038 	/*
21039 	 * The sequence ID is used by the driver for tracking multiple
21040 	 * commands. This ID is treated as opaque data by the firmware and
21041 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21042 	 */
21043 	uint16_t	seq_id;
21044 	/*
21045 	 * The target ID of the command:
21046 	 * * 0x0-0xFFF8 - The function ID
21047 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21048 	 * * 0xFFFD - Reserved for user-space HWRM interface
21049 	 * * 0xFFFF - HWRM
21050 	 */
21051 	uint16_t	target_id;
21052 	/*
21053 	 * A physical address pointer pointing to a host buffer that the
21054 	 * command's response data will be written. This can be either a host
21055 	 * physical address (HPA) or a guest physical address (GPA) and must
21056 	 * point to a physically contiguous block of memory.
21057 	 */
21058 	uint64_t	resp_addr;
21059 	/* Function ID. */
21060 	uint16_t	fid;
21061 	/* Number of Key Contexts to be allocated. */
21062 	uint16_t	num_key_ctxs;
21063 	/* DMA buffer size in bytes. */
21064 	uint32_t	dma_bufr_size_bytes;
21065 	/* Key Context type. */
21066 	uint8_t	key_ctx_type;
21067 	/* KTLS Tx Key Context type. */
21068 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_TX	UINT32_C(0x0)
21069 	/* KTLS Rx Key Context type. */
21070 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_RX	UINT32_C(0x1)
21071 	/* QUIC Tx Key Context type. */
21072 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_TX UINT32_C(0x2)
21073 	/* QUIC Rx Key Context type. */
21074 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX UINT32_C(0x3)
21075 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_LAST   HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX
21076 	uint8_t	unused_0[7];
21077 	/* Host DMA address to send back KTLS context IDs. */
21078 	uint64_t	host_dma_addr;
21079 } hwrm_func_key_ctx_alloc_input_t, *phwrm_func_key_ctx_alloc_input_t;
21080 
21081 /* hwrm_func_key_ctx_alloc_output (size:128b/16B) */
21082 
21083 typedef struct hwrm_func_key_ctx_alloc_output {
21084 	/* The specific error status for the command. */
21085 	uint16_t	error_code;
21086 	/* The HWRM command request type. */
21087 	uint16_t	req_type;
21088 	/* The sequence ID from the original command. */
21089 	uint16_t	seq_id;
21090 	/* The length of the response data in number of bytes. */
21091 	uint16_t	resp_len;
21092 	/* Actual number of Key Contexts allocated. */
21093 	uint16_t	num_key_ctxs_allocated;
21094 	/* Control flags. */
21095 	uint8_t	flags;
21096 	/*
21097 	 * When set, it indicates that all key contexts allocated by this
21098 	 * command are contiguous. As a result, the driver has to read the
21099 	 * start context ID from the first entry of the DMA data buffer
21100 	 * and figures out the end context ID by “start context ID +
21101 	 * num_key_ctxs_allocated - 1”.
21102 	 */
21103 	#define HWRM_FUNC_KEY_CTX_ALLOC_OUTPUT_FLAGS_KEY_CTXS_CONTIGUOUS	UINT32_C(0x1)
21104 	uint8_t	unused_0[4];
21105 	/*
21106 	 * This field is used in Output records to indicate that the output
21107 	 * is completely written to RAM.  This field should be read as '1'
21108 	 * to indicate that the output has been completely written.
21109 	 * When writing a command completion or response to an internal processor,
21110 	 * the order of writes has to be such that this field is written last.
21111 	 */
21112 	uint8_t	valid;
21113 } hwrm_func_key_ctx_alloc_output_t, *phwrm_func_key_ctx_alloc_output_t;
21114 
21115 /**********************************
21116  * hwrm_func_backing_store_cfg_v2 *
21117  **********************************/
21118 
21119 
21120 /* hwrm_func_backing_store_cfg_v2_input (size:448b/56B) */
21121 
21122 typedef struct hwrm_func_backing_store_cfg_v2_input {
21123 	/* The HWRM command request type. */
21124 	uint16_t	req_type;
21125 	/*
21126 	 * The completion ring to send the completion event on. This should
21127 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21128 	 */
21129 	uint16_t	cmpl_ring;
21130 	/*
21131 	 * The sequence ID is used by the driver for tracking multiple
21132 	 * commands. This ID is treated as opaque data by the firmware and
21133 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21134 	 */
21135 	uint16_t	seq_id;
21136 	/*
21137 	 * The target ID of the command:
21138 	 * * 0x0-0xFFF8 - The function ID
21139 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21140 	 * * 0xFFFD - Reserved for user-space HWRM interface
21141 	 * * 0xFFFF - HWRM
21142 	 */
21143 	uint16_t	target_id;
21144 	/*
21145 	 * A physical address pointer pointing to a host buffer that the
21146 	 * command's response data will be written. This can be either a host
21147 	 * physical address (HPA) or a guest physical address (GPA) and must
21148 	 * point to a physically contiguous block of memory.
21149 	 */
21150 	uint64_t	resp_addr;
21151 	/* Type of backing store to be configured. */
21152 	uint16_t	type;
21153 	/* Queue pair. */
21154 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QP		UINT32_C(0x0)
21155 	/* Shared receive queue. */
21156 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ	UINT32_C(0x1)
21157 	/* Completion queue. */
21158 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
21159 	/* Virtual NIC. */
21160 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_VNIC	UINT32_C(0x3)
21161 	/* Statistic context. */
21162 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_STAT	UINT32_C(0x4)
21163 	/* Slow-path TQM ring. */
21164 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SP_TQM_RING   UINT32_C(0x5)
21165 	/* Fast-path TQM ring. */
21166 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_FP_TQM_RING   UINT32_C(0x6)
21167 	/* Memory Region and Memory Address Vector Context. */
21168 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MRAV	UINT32_C(0xe)
21169 	/* TIM. */
21170 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TIM	UINT32_C(0xf)
21171 	/* Tx key context. */
21172 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TKC	UINT32_C(0x13)
21173 	/* Rx key context. */
21174 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RKC	UINT32_C(0x14)
21175 	/* Mid-path TQM ring. */
21176 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MP_TQM_RING   UINT32_C(0x15)
21177 	/* SQ Doorbell shadow region. */
21178 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SQ_DB_SHADOW  UINT32_C(0x16)
21179 	/* RQ Doorbell shadow region. */
21180 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RQ_DB_SHADOW  UINT32_C(0x17)
21181 	/* SRQ Doorbell shadow region. */
21182 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ_DB_SHADOW UINT32_C(0x18)
21183 	/* CQ Doorbell shadow region. */
21184 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ_DB_SHADOW  UINT32_C(0x19)
21185 	/* QUIC Tx key context. */
21186 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_TKC	UINT32_C(0x1a)
21187 	/* QUIC Rx key context. */
21188 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_RKC	UINT32_C(0x1b)
21189 	/* Invalid type. */
21190 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID	UINT32_C(0xffff)
21191 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_LAST	HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID
21192 	/*
21193 	 * Instance of the backing store type. It is zero-based,
21194 	 * which means "0" indicates the first instance. For backing
21195 	 * stores with single instance only, leave this field to 0.
21196 	 * 1. If the backing store type is MPC TQM ring, use the following
21197 	 *	instance value to MPC client mapping:
21198 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
21199 	 */
21200 	uint16_t	instance;
21201 	/* Control flags. */
21202 	uint32_t	flags;
21203 	/*
21204 	 * When set, the firmware only uses on-chip resources and
21205 	 * does not expect any backing store to be provided by the
21206 	 * host driver. This mode provides minimal L2 functionality
21207 	 * (e.g. limited L2 resources, no RoCE).
21208 	 */
21209 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_PREBOOT_MODE	UINT32_C(0x1)
21210 	/*
21211 	 * When set, the driver indicates that the backing store type
21212 	 * to be configured in this command is the last one to do for
21213 	 * the associated PF. That means all backing store type
21214 	 * configurations are done for the corresponding PF after this
21215 	 * command. As a result, the firmware has to do the necessary
21216 	 * post configurations.
21217 	 */
21218 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_BS_CFG_ALL_DONE	UINT32_C(0x2)
21219 	/*
21220 	 * When set, the driver indicates extending the size of the specific
21221 	 * backing store type instead of configuring the corresponding PBLs.
21222 	 * The size specified in the command will be the new size to be
21223 	 * configured. The operation is only valid when the specific backing
21224 	 * store has been configured before. Otherwise, the firmware will
21225 	 * return an error. The driver needs to zero out the “entry_size”,
21226 	 * “flags”, “page_dir”, and “page_size_pbl_level” fields, and the
21227 	 * firmware will ignore these inputs. Further, the firmware expects
21228 	 * the “num_entries” and any valid split entries to be no less than
21229 	 * the initial value that has been configured. If not, it will
21230 	 * return an error code.
21231 	 */
21232 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_BS_EXTEND	UINT32_C(0x4)
21233 	/* Page directory. */
21234 	uint64_t	page_dir;
21235 	/* Number of entries */
21236 	uint32_t	num_entries;
21237 	/* Number of bytes allocated for each entry */
21238 	uint16_t	entry_size;
21239 	/* Page size and pbl level. */
21240 	uint8_t	page_size_pbl_level;
21241 	/* PBL indirect levels. */
21242 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_MASK  UINT32_C(0xf)
21243 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_SFT   0
21244 	/* PBL pointer is physical start address. */
21245 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_0   UINT32_C(0x0)
21246 	/* PBL pointer points to PTE table. */
21247 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_1   UINT32_C(0x1)
21248 	/*
21249 	 * PBL pointer points to PDE table with each entry pointing to
21250 	 * PTE tables.
21251 	 */
21252 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2   UINT32_C(0x2)
21253 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LAST   HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2
21254 	/* Page size. */
21255 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_MASK  UINT32_C(0xf0)
21256 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_SFT   4
21257 	/* 4KB. */
21258 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21259 	/* 8KB. */
21260 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21261 	/* 64KB. */
21262 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21263 	/* 2MB. */
21264 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21265 	/* 8MB. */
21266 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21267 	/* 1GB. */
21268 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21269 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G
21270 	/*
21271 	 * This field counts how many split entries contain valid data.
21272 	 * Below is the table that maps the count value:
21273 	 * | Count |			Indication			|
21274 	 * | ----- | -------------------------------------------------- |
21275 	 * |   0   | None of the split entries has valid data.	|
21276 	 * |   1   | Only "split_entry_0" contains valid data.	|
21277 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
21278 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
21279 	 * |   4   | All four split entries have valid data.		|
21280 	 */
21281 	uint8_t	subtype_valid_cnt;
21282 	/*
21283 	 * Split entry #0. Note that the four split entries (as a group)
21284 	 * must be cast to a type-specific data structure first before
21285 	 * accessing it! Below is the table that maps a backing store
21286 	 * type to the associated split entry casting data structure.
21287 	 * | Type |	Split Entry Casting Data Structure	|
21288 	 * | ---- | -------------------------------------------------- |
21289 	 * | QPC  |		qpc_split_entries			|
21290 	 * | SRQ  |		srq_split_entries			|
21291 	 * | CQ   |		cq_split_entries			|
21292 	 * | VINC |		vnic_split_entries			|
21293 	 * | MRAV |		marv_split_entries			|
21294 	 */
21295 	uint32_t	split_entry_0;
21296 	/* Split entry #1. */
21297 	uint32_t	split_entry_1;
21298 	/* Split entry #2. */
21299 	uint32_t	split_entry_2;
21300 	/* Split entry #3. */
21301 	uint32_t	split_entry_3;
21302 } hwrm_func_backing_store_cfg_v2_input_t, *phwrm_func_backing_store_cfg_v2_input_t;
21303 
21304 /* hwrm_func_backing_store_cfg_v2_output (size:128b/16B) */
21305 
21306 typedef struct hwrm_func_backing_store_cfg_v2_output {
21307 	/* The specific error status for the command. */
21308 	uint16_t	error_code;
21309 	/* The HWRM command request type. */
21310 	uint16_t	req_type;
21311 	/* The sequence ID from the original command. */
21312 	uint16_t	seq_id;
21313 	/* The length of the response data in number of bytes. */
21314 	uint16_t	resp_len;
21315 	uint8_t	rsvd0[7];
21316 	/*
21317 	 * This field is used in Output records to indicate that the
21318 	 * output is completely written to RAM.  This field should be
21319 	 * read as '1' to indicate that the output has been completely
21320 	 * written. When writing a command completion or response to
21321 	 * an internal processor, the order of writes has to be such
21322 	 * that this field is written last.
21323 	 */
21324 	uint8_t	valid;
21325 } hwrm_func_backing_store_cfg_v2_output_t, *phwrm_func_backing_store_cfg_v2_output_t;
21326 
21327 /***********************************
21328  * hwrm_func_backing_store_qcfg_v2 *
21329  ***********************************/
21330 
21331 
21332 /* hwrm_func_backing_store_qcfg_v2_input (size:192b/24B) */
21333 
21334 typedef struct hwrm_func_backing_store_qcfg_v2_input {
21335 	/* The HWRM command request type. */
21336 	uint16_t	req_type;
21337 	/*
21338 	 * The completion ring to send the completion event on. This should
21339 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21340 	 */
21341 	uint16_t	cmpl_ring;
21342 	/*
21343 	 * The sequence ID is used by the driver for tracking multiple
21344 	 * commands. This ID is treated as opaque data by the firmware and
21345 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21346 	 */
21347 	uint16_t	seq_id;
21348 	/*
21349 	 * The target ID of the command:
21350 	 * * 0x0-0xFFF8 - The function ID
21351 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21352 	 * * 0xFFFD - Reserved for user-space HWRM interface
21353 	 * * 0xFFFF - HWRM
21354 	 */
21355 	uint16_t	target_id;
21356 	/*
21357 	 * A physical address pointer pointing to a host buffer that the
21358 	 * command's response data will be written. This can be either a host
21359 	 * physical address (HPA) or a guest physical address (GPA) and must
21360 	 * point to a physically contiguous block of memory.
21361 	 */
21362 	uint64_t	resp_addr;
21363 	/* Type of backing store to be configured. */
21364 	uint16_t	type;
21365 	/* Queue pair. */
21366 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QP		UINT32_C(0x0)
21367 	/* Shared receive queue. */
21368 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ	UINT32_C(0x1)
21369 	/* Completion queue. */
21370 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
21371 	/* Virtual NIC. */
21372 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_VNIC	UINT32_C(0x3)
21373 	/* Statistic context. */
21374 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_STAT	UINT32_C(0x4)
21375 	/* Slow-path TQM ring. */
21376 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SP_TQM_RING   UINT32_C(0x5)
21377 	/* Fast-path TQM ring. */
21378 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_FP_TQM_RING   UINT32_C(0x6)
21379 	/* Memory Region and Memory Address Vector Context. */
21380 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MRAV	UINT32_C(0xe)
21381 	/* TIM. */
21382 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TIM	UINT32_C(0xf)
21383 	/* Tx key context. */
21384 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TKC	UINT32_C(0x13)
21385 	/* Rx key context. */
21386 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RKC	UINT32_C(0x14)
21387 	/* Mid-path TQM ring. */
21388 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MP_TQM_RING   UINT32_C(0x15)
21389 	/* SQ Doorbell shadow region. */
21390 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SQ_DB_SHADOW  UINT32_C(0x16)
21391 	/* RQ Doorbell shadow region. */
21392 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RQ_DB_SHADOW  UINT32_C(0x17)
21393 	/* SRQ Doorbell shadow region. */
21394 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ_DB_SHADOW UINT32_C(0x18)
21395 	/* CQ Doorbell shadow region. */
21396 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ_DB_SHADOW  UINT32_C(0x19)
21397 	/* QUIC Tx key context. */
21398 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QUIC_TKC	UINT32_C(0x1a)
21399 	/* QUIC Rx key context. */
21400 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QUIC_RKC	UINT32_C(0x1b)
21401 	/* Invalid type. */
21402 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID	UINT32_C(0xffff)
21403 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_LAST	HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID
21404 	/*
21405 	 * Instance of the backing store type. It is zero-based,
21406 	 * which means "0" indicates the first instance. For backing
21407 	 * stores with single instance only, leave this field to 0.
21408 	 */
21409 	uint16_t	instance;
21410 	uint8_t	rsvd[4];
21411 } hwrm_func_backing_store_qcfg_v2_input_t, *phwrm_func_backing_store_qcfg_v2_input_t;
21412 
21413 /* hwrm_func_backing_store_qcfg_v2_output (size:448b/56B) */
21414 
21415 typedef struct hwrm_func_backing_store_qcfg_v2_output {
21416 	/* The specific error status for the command. */
21417 	uint16_t	error_code;
21418 	/* The HWRM command request type. */
21419 	uint16_t	req_type;
21420 	/* The sequence ID from the original command. */
21421 	uint16_t	seq_id;
21422 	/* The length of the response data in number of bytes. */
21423 	uint16_t	resp_len;
21424 	/* Type of backing store to be configured. */
21425 	uint16_t	type;
21426 	/* Queue pair. */
21427 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QP	UINT32_C(0x0)
21428 	/* Shared receive queue. */
21429 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRQ	UINT32_C(0x1)
21430 	/* Completion queue. */
21431 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CQ	UINT32_C(0x2)
21432 	/* Virtual NIC. */
21433 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_VNIC	UINT32_C(0x3)
21434 	/* Statistic context. */
21435 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_STAT	UINT32_C(0x4)
21436 	/* Slow-path TQM ring. */
21437 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SP_TQM_RING UINT32_C(0x5)
21438 	/* Fast-path TQM ring. */
21439 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_FP_TQM_RING UINT32_C(0x6)
21440 	/* Memory Region and Memory Address Vector Context. */
21441 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MRAV	UINT32_C(0xe)
21442 	/* TIM. */
21443 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TIM	UINT32_C(0xf)
21444 	/* Tx key context. */
21445 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TKC	UINT32_C(0x13)
21446 	/* Rx key context. */
21447 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RKC	UINT32_C(0x14)
21448 	/* Mid-path TQM ring. */
21449 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MP_TQM_RING UINT32_C(0x15)
21450 	/* QUIC Tx key context. */
21451 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QUIC_TKC	UINT32_C(0x1a)
21452 	/* QUIC Rx key context. */
21453 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QUIC_RKC	UINT32_C(0x1b)
21454 	/* Invalid type. */
21455 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID	UINT32_C(0xffff)
21456 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_LAST	HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID
21457 	/*
21458 	 * Instance of the backing store type. It is zero-based,
21459 	 * which means "0" indicates the first instance. For backing
21460 	 * stores with single instance only, leave this field to 0.
21461 	 */
21462 	uint16_t	instance;
21463 	/* Control flags. */
21464 	uint32_t	flags;
21465 	/* Page directory. */
21466 	uint64_t	page_dir;
21467 	/* Number of entries */
21468 	uint32_t	num_entries;
21469 	/* Page size and pbl level. */
21470 	uint8_t	page_size_pbl_level;
21471 	/* PBL indirect levels. */
21472 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_MASK  UINT32_C(0xf)
21473 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_SFT   0
21474 	/* PBL pointer is physical start address. */
21475 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_0   UINT32_C(0x0)
21476 	/* PBL pointer points to PTE table. */
21477 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_1   UINT32_C(0x1)
21478 	/*
21479 	 * PBL pointer points to PDE table with each entry pointing to
21480 	 * PTE tables.
21481 	 */
21482 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2   UINT32_C(0x2)
21483 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LAST   HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2
21484 	/* Page size. */
21485 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_MASK  UINT32_C(0xf0)
21486 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_SFT   4
21487 	/* 4KB. */
21488 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21489 	/* 8KB. */
21490 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21491 	/* 64KB. */
21492 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21493 	/* 2MB. */
21494 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21495 	/* 8MB. */
21496 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21497 	/* 1GB. */
21498 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21499 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G
21500 	/*
21501 	 * This field counts how many split entries contain valid data.
21502 	 * Below is the table that maps the count value:
21503 	 * | count |			Indication			|
21504 	 * | ----- | -------------------------------------------------- |
21505 	 * |   0   | None of the split entries has valid data.	|
21506 	 * |   1   | Only "split_entry_0" contains valid data.	|
21507 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
21508 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
21509 	 * |   4   | All four split entries have valid data.		|
21510 	 */
21511 	uint8_t	subtype_valid_cnt;
21512 	uint8_t	rsvd[2];
21513 	/*
21514 	 * Split entry #0. Note that the four split entries (as a group)
21515 	 * must be cast to a type-specific data structure first before
21516 	 * accessing it! Below is the table that maps a backing store
21517 	 * type to the associated split entry casting data structure.
21518 	 * | Type |	Split Entry Casting Data Structure	|
21519 	 * | ---- | -------------------------------------------------- |
21520 	 * | QPC  |		qpc_split_entries			|
21521 	 * | SRQ  |		srq_split_entries			|
21522 	 * | CQ   |		cq_split_entries			|
21523 	 * | VINC |		vnic_split_entries			|
21524 	 * | MRAV |		marv_split_entries			|
21525 	 */
21526 	uint32_t	split_entry_0;
21527 	/* Split entry #1. */
21528 	uint32_t	split_entry_1;
21529 	/* Split entry #2. */
21530 	uint32_t	split_entry_2;
21531 	/* Split entry #3. */
21532 	uint32_t	split_entry_3;
21533 	uint8_t	rsvd2[7];
21534 	/*
21535 	 * This field is used in Output records to indicate that the
21536 	 * output is completely written to RAM.  This field should be
21537 	 * read as '1' to indicate that the output has been completely
21538 	 * written. When writing a command completion or response to
21539 	 * an internal processor, the order of writes has to be such
21540 	 * that this field is written last.
21541 	 */
21542 	uint8_t	valid;
21543 } hwrm_func_backing_store_qcfg_v2_output_t, *phwrm_func_backing_store_qcfg_v2_output_t;
21544 
21545 /* 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 */
21546 /* qpc_split_entries (size:128b/16B) */
21547 
21548 typedef struct qpc_split_entries {
21549 	/* Number of L2 QP backing store entries. */
21550 	uint32_t	qp_num_l2_entries;
21551 	/* Number of QP1 entries. */
21552 	uint32_t	qp_num_qp1_entries;
21553 	uint64_t	rsvd;
21554 } qpc_split_entries_t, *pqpc_split_entries_t;
21555 
21556 /* 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 */
21557 /* srq_split_entries (size:128b/16B) */
21558 
21559 typedef struct srq_split_entries {
21560 	/* Number of L2 SRQ backing store entries. */
21561 	uint32_t	srq_num_l2_entries;
21562 	uint32_t	rsvd;
21563 	uint64_t	rsvd2;
21564 } srq_split_entries_t, *psrq_split_entries_t;
21565 
21566 /* 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 */
21567 /* cq_split_entries (size:128b/16B) */
21568 
21569 typedef struct cq_split_entries {
21570 	/* Number of L2 CQ backing store entries. */
21571 	uint32_t	cq_num_l2_entries;
21572 	uint32_t	rsvd;
21573 	uint64_t	rsvd2;
21574 } cq_split_entries_t, *pcq_split_entries_t;
21575 
21576 /* 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 */
21577 /* vnic_split_entries (size:128b/16B) */
21578 
21579 typedef struct vnic_split_entries {
21580 	/* Number of VNIC backing store entries. */
21581 	uint32_t	vnic_num_vnic_entries;
21582 	uint32_t	rsvd;
21583 	uint64_t	rsvd2;
21584 } vnic_split_entries_t, *pvnic_split_entries_t;
21585 
21586 /* 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 */
21587 /* mrav_split_entries (size:128b/16B) */
21588 
21589 typedef struct mrav_split_entries {
21590 	/* Number of AV backing store entries. */
21591 	uint32_t	mrav_num_av_entries;
21592 	uint32_t	rsvd;
21593 	uint64_t	rsvd2;
21594 } mrav_split_entries_t, *pmrav_split_entries_t;
21595 
21596 /************************************
21597  * hwrm_func_backing_store_qcaps_v2 *
21598  ************************************/
21599 
21600 
21601 /* hwrm_func_backing_store_qcaps_v2_input (size:192b/24B) */
21602 
21603 typedef struct hwrm_func_backing_store_qcaps_v2_input {
21604 	/* The HWRM command request type. */
21605 	uint16_t	req_type;
21606 	/*
21607 	 * The completion ring to send the completion event on. This should
21608 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21609 	 */
21610 	uint16_t	cmpl_ring;
21611 	/*
21612 	 * The sequence ID is used by the driver for tracking multiple
21613 	 * commands. This ID is treated as opaque data by the firmware and
21614 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21615 	 */
21616 	uint16_t	seq_id;
21617 	/*
21618 	 * The target ID of the command:
21619 	 * * 0x0-0xFFF8 - The function ID
21620 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21621 	 * * 0xFFFD - Reserved for user-space HWRM interface
21622 	 * * 0xFFFF - HWRM
21623 	 */
21624 	uint16_t	target_id;
21625 	/*
21626 	 * A physical address pointer pointing to a host buffer that the
21627 	 * command's response data will be written. This can be either a host
21628 	 * physical address (HPA) or a guest physical address (GPA) and must
21629 	 * point to a physically contiguous block of memory.
21630 	 */
21631 	uint64_t	resp_addr;
21632 	/* Type of backing store to be queried. */
21633 	uint16_t	type;
21634 	/* Queue pair. */
21635 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QP		UINT32_C(0x0)
21636 	/* Shared receive queue. */
21637 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ	UINT32_C(0x1)
21638 	/* Completion queue. */
21639 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
21640 	/* Virtual NIC. */
21641 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_VNIC	UINT32_C(0x3)
21642 	/* Statistic context. */
21643 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_STAT	UINT32_C(0x4)
21644 	/* Slow-path TQM ring. */
21645 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SP_TQM_RING   UINT32_C(0x5)
21646 	/* Fast-path TQM ring. */
21647 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_FP_TQM_RING   UINT32_C(0x6)
21648 	/* Memory Region and Memory Address Vector Context. */
21649 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MRAV	UINT32_C(0xe)
21650 	/* TIM. */
21651 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TIM	UINT32_C(0xf)
21652 	/* Tx key context. */
21653 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TKC	UINT32_C(0x13)
21654 	/* Rx key context. */
21655 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RKC	UINT32_C(0x14)
21656 	/* Mid-path TQM ring. */
21657 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MP_TQM_RING   UINT32_C(0x15)
21658 	/* SQ Doorbell shadow region. */
21659 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SQ_DB_SHADOW  UINT32_C(0x16)
21660 	/* RQ Doorbell shadow region. */
21661 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RQ_DB_SHADOW  UINT32_C(0x17)
21662 	/* SRQ Doorbell shadow region. */
21663 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ_DB_SHADOW UINT32_C(0x18)
21664 	/* CQ Doorbell shadow region. */
21665 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ_DB_SHADOW  UINT32_C(0x19)
21666 	/* QUIC Tx key context. */
21667 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QUIC_TKC	UINT32_C(0x1a)
21668 	/* QUIC Rx key context. */
21669 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QUIC_RKC	UINT32_C(0x1b)
21670 	/* Invalid type. */
21671 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID	UINT32_C(0xffff)
21672 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_LAST	HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID
21673 	uint8_t	rsvd[6];
21674 } hwrm_func_backing_store_qcaps_v2_input_t, *phwrm_func_backing_store_qcaps_v2_input_t;
21675 
21676 /* hwrm_func_backing_store_qcaps_v2_output (size:448b/56B) */
21677 
21678 typedef struct hwrm_func_backing_store_qcaps_v2_output {
21679 	/* The specific error status for the command. */
21680 	uint16_t	error_code;
21681 	/* The HWRM command request type. */
21682 	uint16_t	req_type;
21683 	/* The sequence ID from the original command. */
21684 	uint16_t	seq_id;
21685 	/* The length of the response data in number of bytes. */
21686 	uint16_t	resp_len;
21687 	/* Type of backing store to be queried. */
21688 	uint16_t	type;
21689 	/* Queue pair. */
21690 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QP		UINT32_C(0x0)
21691 	/* Shared receive queue. */
21692 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ	UINT32_C(0x1)
21693 	/* Completion queue. */
21694 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ		UINT32_C(0x2)
21695 	/* Virtual NIC. */
21696 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_VNIC	UINT32_C(0x3)
21697 	/* Statistic context. */
21698 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_STAT	UINT32_C(0x4)
21699 	/* Slow-path TQM ring. */
21700 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SP_TQM_RING   UINT32_C(0x5)
21701 	/* Fast-path TQM ring. */
21702 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_FP_TQM_RING   UINT32_C(0x6)
21703 	/* Memory Region and Memory Address Vector Context. */
21704 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MRAV	UINT32_C(0xe)
21705 	/* TIM. */
21706 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TIM	UINT32_C(0xf)
21707 	/* KTLS Tx key context. */
21708 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TKC	UINT32_C(0x13)
21709 	/* KTLS Rx key context. */
21710 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RKC	UINT32_C(0x14)
21711 	/* Mid-path TQM ring. */
21712 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MP_TQM_RING   UINT32_C(0x15)
21713 	/* SQ Doorbell shadow region. */
21714 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SQ_DB_SHADOW  UINT32_C(0x16)
21715 	/* RQ Doorbell shadow region. */
21716 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RQ_DB_SHADOW  UINT32_C(0x17)
21717 	/* SRQ Doorbell shadow region. */
21718 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ_DB_SHADOW UINT32_C(0x18)
21719 	/* CQ Doorbell shadow region. */
21720 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ_DB_SHADOW  UINT32_C(0x19)
21721 	/* QUIC Tx key context. */
21722 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QUIC_TKC	UINT32_C(0x1a)
21723 	/* QUIC Rx key context. */
21724 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QUIC_RKC	UINT32_C(0x1b)
21725 	/* Invalid type. */
21726 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID	UINT32_C(0xffff)
21727 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_LAST	HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID
21728 	/* Number of bytes per backing store entry. */
21729 	uint16_t	entry_size;
21730 	/* Control flags. */
21731 	uint32_t	flags;
21732 	/*
21733 	 * When set, it indicates the context type should be initialized
21734 	 * with the “ctx_init_value” at the specified offset.
21735 	 */
21736 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_ENABLE_CTX_KIND_INIT	UINT32_C(0x1)
21737 	/* When set, it indicates the context type is valid. */
21738 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID		UINT32_C(0x2)
21739 	/*
21740 	 * When set, it indicates the region for this type is not a regular
21741 	 * context memory but a driver managed memory that is created,
21742 	 * initialized and managed by the driver.
21743 	 */
21744 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_DRIVER_MANAGED_MEMORY	UINT32_C(0x4)
21745 	/*
21746 	 * Bit map of the valid instances associated with the
21747 	 * backing store type.
21748 	 * 1. If the backing store type is MPC TQM ring, use the following
21749 	 *	bit to MPC client mapping:
21750 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
21751 	 */
21752 	uint32_t	instance_bit_map;
21753 	/*
21754 	 * Initializer to be used by drivers to initialize context memory
21755 	 * to ensure context subsystem flags an error for an attack before
21756 	 * the first time context load.
21757 	 */
21758 	uint8_t	ctx_init_value;
21759 	/*
21760 	 * Specifies the doubleword offset of ctx_init_value for this
21761 	 * context type.
21762 	 */
21763 	uint8_t	ctx_init_offset;
21764 	/*
21765 	 * Some backing store types, e.g., TQM rings, require the number
21766 	 * of entries to be a multiple of this value to prevent any
21767 	 * resource allocation limitations. If not applicable, leave
21768 	 * this field with "0".
21769 	 */
21770 	uint8_t	entry_multiple;
21771 	uint8_t	rsvd;
21772 	/* Maximum number of backing store entries supported for this type. */
21773 	uint32_t	max_num_entries;
21774 	/*
21775 	 * Minimum number of backing store entries required for this type.
21776 	 * This field is only valid for some backing store types, e.g.,
21777 	 * TQM rings. If not applicable, leave this field with "0".
21778 	 */
21779 	uint32_t	min_num_entries;
21780 	/*
21781 	 * Next valid backing store type. If current type queried is already
21782 	 * the last valid type, firmware must set this field to invalid type.
21783 	 */
21784 	uint16_t	next_valid_type;
21785 	/*
21786 	 * This field counts how many split entries contain valid data.
21787 	 * Below is the table that maps the count value:
21788 	 * | count |			Indication			|
21789 	 * | ----- | -------------------------------------------------- |
21790 	 * |   0   | None of the split entries has valid data.	|
21791 	 * |   1   | Only "split_entry_0" contains valid data.	|
21792 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
21793 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
21794 	 * |   4   | All four split entries have valid data.		|
21795 	 */
21796 	uint8_t	subtype_valid_cnt;
21797 	uint8_t	rsvd2;
21798 	/*
21799 	 * Split entry #0. Note that the four split entries (as a group)
21800 	 * must be cast to a type-specific data structure first before
21801 	 * accessing it! Below is the table that maps a backing store
21802 	 * type to the associated split entry casting data structure.
21803 	 * | Type |	Split Entry Casting Data Structure	|
21804 	 * | ---- | -------------------------------------------------- |
21805 	 * | QPC  |		qpc_split_entries			|
21806 	 * | SRQ  |		srq_split_entries			|
21807 	 * | CQ   |		cq_split_entries			|
21808 	 * | VINC |		vnic_split_entries			|
21809 	 * | MRAV |		marv_split_entries			|
21810 	 */
21811 	uint32_t	split_entry_0;
21812 	/* Split entry #1. */
21813 	uint32_t	split_entry_1;
21814 	/* Split entry #2. */
21815 	uint32_t	split_entry_2;
21816 	/* Split entry #3. */
21817 	uint32_t	split_entry_3;
21818 	uint8_t	rsvd3[3];
21819 	/*
21820 	 * This field is used in Output records to indicate that the
21821 	 * output is completely written to RAM.  This field should be
21822 	 * read as '1' to indicate that the output has been completely
21823 	 * written. When writing a command completion or response to
21824 	 * an internal processor, the order of writes has to be such
21825 	 * that this field is written last.
21826 	 */
21827 	uint8_t	valid;
21828 } hwrm_func_backing_store_qcaps_v2_output_t, *phwrm_func_backing_store_qcaps_v2_output_t;
21829 
21830 /****************************
21831  * hwrm_func_dbr_pacing_cfg *
21832  ****************************/
21833 
21834 
21835 /* hwrm_func_dbr_pacing_cfg_input (size:320b/40B) */
21836 
21837 typedef struct hwrm_func_dbr_pacing_cfg_input {
21838 	/* The HWRM command request type. */
21839 	uint16_t	req_type;
21840 	/*
21841 	 * The completion ring to send the completion event on. This should
21842 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21843 	 */
21844 	uint16_t	cmpl_ring;
21845 	/*
21846 	 * The sequence ID is used by the driver for tracking multiple
21847 	 * commands. This ID is treated as opaque data by the firmware and
21848 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21849 	 */
21850 	uint16_t	seq_id;
21851 	/*
21852 	 * The target ID of the command:
21853 	 * * 0x0-0xFFF8 - The function ID
21854 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21855 	 * * 0xFFFD - Reserved for user-space HWRM interface
21856 	 * * 0xFFFF - HWRM
21857 	 */
21858 	uint16_t	target_id;
21859 	/*
21860 	 * A physical address pointer pointing to a host buffer that the
21861 	 * command's response data will be written. This can be either a host
21862 	 * physical address (HPA) or a guest physical address (GPA) and must
21863 	 * point to a physically contiguous block of memory.
21864 	 */
21865 	uint64_t	resp_addr;
21866 	uint8_t	flags;
21867 	/*
21868 	 * This bit must be '1' to enable DBR NQ events. The NQ ID to
21869 	 * receive the events must be specified in the primary_nq_id
21870 	 * field.
21871 	 */
21872 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_ENABLE	UINT32_C(0x1)
21873 	/* This bit must be '1' to disable DBR NQ events. */
21874 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_DISABLE	UINT32_C(0x2)
21875 	uint8_t	unused_0[7];
21876 	uint32_t	enables;
21877 	/*
21878 	 * This bit must be '1' for the primary_nq_id field to be
21879 	 * configured.
21880 	 */
21881 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PRIMARY_NQ_ID_VALID	UINT32_C(0x1)
21882 	/*
21883 	 * This bit must be '1' for the pacing_threshold field to be
21884 	 * configured.
21885 	 */
21886 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PACING_THRESHOLD_VALID	UINT32_C(0x2)
21887 	/*
21888 	 * Specify primary function’s NQ ID to receive the doorbell pacing
21889 	 * threshold crossing events.
21890 	 */
21891 	uint32_t	primary_nq_id;
21892 	/*
21893 	 * Specify pacing threshold value, as a percentage of the max
21894 	 * doorbell FIFO depth. The range is 1 to 36.
21895 	 */
21896 	uint32_t	pacing_threshold;
21897 	uint8_t	unused_1[4];
21898 } hwrm_func_dbr_pacing_cfg_input_t, *phwrm_func_dbr_pacing_cfg_input_t;
21899 
21900 /* hwrm_func_dbr_pacing_cfg_output (size:128b/16B) */
21901 
21902 typedef struct hwrm_func_dbr_pacing_cfg_output {
21903 	/* The specific error status for the command. */
21904 	uint16_t	error_code;
21905 	/* The HWRM command request type. */
21906 	uint16_t	req_type;
21907 	/* The sequence ID from the original command. */
21908 	uint16_t	seq_id;
21909 	/* The length of the response data in number of bytes. */
21910 	uint16_t	resp_len;
21911 	uint8_t	unused_0[7];
21912 	/*
21913 	 * This field is used in Output records to indicate that the output
21914 	 * is completely written to RAM.  This field should be read as '1'
21915 	 * to indicate that the output has been completely written.
21916 	 * When writing a command completion or response to an internal
21917 	 * processor, the order of writes has to be such that this field is
21918 	 * written last.
21919 	 */
21920 	uint8_t	valid;
21921 } hwrm_func_dbr_pacing_cfg_output_t, *phwrm_func_dbr_pacing_cfg_output_t;
21922 
21923 /*****************************
21924  * hwrm_func_dbr_pacing_qcfg *
21925  *****************************/
21926 
21927 
21928 /* hwrm_func_dbr_pacing_qcfg_input (size:128b/16B) */
21929 
21930 typedef struct hwrm_func_dbr_pacing_qcfg_input {
21931 	/* The HWRM command request type. */
21932 	uint16_t	req_type;
21933 	/*
21934 	 * The completion ring to send the completion event on. This should
21935 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21936 	 */
21937 	uint16_t	cmpl_ring;
21938 	/*
21939 	 * The sequence ID is used by the driver for tracking multiple
21940 	 * commands. This ID is treated as opaque data by the firmware and
21941 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21942 	 */
21943 	uint16_t	seq_id;
21944 	/*
21945 	 * The target ID of the command:
21946 	 * * 0x0-0xFFF8 - The function ID
21947 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21948 	 * * 0xFFFD - Reserved for user-space HWRM interface
21949 	 * * 0xFFFF - HWRM
21950 	 */
21951 	uint16_t	target_id;
21952 	/*
21953 	 * A physical address pointer pointing to a host buffer that the
21954 	 * command's response data will be written. This can be either a host
21955 	 * physical address (HPA) or a guest physical address (GPA) and must
21956 	 * point to a physically contiguous block of memory.
21957 	 */
21958 	uint64_t	resp_addr;
21959 } hwrm_func_dbr_pacing_qcfg_input_t, *phwrm_func_dbr_pacing_qcfg_input_t;
21960 
21961 /* hwrm_func_dbr_pacing_qcfg_output (size:512b/64B) */
21962 
21963 typedef struct hwrm_func_dbr_pacing_qcfg_output {
21964 	/* The specific error status for the command. */
21965 	uint16_t	error_code;
21966 	/* The HWRM command request type. */
21967 	uint16_t	req_type;
21968 	/* The sequence ID from the original command. */
21969 	uint16_t	seq_id;
21970 	/* The length of the response data in number of bytes. */
21971 	uint16_t	resp_len;
21972 	uint8_t	flags;
21973 	/* When this bit is '1', it indicates DBR NQ events are enabled. */
21974 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_FLAGS_DBR_NQ_EVENT_ENABLED	UINT32_C(0x1)
21975 	uint8_t	unused_0[7];
21976 	/*
21977 	 * The Doorbell global FIFO occupancy register. This field should be
21978 	 * used by the driver and user library in the doorbell pacing
21979 	 * algorithm. Lower 2 bits indicates address space location and upper
21980 	 * 30 bits indicates upper 30bits of the register address. A value of
21981 	 * 0xFFFF-FFFF indicates this register does not exist.
21982 	 */
21983 	uint32_t	dbr_stat_db_fifo_reg;
21984 	/* Lower 2 bits indicates address space location. */
21985 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21986 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_SFT	0
21987 	/*
21988 	 * If value is 0, this register is located in PCIe config space.
21989 	 * Drivers have to map appropriate window to access this
21990 	 * register.
21991 	 */
21992 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21993 	/*
21994 	 * If value is 1, this register is located in GRC address space.
21995 	 * Drivers have to map appropriate window to access this
21996 	 * register.
21997 	 */
21998 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21999 	/*
22000 	 * If value is 2, this register is located in first BAR address
22001 	 * space. Drivers have to map appropriate window to access this
22002 	 * register.
22003 	 */
22004 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
22005 	/*
22006 	 * If value is 3, this register is located in second BAR address
22007 	 * space. Drivers have to map appropriate window to access this
22008 	 * Drivers have to map appropriate window to access this
22009 	 * register.
22010 	 */
22011 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
22012 		#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
22013 	/* Upper 30bits of the register address. */
22014 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_MASK	UINT32_C(0xfffffffc)
22015 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SFT	2
22016 	/*
22017 	 * This field indicates the mask value for dbr_stat_db_fifo_reg
22018 	 * to get the high watermark for doorbell FIFO.
22019 	 */
22020 	uint32_t	dbr_stat_db_fifo_reg_watermark_mask;
22021 	/*
22022 	 * This field indicates the shift value for dbr_stat_db_fifo_reg
22023 	 * to get the high watermark for doorbell FIFO.
22024 	 */
22025 	uint8_t	dbr_stat_db_fifo_reg_watermark_shift;
22026 	uint8_t	unused_1[3];
22027 	/*
22028 	 * This field indicates the mask value for dbr_stat_db_fifo_reg
22029 	 * to get the amount of room left for doorbell FIFO.
22030 	 */
22031 	uint32_t	dbr_stat_db_fifo_reg_fifo_room_mask;
22032 	/*
22033 	 * This field indicates the shift value for dbr_stat_db_fifo_reg
22034 	 * to get the amount of room left for doorbell FIFO.
22035 	 */
22036 	uint8_t	dbr_stat_db_fifo_reg_fifo_room_shift;
22037 	uint8_t	unused_2[3];
22038 	/*
22039 	 * DBR_REG_AEQ_ARM register. This field should be used by the driver
22040 	 * to rearm the interrupt for regeneration of a notification to the
22041 	 * host from the hardware when the global doorbell occupancy threshold
22042 	 * is above the threshold value. Lower 2 bits indicates address space
22043 	 * location and upper 30 bits indicates upper 30bits of the register
22044 	 * address. A value of 0xFFFF-FFFF indicates this register does not
22045 	 * exist.
22046 	 */
22047 	uint32_t	dbr_throttling_aeq_arm_reg;
22048 	/* Lower 2 bits indicates address space location. */
22049 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
22050 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_SFT	0
22051 	/*
22052 	 * If value is 0, this register is located in PCIe config space.
22053 	 * Drivers have to map appropriate window to access this
22054 	 * register.
22055 	 */
22056 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
22057 	/*
22058 	 * If value is 1, this register is located in GRC address space.
22059 	 * Drivers have to map appropriate window to access this
22060 	 * register.
22061 	 */
22062 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
22063 	/*
22064 	 * If value is 2, this register is located in first BAR address
22065 	 * space. Drivers have to map appropriate window to access this
22066 	 * register.
22067 	 */
22068 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
22069 	/*
22070 	 * If value is 3, this register is located in second BAR address
22071 	 * space. Drivers have to map appropriate window to access this
22072 	 * Drivers have to map appropriate window to access this
22073 	 * register.
22074 	 */
22075 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
22076 		#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
22077 	/* Upper 30bits of the register address. */
22078 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_MASK	UINT32_C(0xfffffffc)
22079 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SFT	2
22080 	/*
22081 	 * This field indicates the value to be written for
22082 	 * dbr_throttling_aeq_arm_reg register.
22083 	 */
22084 	uint8_t	dbr_throttling_aeq_arm_reg_val;
22085 	uint8_t	unused_3[3];
22086 	uint32_t dbr_stat_db_max_fifo_depth;
22087 	/*
22088 	 * Specifies primary function’s NQ ID.
22089 	 * A value of 0xFFFF FFFF indicates NQ ID is invalid.
22090 	 */
22091 	uint32_t	primary_nq_id;
22092 	/*
22093 	 * Specifies the pacing threshold value, as a percentage of the
22094 	 * max doorbell FIFO depth. The range is 1 to 100.
22095 	 */
22096 	uint32_t	pacing_threshold;
22097 	uint8_t	unused_4[7];
22098 	/*
22099 	 * This field is used in Output records to indicate that the output
22100 	 * is completely written to RAM.  This field should be read as '1'
22101 	 * to indicate that the output has been completely written.
22102 	 * When writing a command completion or response to an internal
22103 	 * processor, the order of writes has to be such that this field is
22104 	 * written last.
22105 	 */
22106 	uint8_t	valid;
22107 } hwrm_func_dbr_pacing_qcfg_output_t, *phwrm_func_dbr_pacing_qcfg_output_t;
22108 
22109 /****************************************
22110  * hwrm_func_dbr_pacing_broadcast_event *
22111  ****************************************/
22112 
22113 
22114 /* hwrm_func_dbr_pacing_broadcast_event_input (size:128b/16B) */
22115 
22116 typedef struct hwrm_func_dbr_pacing_broadcast_event_input {
22117 	/* The HWRM command request type. */
22118 	uint16_t	req_type;
22119 	/*
22120 	 * The completion ring to send the completion event on. This should
22121 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22122 	 */
22123 	uint16_t	cmpl_ring;
22124 	/*
22125 	 * The sequence ID is used by the driver for tracking multiple
22126 	 * commands. This ID is treated as opaque data by the firmware and
22127 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22128 	 */
22129 	uint16_t	seq_id;
22130 	/*
22131 	 * The target ID of the command:
22132 	 * * 0x0-0xFFF8 - The function ID
22133 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22134 	 * * 0xFFFD - Reserved for user-space HWRM interface
22135 	 * * 0xFFFF - HWRM
22136 	 */
22137 	uint16_t	target_id;
22138 	/*
22139 	 * A physical address pointer pointing to a host buffer that the
22140 	 * command's response data will be written. This can be either a host
22141 	 * physical address (HPA) or a guest physical address (GPA) and must
22142 	 * point to a physically contiguous block of memory.
22143 	 */
22144 	uint64_t	resp_addr;
22145 } hwrm_func_dbr_pacing_broadcast_event_input_t, *phwrm_func_dbr_pacing_broadcast_event_input_t;
22146 
22147 /* hwrm_func_dbr_pacing_broadcast_event_output (size:128b/16B) */
22148 
22149 typedef struct hwrm_func_dbr_pacing_broadcast_event_output {
22150 	/* The specific error status for the command. */
22151 	uint16_t	error_code;
22152 	/* The HWRM command request type. */
22153 	uint16_t	req_type;
22154 	/* The sequence ID from the original command. */
22155 	uint16_t	seq_id;
22156 	/* The length of the response data in number of bytes. */
22157 	uint16_t	resp_len;
22158 	uint8_t	unused_0[7];
22159 	/*
22160 	 * This field is used in Output records to indicate that the output
22161 	 * is completely written to RAM.  This field should be read as '1'
22162 	 * to indicate that the output has been completely written.
22163 	 * When writing a command completion or response to an internal
22164 	 * processor, the order of writes has to be such that this field is
22165 	 * written last.
22166 	 */
22167 	uint8_t	valid;
22168 } hwrm_func_dbr_pacing_broadcast_event_output_t, *phwrm_func_dbr_pacing_broadcast_event_output_t;
22169 
22170 /*************************************
22171  * hwrm_func_dbr_pacing_nqlist_query *
22172  *************************************/
22173 
22174 
22175 /* hwrm_func_dbr_pacing_nqlist_query_input (size:128b/16B) */
22176 
22177 typedef struct hwrm_func_dbr_pacing_nqlist_query_input {
22178 	/* The HWRM command request type. */
22179 	uint16_t	req_type;
22180 	/*
22181 	 * The completion ring to send the completion event on. This should
22182 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22183 	 */
22184 	uint16_t	cmpl_ring;
22185 	/*
22186 	 * The sequence ID is used by the driver for tracking multiple
22187 	 * commands. This ID is treated as opaque data by the firmware and
22188 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22189 	 */
22190 	uint16_t	seq_id;
22191 	/*
22192 	 * The target ID of the command:
22193 	 * * 0x0-0xFFF8 - The function ID
22194 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22195 	 * * 0xFFFD - Reserved for user-space HWRM interface
22196 	 * * 0xFFFF - HWRM
22197 	 */
22198 	uint16_t	target_id;
22199 	/*
22200 	 * A physical address pointer pointing to a host buffer that the
22201 	 * command's response data will be written. This can be either a host
22202 	 * physical address (HPA) or a guest physical address (GPA) and must
22203 	 * point to a physically contiguous block of memory.
22204 	 */
22205 	uint64_t	resp_addr;
22206 } hwrm_func_dbr_pacing_nqlist_query_input_t, *phwrm_func_dbr_pacing_nqlist_query_input_t;
22207 
22208 /* hwrm_func_dbr_pacing_nqlist_query_output (size:384b/48B) */
22209 
22210 typedef struct hwrm_func_dbr_pacing_nqlist_query_output {
22211 	/* The specific error status for the command. */
22212 	uint16_t	error_code;
22213 	/* The HWRM command request type. */
22214 	uint16_t	req_type;
22215 	/* The sequence ID from the original command. */
22216 	uint16_t	seq_id;
22217 	/* The length of the response data in number of bytes. */
22218 	uint16_t	resp_len;
22219 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22220 	uint16_t	nq_ring_id0;
22221 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22222 	uint16_t	nq_ring_id1;
22223 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22224 	uint16_t	nq_ring_id2;
22225 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22226 	uint16_t	nq_ring_id3;
22227 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22228 	uint16_t	nq_ring_id4;
22229 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22230 	uint16_t	nq_ring_id5;
22231 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22232 	uint16_t	nq_ring_id6;
22233 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22234 	uint16_t	nq_ring_id7;
22235 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22236 	uint16_t	nq_ring_id8;
22237 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22238 	uint16_t	nq_ring_id9;
22239 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22240 	uint16_t	nq_ring_id10;
22241 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22242 	uint16_t	nq_ring_id11;
22243 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22244 	uint16_t	nq_ring_id12;
22245 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22246 	uint16_t	nq_ring_id13;
22247 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22248 	uint16_t	nq_ring_id14;
22249 	/* ID of an NQ ring allocated for DBR pacing notifications. */
22250 	uint16_t	nq_ring_id15;
22251 	/* Number of consecutive NQ ring IDs populated in the response. */
22252 	uint32_t	num_nqs;
22253 	uint8_t	unused_0[3];
22254 	/*
22255 	 * This field is used in Output records to indicate that the output
22256 	 * is completely written to RAM.  This field should be read as '1'
22257 	 * to indicate that the output has been completely written.
22258 	 * When writing a command completion or response to an internal processor,
22259 	 * the order of writes has to be such that this field is written last.
22260 	 */
22261 	uint8_t	valid;
22262 } hwrm_func_dbr_pacing_nqlist_query_output_t, *phwrm_func_dbr_pacing_nqlist_query_output_t;
22263 
22264 /************************************
22265  * hwrm_func_dbr_recovery_completed *
22266  ************************************/
22267 
22268 
22269 /* hwrm_func_dbr_recovery_completed_input (size:192b/24B) */
22270 
22271 typedef struct hwrm_func_dbr_recovery_completed_input {
22272 	/* The HWRM command request type. */
22273 	uint16_t	req_type;
22274 	/*
22275 	 * The completion ring to send the completion event on. This should
22276 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22277 	 */
22278 	uint16_t	cmpl_ring;
22279 	/*
22280 	 * The sequence ID is used by the driver for tracking multiple
22281 	 * commands. This ID is treated as opaque data by the firmware and
22282 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22283 	 */
22284 	uint16_t	seq_id;
22285 	/*
22286 	 * The target ID of the command:
22287 	 * * 0x0-0xFFF8 - The function ID
22288 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22289 	 * * 0xFFFD - Reserved for user-space HWRM interface
22290 	 * * 0xFFFF - HWRM
22291 	 */
22292 	uint16_t	target_id;
22293 	/*
22294 	 * A physical address pointer pointing to a host buffer that the
22295 	 * command's response data will be written. This can be either a host
22296 	 * physical address (HPA) or a guest physical address (GPA) and must
22297 	 * point to a physically contiguous block of memory.
22298 	 */
22299 	uint64_t	resp_addr;
22300 	/*
22301 	 * Specifies the epoch value with the one that was specified by the
22302 	 * firmware in the error_report_doorbell_drop_threshold async event
22303 	 * corresponding to the specific recovery cycle.
22304 	 */
22305 	uint32_t	epoch;
22306 	/* The epoch value. */
22307 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED_INPUT_EPOCH_VALUE_MASK UINT32_C(0xffffff)
22308 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED_INPUT_EPOCH_VALUE_SFT 0
22309 	uint8_t	unused_0[4];
22310 } hwrm_func_dbr_recovery_completed_input_t, *phwrm_func_dbr_recovery_completed_input_t;
22311 
22312 /* hwrm_func_dbr_recovery_completed_output (size:128b/16B) */
22313 
22314 typedef struct hwrm_func_dbr_recovery_completed_output {
22315 	/* The specific error status for the command. */
22316 	uint16_t	error_code;
22317 	/* The HWRM command request type. */
22318 	uint16_t	req_type;
22319 	/* The sequence ID from the original command. */
22320 	uint16_t	seq_id;
22321 	/* The length of the response data in number of bytes. */
22322 	uint16_t	resp_len;
22323 	uint8_t	unused_0[7];
22324 	/*
22325 	 * This field is used in Output records to indicate that the output
22326 	 * is completely written to RAM.  This field should be read as '1'
22327 	 * to indicate that the output has been completely written.
22328 	 * When writing a command completion or response to an internal
22329 	 * processor, the order of writes has to be such that this field is
22330 	 * written last.
22331 	 */
22332 	uint8_t	valid;
22333 } hwrm_func_dbr_recovery_completed_output_t, *phwrm_func_dbr_recovery_completed_output_t;
22334 
22335 /***********************
22336  * hwrm_func_synce_cfg *
22337  ***********************/
22338 
22339 
22340 /* hwrm_func_synce_cfg_input (size:192b/24B) */
22341 
22342 typedef struct hwrm_func_synce_cfg_input {
22343 	/* The HWRM command request type. */
22344 	uint16_t	req_type;
22345 	/*
22346 	 * The completion ring to send the completion event on. This should
22347 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22348 	 */
22349 	uint16_t	cmpl_ring;
22350 	/*
22351 	 * The sequence ID is used by the driver for tracking multiple
22352 	 * commands. This ID is treated as opaque data by the firmware and
22353 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22354 	 */
22355 	uint16_t	seq_id;
22356 	/*
22357 	 * The target ID of the command:
22358 	 * * 0x0-0xFFF8 - The function ID
22359 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22360 	 * * 0xFFFD - Reserved for user-space HWRM interface
22361 	 * * 0xFFFF - HWRM
22362 	 */
22363 	uint16_t	target_id;
22364 	/*
22365 	 * A physical address pointer pointing to a host buffer that the
22366 	 * command's response data will be written. This can be either a host
22367 	 * physical address (HPA) or a guest physical address (GPA) and must
22368 	 * point to a physically contiguous block of memory.
22369 	 */
22370 	uint64_t	resp_addr;
22371 	uint8_t	enables;
22372 	/*
22373 	 * This bit must be '1' for the freq_profile field to be
22374 	 * configured.
22375 	 */
22376 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_FREQ_PROFILE	UINT32_C(0x1)
22377 	/*
22378 	 * This bit must be '1' for the primary_clock_state field to be
22379 	 * configured.
22380 	 */
22381 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_PRIMARY_CLOCK	UINT32_C(0x2)
22382 	/*
22383 	 * This bit must be '1' for the secondary_clock_state field to be
22384 	 * configured.
22385 	 */
22386 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_SECONDARY_CLOCK	UINT32_C(0x4)
22387 	/* Frequency profile for SyncE recovered clock. */
22388 	uint8_t	freq_profile;
22389 	/* Invalid frequency profile */
22390 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_INVALID UINT32_C(0x0)
22391 	/* 25MHz SyncE clock profile */
22392 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_25MHZ   UINT32_C(0x1)
22393 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_25MHZ
22394 	/*
22395 	 * Enable or disable primary clock for PF/port, overriding previous
22396 	 * primary clock setting.
22397 	 */
22398 	uint8_t	primary_clock_state;
22399 	/* Disable clock */
22400 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_DISABLE UINT32_C(0x0)
22401 	/* Enable clock */
22402 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_ENABLE  UINT32_C(0x1)
22403 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_ENABLE
22404 	/*
22405 	 * Enable or disable secondary clock for PF/port, overriding previous
22406 	 * secondary clock setting.
22407 	 */
22408 	uint8_t	secondary_clock_state;
22409 	/* Clock disabled */
22410 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_DISABLE UINT32_C(0x0)
22411 	/* Clock enabled */
22412 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_ENABLE  UINT32_C(0x1)
22413 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_ENABLE
22414 	uint8_t	unused_0[4];
22415 } hwrm_func_synce_cfg_input_t, *phwrm_func_synce_cfg_input_t;
22416 
22417 /* hwrm_func_synce_cfg_output (size:128b/16B) */
22418 
22419 typedef struct hwrm_func_synce_cfg_output {
22420 	/* The specific error status for the command. */
22421 	uint16_t	error_code;
22422 	/* The HWRM command request type. */
22423 	uint16_t	req_type;
22424 	/* The sequence ID from the original command. */
22425 	uint16_t	seq_id;
22426 	/* The length of the response data in number of bytes. */
22427 	uint16_t	resp_len;
22428 	uint8_t	unused_0[7];
22429 	/*
22430 	 * This field is used in Output records to indicate that the output
22431 	 * is completely written to RAM.  This field should be read as '1'
22432 	 * to indicate that the output has been completely written.
22433 	 * When writing a command completion or response to an internal processor,
22434 	 * the order of writes has to be such that this field is written last.
22435 	 */
22436 	uint8_t	valid;
22437 } hwrm_func_synce_cfg_output_t, *phwrm_func_synce_cfg_output_t;
22438 
22439 /************************
22440  * hwrm_func_synce_qcfg *
22441  ************************/
22442 
22443 
22444 /* hwrm_func_synce_qcfg_input (size:192b/24B) */
22445 
22446 typedef struct hwrm_func_synce_qcfg_input {
22447 	/* The HWRM command request type. */
22448 	uint16_t	req_type;
22449 	/*
22450 	 * The completion ring to send the completion event on. This should
22451 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22452 	 */
22453 	uint16_t	cmpl_ring;
22454 	/*
22455 	 * The sequence ID is used by the driver for tracking multiple
22456 	 * commands. This ID is treated as opaque data by the firmware and
22457 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22458 	 */
22459 	uint16_t	seq_id;
22460 	/*
22461 	 * The target ID of the command:
22462 	 * * 0x0-0xFFF8 - The function ID
22463 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22464 	 * * 0xFFFD - Reserved for user-space HWRM interface
22465 	 * * 0xFFFF - HWRM
22466 	 */
22467 	uint16_t	target_id;
22468 	/*
22469 	 * A physical address pointer pointing to a host buffer that the
22470 	 * command's response data will be written. This can be either a host
22471 	 * physical address (HPA) or a guest physical address (GPA) and must
22472 	 * point to a physically contiguous block of memory.
22473 	 */
22474 	uint64_t	resp_addr;
22475 	uint8_t	unused_0[8];
22476 } hwrm_func_synce_qcfg_input_t, *phwrm_func_synce_qcfg_input_t;
22477 
22478 /* hwrm_func_synce_qcfg_output (size:128b/16B) */
22479 
22480 typedef struct hwrm_func_synce_qcfg_output {
22481 	/* The specific error status for the command. */
22482 	uint16_t	error_code;
22483 	/* The HWRM command request type. */
22484 	uint16_t	req_type;
22485 	/* The sequence ID from the original command. */
22486 	uint16_t	seq_id;
22487 	/* The length of the response data in number of bytes. */
22488 	uint16_t	resp_len;
22489 	/* Frequency profile for SyncE recovered clock. */
22490 	uint8_t	freq_profile;
22491 	/* Invalid frequency profile */
22492 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_INVALID UINT32_C(0x0)
22493 	/* 25MHz SyncE clock profile */
22494 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_25MHZ   UINT32_C(0x1)
22495 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_LAST   HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_25MHZ
22496 	/* SyncE recovered clock state */
22497 	uint8_t	state;
22498 	/*
22499 	 * When this bit is '1', primary clock is enabled for this PF/port.
22500 	 * When this bit is '0', primary clock is disabled for this PF/port.
22501 	 */
22502 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_STATE_PRIMARY_CLOCK_ENABLED	UINT32_C(0x1)
22503 	/*
22504 	 * When this bit is '1', secondary clock is enabled for this
22505 	 * PF/port.
22506 	 * When this bit is '0', secondary clock is disabled for this
22507 	 * PF/port.
22508 	 */
22509 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_STATE_SECONDARY_CLOCK_ENABLED	UINT32_C(0x2)
22510 	uint8_t	unused_0[5];
22511 	/*
22512 	 * This field is used in Output records to indicate that the output
22513 	 * is completely written to RAM.  This field should be read as '1'
22514 	 * to indicate that the output has been completely written.
22515 	 * When writing a command completion or response to an internal processor,
22516 	 * the order of writes has to be such that this field is written last.
22517 	 */
22518 	uint8_t	valid;
22519 } hwrm_func_synce_qcfg_output_t, *phwrm_func_synce_qcfg_output_t;
22520 
22521 /***********************
22522  * hwrm_func_vlan_qcfg *
22523  ***********************/
22524 
22525 
22526 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
22527 
22528 typedef struct hwrm_func_vlan_qcfg_input {
22529 	/* The HWRM command request type. */
22530 	uint16_t	req_type;
22531 	/*
22532 	 * The completion ring to send the completion event on. This should
22533 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22534 	 */
22535 	uint16_t	cmpl_ring;
22536 	/*
22537 	 * The sequence ID is used by the driver for tracking multiple
22538 	 * commands. This ID is treated as opaque data by the firmware and
22539 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22540 	 */
22541 	uint16_t	seq_id;
22542 	/*
22543 	 * The target ID of the command:
22544 	 * * 0x0-0xFFF8 - The function ID
22545 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22546 	 * * 0xFFFD - Reserved for user-space HWRM interface
22547 	 * * 0xFFFF - HWRM
22548 	 */
22549 	uint16_t	target_id;
22550 	/*
22551 	 * A physical address pointer pointing to a host buffer that the
22552 	 * command's response data will be written. This can be either a host
22553 	 * physical address (HPA) or a guest physical address (GPA) and must
22554 	 * point to a physically contiguous block of memory.
22555 	 */
22556 	uint64_t	resp_addr;
22557 	/*
22558 	 * Function ID of the function that is being
22559 	 * configured.
22560 	 * If set to 0xFF... (All Fs), then the configuration is
22561 	 * for the requesting function.
22562 	 */
22563 	uint16_t	fid;
22564 	uint8_t	unused_0[6];
22565 } hwrm_func_vlan_qcfg_input_t, *phwrm_func_vlan_qcfg_input_t;
22566 
22567 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
22568 
22569 typedef struct hwrm_func_vlan_qcfg_output {
22570 	/* The specific error status for the command. */
22571 	uint16_t	error_code;
22572 	/* The HWRM command request type. */
22573 	uint16_t	req_type;
22574 	/* The sequence ID from the original command. */
22575 	uint16_t	seq_id;
22576 	/* The length of the response data in number of bytes. */
22577 	uint16_t	resp_len;
22578 	uint64_t	unused_0;
22579 	/* S-TAG VLAN identifier configured for the function. */
22580 	uint16_t	stag_vid;
22581 	/* S-TAG PCP value configured for the function. */
22582 	uint8_t	stag_pcp;
22583 	uint8_t	unused_1;
22584 	/*
22585 	 * S-TAG TPID value configured for the function. This field is specified in
22586 	 * network byte order.
22587 	 */
22588 	uint16_t	stag_tpid;
22589 	/* C-TAG VLAN identifier configured for the function. */
22590 	uint16_t	ctag_vid;
22591 	/* C-TAG PCP value configured for the function. */
22592 	uint8_t	ctag_pcp;
22593 	uint8_t	unused_2;
22594 	/*
22595 	 * C-TAG TPID value configured for the function. This field is specified in
22596 	 * network byte order.
22597 	 */
22598 	uint16_t	ctag_tpid;
22599 	/* Future use. */
22600 	uint32_t	rsvd2;
22601 	/* Future use. */
22602 	uint32_t	rsvd3;
22603 	uint8_t	unused_3[3];
22604 	/*
22605 	 * This field is used in Output records to indicate that the output
22606 	 * is completely written to RAM.  This field should be read as '1'
22607 	 * to indicate that the output has been completely written.
22608 	 * When writing a command completion or response to an internal processor,
22609 	 * the order of writes has to be such that this field is written last.
22610 	 */
22611 	uint8_t	valid;
22612 } hwrm_func_vlan_qcfg_output_t, *phwrm_func_vlan_qcfg_output_t;
22613 
22614 /**********************
22615  * hwrm_func_vlan_cfg *
22616  **********************/
22617 
22618 
22619 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
22620 
22621 typedef struct hwrm_func_vlan_cfg_input {
22622 	/* The HWRM command request type. */
22623 	uint16_t	req_type;
22624 	/*
22625 	 * The completion ring to send the completion event on. This should
22626 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22627 	 */
22628 	uint16_t	cmpl_ring;
22629 	/*
22630 	 * The sequence ID is used by the driver for tracking multiple
22631 	 * commands. This ID is treated as opaque data by the firmware and
22632 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22633 	 */
22634 	uint16_t	seq_id;
22635 	/*
22636 	 * The target ID of the command:
22637 	 * * 0x0-0xFFF8 - The function ID
22638 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22639 	 * * 0xFFFD - Reserved for user-space HWRM interface
22640 	 * * 0xFFFF - HWRM
22641 	 */
22642 	uint16_t	target_id;
22643 	/*
22644 	 * A physical address pointer pointing to a host buffer that the
22645 	 * command's response data will be written. This can be either a host
22646 	 * physical address (HPA) or a guest physical address (GPA) and must
22647 	 * point to a physically contiguous block of memory.
22648 	 */
22649 	uint64_t	resp_addr;
22650 	/*
22651 	 * Function ID of the function that is being
22652 	 * configured.
22653 	 * If set to 0xFF... (All Fs), then the configuration is
22654 	 * for the requesting function.
22655 	 */
22656 	uint16_t	fid;
22657 	uint8_t	unused_0[2];
22658 	uint32_t	enables;
22659 	/*
22660 	 * This bit must be '1' for the stag_vid field to be
22661 	 * configured.
22662 	 */
22663 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID	UINT32_C(0x1)
22664 	/*
22665 	 * This bit must be '1' for the ctag_vid field to be
22666 	 * configured.
22667 	 */
22668 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID	UINT32_C(0x2)
22669 	/*
22670 	 * This bit must be '1' for the stag_pcp field to be
22671 	 * configured.
22672 	 */
22673 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP	UINT32_C(0x4)
22674 	/*
22675 	 * This bit must be '1' for the ctag_pcp field to be
22676 	 * configured.
22677 	 */
22678 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP	UINT32_C(0x8)
22679 	/*
22680 	 * This bit must be '1' for the stag_tpid field to be
22681 	 * configured.
22682 	 */
22683 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID	UINT32_C(0x10)
22684 	/*
22685 	 * This bit must be '1' for the ctag_tpid field to be
22686 	 * configured.
22687 	 */
22688 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID	UINT32_C(0x20)
22689 	/* S-TAG VLAN identifier configured for the function. */
22690 	uint16_t	stag_vid;
22691 	/* S-TAG PCP value configured for the function. */
22692 	uint8_t	stag_pcp;
22693 	uint8_t	unused_1;
22694 	/*
22695 	 * S-TAG TPID value configured for the function. This field is specified in
22696 	 * network byte order.
22697 	 */
22698 	uint16_t	stag_tpid;
22699 	/* C-TAG VLAN identifier configured for the function. */
22700 	uint16_t	ctag_vid;
22701 	/* C-TAG PCP value configured for the function. */
22702 	uint8_t	ctag_pcp;
22703 	uint8_t	unused_2;
22704 	/*
22705 	 * C-TAG TPID value configured for the function. This field is specified in
22706 	 * network byte order.
22707 	 */
22708 	uint16_t	ctag_tpid;
22709 	/* Future use. */
22710 	uint32_t	rsvd1;
22711 	/* Future use. */
22712 	uint32_t	rsvd2;
22713 	uint8_t	unused_3[4];
22714 } hwrm_func_vlan_cfg_input_t, *phwrm_func_vlan_cfg_input_t;
22715 
22716 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
22717 
22718 typedef struct hwrm_func_vlan_cfg_output {
22719 	/* The specific error status for the command. */
22720 	uint16_t	error_code;
22721 	/* The HWRM command request type. */
22722 	uint16_t	req_type;
22723 	/* The sequence ID from the original command. */
22724 	uint16_t	seq_id;
22725 	/* The length of the response data in number of bytes. */
22726 	uint16_t	resp_len;
22727 	uint8_t	unused_0[7];
22728 	/*
22729 	 * This field is used in Output records to indicate that the output
22730 	 * is completely written to RAM.  This field should be read as '1'
22731 	 * to indicate that the output has been completely written.
22732 	 * When writing a command completion or response to an internal processor,
22733 	 * the order of writes has to be such that this field is written last.
22734 	 */
22735 	uint8_t	valid;
22736 } hwrm_func_vlan_cfg_output_t, *phwrm_func_vlan_cfg_output_t;
22737 
22738 /*******************************
22739  * hwrm_func_vf_vnic_ids_query *
22740  *******************************/
22741 
22742 
22743 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
22744 
22745 typedef struct hwrm_func_vf_vnic_ids_query_input {
22746 	/* The HWRM command request type. */
22747 	uint16_t	req_type;
22748 	/*
22749 	 * The completion ring to send the completion event on. This should
22750 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22751 	 */
22752 	uint16_t	cmpl_ring;
22753 	/*
22754 	 * The sequence ID is used by the driver for tracking multiple
22755 	 * commands. This ID is treated as opaque data by the firmware and
22756 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22757 	 */
22758 	uint16_t	seq_id;
22759 	/*
22760 	 * The target ID of the command:
22761 	 * * 0x0-0xFFF8 - The function ID
22762 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22763 	 * * 0xFFFD - Reserved for user-space HWRM interface
22764 	 * * 0xFFFF - HWRM
22765 	 */
22766 	uint16_t	target_id;
22767 	/*
22768 	 * A physical address pointer pointing to a host buffer that the
22769 	 * command's response data will be written. This can be either a host
22770 	 * physical address (HPA) or a guest physical address (GPA) and must
22771 	 * point to a physically contiguous block of memory.
22772 	 */
22773 	uint64_t	resp_addr;
22774 	/*
22775 	 * This value is used to identify a Virtual Function (VF).
22776 	 * The scope of VF ID is local within a PF.
22777 	 */
22778 	uint16_t	vf_id;
22779 	uint8_t	unused_0[2];
22780 	/* Max number of vnic ids in vnic id table */
22781 	uint32_t	max_vnic_id_cnt;
22782 	/* This is the address for VF VNIC ID table */
22783 	uint64_t	vnic_id_tbl_addr;
22784 } hwrm_func_vf_vnic_ids_query_input_t, *phwrm_func_vf_vnic_ids_query_input_t;
22785 
22786 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
22787 
22788 typedef struct hwrm_func_vf_vnic_ids_query_output {
22789 	/* The specific error status for the command. */
22790 	uint16_t	error_code;
22791 	/* The HWRM command request type. */
22792 	uint16_t	req_type;
22793 	/* The sequence ID from the original command. */
22794 	uint16_t	seq_id;
22795 	/* The length of the response data in number of bytes. */
22796 	uint16_t	resp_len;
22797 	/*
22798 	 * Actual number of vnic ids
22799 	 *
22800 	 * Each VNIC ID is written as a 32-bit number.
22801 	 */
22802 	uint32_t	vnic_id_cnt;
22803 	uint8_t	unused_0[3];
22804 	/*
22805 	 * This field is used in Output records to indicate that the output
22806 	 * is completely written to RAM.  This field should be read as '1'
22807 	 * to indicate that the output has been completely written.
22808 	 * When writing a command completion or response to an internal processor,
22809 	 * the order of writes has to be such that this field is written last.
22810 	 */
22811 	uint8_t	valid;
22812 } hwrm_func_vf_vnic_ids_query_output_t, *phwrm_func_vf_vnic_ids_query_output_t;
22813 
22814 /***********************
22815  * hwrm_func_vf_bw_cfg *
22816  ***********************/
22817 
22818 
22819 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
22820 
22821 typedef struct hwrm_func_vf_bw_cfg_input {
22822 	/* The HWRM command request type. */
22823 	uint16_t	req_type;
22824 	/*
22825 	 * The completion ring to send the completion event on. This should
22826 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22827 	 */
22828 	uint16_t	cmpl_ring;
22829 	/*
22830 	 * The sequence ID is used by the driver for tracking multiple
22831 	 * commands. This ID is treated as opaque data by the firmware and
22832 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22833 	 */
22834 	uint16_t	seq_id;
22835 	/*
22836 	 * The target ID of the command:
22837 	 * * 0x0-0xFFF8 - The function ID
22838 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22839 	 * * 0xFFFD - Reserved for user-space HWRM interface
22840 	 * * 0xFFFF - HWRM
22841 	 */
22842 	uint16_t	target_id;
22843 	/*
22844 	 * A physical address pointer pointing to a host buffer that the
22845 	 * command's response data will be written. This can be either a host
22846 	 * physical address (HPA) or a guest physical address (GPA) and must
22847 	 * point to a physically contiguous block of memory.
22848 	 */
22849 	uint64_t	resp_addr;
22850 	/*
22851 	 * The number of VF functions that are being configured.
22852 	 * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
22853 	 */
22854 	uint16_t	num_vfs;
22855 	uint16_t	unused[3];
22856 	/* These 16-bit fields contain the VF fid and the rate scale percentage. */
22857 	uint16_t	vfn[48];
22858 	/* The physical VF id the adjustment will be made to. */
22859 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK	UINT32_C(0xfff)
22860 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT	0
22861 	/*
22862 	 * This field configures the rate scale percentage of the VF as specified
22863 	 * by the physical VF id.
22864 	 */
22865 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK	UINT32_C(0xf000)
22866 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT	12
22867 	/* 0% of the max tx rate */
22868 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0	(UINT32_C(0x0) << 12)
22869 	/* 6.66% of the max tx rate */
22870 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66   (UINT32_C(0x1) << 12)
22871 	/* 13.33% of the max tx rate */
22872 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33  (UINT32_C(0x2) << 12)
22873 	/* 20% of the max tx rate */
22874 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20	(UINT32_C(0x3) << 12)
22875 	/* 26.66% of the max tx rate */
22876 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66  (UINT32_C(0x4) << 12)
22877 	/* 33% of the max tx rate */
22878 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33  (UINT32_C(0x5) << 12)
22879 	/* 40% of the max tx rate */
22880 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40	(UINT32_C(0x6) << 12)
22881 	/* 46.66% of the max tx rate */
22882 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66  (UINT32_C(0x7) << 12)
22883 	/* 53.33% of the max tx rate */
22884 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33  (UINT32_C(0x8) << 12)
22885 	/* 60% of the max tx rate */
22886 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60	(UINT32_C(0x9) << 12)
22887 	/* 66.66% of the max tx rate */
22888 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66  (UINT32_C(0xa) << 12)
22889 	/* 53.33% of the max tx rate */
22890 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33  (UINT32_C(0xb) << 12)
22891 	/* 80% of the max tx rate */
22892 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80	(UINT32_C(0xc) << 12)
22893 	/* 86.66% of the max tx rate */
22894 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66  (UINT32_C(0xd) << 12)
22895 	/* 93.33% of the max tx rate */
22896 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33  (UINT32_C(0xe) << 12)
22897 	/* 100% of the max tx rate */
22898 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100	(UINT32_C(0xf) << 12)
22899 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST	HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
22900 } hwrm_func_vf_bw_cfg_input_t, *phwrm_func_vf_bw_cfg_input_t;
22901 
22902 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
22903 
22904 typedef struct hwrm_func_vf_bw_cfg_output {
22905 	/* The specific error status for the command. */
22906 	uint16_t	error_code;
22907 	/* The HWRM command request type. */
22908 	uint16_t	req_type;
22909 	/* The sequence ID from the original command. */
22910 	uint16_t	seq_id;
22911 	/* The length of the response data in number of bytes. */
22912 	uint16_t	resp_len;
22913 	uint8_t	unused_0[7];
22914 	/*
22915 	 * This field is used in Output records to indicate that the output
22916 	 * is completely written to RAM.  This field should be read as '1'
22917 	 * to indicate that the output has been completely written.
22918 	 * When writing a command completion or response to an internal processor,
22919 	 * the order of writes has to be such that this field is written last.
22920 	 */
22921 	uint8_t	valid;
22922 } hwrm_func_vf_bw_cfg_output_t, *phwrm_func_vf_bw_cfg_output_t;
22923 
22924 /************************
22925  * hwrm_func_vf_bw_qcfg *
22926  ************************/
22927 
22928 
22929 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
22930 
22931 typedef struct hwrm_func_vf_bw_qcfg_input {
22932 	/* The HWRM command request type. */
22933 	uint16_t	req_type;
22934 	/*
22935 	 * The completion ring to send the completion event on. This should
22936 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22937 	 */
22938 	uint16_t	cmpl_ring;
22939 	/*
22940 	 * The sequence ID is used by the driver for tracking multiple
22941 	 * commands. This ID is treated as opaque data by the firmware and
22942 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22943 	 */
22944 	uint16_t	seq_id;
22945 	/*
22946 	 * The target ID of the command:
22947 	 * * 0x0-0xFFF8 - The function ID
22948 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22949 	 * * 0xFFFD - Reserved for user-space HWRM interface
22950 	 * * 0xFFFF - HWRM
22951 	 */
22952 	uint16_t	target_id;
22953 	/*
22954 	 * A physical address pointer pointing to a host buffer that the
22955 	 * command's response data will be written. This can be either a host
22956 	 * physical address (HPA) or a guest physical address (GPA) and must
22957 	 * point to a physically contiguous block of memory.
22958 	 */
22959 	uint64_t	resp_addr;
22960 	/*
22961 	 * The number of VF functions that are being queried.
22962 	 * The inline response space allows the host to query up to 50 VFs'
22963 	 * rate scale percentage
22964 	 */
22965 	uint16_t	num_vfs;
22966 	uint16_t	unused[3];
22967 	/* These 16-bit fields contain the VF fid */
22968 	uint16_t	vfn[48];
22969 	/* The physical VF id of interest */
22970 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
22971 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
22972 } hwrm_func_vf_bw_qcfg_input_t, *phwrm_func_vf_bw_qcfg_input_t;
22973 
22974 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
22975 
22976 typedef struct hwrm_func_vf_bw_qcfg_output {
22977 	/* The specific error status for the command. */
22978 	uint16_t	error_code;
22979 	/* The HWRM command request type. */
22980 	uint16_t	req_type;
22981 	/* The sequence ID from the original command. */
22982 	uint16_t	seq_id;
22983 	/* The length of the response data in number of bytes. */
22984 	uint16_t	resp_len;
22985 	/*
22986 	 * The number of VF functions that are being queried.
22987 	 * The inline response space allows the host to query up to 50 VFs' rate
22988 	 * scale percentage
22989 	 */
22990 	uint16_t	num_vfs;
22991 	uint16_t	unused[3];
22992 	/* These 16-bit fields contain the VF fid and the rate scale percentage. */
22993 	uint16_t	vfn[48];
22994 	/* The physical VF id the adjustment will be made to. */
22995 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK	UINT32_C(0xfff)
22996 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT	0
22997 	/*
22998 	 * This field configures the rate scale percentage of the VF as specified
22999 	 * by the physical VF id.
23000 	 */
23001 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK	UINT32_C(0xf000)
23002 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT	12
23003 	/* 0% of the max tx rate */
23004 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0	(UINT32_C(0x0) << 12)
23005 	/* 6.66% of the max tx rate */
23006 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66   (UINT32_C(0x1) << 12)
23007 	/* 13.33% of the max tx rate */
23008 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33  (UINT32_C(0x2) << 12)
23009 	/* 20% of the max tx rate */
23010 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20	(UINT32_C(0x3) << 12)
23011 	/* 26.66% of the max tx rate */
23012 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66  (UINT32_C(0x4) << 12)
23013 	/* 33% of the max tx rate */
23014 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33  (UINT32_C(0x5) << 12)
23015 	/* 40% of the max tx rate */
23016 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40	(UINT32_C(0x6) << 12)
23017 	/* 46.66% of the max tx rate */
23018 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66  (UINT32_C(0x7) << 12)
23019 	/* 53.33% of the max tx rate */
23020 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33  (UINT32_C(0x8) << 12)
23021 	/* 60% of the max tx rate */
23022 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60	(UINT32_C(0x9) << 12)
23023 	/* 66.66% of the max tx rate */
23024 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66  (UINT32_C(0xa) << 12)
23025 	/* 53.33% of the max tx rate */
23026 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33  (UINT32_C(0xb) << 12)
23027 	/* 80% of the max tx rate */
23028 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80	(UINT32_C(0xc) << 12)
23029 	/* 86.66% of the max tx rate */
23030 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66  (UINT32_C(0xd) << 12)
23031 	/* 93.33% of the max tx rate */
23032 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33  (UINT32_C(0xe) << 12)
23033 	/* 100% of the max tx rate */
23034 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100	(UINT32_C(0xf) << 12)
23035 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST	HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
23036 	uint8_t	unused_0[7];
23037 	/*
23038 	 * This field is used in Output records to indicate that the output
23039 	 * is completely written to RAM.  This field should be read as '1'
23040 	 * to indicate that the output has been completely written.
23041 	 * When writing a command completion or response to an internal processor,
23042 	 * the order of writes has to be such that this field is written last.
23043 	 */
23044 	uint8_t	valid;
23045 } hwrm_func_vf_bw_qcfg_output_t, *phwrm_func_vf_bw_qcfg_output_t;
23046 
23047 /***************************
23048  * hwrm_func_drv_if_change *
23049  ***************************/
23050 
23051 
23052 /* hwrm_func_drv_if_change_input (size:192b/24B) */
23053 
23054 typedef struct hwrm_func_drv_if_change_input {
23055 	/* The HWRM command request type. */
23056 	uint16_t	req_type;
23057 	/*
23058 	 * The completion ring to send the completion event on. This should
23059 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23060 	 */
23061 	uint16_t	cmpl_ring;
23062 	/*
23063 	 * The sequence ID is used by the driver for tracking multiple
23064 	 * commands. This ID is treated as opaque data by the firmware and
23065 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23066 	 */
23067 	uint16_t	seq_id;
23068 	/*
23069 	 * The target ID of the command:
23070 	 * * 0x0-0xFFF8 - The function ID
23071 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23072 	 * * 0xFFFD - Reserved for user-space HWRM interface
23073 	 * * 0xFFFF - HWRM
23074 	 */
23075 	uint16_t	target_id;
23076 	/*
23077 	 * A physical address pointer pointing to a host buffer that the
23078 	 * command's response data will be written. This can be either a host
23079 	 * physical address (HPA) or a guest physical address (GPA) and must
23080 	 * point to a physically contiguous block of memory.
23081 	 */
23082 	uint64_t	resp_addr;
23083 	uint32_t	flags;
23084 	/*
23085 	 * When this bit is '1', the function driver is indicating
23086 	 * that the IF state is changing to UP state.  The call should
23087 	 * be made at the beginning of the driver's open call before
23088 	 * resources are allocated.  After making the call, the driver
23089 	 * should check the response to see if any resources may have
23090 	 * changed (see the response below).  If the driver fails
23091 	 * the open call, the driver should make this call again with
23092 	 * this bit cleared to indicate that the IF state is not UP.
23093 	 * During the driver's close call when the IF state is changing
23094 	 * to DOWN, the driver should make this call with the bit cleared
23095 	 * after all resources have been freed.
23096 	 */
23097 	#define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP	UINT32_C(0x1)
23098 	uint32_t	unused;
23099 } hwrm_func_drv_if_change_input_t, *phwrm_func_drv_if_change_input_t;
23100 
23101 /* hwrm_func_drv_if_change_output (size:128b/16B) */
23102 
23103 typedef struct hwrm_func_drv_if_change_output {
23104 	/* The specific error status for the command. */
23105 	uint16_t	error_code;
23106 	/* The HWRM command request type. */
23107 	uint16_t	req_type;
23108 	/* The sequence ID from the original command. */
23109 	uint16_t	seq_id;
23110 	/* The length of the response data in number of bytes. */
23111 	uint16_t	resp_len;
23112 	uint32_t	flags;
23113 	/*
23114 	 * When this bit is '1', it indicates that the resources reserved
23115 	 * for this function may have changed.  The driver should check
23116 	 * resource capabilities and reserve resources again before
23117 	 * allocating resources.
23118 	 */
23119 	#define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE	UINT32_C(0x1)
23120 	/*
23121 	 * When this bit is '1', it indicates that the firmware got changed / reset.
23122 	 * The driver should do complete re-initialization when that bit is set.
23123 	 */
23124 	#define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE	UINT32_C(0x2)
23125 	uint8_t	unused_0[3];
23126 	/*
23127 	 * This field is used in Output records to indicate that the output
23128 	 * is completely written to RAM.  This field should be read as '1'
23129 	 * to indicate that the output has been completely written.
23130 	 * When writing a command completion or response to an internal processor,
23131 	 * the order of writes has to be such that this field is written last.
23132 	 */
23133 	uint8_t	valid;
23134 } hwrm_func_drv_if_change_output_t, *phwrm_func_drv_if_change_output_t;
23135 
23136 /*******************************
23137  * hwrm_func_host_pf_ids_query *
23138  *******************************/
23139 
23140 
23141 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
23142 
23143 typedef struct hwrm_func_host_pf_ids_query_input {
23144 	/* The HWRM command request type. */
23145 	uint16_t	req_type;
23146 	/*
23147 	 * The completion ring to send the completion event on. This should
23148 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23149 	 */
23150 	uint16_t	cmpl_ring;
23151 	/*
23152 	 * The sequence ID is used by the driver for tracking multiple
23153 	 * commands. This ID is treated as opaque data by the firmware and
23154 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23155 	 */
23156 	uint16_t	seq_id;
23157 	/*
23158 	 * The target ID of the command:
23159 	 * * 0x0-0xFFF8 - The function ID
23160 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23161 	 * * 0xFFFD - Reserved for user-space HWRM interface
23162 	 * * 0xFFFF - HWRM
23163 	 */
23164 	uint16_t	target_id;
23165 	/*
23166 	 * A physical address pointer pointing to a host buffer that the
23167 	 * command's response data will be written. This can be either a host
23168 	 * physical address (HPA) or a guest physical address (GPA) and must
23169 	 * point to a physically contiguous block of memory.
23170 	 */
23171 	uint64_t	resp_addr;
23172 	uint8_t	host;
23173 	/*
23174 	 * # If this bit is set to '1', the query will contain PF(s)
23175 	 * belongs to SOC host.
23176 	 */
23177 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC	UINT32_C(0x1)
23178 	/*
23179 	 * # If this bit is set to '1', the query will contain PF(s)
23180 	 * belongs to EP0 host.
23181 	 */
23182 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0	UINT32_C(0x2)
23183 	/*
23184 	 * # If this bit is set to '1', the query will contain PF(s)
23185 	 * belongs to EP1 host.
23186 	 */
23187 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1	UINT32_C(0x4)
23188 	/*
23189 	 * # If this bit is set to '1', the query will contain PF(s)
23190 	 * belongs to EP2 host.
23191 	 */
23192 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2	UINT32_C(0x8)
23193 	/*
23194 	 * # If this bit is set to '1', the query will contain PF(s)
23195 	 * belongs to EP3 host.
23196 	 */
23197 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3	UINT32_C(0x10)
23198 	/*
23199 	 * This provides a filter of what PF(s) will be returned in the
23200 	 * query..
23201 	 */
23202 	uint8_t	filter;
23203 	/*
23204 	 * all available PF(s) belong to the host(s) (defined in the
23205 	 * host field). This includes the hidden PFs.
23206 	 */
23207 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
23208 	/*
23209 	 * all available PF(s) belong to the host(s) (defined in the
23210 	 * host field) that is available for L2 traffic.
23211 	 */
23212 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
23213 	/*
23214 	 * all available PF(s) belong to the host(s) (defined in the
23215 	 * host field) that is available for ROCE traffic.
23216 	 */
23217 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
23218 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
23219 	uint8_t	unused_1[6];
23220 } hwrm_func_host_pf_ids_query_input_t, *phwrm_func_host_pf_ids_query_input_t;
23221 
23222 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
23223 
23224 typedef struct hwrm_func_host_pf_ids_query_output {
23225 	/* The specific error status for the command. */
23226 	uint16_t	error_code;
23227 	/* The HWRM command request type. */
23228 	uint16_t	req_type;
23229 	/* The sequence ID from the original command. */
23230 	uint16_t	seq_id;
23231 	/* The length of the response data in number of bytes. */
23232 	uint16_t	resp_len;
23233 	/* This provides the first PF ID of the device. */
23234 	uint16_t	first_pf_id;
23235 	uint16_t	pf_ordinal_mask;
23236 	/*
23237 	 * When this bit is '1', it indicates first PF belongs to one of
23238 	 * the hosts defined in the input request.
23239 	 */
23240 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0	UINT32_C(0x1)
23241 	/*
23242 	 * When this bit is '1', it indicates 2nd PF belongs to one of the
23243 	 * hosts defined in the input request.
23244 	 */
23245 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1	UINT32_C(0x2)
23246 	/*
23247 	 * When this bit is '1', it indicates 3rd PF belongs to one of the
23248 	 * hosts defined in the input request.
23249 	 */
23250 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2	UINT32_C(0x4)
23251 	/*
23252 	 * When this bit is '1', it indicates 4th PF belongs to one of the
23253 	 * hosts defined in the input request.
23254 	 */
23255 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3	UINT32_C(0x8)
23256 	/*
23257 	 * When this bit is '1', it indicates 5th PF belongs to one of the
23258 	 * hosts defined in the input request.
23259 	 */
23260 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4	UINT32_C(0x10)
23261 	/*
23262 	 * When this bit is '1', it indicates 6th PF belongs to one of the
23263 	 * hosts defined in the input request.
23264 	 */
23265 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5	UINT32_C(0x20)
23266 	/*
23267 	 * When this bit is '1', it indicates 7th PF belongs to one of the
23268 	 * hosts defined in the input request.
23269 	 */
23270 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6	UINT32_C(0x40)
23271 	/*
23272 	 * When this bit is '1', it indicates 8th PF belongs to one of the
23273 	 * hosts defined in the input request.
23274 	 */
23275 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7	UINT32_C(0x80)
23276 	/*
23277 	 * When this bit is '1', it indicates 9th PF belongs to one of the
23278 	 * hosts defined in the input request.
23279 	 */
23280 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8	UINT32_C(0x100)
23281 	/*
23282 	 * When this bit is '1', it indicates 10th PF belongs to one of the
23283 	 * hosts defined in the input request.
23284 	 */
23285 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9	UINT32_C(0x200)
23286 	/*
23287 	 * When this bit is '1', it indicates 11th PF belongs to one of the
23288 	 * hosts defined in the input request.
23289 	 */
23290 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10	UINT32_C(0x400)
23291 	/*
23292 	 * When this bit is '1', it indicates 12th PF belongs to one of the
23293 	 * hosts defined in the input request.
23294 	 */
23295 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11	UINT32_C(0x800)
23296 	/*
23297 	 * When this bit is '1', it indicates 13th PF belongs to one of the
23298 	 * hosts defined in the input request.
23299 	 */
23300 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12	UINT32_C(0x1000)
23301 	/*
23302 	 * When this bit is '1', it indicates 14th PF belongs to one of the
23303 	 * hosts defined in the input request.
23304 	 */
23305 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13	UINT32_C(0x2000)
23306 	/*
23307 	 * When this bit is '1', it indicates 15th PF belongs to one of the
23308 	 * hosts defined in the input request.
23309 	 */
23310 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14	UINT32_C(0x4000)
23311 	/*
23312 	 * When this bit is '1', it indicates 16th PF belongs to one of the
23313 	 * hosts defined in the input request.
23314 	 */
23315 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15	UINT32_C(0x8000)
23316 	uint8_t	unused_1[3];
23317 	/*
23318 	 * This field is used in Output records to indicate that the output
23319 	 * is completely written to RAM.  This field should be read as '1'
23320 	 * to indicate that the output has been completely written.
23321 	 * When writing a command completion or response to an internal processor,
23322 	 * the order of writes has to be such that this field is written last.
23323 	 */
23324 	uint8_t	valid;
23325 } hwrm_func_host_pf_ids_query_output_t, *phwrm_func_host_pf_ids_query_output_t;
23326 
23327 /*********************
23328  * hwrm_func_spd_cfg *
23329  *********************/
23330 
23331 
23332 /* hwrm_func_spd_cfg_input (size:384b/48B) */
23333 
23334 typedef struct hwrm_func_spd_cfg_input {
23335 	/* The HWRM command request type. */
23336 	uint16_t	req_type;
23337 	/*
23338 	 * The completion ring to send the completion event on. This should
23339 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23340 	 */
23341 	uint16_t	cmpl_ring;
23342 	/*
23343 	 * The sequence ID is used by the driver for tracking multiple
23344 	 * commands. This ID is treated as opaque data by the firmware and
23345 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23346 	 */
23347 	uint16_t	seq_id;
23348 	/*
23349 	 * The target ID of the command:
23350 	 * * 0x0-0xFFF8 - The function ID
23351 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23352 	 * * 0xFFFD - Reserved for user-space HWRM interface
23353 	 * * 0xFFFF - HWRM
23354 	 */
23355 	uint16_t	target_id;
23356 	/*
23357 	 * A physical address pointer pointing to a host buffer that the
23358 	 * command's response data will be written. This can be either a host
23359 	 * physical address (HPA) or a guest physical address (GPA) and must
23360 	 * point to a physically contiguous block of memory.
23361 	 */
23362 	uint64_t	resp_addr;
23363 	uint32_t	flags;
23364 	/* Set this bit is '1' to enable the SPD datapath forwarding. */
23365 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_ENABLE	UINT32_C(0x1)
23366 	/* Set this bit is '1' to disable the SPD datapath forwarding. */
23367 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_DISABLE	UINT32_C(0x2)
23368 	/*
23369 	 * Set this bit is '1' to enable the SPD datapath checksum
23370 	 * feature.
23371 	 */
23372 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_ENABLE	UINT32_C(0x4)
23373 	/*
23374 	 * Set this bit is '1' to disable the SPD datapath checksum
23375 	 * feature.
23376 	 */
23377 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_DISABLE	UINT32_C(0x8)
23378 	/*
23379 	 * Set this bit is '1' to enable the SPD datapath debug
23380 	 * feature.
23381 	 */
23382 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_ENABLE	UINT32_C(0x10)
23383 	/*
23384 	 * Set this bit is '1' to disable the SPD datapath debug
23385 	 * feature.
23386 	 */
23387 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_DISABLE	UINT32_C(0x20)
23388 	uint32_t	enables;
23389 	/*
23390 	 * This bit must be '1' for the ethertype field to be
23391 	 * configured.
23392 	 */
23393 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x1)
23394 	/*
23395 	 * This bit must be '1' for the hash_mode_flags field to be
23396 	 * configured.
23397 	 */
23398 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_MODE_FLAGS	UINT32_C(0x2)
23399 	/*
23400 	 * This bit must be '1' for the hash_type field to be
23401 	 * configured.
23402 	 */
23403 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_TYPE		UINT32_C(0x4)
23404 	/*
23405 	 * This bit must be '1' for the ring_tbl_addr field to be
23406 	 * configured.
23407 	 */
23408 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_RING_TBL_ADDR	UINT32_C(0x8)
23409 	/*
23410 	 * This bit must be '1' for the hash_key_tbl_addr field to be
23411 	 * configured.
23412 	 */
23413 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_KEY_TBL_ADDR	UINT32_C(0x10)
23414 	/*
23415 	 * Ethertype value used in the encapsulated SPD packet header.
23416 	 * The user must choose a value that is not conflicting with
23417 	 * publicly defined ethertype values. By default, the ethertype
23418 	 * value of 0xffff is used if there is no user specified value.
23419 	 */
23420 	uint16_t	ethertype;
23421 	/* Flags to specify different RSS hash modes. */
23422 	uint8_t	hash_mode_flags;
23423 	/*
23424 	 * When this bit is '1', it indicates using current RSS
23425 	 * hash mode setting configured in the device.
23426 	 */
23427 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
23428 	/*
23429 	 * When this bit is '1', it indicates requesting support of
23430 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
23431 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
23432 	 * packets, the RSS hash is computed over the normal
23433 	 * src/dest l3 and src/dest l4 headers.
23434 	 */
23435 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
23436 	/*
23437 	 * When this bit is '1', it indicates requesting support of
23438 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
23439 	 * tunnel packets. For none-tunnel packets, the RSS hash is
23440 	 * computed over the normal src/dest l3 headers.
23441 	 */
23442 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
23443 	/*
23444 	 * When this bit is '1', it indicates requesting support of
23445 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
23446 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
23447 	 * packets, the RSS hash is computed over the normal
23448 	 * src/dest l3 and src/dest l4 headers.
23449 	 */
23450 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
23451 	/*
23452 	 * When this bit is '1', it indicates requesting support of
23453 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
23454 	 * tunnel packets. For none-tunnel packets, the RSS hash is
23455 	 * computed over the normal src/dest l3 headers.
23456 	 */
23457 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
23458 	uint8_t	unused_1;
23459 	uint32_t	hash_type;
23460 	/*
23461 	 * When this bit is '1', the RSS hash shall be computed
23462 	 * over source and destination IPv4 addresses of IPv4
23463 	 * packets.
23464 	 */
23465 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV4	UINT32_C(0x1)
23466 	/*
23467 	 * When this bit is '1', the RSS hash shall be computed
23468 	 * over source/destination IPv4 addresses and
23469 	 * source/destination ports of TCP/IPv4 packets.
23470 	 */
23471 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
23472 	/*
23473 	 * When this bit is '1', the RSS hash shall be computed
23474 	 * over source/destination IPv4 addresses and
23475 	 * source/destination ports of UDP/IPv4 packets.
23476 	 */
23477 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
23478 	/*
23479 	 * When this bit is '1', the RSS hash shall be computed
23480 	 * over source and destination IPv4 addresses of IPv6
23481 	 * packets.
23482 	 */
23483 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV6	UINT32_C(0x8)
23484 	/*
23485 	 * When this bit is '1', the RSS hash shall be computed
23486 	 * over source/destination IPv6 addresses and
23487 	 * source/destination ports of TCP/IPv6 packets.
23488 	 */
23489 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
23490 	/*
23491 	 * When this bit is '1', the RSS hash shall be computed
23492 	 * over source/destination IPv6 addresses and
23493 	 * source/destination ports of UDP/IPv6 packets.
23494 	 */
23495 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
23496 	/* This is the address for rss ring group table */
23497 	uint64_t	ring_grp_tbl_addr;
23498 	/* This is the address for rss hash key table */
23499 	uint64_t	hash_key_tbl_addr;
23500 } hwrm_func_spd_cfg_input_t, *phwrm_func_spd_cfg_input_t;
23501 
23502 /* hwrm_func_spd_cfg_output (size:128b/16B) */
23503 
23504 typedef struct hwrm_func_spd_cfg_output {
23505 	/* The specific error status for the command. */
23506 	uint16_t	error_code;
23507 	/* The HWRM command request type. */
23508 	uint16_t	req_type;
23509 	/* The sequence ID from the original command. */
23510 	uint16_t	seq_id;
23511 	/* The length of the response data in number of bytes. */
23512 	uint16_t	resp_len;
23513 	uint8_t	unused_0[7];
23514 	/*
23515 	 * This field is used in Output records to indicate that the output
23516 	 * is completely written to RAM.  This field should be read as '1'
23517 	 * to indicate that the output has been completely written.
23518 	 * When writing a command completion or response to an internal processor,
23519 	 * the order of writes has to be such that this field is written last.
23520 	 */
23521 	uint8_t	valid;
23522 } hwrm_func_spd_cfg_output_t, *phwrm_func_spd_cfg_output_t;
23523 
23524 /**********************
23525  * hwrm_func_spd_qcfg *
23526  **********************/
23527 
23528 
23529 /* hwrm_func_spd_qcfg_input (size:128b/16B) */
23530 
23531 typedef struct hwrm_func_spd_qcfg_input {
23532 	/* The HWRM command request type. */
23533 	uint16_t	req_type;
23534 	/*
23535 	 * The completion ring to send the completion event on. This should
23536 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23537 	 */
23538 	uint16_t	cmpl_ring;
23539 	/*
23540 	 * The sequence ID is used by the driver for tracking multiple
23541 	 * commands. This ID is treated as opaque data by the firmware and
23542 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23543 	 */
23544 	uint16_t	seq_id;
23545 	/*
23546 	 * The target ID of the command:
23547 	 * * 0x0-0xFFF8 - The function ID
23548 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23549 	 * * 0xFFFD - Reserved for user-space HWRM interface
23550 	 * * 0xFFFF - HWRM
23551 	 */
23552 	uint16_t	target_id;
23553 	/*
23554 	 * A physical address pointer pointing to a host buffer that the
23555 	 * command's response data will be written. This can be either a host
23556 	 * physical address (HPA) or a guest physical address (GPA) and must
23557 	 * point to a physically contiguous block of memory.
23558 	 */
23559 	uint64_t	resp_addr;
23560 } hwrm_func_spd_qcfg_input_t, *phwrm_func_spd_qcfg_input_t;
23561 
23562 /* hwrm_func_spd_qcfg_output (size:512b/64B) */
23563 
23564 typedef struct hwrm_func_spd_qcfg_output {
23565 	/* The specific error status for the command. */
23566 	uint16_t	error_code;
23567 	/* The HWRM command request type. */
23568 	uint16_t	req_type;
23569 	/* The sequence ID from the original command. */
23570 	uint16_t	seq_id;
23571 	/* The length of the response data in number of bytes. */
23572 	uint16_t	resp_len;
23573 	uint32_t	flags;
23574 	/*
23575 	 * The SPD datapath forwarding is currently enabled when this
23576 	 * flag is set to '1'.
23577 	 */
23578 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_FWD_ENABLED	UINT32_C(0x1)
23579 	/*
23580 	 * The SPD datapath checksum feature is currently enabled when
23581 	 * this flag is set to '1'.
23582 	 */
23583 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_CSUM_ENABLED	UINT32_C(0x2)
23584 	/*
23585 	 * The SPD datapath debug feature is currently enabled when
23586 	 * this flag is set to '1'.
23587 	 */
23588 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_DBG_ENABLED	UINT32_C(0x4)
23589 	uint32_t	hash_type;
23590 	/*
23591 	 * When this bit is '1', the RSS hash shall be computed
23592 	 * over source and destination IPv4 addresses of IPv4
23593 	 * packets.
23594 	 */
23595 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV4	UINT32_C(0x1)
23596 	/*
23597 	 * When this bit is '1', the RSS hash shall be computed
23598 	 * over source/destination IPv4 addresses and
23599 	 * source/destination ports of TCP/IPv4 packets.
23600 	 */
23601 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
23602 	/*
23603 	 * When this bit is '1', the RSS hash shall be computed
23604 	 * over source/destination IPv4 addresses and
23605 	 * source/destination ports of UDP/IPv4 packets.
23606 	 */
23607 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
23608 	/*
23609 	 * When this bit is '1', the RSS hash shall be computed
23610 	 * over source and destination IPv4 addresses of IPv6
23611 	 * packets.
23612 	 */
23613 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV6	UINT32_C(0x8)
23614 	/*
23615 	 * When this bit is '1', the RSS hash shall be computed
23616 	 * over source/destination IPv6 addresses and
23617 	 * source/destination ports of TCP/IPv6 packets.
23618 	 */
23619 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
23620 	/*
23621 	 * When this bit is '1', the RSS hash shall be computed
23622 	 * over source/destination IPv6 addresses and
23623 	 * source/destination ports of UDP/IPv6 packets.
23624 	 */
23625 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
23626 	/* This is the value of rss hash key */
23627 	uint32_t	hash_key[10];
23628 	/* Flags to specify different RSS hash modes. */
23629 	uint8_t	hash_mode_flags;
23630 	/*
23631 	 * When this bit is '1', it indicates using current RSS
23632 	 * hash mode setting configured in the device.
23633 	 */
23634 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
23635 	/*
23636 	 * When this bit is '1', it indicates requesting support of
23637 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
23638 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
23639 	 * packets, the RSS hash is computed over the normal
23640 	 * src/dest l3 and src/dest l4 headers.
23641 	 */
23642 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
23643 	/*
23644 	 * When this bit is '1', it indicates requesting support of
23645 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
23646 	 * tunnel packets. For none-tunnel packets, the RSS hash is
23647 	 * computed over the normal src/dest l3 headers.
23648 	 */
23649 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
23650 	/*
23651 	 * When this bit is '1', it indicates requesting support of
23652 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
23653 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
23654 	 * packets, the RSS hash is computed over the normal
23655 	 * src/dest l3 and src/dest l4 headers.
23656 	 */
23657 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
23658 	/*
23659 	 * When this bit is '1', it indicates requesting support of
23660 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
23661 	 * tunnel packets. For none-tunnel packets, the RSS hash is
23662 	 * computed over the normal src/dest l3 headers.
23663 	 */
23664 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
23665 	uint8_t	unused_1;
23666 	/*
23667 	 * Ethertype value used in the encapsulated SPD packet header.
23668 	 * The user must choose a value that is not conflicting with
23669 	 * publicly defined ethertype values. By default, the ethertype
23670 	 * value of 0xffff is used if there is no user specified value.
23671 	 */
23672 	uint16_t	ethertype;
23673 	uint8_t	unused_2[3];
23674 	/*
23675 	 * This field is used in Output records to indicate that the output
23676 	 * is completely written to RAM.  This field should be read as '1'
23677 	 * to indicate that the output has been completely written.
23678 	 * When writing a command completion or response to an internal processor,
23679 	 * the order of writes has to be such that this field is written last.
23680 	 */
23681 	uint8_t	valid;
23682 } hwrm_func_spd_qcfg_output_t, *phwrm_func_spd_qcfg_output_t;
23683 
23684 /*********************
23685  * hwrm_port_phy_cfg *
23686  *********************/
23687 
23688 
23689 /* hwrm_port_phy_cfg_input (size:448b/56B) */
23690 
23691 typedef struct hwrm_port_phy_cfg_input {
23692 	/* The HWRM command request type. */
23693 	uint16_t	req_type;
23694 	/*
23695 	 * The completion ring to send the completion event on. This should
23696 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23697 	 */
23698 	uint16_t	cmpl_ring;
23699 	/*
23700 	 * The sequence ID is used by the driver for tracking multiple
23701 	 * commands. This ID is treated as opaque data by the firmware and
23702 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23703 	 */
23704 	uint16_t	seq_id;
23705 	/*
23706 	 * The target ID of the command:
23707 	 * * 0x0-0xFFF8 - The function ID
23708 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23709 	 * * 0xFFFD - Reserved for user-space HWRM interface
23710 	 * * 0xFFFF - HWRM
23711 	 */
23712 	uint16_t	target_id;
23713 	/*
23714 	 * A physical address pointer pointing to a host buffer that the
23715 	 * command's response data will be written. This can be either a host
23716 	 * physical address (HPA) or a guest physical address (GPA) and must
23717 	 * point to a physically contiguous block of memory.
23718 	 */
23719 	uint64_t	resp_addr;
23720 	uint32_t	flags;
23721 	/*
23722 	 * When this bit is set to '1', the PHY for the port shall
23723 	 * be reset.
23724 	 *
23725 	 * # If this bit is set to 1, then the HWRM shall reset the
23726 	 * PHY after applying PHY configuration changes specified
23727 	 * in this command.
23728 	 * # In order to guarantee that PHY configuration changes
23729 	 * specified in this command take effect, the HWRM
23730 	 * client should set this flag to 1.
23731 	 * # If this bit is not set to 1, then the HWRM may reset
23732 	 * the PHY depending on the current PHY configuration and
23733 	 * settings specified in this command.
23734 	 */
23735 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY		UINT32_C(0x1)
23736 	/* deprecated bit.  Do not use!!! */
23737 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED		UINT32_C(0x2)
23738 	/*
23739 	 * When this bit is set to '1', and the force_pam4_link_speed
23740 	 * bit in the 'enables' field is '0', the link shall be forced
23741 	 * to the force_link_speed value.
23742 	 *
23743 	 * When this bit is set to '1', and the force_pam4_link_speed
23744 	 * bit in the 'enables' field is '1', the link shall be forced
23745 	 * to the force_pam4_link_speed value.
23746 	 *
23747 	 * When this bit is set to '1', the HWRM client should
23748 	 * not enable any of the auto negotiation related
23749 	 * fields represented by auto_XXX fields in this command.
23750 	 * When this bit is set to '1' and the HWRM client has
23751 	 * enabled a auto_XXX field in this command, then the
23752 	 * HWRM shall ignore the enabled auto_XXX field.
23753 	 *
23754 	 * When this bit is set to zero, the link
23755 	 * shall be allowed to autoneg.
23756 	 */
23757 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE			UINT32_C(0x4)
23758 	/*
23759 	 * When this bit is set to '1', the auto-negotiation process
23760 	 * shall be restarted on the link.
23761 	 */
23762 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG		UINT32_C(0x8)
23763 	/*
23764 	 * When this bit is set to '1', Energy Efficient Ethernet
23765 	 * (EEE) is requested to be enabled on this link.
23766 	 * If EEE is not supported on this port, then this flag
23767 	 * shall be ignored by the HWRM.
23768 	 */
23769 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE		UINT32_C(0x10)
23770 	/*
23771 	 * When this bit is set to '1', Energy Efficient Ethernet
23772 	 * (EEE) is requested to be disabled on this link.
23773 	 * If EEE is not supported on this port, then this flag
23774 	 * shall be ignored by the HWRM.
23775 	 */
23776 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE		UINT32_C(0x20)
23777 	/*
23778 	 * When this bit is set to '1' and EEE is enabled on this
23779 	 * link, then TX LPI is requested to be enabled on the link.
23780 	 * If EEE is not supported on this port, then this flag
23781 	 * shall be ignored by the HWRM.
23782 	 * If EEE is disabled on this port, then this flag shall be
23783 	 * ignored by the HWRM.
23784 	 */
23785 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE	UINT32_C(0x40)
23786 	/*
23787 	 * When this bit is set to '1' and EEE is enabled on this
23788 	 * link, then TX LPI is requested to be disabled on the link.
23789 	 * If EEE is not supported on this port, then this flag
23790 	 * shall be ignored by the HWRM.
23791 	 * If EEE is disabled on this port, then this flag shall be
23792 	 * ignored by the HWRM.
23793 	 */
23794 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE	UINT32_C(0x80)
23795 	/*
23796 	 * When set to 1, then the HWRM shall enable FEC autonegotitation
23797 	 * on this port if supported.  When enabled, at least one of the
23798 	 * FEC modes must be advertised by enabling the fec_clause_74_enable,
23799 	 * fec_clause_91_enable, fec_rs544_1xn_enable, fec_rs544_ieee_enable,
23800 	 * fec_rs272_1xn_enable, or fec_rs272_ieee_enable flag.  If none
23801 	 * of the FEC mode is currently enabled, the HWRM shall choose
23802 	 * a default advertisement setting.
23803 	 * The default advertisement setting can be queried by calling
23804 	 * hwrm_port_phy_qcfg.  Note that the link speed must be
23805 	 * in autonegotiation mode for FEC autonegotiation to take effect.
23806 	 * When set to 0, then this flag shall be ignored.
23807 	 * If FEC autonegotiation is not supported, then the HWRM shall ignore this
23808 	 * flag.
23809 	 */
23810 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE	UINT32_C(0x100)
23811 	/*
23812 	 * When set to 1, then the HWRM shall disable FEC autonegotiation
23813 	 * on this port and use forced FEC mode.  In forced FEC mode, one
23814 	 * or more FEC forced settings under the same clause can be set.
23815 	 * When set to 0, then this flag shall be ignored.
23816 	 * If FEC autonegotiation is not supported, then the HWRM shall ignore this
23817 	 * flag.
23818 	 */
23819 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE	UINT32_C(0x200)
23820 	/*
23821 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
23822 	 * on this port if supported, by advertising FEC CLAUSE 74 if
23823 	 * FEC autonegotiation is enabled or force enabled otherwise.
23824 	 * When set to 0, then this flag shall be ignored.
23825 	 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
23826 	 * flag.
23827 	 */
23828 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE	UINT32_C(0x400)
23829 	/*
23830 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
23831 	 * on this port if supported, by not advertising FEC CLAUSE 74 if
23832 	 * FEC autonegotiation is enabled or force disabled otherwise.
23833 	 * When set to 0, then this flag shall be ignored.
23834 	 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
23835 	 * flag.
23836 	 */
23837 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE	UINT32_C(0x800)
23838 	/*
23839 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 91
23840 	 * (Reed Solomon RS(528,514) for NRZ) on this port if supported,
23841 	 * by advertising FEC RS(528,514) if FEC autonegotiation is enabled
23842 	 * or force enabled otherwise.  In forced FEC mode, this flag
23843 	 * will only take effect if the speed is NRZ.  Additional
23844 	 * RS544 or RS272 flags (also under clause 91) may be set for PAM4
23845 	 * in forced FEC mode.
23846 	 * When set to 0, then this flag shall be ignored.
23847 	 * If FEC RS(528,514) is not supported, then the HWRM shall ignore
23848 	 * this flag.
23849 	 */
23850 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE	UINT32_C(0x1000)
23851 	/*
23852 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
23853 	 * (Reed Solomon RS(528,514) for NRZ) on this port if supported, by
23854 	 * not advertising RS(528,514) if FEC autonegotiation is enabled or
23855 	 * force disabled otherwise.  When set to 0, then this flag shall be
23856 	 * ignored.  If FEC RS(528,514) is not supported, then the HWRM
23857 	 * shall ignore this flag.
23858 	 */
23859 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE	UINT32_C(0x2000)
23860 	/*
23861 	 * When this bit is set to '1', the link shall be forced to
23862 	 * be taken down.
23863 	 *
23864 	 * # When this bit is set to '1", all other
23865 	 * command input settings related to the link speed shall
23866 	 * be ignored.
23867 	 * Once the link state is forced down, it can be
23868 	 * explicitly cleared from that state by setting this flag
23869 	 * to '0'.
23870 	 * # If this flag is set to '0', then the link shall be
23871 	 * cleared from forced down state if the link is in forced
23872 	 * down state.
23873 	 * There may be conditions (e.g. out-of-band or sideband
23874 	 * configuration changes for the link) outside the scope
23875 	 * of the HWRM implementation that may clear forced down
23876 	 * link state.
23877 	 */
23878 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN		UINT32_C(0x4000)
23879 	/*
23880 	 * When set to 1, then the HWRM shall enable FEC RS544_1XN
23881 	 * on this port if supported, by advertising FEC RS544_1XN if
23882 	 * FEC autonegotiation is enabled or force enabled otherwise.
23883 	 * In forced mode, this flag will only take effect if the speed is
23884 	 * PAM4.  If this flag and fec_rs544_ieee_enable are set, the
23885 	 * HWRM shall choose one of the RS544 modes.
23886 	 * When set to 0, then this flag shall be ignored.
23887 	 * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
23888 	 * flag.
23889 	 */
23890 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE	UINT32_C(0x8000)
23891 	/*
23892 	 * When set to 1, then the HWRM shall disable FEC RS544_1XN
23893 	 * on this port if supported, by not advertising FEC RS544_1XN if
23894 	 * FEC autonegotiation is enabled or force disabled otherwise.
23895 	 * When set to 0, then this flag shall be ignored.
23896 	 * If FEC RS544_1XN  is not supported, then the HWRM shall ignore this
23897 	 * flag.
23898 	 */
23899 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE	UINT32_C(0x10000)
23900 	/*
23901 	 * When set to 1, then the HWRM shall enable FEC RS(544,514)
23902 	 * on this port if supported, by advertising FEC RS(544,514) if
23903 	 * FEC autonegotiation is enabled or force enabled otherwise.
23904 	 * In forced mode, this flag will only take effect if the speed is
23905 	 * PAM4.  If this flag and fec_rs544_1xn_enable are set, the
23906 	 * HWRM shall choose one of the RS544 modes.
23907 	 * When set to 0, then this flag shall be ignored.
23908 	 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
23909 	 * this flag.
23910 	 */
23911 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_ENABLE	UINT32_C(0x20000)
23912 	/*
23913 	 * When set to 1, then the HWRM shall disable FEC RS(544,514)
23914 	 * on this port if supported, by not advertising FEC RS(544,514) if
23915 	 * FEC autonegotiation is enabled or force disabled otherwise.
23916 	 * When set to 0, then this flag shall be ignored.
23917 	 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
23918 	 * this flag.
23919 	 */
23920 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_DISABLE	UINT32_C(0x40000)
23921 	/*
23922 	 * When set to 1, then the HWRM shall enable FEC RS272_1XN
23923 	 * on this port if supported, by advertising FEC RS272_1XN if
23924 	 * FEC autonegotiation is enabled or force enabled otherwise.
23925 	 * In forced mode, this flag will only take effect if the speed is
23926 	 * PAM4.  If this flag and fec_rs272_ieee_enable are set, the
23927 	 * HWRM shall choose one of the RS272 modes.  Note that RS272
23928 	 * and RS544 modes cannot be set at the same time in forced FEC mode.
23929 	 * When set to 0, then this flag shall be ignored.
23930 	 * If FEC RS272_1XN is not supported, then the HWRM shall ignore this
23931 	 * flag.
23932 	 */
23933 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_ENABLE	UINT32_C(0x80000)
23934 	/*
23935 	 * When set to 1, then the HWRM shall disable FEC RS272_1XN
23936 	 * on this port if supported, by not advertising FEC RS272_1XN if
23937 	 * FEC autonegotiation is enabled or force disabled otherwise.
23938 	 * When set to 0, then this flag shall be ignored.
23939 	 * If FEC RS272_1XN is not supported, then the HWRM shall ignore
23940 	 * this flag.
23941 	 */
23942 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_DISABLE	UINT32_C(0x100000)
23943 	/*
23944 	 * When set to 1, then the HWRM shall enable FEC RS(272,257)
23945 	 * on this port if supported, by advertising FEC RS(272,257) if
23946 	 * FEC autonegotiation is enabled or force enabled otherwise.
23947 	 * In forced mode, this flag will only take effect if the speed is
23948 	 * PAM4.  If this flag and fec_rs272_1xn_enable are set, the
23949 	 * HWRM shall choose one of the RS272 modes.  Note that RS272
23950 	 * and RS544 modes cannot be set at the same time in forced FEC mode.
23951 	 * When set to 0, then this flag shall be ignored.
23952 	 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
23953 	 * this flag.
23954 	 */
23955 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_ENABLE	UINT32_C(0x200000)
23956 	/*
23957 	 * When set to 1, then the HWRM shall disable FEC RS(272,257)
23958 	 * on this port if supported, by not advertising FEC RS(272,257) if
23959 	 * FEC autonegotiation is enabled or force disabled otherwise.
23960 	 * When set to 0, then this flag shall be ignored.
23961 	 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
23962 	 * this flag.
23963 	 */
23964 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_DISABLE	UINT32_C(0x400000)
23965 	uint32_t	enables;
23966 	/*
23967 	 * This bit must be '1' for the auto_mode field to be
23968 	 * configured.
23969 	 */
23970 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE			UINT32_C(0x1)
23971 	/*
23972 	 * This bit must be '1' for the auto_duplex field to be
23973 	 * configured.
23974 	 */
23975 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX		UINT32_C(0x2)
23976 	/*
23977 	 * This bit must be '1' for the auto_pause field to be
23978 	 * configured.
23979 	 */
23980 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE			UINT32_C(0x4)
23981 	/*
23982 	 * This bit must be '1' for the auto_link_speed field to be
23983 	 * configured.
23984 	 */
23985 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED		UINT32_C(0x8)
23986 	/*
23987 	 * This bit must be '1' for the auto_link_speed_mask field to be
23988 	 * configured.
23989 	 */
23990 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK	UINT32_C(0x10)
23991 	/*
23992 	 * This bit must be '1' for the wirespeed field to be
23993 	 * configured.
23994 	 */
23995 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED			UINT32_C(0x20)
23996 	/*
23997 	 * This bit must be '1' for the lpbk field to be
23998 	 * configured.
23999 	 */
24000 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK			UINT32_C(0x40)
24001 	/*
24002 	 * This bit must be '1' for the preemphasis field to be
24003 	 * configured.
24004 	 */
24005 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS		UINT32_C(0x80)
24006 	/*
24007 	 * This bit must be '1' for the force_pause field to be
24008 	 * configured.
24009 	 */
24010 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE		UINT32_C(0x100)
24011 	/*
24012 	 * This bit must be '1' for the eee_link_speed_mask field to be
24013 	 * configured.
24014 	 */
24015 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK	UINT32_C(0x200)
24016 	/*
24017 	 * This bit must be '1' for the tx_lpi_timer field to be
24018 	 * configured.
24019 	 */
24020 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER		UINT32_C(0x400)
24021 	/*
24022 	 * This bit must be '1' for the force_pam4_link_speed field to be
24023 	 * configured.
24024 	 */
24025 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED	UINT32_C(0x800)
24026 	/*
24027 	 * This bit must be '1' for the auto_pam4_link_speed_mask field to
24028 	 * be configured.
24029 	 */
24030 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAM4_LINK_SPEED_MASK	UINT32_C(0x1000)
24031 	/* Port ID of port that is to be configured. */
24032 	uint16_t	port_id;
24033 	/*
24034 	 * This is the speed that will be used if the force
24035 	 * bit is '1'.  If unsupported speed is selected, an error
24036 	 * will be generated.
24037 	 */
24038 	uint16_t	force_link_speed;
24039 	/* 100Mb link speed */
24040 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
24041 	/* 1Gb link speed */
24042 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
24043 	/* 2Gb link speed */
24044 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
24045 	/* 25Gb link speed */
24046 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
24047 	/* 10Gb link speed */
24048 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
24049 	/* 20Mb link speed */
24050 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
24051 	/* 25Gb link speed */
24052 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
24053 	/* 40Gb link speed */
24054 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
24055 	/* 50Gb link speed */
24056 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
24057 	/* 100Gb link speed */
24058 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
24059 	/* 10Mb link speed */
24060 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
24061 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
24062 	/*
24063 	 * This value is used to identify what autoneg mode is
24064 	 * used when the link speed is not being forced.
24065 	 */
24066 	uint8_t	auto_mode;
24067 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
24068 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE	UINT32_C(0x0)
24069 	/* Select all possible speeds for autoneg mode. */
24070 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
24071 	/*
24072 	 * Select only the auto_link_speed speed for autoneg mode. This mode has
24073 	 * been DEPRECATED. An HWRM client should not use this mode.
24074 	 */
24075 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
24076 	/*
24077 	 * Select the auto_link_speed or any speed below that speed for autoneg.
24078 	 * This mode has been DEPRECATED. An HWRM client should not use this mode.
24079 	 */
24080 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
24081 	/*
24082 	 * Select the speeds based on the corresponding link speed mask values
24083 	 * that are provided. The included speeds are specified in the
24084 	 * auto_link_speed and auto_pam4_link_speed fields.
24085 	 */
24086 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
24087 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST	HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
24088 	/*
24089 	 * This is the duplex setting that will be used if the autoneg_mode
24090 	 * is "one_speed" or "one_or_below".
24091 	 */
24092 	uint8_t	auto_duplex;
24093 	/* Half Duplex will be requested. */
24094 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
24095 	/* Full duplex will be requested. */
24096 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
24097 	/* Both Half and Full duplex will be requested. */
24098 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
24099 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
24100 	/*
24101 	 * This value is used to configure the pause that will be
24102 	 * used for autonegotiation.
24103 	 * Add text on the usage of auto_pause and force_pause.
24104 	 */
24105 	uint8_t	auto_pause;
24106 	/*
24107 	 * When this bit is '1', Generation of tx pause messages
24108 	 * has been requested. Disabled otherwise.
24109 	 */
24110 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
24111 	/*
24112 	 * When this bit is '1', Reception of rx pause messages
24113 	 * has been requested. Disabled otherwise.
24114 	 */
24115 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
24116 	/*
24117 	 * When set to 1, the advertisement of pause is enabled.
24118 	 *
24119 	 * # When the auto_mode is not set to none and this flag is
24120 	 * set to 1, then the auto_pause bits on this port are being
24121 	 * advertised and autoneg pause results are being interpreted.
24122 	 * # When the auto_mode is not set to none and this
24123 	 * flag is set to 0, the pause is forced as indicated in
24124 	 * force_pause, and also advertised as auto_pause bits, but
24125 	 * the autoneg results are not interpreted since the pause
24126 	 * configuration is being forced.
24127 	 * # When the auto_mode is set to none and this flag is set to
24128 	 * 1, auto_pause bits should be ignored and should be set to 0.
24129 	 */
24130 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE	UINT32_C(0x4)
24131 	uint8_t	unused_0;
24132 	/*
24133 	 * This is the speed that will be used if the autoneg_mode
24134 	 * is "one_speed" or "one_or_below".  If an unsupported speed
24135 	 * is selected, an error will be generated.
24136 	 */
24137 	uint16_t	auto_link_speed;
24138 	/* 100Mb link speed */
24139 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
24140 	/* 1Gb link speed */
24141 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
24142 	/* 2Gb link speed */
24143 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
24144 	/* 25Gb link speed */
24145 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
24146 	/* 10Gb link speed */
24147 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
24148 	/* 20Mb link speed */
24149 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
24150 	/* 25Gb link speed */
24151 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
24152 	/* 40Gb link speed */
24153 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
24154 	/* 50Gb link speed */
24155 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
24156 	/* 100Gb link speed */
24157 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
24158 	/* 10Mb link speed */
24159 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
24160 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
24161 	/*
24162 	 * This is a mask of link speeds that will be used if
24163 	 * autoneg_mode is "mask".  If unsupported speed is enabled
24164 	 * an error will be generated.
24165 	 */
24166 	uint16_t	auto_link_speed_mask;
24167 	/* 100Mb link speed (Half-duplex) */
24168 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD	UINT32_C(0x1)
24169 	/* 100Mb link speed (Full-duplex) */
24170 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
24171 	/* 1Gb link speed (Half-duplex) */
24172 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD	UINT32_C(0x4)
24173 	/* 1Gb link speed (Full-duplex) */
24174 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
24175 	/* 2Gb link speed */
24176 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB	UINT32_C(0x10)
24177 	/* 25Gb link speed */
24178 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB	UINT32_C(0x20)
24179 	/* 10Gb link speed */
24180 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
24181 	/* 20Gb link speed */
24182 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB	UINT32_C(0x80)
24183 	/* 25Gb link speed */
24184 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB	UINT32_C(0x100)
24185 	/* 40Gb link speed */
24186 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB	UINT32_C(0x200)
24187 	/* 50Gb link speed */
24188 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB	UINT32_C(0x400)
24189 	/* 100Gb link speed */
24190 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB	UINT32_C(0x800)
24191 	/* 10Mb link speed (Half-duplex) */
24192 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD	UINT32_C(0x1000)
24193 	/* 10Mb link speed (Full-duplex) */
24194 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB	UINT32_C(0x2000)
24195 	/* This value controls the wirespeed feature. */
24196 	uint8_t	wirespeed;
24197 	/* Wirespeed feature is disabled. */
24198 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
24199 	/* Wirespeed feature is enabled. */
24200 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
24201 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
24202 	/* This value controls the loopback setting for the PHY. */
24203 	uint8_t	lpbk;
24204 	/* No loopback is selected.  Normal operation. */
24205 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE	UINT32_C(0x0)
24206 	/*
24207 	 * The HW will be configured with local loopback such that
24208 	 * host data is sent back to the host without modification.
24209 	 */
24210 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL	UINT32_C(0x1)
24211 	/*
24212 	 * The HW will be configured with remote loopback such that
24213 	 * port logic will send packets back out the transmitter that
24214 	 * are received.
24215 	 */
24216 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
24217 	/*
24218 	 * The HW will be configured with external loopback such that
24219 	 * host data is sent on the transmitter and based on the external
24220 	 * loopback connection the data will be received without modification.
24221 	 */
24222 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
24223 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST	HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
24224 	/*
24225 	 * This value is used to configure the pause that will be
24226 	 * used for force mode.
24227 	 */
24228 	uint8_t	force_pause;
24229 	/*
24230 	 * When this bit is '1', Generation of tx pause messages
24231 	 * is supported. Disabled otherwise.
24232 	 */
24233 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX	UINT32_C(0x1)
24234 	/*
24235 	 * When this bit is '1', Reception of rx pause messages
24236 	 * is supported. Disabled otherwise.
24237 	 */
24238 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX	UINT32_C(0x2)
24239 	uint8_t	unused_1;
24240 	/*
24241 	 * This value controls the pre-emphasis to be used for the
24242 	 * link.  Driver should not set this value (use
24243 	 * enable.preemphasis = 0) unless driver is sure of setting.
24244 	 * Normally HWRM FW will determine proper pre-emphasis.
24245 	 */
24246 	uint32_t	preemphasis;
24247 	/*
24248 	 * Setting for link speed mask that is used to
24249 	 * advertise speeds during autonegotiation when EEE is enabled.
24250 	 * This field is valid only when EEE is enabled.
24251 	 * The speeds specified in this field shall be a subset of
24252 	 * speeds specified in auto_link_speed_mask.
24253 	 * If EEE is enabled,then at least one speed shall be provided
24254 	 * in this mask.
24255 	 */
24256 	uint16_t	eee_link_speed_mask;
24257 	/* Reserved */
24258 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
24259 	/* 100Mb link speed (Full-duplex) */
24260 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
24261 	/* Reserved */
24262 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
24263 	/* 1Gb link speed (Full-duplex) */
24264 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
24265 	/* Reserved */
24266 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
24267 	/* Reserved */
24268 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
24269 	/* 10Gb link speed */
24270 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
24271 	/*
24272 	 * This is the speed that will be used if the force and force_pam4
24273 	 * bits are '1'.  If unsupported speed is selected, an error
24274 	 * will be generated.
24275 	 */
24276 	uint16_t	force_pam4_link_speed;
24277 	/* 50Gb link speed */
24278 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB  UINT32_C(0x1f4)
24279 	/* 100Gb link speed */
24280 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
24281 	/* 200Gb link speed */
24282 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
24283 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
24284 	/*
24285 	 * Requested setting of TX LPI timer in microseconds.
24286 	 * This field is valid only when EEE is enabled and TX LPI is
24287 	 * enabled.
24288 	 */
24289 	uint32_t	tx_lpi_timer;
24290 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
24291 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
24292 	/* This field specifies which PAM4 speeds are enabled for auto mode. */
24293 	uint16_t	auto_link_pam4_speed_mask;
24294 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_50G	UINT32_C(0x1)
24295 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_100G	UINT32_C(0x2)
24296 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_200G	UINT32_C(0x4)
24297 	uint8_t	unused_2[2];
24298 } hwrm_port_phy_cfg_input_t, *phwrm_port_phy_cfg_input_t;
24299 
24300 /* hwrm_port_phy_cfg_output (size:128b/16B) */
24301 
24302 typedef struct hwrm_port_phy_cfg_output {
24303 	/* The specific error status for the command. */
24304 	uint16_t	error_code;
24305 	/* The HWRM command request type. */
24306 	uint16_t	req_type;
24307 	/* The sequence ID from the original command. */
24308 	uint16_t	seq_id;
24309 	/* The length of the response data in number of bytes. */
24310 	uint16_t	resp_len;
24311 	uint8_t	unused_0[7];
24312 	/*
24313 	 * This field is used in Output records to indicate that the output
24314 	 * is completely written to RAM.  This field should be read as '1'
24315 	 * to indicate that the output has been completely written.
24316 	 * When writing a command completion or response to an internal processor,
24317 	 * the order of writes has to be such that this field is written last.
24318 	 */
24319 	uint8_t	valid;
24320 } hwrm_port_phy_cfg_output_t, *phwrm_port_phy_cfg_output_t;
24321 
24322 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
24323 
24324 typedef struct hwrm_port_phy_cfg_cmd_err {
24325 	/*
24326 	 * command specific error codes that goes to
24327 	 * the cmd_err field in Common HWRM Error Response.
24328 	 */
24329 	uint8_t	code;
24330 	/* Unknown error */
24331 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
24332 	/* Unable to complete operation due to invalid speed */
24333 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
24334 	/*
24335 	 * retry the command since the phy is not ready.
24336 	 * retry count is returned in opaque_0.
24337 	 * This is only valid for the first command and
24338 	 * this value will not change for successive calls.
24339 	 * but if a 0 is returned at any time then this should
24340 	 * be treated as an un recoverable failure,
24341 	 *
24342 	 * retry interval in milli seconds is returned in opaque_1.
24343 	 * This specifies the time that user should wait before
24344 	 * issuing the next port_phy_cfg command.
24345 	 */
24346 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY	UINT32_C(0x2)
24347 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST	HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
24348 	uint8_t	unused_0[7];
24349 } hwrm_port_phy_cfg_cmd_err_t, *phwrm_port_phy_cfg_cmd_err_t;
24350 
24351 /**********************
24352  * hwrm_port_phy_qcfg *
24353  **********************/
24354 
24355 
24356 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
24357 
24358 typedef struct hwrm_port_phy_qcfg_input {
24359 	/* The HWRM command request type. */
24360 	uint16_t	req_type;
24361 	/*
24362 	 * The completion ring to send the completion event on. This should
24363 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24364 	 */
24365 	uint16_t	cmpl_ring;
24366 	/*
24367 	 * The sequence ID is used by the driver for tracking multiple
24368 	 * commands. This ID is treated as opaque data by the firmware and
24369 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24370 	 */
24371 	uint16_t	seq_id;
24372 	/*
24373 	 * The target ID of the command:
24374 	 * * 0x0-0xFFF8 - The function ID
24375 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24376 	 * * 0xFFFD - Reserved for user-space HWRM interface
24377 	 * * 0xFFFF - HWRM
24378 	 */
24379 	uint16_t	target_id;
24380 	/*
24381 	 * A physical address pointer pointing to a host buffer that the
24382 	 * command's response data will be written. This can be either a host
24383 	 * physical address (HPA) or a guest physical address (GPA) and must
24384 	 * point to a physically contiguous block of memory.
24385 	 */
24386 	uint64_t	resp_addr;
24387 	/* Port ID of port that is to be queried. */
24388 	uint16_t	port_id;
24389 	uint8_t	unused_0[6];
24390 } hwrm_port_phy_qcfg_input_t, *phwrm_port_phy_qcfg_input_t;
24391 
24392 /* hwrm_port_phy_qcfg_output (size:832b/104B) */
24393 
24394 typedef struct hwrm_port_phy_qcfg_output {
24395 	/* The specific error status for the command. */
24396 	uint16_t	error_code;
24397 	/* The HWRM command request type. */
24398 	uint16_t	req_type;
24399 	/* The sequence ID from the original command. */
24400 	uint16_t	seq_id;
24401 	/* The length of the response data in number of bytes. */
24402 	uint16_t	resp_len;
24403 	/* This value indicates the current link status. */
24404 	uint8_t	link;
24405 	/* There is no link or cable detected. */
24406 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
24407 	/* There is no link, but a cable has been detected. */
24408 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
24409 	/* There is a link. */
24410 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK	UINT32_C(0x2)
24411 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST   HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
24412 	uint8_t	active_fec_signal_mode;
24413 	/*
24414 	 * This value indicates the current link signaling mode of the
24415 	 * connection.
24416 	 */
24417 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK		UINT32_C(0xf)
24418 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_SFT		0
24419 	/* NRZ signaling */
24420 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ		UINT32_C(0x0)
24421 	/* PAM4 signaling */
24422 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4		UINT32_C(0x1)
24423 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4
24424 	/* This value indicates the current active FEC mode. */
24425 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_MASK		UINT32_C(0xf0)
24426 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_SFT		4
24427 	/* No active FEC */
24428 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_NONE_ACTIVE	(UINT32_C(0x0) << 4)
24429 	/* FEC CLAUSE 74 (Fire Code) active, autonegotiated or forced. */
24430 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE	(UINT32_C(0x1) << 4)
24431 	/* FEC CLAUSE 91 RS(528,514) active, autonegoatiated or forced. */
24432 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE	(UINT32_C(0x2) << 4)
24433 	/* FEC RS544_1XN active, autonegoatiated or forced. */
24434 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE   (UINT32_C(0x3) << 4)
24435 	/* FEC RS(544,528) active, autonegoatiated or forced. */
24436 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE  (UINT32_C(0x4) << 4)
24437 	/* FEC RS272_1XN active, autonegotiated or forced. */
24438 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE   (UINT32_C(0x5) << 4)
24439 	/* FEC RS(272,257) active, autonegoatiated or forced. */
24440 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE  (UINT32_C(0x6) << 4)
24441 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE
24442 	/*
24443 	 * This value indicates the current link speed of the connection.
24444 	 * The signal_mode field indicates if the link is using
24445 	 * NRZ or PAM4 signaling.
24446 	 */
24447 	uint16_t	link_speed;
24448 	/* 100Mb link speed */
24449 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
24450 	/* 1Gb link speed */
24451 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
24452 	/* 2Gb link speed */
24453 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
24454 	/* 25Gb link speed */
24455 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
24456 	/* 10Gb link speed */
24457 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
24458 	/* 20Mb link speed */
24459 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
24460 	/* 25Gb link speed */
24461 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
24462 	/* 40Gb link speed */
24463 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
24464 	/* 50Gb link speed */
24465 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
24466 	/* 100Gb link speed */
24467 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
24468 	/* 200Gb link speed */
24469 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
24470 	/* 10Mb link speed */
24471 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
24472 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
24473 	/*
24474 	 * This value is indicates the duplex of the current
24475 	 * configuration.
24476 	 */
24477 	uint8_t	duplex_cfg;
24478 	/* Half Duplex connection. */
24479 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
24480 	/* Full duplex connection. */
24481 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
24482 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
24483 	/*
24484 	 * This value is used to indicate the current
24485 	 * pause configuration. When autoneg is enabled, this value
24486 	 * represents the autoneg results of pause configuration.
24487 	 */
24488 	uint8_t	pause;
24489 	/*
24490 	 * When this bit is '1', Generation of tx pause messages
24491 	 * is supported. Disabled otherwise.
24492 	 */
24493 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX	UINT32_C(0x1)
24494 	/*
24495 	 * When this bit is '1', Reception of rx pause messages
24496 	 * is supported. Disabled otherwise.
24497 	 */
24498 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX	UINT32_C(0x2)
24499 	/*
24500 	 * The supported speeds for the port. This is a bit mask.
24501 	 * For each speed that is supported, the corresponding
24502 	 * bit will be set to '1'.
24503 	 */
24504 	uint16_t	support_speeds;
24505 	/* 100Mb link speed (Half-duplex) */
24506 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD	UINT32_C(0x1)
24507 	/* 100Mb link speed (Full-duplex) */
24508 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB	UINT32_C(0x2)
24509 	/* 1Gb link speed (Half-duplex) */
24510 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD	UINT32_C(0x4)
24511 	/* 1Gb link speed (Full-duplex) */
24512 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB	UINT32_C(0x8)
24513 	/* 2Gb link speed */
24514 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB	UINT32_C(0x10)
24515 	/* 25Gb link speed */
24516 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB	UINT32_C(0x20)
24517 	/* 10Gb link speed */
24518 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB	UINT32_C(0x40)
24519 	/* 20Gb link speed */
24520 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB	UINT32_C(0x80)
24521 	/* 25Gb link speed */
24522 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB	UINT32_C(0x100)
24523 	/* 40Gb link speed */
24524 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB	UINT32_C(0x200)
24525 	/* 50Gb link speed */
24526 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB	UINT32_C(0x400)
24527 	/* 100Gb link speed */
24528 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB	UINT32_C(0x800)
24529 	/* 10Mb link speed (Half-duplex) */
24530 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD	UINT32_C(0x1000)
24531 	/* 10Mb link speed (Full-duplex) */
24532 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB	UINT32_C(0x2000)
24533 	/*
24534 	 * Current setting of forced link speed.
24535 	 * When the link speed is not being forced, this
24536 	 * value shall be set to 0.
24537 	 */
24538 	uint16_t	force_link_speed;
24539 	/* 100Mb link speed */
24540 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
24541 	/* 1Gb link speed */
24542 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
24543 	/* 2Gb link speed */
24544 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
24545 	/* 25Gb link speed */
24546 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
24547 	/* 10Gb link speed */
24548 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
24549 	/* 20Mb link speed */
24550 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
24551 	/* 25Gb link speed */
24552 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
24553 	/* 40Gb link speed */
24554 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
24555 	/* 50Gb link speed */
24556 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
24557 	/* 100Gb link speed */
24558 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
24559 	/* 10Mb link speed */
24560 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
24561 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
24562 	/* Current setting of auto negotiation mode. */
24563 	uint8_t	auto_mode;
24564 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
24565 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE	UINT32_C(0x0)
24566 	/* Select all possible speeds for autoneg mode. */
24567 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
24568 	/*
24569 	 * Select only the auto_link_speed speed for autoneg mode. This mode has
24570 	 * been DEPRECATED. An HWRM client should not use this mode.
24571 	 */
24572 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
24573 	/*
24574 	 * Select the auto_link_speed or any speed below that speed for autoneg.
24575 	 * This mode has been DEPRECATED. An HWRM client should not use this mode.
24576 	 */
24577 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
24578 	/*
24579 	 * Select the speeds based on the corresponding link speed mask value
24580 	 * that is provided.
24581 	 */
24582 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
24583 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
24584 	/*
24585 	 * Current setting of pause autonegotiation.
24586 	 * Move autoneg_pause flag here.
24587 	 */
24588 	uint8_t	auto_pause;
24589 	/*
24590 	 * When this bit is '1', Generation of tx pause messages
24591 	 * has been requested. Disabled otherwise.
24592 	 */
24593 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
24594 	/*
24595 	 * When this bit is '1', Reception of rx pause messages
24596 	 * has been requested. Disabled otherwise.
24597 	 */
24598 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
24599 	/*
24600 	 * When set to 1, the advertisement of pause is enabled.
24601 	 *
24602 	 * # When the auto_mode is not set to none and this flag is
24603 	 * set to 1, then the auto_pause bits on this port are being
24604 	 * advertised and autoneg pause results are being interpreted.
24605 	 * # When the auto_mode is not set to none and this
24606 	 * flag is set to 0, the pause is forced as indicated in
24607 	 * force_pause, and also advertised as auto_pause bits, but
24608 	 * the autoneg results are not interpreted since the pause
24609 	 * configuration is being forced.
24610 	 * # When the auto_mode is set to none and this flag is set to
24611 	 * 1, auto_pause bits should be ignored and should be set to 0.
24612 	 */
24613 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE	UINT32_C(0x4)
24614 	/*
24615 	 * Current setting for auto_link_speed. This field is only
24616 	 * valid when auto_mode is set to "one_speed" or "one_or_below".
24617 	 */
24618 	uint16_t	auto_link_speed;
24619 	/* 100Mb link speed */
24620 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
24621 	/* 1Gb link speed */
24622 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
24623 	/* 2Gb link speed */
24624 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
24625 	/* 25Gb link speed */
24626 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
24627 	/* 10Gb link speed */
24628 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
24629 	/* 20Mb link speed */
24630 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
24631 	/* 25Gb link speed */
24632 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
24633 	/* 40Gb link speed */
24634 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
24635 	/* 50Gb link speed */
24636 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
24637 	/* 100Gb link speed */
24638 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
24639 	/* 10Mb link speed */
24640 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
24641 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
24642 	/*
24643 	 * Current setting for auto_link_speed_mask that is used to
24644 	 * advertise speeds during autonegotiation.
24645 	 * This field is only valid when auto_mode is set to "mask".
24646 	 * The speeds specified in this field shall be a subset of
24647 	 * supported speeds on this port.
24648 	 */
24649 	uint16_t	auto_link_speed_mask;
24650 	/* 100Mb link speed (Half-duplex) */
24651 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD	UINT32_C(0x1)
24652 	/* 100Mb link speed (Full-duplex) */
24653 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
24654 	/* 1Gb link speed (Half-duplex) */
24655 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD	UINT32_C(0x4)
24656 	/* 1Gb link speed (Full-duplex) */
24657 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
24658 	/* 2Gb link speed */
24659 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB	UINT32_C(0x10)
24660 	/* 25Gb link speed */
24661 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB	UINT32_C(0x20)
24662 	/* 10Gb link speed */
24663 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
24664 	/* 20Gb link speed */
24665 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB	UINT32_C(0x80)
24666 	/* 25Gb link speed */
24667 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB	UINT32_C(0x100)
24668 	/* 40Gb link speed */
24669 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB	UINT32_C(0x200)
24670 	/* 50Gb link speed */
24671 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB	UINT32_C(0x400)
24672 	/* 100Gb link speed */
24673 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB	UINT32_C(0x800)
24674 	/* 10Mb link speed (Half-duplex) */
24675 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD	UINT32_C(0x1000)
24676 	/* 10Mb link speed (Full-duplex) */
24677 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB	UINT32_C(0x2000)
24678 	/* Current setting for wirespeed. */
24679 	uint8_t	wirespeed;
24680 	/* Wirespeed feature is disabled. */
24681 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
24682 	/* Wirespeed feature is enabled. */
24683 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
24684 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
24685 	/* Current setting for loopback. */
24686 	uint8_t	lpbk;
24687 	/* No loopback is selected.  Normal operation. */
24688 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE	UINT32_C(0x0)
24689 	/*
24690 	 * The HW will be configured with local loopback such that
24691 	 * host data is sent back to the host without modification.
24692 	 */
24693 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL	UINT32_C(0x1)
24694 	/*
24695 	 * The HW will be configured with remote loopback such that
24696 	 * port logic will send packets back out the transmitter that
24697 	 * are received.
24698 	 */
24699 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
24700 	/*
24701 	 * The HW will be configured with external loopback such that
24702 	 * host data is sent on the transmitter and based on the external
24703 	 * loopback connection the data will be received without modification.
24704 	 */
24705 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
24706 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
24707 	/*
24708 	 * Current setting of forced pause.
24709 	 * When the pause configuration is not being forced, then
24710 	 * this value shall be set to 0.
24711 	 */
24712 	uint8_t	force_pause;
24713 	/*
24714 	 * When this bit is '1', Generation of tx pause messages
24715 	 * is supported. Disabled otherwise.
24716 	 */
24717 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX	UINT32_C(0x1)
24718 	/*
24719 	 * When this bit is '1', Reception of rx pause messages
24720 	 * is supported. Disabled otherwise.
24721 	 */
24722 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX	UINT32_C(0x2)
24723 	/*
24724 	 * This value indicates the current status of the optics module on
24725 	 * this port.
24726 	 */
24727 	uint8_t	module_status;
24728 	/* Module is inserted and accepted */
24729 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE	UINT32_C(0x0)
24730 	/* Module is rejected and transmit side Laser is disabled. */
24731 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX	UINT32_C(0x1)
24732 	/* Module mismatch warning. */
24733 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG	UINT32_C(0x2)
24734 	/* Module is rejected and powered down. */
24735 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN	UINT32_C(0x3)
24736 	/* Module is not inserted. */
24737 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED   UINT32_C(0x4)
24738 	/* Module is powered down because of over current fault. */
24739 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT  UINT32_C(0x5)
24740 	/* Module status is not applicable. */
24741 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE UINT32_C(0xff)
24742 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
24743 	/* Current setting for preemphasis. */
24744 	uint32_t	preemphasis;
24745 	/* This field represents the major version of the PHY. */
24746 	uint8_t	phy_maj;
24747 	/* This field represents the minor version of the PHY. */
24748 	uint8_t	phy_min;
24749 	/* This field represents the build version of the PHY. */
24750 	uint8_t	phy_bld;
24751 	/* This value represents a PHY type. */
24752 	uint8_t	phy_type;
24753 	/* Unknown */
24754 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN	UINT32_C(0x0)
24755 	/* BASE-CR */
24756 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR	UINT32_C(0x1)
24757 	/* BASE-KR4 (Deprecated) */
24758 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4	UINT32_C(0x2)
24759 	/* BASE-LR */
24760 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR	UINT32_C(0x3)
24761 	/* BASE-SR */
24762 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR	UINT32_C(0x4)
24763 	/* BASE-KR2 (Deprecated) */
24764 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2	UINT32_C(0x5)
24765 	/* BASE-KX */
24766 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX	UINT32_C(0x6)
24767 	/* BASE-KR */
24768 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR	UINT32_C(0x7)
24769 	/* BASE-T */
24770 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET		UINT32_C(0x8)
24771 	/* EEE capable BASE-T */
24772 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE	UINT32_C(0x9)
24773 	/* SGMII connected external PHY */
24774 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY	UINT32_C(0xa)
24775 	/* 25G_BASECR_CA_L */
24776 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L  UINT32_C(0xb)
24777 	/* 25G_BASECR_CA_S */
24778 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S  UINT32_C(0xc)
24779 	/* 25G_BASECR_CA_N */
24780 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N  UINT32_C(0xd)
24781 	/* 25G_BASESR */
24782 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR	UINT32_C(0xe)
24783 	/* 100G_BASECR4 */
24784 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4	UINT32_C(0xf)
24785 	/* 100G_BASESR4 */
24786 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4	UINT32_C(0x10)
24787 	/* 100G_BASELR4 */
24788 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4	UINT32_C(0x11)
24789 	/* 100G_BASEER4 */
24790 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4	UINT32_C(0x12)
24791 	/* 100G_BASESR10 */
24792 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10	UINT32_C(0x13)
24793 	/* 40G_BASECR4 */
24794 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4	UINT32_C(0x14)
24795 	/* 40G_BASESR4 */
24796 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4	UINT32_C(0x15)
24797 	/* 40G_BASELR4 */
24798 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4	UINT32_C(0x16)
24799 	/* 40G_BASEER4 */
24800 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4	UINT32_C(0x17)
24801 	/* 40G_ACTIVE_CABLE */
24802 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE UINT32_C(0x18)
24803 	/* 1G_baseT */
24804 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET	UINT32_C(0x19)
24805 	/* 1G_baseSX */
24806 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX	UINT32_C(0x1a)
24807 	/* 1G_baseCX */
24808 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX	UINT32_C(0x1b)
24809 	/* 200G_BASECR4 */
24810 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4	UINT32_C(0x1c)
24811 	/* 200G_BASESR4 */
24812 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4	UINT32_C(0x1d)
24813 	/* 200G_BASELR4 */
24814 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4	UINT32_C(0x1e)
24815 	/* 200G_BASEER4 */
24816 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4	UINT32_C(0x1f)
24817 	/* 50G_BASECR */
24818 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASECR	UINT32_C(0x20)
24819 	/* 50G_BASESR */
24820 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASESR	UINT32_C(0x21)
24821 	/* 50G_BASELR */
24822 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASELR	UINT32_C(0x22)
24823 	/* 50G_BASEER */
24824 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASEER	UINT32_C(0x23)
24825 	/* 100G_BASECR2 */
24826 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR2	UINT32_C(0x24)
24827 	/* 100G_BASESR2 */
24828 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR2	UINT32_C(0x25)
24829 	/* 100G_BASELR2 */
24830 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR2	UINT32_C(0x26)
24831 	/* 100G_BASEER2 */
24832 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER2	UINT32_C(0x27)
24833 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER2
24834 	/* This value represents a media type. */
24835 	uint8_t	media_type;
24836 	/* Unknown */
24837 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
24838 	/* Twisted Pair */
24839 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP	UINT32_C(0x1)
24840 	/* Direct Attached Copper */
24841 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC	UINT32_C(0x2)
24842 	/* Fiber */
24843 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
24844 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST   HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
24845 	/* This value represents a transceiver type. */
24846 	uint8_t	xcvr_pkg_type;
24847 	/* PHY and MAC are in the same package */
24848 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL UINT32_C(0x1)
24849 	/* PHY and MAC are in different packages */
24850 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL UINT32_C(0x2)
24851 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
24852 	uint8_t	eee_config_phy_addr;
24853 	/* This field represents PHY address. */
24854 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK		UINT32_C(0x1f)
24855 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT		0
24856 	/*
24857 	 * This field represents flags related to EEE configuration.
24858 	 * These EEE configuration flags are valid only when the
24859 	 * auto_mode is not set to none (in other words autonegotiation
24860 	 * is enabled).
24861 	 */
24862 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK		UINT32_C(0xe0)
24863 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT		5
24864 	/*
24865 	 * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
24866 	 * Speeds for autoneg with EEE mode enabled
24867 	 * are based on eee_link_speed_mask.
24868 	 */
24869 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED	UINT32_C(0x20)
24870 	/*
24871 	 * This flag is valid only when eee_enabled is set to 1.
24872 	 *
24873 	 * # If eee_enabled is set to 0, then EEE mode is disabled
24874 	 * and this flag shall be ignored.
24875 	 * # If eee_enabled is set to 1 and this flag is set to 1,
24876 	 * then Energy Efficient Ethernet (EEE) mode is enabled
24877 	 * and in use.
24878 	 * # If eee_enabled is set to 1 and this flag is set to 0,
24879 	 * then Energy Efficient Ethernet (EEE) mode is enabled
24880 	 * but is currently not in use.
24881 	 */
24882 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE	UINT32_C(0x40)
24883 	/*
24884 	 * This flag is valid only when eee_enabled is set to 1.
24885 	 *
24886 	 * # If eee_enabled is set to 0, then EEE mode is disabled
24887 	 * and this flag shall be ignored.
24888 	 * # If eee_enabled is set to 1 and this flag is set to 1,
24889 	 * then Energy Efficient Ethernet (EEE) mode is enabled
24890 	 * and TX LPI is enabled.
24891 	 * # If eee_enabled is set to 1 and this flag is set to 0,
24892 	 * then Energy Efficient Ethernet (EEE) mode is enabled
24893 	 * but TX LPI is disabled.
24894 	 */
24895 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI	UINT32_C(0x80)
24896 	/*
24897 	 * When set to 1, the parallel detection is used to determine
24898 	 * the speed of the link partner.
24899 	 *
24900 	 * Parallel detection is used when a autonegotiation capable
24901 	 * device is connected to a link partner that is not capable
24902 	 * of autonegotiation.
24903 	 */
24904 	uint8_t	parallel_detect;
24905 	/*
24906 	 * When set to 1, the parallel detection is used to determine
24907 	 * the speed of the link partner.
24908 	 *
24909 	 * Parallel detection is used when a autonegotiation capable
24910 	 * device is connected to a link partner that is not capable
24911 	 * of autonegotiation.
24912 	 */
24913 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT	UINT32_C(0x1)
24914 	/*
24915 	 * The advertised speeds for the port by the link partner.
24916 	 * Each advertised speed will be set to '1'.
24917 	 */
24918 	uint16_t	link_partner_adv_speeds;
24919 	/* 100Mb link speed (Half-duplex) */
24920 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD	UINT32_C(0x1)
24921 	/* 100Mb link speed (Full-duplex) */
24922 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB	UINT32_C(0x2)
24923 	/* 1Gb link speed (Half-duplex) */
24924 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD	UINT32_C(0x4)
24925 	/* 1Gb link speed (Full-duplex) */
24926 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB	UINT32_C(0x8)
24927 	/* 2Gb link speed */
24928 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB	UINT32_C(0x10)
24929 	/* 25Gb link speed */
24930 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB	UINT32_C(0x20)
24931 	/* 10Gb link speed */
24932 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB	UINT32_C(0x40)
24933 	/* 20Gb link speed */
24934 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB	UINT32_C(0x80)
24935 	/* 25Gb link speed */
24936 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB	UINT32_C(0x100)
24937 	/* 40Gb link speed */
24938 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB	UINT32_C(0x200)
24939 	/* 50Gb link speed */
24940 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB	UINT32_C(0x400)
24941 	/* 100Gb link speed */
24942 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB	UINT32_C(0x800)
24943 	/* 10Mb link speed (Half-duplex) */
24944 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD	UINT32_C(0x1000)
24945 	/* 10Mb link speed (Full-duplex) */
24946 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB	UINT32_C(0x2000)
24947 	/*
24948 	 * The advertised autoneg for the port by the link partner.
24949 	 * This field is deprecated and should be set to 0.
24950 	 */
24951 	uint8_t	link_partner_adv_auto_mode;
24952 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
24953 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE	UINT32_C(0x0)
24954 	/* Select all possible speeds for autoneg mode. */
24955 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
24956 	/*
24957 	 * Select only the auto_link_speed speed for autoneg mode. This mode has
24958 	 * been DEPRECATED. An HWRM client should not use this mode.
24959 	 */
24960 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
24961 	/*
24962 	 * Select the auto_link_speed or any speed below that speed for autoneg.
24963 	 * This mode has been DEPRECATED. An HWRM client should not use this mode.
24964 	 */
24965 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
24966 	/*
24967 	 * Select the speeds based on the corresponding link speed mask value
24968 	 * that is provided.
24969 	 */
24970 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
24971 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
24972 	/* The advertised pause settings on the port by the link partner. */
24973 	uint8_t	link_partner_adv_pause;
24974 	/*
24975 	 * When this bit is '1', Generation of tx pause messages
24976 	 * is supported. Disabled otherwise.
24977 	 */
24978 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX	UINT32_C(0x1)
24979 	/*
24980 	 * When this bit is '1', Reception of rx pause messages
24981 	 * is supported. Disabled otherwise.
24982 	 */
24983 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX	UINT32_C(0x2)
24984 	/*
24985 	 * Current setting for link speed mask that is used to
24986 	 * advertise speeds during autonegotiation when EEE is enabled.
24987 	 * This field is valid only when eee_enabled flags is set to 1.
24988 	 * The speeds specified in this field shall be a subset of
24989 	 * speeds specified in auto_link_speed_mask.
24990 	 */
24991 	uint16_t	adv_eee_link_speed_mask;
24992 	/* Reserved */
24993 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
24994 	/* 100Mb link speed (Full-duplex) */
24995 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
24996 	/* Reserved */
24997 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
24998 	/* 1Gb link speed (Full-duplex) */
24999 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
25000 	/* Reserved */
25001 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
25002 	/* Reserved */
25003 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
25004 	/* 10Gb link speed */
25005 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
25006 	/*
25007 	 * Current setting for link speed mask that is advertised by
25008 	 * the link partner when EEE is enabled.
25009 	 * This field is valid only when eee_enabled flags is set to 1.
25010 	 */
25011 	uint16_t	link_partner_adv_eee_link_speed_mask;
25012 	/* Reserved */
25013 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
25014 	/* 100Mb link speed (Full-duplex) */
25015 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
25016 	/* Reserved */
25017 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
25018 	/* 1Gb link speed (Full-duplex) */
25019 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
25020 	/* Reserved */
25021 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
25022 	/* Reserved */
25023 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
25024 	/* 10Gb link speed */
25025 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
25026 	uint32_t	xcvr_identifier_type_tx_lpi_timer;
25027 	/*
25028 	 * Current setting of TX LPI timer in microseconds.
25029 	 * This field is valid only when_eee_enabled flag is set to 1
25030 	 * and tx_lpi_enabled is set to 1.
25031 	 */
25032 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK		UINT32_C(0xffffff)
25033 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT		0
25034 	/* This value represents transceiver identifier type. */
25035 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK	UINT32_C(0xff000000)
25036 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT	24
25037 	/* Unknown */
25038 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN   (UINT32_C(0x0) << 24)
25039 	/* SFP/SFP+/SFP28 */
25040 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP	(UINT32_C(0x3) << 24)
25041 	/* QSFP+ */
25042 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP	(UINT32_C(0xc) << 24)
25043 	/* QSFP+ */
25044 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS  (UINT32_C(0xd) << 24)
25045 	/* QSFP28 */
25046 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28	(UINT32_C(0x11) << 24)
25047 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
25048 	/*
25049 	 * This value represents the current configuration of
25050 	 * Forward Error Correction (FEC) on the port.
25051 	 */
25052 	uint16_t	fec_cfg;
25053 	/*
25054 	 * When set to 1, then FEC is not supported on this port. If this flag
25055 	 * is set to 1, then all other FEC configuration flags shall be ignored.
25056 	 * When set to 0, then FEC is supported as indicated by other
25057 	 * configuration flags.
25058 	 */
25059 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED	UINT32_C(0x1)
25060 	/*
25061 	 * When set to 1, then FEC autonegotiation is supported on this port.
25062 	 * When set to 0, then FEC autonegotiation is not supported on this port.
25063 	 */
25064 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED	UINT32_C(0x2)
25065 	/*
25066 	 * When set to 1, then FEC autonegotiation is enabled on this port.
25067 	 * When set to 0, then FEC autonegotiation is disabled if supported.
25068 	 * This flag should be ignored if FEC autonegotiation is not supported on this port.
25069 	 */
25070 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED	UINT32_C(0x4)
25071 	/*
25072 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
25073 	 * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
25074 	 */
25075 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED	UINT32_C(0x8)
25076 	/*
25077 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
25078 	 * port. This means that FEC CLAUSE 74 is either advertised if
25079 	 * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
25080 	 * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
25081 	 * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
25082 	 */
25083 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED	UINT32_C(0x10)
25084 	/*
25085 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
25086 	 * NRZ) is supported on this port.
25087 	 * When set to 0, then FEC RS(528,418) is not supported on this port.
25088 	 */
25089 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED	UINT32_C(0x20)
25090 	/*
25091 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
25092 	 * NRZ) is enabled on this port. This means that FEC RS(528,514) is
25093 	 * either advertised if FEC autonegotiation is enabled or FEC
25094 	 * RS(528,514) is force enabled.  When set to 0, then FEC RS(528,514)
25095 	 * is disabled if supported.
25096 	 * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
25097 	 */
25098 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED	UINT32_C(0x40)
25099 	/*
25100 	 * When set to 1, then FEC RS544_1XN is supported on this port.
25101 	 * When set to 0, then FEC RS544_1XN is not supported on this port.
25102 	 */
25103 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED	UINT32_C(0x80)
25104 	/*
25105 	 * When set to 1, then RS544_1XN is enabled on this
25106 	 * port. This means that FEC RS544_1XN is either advertised if
25107 	 * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
25108 	 * When set to 0, then FEC RS544_1XN is disabled if supported.
25109 	 * This flag should be ignored if FEC RS544_1XN is not supported on this port.
25110 	 */
25111 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED	UINT32_C(0x100)
25112 	/*
25113 	 * When set to 1, then FEC RS(544,514) is supported on this port.
25114 	 * When set to 0, then FEC RS(544,514) is not supported on this port.
25115 	 */
25116 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_SUPPORTED	UINT32_C(0x200)
25117 	/*
25118 	 * When set to 1, then RS(544,514) is enabled on this
25119 	 * port. This means that FEC RS(544,514) is either advertised if
25120 	 * FEC autonegotiation is enabled or FEC RS(544,514) is force
25121 	 * enabled.  When set to 0, then FEC RS(544,514) is disabled if supported.
25122 	 * This flag should be ignored if FEC RS(544,514) is not supported on this port.
25123 	 */
25124 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_ENABLED	UINT32_C(0x400)
25125 	/*
25126 	 * When set to 1, then FEC RS272_1XN is supported on this port.
25127 	 * When set to 0, then FEC RS272_1XN is not supported on this port.
25128 	 */
25129 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_SUPPORTED	UINT32_C(0x800)
25130 	/*
25131 	 * When set to 1, then RS272_1XN is enabled on this
25132 	 * port. This means that FEC RS272_1XN is either advertised if
25133 	 * FEC autonegotiation is enabled or FEC RS272_1XN is force
25134 	 * enabled.  When set to 0, then FEC RS272_1XN is disabled if supported.
25135 	 * This flag should be ignored if FEC RS272_1XN is not supported on this port.
25136 	 */
25137 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_ENABLED	UINT32_C(0x1000)
25138 	/*
25139 	 * When set to 1, then FEC RS(272,514) is supported on this port.
25140 	 * When set to 0, then FEC RS(272,514) is not supported on this port.
25141 	 */
25142 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_SUPPORTED	UINT32_C(0x2000)
25143 	/*
25144 	 * When set to 1, then RS(272,257) is enabled on this
25145 	 * port. This means that FEC RS(272,257) is either advertised if
25146 	 * FEC autonegotiation is enabled or FEC RS(272,257) is force
25147 	 * enabled.  When set to 0, then FEC RS(272,257) is disabled if supported.
25148 	 * This flag should be ignored if FEC RS(272,257) is not supported on this port.
25149 	 */
25150 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_ENABLED	UINT32_C(0x4000)
25151 	/*
25152 	 * This value is indicates the duplex of the current
25153 	 * connection state.
25154 	 */
25155 	uint8_t	duplex_state;
25156 	/* Half Duplex connection. */
25157 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
25158 	/* Full duplex connection. */
25159 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
25160 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
25161 	/* Option flags fields. */
25162 	uint8_t	option_flags;
25163 	/* When this bit is '1', Media auto detect is enabled. */
25164 	#define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT	UINT32_C(0x1)
25165 	/*
25166 	 * When this bit is '1', active_fec_signal_mode can be
25167 	 * trusted.
25168 	 */
25169 	#define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN	UINT32_C(0x2)
25170 	/*
25171 	 * Up to 16 bytes of null padded ASCII string representing
25172 	 * PHY vendor.
25173 	 * If the string is set to null, then the vendor name is not
25174 	 * available.
25175 	 */
25176 	char	phy_vendor_name[16];
25177 	/*
25178 	 * Up to 16 bytes of null padded ASCII string that
25179 	 * identifies vendor specific part number of the PHY.
25180 	 * If the string is set to null, then the vendor specific
25181 	 * part number is not available.
25182 	 */
25183 	char	phy_vendor_partnumber[16];
25184 	/*
25185 	 * The supported PAM4 speeds for the port. This is a bit mask.
25186 	 * For each speed that is supported, the corresponding
25187 	 * bit will be set to '1'.
25188 	 */
25189 	uint16_t	support_pam4_speeds;
25190 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G	UINT32_C(0x1)
25191 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G	UINT32_C(0x2)
25192 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G	UINT32_C(0x4)
25193 	/*
25194 	 * Current setting of forced PAM4 link speed.
25195 	 * When the link speed is not being forced, this
25196 	 * value shall be set to 0.
25197 	 */
25198 	uint16_t	force_pam4_link_speed;
25199 	/* 50Gb link speed */
25200 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_50GB  UINT32_C(0x1f4)
25201 	/* 100Gb link speed */
25202 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
25203 	/* 200Gb link speed */
25204 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
25205 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB
25206 	/*
25207 	 * Current setting for auto_pam4_link_speed_mask that is used to
25208 	 * advertise speeds during autonegotiation.
25209 	 * This field is only valid when auto_mode is set to "mask".
25210 	 * The speeds specified in this field shall be a subset of
25211 	 * supported speeds on this port.
25212 	 */
25213 	uint16_t	auto_pam4_link_speed_mask;
25214 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_50G	UINT32_C(0x1)
25215 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_100G	UINT32_C(0x2)
25216 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_200G	UINT32_C(0x4)
25217 	/*
25218 	 * The advertised PAM4 speeds for the port by the link partner.
25219 	 * Each advertised speed will be set to '1'.
25220 	 */
25221 	uint8_t	link_partner_pam4_adv_speeds;
25222 	/* 50Gb link speed */
25223 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB	UINT32_C(0x1)
25224 	/* 100Gb link speed */
25225 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB	UINT32_C(0x2)
25226 	/* 200Gb link speed */
25227 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB	UINT32_C(0x4)
25228 	/*
25229 	 * This field is used to indicate the reasons for link down.
25230 	 * This field is set to 0, if the link down reason is unknown.
25231 	 */
25232 	uint8_t	link_down_reason;
25233 	/* Remote fault */
25234 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_DOWN_REASON_RF	UINT32_C(0x1)
25235 	uint8_t	unused_0[7];
25236 	/*
25237 	 * This field is used in Output records to indicate that the output
25238 	 * is completely written to RAM.  This field should be read as '1'
25239 	 * to indicate that the output has been completely written.
25240 	 * When writing a command completion or response to an internal processor,
25241 	 * the order of writes has to be such that this field is written last.
25242 	 */
25243 	uint8_t	valid;
25244 } hwrm_port_phy_qcfg_output_t, *phwrm_port_phy_qcfg_output_t;
25245 
25246 /*********************
25247  * hwrm_port_mac_cfg *
25248  *********************/
25249 
25250 
25251 /* hwrm_port_mac_cfg_input (size:448b/56B) */
25252 
25253 typedef struct hwrm_port_mac_cfg_input {
25254 	/* The HWRM command request type. */
25255 	uint16_t	req_type;
25256 	/*
25257 	 * The completion ring to send the completion event on. This should
25258 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25259 	 */
25260 	uint16_t	cmpl_ring;
25261 	/*
25262 	 * The sequence ID is used by the driver for tracking multiple
25263 	 * commands. This ID is treated as opaque data by the firmware and
25264 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25265 	 */
25266 	uint16_t	seq_id;
25267 	/*
25268 	 * The target ID of the command:
25269 	 * * 0x0-0xFFF8 - The function ID
25270 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25271 	 * * 0xFFFD - Reserved for user-space HWRM interface
25272 	 * * 0xFFFF - HWRM
25273 	 */
25274 	uint16_t	target_id;
25275 	/*
25276 	 * A physical address pointer pointing to a host buffer that the
25277 	 * command's response data will be written. This can be either a host
25278 	 * physical address (HPA) or a guest physical address (GPA) and must
25279 	 * point to a physically contiguous block of memory.
25280 	 */
25281 	uint64_t	resp_addr;
25282 	/*
25283 	 * In this field, there are a number of CoS mappings related flags
25284 	 * that are used to configure CoS mappings and their corresponding
25285 	 * priorities in the hardware.
25286 	 * For the priorities of CoS mappings, the HWRM uses the following
25287 	 * priority order (high to low) by default:
25288 	 * # vlan pri
25289 	 * # ip_dscp
25290 	 * # tunnel_vlan_pri
25291 	 * # default cos
25292 	 *
25293 	 * A subset of CoS mappings can be enabled.
25294 	 * If a priority is not specified for an enabled CoS mapping, the
25295 	 * priority will be assigned in the above order for the enabled CoS
25296 	 * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
25297 	 * enabled and their priorities are not specified, the following
25298 	 * priority order (high to low) will be used by the HWRM:
25299 	 * # vlan_pri
25300 	 * # ip_dscp
25301 	 * # default cos
25302 	 *
25303 	 * vlan_pri CoS mapping together with default CoS with lower priority
25304 	 * are enabled by default by the HWRM.
25305 	 */
25306 	uint32_t	flags;
25307 	/*
25308 	 * When this bit is '1', this command will configure
25309 	 * the MAC to match the current link state of the PHY.
25310 	 * If the link is not established on the PHY, then this
25311 	 * bit has no effect.
25312 	 */
25313 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK			UINT32_C(0x1)
25314 	/*
25315 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
25316 	 * is requested to be enabled.
25317 	 */
25318 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE	UINT32_C(0x2)
25319 	/*
25320 	 * When this bit is set to '1', tunnel VLAN PRI field to
25321 	 * CoS mapping is requested to be enabled.
25322 	 */
25323 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE	UINT32_C(0x4)
25324 	/*
25325 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
25326 	 * requested to be enabled.
25327 	 */
25328 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE		UINT32_C(0x8)
25329 	/*
25330 	 * When this bit is '1', the HWRM is requested to
25331 	 * enable timestamp capture capability on the receive side
25332 	 * of this port.
25333 	 */
25334 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE	UINT32_C(0x10)
25335 	/*
25336 	 * When this bit is '1', the HWRM is requested to
25337 	 * disable timestamp capture capability on the receive side
25338 	 * of this port.
25339 	 */
25340 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE	UINT32_C(0x20)
25341 	/*
25342 	 * When this bit is '1', the HWRM is requested to
25343 	 * enable timestamp capture capability on the transmit side
25344 	 * of this port.
25345 	 */
25346 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE	UINT32_C(0x40)
25347 	/*
25348 	 * When this bit is '1', the HWRM is requested to
25349 	 * disable timestamp capture capability on the transmit side
25350 	 * of this port.
25351 	 */
25352 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE	UINT32_C(0x80)
25353 	/*
25354 	 * When this bit is '1', the Out-Of-Box WoL is requested to
25355 	 * be enabled on this port.
25356 	 */
25357 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE		UINT32_C(0x100)
25358 	/*
25359 	 * When this bit is '1', the Out-Of-Box WoL is requested to
25360 	 * be disabled on this port.
25361 	 */
25362 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE		UINT32_C(0x200)
25363 	/*
25364 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
25365 	 * is requested to be disabled.
25366 	 */
25367 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE	UINT32_C(0x400)
25368 	/*
25369 	 * When this bit is set to '1', tunnel VLAN PRI field to
25370 	 * CoS mapping is requested to be disabled.
25371 	 */
25372 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE	UINT32_C(0x800)
25373 	/*
25374 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
25375 	 * requested to be disabled.
25376 	 */
25377 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE	UINT32_C(0x1000)
25378 	/*
25379 	 * When this bit is set to '1', and the ptp_tx_ts_capture_enable
25380 	 * bit is set, then the device uses one step Tx timestamping.
25381 	 * This bit is temporary and used for experimental purposes.
25382 	 */
25383 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS		UINT32_C(0x2000)
25384 	/*
25385 	 * When this bit is '1', the controller is requested to enable
25386 	 * timestamp capture capability on all packets (not just PTP)
25387 	 * of the receive side of this port.
25388 	 */
25389 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_ENABLE	UINT32_C(0x4000)
25390 	/*
25391 	 * When this bit is '1', the controller is requested to disable
25392 	 * timestamp capture capability on all packets (not just PTP)
25393 	 * of the receive side of this port.
25394 	 */
25395 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_DISABLE	UINT32_C(0x8000)
25396 	uint32_t	enables;
25397 	/*
25398 	 * This bit must be '1' for the ipg field to be
25399 	 * configured.
25400 	 */
25401 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG				UINT32_C(0x1)
25402 	/*
25403 	 * This bit must be '1' for the lpbk field to be
25404 	 * configured.
25405 	 */
25406 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK			UINT32_C(0x2)
25407 	/*
25408 	 * This bit must be '1' for the vlan_pri2cos_map_pri field to be
25409 	 * configured.
25410 	 */
25411 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI	UINT32_C(0x4)
25412 	/*
25413 	 * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
25414 	 * configured.
25415 	 */
25416 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI	UINT32_C(0x10)
25417 	/*
25418 	 * This bit must be '1' for the dscp2cos_map_pri field to be
25419 	 * configured.
25420 	 */
25421 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI		UINT32_C(0x20)
25422 	/*
25423 	 * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
25424 	 * configured.
25425 	 */
25426 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE	UINT32_C(0x40)
25427 	/*
25428 	 * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
25429 	 * configured.
25430 	 */
25431 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE	UINT32_C(0x80)
25432 	/*
25433 	 * This bit must be '1' for the cos_field_cfg field to be
25434 	 * configured.
25435 	 */
25436 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG		UINT32_C(0x100)
25437 	/*
25438 	 * This bit must be '1' for the ptp_freq_adj_ppb field to be
25439 	 * configured.
25440 	 */
25441 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB		UINT32_C(0x200)
25442 	/*
25443 	 * This bit must be '1' for the ptp_adj_phase field to be
25444 	 * configured.
25445 	 */
25446 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_ADJ_PHASE		UINT32_C(0x400)
25447 	/* Port ID of port that is to be configured. */
25448 	uint16_t	port_id;
25449 	/*
25450 	 * This value is used to configure the minimum IPG that will
25451 	 * be sent between packets by this port.
25452 	 */
25453 	uint8_t	ipg;
25454 	/* This value controls the loopback setting for the MAC. */
25455 	uint8_t	lpbk;
25456 	/* No loopback is selected.  Normal operation. */
25457 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
25458 	/*
25459 	 * The HW will be configured with local loopback such that
25460 	 * host data is sent back to the host without modification.
25461 	 */
25462 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
25463 	/*
25464 	 * The HW will be configured with remote loopback such that
25465 	 * port logic will send packets back out the transmitter that
25466 	 * are received.
25467 	 */
25468 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
25469 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST  HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
25470 	/*
25471 	 * This value controls the priority setting of VLAN PRI to CoS
25472 	 * mapping based on VLAN Tags of inner packet headers of
25473 	 * tunneled packets or packet headers of non-tunneled packets.
25474 	 *
25475 	 * # Each XXX_pri variable shall have a unique priority value
25476 	 * when it is being specified.
25477 	 * # When comparing priorities of mappings, higher value
25478 	 * indicates higher priority.
25479 	 * For example, a value of 0-3 is returned where 0 is being
25480 	 * the lowest priority and 3 is being the highest priority.
25481 	 */
25482 	uint8_t	vlan_pri2cos_map_pri;
25483 	/* Reserved field. */
25484 	uint8_t	reserved1;
25485 	/*
25486 	 * This value controls the priority setting of VLAN PRI to CoS
25487 	 * mapping based on VLAN Tags of tunneled header.
25488 	 * This mapping only applies when tunneled headers
25489 	 * are present.
25490 	 *
25491 	 * # Each XXX_pri variable shall have a unique priority value
25492 	 * when it is being specified.
25493 	 * # When comparing priorities of mappings, higher value
25494 	 * indicates higher priority.
25495 	 * For example, a value of 0-3 is returned where 0 is being
25496 	 * the lowest priority and 3 is being the highest priority.
25497 	 */
25498 	uint8_t	tunnel_pri2cos_map_pri;
25499 	/*
25500 	 * This value controls the priority setting of IP DSCP to CoS
25501 	 * mapping based on inner IP header of tunneled packets or
25502 	 * IP header of non-tunneled packets.
25503 	 *
25504 	 * # Each XXX_pri variable shall have a unique priority value
25505 	 * when it is being specified.
25506 	 * # When comparing priorities of mappings, higher value
25507 	 * indicates higher priority.
25508 	 * For example, a value of 0-3 is returned where 0 is being
25509 	 * the lowest priority and 3 is being the highest priority.
25510 	 */
25511 	uint8_t	dscp2pri_map_pri;
25512 	/*
25513 	 * This is a 16-bit bit mask that is used to request a
25514 	 * specific configuration of time stamp capture of PTP messages
25515 	 * on the receive side of this port.
25516 	 * This field shall be ignored if the ptp_rx_ts_capture_enable
25517 	 * flag is not set in this command.
25518 	 * Otherwise, if bit 'i' is set, then the HWRM is being
25519 	 * requested to configure the receive side of the port to
25520 	 * capture the time stamp of every received PTP message
25521 	 * with messageType field value set to i.
25522 	 */
25523 	uint16_t	rx_ts_capture_ptp_msg_type;
25524 	/*
25525 	 * This is a 16-bit bit mask that is used to request a
25526 	 * specific configuration of time stamp capture of PTP messages
25527 	 * on the transmit side of this port.
25528 	 * This field shall be ignored if the ptp_tx_ts_capture_enable
25529 	 * flag is not set in this command.
25530 	 * Otherwise, if bit 'i' is set, then the HWRM is being
25531 	 * requested to configure the transmit side of the port to
25532 	 * capture the time stamp of every transmitted PTP message
25533 	 * with messageType field value set to i.
25534 	 */
25535 	uint16_t	tx_ts_capture_ptp_msg_type;
25536 	/* Configuration of CoS fields. */
25537 	uint8_t	cos_field_cfg;
25538 	/* Reserved */
25539 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1			UINT32_C(0x1)
25540 	/*
25541 	 * This field is used to specify selection of VLAN PRI value
25542 	 * based on whether one or two VLAN Tags are present in
25543 	 * the inner packet headers of tunneled packets or
25544 	 * non-tunneled packets.
25545 	 * This field is valid only if inner VLAN PRI to CoS mapping
25546 	 * is enabled.
25547 	 * If VLAN PRI to CoS mapping is not enabled, then this
25548 	 * field shall be ignored.
25549 	 */
25550 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK	UINT32_C(0x6)
25551 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT	1
25552 	/*
25553 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25554 	 * present in the inner packet headers
25555 	 */
25556 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 1)
25557 	/*
25558 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
25559 	 * present in the inner packet headers.
25560 	 * No VLAN PRI shall be selected for this configuration
25561 	 * if only one VLAN Tag is present in the inner
25562 	 * packet headers.
25563 	 */
25564 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 1)
25565 	/*
25566 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
25567 	 * are present in the inner packet headers
25568 	 */
25569 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 1)
25570 	/* Unspecified */
25571 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED	(UINT32_C(0x3) << 1)
25572 		#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
25573 	/*
25574 	 * This field is used to specify selection of tunnel VLAN
25575 	 * PRI value based on whether one or two VLAN Tags are
25576 	 * present in tunnel headers.
25577 	 * This field is valid only if tunnel VLAN PRI to CoS mapping
25578 	 * is enabled.
25579 	 * If tunnel VLAN PRI to CoS mapping is not enabled, then this
25580 	 * field shall be ignored.
25581 	 */
25582 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK	UINT32_C(0x18)
25583 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT	3
25584 	/*
25585 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25586 	 * present in the tunnel packet headers
25587 	 */
25588 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 3)
25589 	/*
25590 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
25591 	 * present in the tunnel packet headers.
25592 	 * No tunnel VLAN PRI shall be selected for this
25593 	 * configuration if only one VLAN Tag is present in
25594 	 * the tunnel packet headers.
25595 	 */
25596 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 3)
25597 	/*
25598 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
25599 	 * are present in the tunnel packet headers
25600 	 */
25601 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 3)
25602 	/* Unspecified */
25603 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED  (UINT32_C(0x3) << 3)
25604 		#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
25605 	/*
25606 	 * This field shall be used to provide default CoS value
25607 	 * that has been configured on this port.
25608 	 * This field is valid only if default CoS mapping
25609 	 * is enabled.
25610 	 * If default CoS mapping is not enabled, then this
25611 	 * field shall be ignored.
25612 	 */
25613 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK	UINT32_C(0xe0)
25614 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT	5
25615 	uint8_t	unused_0[3];
25616 	/*
25617 	 * This signed field specifies by how much to adjust the frequency
25618 	 * of sync timer updates (measured in parts per billion).
25619 	 */
25620 	int32_t	ptp_freq_adj_ppb;
25621 	uint8_t	unused_1[4];
25622 	/*
25623 	 * This unsigned field specifies the phase offset to be applied
25624 	 * to the PHC (PTP Hardware Clock). This field is specified in
25625 	 * nanoseconds.
25626 	 */
25627 	int64_t	ptp_adj_phase;
25628 } hwrm_port_mac_cfg_input_t, *phwrm_port_mac_cfg_input_t;
25629 
25630 /* hwrm_port_mac_cfg_output (size:128b/16B) */
25631 
25632 typedef struct hwrm_port_mac_cfg_output {
25633 	/* The specific error status for the command. */
25634 	uint16_t	error_code;
25635 	/* The HWRM command request type. */
25636 	uint16_t	req_type;
25637 	/* The sequence ID from the original command. */
25638 	uint16_t	seq_id;
25639 	/* The length of the response data in number of bytes. */
25640 	uint16_t	resp_len;
25641 	/*
25642 	 * This is the configured maximum length of Ethernet packet
25643 	 * payload that is allowed to be received on the port.
25644 	 * This value does not include the number of bytes used by
25645 	 * Ethernet header and trailer (CRC).
25646 	 */
25647 	uint16_t	mru;
25648 	/*
25649 	 * This is the configured maximum length of Ethernet packet
25650 	 * payload that is allowed to be transmitted on the port.
25651 	 * This value does not include the number of bytes used by
25652 	 * Ethernet header and trailer (CRC).
25653 	 */
25654 	uint16_t	mtu;
25655 	/* Current configuration of the IPG value. */
25656 	uint8_t	ipg;
25657 	/* Current value of the loopback value. */
25658 	uint8_t	lpbk;
25659 	/* No loopback is selected.  Normal operation. */
25660 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
25661 	/*
25662 	 * The HW will be configured with local loopback such that
25663 	 * host data is sent back to the host without modification.
25664 	 */
25665 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
25666 	/*
25667 	 * The HW will be configured with remote loopback such that
25668 	 * port logic will send packets back out the transmitter that
25669 	 * are received.
25670 	 */
25671 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
25672 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST  HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
25673 	uint8_t	unused_0;
25674 	/*
25675 	 * This field is used in Output records to indicate that the output
25676 	 * is completely written to RAM.  This field should be read as '1'
25677 	 * to indicate that the output has been completely written.
25678 	 * When writing a command completion or response to an internal processor,
25679 	 * the order of writes has to be such that this field is written last.
25680 	 */
25681 	uint8_t	valid;
25682 } hwrm_port_mac_cfg_output_t, *phwrm_port_mac_cfg_output_t;
25683 
25684 /**********************
25685  * hwrm_port_mac_qcfg *
25686  **********************/
25687 
25688 
25689 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
25690 
25691 typedef struct hwrm_port_mac_qcfg_input {
25692 	/* The HWRM command request type. */
25693 	uint16_t	req_type;
25694 	/*
25695 	 * The completion ring to send the completion event on. This should
25696 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25697 	 */
25698 	uint16_t	cmpl_ring;
25699 	/*
25700 	 * The sequence ID is used by the driver for tracking multiple
25701 	 * commands. This ID is treated as opaque data by the firmware and
25702 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25703 	 */
25704 	uint16_t	seq_id;
25705 	/*
25706 	 * The target ID of the command:
25707 	 * * 0x0-0xFFF8 - The function ID
25708 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25709 	 * * 0xFFFD - Reserved for user-space HWRM interface
25710 	 * * 0xFFFF - HWRM
25711 	 */
25712 	uint16_t	target_id;
25713 	/*
25714 	 * A physical address pointer pointing to a host buffer that the
25715 	 * command's response data will be written. This can be either a host
25716 	 * physical address (HPA) or a guest physical address (GPA) and must
25717 	 * point to a physically contiguous block of memory.
25718 	 */
25719 	uint64_t	resp_addr;
25720 	/* Port ID of port that is to be configured. */
25721 	uint16_t	port_id;
25722 	uint8_t	unused_0[6];
25723 } hwrm_port_mac_qcfg_input_t, *phwrm_port_mac_qcfg_input_t;
25724 
25725 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
25726 
25727 typedef struct hwrm_port_mac_qcfg_output {
25728 	/* The specific error status for the command. */
25729 	uint16_t	error_code;
25730 	/* The HWRM command request type. */
25731 	uint16_t	req_type;
25732 	/* The sequence ID from the original command. */
25733 	uint16_t	seq_id;
25734 	/* The length of the response data in number of bytes. */
25735 	uint16_t	resp_len;
25736 	/*
25737 	 * This is the configured maximum length of Ethernet packet
25738 	 * payload that is allowed to be received on the port.
25739 	 * This value does not include the number of bytes used by the
25740 	 * Ethernet header and trailer (CRC).
25741 	 */
25742 	uint16_t	mru;
25743 	/*
25744 	 * This is the configured maximum length of Ethernet packet
25745 	 * payload that is allowed to be transmitted on the port.
25746 	 * This value does not include the number of bytes used by the
25747 	 * Ethernet header and trailer (CRC).
25748 	 */
25749 	uint16_t	mtu;
25750 	/*
25751 	 * The minimum IPG that will
25752 	 * be sent between packets by this port.
25753 	 */
25754 	uint8_t	ipg;
25755 	/* The loopback setting for the MAC. */
25756 	uint8_t	lpbk;
25757 	/* No loopback is selected.  Normal operation. */
25758 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
25759 	/*
25760 	 * The HW will be configured with local loopback such that
25761 	 * host data is sent back to the host without modification.
25762 	 */
25763 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
25764 	/*
25765 	 * The HW will be configured with remote loopback such that
25766 	 * port logic will send packets back out the transmitter that
25767 	 * are received.
25768 	 */
25769 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
25770 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST  HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
25771 	/*
25772 	 * Priority setting for VLAN PRI to CoS mapping.
25773 	 * # Each XXX_pri variable shall have a unique priority value
25774 	 * when it is being used.
25775 	 * # When comparing priorities of mappings, higher value
25776 	 * indicates higher priority.
25777 	 * For example, a value of 0-3 is returned where 0 is being
25778 	 * the lowest priority and 3 is being the highest priority.
25779 	 * # If the corresponding CoS mapping is not enabled, then this
25780 	 * field should be ignored.
25781 	 * # This value indicates the normalized priority value retained
25782 	 * in the HWRM.
25783 	 */
25784 	uint8_t	vlan_pri2cos_map_pri;
25785 	/*
25786 	 * In this field, a number of CoS mappings related flags
25787 	 * are used to indicate configured CoS mappings.
25788 	 */
25789 	uint8_t	flags;
25790 	/*
25791 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
25792 	 * is enabled.
25793 	 */
25794 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE	UINT32_C(0x1)
25795 	/*
25796 	 * When this bit is set to '1', tunnel VLAN PRI field to
25797 	 * CoS mapping is enabled.
25798 	 */
25799 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE	UINT32_C(0x2)
25800 	/*
25801 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
25802 	 * enabled.
25803 	 */
25804 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE	UINT32_C(0x4)
25805 	/*
25806 	 * When this bit is '1', the Out-Of-Box WoL is enabled on this
25807 	 * port.
25808 	 */
25809 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE		UINT32_C(0x8)
25810 	/* When this bit is '1', PTP is enabled for RX on this port. */
25811 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE	UINT32_C(0x10)
25812 	/* When this bit is '1', PTP is enabled for TX on this port. */
25813 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE	UINT32_C(0x20)
25814 	/*
25815 	 * Priority setting for tunnel VLAN PRI to CoS mapping.
25816 	 * # Each XXX_pri variable shall have a unique priority value
25817 	 * when it is being used.
25818 	 * # When comparing priorities of mappings, higher value
25819 	 * indicates higher priority.
25820 	 * For example, a value of 0-3 is returned where 0 is being
25821 	 * the lowest priority and 3 is being the highest priority.
25822 	 * # If the corresponding CoS mapping is not enabled, then this
25823 	 * field should be ignored.
25824 	 * # This value indicates the normalized priority value retained
25825 	 * in the HWRM.
25826 	 */
25827 	uint8_t	tunnel_pri2cos_map_pri;
25828 	/*
25829 	 * Priority setting for DSCP to PRI mapping.
25830 	 * # Each XXX_pri variable shall have a unique priority value
25831 	 * when it is being used.
25832 	 * # When comparing priorities of mappings, higher value
25833 	 * indicates higher priority.
25834 	 * For example, a value of 0-3 is returned where 0 is being
25835 	 * the lowest priority and 3 is being the highest priority.
25836 	 * # If the corresponding CoS mapping is not enabled, then this
25837 	 * field should be ignored.
25838 	 * # This value indicates the normalized priority value retained
25839 	 * in the HWRM.
25840 	 */
25841 	uint8_t	dscp2pri_map_pri;
25842 	/*
25843 	 * This is a 16-bit bit mask that represents the
25844 	 * current configuration of time stamp capture of PTP messages
25845 	 * on the receive side of this port.
25846 	 * If bit 'i' is set, then the receive side of the port
25847 	 * is configured to capture the time stamp of every
25848 	 * received PTP message with messageType field value set
25849 	 * to i.
25850 	 * If all bits are set to 0 (i.e. field value set 0),
25851 	 * then the receive side of the port is not configured
25852 	 * to capture timestamp for PTP messages.
25853 	 * If all bits are set to 1, then the receive side of the
25854 	 * port is configured to capture timestamp for all PTP
25855 	 * messages.
25856 	 */
25857 	uint16_t	rx_ts_capture_ptp_msg_type;
25858 	/*
25859 	 * This is a 16-bit bit mask that represents the
25860 	 * current configuration of time stamp capture of PTP messages
25861 	 * on the transmit side of this port.
25862 	 * If bit 'i' is set, then the transmit side of the port
25863 	 * is configured to capture the time stamp of every
25864 	 * received PTP message with messageType field value set
25865 	 * to i.
25866 	 * If all bits are set to 0 (i.e. field value set 0),
25867 	 * then the transmit side of the port is not configured
25868 	 * to capture timestamp for PTP messages.
25869 	 * If all bits are set to 1, then the transmit side of the
25870 	 * port is configured to capture timestamp for all PTP
25871 	 * messages.
25872 	 */
25873 	uint16_t	tx_ts_capture_ptp_msg_type;
25874 	/* Configuration of CoS fields. */
25875 	uint8_t	cos_field_cfg;
25876 	/* Reserved */
25877 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD			UINT32_C(0x1)
25878 	/*
25879 	 * This field is used for selecting VLAN PRI value
25880 	 * based on whether one or two VLAN Tags are present in
25881 	 * the inner packet headers of tunneled packets or
25882 	 * non-tunneled packets.
25883 	 */
25884 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK	UINT32_C(0x6)
25885 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT	1
25886 	/*
25887 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25888 	 * present in the inner packet headers
25889 	 */
25890 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 1)
25891 	/*
25892 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
25893 	 * present in the inner packet headers.
25894 	 * No VLAN PRI is selected for this configuration
25895 	 * if only one VLAN Tag is present in the inner
25896 	 * packet headers.
25897 	 */
25898 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 1)
25899 	/*
25900 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
25901 	 * are present in the inner packet headers
25902 	 */
25903 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 1)
25904 	/* Unspecified */
25905 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED	(UINT32_C(0x3) << 1)
25906 		#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
25907 	/*
25908 	 * This field is used for selecting tunnel VLAN PRI value
25909 	 * based on whether one or two VLAN Tags are present in
25910 	 * the tunnel headers of tunneled packets. This selection
25911 	 * does not apply to non-tunneled packets.
25912 	 */
25913 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK	UINT32_C(0x18)
25914 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT	3
25915 	/*
25916 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25917 	 * present in the tunnel packet headers
25918 	 */
25919 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 3)
25920 	/*
25921 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
25922 	 * present in the tunnel packet headers.
25923 	 * No VLAN PRI is selected for this configuration
25924 	 * if only one VLAN Tag is present in the tunnel
25925 	 * packet headers.
25926 	 */
25927 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 3)
25928 	/*
25929 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
25930 	 * are present in the tunnel packet headers
25931 	 */
25932 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 3)
25933 	/* Unspecified */
25934 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED  (UINT32_C(0x3) << 3)
25935 		#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
25936 	/*
25937 	 * This field is used to provide default CoS value that
25938 	 * has been configured on this port.
25939 	 */
25940 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK	UINT32_C(0xe0)
25941 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT	5
25942 	uint8_t	unused_1;
25943 	uint16_t	port_svif_info;
25944 	/*
25945 	 * This field specifies the source virtual interface of the port being
25946 	 * queried. Drivers can use this to program port svif field in the
25947 	 * L2 context table
25948 	 */
25949 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK	UINT32_C(0x7fff)
25950 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT	0
25951 	/* This field specifies whether port_svif is valid or not */
25952 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID	UINT32_C(0x8000)
25953 	uint8_t	unused_2[5];
25954 	/*
25955 	 * This field is used in Output records to indicate that the output
25956 	 * is completely written to RAM.  This field should be read as '1'
25957 	 * to indicate that the output has been completely written.
25958 	 * When writing a command completion or response to an internal processor,
25959 	 * the order of writes has to be such that this field is written last.
25960 	 */
25961 	uint8_t	valid;
25962 } hwrm_port_mac_qcfg_output_t, *phwrm_port_mac_qcfg_output_t;
25963 
25964 /**************************
25965  * hwrm_port_mac_ptp_qcfg *
25966  **************************/
25967 
25968 
25969 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
25970 
25971 typedef struct hwrm_port_mac_ptp_qcfg_input {
25972 	/* The HWRM command request type. */
25973 	uint16_t	req_type;
25974 	/*
25975 	 * The completion ring to send the completion event on. This should
25976 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25977 	 */
25978 	uint16_t	cmpl_ring;
25979 	/*
25980 	 * The sequence ID is used by the driver for tracking multiple
25981 	 * commands. This ID is treated as opaque data by the firmware and
25982 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25983 	 */
25984 	uint16_t	seq_id;
25985 	/*
25986 	 * The target ID of the command:
25987 	 * * 0x0-0xFFF8 - The function ID
25988 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25989 	 * * 0xFFFD - Reserved for user-space HWRM interface
25990 	 * * 0xFFFF - HWRM
25991 	 */
25992 	uint16_t	target_id;
25993 	/*
25994 	 * A physical address pointer pointing to a host buffer that the
25995 	 * command's response data will be written. This can be either a host
25996 	 * physical address (HPA) or a guest physical address (GPA) and must
25997 	 * point to a physically contiguous block of memory.
25998 	 */
25999 	uint64_t	resp_addr;
26000 	/* Port ID of port that is being queried. */
26001 	uint16_t	port_id;
26002 	uint8_t	unused_0[6];
26003 } hwrm_port_mac_ptp_qcfg_input_t, *phwrm_port_mac_ptp_qcfg_input_t;
26004 
26005 /* hwrm_port_mac_ptp_qcfg_output (size:704b/88B) */
26006 
26007 typedef struct hwrm_port_mac_ptp_qcfg_output {
26008 	/* The specific error status for the command. */
26009 	uint16_t	error_code;
26010 	/* The HWRM command request type. */
26011 	uint16_t	req_type;
26012 	/* The sequence ID from the original command. */
26013 	uint16_t	seq_id;
26014 	/* The length of the response data in number of bytes. */
26015 	uint16_t	resp_len;
26016 	/*
26017 	 * In this field, a number of PTP related flags
26018 	 * are used to indicate configured PTP capabilities.
26019 	 */
26020 	uint8_t	flags;
26021 	/*
26022 	 * When this bit is set to '1', the PTP related registers are
26023 	 * directly accessible by the host.
26024 	 */
26025 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS			UINT32_C(0x1)
26026 	/*
26027 	 * When this bit is set to '1', the device supports one-step
26028 	 * Tx timestamping.
26029 	 */
26030 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS			UINT32_C(0x4)
26031 	/*
26032 	 * When this bit is set to '1', the PTP information is accessible
26033 	 * via HWRM commands.
26034 	 */
26035 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS			UINT32_C(0x8)
26036 	/*
26037 	 * When this bit is set to '1', two specific registers for current
26038 	 * time (ts_ref_clock_reg_lower and ts_ref_clock_reg_upper) are
26039 	 * directly accessible by the host.
26040 	 */
26041 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_PARTIAL_DIRECT_ACCESS_REF_CLOCK	UINT32_C(0x10)
26042 	/*
26043 	 * When this bit is set to '1', it indicates that driver has
26044 	 * configured 64bit RTC.
26045 	 */
26046 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_RTC_CONFIGURED			UINT32_C(0x20)
26047 	uint8_t	unused_0[3];
26048 	/*
26049 	 * Offset of the PTP register for the lower 32 bits of timestamp
26050 	 * for RX.
26051 	 */
26052 	uint32_t	rx_ts_reg_off_lower;
26053 	/*
26054 	 * Offset of the PTP register for the upper 32 bits of timestamp
26055 	 * for RX.
26056 	 */
26057 	uint32_t	rx_ts_reg_off_upper;
26058 	/* Offset of the PTP register for the sequence ID for RX. */
26059 	uint32_t	rx_ts_reg_off_seq_id;
26060 	/* Offset of the first PTP source ID for RX. */
26061 	uint32_t	rx_ts_reg_off_src_id_0;
26062 	/* Offset of the second PTP source ID for RX. */
26063 	uint32_t	rx_ts_reg_off_src_id_1;
26064 	/* Offset of the third PTP source ID for RX. */
26065 	uint32_t	rx_ts_reg_off_src_id_2;
26066 	/* Offset of the domain ID for RX. */
26067 	uint32_t	rx_ts_reg_off_domain_id;
26068 	/* Offset of the PTP FIFO register for RX. */
26069 	uint32_t	rx_ts_reg_off_fifo;
26070 	/* Offset of the PTP advance FIFO register for RX. */
26071 	uint32_t	rx_ts_reg_off_fifo_adv;
26072 	/* PTP timestamp granularity for RX. */
26073 	uint32_t	rx_ts_reg_off_granularity;
26074 	/*
26075 	 * Offset of the PTP register for the lower 32 bits of timestamp
26076 	 * for TX.
26077 	 */
26078 	uint32_t	tx_ts_reg_off_lower;
26079 	/*
26080 	 * Offset of the PTP register for the upper 32 bits of timestamp
26081 	 * for TX.
26082 	 */
26083 	uint32_t	tx_ts_reg_off_upper;
26084 	/* Offset of the PTP register for the sequence ID for TX. */
26085 	uint32_t	tx_ts_reg_off_seq_id;
26086 	/* Offset of the PTP FIFO register for TX. */
26087 	uint32_t	tx_ts_reg_off_fifo;
26088 	/* PTP timestamp granularity for TX. */
26089 	uint32_t	tx_ts_reg_off_granularity;
26090 	/* Offset of register to get lower 32 bits of current time. */
26091 	uint32_t	ts_ref_clock_reg_lower;
26092 	/* Offset of register to get upper 32 bits of current time. */
26093 	uint32_t	ts_ref_clock_reg_upper;
26094 	uint8_t	unused_1[7];
26095 	/*
26096 	 * This field is used in Output records to indicate that the output
26097 	 * is completely written to RAM.  This field should be read as '1'
26098 	 * to indicate that the output has been completely written.
26099 	 * When writing a command completion or response to an internal processor,
26100 	 * the order of writes has to be such that this field is written last.
26101 	 */
26102 	uint8_t	valid;
26103 } hwrm_port_mac_ptp_qcfg_output_t, *phwrm_port_mac_ptp_qcfg_output_t;
26104 
26105 /* Port Tx Statistics Format */
26106 /* tx_port_stats (size:3264b/408B) */
26107 
26108 typedef struct tx_port_stats {
26109 	/* Total Number of 64 Bytes frames transmitted */
26110 	uint64_t	tx_64b_frames;
26111 	/* Total Number of 65-127 Bytes frames transmitted */
26112 	uint64_t	tx_65b_127b_frames;
26113 	/* Total Number of 128-255 Bytes frames transmitted */
26114 	uint64_t	tx_128b_255b_frames;
26115 	/* Total Number of 256-511 Bytes frames transmitted */
26116 	uint64_t	tx_256b_511b_frames;
26117 	/* Total Number of 512-1023 Bytes frames transmitted */
26118 	uint64_t	tx_512b_1023b_frames;
26119 	/* Total Number of 1024-1518 Bytes frames transmitted */
26120 	uint64_t	tx_1024b_1518b_frames;
26121 	/*
26122 	 * Total Number of each good VLAN (excludes FCS errors)
26123 	 * frame transmitted which is 1519 to 1522 bytes in length
26124 	 * inclusive (excluding framing bits but including FCS bytes).
26125 	 */
26126 	uint64_t	tx_good_vlan_frames;
26127 	/* Total Number of 1519-2047 Bytes frames transmitted */
26128 	uint64_t	tx_1519b_2047b_frames;
26129 	/* Total Number of 2048-4095 Bytes frames transmitted */
26130 	uint64_t	tx_2048b_4095b_frames;
26131 	/* Total Number of 4096-9216 Bytes frames transmitted */
26132 	uint64_t	tx_4096b_9216b_frames;
26133 	/* Total Number of 9217-16383 Bytes frames transmitted */
26134 	uint64_t	tx_9217b_16383b_frames;
26135 	/* Total Number of good frames transmitted */
26136 	uint64_t	tx_good_frames;
26137 	/* Total Number of frames transmitted */
26138 	uint64_t	tx_total_frames;
26139 	/* Total number of unicast frames transmitted */
26140 	uint64_t	tx_ucast_frames;
26141 	/* Total number of multicast frames transmitted */
26142 	uint64_t	tx_mcast_frames;
26143 	/* Total number of broadcast frames transmitted */
26144 	uint64_t	tx_bcast_frames;
26145 	/* Total number of PAUSE control frames transmitted */
26146 	uint64_t	tx_pause_frames;
26147 	/*
26148 	 * Total number of PFC/per-priority PAUSE
26149 	 * control frames transmitted
26150 	 */
26151 	uint64_t	tx_pfc_frames;
26152 	/* Total number of jabber frames transmitted */
26153 	uint64_t	tx_jabber_frames;
26154 	/* Total number of frames transmitted with FCS error */
26155 	uint64_t	tx_fcs_err_frames;
26156 	/* Total number of control frames transmitted */
26157 	uint64_t	tx_control_frames;
26158 	/* Total number of over-sized frames transmitted */
26159 	uint64_t	tx_oversz_frames;
26160 	/* Total number of frames with single deferral */
26161 	uint64_t	tx_single_dfrl_frames;
26162 	/* Total number of frames with multiple deferrals */
26163 	uint64_t	tx_multi_dfrl_frames;
26164 	/* Total number of frames with single collision */
26165 	uint64_t	tx_single_coll_frames;
26166 	/* Total number of frames with multiple collisions */
26167 	uint64_t	tx_multi_coll_frames;
26168 	/* Total number of frames with late collisions */
26169 	uint64_t	tx_late_coll_frames;
26170 	/* Total number of frames with excessive collisions */
26171 	uint64_t	tx_excessive_coll_frames;
26172 	/* Total number of fragmented frames transmitted */
26173 	uint64_t	tx_frag_frames;
26174 	/* Total number of transmit errors */
26175 	uint64_t	tx_err;
26176 	/* Total number of single VLAN tagged frames transmitted */
26177 	uint64_t	tx_tagged_frames;
26178 	/* Total number of double VLAN tagged frames transmitted */
26179 	uint64_t	tx_dbl_tagged_frames;
26180 	/* Total number of runt frames transmitted */
26181 	uint64_t	tx_runt_frames;
26182 	/* Total number of TX FIFO under runs */
26183 	uint64_t	tx_fifo_underruns;
26184 	/*
26185 	 * Total number of PFC frames with PFC enabled bit for
26186 	 * Pri 0 transmitted
26187 	 */
26188 	uint64_t	tx_pfc_ena_frames_pri0;
26189 	/*
26190 	 * Total number of PFC frames with PFC enabled bit for
26191 	 * Pri 1 transmitted
26192 	 */
26193 	uint64_t	tx_pfc_ena_frames_pri1;
26194 	/*
26195 	 * Total number of PFC frames with PFC enabled bit for
26196 	 * Pri 2 transmitted
26197 	 */
26198 	uint64_t	tx_pfc_ena_frames_pri2;
26199 	/*
26200 	 * Total number of PFC frames with PFC enabled bit for
26201 	 * Pri 3 transmitted
26202 	 */
26203 	uint64_t	tx_pfc_ena_frames_pri3;
26204 	/*
26205 	 * Total number of PFC frames with PFC enabled bit for
26206 	 * Pri 4 transmitted
26207 	 */
26208 	uint64_t	tx_pfc_ena_frames_pri4;
26209 	/*
26210 	 * Total number of PFC frames with PFC enabled bit for
26211 	 * Pri 5 transmitted
26212 	 */
26213 	uint64_t	tx_pfc_ena_frames_pri5;
26214 	/*
26215 	 * Total number of PFC frames with PFC enabled bit for
26216 	 * Pri 6 transmitted
26217 	 */
26218 	uint64_t	tx_pfc_ena_frames_pri6;
26219 	/*
26220 	 * Total number of PFC frames with PFC enabled bit for
26221 	 * Pri 7 transmitted
26222 	 */
26223 	uint64_t	tx_pfc_ena_frames_pri7;
26224 	/* Total number of EEE LPI Events on TX */
26225 	uint64_t	tx_eee_lpi_events;
26226 	/* EEE LPI Duration Counter on TX */
26227 	uint64_t	tx_eee_lpi_duration;
26228 	/*
26229 	 * Total number of Link Level Flow Control (LLFC) messages
26230 	 * transmitted
26231 	 */
26232 	uint64_t	tx_llfc_logical_msgs;
26233 	/* Total number of HCFC messages transmitted */
26234 	uint64_t	tx_hcfc_msgs;
26235 	/* Total number of TX collisions */
26236 	uint64_t	tx_total_collisions;
26237 	/* Total number of transmitted bytes */
26238 	uint64_t	tx_bytes;
26239 	/* Total number of end-to-end HOL frames */
26240 	uint64_t	tx_xthol_frames;
26241 	/* Total Tx Drops per Port reported by STATS block */
26242 	uint64_t	tx_stat_discard;
26243 	/* Total Tx Error Drops per Port reported by STATS block */
26244 	uint64_t	tx_stat_error;
26245 } tx_port_stats_t, *ptx_port_stats_t;
26246 
26247 /* Port Rx Statistics Format */
26248 /* rx_port_stats (size:4224b/528B) */
26249 
26250 typedef struct rx_port_stats {
26251 	/* Total Number of 64 Bytes frames received */
26252 	uint64_t	rx_64b_frames;
26253 	/* Total Number of 65-127 Bytes frames received */
26254 	uint64_t	rx_65b_127b_frames;
26255 	/* Total Number of 128-255 Bytes frames received */
26256 	uint64_t	rx_128b_255b_frames;
26257 	/* Total Number of 256-511 Bytes frames received */
26258 	uint64_t	rx_256b_511b_frames;
26259 	/* Total Number of 512-1023 Bytes frames received */
26260 	uint64_t	rx_512b_1023b_frames;
26261 	/* Total Number of 1024-1518 Bytes frames received */
26262 	uint64_t	rx_1024b_1518b_frames;
26263 	/*
26264 	 * Total Number of each good VLAN (excludes FCS errors)
26265 	 * frame received which is 1519 to 1522 bytes in length
26266 	 * inclusive (excluding framing bits but including FCS bytes).
26267 	 */
26268 	uint64_t	rx_good_vlan_frames;
26269 	/* Total Number of 1519-2047 Bytes frames received */
26270 	uint64_t	rx_1519b_2047b_frames;
26271 	/* Total Number of 2048-4095 Bytes frames received */
26272 	uint64_t	rx_2048b_4095b_frames;
26273 	/* Total Number of 4096-9216 Bytes frames received */
26274 	uint64_t	rx_4096b_9216b_frames;
26275 	/* Total Number of 9217-16383 Bytes frames received */
26276 	uint64_t	rx_9217b_16383b_frames;
26277 	/* Total number of frames received */
26278 	uint64_t	rx_total_frames;
26279 	/* Total number of unicast frames received */
26280 	uint64_t	rx_ucast_frames;
26281 	/* Total number of multicast frames received */
26282 	uint64_t	rx_mcast_frames;
26283 	/* Total number of broadcast frames received */
26284 	uint64_t	rx_bcast_frames;
26285 	/* Total number of received frames with FCS error */
26286 	uint64_t	rx_fcs_err_frames;
26287 	/* Total number of control frames received */
26288 	uint64_t	rx_ctrl_frames;
26289 	/* Total number of PAUSE frames received */
26290 	uint64_t	rx_pause_frames;
26291 	/* Total number of PFC frames received */
26292 	uint64_t	rx_pfc_frames;
26293 	/*
26294 	 * Total number of frames received with an unsupported
26295 	 * opcode
26296 	 */
26297 	uint64_t	rx_unsupported_opcode_frames;
26298 	/*
26299 	 * Total number of frames received with an unsupported
26300 	 * DA for pause and PFC
26301 	 */
26302 	uint64_t	rx_unsupported_da_pausepfc_frames;
26303 	/* Total number of frames received with an unsupported SA */
26304 	uint64_t	rx_wrong_sa_frames;
26305 	/* Total number of received packets with alignment error */
26306 	uint64_t	rx_align_err_frames;
26307 	/* Total number of received frames with out-of-range length */
26308 	uint64_t	rx_oor_len_frames;
26309 	/* Total number of received frames with error termination */
26310 	uint64_t	rx_code_err_frames;
26311 	/*
26312 	 * Total number of received frames with a false carrier is
26313 	 * detected during idle, as defined by RX_ER samples active
26314 	 * and RXD is 0xE. The event is reported along with the
26315 	 * statistics generated on the next received frame. Only
26316 	 * one false carrier condition can be detected and logged
26317 	 * between frames.
26318 	 *
26319 	 * Carrier event, valid for 10M/100M speed modes only.
26320 	 */
26321 	uint64_t	rx_false_carrier_frames;
26322 	/* Total number of over-sized frames received */
26323 	uint64_t	rx_ovrsz_frames;
26324 	/* Total number of jabber packets received */
26325 	uint64_t	rx_jbr_frames;
26326 	/* Total number of received frames with MTU error */
26327 	uint64_t	rx_mtu_err_frames;
26328 	/* Total number of received frames with CRC match */
26329 	uint64_t	rx_match_crc_frames;
26330 	/* Total number of frames received promiscuously */
26331 	uint64_t	rx_promiscuous_frames;
26332 	/*
26333 	 * Total number of received frames with one or two VLAN
26334 	 * tags
26335 	 */
26336 	uint64_t	rx_tagged_frames;
26337 	/* Total number of received frames with two VLAN tags */
26338 	uint64_t	rx_double_tagged_frames;
26339 	/* Total number of truncated frames received */
26340 	uint64_t	rx_trunc_frames;
26341 	/* Total number of good frames (without errors) received */
26342 	uint64_t	rx_good_frames;
26343 	/*
26344 	 * Total number of received PFC frames with transition from
26345 	 * XON to XOFF on Pri 0
26346 	 */
26347 	uint64_t	rx_pfc_xon2xoff_frames_pri0;
26348 	/*
26349 	 * Total number of received PFC frames with transition from
26350 	 * XON to XOFF on Pri 1
26351 	 */
26352 	uint64_t	rx_pfc_xon2xoff_frames_pri1;
26353 	/*
26354 	 * Total number of received PFC frames with transition from
26355 	 * XON to XOFF on Pri 2
26356 	 */
26357 	uint64_t	rx_pfc_xon2xoff_frames_pri2;
26358 	/*
26359 	 * Total number of received PFC frames with transition from
26360 	 * XON to XOFF on Pri 3
26361 	 */
26362 	uint64_t	rx_pfc_xon2xoff_frames_pri3;
26363 	/*
26364 	 * Total number of received PFC frames with transition from
26365 	 * XON to XOFF on Pri 4
26366 	 */
26367 	uint64_t	rx_pfc_xon2xoff_frames_pri4;
26368 	/*
26369 	 * Total number of received PFC frames with transition from
26370 	 * XON to XOFF on Pri 5
26371 	 */
26372 	uint64_t	rx_pfc_xon2xoff_frames_pri5;
26373 	/*
26374 	 * Total number of received PFC frames with transition from
26375 	 * XON to XOFF on Pri 6
26376 	 */
26377 	uint64_t	rx_pfc_xon2xoff_frames_pri6;
26378 	/*
26379 	 * Total number of received PFC frames with transition from
26380 	 * XON to XOFF on Pri 7
26381 	 */
26382 	uint64_t	rx_pfc_xon2xoff_frames_pri7;
26383 	/*
26384 	 * Total number of received PFC frames with PFC enabled
26385 	 * bit for Pri 0
26386 	 */
26387 	uint64_t	rx_pfc_ena_frames_pri0;
26388 	/*
26389 	 * Total number of received PFC frames with PFC enabled
26390 	 * bit for Pri 1
26391 	 */
26392 	uint64_t	rx_pfc_ena_frames_pri1;
26393 	/*
26394 	 * Total number of received PFC frames with PFC enabled
26395 	 * bit for Pri 2
26396 	 */
26397 	uint64_t	rx_pfc_ena_frames_pri2;
26398 	/*
26399 	 * Total number of received PFC frames with PFC enabled
26400 	 * bit for Pri 3
26401 	 */
26402 	uint64_t	rx_pfc_ena_frames_pri3;
26403 	/*
26404 	 * Total number of received PFC frames with PFC enabled
26405 	 * bit for Pri 4
26406 	 */
26407 	uint64_t	rx_pfc_ena_frames_pri4;
26408 	/*
26409 	 * Total number of received PFC frames with PFC enabled
26410 	 * bit for Pri 5
26411 	 */
26412 	uint64_t	rx_pfc_ena_frames_pri5;
26413 	/*
26414 	 * Total number of received PFC frames with PFC enabled
26415 	 * bit for Pri 6
26416 	 */
26417 	uint64_t	rx_pfc_ena_frames_pri6;
26418 	/*
26419 	 * Total number of received PFC frames with PFC enabled
26420 	 * bit for Pri 7
26421 	 */
26422 	uint64_t	rx_pfc_ena_frames_pri7;
26423 	/* Total Number of frames received with SCH CRC error */
26424 	uint64_t	rx_sch_crc_err_frames;
26425 	/* Total Number of under-sized frames received */
26426 	uint64_t	rx_undrsz_frames;
26427 	/* Total Number of fragmented frames received */
26428 	uint64_t	rx_frag_frames;
26429 	/* Total number of RX EEE LPI Events */
26430 	uint64_t	rx_eee_lpi_events;
26431 	/* EEE LPI Duration Counter on RX */
26432 	uint64_t	rx_eee_lpi_duration;
26433 	/*
26434 	 * Total number of physical type Link Level Flow Control
26435 	 * (LLFC) messages received
26436 	 */
26437 	uint64_t	rx_llfc_physical_msgs;
26438 	/*
26439 	 * Total number of logical type Link Level Flow Control
26440 	 * (LLFC) messages received
26441 	 */
26442 	uint64_t	rx_llfc_logical_msgs;
26443 	/*
26444 	 * Total number of logical type Link Level Flow Control
26445 	 * (LLFC) messages received with CRC error
26446 	 */
26447 	uint64_t	rx_llfc_msgs_with_crc_err;
26448 	/* Total number of HCFC messages received */
26449 	uint64_t	rx_hcfc_msgs;
26450 	/* Total number of HCFC messages received with CRC error */
26451 	uint64_t	rx_hcfc_msgs_with_crc_err;
26452 	/* Total number of received bytes */
26453 	uint64_t	rx_bytes;
26454 	/* Total number of bytes received in runt frames */
26455 	uint64_t	rx_runt_bytes;
26456 	/* Total number of runt frames received */
26457 	uint64_t	rx_runt_frames;
26458 	/* Total Rx Discards per Port reported by STATS block */
26459 	uint64_t	rx_stat_discard;
26460 	uint64_t	rx_stat_err;
26461 } rx_port_stats_t, *prx_port_stats_t;
26462 
26463 /********************
26464  * hwrm_port_qstats *
26465  ********************/
26466 
26467 
26468 /* hwrm_port_qstats_input (size:320b/40B) */
26469 
26470 typedef struct hwrm_port_qstats_input {
26471 	/* The HWRM command request type. */
26472 	uint16_t	req_type;
26473 	/*
26474 	 * The completion ring to send the completion event on. This should
26475 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
26476 	 */
26477 	uint16_t	cmpl_ring;
26478 	/*
26479 	 * The sequence ID is used by the driver for tracking multiple
26480 	 * commands. This ID is treated as opaque data by the firmware and
26481 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
26482 	 */
26483 	uint16_t	seq_id;
26484 	/*
26485 	 * The target ID of the command:
26486 	 * * 0x0-0xFFF8 - The function ID
26487 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26488 	 * * 0xFFFD - Reserved for user-space HWRM interface
26489 	 * * 0xFFFF - HWRM
26490 	 */
26491 	uint16_t	target_id;
26492 	/*
26493 	 * A physical address pointer pointing to a host buffer that the
26494 	 * command's response data will be written. This can be either a host
26495 	 * physical address (HPA) or a guest physical address (GPA) and must
26496 	 * point to a physically contiguous block of memory.
26497 	 */
26498 	uint64_t	resp_addr;
26499 	/* Port ID of port that is being queried. */
26500 	uint16_t	port_id;
26501 	uint8_t	flags;
26502 	/*
26503 	 * This bit is set to 1 when request is for a counter mask,
26504 	 * representing the width of each of the stats counters, rather
26505 	 * than counters themselves.
26506 	 */
26507 	#define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
26508 	uint8_t	unused_0[5];
26509 	/*
26510 	 * This is the host address where
26511 	 * Tx port statistics will be stored
26512 	 */
26513 	uint64_t	tx_stat_host_addr;
26514 	/*
26515 	 * This is the host address where
26516 	 * Rx port statistics will be stored
26517 	 */
26518 	uint64_t	rx_stat_host_addr;
26519 } hwrm_port_qstats_input_t, *phwrm_port_qstats_input_t;
26520 
26521 /* hwrm_port_qstats_output (size:128b/16B) */
26522 
26523 typedef struct hwrm_port_qstats_output {
26524 	/* The specific error status for the command. */
26525 	uint16_t	error_code;
26526 	/* The HWRM command request type. */
26527 	uint16_t	req_type;
26528 	/* The sequence ID from the original command. */
26529 	uint16_t	seq_id;
26530 	/* The length of the response data in number of bytes. */
26531 	uint16_t	resp_len;
26532 	/* The size of TX port statistics block in bytes. */
26533 	uint16_t	tx_stat_size;
26534 	/* The size of RX port statistics block in bytes. */
26535 	uint16_t	rx_stat_size;
26536 	uint8_t	unused_0[3];
26537 	/*
26538 	 * This field is used in Output records to indicate that the output
26539 	 * is completely written to RAM.  This field should be read as '1'
26540 	 * to indicate that the output has been completely written.
26541 	 * When writing a command completion or response to an internal processor,
26542 	 * the order of writes has to be such that this field is written last.
26543 	 */
26544 	uint8_t	valid;
26545 } hwrm_port_qstats_output_t, *phwrm_port_qstats_output_t;
26546 
26547 /* Port Tx Statistics extended Format */
26548 /* tx_port_stats_ext (size:2048b/256B) */
26549 
26550 typedef struct tx_port_stats_ext {
26551 	/* Total number of tx bytes count on cos queue 0 */
26552 	uint64_t	tx_bytes_cos0;
26553 	/* Total number of tx bytes count on cos queue 1 */
26554 	uint64_t	tx_bytes_cos1;
26555 	/* Total number of tx bytes count on cos queue 2 */
26556 	uint64_t	tx_bytes_cos2;
26557 	/* Total number of tx bytes count on cos queue 3 */
26558 	uint64_t	tx_bytes_cos3;
26559 	/* Total number of tx bytes count on cos queue 4 */
26560 	uint64_t	tx_bytes_cos4;
26561 	/* Total number of tx bytes count on cos queue 5 */
26562 	uint64_t	tx_bytes_cos5;
26563 	/* Total number of tx bytes count on cos queue 6 */
26564 	uint64_t	tx_bytes_cos6;
26565 	/* Total number of tx bytes count on cos queue 7 */
26566 	uint64_t	tx_bytes_cos7;
26567 	/* Total number of tx packets count on cos queue 0 */
26568 	uint64_t	tx_packets_cos0;
26569 	/* Total number of tx packets count on cos queue 1 */
26570 	uint64_t	tx_packets_cos1;
26571 	/* Total number of tx packets count on cos queue 2 */
26572 	uint64_t	tx_packets_cos2;
26573 	/* Total number of tx packets count on cos queue 3 */
26574 	uint64_t	tx_packets_cos3;
26575 	/* Total number of tx packets count on cos queue 4 */
26576 	uint64_t	tx_packets_cos4;
26577 	/* Total number of tx packets count on cos queue 5 */
26578 	uint64_t	tx_packets_cos5;
26579 	/* Total number of tx packets count on cos queue 6 */
26580 	uint64_t	tx_packets_cos6;
26581 	/* Total number of tx packets count on cos queue 7 */
26582 	uint64_t	tx_packets_cos7;
26583 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
26584 	uint64_t	pfc_pri0_tx_duration_us;
26585 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
26586 	uint64_t	pfc_pri0_tx_transitions;
26587 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
26588 	uint64_t	pfc_pri1_tx_duration_us;
26589 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
26590 	uint64_t	pfc_pri1_tx_transitions;
26591 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
26592 	uint64_t	pfc_pri2_tx_duration_us;
26593 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
26594 	uint64_t	pfc_pri2_tx_transitions;
26595 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
26596 	uint64_t	pfc_pri3_tx_duration_us;
26597 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
26598 	uint64_t	pfc_pri3_tx_transitions;
26599 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
26600 	uint64_t	pfc_pri4_tx_duration_us;
26601 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
26602 	uint64_t	pfc_pri4_tx_transitions;
26603 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
26604 	uint64_t	pfc_pri5_tx_duration_us;
26605 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
26606 	uint64_t	pfc_pri5_tx_transitions;
26607 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
26608 	uint64_t	pfc_pri6_tx_duration_us;
26609 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
26610 	uint64_t	pfc_pri6_tx_transitions;
26611 	/* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
26612 	uint64_t	pfc_pri7_tx_duration_us;
26613 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
26614 	uint64_t	pfc_pri7_tx_transitions;
26615 } tx_port_stats_ext_t, *ptx_port_stats_ext_t;
26616 
26617 /* Port Rx Statistics extended Format */
26618 /* rx_port_stats_ext (size:3776b/472B) */
26619 
26620 typedef struct rx_port_stats_ext {
26621 	/* Number of times link state changed to down */
26622 	uint64_t	link_down_events;
26623 	/* Number of times the idle rings with pause bit are found */
26624 	uint64_t	continuous_pause_events;
26625 	/* Number of times the active rings pause bit resumed back */
26626 	uint64_t	resume_pause_events;
26627 	/* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
26628 	uint64_t	continuous_roce_pause_events;
26629 	/* Number of times, the ROCE cos queue PFC is enabled back */
26630 	uint64_t	resume_roce_pause_events;
26631 	/* Total number of rx bytes count on cos queue 0 */
26632 	uint64_t	rx_bytes_cos0;
26633 	/* Total number of rx bytes count on cos queue 1 */
26634 	uint64_t	rx_bytes_cos1;
26635 	/* Total number of rx bytes count on cos queue 2 */
26636 	uint64_t	rx_bytes_cos2;
26637 	/* Total number of rx bytes count on cos queue 3 */
26638 	uint64_t	rx_bytes_cos3;
26639 	/* Total number of rx bytes count on cos queue 4 */
26640 	uint64_t	rx_bytes_cos4;
26641 	/* Total number of rx bytes count on cos queue 5 */
26642 	uint64_t	rx_bytes_cos5;
26643 	/* Total number of rx bytes count on cos queue 6 */
26644 	uint64_t	rx_bytes_cos6;
26645 	/* Total number of rx bytes count on cos queue 7 */
26646 	uint64_t	rx_bytes_cos7;
26647 	/* Total number of rx packets count on cos queue 0 */
26648 	uint64_t	rx_packets_cos0;
26649 	/* Total number of rx packets count on cos queue 1 */
26650 	uint64_t	rx_packets_cos1;
26651 	/* Total number of rx packets count on cos queue 2 */
26652 	uint64_t	rx_packets_cos2;
26653 	/* Total number of rx packets count on cos queue 3 */
26654 	uint64_t	rx_packets_cos3;
26655 	/* Total number of rx packets count on cos queue 4 */
26656 	uint64_t	rx_packets_cos4;
26657 	/* Total number of rx packets count on cos queue 5 */
26658 	uint64_t	rx_packets_cos5;
26659 	/* Total number of rx packets count on cos queue 6 */
26660 	uint64_t	rx_packets_cos6;
26661 	/* Total number of rx packets count on cos queue 7 */
26662 	uint64_t	rx_packets_cos7;
26663 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
26664 	uint64_t	pfc_pri0_rx_duration_us;
26665 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
26666 	uint64_t	pfc_pri0_rx_transitions;
26667 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
26668 	uint64_t	pfc_pri1_rx_duration_us;
26669 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
26670 	uint64_t	pfc_pri1_rx_transitions;
26671 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
26672 	uint64_t	pfc_pri2_rx_duration_us;
26673 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
26674 	uint64_t	pfc_pri2_rx_transitions;
26675 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
26676 	uint64_t	pfc_pri3_rx_duration_us;
26677 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
26678 	uint64_t	pfc_pri3_rx_transitions;
26679 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
26680 	uint64_t	pfc_pri4_rx_duration_us;
26681 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
26682 	uint64_t	pfc_pri4_rx_transitions;
26683 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
26684 	uint64_t	pfc_pri5_rx_duration_us;
26685 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
26686 	uint64_t	pfc_pri5_rx_transitions;
26687 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
26688 	uint64_t	pfc_pri6_rx_duration_us;
26689 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
26690 	uint64_t	pfc_pri6_rx_transitions;
26691 	/* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
26692 	uint64_t	pfc_pri7_rx_duration_us;
26693 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
26694 	uint64_t	pfc_pri7_rx_transitions;
26695 	/* Total number of received bits */
26696 	uint64_t	rx_bits;
26697 	/* The number of events where the port receive buffer was over 85% full */
26698 	uint64_t	rx_buffer_passed_threshold;
26699 	/*
26700 	 * The number of symbol errors that wasn't corrected by FEC correction
26701 	 * algorithm
26702 	 */
26703 	uint64_t	rx_pcs_symbol_err;
26704 	/* The number of corrected bits on the port according to active FEC */
26705 	uint64_t	rx_corrected_bits;
26706 	/* Total number of rx discard bytes count on cos queue 0 */
26707 	uint64_t	rx_discard_bytes_cos0;
26708 	/* Total number of rx discard bytes count on cos queue 1 */
26709 	uint64_t	rx_discard_bytes_cos1;
26710 	/* Total number of rx discard bytes count on cos queue 2 */
26711 	uint64_t	rx_discard_bytes_cos2;
26712 	/* Total number of rx discard bytes count on cos queue 3 */
26713 	uint64_t	rx_discard_bytes_cos3;
26714 	/* Total number of rx discard bytes count on cos queue 4 */
26715 	uint64_t	rx_discard_bytes_cos4;
26716 	/* Total number of rx discard bytes count on cos queue 5 */
26717 	uint64_t	rx_discard_bytes_cos5;
26718 	/* Total number of rx discard bytes count on cos queue 6 */
26719 	uint64_t	rx_discard_bytes_cos6;
26720 	/* Total number of rx discard bytes count on cos queue 7 */
26721 	uint64_t	rx_discard_bytes_cos7;
26722 	/* Total number of rx discard packets count on cos queue 0 */
26723 	uint64_t	rx_discard_packets_cos0;
26724 	/* Total number of rx discard packets count on cos queue 1 */
26725 	uint64_t	rx_discard_packets_cos1;
26726 	/* Total number of rx discard packets count on cos queue 2 */
26727 	uint64_t	rx_discard_packets_cos2;
26728 	/* Total number of rx discard packets count on cos queue 3 */
26729 	uint64_t	rx_discard_packets_cos3;
26730 	/* Total number of rx discard packets count on cos queue 4 */
26731 	uint64_t	rx_discard_packets_cos4;
26732 	/* Total number of rx discard packets count on cos queue 5 */
26733 	uint64_t	rx_discard_packets_cos5;
26734 	/* Total number of rx discard packets count on cos queue 6 */
26735 	uint64_t	rx_discard_packets_cos6;
26736 	/* Total number of rx discard packets count on cos queue 7 */
26737 	uint64_t	rx_discard_packets_cos7;
26738 	/* Total number of FEC blocks corrected by the FEC function in the PHY */
26739 	uint64_t	rx_fec_corrected_blocks;
26740 	/*
26741 	 * Total number of FEC blocks determined to be uncorrectable by the
26742 	 * FEC function in the PHY
26743 	 */
26744 	uint64_t	rx_fec_uncorrectable_blocks;
26745 } rx_port_stats_ext_t, *prx_port_stats_ext_t;
26746 
26747 /*
26748  * Port Rx Statistics extended PFC WatchDog Format.
26749  * StormDetect and StormRevert event determination is based
26750  * on an integration period and a percentage threshold.
26751  * StormDetect event - when percentage of XOFF frames received
26752  * within an integration period exceeds the configured threshold.
26753  * StormRevert event - when percentage of XON frames received
26754  * within an integration period exceeds the configured threshold.
26755  * Actual number of XOFF/XON frames for the events to be triggered
26756  * depends on both configured integration period and sampling rate.
26757  * The statistics in this structure represent counts of specified
26758  * events from the moment the feature (PFC WatchDog) is enabled via
26759  * hwrm_queue_pfc_enable_cfg call.
26760  */
26761 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
26762 
26763 typedef struct rx_port_stats_ext_pfc_wd {
26764 	/*
26765 	 * Total number of PFC WatchDog StormDetect events detected
26766 	 * for Pri 0
26767 	 */
26768 	uint64_t	rx_pfc_watchdog_storms_detected_pri0;
26769 	/*
26770 	 * Total number of PFC WatchDog StormDetect events detected
26771 	 * for Pri 1
26772 	 */
26773 	uint64_t	rx_pfc_watchdog_storms_detected_pri1;
26774 	/*
26775 	 * Total number of PFC WatchDog StormDetect events detected
26776 	 * for Pri 2
26777 	 */
26778 	uint64_t	rx_pfc_watchdog_storms_detected_pri2;
26779 	/*
26780 	 * Total number of PFC WatchDog StormDetect events detected
26781 	 * for Pri 3
26782 	 */
26783 	uint64_t	rx_pfc_watchdog_storms_detected_pri3;
26784 	/*
26785 	 * Total number of PFC WatchDog StormDetect events detected
26786 	 * for Pri 4
26787 	 */
26788 	uint64_t	rx_pfc_watchdog_storms_detected_pri4;
26789 	/*
26790 	 * Total number of PFC WatchDog StormDetect events detected
26791 	 * for Pri 5
26792 	 */
26793 	uint64_t	rx_pfc_watchdog_storms_detected_pri5;
26794 	/*
26795 	 * Total number of PFC WatchDog StormDetect events detected
26796 	 * for Pri 6
26797 	 */
26798 	uint64_t	rx_pfc_watchdog_storms_detected_pri6;
26799 	/*
26800 	 * Total number of PFC WatchDog StormDetect events detected
26801 	 * for Pri 7
26802 	 */
26803 	uint64_t	rx_pfc_watchdog_storms_detected_pri7;
26804 	/*
26805 	 * Total number of PFC WatchDog StormRevert events detected
26806 	 * for Pri 0
26807 	 */
26808 	uint64_t	rx_pfc_watchdog_storms_reverted_pri0;
26809 	/*
26810 	 * Total number of PFC WatchDog StormRevert events detected
26811 	 * for Pri 1
26812 	 */
26813 	uint64_t	rx_pfc_watchdog_storms_reverted_pri1;
26814 	/*
26815 	 * Total number of PFC WatchDog StormRevert events detected
26816 	 * for Pri 2
26817 	 */
26818 	uint64_t	rx_pfc_watchdog_storms_reverted_pri2;
26819 	/*
26820 	 * Total number of PFC WatchDog StormRevert events detected
26821 	 * for Pri 3
26822 	 */
26823 	uint64_t	rx_pfc_watchdog_storms_reverted_pri3;
26824 	/*
26825 	 * Total number of PFC WatchDog StormRevert events detected
26826 	 * for Pri 4
26827 	 */
26828 	uint64_t	rx_pfc_watchdog_storms_reverted_pri4;
26829 	/*
26830 	 * Total number of PFC WatchDog StormRevert events detected
26831 	 * for Pri 5
26832 	 */
26833 	uint64_t	rx_pfc_watchdog_storms_reverted_pri5;
26834 	/*
26835 	 * Total number of PFC WatchDog StormRevert events detected
26836 	 * for Pri 6
26837 	 */
26838 	uint64_t	rx_pfc_watchdog_storms_reverted_pri6;
26839 	/*
26840 	 * Total number of PFC WatchDog StormRevert events detected
26841 	 * for Pri 7
26842 	 */
26843 	uint64_t	rx_pfc_watchdog_storms_reverted_pri7;
26844 	/*
26845 	 * Total number of packets received during PFC watchdog storm
26846 	 * for pri 0
26847 	 */
26848 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri0;
26849 	/*
26850 	 * Total number of packets received during PFC watchdog storm
26851 	 * for pri 1
26852 	 */
26853 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri1;
26854 	/*
26855 	 * Total number of packets received during PFC watchdog storm
26856 	 *  for pri 2
26857 	 */
26858 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri2;
26859 	/*
26860 	 * Total number of packets received during PFC watchdog storm
26861 	 *  for pri 3
26862 	 */
26863 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri3;
26864 	/*
26865 	 * Total number of packets received during PFC watchdog storm
26866 	 *  for pri 4
26867 	 */
26868 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri4;
26869 	/*
26870 	 * Total number of packets received during PFC watchdog storm
26871 	 *  for pri 5
26872 	 */
26873 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri5;
26874 	/*
26875 	 * Total number of packets received during PFC watchdog storm
26876 	 *  for pri 6
26877 	 */
26878 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri6;
26879 	/*
26880 	 * Total number of packets received during PFC watchdog storm
26881 	 *  for pri 7
26882 	 */
26883 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri7;
26884 	/*
26885 	 * Total number of bytes received during PFC watchdog storm
26886 	 * for pri 0
26887 	 */
26888 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri0;
26889 	/*
26890 	 * Total number of bytes received during PFC watchdog storm
26891 	 * for pri 1
26892 	 */
26893 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri1;
26894 	/*
26895 	 * Total number of bytes received during PFC watchdog storm
26896 	 *  for pri 2
26897 	 */
26898 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri2;
26899 	/*
26900 	 * Total number of bytes received during PFC watchdog storm
26901 	 *  for pri 3
26902 	 */
26903 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri3;
26904 	/*
26905 	 * Total number of bytes received during PFC watchdog storm
26906 	 *  for pri 4
26907 	 */
26908 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri4;
26909 	/*
26910 	 * Total number of bytes received during PFC watchdog storm
26911 	 *  for pri 5
26912 	 */
26913 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri5;
26914 	/*
26915 	 * Total number of bytes received during PFC watchdog storm
26916 	 *  for pri 6
26917 	 */
26918 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri6;
26919 	/*
26920 	 * Total number of bytes received during PFC watchdog storm
26921 	 *  for pri 7
26922 	 */
26923 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri7;
26924 	/*
26925 	 * Total number of packets dropped on rx during PFC watchdog storm
26926 	 * for pri 0
26927 	 */
26928 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
26929 	/*
26930 	 * Total number of packets dropped on rx during PFC watchdog storm
26931 	 * for pri 1
26932 	 */
26933 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
26934 	/*
26935 	 * Total number of packets dropped on rx during PFC watchdog storm
26936 	 *  for pri 2
26937 	 */
26938 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
26939 	/*
26940 	 * Total number of packets dropped on rx during PFC watchdog storm
26941 	 *  for pri 3
26942 	 */
26943 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
26944 	/*
26945 	 * Total number of packets dropped on rx during PFC watchdog storm
26946 	 *  for pri 4
26947 	 */
26948 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
26949 	/*
26950 	 * Total number of packets dropped on rx during PFC watchdog storm
26951 	 *  for pri 5
26952 	 */
26953 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
26954 	/*
26955 	 * Total number of packets dropped on rx during PFC watchdog storm
26956 	 *  for pri 6
26957 	 */
26958 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
26959 	/*
26960 	 * Total number of packets dropped on rx during PFC watchdog storm
26961 	 *  for pri 7
26962 	 */
26963 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
26964 	/*
26965 	 * Total number of bytes dropped on rx during PFC watchdog storm
26966 	 * for pri 0
26967 	 */
26968 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
26969 	/*
26970 	 * Total number of bytes dropped on rx during PFC watchdog storm
26971 	 * for pri 1
26972 	 */
26973 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
26974 	/*
26975 	 * Total number of bytes dropped on rx during PFC watchdog storm
26976 	 *  for pri 2
26977 	 */
26978 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
26979 	/*
26980 	 * Total number of bytes dropped on rx during PFC watchdog storm
26981 	 *  for pri 3
26982 	 */
26983 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
26984 	/*
26985 	 * Total number of bytes dropped on rx during PFC watchdog storm
26986 	 *  for pri 4
26987 	 */
26988 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
26989 	/*
26990 	 * Total number of bytes dropped on rx during PFC watchdog storm
26991 	 *  for pri 5
26992 	 */
26993 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
26994 	/*
26995 	 * Total number of bytes dropped on rx during PFC watchdog storm
26996 	 *  for pri 6
26997 	 */
26998 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
26999 	/*
27000 	 * Total number of bytes dropped on rx during PFC watchdog storm
27001 	 *  for pri 7
27002 	 */
27003 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
27004 	/*
27005 	 * Number of packets received during last PFC watchdog storm
27006 	 * for pri 0
27007 	 */
27008 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri0;
27009 	/*
27010 	 * Number of packets received during last PFC watchdog storm
27011 	 * for pri 1
27012 	 */
27013 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri1;
27014 	/*
27015 	 * Number of packets received during last PFC watchdog storm
27016 	 *  for pri 2
27017 	 */
27018 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri2;
27019 	/*
27020 	 * Number of packets received during last PFC watchdog storm
27021 	 *  for pri 3
27022 	 */
27023 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri3;
27024 	/*
27025 	 * Number of packets received during last PFC watchdog storm
27026 	 *  for pri 4
27027 	 */
27028 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri4;
27029 	/*
27030 	 * Number of packets received during last PFC watchdog storm
27031 	 *  for pri 5
27032 	 */
27033 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri5;
27034 	/*
27035 	 * Number of packets received during last PFC watchdog storm
27036 	 *  for pri 6
27037 	 */
27038 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri6;
27039 	/*
27040 	 * Number of packets received during last PFC watchdog storm
27041 	 *  for pri 7
27042 	 */
27043 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri7;
27044 	/*
27045 	 * Number of bytes received during last PFC watchdog storm
27046 	 * for pri 0
27047 	 */
27048 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri0;
27049 	/*
27050 	 * Number of bytes received during last PFC watchdog storm
27051 	 * for pri 1
27052 	 */
27053 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri1;
27054 	/*
27055 	 * Number of bytes received during last PFC watchdog storm
27056 	 *  for pri 2
27057 	 */
27058 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri2;
27059 	/*
27060 	 * Number of bytes received during last PFC watchdog storm
27061 	 *  for pri 3
27062 	 */
27063 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri3;
27064 	/*
27065 	 * Number of bytes received during last PFC watchdog storm
27066 	 *  for pri 4
27067 	 */
27068 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri4;
27069 	/*
27070 	 * Number of bytes received during last PFC watchdog storm
27071 	 *  for pri 5
27072 	 */
27073 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri5;
27074 	/*
27075 	 * Number of bytes received during last PFC watchdog storm
27076 	 *  for pri 6
27077 	 */
27078 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri6;
27079 	/*
27080 	 * Number of bytes received during last PFC watchdog storm
27081 	 *  for pri 7
27082 	 */
27083 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri7;
27084 	/*
27085 	 * Number of packets dropped on rx during last PFC watchdog storm
27086 	 * for pri 0
27087 	 */
27088 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
27089 	/*
27090 	 * Number of packets dropped on rx during last PFC watchdog storm
27091 	 * for pri 1
27092 	 */
27093 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
27094 	/*
27095 	 * Number of packets dropped on rx during last PFC watchdog storm
27096 	 *  for pri 2
27097 	 */
27098 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
27099 	/*
27100 	 * Number of packets dropped on rx during last PFC watchdog storm
27101 	 *  for pri 3
27102 	 */
27103 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
27104 	/*
27105 	 * Number of packets dropped on rx during last PFC watchdog storm
27106 	 *  for pri 4
27107 	 */
27108 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
27109 	/*
27110 	 * Number of packets dropped on rx during last PFC watchdog storm
27111 	 *  for pri 5
27112 	 */
27113 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
27114 	/*
27115 	 * Number of packets dropped on rx during last PFC watchdog storm
27116 	 *  for pri 6
27117 	 */
27118 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
27119 	/*
27120 	 * Number of packets dropped on rx during last PFC watchdog storm
27121 	 *  for pri 7
27122 	 */
27123 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
27124 	/*
27125 	 * Total number of bytes dropped on rx during PFC watchdog storm
27126 	 * for pri 0
27127 	 */
27128 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
27129 	/*
27130 	 * Number of bytes dropped on rx during last PFC watchdog storm
27131 	 * for pri 1
27132 	 */
27133 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
27134 	/*
27135 	 * Number of bytes dropped on rx during last PFC watchdog storm
27136 	 *  for pri 2
27137 	 */
27138 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
27139 	/*
27140 	 * Number of bytes dropped on rx during last PFC watchdog storm
27141 	 *  for pri 3
27142 	 */
27143 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
27144 	/*
27145 	 * Number of bytes dropped on rx during last PFC watchdog storm
27146 	 *  for pri 4
27147 	 */
27148 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
27149 	/*
27150 	 * Number of bytes dropped on rx during last PFC watchdog storm
27151 	 *  for pri 5
27152 	 */
27153 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
27154 	/*
27155 	 * Number of bytes dropped on rx during last PFC watchdog storm
27156 	 *  for pri 6
27157 	 */
27158 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
27159 	/*
27160 	 * Number of bytes dropped on rx during last PFC watchdog storm
27161 	 *  for pri 7
27162 	 */
27163 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
27164 } rx_port_stats_ext_pfc_wd_t, *prx_port_stats_ext_pfc_wd_t;
27165 
27166 /************************
27167  * hwrm_port_qstats_ext *
27168  ************************/
27169 
27170 
27171 /* hwrm_port_qstats_ext_input (size:320b/40B) */
27172 
27173 typedef struct hwrm_port_qstats_ext_input {
27174 	/* The HWRM command request type. */
27175 	uint16_t	req_type;
27176 	/*
27177 	 * The completion ring to send the completion event on. This should
27178 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27179 	 */
27180 	uint16_t	cmpl_ring;
27181 	/*
27182 	 * The sequence ID is used by the driver for tracking multiple
27183 	 * commands. This ID is treated as opaque data by the firmware and
27184 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27185 	 */
27186 	uint16_t	seq_id;
27187 	/*
27188 	 * The target ID of the command:
27189 	 * * 0x0-0xFFF8 - The function ID
27190 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27191 	 * * 0xFFFD - Reserved for user-space HWRM interface
27192 	 * * 0xFFFF - HWRM
27193 	 */
27194 	uint16_t	target_id;
27195 	/*
27196 	 * A physical address pointer pointing to a host buffer that the
27197 	 * command's response data will be written. This can be either a host
27198 	 * physical address (HPA) or a guest physical address (GPA) and must
27199 	 * point to a physically contiguous block of memory.
27200 	 */
27201 	uint64_t	resp_addr;
27202 	/* Port ID of port that is being queried. */
27203 	uint16_t	port_id;
27204 	/*
27205 	 * The size of TX port extended
27206 	 * statistics block in bytes.
27207 	 */
27208 	uint16_t	tx_stat_size;
27209 	/*
27210 	 * The size of RX port extended
27211 	 * statistics block in bytes
27212 	 */
27213 	uint16_t	rx_stat_size;
27214 	uint8_t	flags;
27215 	/*
27216 	 * This bit is set to 1 when request is for the counter mask,
27217 	 * representing width of each of the stats counters, rather than
27218 	 * counters themselves.
27219 	 */
27220 	#define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
27221 	uint8_t	unused_0;
27222 	/*
27223 	 * This is the host address where
27224 	 * Tx port statistics will be stored
27225 	 */
27226 	uint64_t	tx_stat_host_addr;
27227 	/*
27228 	 * This is the host address where
27229 	 * Rx port statistics will be stored
27230 	 */
27231 	uint64_t	rx_stat_host_addr;
27232 } hwrm_port_qstats_ext_input_t, *phwrm_port_qstats_ext_input_t;
27233 
27234 /* hwrm_port_qstats_ext_output (size:128b/16B) */
27235 
27236 typedef struct hwrm_port_qstats_ext_output {
27237 	/* The specific error status for the command. */
27238 	uint16_t	error_code;
27239 	/* The HWRM command request type. */
27240 	uint16_t	req_type;
27241 	/* The sequence ID from the original command. */
27242 	uint16_t	seq_id;
27243 	/* The length of the response data in number of bytes. */
27244 	uint16_t	resp_len;
27245 	/* The size of TX port statistics block in bytes. */
27246 	uint16_t	tx_stat_size;
27247 	/* The size of RX port statistics block in bytes. */
27248 	uint16_t	rx_stat_size;
27249 	/* Total number of active cos queues available. */
27250 	uint16_t	total_active_cos_queues;
27251 	uint8_t	flags;
27252 	/*
27253 	 * If set to 1, then this field indicates that clear
27254 	 * roce specific counters is supported.
27255 	 */
27256 	#define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED	UINT32_C(0x1)
27257 	/*
27258 	 * This field is used in Output records to indicate that the output
27259 	 * is completely written to RAM.  This field should be read as '1'
27260 	 * to indicate that the output has been completely written.
27261 	 * When writing a command completion or response to an internal processor,
27262 	 * the order of writes has to be such that this field is written last.
27263 	 */
27264 	uint8_t	valid;
27265 } hwrm_port_qstats_ext_output_t, *phwrm_port_qstats_ext_output_t;
27266 
27267 /*******************************
27268  * hwrm_port_qstats_ext_pfc_wd *
27269  *******************************/
27270 
27271 
27272 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
27273 
27274 typedef struct hwrm_port_qstats_ext_pfc_wd_input {
27275 	/* The HWRM command request type. */
27276 	uint16_t	req_type;
27277 	/*
27278 	 * The completion ring to send the completion event on. This should
27279 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27280 	 */
27281 	uint16_t	cmpl_ring;
27282 	/*
27283 	 * The sequence ID is used by the driver for tracking multiple
27284 	 * commands. This ID is treated as opaque data by the firmware and
27285 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27286 	 */
27287 	uint16_t	seq_id;
27288 	/*
27289 	 * The target ID of the command:
27290 	 * * 0x0-0xFFF8 - The function ID
27291 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27292 	 * * 0xFFFD - Reserved for user-space HWRM interface
27293 	 * * 0xFFFF - HWRM
27294 	 */
27295 	uint16_t	target_id;
27296 	/*
27297 	 * A physical address pointer pointing to a host buffer that the
27298 	 * command's response data will be written. This can be either a host
27299 	 * physical address (HPA) or a guest physical address (GPA) and must
27300 	 * point to a physically contiguous block of memory.
27301 	 */
27302 	uint64_t	resp_addr;
27303 	/* Port ID of port that is being queried. */
27304 	uint16_t	port_id;
27305 	/*
27306 	 * The size of rx_port_stats_ext_pfc_wd
27307 	 * block in bytes
27308 	 */
27309 	uint16_t	pfc_wd_stat_size;
27310 	uint8_t	unused_0[4];
27311 	/*
27312 	 * This is the host address where
27313 	 * rx_port_stats_ext_pfc_wd will be stored
27314 	 */
27315 	uint64_t	pfc_wd_stat_host_addr;
27316 } hwrm_port_qstats_ext_pfc_wd_input_t, *phwrm_port_qstats_ext_pfc_wd_input_t;
27317 
27318 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
27319 
27320 typedef struct hwrm_port_qstats_ext_pfc_wd_output {
27321 	/* The specific error status for the command. */
27322 	uint16_t	error_code;
27323 	/* The HWRM command request type. */
27324 	uint16_t	req_type;
27325 	/* The sequence ID from the original command. */
27326 	uint16_t	seq_id;
27327 	/* The length of the response data in number of bytes. */
27328 	uint16_t	resp_len;
27329 	/*
27330 	 * The size of rx_port_stats_ext_pfc_wd
27331 	 * statistics block in bytes.
27332 	 */
27333 	uint16_t	pfc_wd_stat_size;
27334 	uint8_t	flags;
27335 	/*
27336 	 * This field is used in Output records to indicate that the output
27337 	 * is completely written to RAM.  This field should be read as '1'
27338 	 * to indicate that the output has been completely written.
27339 	 * When writing a command completion or response to an internal processor,
27340 	 * the order of writes has to be such that this field is written last.
27341 	 */
27342 	uint8_t	valid;
27343 	uint8_t	unused_0[4];
27344 } hwrm_port_qstats_ext_pfc_wd_output_t, *phwrm_port_qstats_ext_pfc_wd_output_t;
27345 
27346 /*************************
27347  * hwrm_port_lpbk_qstats *
27348  *************************/
27349 
27350 
27351 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
27352 
27353 typedef struct hwrm_port_lpbk_qstats_input {
27354 	/* The HWRM command request type. */
27355 	uint16_t	req_type;
27356 	/*
27357 	 * The completion ring to send the completion event on. This should
27358 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27359 	 */
27360 	uint16_t	cmpl_ring;
27361 	/*
27362 	 * The sequence ID is used by the driver for tracking multiple
27363 	 * commands. This ID is treated as opaque data by the firmware and
27364 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27365 	 */
27366 	uint16_t	seq_id;
27367 	/*
27368 	 * The target ID of the command:
27369 	 * * 0x0-0xFFF8 - The function ID
27370 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27371 	 * * 0xFFFD - Reserved for user-space HWRM interface
27372 	 * * 0xFFFF - HWRM
27373 	 */
27374 	uint16_t	target_id;
27375 	/*
27376 	 * A physical address pointer pointing to a host buffer that the
27377 	 * command's response data will be written. This can be either a host
27378 	 * physical address (HPA) or a guest physical address (GPA) and must
27379 	 * point to a physically contiguous block of memory.
27380 	 */
27381 	uint64_t	resp_addr;
27382 } hwrm_port_lpbk_qstats_input_t, *phwrm_port_lpbk_qstats_input_t;
27383 
27384 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
27385 
27386 typedef struct hwrm_port_lpbk_qstats_output {
27387 	/* The specific error status for the command. */
27388 	uint16_t	error_code;
27389 	/* The HWRM command request type. */
27390 	uint16_t	req_type;
27391 	/* The sequence ID from the original command. */
27392 	uint16_t	seq_id;
27393 	/* The length of the response data in number of bytes. */
27394 	uint16_t	resp_len;
27395 	/* Number of transmitted unicast frames */
27396 	uint64_t	lpbk_ucast_frames;
27397 	/* Number of transmitted multicast frames */
27398 	uint64_t	lpbk_mcast_frames;
27399 	/* Number of transmitted broadcast frames */
27400 	uint64_t	lpbk_bcast_frames;
27401 	/* Number of transmitted bytes for unicast traffic */
27402 	uint64_t	lpbk_ucast_bytes;
27403 	/* Number of transmitted bytes for multicast traffic */
27404 	uint64_t	lpbk_mcast_bytes;
27405 	/* Number of transmitted bytes for broadcast traffic */
27406 	uint64_t	lpbk_bcast_bytes;
27407 	/* Total Tx Drops for loopback traffic reported by STATS block */
27408 	uint64_t	tx_stat_discard;
27409 	/* Total Tx Error Drops for loopback traffic reported by STATS block */
27410 	uint64_t	tx_stat_error;
27411 	/* Total Rx Drops for loopback traffic reported by STATS block */
27412 	uint64_t	rx_stat_discard;
27413 	/* Total Rx Error Drops for loopback traffic reported by STATS block */
27414 	uint64_t	rx_stat_error;
27415 	uint8_t	unused_0[7];
27416 	/*
27417 	 * This field is used in Output records to indicate that the output
27418 	 * is completely written to RAM.  This field should be read as '1'
27419 	 * to indicate that the output has been completely written.
27420 	 * When writing a command completion or response to an internal processor,
27421 	 * the order of writes has to be such that this field is written last.
27422 	 */
27423 	uint8_t	valid;
27424 } hwrm_port_lpbk_qstats_output_t, *phwrm_port_lpbk_qstats_output_t;
27425 
27426 /************************
27427  * hwrm_port_ecn_qstats *
27428  ************************/
27429 
27430 
27431 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
27432 
27433 typedef struct hwrm_port_ecn_qstats_input {
27434 	/* The HWRM command request type. */
27435 	uint16_t	req_type;
27436 	/*
27437 	 * The completion ring to send the completion event on. This should
27438 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27439 	 */
27440 	uint16_t	cmpl_ring;
27441 	/*
27442 	 * The sequence ID is used by the driver for tracking multiple
27443 	 * commands. This ID is treated as opaque data by the firmware and
27444 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27445 	 */
27446 	uint16_t	seq_id;
27447 	/*
27448 	 * The target ID of the command:
27449 	 * * 0x0-0xFFF8 - The function ID
27450 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27451 	 * * 0xFFFD - Reserved for user-space HWRM interface
27452 	 * * 0xFFFF - HWRM
27453 	 */
27454 	uint16_t	target_id;
27455 	/*
27456 	 * A physical address pointer pointing to a host buffer that the
27457 	 * command's response data will be written. This can be either a host
27458 	 * physical address (HPA) or a guest physical address (GPA) and must
27459 	 * point to a physically contiguous block of memory.
27460 	 */
27461 	uint64_t	resp_addr;
27462 	/*
27463 	 * Port ID of port that is being queried. Unused if NIC is in
27464 	 * multi-host mode.
27465 	 */
27466 	uint16_t	port_id;
27467 	/*
27468 	 * Size of the DMA buffer the caller has allocated for the firmware to
27469 	 * write into.
27470 	 */
27471 	uint16_t	ecn_stat_buf_size;
27472 	uint8_t	flags;
27473 	/*
27474 	 * This bit is set to 1 when request is for a counter mask,
27475 	 * representing the width of each of the stats counters, rather
27476 	 * than counters themselves.
27477 	 */
27478 	#define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
27479 	uint8_t	unused_0[3];
27480 	/*
27481 	 * This is the host address where
27482 	 * ECN port statistics will be stored
27483 	 */
27484 	uint64_t	ecn_stat_host_addr;
27485 } hwrm_port_ecn_qstats_input_t, *phwrm_port_ecn_qstats_input_t;
27486 
27487 /* hwrm_port_ecn_qstats_output (size:128b/16B) */
27488 
27489 typedef struct hwrm_port_ecn_qstats_output {
27490 	/* The specific error status for the command. */
27491 	uint16_t	error_code;
27492 	/* The HWRM command request type. */
27493 	uint16_t	req_type;
27494 	/* The sequence ID from the original command. */
27495 	uint16_t	seq_id;
27496 	/* The length of the response data in number of bytes. */
27497 	uint16_t	resp_len;
27498 	/* Number of bytes of stats the firmware wrote to the DMA buffer. */
27499 	uint16_t	ecn_stat_buf_size;
27500 	/*
27501 	 * Bitmask that indicates which CoS queues have ECN marking enabled.
27502 	 * Bit i corresponds to CoS queue i.
27503 	 */
27504 	uint8_t	mark_en;
27505 	uint8_t	unused_0[4];
27506 	/*
27507 	 * This field is used in Output records to indicate that the output
27508 	 * is completely written to RAM.  This field should be read as '1'
27509 	 * to indicate that the output has been completely written.
27510 	 * When writing a command completion or response to an internal processor,
27511 	 * the order of writes has to be such that this field is written last.
27512 	 */
27513 	uint8_t	valid;
27514 } hwrm_port_ecn_qstats_output_t, *phwrm_port_ecn_qstats_output_t;
27515 
27516 /* ECN mark statistics format */
27517 /* port_stats_ecn (size:512b/64B) */
27518 
27519 typedef struct port_stats_ecn {
27520 	/*
27521 	 * Number of packets marked in CoS queue 0.
27522 	 * Or, if the driver requested counter masks, a mask to indicate the size
27523 	 * of the counter.
27524 	 */
27525 	uint64_t	mark_cnt_cos0;
27526 	/*
27527 	 * Number of packets marked in CoS queue 1.
27528 	 * Or, if the driver requested counter masks, a mask to indicate the size
27529 	 * of the counter.
27530 	 */
27531 	uint64_t	mark_cnt_cos1;
27532 	/*
27533 	 * Number of packets marked in CoS queue 2.
27534 	 * Or, if the driver requested counter masks, a mask to indicate the size
27535 	 * of the counter.
27536 	 */
27537 	uint64_t	mark_cnt_cos2;
27538 	/*
27539 	 * Number of packets marked in CoS queue 3.
27540 	 * Or, if the driver requested counter masks, a mask to indicate the size
27541 	 * of the counter.
27542 	 */
27543 	uint64_t	mark_cnt_cos3;
27544 	/*
27545 	 * Number of packets marked in CoS queue 4.
27546 	 * Or, if the driver requested counter masks, a mask to indicate the size
27547 	 * of the counter.
27548 	 */
27549 	uint64_t	mark_cnt_cos4;
27550 	/*
27551 	 * Number of packets marked in CoS queue 5.
27552 	 * Or, if the driver requested counter masks, a mask to indicate the size
27553 	 * of the counter.
27554 	 */
27555 	uint64_t	mark_cnt_cos5;
27556 	/*
27557 	 * Number of packets marked in CoS queue 6.
27558 	 * Or, if the driver requested counter masks, a mask to indicate the size
27559 	 * of the counter.
27560 	 */
27561 	uint64_t	mark_cnt_cos6;
27562 	/*
27563 	 * Number of packets marked in CoS queue 7.
27564 	 * Or, if the driver requested counter masks, a mask to indicate the size
27565 	 * of the counter.
27566 	 */
27567 	uint64_t	mark_cnt_cos7;
27568 } port_stats_ecn_t, *pport_stats_ecn_t;
27569 
27570 /***********************
27571  * hwrm_port_clr_stats *
27572  ***********************/
27573 
27574 
27575 /* hwrm_port_clr_stats_input (size:192b/24B) */
27576 
27577 typedef struct hwrm_port_clr_stats_input {
27578 	/* The HWRM command request type. */
27579 	uint16_t	req_type;
27580 	/*
27581 	 * The completion ring to send the completion event on. This should
27582 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27583 	 */
27584 	uint16_t	cmpl_ring;
27585 	/*
27586 	 * The sequence ID is used by the driver for tracking multiple
27587 	 * commands. This ID is treated as opaque data by the firmware and
27588 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27589 	 */
27590 	uint16_t	seq_id;
27591 	/*
27592 	 * The target ID of the command:
27593 	 * * 0x0-0xFFF8 - The function ID
27594 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27595 	 * * 0xFFFD - Reserved for user-space HWRM interface
27596 	 * * 0xFFFF - HWRM
27597 	 */
27598 	uint16_t	target_id;
27599 	/*
27600 	 * A physical address pointer pointing to a host buffer that the
27601 	 * command's response data will be written. This can be either a host
27602 	 * physical address (HPA) or a guest physical address (GPA) and must
27603 	 * point to a physically contiguous block of memory.
27604 	 */
27605 	uint64_t	resp_addr;
27606 	/* Port ID of port that is being queried. */
27607 	uint16_t	port_id;
27608 	uint8_t	flags;
27609 	/*
27610 	 * If set to 1, then this field indicates clear the following RoCE
27611 	 * specific counters.
27612 	 * RoCE associated TX/RX cos counters
27613 	 * CNP associated TX/RX cos counters
27614 	 * RoCE/CNP specific TX/RX flow counters
27615 	 * Firmware will determine the RoCE/CNP cos queue based on qos profile.
27616 	 * This flag is honored only when RoCE is enabled on that port.
27617 	 */
27618 	#define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS	UINT32_C(0x1)
27619 	uint8_t	unused_0[5];
27620 } hwrm_port_clr_stats_input_t, *phwrm_port_clr_stats_input_t;
27621 
27622 /* hwrm_port_clr_stats_output (size:128b/16B) */
27623 
27624 typedef struct hwrm_port_clr_stats_output {
27625 	/* The specific error status for the command. */
27626 	uint16_t	error_code;
27627 	/* The HWRM command request type. */
27628 	uint16_t	req_type;
27629 	/* The sequence ID from the original command. */
27630 	uint16_t	seq_id;
27631 	/* The length of the response data in number of bytes. */
27632 	uint16_t	resp_len;
27633 	uint8_t	unused_0[7];
27634 	/*
27635 	 * This field is used in Output records to indicate that the output
27636 	 * is completely written to RAM.  This field should be read as '1'
27637 	 * to indicate that the output has been completely written.
27638 	 * When writing a command completion or response to an internal processor,
27639 	 * the order of writes has to be such that this field is written last.
27640 	 */
27641 	uint8_t	valid;
27642 } hwrm_port_clr_stats_output_t, *phwrm_port_clr_stats_output_t;
27643 
27644 /****************************
27645  * hwrm_port_lpbk_clr_stats *
27646  ****************************/
27647 
27648 
27649 /* hwrm_port_lpbk_clr_stats_input (size:128b/16B) */
27650 
27651 typedef struct hwrm_port_lpbk_clr_stats_input {
27652 	/* The HWRM command request type. */
27653 	uint16_t	req_type;
27654 	/*
27655 	 * The completion ring to send the completion event on. This should
27656 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27657 	 */
27658 	uint16_t	cmpl_ring;
27659 	/*
27660 	 * The sequence ID is used by the driver for tracking multiple
27661 	 * commands. This ID is treated as opaque data by the firmware and
27662 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27663 	 */
27664 	uint16_t	seq_id;
27665 	/*
27666 	 * The target ID of the command:
27667 	 * * 0x0-0xFFF8 - The function ID
27668 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27669 	 * * 0xFFFD - Reserved for user-space HWRM interface
27670 	 * * 0xFFFF - HWRM
27671 	 */
27672 	uint16_t	target_id;
27673 	/*
27674 	 * A physical address pointer pointing to a host buffer that the
27675 	 * command's response data will be written. This can be either a host
27676 	 * physical address (HPA) or a guest physical address (GPA) and must
27677 	 * point to a physically contiguous block of memory.
27678 	 */
27679 	uint64_t	resp_addr;
27680 } hwrm_port_lpbk_clr_stats_input_t, *phwrm_port_lpbk_clr_stats_input_t;
27681 
27682 /* hwrm_port_lpbk_clr_stats_output (size:128b/16B) */
27683 
27684 typedef struct hwrm_port_lpbk_clr_stats_output {
27685 	/* The specific error status for the command. */
27686 	uint16_t	error_code;
27687 	/* The HWRM command request type. */
27688 	uint16_t	req_type;
27689 	/* The sequence ID from the original command. */
27690 	uint16_t	seq_id;
27691 	/* The length of the response data in number of bytes. */
27692 	uint16_t	resp_len;
27693 	uint8_t	unused_0[7];
27694 	/*
27695 	 * This field is used in Output records to indicate that the output
27696 	 * is completely written to RAM.  This field should be read as '1'
27697 	 * to indicate that the output has been completely written.
27698 	 * When writing a command completion or response to an internal processor,
27699 	 * the order of writes has to be such that this field is written last.
27700 	 */
27701 	uint8_t	valid;
27702 } hwrm_port_lpbk_clr_stats_output_t, *phwrm_port_lpbk_clr_stats_output_t;
27703 
27704 /**********************
27705  * hwrm_port_ts_query *
27706  **********************/
27707 
27708 
27709 /* hwrm_port_ts_query_input (size:320b/40B) */
27710 
27711 typedef struct hwrm_port_ts_query_input {
27712 	/* The HWRM command request type. */
27713 	uint16_t	req_type;
27714 	/*
27715 	 * The completion ring to send the completion event on. This should
27716 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27717 	 */
27718 	uint16_t	cmpl_ring;
27719 	/*
27720 	 * The sequence ID is used by the driver for tracking multiple
27721 	 * commands. This ID is treated as opaque data by the firmware and
27722 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27723 	 */
27724 	uint16_t	seq_id;
27725 	/*
27726 	 * The target ID of the command:
27727 	 * * 0x0-0xFFF8 - The function ID
27728 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27729 	 * * 0xFFFD - Reserved for user-space HWRM interface
27730 	 * * 0xFFFF - HWRM
27731 	 */
27732 	uint16_t	target_id;
27733 	/*
27734 	 * A physical address pointer pointing to a host buffer that the
27735 	 * command's response data will be written. This can be either a host
27736 	 * physical address (HPA) or a guest physical address (GPA) and must
27737 	 * point to a physically contiguous block of memory.
27738 	 */
27739 	uint64_t	resp_addr;
27740 	uint32_t	flags;
27741 	/*
27742 	 * Enumeration denoting the RX, TX type of the resource.
27743 	 * This enumeration is used for resources that are similar for both
27744 	 * TX and RX paths of the chip.
27745 	 */
27746 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH		UINT32_C(0x1)
27747 	/* tx path */
27748 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
27749 	/* rx path */
27750 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
27751 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST	HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
27752 	/*
27753 	 * If set, the response includes the current value of the free
27754 	 * running timer.
27755 	 */
27756 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME	UINT32_C(0x2)
27757 	/* Port ID of port that is being queried. */
27758 	uint16_t	port_id;
27759 	uint8_t	unused_0[2];
27760 	uint16_t	enables;
27761 	/*
27762 	 * This bit must be '1' for the ts_req_timeout field to be
27763 	 * configured.
27764 	 */
27765 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_TS_REQ_TIMEOUT	UINT32_C(0x1)
27766 	/*
27767 	 * This bit must be '1' for the ptp_seq_id field to be
27768 	 * configured.
27769 	 */
27770 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_PTP_SEQ_ID	UINT32_C(0x2)
27771 	/*
27772 	 * This bit must be '1' for the ptp_hdr_offset field to be
27773 	 * configured.
27774 	 */
27775 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_PTP_HDR_OFFSET	UINT32_C(0x4)
27776 	/*
27777 	 * Specifies the timeout in microseconds. If this is specified,
27778 	 * firmware will keep checking for a matching timestamp packet
27779 	 * till the timeout is exhausted. User can specify a max timeout
27780 	 * of 65535 microseconds. Firmware will return HWRM_ERR_CODE_BUSY
27781 	 * if a matching timestamp is not found. Firmware will return
27782 	 * HWRM_ERROR_CODE_FAIL if we are unable to read timestamps
27783 	 * from FIFO.
27784 	 */
27785 	uint16_t	ts_req_timeout;
27786 	/*
27787 	 * Specifies the sequence ID of the PTP timestamp packet we
27788 	 * are interested in. When this is specified, firmware will
27789 	 * only return the timestamp of the packet which matches this
27790 	 * sequence ID.
27791 	 */
27792 	uint32_t	ptp_seq_id;
27793 	/*
27794 	 * Specifies the PTP header offset of the PTP packet for which
27795 	 * the timestamp is requested.
27796 	 */
27797 	uint16_t	ptp_hdr_offset;
27798 	uint8_t	unused_1[6];
27799 } hwrm_port_ts_query_input_t, *phwrm_port_ts_query_input_t;
27800 
27801 /* hwrm_port_ts_query_output (size:192b/24B) */
27802 
27803 typedef struct hwrm_port_ts_query_output {
27804 	/* The specific error status for the command. */
27805 	uint16_t	error_code;
27806 	/* The HWRM command request type. */
27807 	uint16_t	req_type;
27808 	/* The sequence ID from the original command. */
27809 	uint16_t	seq_id;
27810 	/* The length of the response data in number of bytes. */
27811 	uint16_t	resp_len;
27812 	/*
27813 	 * Timestamp value of PTP message captured, or current value of
27814 	 * free running timer.
27815 	 */
27816 	uint64_t	ptp_msg_ts;
27817 	/* Sequence ID of the PTP message captured. */
27818 	uint16_t	ptp_msg_seqid;
27819 	uint8_t	unused_0[5];
27820 	/*
27821 	 * This field is used in Output records to indicate that the output
27822 	 * is completely written to RAM.  This field should be read as '1'
27823 	 * to indicate that the output has been completely written.
27824 	 * When writing a command completion or response to an internal processor,
27825 	 * the order of writes has to be such that this field is written last.
27826 	 */
27827 	uint8_t	valid;
27828 } hwrm_port_ts_query_output_t, *phwrm_port_ts_query_output_t;
27829 
27830 /***********************
27831  * hwrm_port_phy_qcaps *
27832  ***********************/
27833 
27834 
27835 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
27836 
27837 typedef struct hwrm_port_phy_qcaps_input {
27838 	/* The HWRM command request type. */
27839 	uint16_t	req_type;
27840 	/*
27841 	 * The completion ring to send the completion event on. This should
27842 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27843 	 */
27844 	uint16_t	cmpl_ring;
27845 	/*
27846 	 * The sequence ID is used by the driver for tracking multiple
27847 	 * commands. This ID is treated as opaque data by the firmware and
27848 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27849 	 */
27850 	uint16_t	seq_id;
27851 	/*
27852 	 * The target ID of the command:
27853 	 * * 0x0-0xFFF8 - The function ID
27854 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27855 	 * * 0xFFFD - Reserved for user-space HWRM interface
27856 	 * * 0xFFFF - HWRM
27857 	 */
27858 	uint16_t	target_id;
27859 	/*
27860 	 * A physical address pointer pointing to a host buffer that the
27861 	 * command's response data will be written. This can be either a host
27862 	 * physical address (HPA) or a guest physical address (GPA) and must
27863 	 * point to a physically contiguous block of memory.
27864 	 */
27865 	uint64_t	resp_addr;
27866 	/* Port ID of port that is being queried. */
27867 	uint16_t	port_id;
27868 	uint8_t	unused_0[6];
27869 } hwrm_port_phy_qcaps_input_t, *phwrm_port_phy_qcaps_input_t;
27870 
27871 /* hwrm_port_phy_qcaps_output (size:256b/32B) */
27872 
27873 typedef struct hwrm_port_phy_qcaps_output {
27874 	/* The specific error status for the command. */
27875 	uint16_t	error_code;
27876 	/* The HWRM command request type. */
27877 	uint16_t	req_type;
27878 	/* The sequence ID from the original command. */
27879 	uint16_t	seq_id;
27880 	/* The length of the response data in number of bytes. */
27881 	uint16_t	resp_len;
27882 	/* PHY capability flags */
27883 	uint8_t	flags;
27884 	/*
27885 	 * If set to 1, then this field indicates that the
27886 	 * link is capable of supporting EEE.
27887 	 */
27888 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED			UINT32_C(0x1)
27889 	/*
27890 	 * If set to 1, then this field indicates that the
27891 	 * PHY is capable of supporting external loopback.
27892 	 */
27893 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED	UINT32_C(0x2)
27894 	/*
27895 	 * If set to 1, then this field indicates that the
27896 	 * PHY is capable of supporting loopback in autoneg mode.
27897 	 */
27898 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED	UINT32_C(0x4)
27899 	/*
27900 	 * Indicates if the configuration of shared PHY settings is supported.
27901 	 * In cases where a physical port is shared by multiple functions
27902 	 * (e.g. NPAR, multihost, etc), the configuration of PHY
27903 	 * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
27904 	 * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
27905 	 */
27906 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED	UINT32_C(0x8)
27907 	/*
27908 	 * If set to 1, it indicates that the port counters and extended
27909 	 * port counters will not reset when the firmware shuts down or
27910 	 * resets the PHY.  These counters will only be reset during power
27911 	 * cycle or by calling HWRM_PORT_CLR_STATS.
27912 	 * If set to 0, the state of the counters is unspecified when
27913 	 * firmware shuts down or resets the PHY.
27914 	 */
27915 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET	UINT32_C(0x10)
27916 	/*
27917 	 * If set to 1, then this field indicates that the
27918 	 * local loopback is not supported on this controller.
27919 	 */
27920 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED	UINT32_C(0x20)
27921 	/*
27922 	 * If set to 1, then this field indicates that the
27923 	 * PHY/Link down policy during PF shutdown is totally
27924 	 * controlled by the firmware. It can shutdown the link
27925 	 * even when there are active VFs associated with the PF.
27926 	 * Host PF driver can send HWRM_PHY_CFG command to bring
27927 	 * down the PHY even when the port is shared between VFs
27928 	 * and PFs.
27929 	 */
27930 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN		UINT32_C(0x40)
27931 	/*
27932 	 * If set to 1, this field indicates that the FCS may
27933 	 * be disabled for a given packet via the transmit
27934 	 * buffer descriptor.
27935 	 */
27936 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS			UINT32_C(0x80)
27937 	/* Number of front panel ports for this device. */
27938 	uint8_t	port_cnt;
27939 	/* Not supported or unknown */
27940 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
27941 	/* single port device */
27942 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1	UINT32_C(0x1)
27943 	/* 2-port device */
27944 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2	UINT32_C(0x2)
27945 	/* 3-port device */
27946 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3	UINT32_C(0x3)
27947 	/* 4-port device */
27948 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4	UINT32_C(0x4)
27949 	/* 12-port device */
27950 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12	UINT32_C(0xc)
27951 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST   HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12
27952 	/*
27953 	 * This is a bit mask to indicate what speeds are supported
27954 	 * as forced speeds on this link.
27955 	 * For each speed that can be forced on this link, the
27956 	 * corresponding mask bit shall be set to '1'.
27957 	 */
27958 	uint16_t	supported_speeds_force_mode;
27959 	/* 100Mb link speed (Half-duplex) */
27960 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD	UINT32_C(0x1)
27961 	/* 100Mb link speed (Full-duplex) */
27962 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB	UINT32_C(0x2)
27963 	/* 1Gb link speed (Half-duplex) */
27964 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD	UINT32_C(0x4)
27965 	/* 1Gb link speed (Full-duplex) */
27966 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB	UINT32_C(0x8)
27967 	/* 2Gb link speed */
27968 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB	UINT32_C(0x10)
27969 	/* 25Gb link speed */
27970 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB	UINT32_C(0x20)
27971 	/* 10Gb link speed */
27972 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB	UINT32_C(0x40)
27973 	/* 20Gb link speed */
27974 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB	UINT32_C(0x80)
27975 	/* 25Gb link speed */
27976 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB	UINT32_C(0x100)
27977 	/* 40Gb link speed */
27978 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB	UINT32_C(0x200)
27979 	/* 50Gb link speed */
27980 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB	UINT32_C(0x400)
27981 	/* 100Gb link speed */
27982 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB	UINT32_C(0x800)
27983 	/* 10Mb link speed (Half-duplex) */
27984 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD	UINT32_C(0x1000)
27985 	/* 10Mb link speed (Full-duplex) */
27986 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB	UINT32_C(0x2000)
27987 	/*
27988 	 * This is a bit mask to indicate what speeds are supported
27989 	 * for autonegotiation on this link.
27990 	 * For each speed that can be autonegotiated on this link, the
27991 	 * corresponding mask bit shall be set to '1'.
27992 	 */
27993 	uint16_t	supported_speeds_auto_mode;
27994 	/* 100Mb link speed (Half-duplex) */
27995 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD	UINT32_C(0x1)
27996 	/* 100Mb link speed (Full-duplex) */
27997 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB	UINT32_C(0x2)
27998 	/* 1Gb link speed (Half-duplex) */
27999 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD	UINT32_C(0x4)
28000 	/* 1Gb link speed (Full-duplex) */
28001 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB	UINT32_C(0x8)
28002 	/* 2Gb link speed */
28003 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB	UINT32_C(0x10)
28004 	/* 25Gb link speed */
28005 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB	UINT32_C(0x20)
28006 	/* 10Gb link speed */
28007 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB	UINT32_C(0x40)
28008 	/* 20Gb link speed */
28009 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB	UINT32_C(0x80)
28010 	/* 25Gb link speed */
28011 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB	UINT32_C(0x100)
28012 	/* 40Gb link speed */
28013 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB	UINT32_C(0x200)
28014 	/* 50Gb link speed */
28015 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB	UINT32_C(0x400)
28016 	/* 100Gb link speed */
28017 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB	UINT32_C(0x800)
28018 	/* 10Mb link speed (Half-duplex) */
28019 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD	UINT32_C(0x1000)
28020 	/* 10Mb link speed (Full-duplex) */
28021 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB	UINT32_C(0x2000)
28022 	/*
28023 	 * This is a bit mask to indicate what speeds are supported
28024 	 * for EEE on this link.
28025 	 * For each speed that can be autonegotiated when EEE is enabled
28026 	 * on this link, the corresponding mask bit shall be set to '1'.
28027 	 * This field is only valid when the eee_supported is set to '1'.
28028 	 */
28029 	uint16_t	supported_speeds_eee_mode;
28030 	/* Reserved */
28031 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1	UINT32_C(0x1)
28032 	/* 100Mb link speed (Full-duplex) */
28033 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB	UINT32_C(0x2)
28034 	/* Reserved */
28035 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2	UINT32_C(0x4)
28036 	/* 1Gb link speed (Full-duplex) */
28037 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB	UINT32_C(0x8)
28038 	/* Reserved */
28039 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3	UINT32_C(0x10)
28040 	/* Reserved */
28041 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4	UINT32_C(0x20)
28042 	/* 10Gb link speed */
28043 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB	UINT32_C(0x40)
28044 	uint32_t	tx_lpi_timer_low;
28045 	/*
28046 	 * The lowest value of TX LPI timer that can be set on this link
28047 	 * when EEE is enabled. This value is in microseconds.
28048 	 * This field is valid only when_eee_supported is set to '1'.
28049 	 */
28050 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK UINT32_C(0xffffff)
28051 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
28052 	/*
28053 	 * Reserved field. The HWRM shall set this field to 0.
28054 	 * An HWRM client shall ignore this field.
28055 	 */
28056 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK	UINT32_C(0xff000000)
28057 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT		24
28058 	uint32_t	valid_tx_lpi_timer_high;
28059 	/*
28060 	 * The highest value of TX LPI timer that can be set on this link
28061 	 * when EEE is enabled. This value is in microseconds.
28062 	 * This field is valid only when_eee_supported is set to '1'.
28063 	 */
28064 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK UINT32_C(0xffffff)
28065 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
28066 	/*
28067 	 * Reserved field. The HWRM shall set this field to 0.
28068 	 * An HWRM client shall ignore this field.
28069 	 */
28070 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_MASK		UINT32_C(0xff000000)
28071 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_SFT		24
28072 	/*
28073 	 * This field is used to advertise which PAM4 speeds are supported
28074 	 * in auto mode.
28075 	 */
28076 	uint16_t	supported_pam4_speeds_auto_mode;
28077 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G	UINT32_C(0x1)
28078 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G	UINT32_C(0x2)
28079 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G	UINT32_C(0x4)
28080 	/*
28081 	 * This field is used to advertise which PAM4 speeds are supported
28082 	 * in forced mode.
28083 	 */
28084 	uint16_t	supported_pam4_speeds_force_mode;
28085 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G	UINT32_C(0x1)
28086 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G	UINT32_C(0x2)
28087 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G	UINT32_C(0x4)
28088 	/* More PHY capability flags */
28089 	uint16_t	flags2;
28090 	/*
28091 	 * If set to 1, then this field indicates that
28092 	 * 802.3x flow control is not supported.
28093 	 */
28094 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PAUSE_UNSUPPORTED	UINT32_C(0x1)
28095 	/*
28096 	 * If set to 1, then this field indicates that
28097 	 * priority-based flow control is not supported.
28098 	 */
28099 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PFC_UNSUPPORTED	UINT32_C(0x2)
28100 	/*
28101 	 * If set to 1, then this field indicates that
28102 	 * bank based addressing is supported in firmware.
28103 	 */
28104 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_BANK_ADDR_SUPPORTED	UINT32_C(0x4)
28105 	/*
28106 	 * Number of internal ports for this device. This field allows the FW
28107 	 * to advertise how many internal ports are present. Manufacturing
28108 	 * tools uses this to determine how many internal ports should have
28109 	 * the PRBS test run on them. This field always return 0 unless NVM
28110 	 * option "HPTN_MODE" is set to 1.
28111 	 */
28112 	uint8_t	internal_port_cnt;
28113 	/*
28114 	 * This field is used in Output records to indicate that the output
28115 	 * is completely written to RAM.  This field should be read as '1'
28116 	 * to indicate that the output has been completely written.
28117 	 * When writing a command completion or response to an internal processor,
28118 	 * the order of writes has to be such that this field is written last.
28119 	 */
28120 	uint8_t	valid;
28121 } hwrm_port_phy_qcaps_output_t, *phwrm_port_phy_qcaps_output_t;
28122 
28123 /***************************
28124  * hwrm_port_phy_i2c_write *
28125  ***************************/
28126 
28127 
28128 /* hwrm_port_phy_i2c_write_input (size:832b/104B) */
28129 
28130 typedef struct hwrm_port_phy_i2c_write_input {
28131 	/* The HWRM command request type. */
28132 	uint16_t	req_type;
28133 	/*
28134 	 * The completion ring to send the completion event on. This should
28135 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28136 	 */
28137 	uint16_t	cmpl_ring;
28138 	/*
28139 	 * The sequence ID is used by the driver for tracking multiple
28140 	 * commands. This ID is treated as opaque data by the firmware and
28141 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28142 	 */
28143 	uint16_t	seq_id;
28144 	/*
28145 	 * The target ID of the command:
28146 	 * * 0x0-0xFFF8 - The function ID
28147 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28148 	 * * 0xFFFD - Reserved for user-space HWRM interface
28149 	 * * 0xFFFF - HWRM
28150 	 */
28151 	uint16_t	target_id;
28152 	/*
28153 	 * A physical address pointer pointing to a host buffer that the
28154 	 * command's response data will be written. This can be either a host
28155 	 * physical address (HPA) or a guest physical address (GPA) and must
28156 	 * point to a physically contiguous block of memory.
28157 	 */
28158 	uint64_t	resp_addr;
28159 	uint32_t	flags;
28160 	uint32_t	enables;
28161 	/*
28162 	 * This bit must be '1' for the page_offset field to be
28163 	 * configured.
28164 	 */
28165 	#define HWRM_PORT_PHY_I2C_WRITE_INPUT_ENABLES_PAGE_OFFSET	UINT32_C(0x1)
28166 	/*
28167 	 * This bit must be '1' for the bank_number field to be
28168 	 * configured.
28169 	 */
28170 	#define HWRM_PORT_PHY_I2C_WRITE_INPUT_ENABLES_BANK_NUMBER	UINT32_C(0x2)
28171 	/* Port ID of port. */
28172 	uint16_t	port_id;
28173 	/* 8-bit I2C slave address. */
28174 	uint8_t	i2c_slave_addr;
28175 	/* The bank number of the page that is being accessed over I2C. */
28176 	uint8_t	bank_number;
28177 	/* The page number that is being accessed over I2C. */
28178 	uint16_t	page_number;
28179 	/* Offset within the page that is being accessed over I2C. */
28180 	uint16_t	page_offset;
28181 	/*
28182 	 * Length of data to write, in bytes starting at the offset
28183 	 * specified above. If the offset is not specified, then
28184 	 * the data shall be written from the beginning of the page.
28185 	 */
28186 	uint8_t	data_length;
28187 	uint8_t	unused_1[7];
28188 	/* Up to 64B of data. */
28189 	uint32_t	data[16];
28190 } hwrm_port_phy_i2c_write_input_t, *phwrm_port_phy_i2c_write_input_t;
28191 
28192 /* hwrm_port_phy_i2c_write_output (size:128b/16B) */
28193 
28194 typedef struct hwrm_port_phy_i2c_write_output {
28195 	/* The specific error status for the command. */
28196 	uint16_t	error_code;
28197 	/* The HWRM command request type. */
28198 	uint16_t	req_type;
28199 	/* The sequence ID from the original command. */
28200 	uint16_t	seq_id;
28201 	/* The length of the response data in number of bytes. */
28202 	uint16_t	resp_len;
28203 	uint8_t	unused_0[7];
28204 	/*
28205 	 * This field is used in Output records to indicate that the output
28206 	 * is completely written to RAM.  This field should be read as '1'
28207 	 * to indicate that the output has been completely written.
28208 	 * When writing a command completion or response to an internal processor,
28209 	 * the order of writes has to be such that this field is written last.
28210 	 */
28211 	uint8_t	valid;
28212 } hwrm_port_phy_i2c_write_output_t, *phwrm_port_phy_i2c_write_output_t;
28213 
28214 /**************************
28215  * hwrm_port_phy_i2c_read *
28216  **************************/
28217 
28218 
28219 /* hwrm_port_phy_i2c_read_input (size:320b/40B) */
28220 
28221 typedef struct hwrm_port_phy_i2c_read_input {
28222 	/* The HWRM command request type. */
28223 	uint16_t	req_type;
28224 	/*
28225 	 * The completion ring to send the completion event on. This should
28226 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28227 	 */
28228 	uint16_t	cmpl_ring;
28229 	/*
28230 	 * The sequence ID is used by the driver for tracking multiple
28231 	 * commands. This ID is treated as opaque data by the firmware and
28232 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28233 	 */
28234 	uint16_t	seq_id;
28235 	/*
28236 	 * The target ID of the command:
28237 	 * * 0x0-0xFFF8 - The function ID
28238 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28239 	 * * 0xFFFD - Reserved for user-space HWRM interface
28240 	 * * 0xFFFF - HWRM
28241 	 */
28242 	uint16_t	target_id;
28243 	/*
28244 	 * A physical address pointer pointing to a host buffer that the
28245 	 * command's response data will be written. This can be either a host
28246 	 * physical address (HPA) or a guest physical address (GPA) and must
28247 	 * point to a physically contiguous block of memory.
28248 	 */
28249 	uint64_t	resp_addr;
28250 	uint32_t	flags;
28251 	uint32_t	enables;
28252 	/*
28253 	 * This bit must be '1' for the page_offset field to be
28254 	 * configured.
28255 	 */
28256 	#define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_PAGE_OFFSET	UINT32_C(0x1)
28257 	/*
28258 	 * This bit must be '1' for the bank_number field to be
28259 	 * configured.
28260 	 */
28261 	#define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_BANK_NUMBER	UINT32_C(0x2)
28262 	/* Port ID of port. */
28263 	uint16_t	port_id;
28264 	/* 8-bit I2C slave address. */
28265 	uint8_t	i2c_slave_addr;
28266 	/* The bank number of the page that is being accessed over I2C. */
28267 	uint8_t	bank_number;
28268 	/* The page number that is being accessed over I2C. */
28269 	uint16_t	page_number;
28270 	/* Offset within the page that is being accessed over I2C. */
28271 	uint16_t	page_offset;
28272 	/*
28273 	 * Length of data to read, in bytes starting at the offset
28274 	 * specified above. If the offset is not specified, then
28275 	 * the data shall be read from the beginning of the page.
28276 	 */
28277 	uint8_t	data_length;
28278 	uint8_t	unused_1[7];
28279 } hwrm_port_phy_i2c_read_input_t, *phwrm_port_phy_i2c_read_input_t;
28280 
28281 /* hwrm_port_phy_i2c_read_output (size:640b/80B) */
28282 
28283 typedef struct hwrm_port_phy_i2c_read_output {
28284 	/* The specific error status for the command. */
28285 	uint16_t	error_code;
28286 	/* The HWRM command request type. */
28287 	uint16_t	req_type;
28288 	/* The sequence ID from the original command. */
28289 	uint16_t	seq_id;
28290 	/* The length of the response data in number of bytes. */
28291 	uint16_t	resp_len;
28292 	/* Up to 64B of data. */
28293 	uint32_t	data[16];
28294 	uint8_t	unused_0[7];
28295 	/*
28296 	 * This field is used in Output records to indicate that the output
28297 	 * is completely written to RAM.  This field should be read as '1'
28298 	 * to indicate that the output has been completely written.
28299 	 * When writing a command completion or response to an internal processor,
28300 	 * the order of writes has to be such that this field is written last.
28301 	 */
28302 	uint8_t	valid;
28303 } hwrm_port_phy_i2c_read_output_t, *phwrm_port_phy_i2c_read_output_t;
28304 
28305 /****************************
28306  * hwrm_port_phy_mdio_write *
28307  ****************************/
28308 
28309 
28310 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
28311 
28312 typedef struct hwrm_port_phy_mdio_write_input {
28313 	/* The HWRM command request type. */
28314 	uint16_t	req_type;
28315 	/*
28316 	 * The completion ring to send the completion event on. This should
28317 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28318 	 */
28319 	uint16_t	cmpl_ring;
28320 	/*
28321 	 * The sequence ID is used by the driver for tracking multiple
28322 	 * commands. This ID is treated as opaque data by the firmware and
28323 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28324 	 */
28325 	uint16_t	seq_id;
28326 	/*
28327 	 * The target ID of the command:
28328 	 * * 0x0-0xFFF8 - The function ID
28329 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28330 	 * * 0xFFFD - Reserved for user-space HWRM interface
28331 	 * * 0xFFFF - HWRM
28332 	 */
28333 	uint16_t	target_id;
28334 	/*
28335 	 * A physical address pointer pointing to a host buffer that the
28336 	 * command's response data will be written. This can be either a host
28337 	 * physical address (HPA) or a guest physical address (GPA) and must
28338 	 * point to a physically contiguous block of memory.
28339 	 */
28340 	uint64_t	resp_addr;
28341 	/* Reserved for future use. */
28342 	uint64_t	unused_0;
28343 	/* Port ID of port. */
28344 	uint16_t	port_id;
28345 	/* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
28346 	uint8_t	phy_addr;
28347 	/* 8-bit device address. */
28348 	uint8_t	dev_addr;
28349 	/* 16-bit register address. */
28350 	uint16_t	reg_addr;
28351 	/* 16-bit register data. */
28352 	uint16_t	reg_data;
28353 	/*
28354 	 * When this bit is set to 1 a Clause 45 mdio access is done.
28355 	 * when this bit is set to 0 a Clause 22 mdio access is done.
28356 	 */
28357 	uint8_t	cl45_mdio;
28358 	/*  */
28359 	uint8_t	unused_1[7];
28360 } hwrm_port_phy_mdio_write_input_t, *phwrm_port_phy_mdio_write_input_t;
28361 
28362 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
28363 
28364 typedef struct hwrm_port_phy_mdio_write_output {
28365 	/* The specific error status for the command. */
28366 	uint16_t	error_code;
28367 	/* The HWRM command request type. */
28368 	uint16_t	req_type;
28369 	/* The sequence ID from the original command. */
28370 	uint16_t	seq_id;
28371 	/* The length of the response data in number of bytes. */
28372 	uint16_t	resp_len;
28373 	uint8_t	unused_0[7];
28374 	/*
28375 	 * This field is used in Output records to indicate that the output
28376 	 * is completely written to RAM.  This field should be read as '1'
28377 	 * to indicate that the output has been completely written.
28378 	 * When writing a command completion or response to an internal processor,
28379 	 * the order of writes has to be such that this field is written last.
28380 	 */
28381 	uint8_t	valid;
28382 } hwrm_port_phy_mdio_write_output_t, *phwrm_port_phy_mdio_write_output_t;
28383 
28384 /***************************
28385  * hwrm_port_phy_mdio_read *
28386  ***************************/
28387 
28388 
28389 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
28390 
28391 typedef struct hwrm_port_phy_mdio_read_input {
28392 	/* The HWRM command request type. */
28393 	uint16_t	req_type;
28394 	/*
28395 	 * The completion ring to send the completion event on. This should
28396 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28397 	 */
28398 	uint16_t	cmpl_ring;
28399 	/*
28400 	 * The sequence ID is used by the driver for tracking multiple
28401 	 * commands. This ID is treated as opaque data by the firmware and
28402 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28403 	 */
28404 	uint16_t	seq_id;
28405 	/*
28406 	 * The target ID of the command:
28407 	 * * 0x0-0xFFF8 - The function ID
28408 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28409 	 * * 0xFFFD - Reserved for user-space HWRM interface
28410 	 * * 0xFFFF - HWRM
28411 	 */
28412 	uint16_t	target_id;
28413 	/*
28414 	 * A physical address pointer pointing to a host buffer that the
28415 	 * command's response data will be written. This can be either a host
28416 	 * physical address (HPA) or a guest physical address (GPA) and must
28417 	 * point to a physically contiguous block of memory.
28418 	 */
28419 	uint64_t	resp_addr;
28420 	/* Reserved for future use. */
28421 	uint64_t	unused_0;
28422 	/* Port ID of port. */
28423 	uint16_t	port_id;
28424 	/* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
28425 	uint8_t	phy_addr;
28426 	/* 8-bit device address. */
28427 	uint8_t	dev_addr;
28428 	/* 16-bit register address. */
28429 	uint16_t	reg_addr;
28430 	/*
28431 	 * When this bit is set to 1 a Clause 45 mdio access is done.
28432 	 * when this bit is set to 0 a Clause 22 mdio access is done.
28433 	 */
28434 	uint8_t	cl45_mdio;
28435 	/*  */
28436 	uint8_t	unused_1;
28437 } hwrm_port_phy_mdio_read_input_t, *phwrm_port_phy_mdio_read_input_t;
28438 
28439 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
28440 
28441 typedef struct hwrm_port_phy_mdio_read_output {
28442 	/* The specific error status for the command. */
28443 	uint16_t	error_code;
28444 	/* The HWRM command request type. */
28445 	uint16_t	req_type;
28446 	/* The sequence ID from the original command. */
28447 	uint16_t	seq_id;
28448 	/* The length of the response data in number of bytes. */
28449 	uint16_t	resp_len;
28450 	/* 16-bit register data. */
28451 	uint16_t	reg_data;
28452 	uint8_t	unused_0[5];
28453 	/*
28454 	 * This field is used in Output records to indicate that the output
28455 	 * is completely written to RAM.  This field should be read as '1'
28456 	 * to indicate that the output has been completely written.
28457 	 * When writing a command completion or response to an internal processor,
28458 	 * the order of writes has to be such that this field is written last.
28459 	 */
28460 	uint8_t	valid;
28461 } hwrm_port_phy_mdio_read_output_t, *phwrm_port_phy_mdio_read_output_t;
28462 
28463 /*********************
28464  * hwrm_port_led_cfg *
28465  *********************/
28466 
28467 
28468 /* hwrm_port_led_cfg_input (size:512b/64B) */
28469 
28470 typedef struct hwrm_port_led_cfg_input {
28471 	/* The HWRM command request type. */
28472 	uint16_t	req_type;
28473 	/*
28474 	 * The completion ring to send the completion event on. This should
28475 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28476 	 */
28477 	uint16_t	cmpl_ring;
28478 	/*
28479 	 * The sequence ID is used by the driver for tracking multiple
28480 	 * commands. This ID is treated as opaque data by the firmware and
28481 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28482 	 */
28483 	uint16_t	seq_id;
28484 	/*
28485 	 * The target ID of the command:
28486 	 * * 0x0-0xFFF8 - The function ID
28487 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28488 	 * * 0xFFFD - Reserved for user-space HWRM interface
28489 	 * * 0xFFFF - HWRM
28490 	 */
28491 	uint16_t	target_id;
28492 	/*
28493 	 * A physical address pointer pointing to a host buffer that the
28494 	 * command's response data will be written. This can be either a host
28495 	 * physical address (HPA) or a guest physical address (GPA) and must
28496 	 * point to a physically contiguous block of memory.
28497 	 */
28498 	uint64_t	resp_addr;
28499 	uint32_t	enables;
28500 	/*
28501 	 * This bit must be '1' for the led0_id field to be
28502 	 * configured.
28503 	 */
28504 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID		UINT32_C(0x1)
28505 	/*
28506 	 * This bit must be '1' for the led0_state field to be
28507 	 * configured.
28508 	 */
28509 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE	UINT32_C(0x2)
28510 	/*
28511 	 * This bit must be '1' for the led0_color field to be
28512 	 * configured.
28513 	 */
28514 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR	UINT32_C(0x4)
28515 	/*
28516 	 * This bit must be '1' for the led0_blink_on field to be
28517 	 * configured.
28518 	 */
28519 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON	UINT32_C(0x8)
28520 	/*
28521 	 * This bit must be '1' for the led0_blink_off field to be
28522 	 * configured.
28523 	 */
28524 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF	UINT32_C(0x10)
28525 	/*
28526 	 * This bit must be '1' for the led0_group_id field to be
28527 	 * configured.
28528 	 */
28529 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID	UINT32_C(0x20)
28530 	/*
28531 	 * This bit must be '1' for the led1_id field to be
28532 	 * configured.
28533 	 */
28534 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID		UINT32_C(0x40)
28535 	/*
28536 	 * This bit must be '1' for the led1_state field to be
28537 	 * configured.
28538 	 */
28539 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE	UINT32_C(0x80)
28540 	/*
28541 	 * This bit must be '1' for the led1_color field to be
28542 	 * configured.
28543 	 */
28544 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR	UINT32_C(0x100)
28545 	/*
28546 	 * This bit must be '1' for the led1_blink_on field to be
28547 	 * configured.
28548 	 */
28549 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON	UINT32_C(0x200)
28550 	/*
28551 	 * This bit must be '1' for the led1_blink_off field to be
28552 	 * configured.
28553 	 */
28554 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF	UINT32_C(0x400)
28555 	/*
28556 	 * This bit must be '1' for the led1_group_id field to be
28557 	 * configured.
28558 	 */
28559 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID	UINT32_C(0x800)
28560 	/*
28561 	 * This bit must be '1' for the led2_id field to be
28562 	 * configured.
28563 	 */
28564 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID		UINT32_C(0x1000)
28565 	/*
28566 	 * This bit must be '1' for the led2_state field to be
28567 	 * configured.
28568 	 */
28569 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE	UINT32_C(0x2000)
28570 	/*
28571 	 * This bit must be '1' for the led2_color field to be
28572 	 * configured.
28573 	 */
28574 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR	UINT32_C(0x4000)
28575 	/*
28576 	 * This bit must be '1' for the led2_blink_on field to be
28577 	 * configured.
28578 	 */
28579 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON	UINT32_C(0x8000)
28580 	/*
28581 	 * This bit must be '1' for the led2_blink_off field to be
28582 	 * configured.
28583 	 */
28584 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF	UINT32_C(0x10000)
28585 	/*
28586 	 * This bit must be '1' for the led2_group_id field to be
28587 	 * configured.
28588 	 */
28589 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID	UINT32_C(0x20000)
28590 	/*
28591 	 * This bit must be '1' for the led3_id field to be
28592 	 * configured.
28593 	 */
28594 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID		UINT32_C(0x40000)
28595 	/*
28596 	 * This bit must be '1' for the led3_state field to be
28597 	 * configured.
28598 	 */
28599 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE	UINT32_C(0x80000)
28600 	/*
28601 	 * This bit must be '1' for the led3_color field to be
28602 	 * configured.
28603 	 */
28604 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR	UINT32_C(0x100000)
28605 	/*
28606 	 * This bit must be '1' for the led3_blink_on field to be
28607 	 * configured.
28608 	 */
28609 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON	UINT32_C(0x200000)
28610 	/*
28611 	 * This bit must be '1' for the led3_blink_off field to be
28612 	 * configured.
28613 	 */
28614 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF	UINT32_C(0x400000)
28615 	/*
28616 	 * This bit must be '1' for the led3_group_id field to be
28617 	 * configured.
28618 	 */
28619 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID	UINT32_C(0x800000)
28620 	/* Port ID of port whose LEDs are configured. */
28621 	uint16_t	port_id;
28622 	/*
28623 	 * The number of LEDs that are being configured.
28624 	 * Up to 4 LEDs can be configured with this command.
28625 	 */
28626 	uint8_t	num_leds;
28627 	/* Reserved field. */
28628 	uint8_t	rsvd;
28629 	/* An identifier for the LED #0. */
28630 	uint8_t	led0_id;
28631 	/* The requested state of the LED #0. */
28632 	uint8_t	led0_state;
28633 	/* Default state of the LED */
28634 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
28635 	/* Off */
28636 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF	UINT32_C(0x1)
28637 	/* On */
28638 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON	UINT32_C(0x2)
28639 	/* Blink */
28640 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK	UINT32_C(0x3)
28641 	/* Blink Alternately */
28642 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
28643 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
28644 	/* The requested color of LED #0. */
28645 	uint8_t	led0_color;
28646 	/* Default */
28647 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
28648 	/* Amber */
28649 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
28650 	/* Green */
28651 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
28652 	/* Green or Amber */
28653 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
28654 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
28655 	uint8_t	unused_0;
28656 	/*
28657 	 * If the LED #0 state is "blink" or "blinkalt", then
28658 	 * this field represents the requested time in milliseconds
28659 	 * to keep LED on between cycles.
28660 	 */
28661 	uint16_t	led0_blink_on;
28662 	/*
28663 	 * If the LED #0 state is "blink" or "blinkalt", then
28664 	 * this field represents the requested time in milliseconds
28665 	 * to keep LED off between cycles.
28666 	 */
28667 	uint16_t	led0_blink_off;
28668 	/*
28669 	 * An identifier for the group of LEDs that LED #0 belongs
28670 	 * to.
28671 	 * If set to 0, then the LED #0 shall not be grouped and
28672 	 * shall be treated as an individual resource.
28673 	 * For all other non-zero values of this field, LED #0 shall
28674 	 * be grouped together with the LEDs with the same group ID
28675 	 * value.
28676 	 */
28677 	uint8_t	led0_group_id;
28678 	/* Reserved field. */
28679 	uint8_t	rsvd0;
28680 	/* An identifier for the LED #1. */
28681 	uint8_t	led1_id;
28682 	/* The requested state of the LED #1. */
28683 	uint8_t	led1_state;
28684 	/* Default state of the LED */
28685 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
28686 	/* Off */
28687 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF	UINT32_C(0x1)
28688 	/* On */
28689 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON	UINT32_C(0x2)
28690 	/* Blink */
28691 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK	UINT32_C(0x3)
28692 	/* Blink Alternately */
28693 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
28694 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
28695 	/* The requested color of LED #1. */
28696 	uint8_t	led1_color;
28697 	/* Default */
28698 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
28699 	/* Amber */
28700 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
28701 	/* Green */
28702 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
28703 	/* Green or Amber */
28704 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
28705 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
28706 	uint8_t	unused_1;
28707 	/*
28708 	 * If the LED #1 state is "blink" or "blinkalt", then
28709 	 * this field represents the requested time in milliseconds
28710 	 * to keep LED on between cycles.
28711 	 */
28712 	uint16_t	led1_blink_on;
28713 	/*
28714 	 * If the LED #1 state is "blink" or "blinkalt", then
28715 	 * this field represents the requested time in milliseconds
28716 	 * to keep LED off between cycles.
28717 	 */
28718 	uint16_t	led1_blink_off;
28719 	/*
28720 	 * An identifier for the group of LEDs that LED #1 belongs
28721 	 * to.
28722 	 * If set to 0, then the LED #1 shall not be grouped and
28723 	 * shall be treated as an individual resource.
28724 	 * For all other non-zero values of this field, LED #1 shall
28725 	 * be grouped together with the LEDs with the same group ID
28726 	 * value.
28727 	 */
28728 	uint8_t	led1_group_id;
28729 	/* Reserved field. */
28730 	uint8_t	rsvd1;
28731 	/* An identifier for the LED #2. */
28732 	uint8_t	led2_id;
28733 	/* The requested state of the LED #2. */
28734 	uint8_t	led2_state;
28735 	/* Default state of the LED */
28736 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
28737 	/* Off */
28738 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF	UINT32_C(0x1)
28739 	/* On */
28740 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON	UINT32_C(0x2)
28741 	/* Blink */
28742 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK	UINT32_C(0x3)
28743 	/* Blink Alternately */
28744 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
28745 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
28746 	/* The requested color of LED #2. */
28747 	uint8_t	led2_color;
28748 	/* Default */
28749 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
28750 	/* Amber */
28751 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
28752 	/* Green */
28753 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
28754 	/* Green or Amber */
28755 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
28756 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
28757 	uint8_t	unused_2;
28758 	/*
28759 	 * If the LED #2 state is "blink" or "blinkalt", then
28760 	 * this field represents the requested time in milliseconds
28761 	 * to keep LED on between cycles.
28762 	 */
28763 	uint16_t	led2_blink_on;
28764 	/*
28765 	 * If the LED #2 state is "blink" or "blinkalt", then
28766 	 * this field represents the requested time in milliseconds
28767 	 * to keep LED off between cycles.
28768 	 */
28769 	uint16_t	led2_blink_off;
28770 	/*
28771 	 * An identifier for the group of LEDs that LED #2 belongs
28772 	 * to.
28773 	 * If set to 0, then the LED #2 shall not be grouped and
28774 	 * shall be treated as an individual resource.
28775 	 * For all other non-zero values of this field, LED #2 shall
28776 	 * be grouped together with the LEDs with the same group ID
28777 	 * value.
28778 	 */
28779 	uint8_t	led2_group_id;
28780 	/* Reserved field. */
28781 	uint8_t	rsvd2;
28782 	/* An identifier for the LED #3. */
28783 	uint8_t	led3_id;
28784 	/* The requested state of the LED #3. */
28785 	uint8_t	led3_state;
28786 	/* Default state of the LED */
28787 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
28788 	/* Off */
28789 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF	UINT32_C(0x1)
28790 	/* On */
28791 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON	UINT32_C(0x2)
28792 	/* Blink */
28793 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK	UINT32_C(0x3)
28794 	/* Blink Alternately */
28795 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
28796 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
28797 	/* The requested color of LED #3. */
28798 	uint8_t	led3_color;
28799 	/* Default */
28800 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
28801 	/* Amber */
28802 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
28803 	/* Green */
28804 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
28805 	/* Green or Amber */
28806 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
28807 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
28808 	uint8_t	unused_3;
28809 	/*
28810 	 * If the LED #3 state is "blink" or "blinkalt", then
28811 	 * this field represents the requested time in milliseconds
28812 	 * to keep LED on between cycles.
28813 	 */
28814 	uint16_t	led3_blink_on;
28815 	/*
28816 	 * If the LED #3 state is "blink" or "blinkalt", then
28817 	 * this field represents the requested time in milliseconds
28818 	 * to keep LED off between cycles.
28819 	 */
28820 	uint16_t	led3_blink_off;
28821 	/*
28822 	 * An identifier for the group of LEDs that LED #3 belongs
28823 	 * to.
28824 	 * If set to 0, then the LED #3 shall not be grouped and
28825 	 * shall be treated as an individual resource.
28826 	 * For all other non-zero values of this field, LED #3 shall
28827 	 * be grouped together with the LEDs with the same group ID
28828 	 * value.
28829 	 */
28830 	uint8_t	led3_group_id;
28831 	/* Reserved field. */
28832 	uint8_t	rsvd3;
28833 } hwrm_port_led_cfg_input_t, *phwrm_port_led_cfg_input_t;
28834 
28835 /* hwrm_port_led_cfg_output (size:128b/16B) */
28836 
28837 typedef struct hwrm_port_led_cfg_output {
28838 	/* The specific error status for the command. */
28839 	uint16_t	error_code;
28840 	/* The HWRM command request type. */
28841 	uint16_t	req_type;
28842 	/* The sequence ID from the original command. */
28843 	uint16_t	seq_id;
28844 	/* The length of the response data in number of bytes. */
28845 	uint16_t	resp_len;
28846 	uint8_t	unused_0[7];
28847 	/*
28848 	 * This field is used in Output records to indicate that the output
28849 	 * is completely written to RAM.  This field should be read as '1'
28850 	 * to indicate that the output has been completely written.
28851 	 * When writing a command completion or response to an internal processor,
28852 	 * the order of writes has to be such that this field is written last.
28853 	 */
28854 	uint8_t	valid;
28855 } hwrm_port_led_cfg_output_t, *phwrm_port_led_cfg_output_t;
28856 
28857 /**********************
28858  * hwrm_port_led_qcfg *
28859  **********************/
28860 
28861 
28862 /* hwrm_port_led_qcfg_input (size:192b/24B) */
28863 
28864 typedef struct hwrm_port_led_qcfg_input {
28865 	/* The HWRM command request type. */
28866 	uint16_t	req_type;
28867 	/*
28868 	 * The completion ring to send the completion event on. This should
28869 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28870 	 */
28871 	uint16_t	cmpl_ring;
28872 	/*
28873 	 * The sequence ID is used by the driver for tracking multiple
28874 	 * commands. This ID is treated as opaque data by the firmware and
28875 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28876 	 */
28877 	uint16_t	seq_id;
28878 	/*
28879 	 * The target ID of the command:
28880 	 * * 0x0-0xFFF8 - The function ID
28881 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28882 	 * * 0xFFFD - Reserved for user-space HWRM interface
28883 	 * * 0xFFFF - HWRM
28884 	 */
28885 	uint16_t	target_id;
28886 	/*
28887 	 * A physical address pointer pointing to a host buffer that the
28888 	 * command's response data will be written. This can be either a host
28889 	 * physical address (HPA) or a guest physical address (GPA) and must
28890 	 * point to a physically contiguous block of memory.
28891 	 */
28892 	uint64_t	resp_addr;
28893 	/* Port ID of port whose LED configuration is being queried. */
28894 	uint16_t	port_id;
28895 	uint8_t	unused_0[6];
28896 } hwrm_port_led_qcfg_input_t, *phwrm_port_led_qcfg_input_t;
28897 
28898 /* hwrm_port_led_qcfg_output (size:448b/56B) */
28899 
28900 typedef struct hwrm_port_led_qcfg_output {
28901 	/* The specific error status for the command. */
28902 	uint16_t	error_code;
28903 	/* The HWRM command request type. */
28904 	uint16_t	req_type;
28905 	/* The sequence ID from the original command. */
28906 	uint16_t	seq_id;
28907 	/* The length of the response data in number of bytes. */
28908 	uint16_t	resp_len;
28909 	/*
28910 	 * The number of LEDs that are configured on this port.
28911 	 * Up to 4 LEDs can be returned in the response.
28912 	 */
28913 	uint8_t	num_leds;
28914 	/* An identifier for the LED #0. */
28915 	uint8_t	led0_id;
28916 	/* The type of LED #0. */
28917 	uint8_t	led0_type;
28918 	/* Speed LED */
28919 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
28920 	/* Activity LED */
28921 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
28922 	/* Invalid */
28923 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
28924 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
28925 	/* The current state of the LED #0. */
28926 	uint8_t	led0_state;
28927 	/* Default state of the LED */
28928 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
28929 	/* Off */
28930 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF	UINT32_C(0x1)
28931 	/* On */
28932 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON	UINT32_C(0x2)
28933 	/* Blink */
28934 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK	UINT32_C(0x3)
28935 	/* Blink Alternately */
28936 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
28937 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
28938 	/* The color of LED #0. */
28939 	uint8_t	led0_color;
28940 	/* Default */
28941 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
28942 	/* Amber */
28943 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
28944 	/* Green */
28945 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
28946 	/* Green or Amber */
28947 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
28948 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
28949 	uint8_t	unused_0;
28950 	/*
28951 	 * If the LED #0 state is "blink" or "blinkalt", then
28952 	 * this field represents the requested time in milliseconds
28953 	 * to keep LED on between cycles.
28954 	 */
28955 	uint16_t	led0_blink_on;
28956 	/*
28957 	 * If the LED #0 state is "blink" or "blinkalt", then
28958 	 * this field represents the requested time in milliseconds
28959 	 * to keep LED off between cycles.
28960 	 */
28961 	uint16_t	led0_blink_off;
28962 	/*
28963 	 * An identifier for the group of LEDs that LED #0 belongs
28964 	 * to.
28965 	 * If set to 0, then the LED #0 is not grouped.
28966 	 * For all other non-zero values of this field, LED #0 is
28967 	 * grouped together with the LEDs with the same group ID
28968 	 * value.
28969 	 */
28970 	uint8_t	led0_group_id;
28971 	/* An identifier for the LED #1. */
28972 	uint8_t	led1_id;
28973 	/* The type of LED #1. */
28974 	uint8_t	led1_type;
28975 	/* Speed LED */
28976 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
28977 	/* Activity LED */
28978 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
28979 	/* Invalid */
28980 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
28981 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
28982 	/* The current state of the LED #1. */
28983 	uint8_t	led1_state;
28984 	/* Default state of the LED */
28985 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
28986 	/* Off */
28987 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF	UINT32_C(0x1)
28988 	/* On */
28989 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON	UINT32_C(0x2)
28990 	/* Blink */
28991 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK	UINT32_C(0x3)
28992 	/* Blink Alternately */
28993 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
28994 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
28995 	/* The color of LED #1. */
28996 	uint8_t	led1_color;
28997 	/* Default */
28998 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
28999 	/* Amber */
29000 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
29001 	/* Green */
29002 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
29003 	/* Green or Amber */
29004 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
29005 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
29006 	uint8_t	unused_1;
29007 	/*
29008 	 * If the LED #1 state is "blink" or "blinkalt", then
29009 	 * this field represents the requested time in milliseconds
29010 	 * to keep LED on between cycles.
29011 	 */
29012 	uint16_t	led1_blink_on;
29013 	/*
29014 	 * If the LED #1 state is "blink" or "blinkalt", then
29015 	 * this field represents the requested time in milliseconds
29016 	 * to keep LED off between cycles.
29017 	 */
29018 	uint16_t	led1_blink_off;
29019 	/*
29020 	 * An identifier for the group of LEDs that LED #1 belongs
29021 	 * to.
29022 	 * If set to 0, then the LED #1 is not grouped.
29023 	 * For all other non-zero values of this field, LED #1 is
29024 	 * grouped together with the LEDs with the same group ID
29025 	 * value.
29026 	 */
29027 	uint8_t	led1_group_id;
29028 	/* An identifier for the LED #2. */
29029 	uint8_t	led2_id;
29030 	/* The type of LED #2. */
29031 	uint8_t	led2_type;
29032 	/* Speed LED */
29033 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
29034 	/* Activity LED */
29035 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
29036 	/* Invalid */
29037 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
29038 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
29039 	/* The current state of the LED #2. */
29040 	uint8_t	led2_state;
29041 	/* Default state of the LED */
29042 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
29043 	/* Off */
29044 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF	UINT32_C(0x1)
29045 	/* On */
29046 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON	UINT32_C(0x2)
29047 	/* Blink */
29048 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK	UINT32_C(0x3)
29049 	/* Blink Alternately */
29050 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
29051 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
29052 	/* The color of LED #2. */
29053 	uint8_t	led2_color;
29054 	/* Default */
29055 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
29056 	/* Amber */
29057 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
29058 	/* Green */
29059 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
29060 	/* Green or Amber */
29061 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
29062 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
29063 	uint8_t	unused_2;
29064 	/*
29065 	 * If the LED #2 state is "blink" or "blinkalt", then
29066 	 * this field represents the requested time in milliseconds
29067 	 * to keep LED on between cycles.
29068 	 */
29069 	uint16_t	led2_blink_on;
29070 	/*
29071 	 * If the LED #2 state is "blink" or "blinkalt", then
29072 	 * this field represents the requested time in milliseconds
29073 	 * to keep LED off between cycles.
29074 	 */
29075 	uint16_t	led2_blink_off;
29076 	/*
29077 	 * An identifier for the group of LEDs that LED #2 belongs
29078 	 * to.
29079 	 * If set to 0, then the LED #2 is not grouped.
29080 	 * For all other non-zero values of this field, LED #2 is
29081 	 * grouped together with the LEDs with the same group ID
29082 	 * value.
29083 	 */
29084 	uint8_t	led2_group_id;
29085 	/* An identifier for the LED #3. */
29086 	uint8_t	led3_id;
29087 	/* The type of LED #3. */
29088 	uint8_t	led3_type;
29089 	/* Speed LED */
29090 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
29091 	/* Activity LED */
29092 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
29093 	/* Invalid */
29094 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
29095 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
29096 	/* The current state of the LED #3. */
29097 	uint8_t	led3_state;
29098 	/* Default state of the LED */
29099 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
29100 	/* Off */
29101 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF	UINT32_C(0x1)
29102 	/* On */
29103 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON	UINT32_C(0x2)
29104 	/* Blink */
29105 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK	UINT32_C(0x3)
29106 	/* Blink Alternately */
29107 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
29108 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
29109 	/* The color of LED #3. */
29110 	uint8_t	led3_color;
29111 	/* Default */
29112 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
29113 	/* Amber */
29114 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
29115 	/* Green */
29116 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
29117 	/* Green or Amber */
29118 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
29119 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
29120 	uint8_t	unused_3;
29121 	/*
29122 	 * If the LED #3 state is "blink" or "blinkalt", then
29123 	 * this field represents the requested time in milliseconds
29124 	 * to keep LED on between cycles.
29125 	 */
29126 	uint16_t	led3_blink_on;
29127 	/*
29128 	 * If the LED #3 state is "blink" or "blinkalt", then
29129 	 * this field represents the requested time in milliseconds
29130 	 * to keep LED off between cycles.
29131 	 */
29132 	uint16_t	led3_blink_off;
29133 	/*
29134 	 * An identifier for the group of LEDs that LED #3 belongs
29135 	 * to.
29136 	 * If set to 0, then the LED #3 is not grouped.
29137 	 * For all other non-zero values of this field, LED #3 is
29138 	 * grouped together with the LEDs with the same group ID
29139 	 * value.
29140 	 */
29141 	uint8_t	led3_group_id;
29142 	uint8_t	unused_4[6];
29143 	/*
29144 	 * This field is used in Output records to indicate that the output
29145 	 * is completely written to RAM.  This field should be read as '1'
29146 	 * to indicate that the output has been completely written.
29147 	 * When writing a command completion or response to an internal processor,
29148 	 * the order of writes has to be such that this field is written last.
29149 	 */
29150 	uint8_t	valid;
29151 } hwrm_port_led_qcfg_output_t, *phwrm_port_led_qcfg_output_t;
29152 
29153 /***********************
29154  * hwrm_port_led_qcaps *
29155  ***********************/
29156 
29157 
29158 /* hwrm_port_led_qcaps_input (size:192b/24B) */
29159 
29160 typedef struct hwrm_port_led_qcaps_input {
29161 	/* The HWRM command request type. */
29162 	uint16_t	req_type;
29163 	/*
29164 	 * The completion ring to send the completion event on. This should
29165 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29166 	 */
29167 	uint16_t	cmpl_ring;
29168 	/*
29169 	 * The sequence ID is used by the driver for tracking multiple
29170 	 * commands. This ID is treated as opaque data by the firmware and
29171 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29172 	 */
29173 	uint16_t	seq_id;
29174 	/*
29175 	 * The target ID of the command:
29176 	 * * 0x0-0xFFF8 - The function ID
29177 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29178 	 * * 0xFFFD - Reserved for user-space HWRM interface
29179 	 * * 0xFFFF - HWRM
29180 	 */
29181 	uint16_t	target_id;
29182 	/*
29183 	 * A physical address pointer pointing to a host buffer that the
29184 	 * command's response data will be written. This can be either a host
29185 	 * physical address (HPA) or a guest physical address (GPA) and must
29186 	 * point to a physically contiguous block of memory.
29187 	 */
29188 	uint64_t	resp_addr;
29189 	/* Port ID of port whose LED configuration is being queried. */
29190 	uint16_t	port_id;
29191 	uint8_t	unused_0[6];
29192 } hwrm_port_led_qcaps_input_t, *phwrm_port_led_qcaps_input_t;
29193 
29194 /* hwrm_port_led_qcaps_output (size:384b/48B) */
29195 
29196 typedef struct hwrm_port_led_qcaps_output {
29197 	/* The specific error status for the command. */
29198 	uint16_t	error_code;
29199 	/* The HWRM command request type. */
29200 	uint16_t	req_type;
29201 	/* The sequence ID from the original command. */
29202 	uint16_t	seq_id;
29203 	/* The length of the response data in number of bytes. */
29204 	uint16_t	resp_len;
29205 	/*
29206 	 * The number of LEDs that are configured on this port.
29207 	 * Up to 4 LEDs can be returned in the response.
29208 	 */
29209 	uint8_t	num_leds;
29210 	/* Reserved for future use. */
29211 	uint8_t	unused[3];
29212 	/* An identifier for the LED #0. */
29213 	uint8_t	led0_id;
29214 	/* The type of LED #0. */
29215 	uint8_t	led0_type;
29216 	/* Speed LED */
29217 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
29218 	/* Activity LED */
29219 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
29220 	/* Invalid */
29221 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
29222 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
29223 	/*
29224 	 * An identifier for the group of LEDs that LED #0 belongs
29225 	 * to.
29226 	 * If set to 0, then the LED #0 cannot be grouped.
29227 	 * For all other non-zero values of this field, LED #0 is
29228 	 * grouped together with the LEDs with the same group ID
29229 	 * value.
29230 	 */
29231 	uint8_t	led0_group_id;
29232 	uint8_t	unused_0;
29233 	/* The states supported by LED #0. */
29234 	uint16_t	led0_state_caps;
29235 	/*
29236 	 * If set to 1, this LED is enabled.
29237 	 * If set to 0, this LED is disabled.
29238 	 */
29239 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED		UINT32_C(0x1)
29240 	/*
29241 	 * If set to 1, off state is supported on this LED.
29242 	 * If set to 0, off state is not supported on this LED.
29243 	 */
29244 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
29245 	/*
29246 	 * If set to 1, on state is supported on this LED.
29247 	 * If set to 0, on state is not supported on this LED.
29248 	 */
29249 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
29250 	/*
29251 	 * If set to 1, blink state is supported on this LED.
29252 	 * If set to 0, blink state is not supported on this LED.
29253 	 */
29254 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
29255 	/*
29256 	 * If set to 1, blink_alt state is supported on this LED.
29257 	 * If set to 0, blink_alt state is not supported on this LED.
29258 	 */
29259 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
29260 	/* The colors supported by LED #0. */
29261 	uint16_t	led0_color_caps;
29262 	/* reserved. */
29263 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD		UINT32_C(0x1)
29264 	/*
29265 	 * If set to 1, Amber color is supported on this LED.
29266 	 * If set to 0, Amber color is not supported on this LED.
29267 	 */
29268 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
29269 	/*
29270 	 * If set to 1, Green color is supported on this LED.
29271 	 * If set to 0, Green color is not supported on this LED.
29272 	 */
29273 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
29274 	/* An identifier for the LED #1. */
29275 	uint8_t	led1_id;
29276 	/* The type of LED #1. */
29277 	uint8_t	led1_type;
29278 	/* Speed LED */
29279 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
29280 	/* Activity LED */
29281 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
29282 	/* Invalid */
29283 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
29284 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
29285 	/*
29286 	 * An identifier for the group of LEDs that LED #1 belongs
29287 	 * to.
29288 	 * If set to 0, then the LED #0 cannot be grouped.
29289 	 * For all other non-zero values of this field, LED #0 is
29290 	 * grouped together with the LEDs with the same group ID
29291 	 * value.
29292 	 */
29293 	uint8_t	led1_group_id;
29294 	uint8_t	unused_1;
29295 	/* The states supported by LED #1. */
29296 	uint16_t	led1_state_caps;
29297 	/*
29298 	 * If set to 1, this LED is enabled.
29299 	 * If set to 0, this LED is disabled.
29300 	 */
29301 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED		UINT32_C(0x1)
29302 	/*
29303 	 * If set to 1, off state is supported on this LED.
29304 	 * If set to 0, off state is not supported on this LED.
29305 	 */
29306 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
29307 	/*
29308 	 * If set to 1, on state is supported on this LED.
29309 	 * If set to 0, on state is not supported on this LED.
29310 	 */
29311 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
29312 	/*
29313 	 * If set to 1, blink state is supported on this LED.
29314 	 * If set to 0, blink state is not supported on this LED.
29315 	 */
29316 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
29317 	/*
29318 	 * If set to 1, blink_alt state is supported on this LED.
29319 	 * If set to 0, blink_alt state is not supported on this LED.
29320 	 */
29321 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
29322 	/* The colors supported by LED #1. */
29323 	uint16_t	led1_color_caps;
29324 	/* reserved. */
29325 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD		UINT32_C(0x1)
29326 	/*
29327 	 * If set to 1, Amber color is supported on this LED.
29328 	 * If set to 0, Amber color is not supported on this LED.
29329 	 */
29330 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
29331 	/*
29332 	 * If set to 1, Green color is supported on this LED.
29333 	 * If set to 0, Green color is not supported on this LED.
29334 	 */
29335 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
29336 	/* An identifier for the LED #2. */
29337 	uint8_t	led2_id;
29338 	/* The type of LED #2. */
29339 	uint8_t	led2_type;
29340 	/* Speed LED */
29341 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
29342 	/* Activity LED */
29343 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
29344 	/* Invalid */
29345 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
29346 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
29347 	/*
29348 	 * An identifier for the group of LEDs that LED #0 belongs
29349 	 * to.
29350 	 * If set to 0, then the LED #0 cannot be grouped.
29351 	 * For all other non-zero values of this field, LED #0 is
29352 	 * grouped together with the LEDs with the same group ID
29353 	 * value.
29354 	 */
29355 	uint8_t	led2_group_id;
29356 	uint8_t	unused_2;
29357 	/* The states supported by LED #2. */
29358 	uint16_t	led2_state_caps;
29359 	/*
29360 	 * If set to 1, this LED is enabled.
29361 	 * If set to 0, this LED is disabled.
29362 	 */
29363 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED		UINT32_C(0x1)
29364 	/*
29365 	 * If set to 1, off state is supported on this LED.
29366 	 * If set to 0, off state is not supported on this LED.
29367 	 */
29368 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
29369 	/*
29370 	 * If set to 1, on state is supported on this LED.
29371 	 * If set to 0, on state is not supported on this LED.
29372 	 */
29373 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
29374 	/*
29375 	 * If set to 1, blink state is supported on this LED.
29376 	 * If set to 0, blink state is not supported on this LED.
29377 	 */
29378 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
29379 	/*
29380 	 * If set to 1, blink_alt state is supported on this LED.
29381 	 * If set to 0, blink_alt state is not supported on this LED.
29382 	 */
29383 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
29384 	/* The colors supported by LED #2. */
29385 	uint16_t	led2_color_caps;
29386 	/* reserved. */
29387 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD		UINT32_C(0x1)
29388 	/*
29389 	 * If set to 1, Amber color is supported on this LED.
29390 	 * If set to 0, Amber color is not supported on this LED.
29391 	 */
29392 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
29393 	/*
29394 	 * If set to 1, Green color is supported on this LED.
29395 	 * If set to 0, Green color is not supported on this LED.
29396 	 */
29397 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
29398 	/* An identifier for the LED #3. */
29399 	uint8_t	led3_id;
29400 	/* The type of LED #3. */
29401 	uint8_t	led3_type;
29402 	/* Speed LED */
29403 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
29404 	/* Activity LED */
29405 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
29406 	/* Invalid */
29407 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
29408 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
29409 	/*
29410 	 * An identifier for the group of LEDs that LED #3 belongs
29411 	 * to.
29412 	 * If set to 0, then the LED #0 cannot be grouped.
29413 	 * For all other non-zero values of this field, LED #0 is
29414 	 * grouped together with the LEDs with the same group ID
29415 	 * value.
29416 	 */
29417 	uint8_t	led3_group_id;
29418 	uint8_t	unused_3;
29419 	/* The states supported by LED #3. */
29420 	uint16_t	led3_state_caps;
29421 	/*
29422 	 * If set to 1, this LED is enabled.
29423 	 * If set to 0, this LED is disabled.
29424 	 */
29425 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED		UINT32_C(0x1)
29426 	/*
29427 	 * If set to 1, off state is supported on this LED.
29428 	 * If set to 0, off state is not supported on this LED.
29429 	 */
29430 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
29431 	/*
29432 	 * If set to 1, on state is supported on this LED.
29433 	 * If set to 0, on state is not supported on this LED.
29434 	 */
29435 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
29436 	/*
29437 	 * If set to 1, blink state is supported on this LED.
29438 	 * If set to 0, blink state is not supported on this LED.
29439 	 */
29440 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
29441 	/*
29442 	 * If set to 1, blink_alt state is supported on this LED.
29443 	 * If set to 0, blink_alt state is not supported on this LED.
29444 	 */
29445 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
29446 	/* The colors supported by LED #3. */
29447 	uint16_t	led3_color_caps;
29448 	/* reserved. */
29449 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD		UINT32_C(0x1)
29450 	/*
29451 	 * If set to 1, Amber color is supported on this LED.
29452 	 * If set to 0, Amber color is not supported on this LED.
29453 	 */
29454 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
29455 	/*
29456 	 * If set to 1, Green color is supported on this LED.
29457 	 * If set to 0, Green color is not supported on this LED.
29458 	 */
29459 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
29460 	uint8_t	unused_4[3];
29461 	/*
29462 	 * This field is used in Output records to indicate that the output
29463 	 * is completely written to RAM.  This field should be read as '1'
29464 	 * to indicate that the output has been completely written.
29465 	 * When writing a command completion or response to an internal processor,
29466 	 * the order of writes has to be such that this field is written last.
29467 	 */
29468 	uint8_t	valid;
29469 } hwrm_port_led_qcaps_output_t, *phwrm_port_led_qcaps_output_t;
29470 
29471 /***********************
29472  * hwrm_port_prbs_test *
29473  ***********************/
29474 
29475 
29476 /* hwrm_port_prbs_test_input (size:384b/48B) */
29477 
29478 typedef struct hwrm_port_prbs_test_input {
29479 	/* The HWRM command request type. */
29480 	uint16_t	req_type;
29481 	/*
29482 	 * The completion ring to send the completion event on. This should
29483 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29484 	 */
29485 	uint16_t	cmpl_ring;
29486 	/*
29487 	 * The sequence ID is used by the driver for tracking multiple
29488 	 * commands. This ID is treated as opaque data by the firmware and
29489 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29490 	 */
29491 	uint16_t	seq_id;
29492 	/*
29493 	 * The target ID of the command:
29494 	 * * 0x0-0xFFF8 - The function ID
29495 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29496 	 * * 0xFFFD - Reserved for user-space HWRM interface
29497 	 * * 0xFFFF - HWRM
29498 	 */
29499 	uint16_t	target_id;
29500 	/*
29501 	 * A physical address pointer pointing to a host buffer that the
29502 	 * command's response data will be written. This can be either a host
29503 	 * physical address (HPA) or a guest physical address (GPA) and must
29504 	 * point to a physically contiguous block of memory.
29505 	 */
29506 	uint64_t	resp_addr;
29507 	/* Host address data is to DMA'd to. */
29508 	uint64_t	resp_data_addr;
29509 	/*
29510 	 * Size of the buffer pointed to by resp_data_addr. The firmware may
29511 	 * use this entire buffer or less than the entire buffer, but never more.
29512 	 */
29513 	uint16_t	data_len;
29514 	uint16_t	flags;
29515 	/*
29516 	 * If set, the port_id field should be interpreted as an internal
29517 	 * port. The internal port id range is returned in port_phy_qcaps
29518 	 * response internal_port_cnt field.
29519 	 */
29520 	#define HWRM_PORT_PRBS_TEST_INPUT_FLAGS_INTERNAL	UINT32_C(0x1)
29521 	uint32_t	unused_1;
29522 	/* Port ID of port where PRBS test to be run. */
29523 	uint16_t	port_id;
29524 	/* Polynomial selection for PRBS test. */
29525 	uint16_t	poly;
29526 	/* PRBS7 */
29527 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
29528 	/* PRBS9 */
29529 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
29530 	/* PRBS11 */
29531 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
29532 	/* PRBS15 */
29533 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
29534 	/* PRBS23 */
29535 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
29536 	/* PRBS31 */
29537 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
29538 	/* PRBS58 */
29539 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
29540 	/* PRBS49 */
29541 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS49  UINT32_C(0x7)
29542 	/* PRBS10 */
29543 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS10  UINT32_C(0x8)
29544 	/* PRBS20 */
29545 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS20  UINT32_C(0x9)
29546 	/* PRBS13 */
29547 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS13  UINT32_C(0xa)
29548 	/* Invalid */
29549 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
29550 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST   HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
29551 	/*
29552 	 * Configuration bits for PRBS test.
29553 	 * Use enable bit to start/stop test.
29554 	 * Use tx/rx lane map bits to run test on specific lanes,
29555 	 * if set to 0 test will be run on all lanes.
29556 	 */
29557 	uint16_t	prbs_config;
29558 	/*
29559 	 * Set 0 to stop test currently in progress
29560 	 * Set 1 to start test with configuration provided.
29561 	 */
29562 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP		UINT32_C(0x1)
29563 	/*
29564 	 * If set to 1, tx_lane_map bitmap should have lane bits set.
29565 	 * If set to 0, test will be run on all lanes for this port.
29566 	 */
29567 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID	UINT32_C(0x2)
29568 	/*
29569 	 * If set to 1, rx_lane_map bitmap should have lane bits set.
29570 	 * If set to 0, test will be run on all lanes for this port.
29571 	 */
29572 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID	UINT32_C(0x4)
29573 	/* If set to 1, FEC stat t-code 0-7 registers are enabled. */
29574 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_FEC_STAT_T0_T7	UINT32_C(0x8)
29575 	/*
29576 	 * If set to 1, FEC stat t-code 8-15 registers are enabled.
29577 	 * If fec_stat_t0_t7 is set, fec_stat_t8_t15 field will be ignored.
29578 	 */
29579 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_FEC_STAT_T8_T15	UINT32_C(0x10)
29580 	/* Duration in seconds to run the PRBS test. */
29581 	uint16_t	timeout;
29582 	/*
29583 	 * If tx_lane_map_valid is set to 1, this field is a bitmap
29584 	 * of tx lanes to run PRBS test. bit0 = lane0,
29585 	 * bit1 = lane1 ..bit31 = lane31
29586 	 */
29587 	uint32_t	tx_lane_map;
29588 	/*
29589 	 * If rx_lane_map_valid is set to 1, this field is a bitmap
29590 	 * of rx lanes to run PRBS test. bit0 = lane0,
29591 	 * bit1 = lane1 ..bit31 = lane31
29592 	 */
29593 	uint32_t	rx_lane_map;
29594 } hwrm_port_prbs_test_input_t, *phwrm_port_prbs_test_input_t;
29595 
29596 /* hwrm_port_prbs_test_output (size:128b/16B) */
29597 
29598 typedef struct hwrm_port_prbs_test_output {
29599 	/* The specific error status for the command. */
29600 	uint16_t	error_code;
29601 	/* The HWRM command request type. */
29602 	uint16_t	req_type;
29603 	/* The sequence ID from the original command. */
29604 	uint16_t	seq_id;
29605 	/* The length of the response data in number of bytes. */
29606 	uint16_t	resp_len;
29607 	/* Total length of stored data. */
29608 	uint16_t	total_data_len;
29609 	/* This field is used in Output records to indicate the output format */
29610 	uint8_t	ber_format;
29611 	/* BER_FORMAT_PRBS */
29612 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_PRBS UINT32_C(0x0)
29613 	/* BER_FORMAT_FEC */
29614 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_FEC  UINT32_C(0x1)
29615 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_LAST HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_FEC
29616 	uint8_t	unused_0;
29617 	uint8_t	unused_1[3];
29618 	/*
29619 	 * This field is used in Output records to indicate that the output
29620 	 * is completely written to RAM.  This field should be read as '1'
29621 	 * to indicate that the output has been completely written.
29622 	 * When writing a command completion or response to an internal processor,
29623 	 * the order of writes has to be such that this field is written last.
29624 	 */
29625 	uint8_t	valid;
29626 } hwrm_port_prbs_test_output_t, *phwrm_port_prbs_test_output_t;
29627 
29628 /**********************
29629  * hwrm_port_dsc_dump *
29630  **********************/
29631 
29632 
29633 /* hwrm_port_dsc_dump_input (size:320b/40B) */
29634 
29635 typedef struct hwrm_port_dsc_dump_input {
29636 	/* The HWRM command request type. */
29637 	uint16_t	req_type;
29638 	/*
29639 	 * The completion ring to send the completion event on. This should
29640 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29641 	 */
29642 	uint16_t	cmpl_ring;
29643 	/*
29644 	 * The sequence ID is used by the driver for tracking multiple
29645 	 * commands. This ID is treated as opaque data by the firmware and
29646 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29647 	 */
29648 	uint16_t	seq_id;
29649 	/*
29650 	 * The target ID of the command:
29651 	 * * 0x0-0xFFF8 - The function ID
29652 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29653 	 * * 0xFFFD - Reserved for user-space HWRM interface
29654 	 * * 0xFFFF - HWRM
29655 	 */
29656 	uint16_t	target_id;
29657 	/*
29658 	 * A physical address pointer pointing to a host buffer that the
29659 	 * command's response data will be written. This can be either a host
29660 	 * physical address (HPA) or a guest physical address (GPA) and must
29661 	 * point to a physically contiguous block of memory.
29662 	 */
29663 	uint64_t	resp_addr;
29664 	/* Host address where response diagnostic data is returned. */
29665 	uint64_t	resp_data_addr;
29666 	/*
29667 	 * Size of the buffer pointed to by resp_data_addr. The firmware
29668 	 * may use this entire buffer or less than the entire buffer, but
29669 	 * never more.
29670 	 */
29671 	uint16_t	data_len;
29672 	uint16_t	unused_0;
29673 	uint32_t	unused_1;
29674 	/* Port ID of port where dsc dump to be collected. */
29675 	uint16_t	port_id;
29676 	/* Diag level specified by the user */
29677 	uint16_t	diag_level;
29678 	/* SRDS_DIAG_LANE */
29679 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE	UINT32_C(0x0)
29680 	/* SRDS_DIAG_CORE */
29681 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE	UINT32_C(0x1)
29682 	/* SRDS_DIAG_EVENT */
29683 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT	UINT32_C(0x2)
29684 	/* SRDS_DIAG_EYE */
29685 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE	UINT32_C(0x3)
29686 	/* SRDS_DIAG_REG_CORE */
29687 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE   UINT32_C(0x4)
29688 	/* SRDS_DIAG_REG_LANE */
29689 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE   UINT32_C(0x5)
29690 	/* SRDS_DIAG_UC_CORE */
29691 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE	UINT32_C(0x6)
29692 	/* SRDS_DIAG_UC_LANE */
29693 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE	UINT32_C(0x7)
29694 	/* SRDS_DIAG_LANE_DEBUG */
29695 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG UINT32_C(0x8)
29696 	/* SRDS_DIAG_BER_VERT */
29697 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT   UINT32_C(0x9)
29698 	/* SRDS_DIAG_BER_HORZ */
29699 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ   UINT32_C(0xa)
29700 	/* SRDS_DIAG_EVENT_SAFE */
29701 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE UINT32_C(0xb)
29702 	/* SRDS_DIAG_TIMESTAMP */
29703 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP  UINT32_C(0xc)
29704 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST		HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
29705 	/*
29706 	 * This field is a lane number
29707 	 * on which to collect the dsc dump
29708 	 */
29709 	uint16_t	lane_number;
29710 	/*
29711 	 * Configuration bits.
29712 	 * Use enable bit to start dsc dump or retrieve dump
29713 	 */
29714 	uint16_t	dsc_dump_config;
29715 	/*
29716 	 * Set 0 to retrieve the dsc dump
29717 	 * Set 1 to start the dsc dump
29718 	 */
29719 	#define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE	UINT32_C(0x1)
29720 } hwrm_port_dsc_dump_input_t, *phwrm_port_dsc_dump_input_t;
29721 
29722 /* hwrm_port_dsc_dump_output (size:128b/16B) */
29723 
29724 typedef struct hwrm_port_dsc_dump_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 	/* Total length of stored data. */
29734 	uint16_t	total_data_len;
29735 	uint16_t	unused_0;
29736 	uint8_t	unused_1[3];
29737 	/*
29738 	 * This field is used in Output records to indicate that the output
29739 	 * is completely written to RAM.  This field should be read as '1'
29740 	 * to indicate that the output has been completely written.
29741 	 * When writing a command completion or response to an internal processor,
29742 	 * the order of writes has to be such that this field is written last.
29743 	 */
29744 	uint8_t	valid;
29745 } hwrm_port_dsc_dump_output_t, *phwrm_port_dsc_dump_output_t;
29746 
29747 /******************************
29748  * hwrm_port_sfp_sideband_cfg *
29749  ******************************/
29750 
29751 
29752 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
29753 
29754 typedef struct hwrm_port_sfp_sideband_cfg_input {
29755 	/* The HWRM command request type. */
29756 	uint16_t	req_type;
29757 	/*
29758 	 * The completion ring to send the completion event on. This should
29759 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29760 	 */
29761 	uint16_t	cmpl_ring;
29762 	/*
29763 	 * The sequence ID is used by the driver for tracking multiple
29764 	 * commands. This ID is treated as opaque data by the firmware and
29765 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29766 	 */
29767 	uint16_t	seq_id;
29768 	/*
29769 	 * The target ID of the command:
29770 	 * * 0x0-0xFFF8 - The function ID
29771 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29772 	 * * 0xFFFD - Reserved for user-space HWRM interface
29773 	 * * 0xFFFF - HWRM
29774 	 */
29775 	uint16_t	target_id;
29776 	/*
29777 	 * A physical address pointer pointing to a host buffer that the
29778 	 * command's response data will be written. This can be either a host
29779 	 * physical address (HPA) or a guest physical address (GPA) and must
29780 	 * point to a physically contiguous block of memory.
29781 	 */
29782 	uint64_t	resp_addr;
29783 	/* Port ID of port that is to be queried. */
29784 	uint16_t	port_id;
29785 	uint8_t	unused_0[6];
29786 	/*
29787 	 * This bitfield is used to specify which bits from the 'flags'
29788 	 * fields are being configured by the caller.
29789 	 */
29790 	uint32_t	enables;
29791 	/* This bit must be '1' for rs0 to be configured. */
29792 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0	UINT32_C(0x1)
29793 	/* This bit must be '1' for rs1 to be configured. */
29794 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1	UINT32_C(0x2)
29795 	/* This bit must be '1' for tx_disable to be configured. */
29796 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS	UINT32_C(0x4)
29797 	/*
29798 	 * This bit must be '1' for mod_sel to be configured.
29799 	 * Valid only on QSFP modules
29800 	 */
29801 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL	UINT32_C(0x8)
29802 	/* This bit must be '1' for reset_l to be configured. */
29803 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L	UINT32_C(0x10)
29804 	/* This bit must be '1' for lp_mode to be configured. */
29805 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE	UINT32_C(0x20)
29806 	/* This bit must be '1' for pwr_disable to be configured. */
29807 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS	UINT32_C(0x40)
29808 	/*
29809 	 * Only bits that have corresponding bits in the 'enables'
29810 	 * bitfield are processed by the firmware, all other bits
29811 	 * of 'flags' are ignored.
29812 	 */
29813 	uint32_t	flags;
29814 	/*
29815 	 * This bit along with rs1 configures the current speed of the dual
29816 	 * rate module. If these pins are GNDed then the speed can be changed
29817 	 * by directly writing to EEPROM.
29818 	 */
29819 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0	UINT32_C(0x1)
29820 	/*
29821 	 * This bit along with rs0 configures the current speed of the dual
29822 	 * rate module. If these pins are GNDed then the speed can be changed
29823 	 * by directly writing to EEPROM.
29824 	 */
29825 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1	UINT32_C(0x2)
29826 	/*
29827 	 * When this bit is set to '1', tx_disable is set.
29828 	 * On a 1G BASE-T module, if this bit is set,
29829 	 * module PHY registers will not be accessible.
29830 	 */
29831 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS	UINT32_C(0x4)
29832 	/*
29833 	 * When this bit is set to '1', this module is selected.
29834 	 * Valid only on QSFP modules
29835 	 */
29836 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL	UINT32_C(0x8)
29837 	/*
29838 	 * If reset_l is set to 0, Module will be taken out of reset
29839 	 * and other signals will be set to their requested state once
29840 	 * the module is out of reset.
29841 	 * Valid only on QSFP modules
29842 	 */
29843 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L	UINT32_C(0x10)
29844 	/*
29845 	 * When this bit is set to '1', the module will be configured
29846 	 * in low power mode.
29847 	 * Valid only on QSFP modules
29848 	 */
29849 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE	UINT32_C(0x20)
29850 	/* When this bit is set to '1', the module will be powered down. */
29851 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS	UINT32_C(0x40)
29852 } hwrm_port_sfp_sideband_cfg_input_t, *phwrm_port_sfp_sideband_cfg_input_t;
29853 
29854 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
29855 
29856 typedef struct hwrm_port_sfp_sideband_cfg_output {
29857 	/* The specific error status for the command. */
29858 	uint16_t	error_code;
29859 	/* The HWRM command request type. */
29860 	uint16_t	req_type;
29861 	/* The sequence ID from the original command. */
29862 	uint16_t	seq_id;
29863 	/* The length of the response data in number of bytes. */
29864 	uint16_t	resp_len;
29865 	uint8_t	unused[7];
29866 	/*
29867 	 * This field is used in Output records to indicate that the output
29868 	 * is completely written to RAM.  This field should be read as '1'
29869 	 * to indicate that the output has been completely written. When
29870 	 * writing a command completion or response to an internal processor,
29871 	 * the order of writes has to be such that this field is written last.
29872 	 */
29873 	uint8_t	valid;
29874 } hwrm_port_sfp_sideband_cfg_output_t, *phwrm_port_sfp_sideband_cfg_output_t;
29875 
29876 /*******************************
29877  * hwrm_port_sfp_sideband_qcfg *
29878  *******************************/
29879 
29880 
29881 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
29882 
29883 typedef struct hwrm_port_sfp_sideband_qcfg_input {
29884 	/* The HWRM command request type. */
29885 	uint16_t	req_type;
29886 	/*
29887 	 * The completion ring to send the completion event on. This should
29888 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29889 	 */
29890 	uint16_t	cmpl_ring;
29891 	/*
29892 	 * The sequence ID is used by the driver for tracking multiple
29893 	 * commands. This ID is treated as opaque data by the firmware and
29894 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29895 	 */
29896 	uint16_t	seq_id;
29897 	/*
29898 	 * The target ID of the command:
29899 	 * * 0x0-0xFFF8 - The function ID
29900 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29901 	 * * 0xFFFD - Reserved for user-space HWRM interface
29902 	 * * 0xFFFF - HWRM
29903 	 */
29904 	uint16_t	target_id;
29905 	/*
29906 	 * A physical address pointer pointing to a host buffer that the
29907 	 * command's response data will be written. This can be either a host
29908 	 * physical address (HPA) or a guest physical address (GPA) and must
29909 	 * point to a physically contiguous block of memory.
29910 	 */
29911 	uint64_t	resp_addr;
29912 	/* Port ID of port that is to be queried. */
29913 	uint16_t	port_id;
29914 	uint8_t	unused_0[6];
29915 } hwrm_port_sfp_sideband_qcfg_input_t, *phwrm_port_sfp_sideband_qcfg_input_t;
29916 
29917 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
29918 
29919 typedef struct hwrm_port_sfp_sideband_qcfg_output {
29920 	/* The specific error status for the command. */
29921 	uint16_t	error_code;
29922 	/* The HWRM command request type. */
29923 	uint16_t	req_type;
29924 	/* The sequence ID from the original command. */
29925 	uint16_t	seq_id;
29926 	/* The length of the response data in number of bytes. */
29927 	uint16_t	resp_len;
29928 	/*
29929 	 * Bitmask indicating which sideband signals are valid.
29930 	 * This is based on the board and nvm cfg that is present on the board.
29931 	 */
29932 	uint32_t	supported_mask;
29933 	uint32_t	sideband_signals;
29934 	/* When this bit is set to '1', the Module is absent. */
29935 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS	UINT32_C(0x1)
29936 	/*
29937 	 * When this bit is set to '1', there is no valid signal on RX.
29938 	 * This signal is a filtered version of Signal Detect.
29939 	 */
29940 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS	UINT32_C(0x2)
29941 	/*
29942 	 * This bit along with rs1 indicates the current speed of the dual
29943 	 * rate module.If these pins are grounded then the speed can be
29944 	 * changed by directly writing to EEPROM.
29945 	 */
29946 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0	UINT32_C(0x4)
29947 	/*
29948 	 * This bit along with rs0 indicates the current speed of the dual
29949 	 * rate module.If these pins are grounded then the speed can be
29950 	 * changed by directly writing to EEPROM.
29951 	 */
29952 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1	UINT32_C(0x8)
29953 	/*
29954 	 * When this bit is set to '1', tx_disable is set.
29955 	 * On a 1G BASE-T module, if this bit is set, module PHY
29956 	 * registers will not be accessible.
29957 	 */
29958 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS	UINT32_C(0x10)
29959 	/* When this bit is set to '1', tx_fault is set. */
29960 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT	UINT32_C(0x20)
29961 	/*
29962 	 * When this bit is set to '1', module is selected.
29963 	 * Valid only on QSFP modules
29964 	 */
29965 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL	UINT32_C(0x40)
29966 	/*
29967 	 * When this bit is set to '0', the module is held in reset.
29968 	 * if reset_l is set to 1,first module is taken out of reset
29969 	 * and other signals will be set to their requested state.
29970 	 * Valid only on QSFP modules.
29971 	 */
29972 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L	UINT32_C(0x80)
29973 	/*
29974 	 * When this bit is set to '1', the module is in low power mode.
29975 	 * Valid only on QSFP modules
29976 	 */
29977 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE	UINT32_C(0x100)
29978 	/* When this bit is set to '1', module is in power down state. */
29979 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS	UINT32_C(0x200)
29980 	uint8_t	unused[7];
29981 	/*
29982 	 * This field is used in Output records to indicate that the output
29983 	 * is completely written to RAM.  This field should be read as '1'
29984 	 * to indicate that the output has been completely written. When
29985 	 * writing a command completion or response to an internal processor,
29986 	 * the order of writes has to be such that this field is written last.
29987 	 */
29988 	uint8_t	valid;
29989 } hwrm_port_sfp_sideband_qcfg_output_t, *phwrm_port_sfp_sideband_qcfg_output_t;
29990 
29991 /**********************************
29992  * hwrm_port_phy_mdio_bus_acquire *
29993  **********************************/
29994 
29995 
29996 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
29997 
29998 typedef struct hwrm_port_phy_mdio_bus_acquire_input {
29999 	/* The HWRM command request type. */
30000 	uint16_t	req_type;
30001 	/*
30002 	 * The completion ring to send the completion event on. This should
30003 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30004 	 */
30005 	uint16_t	cmpl_ring;
30006 	/*
30007 	 * The sequence ID is used by the driver for tracking multiple
30008 	 * commands. This ID is treated as opaque data by the firmware and
30009 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30010 	 */
30011 	uint16_t	seq_id;
30012 	/*
30013 	 * The target ID of the command:
30014 	 * * 0x0-0xFFF8 - The function ID
30015 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30016 	 * * 0xFFFD - Reserved for user-space HWRM interface
30017 	 * * 0xFFFF - HWRM
30018 	 */
30019 	uint16_t	target_id;
30020 	/*
30021 	 * A physical address pointer pointing to a host buffer that the
30022 	 * command's response data will be written. This can be either a host
30023 	 * physical address (HPA) or a guest physical address (GPA) and must
30024 	 * point to a physically contiguous block of memory.
30025 	 */
30026 	uint64_t	resp_addr;
30027 	/* Port ID of the port. */
30028 	uint16_t	port_id;
30029 	/*
30030 	 * client_id of the client requesting BUS access.
30031 	 * Any value from 0x10 to 0xFFFF can be used.
30032 	 * Client should make sure that the returned client_id
30033 	 * in response matches the client_id in request.
30034 	 * 0-0xF are reserved for internal use.
30035 	 */
30036 	uint16_t	client_id;
30037 	/*
30038 	 * Timeout in milli seconds, MDIO BUS will be released automatically
30039 	 * after this time, if another mdio acquire command is not received
30040 	 * within the timeout window from the same client.
30041 	 * A 0xFFFF will hold the bus until this bus is released.
30042 	 */
30043 	uint16_t	mdio_bus_timeout;
30044 	uint8_t	unused_0[2];
30045 } hwrm_port_phy_mdio_bus_acquire_input_t, *phwrm_port_phy_mdio_bus_acquire_input_t;
30046 
30047 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
30048 
30049 typedef struct hwrm_port_phy_mdio_bus_acquire_output {
30050 	/* The specific error status for the command. */
30051 	uint16_t	error_code;
30052 	/* The HWRM command request type. */
30053 	uint16_t	req_type;
30054 	/* The sequence ID from the original command. */
30055 	uint16_t	seq_id;
30056 	/* The length of the response data in number of bytes. */
30057 	uint16_t	resp_len;
30058 	uint16_t	unused_0;
30059 	/*
30060 	 * client_id of the module holding the BUS.
30061 	 * 0-0xF are reserved for internal use.
30062 	 */
30063 	uint16_t	client_id;
30064 	uint8_t	unused_1[3];
30065 	/*
30066 	 * This field is used in Output records to indicate that the output
30067 	 * is completely written to RAM.  This field should be read as '1'
30068 	 * to indicate that the output has been completely written.
30069 	 * When writing a command completion or response to an internal processor,
30070 	 * the order of writes has to be such that this field is written last.
30071 	 */
30072 	uint8_t	valid;
30073 } hwrm_port_phy_mdio_bus_acquire_output_t, *phwrm_port_phy_mdio_bus_acquire_output_t;
30074 
30075 /**********************************
30076  * hwrm_port_phy_mdio_bus_release *
30077  **********************************/
30078 
30079 
30080 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
30081 
30082 typedef struct hwrm_port_phy_mdio_bus_release_input {
30083 	/* The HWRM command request type. */
30084 	uint16_t	req_type;
30085 	/*
30086 	 * The completion ring to send the completion event on. This should
30087 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30088 	 */
30089 	uint16_t	cmpl_ring;
30090 	/*
30091 	 * The sequence ID is used by the driver for tracking multiple
30092 	 * commands. This ID is treated as opaque data by the firmware and
30093 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30094 	 */
30095 	uint16_t	seq_id;
30096 	/*
30097 	 * The target ID of the command:
30098 	 * * 0x0-0xFFF8 - The function ID
30099 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30100 	 * * 0xFFFD - Reserved for user-space HWRM interface
30101 	 * * 0xFFFF - HWRM
30102 	 */
30103 	uint16_t	target_id;
30104 	/*
30105 	 * A physical address pointer pointing to a host buffer that the
30106 	 * command's response data will be written. This can be either a host
30107 	 * physical address (HPA) or a guest physical address (GPA) and must
30108 	 * point to a physically contiguous block of memory.
30109 	 */
30110 	uint64_t	resp_addr;
30111 	/* Port ID of the port. */
30112 	uint16_t	port_id;
30113 	/*
30114 	 * client_id of the client requesting BUS release.
30115 	 * A client should not release any other clients BUS.
30116 	 */
30117 	uint16_t	client_id;
30118 	uint8_t	unused_0[4];
30119 } hwrm_port_phy_mdio_bus_release_input_t, *phwrm_port_phy_mdio_bus_release_input_t;
30120 
30121 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
30122 
30123 typedef struct hwrm_port_phy_mdio_bus_release_output {
30124 	/* The specific error status for the command. */
30125 	uint16_t	error_code;
30126 	/* The HWRM command request type. */
30127 	uint16_t	req_type;
30128 	/* The sequence ID from the original command. */
30129 	uint16_t	seq_id;
30130 	/* The length of the response data in number of bytes. */
30131 	uint16_t	resp_len;
30132 	uint16_t	unused_0;
30133 	/* The BUS is released if client_id matches the client_id in request. */
30134 	uint16_t	clients_id;
30135 	uint8_t	unused_1[3];
30136 	/*
30137 	 * This field is used in Output records to indicate that the output
30138 	 * is completely written to RAM.  This field should be read as '1'
30139 	 * to indicate that the output has been completely written.
30140 	 * When writing a command completion or response to an internal processor,
30141 	 * the order of writes has to be such that this field is written last.
30142 	 */
30143 	uint8_t	valid;
30144 } hwrm_port_phy_mdio_bus_release_output_t, *phwrm_port_phy_mdio_bus_release_output_t;
30145 
30146 /************************
30147  * hwrm_port_tx_fir_cfg *
30148  ************************/
30149 
30150 
30151 /* hwrm_port_tx_fir_cfg_input (size:320b/40B) */
30152 
30153 typedef struct hwrm_port_tx_fir_cfg_input {
30154 	/* The HWRM command request type. */
30155 	uint16_t	req_type;
30156 	/*
30157 	 * The completion ring to send the completion event on. This should
30158 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30159 	 */
30160 	uint16_t	cmpl_ring;
30161 	/*
30162 	 * The sequence ID is used by the driver for tracking multiple
30163 	 * commands. This ID is treated as opaque data by the firmware and
30164 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30165 	 */
30166 	uint16_t	seq_id;
30167 	/*
30168 	 * The target ID of the command:
30169 	 * * 0x0-0xFFF8 - The function ID
30170 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30171 	 * * 0xFFFD - Reserved for user-space HWRM interface
30172 	 * * 0xFFFF - HWRM
30173 	 */
30174 	uint16_t	target_id;
30175 	/*
30176 	 * A physical address pointer pointing to a host buffer that the
30177 	 * command's response data will be written. This can be either a host
30178 	 * physical address (HPA) or a guest physical address (GPA) and must
30179 	 * point to a physically contiguous block of memory.
30180 	 */
30181 	uint64_t	resp_addr;
30182 	/* Modulation types of TX FIR: NRZ, PAM4. */
30183 	uint8_t	mod_type;
30184 	/* For NRZ */
30185 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
30186 	/* For PAM4 */
30187 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
30188 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LAST HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4
30189 	/* The lane mask of the lane TX FIR will be configured. */
30190 	uint8_t	lane_mask;
30191 	uint8_t	unused_0[2];
30192 	/* Value1 of TX FIR, required for NRZ or PAM4. */
30193 	uint32_t	txfir_val_1;
30194 	/* Value2 of TX FIR, required for NRZ or PAM4. */
30195 	uint32_t	txfir_val_2;
30196 	/* Value3 of TX FIR, required for PAM4. */
30197 	uint32_t	txfir_val_3;
30198 	/* Value4 of TX FIR, required for PAM4. */
30199 	uint32_t	txfir_val_4;
30200 	uint8_t	unused_1[4];
30201 } hwrm_port_tx_fir_cfg_input_t, *phwrm_port_tx_fir_cfg_input_t;
30202 
30203 /* hwrm_port_tx_fir_cfg_output (size:128b/16B) */
30204 
30205 typedef struct hwrm_port_tx_fir_cfg_output {
30206 	/* The specific error status for the command. */
30207 	uint16_t	error_code;
30208 	/* The HWRM command request type. */
30209 	uint16_t	req_type;
30210 	/* The sequence ID from the original command. */
30211 	uint16_t	seq_id;
30212 	/* The length of the response data in number of bytes. */
30213 	uint16_t	resp_len;
30214 	uint8_t	unused[7];
30215 	/*
30216 	 * This field is used in Output records to indicate that the output
30217 	 * is completely written to RAM.  This field should be read as '1'
30218 	 * to indicate that the output has been completely written.
30219 	 * When writing a command completion or response to an internal processor,
30220 	 * the order of writes has to be such that this field is written last.
30221 	 */
30222 	uint8_t	valid;
30223 } hwrm_port_tx_fir_cfg_output_t, *phwrm_port_tx_fir_cfg_output_t;
30224 
30225 /*************************
30226  * hwrm_port_tx_fir_qcfg *
30227  *************************/
30228 
30229 
30230 /* hwrm_port_tx_fir_qcfg_input (size:192b/24B) */
30231 
30232 typedef struct hwrm_port_tx_fir_qcfg_input {
30233 	/* The HWRM command request type. */
30234 	uint16_t	req_type;
30235 	/*
30236 	 * The completion ring to send the completion event on. This should
30237 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30238 	 */
30239 	uint16_t	cmpl_ring;
30240 	/*
30241 	 * The sequence ID is used by the driver for tracking multiple
30242 	 * commands. This ID is treated as opaque data by the firmware and
30243 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30244 	 */
30245 	uint16_t	seq_id;
30246 	/*
30247 	 * The target ID of the command:
30248 	 * * 0x0-0xFFF8 - The function ID
30249 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30250 	 * * 0xFFFD - Reserved for user-space HWRM interface
30251 	 * * 0xFFFF - HWRM
30252 	 */
30253 	uint16_t	target_id;
30254 	/*
30255 	 * A physical address pointer pointing to a host buffer that the
30256 	 * command's response data will be written. This can be either a host
30257 	 * physical address (HPA) or a guest physical address (GPA) and must
30258 	 * point to a physically contiguous block of memory.
30259 	 */
30260 	uint64_t	resp_addr;
30261 	/* Modulation types of TX FIR: NRZ, PAM4. */
30262 	uint8_t	mod_type;
30263 	/* For NRZ */
30264 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
30265 	/* For PAM4 */
30266 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
30267 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LAST HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4
30268 	/* The ID of the lane TX FIR will be queried. */
30269 	uint8_t	lane_id;
30270 	uint8_t	unused[6];
30271 } hwrm_port_tx_fir_qcfg_input_t, *phwrm_port_tx_fir_qcfg_input_t;
30272 
30273 /* hwrm_port_tx_fir_qcfg_output (size:256b/32B) */
30274 
30275 typedef struct hwrm_port_tx_fir_qcfg_output {
30276 	/* The specific error status for the command. */
30277 	uint16_t	error_code;
30278 	/* The HWRM command request type. */
30279 	uint16_t	req_type;
30280 	/* The sequence ID from the original command. */
30281 	uint16_t	seq_id;
30282 	/* The length of the response data in number of bytes. */
30283 	uint16_t	resp_len;
30284 	/* Value1 of TX FIR, required for NRZ or PAM4. */
30285 	uint32_t	txfir_val_1;
30286 	/* Value2 of TX FIR, required for NRZ or PAM4. */
30287 	uint32_t	txfir_val_2;
30288 	/* Value3 of TX FIR, required for PAM4. */
30289 	uint32_t	txfir_val_3;
30290 	/* Value4 of TX FIR, required for PAM4. */
30291 	uint32_t	txfir_val_4;
30292 	uint8_t	unused[7];
30293 	/*
30294 	 * This field is used in Output records to indicate that the output
30295 	 * is completely written to RAM.  This field should be read as '1'
30296 	 * to indicate that the output has been completely written.
30297 	 * When writing a command completion or response to an internal processor,
30298 	 * the order of writes has to be such that this field is written last.
30299 	 */
30300 	uint8_t	valid;
30301 } hwrm_port_tx_fir_qcfg_output_t, *phwrm_port_tx_fir_qcfg_output_t;
30302 
30303 /***********************
30304  * hwrm_port_ep_tx_cfg *
30305  ***********************/
30306 
30307 
30308 /* hwrm_port_ep_tx_cfg_input (size:256b/32B) */
30309 
30310 typedef struct hwrm_port_ep_tx_cfg_input {
30311 	/* The HWRM command request type. */
30312 	uint16_t	req_type;
30313 	/*
30314 	 * The completion ring to send the completion event on. This should
30315 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30316 	 */
30317 	uint16_t	cmpl_ring;
30318 	/*
30319 	 * The sequence ID is used by the driver for tracking multiple
30320 	 * commands. This ID is treated as opaque data by the firmware and
30321 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30322 	 */
30323 	uint16_t	seq_id;
30324 	/*
30325 	 * The target ID of the command:
30326 	 * * 0x0-0xFFF8 - The function ID
30327 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30328 	 * * 0xFFFD - Reserved for user-space HWRM interface
30329 	 * * 0xFFFF - HWRM
30330 	 */
30331 	uint16_t	target_id;
30332 	/*
30333 	 * A physical address pointer pointing to a host buffer that the
30334 	 * command's response data will be written. This can be either a host
30335 	 * physical address (HPA) or a guest physical address (GPA) and must
30336 	 * point to a physically contiguous block of memory.
30337 	 */
30338 	uint64_t	resp_addr;
30339 	uint16_t	enables;
30340 	/* When this bit is '1', the value in the ep0_min_bw field is valid. */
30341 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MIN_BW	UINT32_C(0x1)
30342 	/* When this bit is '1', the value in the ep0_max_bw field is valid. */
30343 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MAX_BW	UINT32_C(0x2)
30344 	/* When this bit is '1', the value in the ep1_min_bw field is valid. */
30345 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MIN_BW	UINT32_C(0x4)
30346 	/* When this bit is '1', the value in the ep1_max_bw field is valid. */
30347 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MAX_BW	UINT32_C(0x8)
30348 	/* When this bit is '1', the value in the ep2_min_bw field is valid. */
30349 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MIN_BW	UINT32_C(0x10)
30350 	/* When this bit is '1', the value in the ep2_max_bw field is valid. */
30351 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MAX_BW	UINT32_C(0x20)
30352 	/* When this bit is '1', the value in the ep3_min_bw field is valid. */
30353 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MIN_BW	UINT32_C(0x40)
30354 	/* When this bit is '1', the value in the ep3_max_bw field is valid. */
30355 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MAX_BW	UINT32_C(0x80)
30356 	/* A port index, from 0 to the number of front panel ports, minus 1. */
30357 	uint8_t	port_id;
30358 	uint8_t	unused;
30359 	/*
30360 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30361 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
30362 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30363 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30364 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30365 	 * be less than or equal to 100.
30366 	 */
30367 	uint8_t	ep0_min_bw;
30368 	/*
30369 	 * Specifies the maximum portion of the port's bandwidth that the set
30370 	 * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
30371 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30372 	 * maximum rate.
30373 	 */
30374 	uint8_t	ep0_max_bw;
30375 	/*
30376 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30377 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
30378 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30379 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30380 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30381 	 * be less than or equal to 100.
30382 	 */
30383 	uint8_t	ep1_min_bw;
30384 	/*
30385 	 * Specifies the maximum portion of the port's bandwidth that the set
30386 	 * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
30387 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30388 	 * maximum rate.
30389 	 */
30390 	uint8_t	ep1_max_bw;
30391 	/*
30392 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30393 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
30394 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30395 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30396 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30397 	 * be less than or equal to 100.
30398 	 */
30399 	uint8_t	ep2_min_bw;
30400 	/*
30401 	 * Specifies the maximum portion of the port's bandwidth that the set of
30402 	 * PFs and VFs on PCIe endpoint 2 may use. The value is a percentage of
30403 	 * the link bandwidth, from 0 to 100. A value of 0 indicates no
30404 	 * maximum rate.
30405 	 */
30406 	uint8_t	ep2_max_bw;
30407 	/*
30408 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30409 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
30410 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30411 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30412 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30413 	 * be less than or equal to 100.
30414 	 */
30415 	uint8_t	ep3_min_bw;
30416 	/*
30417 	 * Specifies the maximum portion of the port's bandwidth that the set
30418 	 * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
30419 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30420 	 * maximum rate.
30421 	 */
30422 	uint8_t	ep3_max_bw;
30423 	uint8_t	unused_1[4];
30424 } hwrm_port_ep_tx_cfg_input_t, *phwrm_port_ep_tx_cfg_input_t;
30425 
30426 /* hwrm_port_ep_tx_cfg_output (size:128b/16B) */
30427 
30428 typedef struct hwrm_port_ep_tx_cfg_output {
30429 	/* The specific error status for the command. */
30430 	uint16_t	error_code;
30431 	/* The HWRM command request type. */
30432 	uint16_t	req_type;
30433 	/* The sequence ID from the original command. */
30434 	uint16_t	seq_id;
30435 	/* The length of the response data in number of bytes. */
30436 	uint16_t	resp_len;
30437 	uint8_t	unused_0[7];
30438 	/*
30439 	 * This field is used in output records to indicate that the output
30440 	 * is completely written to RAM. This field should be read as '1'
30441 	 * to indicate that the output has been completely written.
30442 	 * When writing a command completion or response to an internal
30443 	 * processor, the order of writes has to be such that this field
30444 	 * is written last.
30445 	 */
30446 	uint8_t	valid;
30447 } hwrm_port_ep_tx_cfg_output_t, *phwrm_port_ep_tx_cfg_output_t;
30448 
30449 /* hwrm_port_ep_tx_cfg_cmd_err (size:64b/8B) */
30450 
30451 typedef struct hwrm_port_ep_tx_cfg_cmd_err {
30452 	/*
30453 	 * command specific error codes for the cmd_err field in
30454 	 * hwrm_err_output
30455 	 */
30456 	uint8_t	code;
30457 	/* Unknown error. */
30458 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
30459 	/* The port ID is invalid */
30460 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_PORT_ID_INVALID	UINT32_C(0x1)
30461 	/* One of the PCIe endpoints configured is not active. */
30462 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_EP_INACTIVE	UINT32_C(0x2)
30463 	/* A minimum bandwidth is out of range. */
30464 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_RANGE	UINT32_C(0x3)
30465 	/*
30466 	 * One endpoint's minimum bandwidth is more than its maximum
30467 	 * bandwidth.
30468 	 */
30469 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_MORE_THAN_MAX  UINT32_C(0x4)
30470 	/* The sum of the minimum bandwidths on the port is more than 100%. */
30471 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_SUM	UINT32_C(0x5)
30472 	/*
30473 	 * The NIC does not support enforcement of a minimum guaranteed
30474 	 * bandwidth for an endpoint.
30475 	 */
30476 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED UINT32_C(0x6)
30477 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_LAST		HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED
30478 	uint8_t	unused_0[7];
30479 } hwrm_port_ep_tx_cfg_cmd_err_t, *phwrm_port_ep_tx_cfg_cmd_err_t;
30480 
30481 /************************
30482  * hwrm_port_ep_tx_qcfg *
30483  ************************/
30484 
30485 
30486 /* hwrm_port_ep_tx_qcfg_input (size:192b/24B) */
30487 
30488 typedef struct hwrm_port_ep_tx_qcfg_input {
30489 	/* The HWRM command request type. */
30490 	uint16_t	req_type;
30491 	/*
30492 	 * The completion ring to send the completion event on. This should
30493 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30494 	 */
30495 	uint16_t	cmpl_ring;
30496 	/*
30497 	 * The sequence ID is used by the driver for tracking multiple
30498 	 * commands. This ID is treated as opaque data by the firmware and
30499 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30500 	 */
30501 	uint16_t	seq_id;
30502 	/*
30503 	 * The target ID of the command:
30504 	 * * 0x0-0xFFF8 - The function ID
30505 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30506 	 * * 0xFFFD - Reserved for user-space HWRM interface
30507 	 * * 0xFFFF - HWRM
30508 	 */
30509 	uint16_t	target_id;
30510 	/*
30511 	 * A physical address pointer pointing to a host buffer that the
30512 	 * command's response data will be written. This can be either a host
30513 	 * physical address (HPA) or a guest physical address (GPA) and must
30514 	 * point to a physically contiguous block of memory.
30515 	 */
30516 	uint64_t	resp_addr;
30517 	/* The port whose endpoint rate limits are queried. */
30518 	uint8_t	port_id;
30519 	uint8_t	unused[7];
30520 } hwrm_port_ep_tx_qcfg_input_t, *phwrm_port_ep_tx_qcfg_input_t;
30521 
30522 /* hwrm_port_ep_tx_qcfg_output (size:192b/24B) */
30523 
30524 typedef struct hwrm_port_ep_tx_qcfg_output {
30525 	/* The specific error status for the command. */
30526 	uint16_t	error_code;
30527 	/* The HWRM command request type. */
30528 	uint16_t	req_type;
30529 	/* The sequence ID from the original command. */
30530 	uint16_t	seq_id;
30531 	/* The length of the response data in number of bytes. */
30532 	uint16_t	resp_len;
30533 	/*
30534 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30535 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
30536 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30537 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30538 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30539 	 * be less than or equal to 100.
30540 	 */
30541 	uint8_t	ep0_min_bw;
30542 	/*
30543 	 * Specifies the maximum portion of the port's bandwidth that the set
30544 	 * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
30545 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30546 	 * maximum rate.
30547 	 */
30548 	uint8_t	ep0_max_bw;
30549 	/*
30550 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30551 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
30552 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30553 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30554 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30555 	 * be less than or equal to 100.
30556 	 */
30557 	uint8_t	ep1_min_bw;
30558 	/*
30559 	 * Specifies the maximum portion of the port's bandwidth that the set
30560 	 * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
30561 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30562 	 * maximum rate.
30563 	 */
30564 	uint8_t	ep1_max_bw;
30565 	/*
30566 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30567 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
30568 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30569 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30570 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30571 	 * be less than or equal to 100.
30572 	 */
30573 	uint8_t	ep2_min_bw;
30574 	/*
30575 	 * Specifies the maximum portion of the port's bandwidth that the set
30576 	 * of PFs and VFs on PCIe endpoint 2 may use. The value is a percentage
30577 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30578 	 * maximum rate.
30579 	 */
30580 	uint8_t	ep2_max_bw;
30581 	/*
30582 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
30583 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
30584 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
30585 	 * minimum rate. The endpoint's min_bw must be less than or equal to
30586 	 * max_bw. The sum of all configured minimum bandwidths for a port must
30587 	 * be less than or equal to 100.
30588 	 */
30589 	uint8_t	ep3_min_bw;
30590 	/*
30591 	 * Specifies the maximum portion of the port's bandwidth that the set
30592 	 * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
30593 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30594 	 * maximum rate.
30595 	 */
30596 	uint8_t	ep3_max_bw;
30597 	uint8_t	unused_0[7];
30598 	/*
30599 	 * This field is used in output records to indicate that the output
30600 	 * is completely written to RAM. This field should be read as '1'
30601 	 * to indicate that the output has been completely written.
30602 	 * When writing a command completion or response to an internal
30603 	 * processor, the order of writes has to be such that this field is
30604 	 * written last.
30605 	 */
30606 	uint8_t	valid;
30607 } hwrm_port_ep_tx_qcfg_output_t, *phwrm_port_ep_tx_qcfg_output_t;
30608 
30609 /*****************
30610  * hwrm_port_cfg *
30611  *****************/
30612 
30613 
30614 /* hwrm_port_cfg_input (size:256b/32B) */
30615 
30616 typedef struct hwrm_port_cfg_input {
30617 	/* The HWRM command request type. */
30618 	uint16_t	req_type;
30619 	/*
30620 	 * The completion ring to send the completion event on. This should
30621 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30622 	 */
30623 	uint16_t	cmpl_ring;
30624 	/*
30625 	 * The sequence ID is used by the driver for tracking multiple
30626 	 * commands. This ID is treated as opaque data by the firmware and
30627 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30628 	 */
30629 	uint16_t	seq_id;
30630 	/*
30631 	 * The target ID of the command:
30632 	 * * 0x0-0xFFF8 - The function ID
30633 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30634 	 * * 0xFFFD - Reserved for user-space HWRM interface
30635 	 * * 0xFFFF - HWRM
30636 	 */
30637 	uint16_t	target_id;
30638 	/*
30639 	 * A physical address pointer pointing to a host buffer that the
30640 	 * command's response data will be written. This can be either a host
30641 	 * physical address (HPA) or a guest physical address (GPA) and must
30642 	 * point to a physically contiguous block of memory.
30643 	 */
30644 	uint64_t	resp_addr;
30645 	uint32_t	flags;
30646 	uint32_t	enables;
30647 	/*
30648 	 * This bit must be '1' for the tx_rate_limit field to
30649 	 * be configured.
30650 	 */
30651 	#define HWRM_PORT_CFG_INPUT_ENABLES_TX_RATE_LIMIT	UINT32_C(0x1)
30652 	/* Port ID of port that is to be configured. */
30653 	uint16_t	port_id;
30654 	uint16_t	unused_0;
30655 	/*
30656 	 * Requested setting of TX rate limit in Mbps.
30657 	 * tx_rate_limit = 0 will cancel the rate limit if any.
30658 	 * This field is valid only when tx_rate_limit bit in 'enables'
30659 	 * field is '1'.
30660 	 */
30661 	uint32_t	tx_rate_limit;
30662 } hwrm_port_cfg_input_t, *phwrm_port_cfg_input_t;
30663 
30664 /* hwrm_port_cfg_output (size:128b/16B) */
30665 
30666 typedef struct hwrm_port_cfg_output {
30667 	/* The specific error status for the command. */
30668 	uint16_t	error_code;
30669 	/* The HWRM command request type. */
30670 	uint16_t	req_type;
30671 	/* The sequence ID from the original command. */
30672 	uint16_t	seq_id;
30673 	/* The length of the response data in number of bytes. */
30674 	uint16_t	resp_len;
30675 	uint8_t	unused_0[7];
30676 	/*
30677 	 * This field is used in Output records to indicate that the output
30678 	 * is completely written to RAM.  This field should be read as '1'
30679 	 * to indicate that the output has been completely written.
30680 	 * When writing a command completion or response to an internal processor,
30681 	 * the order of writes has to be such that this field is written last.
30682 	 */
30683 	uint8_t	valid;
30684 } hwrm_port_cfg_output_t, *phwrm_port_cfg_output_t;
30685 
30686 /******************
30687  * hwrm_port_qcfg *
30688  ******************/
30689 
30690 
30691 /* hwrm_port_qcfg_input (size:192b/24B) */
30692 
30693 typedef struct hwrm_port_qcfg_input {
30694 	/* The HWRM command request type. */
30695 	uint16_t	req_type;
30696 	/*
30697 	 * The completion ring to send the completion event on. This should
30698 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30699 	 */
30700 	uint16_t	cmpl_ring;
30701 	/*
30702 	 * The sequence ID is used by the driver for tracking multiple
30703 	 * commands. This ID is treated as opaque data by the firmware and
30704 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30705 	 */
30706 	uint16_t	seq_id;
30707 	/*
30708 	 * The target ID of the command:
30709 	 * * 0x0-0xFFF8 - The function ID
30710 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30711 	 * * 0xFFFD - Reserved for user-space HWRM interface
30712 	 * * 0xFFFF - HWRM
30713 	 */
30714 	uint16_t	target_id;
30715 	/*
30716 	 * A physical address pointer pointing to a host buffer that the
30717 	 * command's response data will be written. This can be either a host
30718 	 * physical address (HPA) or a guest physical address (GPA) and must
30719 	 * point to a physically contiguous block of memory.
30720 	 */
30721 	uint64_t	resp_addr;
30722 	/* Port ID of port that is to be queried. */
30723 	uint16_t	port_id;
30724 	uint8_t	unused_0[6];
30725 } hwrm_port_qcfg_input_t, *phwrm_port_qcfg_input_t;
30726 
30727 /* hwrm_port_qcfg_output (size:192b/24B) */
30728 
30729 typedef struct hwrm_port_qcfg_output {
30730 	/* The specific error status for the command. */
30731 	uint16_t	error_code;
30732 	/* The HWRM command request type. */
30733 	uint16_t	req_type;
30734 	/* The sequence ID from the original command. */
30735 	uint16_t	seq_id;
30736 	/* The length of the response data in number of bytes. */
30737 	uint16_t	resp_len;
30738 	uint32_t	supported;
30739 	/*
30740 	 * If set to '1', then this bit indicates that TX rate limit
30741 	 * could be configured via hwrm_port_cfg command.
30742 	 */
30743 	#define HWRM_PORT_QCFG_OUTPUT_SUPPORTED_TX_RATE_LIMIT	UINT32_C(0x1)
30744 	uint32_t	enabled;
30745 	/*
30746 	 * If set to '1', then this bit indicates that TX rate limit
30747 	 * is enabled and could be found in tx_rate_limit field.
30748 	 */
30749 	#define HWRM_PORT_QCFG_OUTPUT_ENABLED_TX_RATE_LIMIT	UINT32_C(0x1)
30750 	/*
30751 	 * Current setting of TX rate limit in Mbps.
30752 	 * This field is valid only when tx_rate_limit bit in 'enabled'
30753 	 * field is '1'.
30754 	 */
30755 	uint32_t	tx_rate_limit;
30756 	uint8_t	unused_0[3];
30757 	/*
30758 	 * This field is used in Output records to indicate that the output
30759 	 * is completely written to RAM.  This field should be read as '1'
30760 	 * to indicate that the output has been completely written.
30761 	 * When writing a command completion or response to an internal processor,
30762 	 * the order of writes has to be such that this field is written last.
30763 	 */
30764 	uint8_t	valid;
30765 } hwrm_port_qcfg_output_t, *phwrm_port_qcfg_output_t;
30766 
30767 /***********************
30768  * hwrm_queue_qportcfg *
30769  ***********************/
30770 
30771 
30772 /* hwrm_queue_qportcfg_input (size:192b/24B) */
30773 
30774 typedef struct hwrm_queue_qportcfg_input {
30775 	/* The HWRM command request type. */
30776 	uint16_t	req_type;
30777 	/*
30778 	 * The completion ring to send the completion event on. This should
30779 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30780 	 */
30781 	uint16_t	cmpl_ring;
30782 	/*
30783 	 * The sequence ID is used by the driver for tracking multiple
30784 	 * commands. This ID is treated as opaque data by the firmware and
30785 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30786 	 */
30787 	uint16_t	seq_id;
30788 	/*
30789 	 * The target ID of the command:
30790 	 * * 0x0-0xFFF8 - The function ID
30791 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30792 	 * * 0xFFFD - Reserved for user-space HWRM interface
30793 	 * * 0xFFFF - HWRM
30794 	 */
30795 	uint16_t	target_id;
30796 	/*
30797 	 * A physical address pointer pointing to a host buffer that the
30798 	 * command's response data will be written. This can be either a host
30799 	 * physical address (HPA) or a guest physical address (GPA) and must
30800 	 * point to a physically contiguous block of memory.
30801 	 */
30802 	uint64_t	resp_addr;
30803 	uint32_t	flags;
30804 	/*
30805 	 * Enumeration denoting the RX, TX type of the resource.
30806 	 * This enumeration is used for resources that are similar for both
30807 	 * TX and RX paths of the chip.
30808 	 */
30809 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
30810 	/* tx path */
30811 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
30812 	/* rx path */
30813 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
30814 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
30815 	/*
30816 	 * Port ID of port for which the queue configuration is being
30817 	 * queried. This field is only required when sent by IPC.
30818 	 */
30819 	uint16_t	port_id;
30820 	/*
30821 	 * Drivers will set this capability when it can use
30822 	 * queue_idx_service_profile to map the queues to application.
30823 	 */
30824 	uint8_t	drv_qmap_cap;
30825 	/* disabled */
30826 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
30827 	/* enabled */
30828 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
30829 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST	HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
30830 	uint8_t	unused_0;
30831 } hwrm_queue_qportcfg_input_t, *phwrm_queue_qportcfg_input_t;
30832 
30833 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
30834 
30835 typedef struct hwrm_queue_qportcfg_output {
30836 	/* The specific error status for the command. */
30837 	uint16_t	error_code;
30838 	/* The HWRM command request type. */
30839 	uint16_t	req_type;
30840 	/* The sequence ID from the original command. */
30841 	uint16_t	seq_id;
30842 	/* The length of the response data in number of bytes. */
30843 	uint16_t	resp_len;
30844 	/*
30845 	 * The maximum number of queues that can be configured on this
30846 	 * port.
30847 	 * Valid values range from 1 through 8.
30848 	 */
30849 	uint8_t	max_configurable_queues;
30850 	/*
30851 	 * The maximum number of lossless queues that can be configured
30852 	 * on this port.
30853 	 * Valid values range from 0 through 8.
30854 	 */
30855 	uint8_t	max_configurable_lossless_queues;
30856 	/*
30857 	 * Bitmask indicating which queues can be configured by the
30858 	 * hwrm_queue_cfg command.
30859 	 *
30860 	 * Each bit represents a specific queue where bit 0 represents
30861 	 * queue 0 and bit 7 represents queue 7.
30862 	 * # A value of 0 indicates that the queue is not configurable
30863 	 * by the hwrm_queue_cfg command.
30864 	 * # A value of 1 indicates that the queue is configurable.
30865 	 * # A hwrm_queue_cfg command shall return error when trying to
30866 	 * configure a queue not configurable.
30867 	 */
30868 	uint8_t	queue_cfg_allowed;
30869 	/* Information about queue configuration. */
30870 	uint8_t	queue_cfg_info;
30871 	/*
30872 	 * If this flag is set to '1', then the queues are
30873 	 * configured asymmetrically on TX and RX sides.
30874 	 * If this flag is set to '0', then the queues are
30875 	 * configured symmetrically on TX and RX sides. For
30876 	 * symmetric configuration, the queue configuration
30877 	 * including queue ids and service profiles on the
30878 	 * TX side is the same as the corresponding queue
30879 	 * configuration on the RX side.
30880 	 */
30881 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG		UINT32_C(0x1)
30882 	/*
30883 	 * If this flag is set to '1', then service_profile will carry
30884 	 * either lossy/lossless type and the new service_profile_type
30885 	 * field will be used to determine if the queue is for L2/ROCE/CNP.
30886 	 */
30887 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_USE_PROFILE_TYPE	UINT32_C(0x2)
30888 	/*
30889 	 * Bitmask indicating which queues can be configured by the
30890 	 * hwrm_queue_pfcenable_cfg command.
30891 	 *
30892 	 * Each bit represents a specific priority where bit 0 represents
30893 	 * priority 0 and bit 7 represents priority 7.
30894 	 * # A value of 0 indicates that the priority is not configurable by
30895 	 * the hwrm_queue_pfcenable_cfg command.
30896 	 * # A value of 1 indicates that the priority is configurable.
30897 	 * # A hwrm_queue_pfcenable_cfg command shall return error when
30898 	 * trying to configure a priority that is not configurable.
30899 	 */
30900 	uint8_t	queue_pfcenable_cfg_allowed;
30901 	/*
30902 	 * Bitmask indicating which queues can be configured by the
30903 	 * hwrm_queue_pri2cos_cfg command.
30904 	 *
30905 	 * Each bit represents a specific queue where bit 0 represents
30906 	 * queue 0 and bit 7 represents queue 7.
30907 	 * # A value of 0 indicates that the queue is not configurable
30908 	 * by the hwrm_queue_pri2cos_cfg command.
30909 	 * # A value of 1 indicates that the queue is configurable.
30910 	 * # A hwrm_queue_pri2cos_cfg command shall return error when
30911 	 * trying to configure a queue that is not configurable.
30912 	 */
30913 	uint8_t	queue_pri2cos_cfg_allowed;
30914 	/*
30915 	 * Bitmask indicating which queues can be configured by the
30916 	 * hwrm_queue_pri2cos_cfg command.
30917 	 *
30918 	 * Each bit represents a specific queue where bit 0 represents
30919 	 * queue 0 and bit 7 represents queue 7.
30920 	 * # A value of 0 indicates that the queue is not configurable
30921 	 * by the hwrm_queue_pri2cos_cfg command.
30922 	 * # A value of 1 indicates that the queue is configurable.
30923 	 * # A hwrm_queue_pri2cos_cfg command shall return error when
30924 	 * trying to configure a queue not configurable.
30925 	 */
30926 	uint8_t	queue_cos2bw_cfg_allowed;
30927 	/*
30928 	 * ID of CoS Queue 0.
30929 	 * FF - Invalid id
30930 	 *
30931 	 * # This ID can be used on any subsequent call to an hwrm command
30932 	 * that takes a queue id.
30933 	 * # IDs must always be queried by this command before any use
30934 	 * by the driver or software.
30935 	 * # The CoS queue index is obtained by applying modulo 10 to the
30936 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
30937 	 * The CoS queue index is used to reference port statistics for the
30938 	 * CoS queue.
30939 	 * # A value of 0xff indicates that the queue is not available.
30940 	 * # Available queues may not be in sequential order.
30941 	 */
30942 	uint8_t	queue_id0;
30943 	/* This value specifies service profile kind for CoS queue */
30944 	uint8_t	queue_id0_service_profile;
30945 	/* Lossy (best-effort) */
30946 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
30947 	/* Lossless */
30948 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
30949 	/* Lossless RoCE (deprecated) */
30950 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
30951 	/* Lossy RoCE CNP (deprecated) */
30952 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
30953 	/* Lossless NIC (deprecated) */
30954 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
30955 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
30956 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
30957 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
30958 	/*
30959 	 * ID of CoS Queue 1.
30960 	 * FF - Invalid id
30961 	 *
30962 	 * # This ID can be used on any subsequent call to an hwrm command
30963 	 * that takes a queue id.
30964 	 * # IDs must always be queried by this command before any use
30965 	 * by the driver or software.
30966 	 * # The CoS queue index is obtained by applying modulo 10 to the
30967 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
30968 	 * The CoS queue index is used to reference port statistics for the
30969 	 * CoS queue.
30970 	 * # A value of 0xff indicates that the queue is not available.
30971 	 * # Available queues may not be in sequential order.
30972 	 */
30973 	uint8_t	queue_id1;
30974 	/* This value specifies service profile kind for CoS queue */
30975 	uint8_t	queue_id1_service_profile;
30976 	/* Lossy (best-effort) */
30977 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
30978 	/* Lossless */
30979 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
30980 	/* Lossless RoCE (deprecated) */
30981 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
30982 	/* Lossy RoCE CNP (deprecated) */
30983 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
30984 	/* Lossless NIC (deprecated) */
30985 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
30986 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
30987 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
30988 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
30989 	/*
30990 	 * ID of CoS Queue 2.
30991 	 * FF - Invalid id
30992 	 *
30993 	 * # This ID can be used on any subsequent call to an hwrm command
30994 	 * that takes a queue id.
30995 	 * # IDs must always be queried by this command before any use
30996 	 * by the driver or software.
30997 	 * # The CoS queue index is obtained by applying modulo 10 to the
30998 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
30999 	 * The CoS queue index is used to reference port statistics for the
31000 	 * CoS queue.
31001 	 * # A value of 0xff indicates that the queue is not available.
31002 	 * # Available queues may not be in sequential order.
31003 	 */
31004 	uint8_t	queue_id2;
31005 	/* This value specifies service profile kind for CoS queue */
31006 	uint8_t	queue_id2_service_profile;
31007 	/* Lossy (best-effort) */
31008 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31009 	/* Lossless */
31010 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31011 	/* Lossless RoCE (deprecated) */
31012 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31013 	/* Lossy RoCE CNP (deprecated) */
31014 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31015 	/* Lossless NIC (deprecated) */
31016 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31017 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31018 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31019 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
31020 	/*
31021 	 * ID of CoS Queue 3.
31022 	 * FF - Invalid id
31023 	 *
31024 	 * # This ID can be used on any subsequent call to an hwrm command
31025 	 * that takes a queue id.
31026 	 * # IDs must always be queried by this command before any use
31027 	 * by the driver or software.
31028 	 * # The CoS queue index is obtained by applying modulo 10 to the
31029 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31030 	 * The CoS queue index is used to reference port statistics for the
31031 	 * CoS queue.
31032 	 * # A value of 0xff indicates that the queue is not available.
31033 	 * # Available queues may not be in sequential order.
31034 	 */
31035 	uint8_t	queue_id3;
31036 	/* This value specifies service profile kind for CoS queue */
31037 	uint8_t	queue_id3_service_profile;
31038 	/* Lossy (best-effort) */
31039 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31040 	/* Lossless */
31041 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31042 	/* Lossless RoCE (deprecated) */
31043 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31044 	/* Lossy RoCE CNP (deprecated) */
31045 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31046 	/* Lossless NIC (deprecated) */
31047 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31048 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31049 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31050 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
31051 	/*
31052 	 * ID of CoS Queue 4.
31053 	 * FF - Invalid id
31054 	 *
31055 	 * # This ID can be used on any subsequent call to an hwrm command
31056 	 * that takes a queue id.
31057 	 * # IDs must always be queried by this command before any use
31058 	 * by the driver or software.
31059 	 * # The CoS queue index is obtained by applying modulo 10 to the
31060 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31061 	 * The CoS queue index is used to reference port statistics for the
31062 	 * CoS queue.
31063 	 * # A value of 0xff indicates that the queue is not available.
31064 	 * # Available queues may not be in sequential order.
31065 	 */
31066 	uint8_t	queue_id4;
31067 	/* This value specifies service profile kind for CoS queue */
31068 	uint8_t	queue_id4_service_profile;
31069 	/* Lossy (best-effort) */
31070 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31071 	/* Lossless */
31072 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31073 	/* Lossless RoCE (deprecated) */
31074 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31075 	/* Lossy RoCE CNP (deprecated) */
31076 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31077 	/* Lossless NIC (deprecated) */
31078 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31079 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31080 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31081 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
31082 	/*
31083 	 * ID of CoS Queue 5.
31084 	 * FF - Invalid id
31085 	 *
31086 	 * # This ID can be used on any subsequent call to an hwrm command
31087 	 * that takes a queue id.
31088 	 * # IDs must always be queried by this command before any use
31089 	 * by the driver or software.
31090 	 * # The CoS queue index is obtained by applying modulo 10 to the
31091 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31092 	 * The CoS queue index is used to reference port statistics for the
31093 	 * CoS queue.
31094 	 * # A value of 0xff indicates that the queue is not available.
31095 	 * # Available queues may not be in sequential order.
31096 	 */
31097 	uint8_t	queue_id5;
31098 	/* This value specifies service profile kind for CoS queue */
31099 	uint8_t	queue_id5_service_profile;
31100 	/* Lossy (best-effort) */
31101 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31102 	/* Lossless */
31103 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31104 	/* Lossless RoCE (deprecated) */
31105 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31106 	/* Lossy RoCE CNP (deprecated) */
31107 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31108 	/* Lossless NIC (deprecated) */
31109 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31110 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31111 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31112 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
31113 	/*
31114 	 * ID of CoS Queue 6.
31115 	 * FF - Invalid id
31116 	 *
31117 	 * # This ID can be used on any subsequent call to an hwrm command
31118 	 * that takes a queue id.
31119 	 * # IDs must always be queried by this command before any use
31120 	 * by the driver or software.
31121 	 * # The CoS queue index is obtained by applying modulo 10 to the
31122 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31123 	 * The CoS queue index is used to reference port statistics for the
31124 	 * CoS queue.
31125 	 * # A value of 0xff indicates that the queue is not available.
31126 	 * # Available queues may not be in sequential order.
31127 	 */
31128 	uint8_t	queue_id6;
31129 	/* This value specifies service profile kind for CoS queue */
31130 	uint8_t	queue_id6_service_profile;
31131 	/* Lossy (best-effort) */
31132 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31133 	/* Lossless */
31134 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31135 	/* Lossless RoCE (deprecated) */
31136 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31137 	/* Lossy RoCE CNP (deprecated) */
31138 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31139 	/* Lossless NIC (deprecated) */
31140 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31141 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31142 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31143 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
31144 	/*
31145 	 * ID of CoS Queue 7.
31146 	 * FF - Invalid id
31147 	 *
31148 	 * # This ID can be used on any subsequent call to an hwrm command
31149 	 * that takes a queue id.
31150 	 * # IDs must always be queried by this command before any use
31151 	 * by the driver or software.
31152 	 * # The CoS queue index is obtained by applying modulo 10 to the
31153 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31154 	 * The CoS queue index is used to reference port statistics for the
31155 	 * CoS queue.
31156 	 * # A value of 0xff indicates that the queue is not available.
31157 	 * # Available queues may not be in sequential order.
31158 	 */
31159 	uint8_t	queue_id7;
31160 	/* This value specifies service profile kind for CoS queue */
31161 	uint8_t	queue_id7_service_profile;
31162 	/* Lossy (best-effort) */
31163 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31164 	/* Lossless */
31165 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
31166 	/* Lossless RoCE (deprecated) */
31167 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
31168 	/* Lossy RoCE CNP (deprecated) */
31169 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
31170 	/* Lossless NIC (deprecated) */
31171 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
31172 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31173 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
31174 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
31175 	/*
31176 	 * This value specifies traffic type for the service profile. We can
31177 	 * have a TC mapped to multiple traffic types. For example shared
31178 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31179 	 * A value of zero is considered as invalid.
31180 	 */
31181 	uint8_t	queue_id0_service_profile_type;
31182 	/* Recommended to be used for RoCE traffic only. */
31183 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31184 	/* Recommended to be used for NIC/L2 traffic only. */
31185 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31186 	/* Recommended to be used for CNP traffic only. */
31187 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31188 	/*
31189 	 * Up to 16 bytes of null padded ASCII string describing this queue.
31190 	 * The queue name includes a CoS queue index and, in some cases, text
31191 	 * that distinguishes the queue from other queues in the group.
31192 	 */
31193 	char	qid0_name[16];
31194 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31195 	char	qid1_name[16];
31196 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31197 	char	qid2_name[16];
31198 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31199 	char	qid3_name[16];
31200 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31201 	char	qid4_name[16];
31202 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31203 	char	qid5_name[16];
31204 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31205 	char	qid6_name[16];
31206 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
31207 	char	qid7_name[16];
31208 	/*
31209 	 * This value specifies traffic type for the service profile. We can
31210 	 * have a TC mapped to multiple traffic types. For example shared
31211 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31212 	 * A value of zero is considered as invalid.
31213 	 */
31214 	uint8_t	queue_id1_service_profile_type;
31215 	/* Recommended to be used for RoCE traffic only. */
31216 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31217 	/* Recommended to be used for NIC/L2 traffic only. */
31218 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31219 	/* Recommended to be used for CNP traffic only. */
31220 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31221 	/*
31222 	 * This value specifies traffic type for the service profile. We can
31223 	 * have a TC mapped to multiple traffic types. For example shared
31224 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31225 	 * A value of zero is considered as invalid.
31226 	 */
31227 	uint8_t	queue_id2_service_profile_type;
31228 	/* Recommended to be used for RoCE traffic only. */
31229 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31230 	/* Recommended to be used for NIC/L2 traffic only. */
31231 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31232 	/* Recommended to be used for CNP traffic only. */
31233 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31234 	/*
31235 	 * This value specifies traffic type for the service profile. We can
31236 	 * have a TC mapped to multiple traffic types. For example shared
31237 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31238 	 * A value of zero is considered as invalid.
31239 	 */
31240 	uint8_t	queue_id3_service_profile_type;
31241 	/* Recommended to be used for RoCE traffic only. */
31242 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31243 	/* Recommended to be used for NIC/L2 traffic only. */
31244 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31245 	/* Recommended to be used for CNP traffic only. */
31246 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31247 	/*
31248 	 * This value specifies traffic type for the service profile. We can
31249 	 * have a TC mapped to multiple traffic types. For example shared
31250 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31251 	 * A value of zero is considered as invalid.
31252 	 */
31253 	uint8_t	queue_id4_service_profile_type;
31254 	/* Recommended to be used for RoCE traffic only. */
31255 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31256 	/* Recommended to be used for NIC/L2 traffic only. */
31257 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31258 	/* Recommended to be used for CNP traffic only. */
31259 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31260 	/*
31261 	 * This value specifies traffic type for the service profile. We can
31262 	 * have a TC mapped to multiple traffic types. For example shared
31263 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31264 	 * A value of zero is considered as invalid.
31265 	 */
31266 	uint8_t	queue_id5_service_profile_type;
31267 	/* Recommended to be used for RoCE traffic only. */
31268 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31269 	/* Recommended to be used for NIC/L2 traffic only. */
31270 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31271 	/* Recommended to be used for CNP traffic only. */
31272 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31273 	/*
31274 	 * This value specifies traffic type for the service profile. We can
31275 	 * have a TC mapped to multiple traffic types. For example shared
31276 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31277 	 * A value of zero is considered as invalid.
31278 	 */
31279 	uint8_t	queue_id6_service_profile_type;
31280 	/* Recommended to be used for RoCE traffic only. */
31281 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31282 	/* Recommended to be used for NIC/L2 traffic only. */
31283 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31284 	/* Recommended to be used for CNP traffic only. */
31285 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31286 	/*
31287 	 * This value specifies traffic type for the service profile. We can
31288 	 * have a TC mapped to multiple traffic types. For example shared
31289 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31290 	 * A value of zero is considered as invalid.
31291 	 */
31292 	uint8_t	queue_id7_service_profile_type;
31293 	/* Recommended to be used for RoCE traffic only. */
31294 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
31295 	/* Recommended to be used for NIC/L2 traffic only. */
31296 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
31297 	/* Recommended to be used for CNP traffic only. */
31298 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
31299 	/*
31300 	 * This field is used in Output records to indicate that the output
31301 	 * is completely written to RAM. This field should be read as '1'
31302 	 * to indicate that the output has been completely written.
31303 	 * When writing a command completion or response to an internal processor,
31304 	 * the order of writes has to be such that this field is written last.
31305 	 */
31306 	uint8_t	valid;
31307 } hwrm_queue_qportcfg_output_t, *phwrm_queue_qportcfg_output_t;
31308 
31309 /*******************
31310  * hwrm_queue_qcfg *
31311  *******************/
31312 
31313 
31314 /* hwrm_queue_qcfg_input (size:192b/24B) */
31315 
31316 typedef struct hwrm_queue_qcfg_input {
31317 	/* The HWRM command request type. */
31318 	uint16_t	req_type;
31319 	/*
31320 	 * The completion ring to send the completion event on. This should
31321 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31322 	 */
31323 	uint16_t	cmpl_ring;
31324 	/*
31325 	 * The sequence ID is used by the driver for tracking multiple
31326 	 * commands. This ID is treated as opaque data by the firmware and
31327 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31328 	 */
31329 	uint16_t	seq_id;
31330 	/*
31331 	 * The target ID of the command:
31332 	 * * 0x0-0xFFF8 - The function ID
31333 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31334 	 * * 0xFFFD - Reserved for user-space HWRM interface
31335 	 * * 0xFFFF - HWRM
31336 	 */
31337 	uint16_t	target_id;
31338 	/*
31339 	 * A physical address pointer pointing to a host buffer that the
31340 	 * command's response data will be written. This can be either a host
31341 	 * physical address (HPA) or a guest physical address (GPA) and must
31342 	 * point to a physically contiguous block of memory.
31343 	 */
31344 	uint64_t	resp_addr;
31345 	uint32_t	flags;
31346 	/*
31347 	 * Enumeration denoting the RX, TX type of the resource.
31348 	 * This enumeration is used for resources that are similar for both
31349 	 * TX and RX paths of the chip.
31350 	 */
31351 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
31352 	/* tx path */
31353 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
31354 	/* rx path */
31355 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
31356 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
31357 	/* Queue ID of the queue. */
31358 	uint32_t	queue_id;
31359 } hwrm_queue_qcfg_input_t, *phwrm_queue_qcfg_input_t;
31360 
31361 /* hwrm_queue_qcfg_output (size:128b/16B) */
31362 
31363 typedef struct hwrm_queue_qcfg_output {
31364 	/* The specific error status for the command. */
31365 	uint16_t	error_code;
31366 	/* The HWRM command request type. */
31367 	uint16_t	req_type;
31368 	/* The sequence ID from the original command. */
31369 	uint16_t	seq_id;
31370 	/* The length of the response data in number of bytes. */
31371 	uint16_t	resp_len;
31372 	/*
31373 	 * This value is the estimate packet length used in the
31374 	 * TX arbiter.
31375 	 */
31376 	uint32_t	queue_len;
31377 	/* This value is applicable to CoS queues only. */
31378 	uint8_t	service_profile;
31379 	/* Lossy (best-effort) */
31380 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31381 	/* Lossless */
31382 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
31383 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31384 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
31385 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST	HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
31386 	/* Information about queue configuration. */
31387 	uint8_t	queue_cfg_info;
31388 	/*
31389 	 * If this flag is set to '1', then the queue is
31390 	 * configured asymmetrically on TX and RX sides.
31391 	 * If this flag is set to '0', then this queue is
31392 	 * configured symmetrically on TX and RX sides.
31393 	 */
31394 	#define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG	UINT32_C(0x1)
31395 	uint8_t	unused_0;
31396 	/*
31397 	 * This field is used in Output records to indicate that the output
31398 	 * is completely written to RAM. This field should be read as '1'
31399 	 * to indicate that the output has been completely written.
31400 	 * When writing a command completion or response to an internal processor,
31401 	 * the order of writes has to be such that this field is written last.
31402 	 */
31403 	uint8_t	valid;
31404 } hwrm_queue_qcfg_output_t, *phwrm_queue_qcfg_output_t;
31405 
31406 /******************
31407  * hwrm_queue_cfg *
31408  ******************/
31409 
31410 
31411 /* hwrm_queue_cfg_input (size:320b/40B) */
31412 
31413 typedef struct hwrm_queue_cfg_input {
31414 	/* The HWRM command request type. */
31415 	uint16_t	req_type;
31416 	/*
31417 	 * The completion ring to send the completion event on. This should
31418 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31419 	 */
31420 	uint16_t	cmpl_ring;
31421 	/*
31422 	 * The sequence ID is used by the driver for tracking multiple
31423 	 * commands. This ID is treated as opaque data by the firmware and
31424 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31425 	 */
31426 	uint16_t	seq_id;
31427 	/*
31428 	 * The target ID of the command:
31429 	 * * 0x0-0xFFF8 - The function ID
31430 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31431 	 * * 0xFFFD - Reserved for user-space HWRM interface
31432 	 * * 0xFFFF - HWRM
31433 	 */
31434 	uint16_t	target_id;
31435 	/*
31436 	 * A physical address pointer pointing to a host buffer that the
31437 	 * command's response data will be written. This can be either a host
31438 	 * physical address (HPA) or a guest physical address (GPA) and must
31439 	 * point to a physically contiguous block of memory.
31440 	 */
31441 	uint64_t	resp_addr;
31442 	uint32_t	flags;
31443 	/*
31444 	 * Enumeration denoting the RX, TX, or both directions applicable to the resource.
31445 	 * This enumeration is used for resources that are similar for both
31446 	 * TX and RX paths of the chip.
31447 	 */
31448 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
31449 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
31450 	/* tx path */
31451 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
31452 	/* rx path */
31453 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
31454 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
31455 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
31456 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
31457 	uint32_t	enables;
31458 	/*
31459 	 * This bit must be '1' for the dflt_len field to be
31460 	 * configured.
31461 	 */
31462 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN		UINT32_C(0x1)
31463 	/*
31464 	 * This bit must be '1' for the service_profile field to be
31465 	 * configured.
31466 	 */
31467 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE	UINT32_C(0x2)
31468 	/* Queue ID of queue that is to be configured by this function. */
31469 	uint32_t	queue_id;
31470 	/*
31471 	 * This value is a the estimate packet length used in the
31472 	 * TX arbiter.
31473 	 * Set to 0xFF... (All Fs) to not adjust this value.
31474 	 */
31475 	uint32_t	dflt_len;
31476 	/* This value is applicable to CoS queues only. */
31477 	uint8_t	service_profile;
31478 	/* Lossy (best-effort) */
31479 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
31480 	/* Lossless */
31481 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
31482 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
31483 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
31484 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST	HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
31485 	uint8_t	unused_0[7];
31486 } hwrm_queue_cfg_input_t, *phwrm_queue_cfg_input_t;
31487 
31488 /* hwrm_queue_cfg_output (size:128b/16B) */
31489 
31490 typedef struct hwrm_queue_cfg_output {
31491 	/* The specific error status for the command. */
31492 	uint16_t	error_code;
31493 	/* The HWRM command request type. */
31494 	uint16_t	req_type;
31495 	/* The sequence ID from the original command. */
31496 	uint16_t	seq_id;
31497 	/* The length of the response data in number of bytes. */
31498 	uint16_t	resp_len;
31499 	uint8_t	unused_0[7];
31500 	/*
31501 	 * This field is used in Output records to indicate that the output
31502 	 * is completely written to RAM. This field should be read as '1'
31503 	 * to indicate that the output has been completely written.
31504 	 * When writing a command completion or response to an internal processor,
31505 	 * the order of writes has to be such that this field is written last.
31506 	 */
31507 	uint8_t	valid;
31508 } hwrm_queue_cfg_output_t, *phwrm_queue_cfg_output_t;
31509 
31510 /*****************************
31511  * hwrm_queue_pfcenable_qcfg *
31512  *****************************/
31513 
31514 
31515 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
31516 
31517 typedef struct hwrm_queue_pfcenable_qcfg_input {
31518 	/* The HWRM command request type. */
31519 	uint16_t	req_type;
31520 	/*
31521 	 * The completion ring to send the completion event on. This should
31522 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31523 	 */
31524 	uint16_t	cmpl_ring;
31525 	/*
31526 	 * The sequence ID is used by the driver for tracking multiple
31527 	 * commands. This ID is treated as opaque data by the firmware and
31528 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31529 	 */
31530 	uint16_t	seq_id;
31531 	/*
31532 	 * The target ID of the command:
31533 	 * * 0x0-0xFFF8 - The function ID
31534 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31535 	 * * 0xFFFD - Reserved for user-space HWRM interface
31536 	 * * 0xFFFF - HWRM
31537 	 */
31538 	uint16_t	target_id;
31539 	/*
31540 	 * A physical address pointer pointing to a host buffer that the
31541 	 * command's response data will be written. This can be either a host
31542 	 * physical address (HPA) or a guest physical address (GPA) and must
31543 	 * point to a physically contiguous block of memory.
31544 	 */
31545 	uint64_t	resp_addr;
31546 	/*
31547 	 * Port ID of port for which the table is being configured.
31548 	 * The HWRM needs to check whether this function is allowed
31549 	 * to configure pri2cos mapping on this port.
31550 	 */
31551 	uint16_t	port_id;
31552 	uint8_t	unused_0[6];
31553 } hwrm_queue_pfcenable_qcfg_input_t, *phwrm_queue_pfcenable_qcfg_input_t;
31554 
31555 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
31556 
31557 typedef struct hwrm_queue_pfcenable_qcfg_output {
31558 	/* The specific error status for the command. */
31559 	uint16_t	error_code;
31560 	/* The HWRM command request type. */
31561 	uint16_t	req_type;
31562 	/* The sequence ID from the original command. */
31563 	uint16_t	seq_id;
31564 	/* The length of the response data in number of bytes. */
31565 	uint16_t	resp_len;
31566 	uint32_t	flags;
31567 	/* If set to 1, then PFC is enabled on PRI 0. */
31568 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED		UINT32_C(0x1)
31569 	/* If set to 1, then PFC is enabled on PRI 1. */
31570 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED		UINT32_C(0x2)
31571 	/* If set to 1, then PFC is enabled on PRI 2. */
31572 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED		UINT32_C(0x4)
31573 	/* If set to 1, then PFC is enabled on PRI 3. */
31574 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED		UINT32_C(0x8)
31575 	/* If set to 1, then PFC is enabled on PRI 4. */
31576 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED		UINT32_C(0x10)
31577 	/* If set to 1, then PFC is enabled on PRI 5. */
31578 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED		UINT32_C(0x20)
31579 	/* If set to 1, then PFC is enabled on PRI 6. */
31580 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED		UINT32_C(0x40)
31581 	/* If set to 1, then PFC is enabled on PRI 7. */
31582 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED		UINT32_C(0x80)
31583 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
31584 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED	UINT32_C(0x100)
31585 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
31586 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED	UINT32_C(0x200)
31587 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
31588 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED	UINT32_C(0x400)
31589 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
31590 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED	UINT32_C(0x800)
31591 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
31592 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED	UINT32_C(0x1000)
31593 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
31594 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED	UINT32_C(0x2000)
31595 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
31596 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED	UINT32_C(0x4000)
31597 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
31598 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED	UINT32_C(0x8000)
31599 	uint8_t	unused_0[3];
31600 	/*
31601 	 * This field is used in Output records to indicate that the output
31602 	 * is completely written to RAM. This field should be read as '1'
31603 	 * to indicate that the output has been completely written.
31604 	 * When writing a command completion or response to an internal processor,
31605 	 * the order of writes has to be such that this field is written last.
31606 	 */
31607 	uint8_t	valid;
31608 } hwrm_queue_pfcenable_qcfg_output_t, *phwrm_queue_pfcenable_qcfg_output_t;
31609 
31610 /****************************
31611  * hwrm_queue_pfcenable_cfg *
31612  ****************************/
31613 
31614 
31615 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
31616 
31617 typedef struct hwrm_queue_pfcenable_cfg_input {
31618 	/* The HWRM command request type. */
31619 	uint16_t	req_type;
31620 	/*
31621 	 * The completion ring to send the completion event on. This should
31622 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31623 	 */
31624 	uint16_t	cmpl_ring;
31625 	/*
31626 	 * The sequence ID is used by the driver for tracking multiple
31627 	 * commands. This ID is treated as opaque data by the firmware and
31628 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31629 	 */
31630 	uint16_t	seq_id;
31631 	/*
31632 	 * The target ID of the command:
31633 	 * * 0x0-0xFFF8 - The function ID
31634 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31635 	 * * 0xFFFD - Reserved for user-space HWRM interface
31636 	 * * 0xFFFF - HWRM
31637 	 */
31638 	uint16_t	target_id;
31639 	/*
31640 	 * A physical address pointer pointing to a host buffer that the
31641 	 * command's response data will be written. This can be either a host
31642 	 * physical address (HPA) or a guest physical address (GPA) and must
31643 	 * point to a physically contiguous block of memory.
31644 	 */
31645 	uint64_t	resp_addr;
31646 	uint32_t	flags;
31647 	/* If set to 1, then PFC is requested to be enabled on PRI 0. */
31648 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED		UINT32_C(0x1)
31649 	/* If set to 1, then PFC is requested to be enabled on PRI 1. */
31650 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED		UINT32_C(0x2)
31651 	/* If set to 1, then PFC is requested to be enabled on PRI 2. */
31652 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED		UINT32_C(0x4)
31653 	/* If set to 1, then PFC is requested to be enabled on PRI 3. */
31654 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED		UINT32_C(0x8)
31655 	/* If set to 1, then PFC is requested to be enabled on PRI 4. */
31656 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED		UINT32_C(0x10)
31657 	/* If set to 1, then PFC is requested to be enabled on PRI 5. */
31658 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED		UINT32_C(0x20)
31659 	/* If set to 1, then PFC is requested to be enabled on PRI 6. */
31660 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED		UINT32_C(0x40)
31661 	/* If set to 1, then PFC is requested to be enabled on PRI 7. */
31662 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED		UINT32_C(0x80)
31663 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
31664 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED	UINT32_C(0x100)
31665 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
31666 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED	UINT32_C(0x200)
31667 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
31668 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED	UINT32_C(0x400)
31669 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
31670 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED	UINT32_C(0x800)
31671 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
31672 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED	UINT32_C(0x1000)
31673 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
31674 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED	UINT32_C(0x2000)
31675 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
31676 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED	UINT32_C(0x4000)
31677 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
31678 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED	UINT32_C(0x8000)
31679 	/*
31680 	 * Port ID of port for which the table is being configured.
31681 	 * The HWRM needs to check whether this function is allowed
31682 	 * to configure pri2cos mapping on this port.
31683 	 */
31684 	uint16_t	port_id;
31685 	uint8_t	unused_0[2];
31686 } hwrm_queue_pfcenable_cfg_input_t, *phwrm_queue_pfcenable_cfg_input_t;
31687 
31688 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
31689 
31690 typedef struct hwrm_queue_pfcenable_cfg_output {
31691 	/* The specific error status for the command. */
31692 	uint16_t	error_code;
31693 	/* The HWRM command request type. */
31694 	uint16_t	req_type;
31695 	/* The sequence ID from the original command. */
31696 	uint16_t	seq_id;
31697 	/* The length of the response data in number of bytes. */
31698 	uint16_t	resp_len;
31699 	uint8_t	unused_0[7];
31700 	/*
31701 	 * This field is used in Output records to indicate that the output
31702 	 * is completely written to RAM. This field should be read as '1'
31703 	 * to indicate that the output has been completely written.
31704 	 * When writing a command completion or response to an internal processor,
31705 	 * the order of writes has to be such that this field is written last.
31706 	 */
31707 	uint8_t	valid;
31708 } hwrm_queue_pfcenable_cfg_output_t, *phwrm_queue_pfcenable_cfg_output_t;
31709 
31710 /***************************
31711  * hwrm_queue_pri2cos_qcfg *
31712  ***************************/
31713 
31714 
31715 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
31716 
31717 typedef struct hwrm_queue_pri2cos_qcfg_input {
31718 	/* The HWRM command request type. */
31719 	uint16_t	req_type;
31720 	/*
31721 	 * The completion ring to send the completion event on. This should
31722 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31723 	 */
31724 	uint16_t	cmpl_ring;
31725 	/*
31726 	 * The sequence ID is used by the driver for tracking multiple
31727 	 * commands. This ID is treated as opaque data by the firmware and
31728 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31729 	 */
31730 	uint16_t	seq_id;
31731 	/*
31732 	 * The target ID of the command:
31733 	 * * 0x0-0xFFF8 - The function ID
31734 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31735 	 * * 0xFFFD - Reserved for user-space HWRM interface
31736 	 * * 0xFFFF - HWRM
31737 	 */
31738 	uint16_t	target_id;
31739 	/*
31740 	 * A physical address pointer pointing to a host buffer that the
31741 	 * command's response data will be written. This can be either a host
31742 	 * physical address (HPA) or a guest physical address (GPA) and must
31743 	 * point to a physically contiguous block of memory.
31744 	 */
31745 	uint64_t	resp_addr;
31746 	uint32_t	flags;
31747 	/*
31748 	 * Enumeration denoting the RX, TX type of the resource.
31749 	 * This enumeration is used for resources that are similar for both
31750 	 * TX and RX paths of the chip.
31751 	 */
31752 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
31753 	/* tx path */
31754 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
31755 	/* rx path */
31756 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
31757 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
31758 	/*
31759 	 * When this bit is set to '0', the query is
31760 	 * for PRI from tunnel headers.
31761 	 * When this bit is set to '1', the query is
31762 	 * for PRI from inner packet headers.
31763 	 */
31764 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN	UINT32_C(0x2)
31765 	/*
31766 	 * Port ID of port for which the table is being configured.
31767 	 * The HWRM needs to check whether this function is allowed
31768 	 * to configure pri2cos mapping on this port.
31769 	 */
31770 	uint8_t	port_id;
31771 	uint8_t	unused_0[3];
31772 } hwrm_queue_pri2cos_qcfg_input_t, *phwrm_queue_pri2cos_qcfg_input_t;
31773 
31774 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
31775 
31776 typedef struct hwrm_queue_pri2cos_qcfg_output {
31777 	/* The specific error status for the command. */
31778 	uint16_t	error_code;
31779 	/* The HWRM command request type. */
31780 	uint16_t	req_type;
31781 	/* The sequence ID from the original command. */
31782 	uint16_t	seq_id;
31783 	/* The length of the response data in number of bytes. */
31784 	uint16_t	resp_len;
31785 	/*
31786 	 * CoS Queue assigned to priority 0. This value can only
31787 	 * be changed before traffic has started.
31788 	 * A value of 0xff indicates that no CoS queue is assigned to the
31789 	 * specified priority.
31790 	 */
31791 	uint8_t	pri0_cos_queue_id;
31792 	/*
31793 	 * CoS Queue assigned to priority 1. This value can only
31794 	 * be changed before traffic has started.
31795 	 * A value of 0xff indicates that no CoS queue is assigned to the
31796 	 * specified priority.
31797 	 */
31798 	uint8_t	pri1_cos_queue_id;
31799 	/*
31800 	 * CoS Queue assigned to priority 2. This value can only
31801 	 * be changed before traffic has started.
31802 	 * A value of 0xff indicates that no CoS queue is assigned to the
31803 	 * specified priority.
31804 	 */
31805 	uint8_t	pri2_cos_queue_id;
31806 	/*
31807 	 * CoS Queue assigned to priority 3. This value can only
31808 	 * be changed before traffic has started.
31809 	 * A value of 0xff indicates that no CoS queue is assigned to the
31810 	 * specified priority.
31811 	 */
31812 	uint8_t	pri3_cos_queue_id;
31813 	/*
31814 	 * CoS Queue assigned to priority 4. This value can only
31815 	 * be changed before traffic has started.
31816 	 * A value of 0xff indicates that no CoS queue is assigned to the
31817 	 * specified priority.
31818 	 */
31819 	uint8_t	pri4_cos_queue_id;
31820 	/*
31821 	 * CoS Queue assigned to priority 5. This value can only
31822 	 * be changed before traffic has started.
31823 	 * A value of 0xff indicates that no CoS queue is assigned to the
31824 	 * specified priority.
31825 	 */
31826 	uint8_t	pri5_cos_queue_id;
31827 	/*
31828 	 * CoS Queue assigned to priority 6. This value can only
31829 	 * be changed before traffic has started.
31830 	 * A value of 0xff indicates that no CoS queue is assigned to the
31831 	 * specified priority.
31832 	 */
31833 	uint8_t	pri6_cos_queue_id;
31834 	/*
31835 	 * CoS Queue assigned to priority 7. This value can only
31836 	 * be changed before traffic has started.
31837 	 * A value of 0xff indicates that no CoS queue is assigned to the
31838 	 * specified priority.
31839 	 */
31840 	uint8_t	pri7_cos_queue_id;
31841 	/* Information about queue configuration. */
31842 	uint8_t	queue_cfg_info;
31843 	/*
31844 	 * If this flag is set to '1', then the PRI to CoS
31845 	 * configuration is asymmetric on TX and RX sides.
31846 	 * If this flag is set to '0', then PRI to CoS configuration
31847 	 * is symmetric on TX and RX sides.
31848 	 */
31849 	#define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG	UINT32_C(0x1)
31850 	uint8_t	unused_0[6];
31851 	/*
31852 	 * This field is used in Output records to indicate that the output
31853 	 * is completely written to RAM. This field should be read as '1'
31854 	 * to indicate that the output has been completely written.
31855 	 * When writing a command completion or response to an internal processor,
31856 	 * the order of writes has to be such that this field is written last.
31857 	 */
31858 	uint8_t	valid;
31859 } hwrm_queue_pri2cos_qcfg_output_t, *phwrm_queue_pri2cos_qcfg_output_t;
31860 
31861 /**************************
31862  * hwrm_queue_pri2cos_cfg *
31863  **************************/
31864 
31865 
31866 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
31867 
31868 typedef struct hwrm_queue_pri2cos_cfg_input {
31869 	/* The HWRM command request type. */
31870 	uint16_t	req_type;
31871 	/*
31872 	 * The completion ring to send the completion event on. This should
31873 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31874 	 */
31875 	uint16_t	cmpl_ring;
31876 	/*
31877 	 * The sequence ID is used by the driver for tracking multiple
31878 	 * commands. This ID is treated as opaque data by the firmware and
31879 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31880 	 */
31881 	uint16_t	seq_id;
31882 	/*
31883 	 * The target ID of the command:
31884 	 * * 0x0-0xFFF8 - The function ID
31885 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31886 	 * * 0xFFFD - Reserved for user-space HWRM interface
31887 	 * * 0xFFFF - HWRM
31888 	 */
31889 	uint16_t	target_id;
31890 	/*
31891 	 * A physical address pointer pointing to a host buffer that the
31892 	 * command's response data will be written. This can be either a host
31893 	 * physical address (HPA) or a guest physical address (GPA) and must
31894 	 * point to a physically contiguous block of memory.
31895 	 */
31896 	uint64_t	resp_addr;
31897 	uint32_t	flags;
31898 	/*
31899 	 * Enumeration denoting the RX, TX, or both directions applicable to the resource.
31900 	 * This enumeration is used for resources that are similar for both
31901 	 * TX and RX paths of the chip.
31902 	 */
31903 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
31904 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
31905 	/* tx path */
31906 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
31907 	/* rx path */
31908 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
31909 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
31910 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
31911 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
31912 	/*
31913 	 * When this bit is set to '0', the mapping is requested
31914 	 * for PRI from tunnel headers.
31915 	 * When this bit is set to '1', the mapping is requested
31916 	 * for PRI from inner packet headers.
31917 	 */
31918 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN	UINT32_C(0x4)
31919 	uint32_t	enables;
31920 	/*
31921 	 * This bit must be '1' for the pri0_cos_queue_id field to be
31922 	 * configured.
31923 	 */
31924 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID	UINT32_C(0x1)
31925 	/*
31926 	 * This bit must be '1' for the pri1_cos_queue_id field to be
31927 	 * configured.
31928 	 */
31929 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID	UINT32_C(0x2)
31930 	/*
31931 	 * This bit must be '1' for the pri2_cos_queue_id field to be
31932 	 * configured.
31933 	 */
31934 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID	UINT32_C(0x4)
31935 	/*
31936 	 * This bit must be '1' for the pri3_cos_queue_id field to be
31937 	 * configured.
31938 	 */
31939 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID	UINT32_C(0x8)
31940 	/*
31941 	 * This bit must be '1' for the pri4_cos_queue_id field to be
31942 	 * configured.
31943 	 */
31944 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID	UINT32_C(0x10)
31945 	/*
31946 	 * This bit must be '1' for the pri5_cos_queue_id field to be
31947 	 * configured.
31948 	 */
31949 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID	UINT32_C(0x20)
31950 	/*
31951 	 * This bit must be '1' for the pri6_cos_queue_id field to be
31952 	 * configured.
31953 	 */
31954 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID	UINT32_C(0x40)
31955 	/*
31956 	 * This bit must be '1' for the pri7_cos_queue_id field to be
31957 	 * configured.
31958 	 */
31959 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID	UINT32_C(0x80)
31960 	/*
31961 	 * Port ID of port for which the table is being configured.
31962 	 * The HWRM needs to check whether this function is allowed
31963 	 * to configure pri2cos mapping on this port.
31964 	 */
31965 	uint8_t	port_id;
31966 	/*
31967 	 * CoS Queue assigned to priority 0. This value can only
31968 	 * be changed before traffic has started.
31969 	 */
31970 	uint8_t	pri0_cos_queue_id;
31971 	/*
31972 	 * CoS Queue assigned to priority 1. This value can only
31973 	 * be changed before traffic has started.
31974 	 */
31975 	uint8_t	pri1_cos_queue_id;
31976 	/*
31977 	 * CoS Queue assigned to priority 2  This value can only
31978 	 * be changed before traffic has started.
31979 	 */
31980 	uint8_t	pri2_cos_queue_id;
31981 	/*
31982 	 * CoS Queue assigned to priority 3. This value can only
31983 	 * be changed before traffic has started.
31984 	 */
31985 	uint8_t	pri3_cos_queue_id;
31986 	/*
31987 	 * CoS Queue assigned to priority 4. This value can only
31988 	 * be changed before traffic has started.
31989 	 */
31990 	uint8_t	pri4_cos_queue_id;
31991 	/*
31992 	 * CoS Queue assigned to priority 5. This value can only
31993 	 * be changed before traffic has started.
31994 	 */
31995 	uint8_t	pri5_cos_queue_id;
31996 	/*
31997 	 * CoS Queue assigned to priority 6. This value can only
31998 	 * be changed before traffic has started.
31999 	 */
32000 	uint8_t	pri6_cos_queue_id;
32001 	/*
32002 	 * CoS Queue assigned to priority 7. This value can only
32003 	 * be changed before traffic has started.
32004 	 */
32005 	uint8_t	pri7_cos_queue_id;
32006 	uint8_t	unused_0[7];
32007 } hwrm_queue_pri2cos_cfg_input_t, *phwrm_queue_pri2cos_cfg_input_t;
32008 
32009 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
32010 
32011 typedef struct hwrm_queue_pri2cos_cfg_output {
32012 	/* The specific error status for the command. */
32013 	uint16_t	error_code;
32014 	/* The HWRM command request type. */
32015 	uint16_t	req_type;
32016 	/* The sequence ID from the original command. */
32017 	uint16_t	seq_id;
32018 	/* The length of the response data in number of bytes. */
32019 	uint16_t	resp_len;
32020 	uint8_t	unused_0[7];
32021 	/*
32022 	 * This field is used in Output records to indicate that the output
32023 	 * is completely written to RAM. This field should be read as '1'
32024 	 * to indicate that the output has been completely written.
32025 	 * When writing a command completion or response to an internal processor,
32026 	 * the order of writes has to be such that this field is written last.
32027 	 */
32028 	uint8_t	valid;
32029 } hwrm_queue_pri2cos_cfg_output_t, *phwrm_queue_pri2cos_cfg_output_t;
32030 
32031 /**************************
32032  * hwrm_queue_cos2bw_qcfg *
32033  **************************/
32034 
32035 
32036 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
32037 
32038 typedef struct hwrm_queue_cos2bw_qcfg_input {
32039 	/* The HWRM command request type. */
32040 	uint16_t	req_type;
32041 	/*
32042 	 * The completion ring to send the completion event on. This should
32043 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
32044 	 */
32045 	uint16_t	cmpl_ring;
32046 	/*
32047 	 * The sequence ID is used by the driver for tracking multiple
32048 	 * commands. This ID is treated as opaque data by the firmware and
32049 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
32050 	 */
32051 	uint16_t	seq_id;
32052 	/*
32053 	 * The target ID of the command:
32054 	 * * 0x0-0xFFF8 - The function ID
32055 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32056 	 * * 0xFFFD - Reserved for user-space HWRM interface
32057 	 * * 0xFFFF - HWRM
32058 	 */
32059 	uint16_t	target_id;
32060 	/*
32061 	 * A physical address pointer pointing to a host buffer that the
32062 	 * command's response data will be written. This can be either a host
32063 	 * physical address (HPA) or a guest physical address (GPA) and must
32064 	 * point to a physically contiguous block of memory.
32065 	 */
32066 	uint64_t	resp_addr;
32067 	/*
32068 	 * Port ID of port for which the table is being configured.
32069 	 * The HWRM needs to check whether this function is allowed
32070 	 * to configure TC BW assignment on this port.
32071 	 */
32072 	uint16_t	port_id;
32073 	uint8_t	unused_0[6];
32074 } hwrm_queue_cos2bw_qcfg_input_t, *phwrm_queue_cos2bw_qcfg_input_t;
32075 
32076 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
32077 
32078 typedef struct hwrm_queue_cos2bw_qcfg_output {
32079 	/* The specific error status for the command. */
32080 	uint16_t	error_code;
32081 	/* The HWRM command request type. */
32082 	uint16_t	req_type;
32083 	/* The sequence ID from the original command. */
32084 	uint16_t	seq_id;
32085 	/* The length of the response data in number of bytes. */
32086 	uint16_t	resp_len;
32087 	/* ID of CoS Queue 0. */
32088 	uint8_t	queue_id0;
32089 	uint8_t	unused_0;
32090 	uint16_t	unused_1;
32091 	/*
32092 	 * Minimum BW allocated to CoS Queue.
32093 	 * The HWRM will translate this value into byte counter and
32094 	 * time interval used for this COS inside the device.
32095 	 */
32096 	uint32_t	queue_id0_min_bw;
32097 	/* The bandwidth value. */
32098 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32099 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT		0
32100 	/* The granularity of the value (bits or bytes). */
32101 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE			UINT32_C(0x10000000)
32102 	/* Value is in bits. */
32103 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32104 	/* Value is in bytes. */
32105 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32106 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
32107 	/* bw_value_unit is 3 b */
32108 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32109 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT	29
32110 	/* Value is in Mb or MB (base 10). */
32111 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32112 	/* Value is in Kb or KB (base 10). */
32113 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32114 	/* Value is in bits or bytes. */
32115 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32116 	/* Value is in Gb or GB (base 10). */
32117 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32118 	/* Value is in 1/100th of a percentage of total bandwidth. */
32119 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32120 	/* Invalid unit */
32121 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32122 		#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
32123 	/*
32124 	 * Maximum BW allocated to CoS Queue.
32125 	 * The HWRM will translate this value into byte counter and
32126 	 * time interval used for this COS inside the device.
32127 	 */
32128 	uint32_t	queue_id0_max_bw;
32129 	/* The bandwidth value. */
32130 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32131 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT		0
32132 	/* The granularity of the value (bits or bytes). */
32133 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE			UINT32_C(0x10000000)
32134 	/* Value is in bits. */
32135 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32136 	/* Value is in bytes. */
32137 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32138 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
32139 	/* bw_value_unit is 3 b */
32140 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32141 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT	29
32142 	/* Value is in Mb or MB (base 10). */
32143 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32144 	/* Value is in Kb or KB (base 10). */
32145 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32146 	/* Value is in bits or bytes. */
32147 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32148 	/* Value is in Gb or GB (base 10). */
32149 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32150 	/* Value is in 1/100th of a percentage of total bandwidth. */
32151 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32152 	/* Invalid unit */
32153 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32154 		#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
32155 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32156 	uint8_t	queue_id0_tsa_assign;
32157 	/* Strict Priority */
32158 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP		UINT32_C(0x0)
32159 	/* Enhanced Transmission Selection */
32160 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS		UINT32_C(0x1)
32161 	/* reserved. */
32162 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32163 	/* reserved. */
32164 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32165 	/*
32166 	 * Priority level for strict priority. Valid only when the
32167 	 * tsa_assign is 0 - Strict Priority (SP)
32168 	 * 0..7 - Valid values.
32169 	 * 8..255 - Reserved.
32170 	 */
32171 	uint8_t	queue_id0_pri_lvl;
32172 	/*
32173 	 * Weight used to allocate remaining BW for this COS after
32174 	 * servicing guaranteed bandwidths for all COS.
32175 	 */
32176 	uint8_t	queue_id0_bw_weight;
32177 	/* ID of CoS Queue 1. */
32178 	uint8_t	queue_id1;
32179 	/*
32180 	 * Minimum BW allocated to CoS Queue.
32181 	 * The HWRM will translate this value into byte counter and
32182 	 * time interval used for this COS inside the device.
32183 	 */
32184 	uint32_t	queue_id1_min_bw;
32185 	/* The bandwidth value. */
32186 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32187 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT		0
32188 	/* The granularity of the value (bits or bytes). */
32189 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE			UINT32_C(0x10000000)
32190 	/* Value is in bits. */
32191 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32192 	/* Value is in bytes. */
32193 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32194 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
32195 	/* bw_value_unit is 3 b */
32196 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32197 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT	29
32198 	/* Value is in Mb or MB (base 10). */
32199 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32200 	/* Value is in Kb or KB (base 10). */
32201 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32202 	/* Value is in bits or bytes. */
32203 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32204 	/* Value is in Gb or GB (base 10). */
32205 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32206 	/* Value is in 1/100th of a percentage of total bandwidth. */
32207 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32208 	/* Invalid unit */
32209 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32210 		#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
32211 	/*
32212 	 * Maximum BW allocated to CoS queue.
32213 	 * The HWRM will translate this value into byte counter and
32214 	 * time interval used for this COS inside the device.
32215 	 */
32216 	uint32_t	queue_id1_max_bw;
32217 	/* The bandwidth value. */
32218 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32219 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT		0
32220 	/* The granularity of the value (bits or bytes). */
32221 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE			UINT32_C(0x10000000)
32222 	/* Value is in bits. */
32223 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32224 	/* Value is in bytes. */
32225 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32226 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
32227 	/* bw_value_unit is 3 b */
32228 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32229 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT	29
32230 	/* Value is in Mb or MB (base 10). */
32231 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32232 	/* Value is in Kb or KB (base 10). */
32233 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32234 	/* Value is in bits or bytes. */
32235 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32236 	/* Value is in Gb or GB (base 10). */
32237 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32238 	/* Value is in 1/100th of a percentage of total bandwidth. */
32239 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32240 	/* Invalid unit */
32241 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32242 		#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
32243 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32244 	uint8_t	queue_id1_tsa_assign;
32245 	/* Strict Priority */
32246 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP		UINT32_C(0x0)
32247 	/* Enhanced Transmission Selection */
32248 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS		UINT32_C(0x1)
32249 	/* reserved. */
32250 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32251 	/* reserved. */
32252 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32253 	/*
32254 	 * Priority level for strict priority. Valid only when the
32255 	 * tsa_assign is 0 - Strict Priority (SP)
32256 	 * 0..7 - Valid values.
32257 	 * 8..255 - Reserved.
32258 	 */
32259 	uint8_t	queue_id1_pri_lvl;
32260 	/*
32261 	 * Weight used to allocate remaining BW for this COS after
32262 	 * servicing guaranteed bandwidths for all COS.
32263 	 */
32264 	uint8_t	queue_id1_bw_weight;
32265 	/* ID of CoS Queue 2. */
32266 	uint8_t	queue_id2;
32267 	/*
32268 	 * Minimum BW allocated to CoS Queue.
32269 	 * The HWRM will translate this value into byte counter and
32270 	 * time interval used for this COS inside the device.
32271 	 */
32272 	uint32_t	queue_id2_min_bw;
32273 	/* The bandwidth value. */
32274 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32275 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT		0
32276 	/* The granularity of the value (bits or bytes). */
32277 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE			UINT32_C(0x10000000)
32278 	/* Value is in bits. */
32279 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32280 	/* Value is in bytes. */
32281 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32282 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
32283 	/* bw_value_unit is 3 b */
32284 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32285 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT	29
32286 	/* Value is in Mb or MB (base 10). */
32287 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32288 	/* Value is in Kb or KB (base 10). */
32289 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32290 	/* Value is in bits or bytes. */
32291 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32292 	/* Value is in Gb or GB (base 10). */
32293 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32294 	/* Value is in 1/100th of a percentage of total bandwidth. */
32295 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32296 	/* Invalid unit */
32297 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32298 		#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
32299 	/*
32300 	 * Maximum BW allocated to CoS queue.
32301 	 * The HWRM will translate this value into byte counter and
32302 	 * time interval used for this COS inside the device.
32303 	 */
32304 	uint32_t	queue_id2_max_bw;
32305 	/* The bandwidth value. */
32306 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32307 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT		0
32308 	/* The granularity of the value (bits or bytes). */
32309 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE			UINT32_C(0x10000000)
32310 	/* Value is in bits. */
32311 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32312 	/* Value is in bytes. */
32313 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32314 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
32315 	/* bw_value_unit is 3 b */
32316 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32317 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT	29
32318 	/* Value is in Mb or MB (base 10). */
32319 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32320 	/* Value is in Kb or KB (base 10). */
32321 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32322 	/* Value is in bits or bytes. */
32323 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32324 	/* Value is in Gb or GB (base 10). */
32325 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32326 	/* Value is in 1/100th of a percentage of total bandwidth. */
32327 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32328 	/* Invalid unit */
32329 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32330 		#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
32331 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32332 	uint8_t	queue_id2_tsa_assign;
32333 	/* Strict Priority */
32334 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP		UINT32_C(0x0)
32335 	/* Enhanced Transmission Selection */
32336 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS		UINT32_C(0x1)
32337 	/* reserved. */
32338 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32339 	/* reserved. */
32340 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32341 	/*
32342 	 * Priority level for strict priority. Valid only when the
32343 	 * tsa_assign is 0 - Strict Priority (SP)
32344 	 * 0..7 - Valid values.
32345 	 * 8..255 - Reserved.
32346 	 */
32347 	uint8_t	queue_id2_pri_lvl;
32348 	/*
32349 	 * Weight used to allocate remaining BW for this COS after
32350 	 * servicing guaranteed bandwidths for all COS.
32351 	 */
32352 	uint8_t	queue_id2_bw_weight;
32353 	/* ID of CoS Queue 3. */
32354 	uint8_t	queue_id3;
32355 	/*
32356 	 * Minimum BW allocated to CoS Queue.
32357 	 * The HWRM will translate this value into byte counter and
32358 	 * time interval used for this COS inside the device.
32359 	 */
32360 	uint32_t	queue_id3_min_bw;
32361 	/* The bandwidth value. */
32362 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32363 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT		0
32364 	/* The granularity of the value (bits or bytes). */
32365 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE			UINT32_C(0x10000000)
32366 	/* Value is in bits. */
32367 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32368 	/* Value is in bytes. */
32369 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32370 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
32371 	/* bw_value_unit is 3 b */
32372 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32373 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT	29
32374 	/* Value is in Mb or MB (base 10). */
32375 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32376 	/* Value is in Kb or KB (base 10). */
32377 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32378 	/* Value is in bits or bytes. */
32379 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32380 	/* Value is in Gb or GB (base 10). */
32381 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32382 	/* Value is in 1/100th of a percentage of total bandwidth. */
32383 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32384 	/* Invalid unit */
32385 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32386 		#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
32387 	/*
32388 	 * Maximum BW allocated to CoS queue.
32389 	 * The HWRM will translate this value into byte counter and
32390 	 * time interval used for this COS inside the device.
32391 	 */
32392 	uint32_t	queue_id3_max_bw;
32393 	/* The bandwidth value. */
32394 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32395 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT		0
32396 	/* The granularity of the value (bits or bytes). */
32397 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE			UINT32_C(0x10000000)
32398 	/* Value is in bits. */
32399 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32400 	/* Value is in bytes. */
32401 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32402 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
32403 	/* bw_value_unit is 3 b */
32404 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32405 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT	29
32406 	/* Value is in Mb or MB (base 10). */
32407 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32408 	/* Value is in Kb or KB (base 10). */
32409 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32410 	/* Value is in bits or bytes. */
32411 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32412 	/* Value is in Gb or GB (base 10). */
32413 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32414 	/* Value is in 1/100th of a percentage of total bandwidth. */
32415 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32416 	/* Invalid unit */
32417 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32418 		#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
32419 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32420 	uint8_t	queue_id3_tsa_assign;
32421 	/* Strict Priority */
32422 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP		UINT32_C(0x0)
32423 	/* Enhanced Transmission Selection */
32424 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS		UINT32_C(0x1)
32425 	/* reserved. */
32426 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32427 	/* reserved. */
32428 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32429 	/*
32430 	 * Priority level for strict priority. Valid only when the
32431 	 * tsa_assign is 0 - Strict Priority (SP)
32432 	 * 0..7 - Valid values.
32433 	 * 8..255 - Reserved.
32434 	 */
32435 	uint8_t	queue_id3_pri_lvl;
32436 	/*
32437 	 * Weight used to allocate remaining BW for this COS after
32438 	 * servicing guaranteed bandwidths for all COS.
32439 	 */
32440 	uint8_t	queue_id3_bw_weight;
32441 	/* ID of CoS Queue 4. */
32442 	uint8_t	queue_id4;
32443 	/*
32444 	 * Minimum BW allocated to CoS Queue.
32445 	 * The HWRM will translate this value into byte counter and
32446 	 * time interval used for this COS inside the device.
32447 	 */
32448 	uint32_t	queue_id4_min_bw;
32449 	/* The bandwidth value. */
32450 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32451 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT		0
32452 	/* The granularity of the value (bits or bytes). */
32453 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE			UINT32_C(0x10000000)
32454 	/* Value is in bits. */
32455 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32456 	/* Value is in bytes. */
32457 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32458 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
32459 	/* bw_value_unit is 3 b */
32460 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32461 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT	29
32462 	/* Value is in Mb or MB (base 10). */
32463 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32464 	/* Value is in Kb or KB (base 10). */
32465 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32466 	/* Value is in bits or bytes. */
32467 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32468 	/* Value is in Gb or GB (base 10). */
32469 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32470 	/* Value is in 1/100th of a percentage of total bandwidth. */
32471 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32472 	/* Invalid unit */
32473 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32474 		#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
32475 	/*
32476 	 * Maximum BW allocated to CoS queue.
32477 	 * The HWRM will translate this value into byte counter and
32478 	 * time interval used for this COS inside the device.
32479 	 */
32480 	uint32_t	queue_id4_max_bw;
32481 	/* The bandwidth value. */
32482 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32483 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT		0
32484 	/* The granularity of the value (bits or bytes). */
32485 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE			UINT32_C(0x10000000)
32486 	/* Value is in bits. */
32487 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32488 	/* Value is in bytes. */
32489 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32490 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
32491 	/* bw_value_unit is 3 b */
32492 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32493 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT	29
32494 	/* Value is in Mb or MB (base 10). */
32495 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32496 	/* Value is in Kb or KB (base 10). */
32497 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32498 	/* Value is in bits or bytes. */
32499 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32500 	/* Value is in Gb or GB (base 10). */
32501 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32502 	/* Value is in 1/100th of a percentage of total bandwidth. */
32503 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32504 	/* Invalid unit */
32505 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32506 		#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
32507 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32508 	uint8_t	queue_id4_tsa_assign;
32509 	/* Strict Priority */
32510 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP		UINT32_C(0x0)
32511 	/* Enhanced Transmission Selection */
32512 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS		UINT32_C(0x1)
32513 	/* reserved. */
32514 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32515 	/* reserved. */
32516 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32517 	/*
32518 	 * Priority level for strict priority. Valid only when the
32519 	 * tsa_assign is 0 - Strict Priority (SP)
32520 	 * 0..7 - Valid values.
32521 	 * 8..255 - Reserved.
32522 	 */
32523 	uint8_t	queue_id4_pri_lvl;
32524 	/*
32525 	 * Weight used to allocate remaining BW for this COS after
32526 	 * servicing guaranteed bandwidths for all COS.
32527 	 */
32528 	uint8_t	queue_id4_bw_weight;
32529 	/* ID of CoS Queue 5. */
32530 	uint8_t	queue_id5;
32531 	/*
32532 	 * Minimum BW allocated to CoS Queue.
32533 	 * The HWRM will translate this value into byte counter and
32534 	 * time interval used for this COS inside the device.
32535 	 */
32536 	uint32_t	queue_id5_min_bw;
32537 	/* The bandwidth value. */
32538 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32539 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT		0
32540 	/* The granularity of the value (bits or bytes). */
32541 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE			UINT32_C(0x10000000)
32542 	/* Value is in bits. */
32543 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32544 	/* Value is in bytes. */
32545 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32546 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
32547 	/* bw_value_unit is 3 b */
32548 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32549 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT	29
32550 	/* Value is in Mb or MB (base 10). */
32551 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32552 	/* Value is in Kb or KB (base 10). */
32553 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32554 	/* Value is in bits or bytes. */
32555 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32556 	/* Value is in Gb or GB (base 10). */
32557 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32558 	/* Value is in 1/100th of a percentage of total bandwidth. */
32559 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32560 	/* Invalid unit */
32561 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32562 		#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
32563 	/*
32564 	 * Maximum BW allocated to CoS queue.
32565 	 * The HWRM will translate this value into byte counter and
32566 	 * time interval used for this COS inside the device.
32567 	 */
32568 	uint32_t	queue_id5_max_bw;
32569 	/* The bandwidth value. */
32570 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32571 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT		0
32572 	/* The granularity of the value (bits or bytes). */
32573 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE			UINT32_C(0x10000000)
32574 	/* Value is in bits. */
32575 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32576 	/* Value is in bytes. */
32577 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32578 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
32579 	/* bw_value_unit is 3 b */
32580 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32581 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT	29
32582 	/* Value is in Mb or MB (base 10). */
32583 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32584 	/* Value is in Kb or KB (base 10). */
32585 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32586 	/* Value is in bits or bytes. */
32587 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32588 	/* Value is in Gb or GB (base 10). */
32589 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32590 	/* Value is in 1/100th of a percentage of total bandwidth. */
32591 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32592 	/* Invalid unit */
32593 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32594 		#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
32595 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32596 	uint8_t	queue_id5_tsa_assign;
32597 	/* Strict Priority */
32598 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP		UINT32_C(0x0)
32599 	/* Enhanced Transmission Selection */
32600 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS		UINT32_C(0x1)
32601 	/* reserved. */
32602 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32603 	/* reserved. */
32604 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32605 	/*
32606 	 * Priority level for strict priority. Valid only when the
32607 	 * tsa_assign is 0 - Strict Priority (SP)
32608 	 * 0..7 - Valid values.
32609 	 * 8..255 - Reserved.
32610 	 */
32611 	uint8_t	queue_id5_pri_lvl;
32612 	/*
32613 	 * Weight used to allocate remaining BW for this COS after
32614 	 * servicing guaranteed bandwidths for all COS.
32615 	 */
32616 	uint8_t	queue_id5_bw_weight;
32617 	/* ID of CoS Queue 6. */
32618 	uint8_t	queue_id6;
32619 	/*
32620 	 * Minimum BW allocated to CoS Queue.
32621 	 * The HWRM will translate this value into byte counter and
32622 	 * time interval used for this COS inside the device.
32623 	 */
32624 	uint32_t	queue_id6_min_bw;
32625 	/* The bandwidth value. */
32626 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32627 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT		0
32628 	/* The granularity of the value (bits or bytes). */
32629 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE			UINT32_C(0x10000000)
32630 	/* Value is in bits. */
32631 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32632 	/* Value is in bytes. */
32633 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32634 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
32635 	/* bw_value_unit is 3 b */
32636 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32637 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT	29
32638 	/* Value is in Mb or MB (base 10). */
32639 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32640 	/* Value is in Kb or KB (base 10). */
32641 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32642 	/* Value is in bits or bytes. */
32643 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32644 	/* Value is in Gb or GB (base 10). */
32645 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32646 	/* Value is in 1/100th of a percentage of total bandwidth. */
32647 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32648 	/* Invalid unit */
32649 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32650 		#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
32651 	/*
32652 	 * Maximum BW allocated to CoS queue.
32653 	 * The HWRM will translate this value into byte counter and
32654 	 * time interval used for this COS inside the device.
32655 	 */
32656 	uint32_t	queue_id6_max_bw;
32657 	/* The bandwidth value. */
32658 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32659 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT		0
32660 	/* The granularity of the value (bits or bytes). */
32661 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE			UINT32_C(0x10000000)
32662 	/* Value is in bits. */
32663 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32664 	/* Value is in bytes. */
32665 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32666 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
32667 	/* bw_value_unit is 3 b */
32668 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32669 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT	29
32670 	/* Value is in Mb or MB (base 10). */
32671 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32672 	/* Value is in Kb or KB (base 10). */
32673 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32674 	/* Value is in bits or bytes. */
32675 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32676 	/* Value is in Gb or GB (base 10). */
32677 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32678 	/* Value is in 1/100th of a percentage of total bandwidth. */
32679 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32680 	/* Invalid unit */
32681 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32682 		#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
32683 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32684 	uint8_t	queue_id6_tsa_assign;
32685 	/* Strict Priority */
32686 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP		UINT32_C(0x0)
32687 	/* Enhanced Transmission Selection */
32688 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS		UINT32_C(0x1)
32689 	/* reserved. */
32690 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32691 	/* reserved. */
32692 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32693 	/*
32694 	 * Priority level for strict priority. Valid only when the
32695 	 * tsa_assign is 0 - Strict Priority (SP)
32696 	 * 0..7 - Valid values.
32697 	 * 8..255 - Reserved.
32698 	 */
32699 	uint8_t	queue_id6_pri_lvl;
32700 	/*
32701 	 * Weight used to allocate remaining BW for this COS after
32702 	 * servicing guaranteed bandwidths for all COS.
32703 	 */
32704 	uint8_t	queue_id6_bw_weight;
32705 	/* ID of CoS Queue 7. */
32706 	uint8_t	queue_id7;
32707 	/*
32708 	 * Minimum BW allocated to CoS Queue.
32709 	 * The HWRM will translate this value into byte counter and
32710 	 * time interval used for this COS inside the device.
32711 	 */
32712 	uint32_t	queue_id7_min_bw;
32713 	/* The bandwidth value. */
32714 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32715 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT		0
32716 	/* The granularity of the value (bits or bytes). */
32717 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE			UINT32_C(0x10000000)
32718 	/* Value is in bits. */
32719 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32720 	/* Value is in bytes. */
32721 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32722 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
32723 	/* bw_value_unit is 3 b */
32724 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32725 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT	29
32726 	/* Value is in Mb or MB (base 10). */
32727 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32728 	/* Value is in Kb or KB (base 10). */
32729 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32730 	/* Value is in bits or bytes. */
32731 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32732 	/* Value is in Gb or GB (base 10). */
32733 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32734 	/* Value is in 1/100th of a percentage of total bandwidth. */
32735 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32736 	/* Invalid unit */
32737 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32738 		#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
32739 	/*
32740 	 * Maximum BW allocated to CoS queue.
32741 	 * The HWRM will translate this value into byte counter and
32742 	 * time interval used for this COS inside the device.
32743 	 */
32744 	uint32_t	queue_id7_max_bw;
32745 	/* The bandwidth value. */
32746 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32747 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT		0
32748 	/* The granularity of the value (bits or bytes). */
32749 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE			UINT32_C(0x10000000)
32750 	/* Value is in bits. */
32751 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32752 	/* Value is in bytes. */
32753 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32754 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
32755 	/* bw_value_unit is 3 b */
32756 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32757 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT	29
32758 	/* Value is in Mb or MB (base 10). */
32759 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32760 	/* Value is in Kb or KB (base 10). */
32761 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32762 	/* Value is in bits or bytes. */
32763 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32764 	/* Value is in Gb or GB (base 10). */
32765 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32766 	/* Value is in 1/100th of a percentage of total bandwidth. */
32767 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32768 	/* Invalid unit */
32769 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32770 		#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
32771 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32772 	uint8_t	queue_id7_tsa_assign;
32773 	/* Strict Priority */
32774 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP		UINT32_C(0x0)
32775 	/* Enhanced Transmission Selection */
32776 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS		UINT32_C(0x1)
32777 	/* reserved. */
32778 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32779 	/* reserved. */
32780 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32781 	/*
32782 	 * Priority level for strict priority. Valid only when the
32783 	 * tsa_assign is 0 - Strict Priority (SP)
32784 	 * 0..7 - Valid values.
32785 	 * 8..255 - Reserved.
32786 	 */
32787 	uint8_t	queue_id7_pri_lvl;
32788 	/*
32789 	 * Weight used to allocate remaining BW for this COS after
32790 	 * servicing guaranteed bandwidths for all COS.
32791 	 */
32792 	uint8_t	queue_id7_bw_weight;
32793 	uint8_t	unused_2[4];
32794 	/*
32795 	 * This field is used in Output records to indicate that the output
32796 	 * is completely written to RAM. This field should be read as '1'
32797 	 * to indicate that the output has been completely written.
32798 	 * When writing a command completion or response to an internal processor,
32799 	 * the order of writes has to be such that this field is written last.
32800 	 */
32801 	uint8_t	valid;
32802 } hwrm_queue_cos2bw_qcfg_output_t, *phwrm_queue_cos2bw_qcfg_output_t;
32803 
32804 /*************************
32805  * hwrm_queue_cos2bw_cfg *
32806  *************************/
32807 
32808 
32809 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
32810 
32811 typedef struct hwrm_queue_cos2bw_cfg_input {
32812 	/* The HWRM command request type. */
32813 	uint16_t	req_type;
32814 	/*
32815 	 * The completion ring to send the completion event on. This should
32816 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
32817 	 */
32818 	uint16_t	cmpl_ring;
32819 	/*
32820 	 * The sequence ID is used by the driver for tracking multiple
32821 	 * commands. This ID is treated as opaque data by the firmware and
32822 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
32823 	 */
32824 	uint16_t	seq_id;
32825 	/*
32826 	 * The target ID of the command:
32827 	 * * 0x0-0xFFF8 - The function ID
32828 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32829 	 * * 0xFFFD - Reserved for user-space HWRM interface
32830 	 * * 0xFFFF - HWRM
32831 	 */
32832 	uint16_t	target_id;
32833 	/*
32834 	 * A physical address pointer pointing to a host buffer that the
32835 	 * command's response data will be written. This can be either a host
32836 	 * physical address (HPA) or a guest physical address (GPA) and must
32837 	 * point to a physically contiguous block of memory.
32838 	 */
32839 	uint64_t	resp_addr;
32840 	uint32_t	flags;
32841 	uint32_t	enables;
32842 	/*
32843 	 * If this bit is set to 1, then all queue_id0 related
32844 	 * parameters in this command are valid.
32845 	 */
32846 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID	UINT32_C(0x1)
32847 	/*
32848 	 * If this bit is set to 1, then all queue_id1 related
32849 	 * parameters in this command are valid.
32850 	 */
32851 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID	UINT32_C(0x2)
32852 	/*
32853 	 * If this bit is set to 1, then all queue_id2 related
32854 	 * parameters in this command are valid.
32855 	 */
32856 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID	UINT32_C(0x4)
32857 	/*
32858 	 * If this bit is set to 1, then all queue_id3 related
32859 	 * parameters in this command are valid.
32860 	 */
32861 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID	UINT32_C(0x8)
32862 	/*
32863 	 * If this bit is set to 1, then all queue_id4 related
32864 	 * parameters in this command are valid.
32865 	 */
32866 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID	UINT32_C(0x10)
32867 	/*
32868 	 * If this bit is set to 1, then all queue_id5 related
32869 	 * parameters in this command are valid.
32870 	 */
32871 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID	UINT32_C(0x20)
32872 	/*
32873 	 * If this bit is set to 1, then all queue_id6 related
32874 	 * parameters in this command are valid.
32875 	 */
32876 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID	UINT32_C(0x40)
32877 	/*
32878 	 * If this bit is set to 1, then all queue_id7 related
32879 	 * parameters in this command are valid.
32880 	 */
32881 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID	UINT32_C(0x80)
32882 	/*
32883 	 * Port ID of port for which the table is being configured.
32884 	 * The HWRM needs to check whether this function is allowed
32885 	 * to configure TC BW assignment on this port.
32886 	 */
32887 	uint16_t	port_id;
32888 	/* ID of CoS Queue 0. */
32889 	uint8_t	queue_id0;
32890 	uint8_t	unused_0;
32891 	/*
32892 	 * Minimum BW allocated to CoS Queue.
32893 	 * The HWRM will translate this value into byte counter and
32894 	 * time interval used for this COS inside the device.
32895 	 */
32896 	uint32_t	queue_id0_min_bw;
32897 	/* The bandwidth value. */
32898 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32899 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT		0
32900 	/* The granularity of the value (bits or bytes). */
32901 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE			UINT32_C(0x10000000)
32902 	/* Value is in bits. */
32903 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32904 	/* Value is in bytes. */
32905 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32906 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
32907 	/* bw_value_unit is 3 b */
32908 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32909 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT	29
32910 	/* Value is in Mb or MB (base 10). */
32911 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32912 	/* Value is in Kb or KB (base 10). */
32913 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32914 	/* Value is in bits or bytes. */
32915 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32916 	/* Value is in Gb or GB (base 10). */
32917 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32918 	/* Value is in 1/100th of a percentage of total bandwidth. */
32919 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32920 	/* Invalid unit */
32921 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32922 		#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
32923 	/*
32924 	 * Maximum BW allocated to CoS Queue.
32925 	 * The HWRM will translate this value into byte counter and
32926 	 * time interval used for this COS inside the device.
32927 	 */
32928 	uint32_t	queue_id0_max_bw;
32929 	/* The bandwidth value. */
32930 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32931 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT		0
32932 	/* The granularity of the value (bits or bytes). */
32933 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE			UINT32_C(0x10000000)
32934 	/* Value is in bits. */
32935 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32936 	/* Value is in bytes. */
32937 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32938 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
32939 	/* bw_value_unit is 3 b */
32940 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32941 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT	29
32942 	/* Value is in Mb or MB (base 10). */
32943 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
32944 	/* Value is in Kb or KB (base 10). */
32945 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
32946 	/* Value is in bits or bytes. */
32947 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
32948 	/* Value is in Gb or GB (base 10). */
32949 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
32950 	/* Value is in 1/100th of a percentage of total bandwidth. */
32951 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
32952 	/* Invalid unit */
32953 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
32954 		#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
32955 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
32956 	uint8_t	queue_id0_tsa_assign;
32957 	/* Strict Priority */
32958 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP		UINT32_C(0x0)
32959 	/* Enhanced Transmission Selection */
32960 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS		UINT32_C(0x1)
32961 	/* reserved. */
32962 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
32963 	/* reserved. */
32964 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
32965 	/*
32966 	 * Priority level for strict priority. Valid only when the
32967 	 * tsa_assign is 0 - Strict Priority (SP)
32968 	 * 0..7 - Valid values.
32969 	 * 8..255 - Reserved.
32970 	 */
32971 	uint8_t	queue_id0_pri_lvl;
32972 	/*
32973 	 * Weight used to allocate remaining BW for this COS after
32974 	 * servicing guaranteed bandwidths for all COS.
32975 	 */
32976 	uint8_t	queue_id0_bw_weight;
32977 	/* ID of CoS Queue 1. */
32978 	uint8_t	queue_id1;
32979 	/*
32980 	 * Minimum BW allocated to CoS Queue.
32981 	 * The HWRM will translate this value into byte counter and
32982 	 * time interval used for this COS inside the device.
32983 	 */
32984 	uint32_t	queue_id1_min_bw;
32985 	/* The bandwidth value. */
32986 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
32987 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT		0
32988 	/* The granularity of the value (bits or bytes). */
32989 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE			UINT32_C(0x10000000)
32990 	/* Value is in bits. */
32991 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
32992 	/* Value is in bytes. */
32993 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
32994 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
32995 	/* bw_value_unit is 3 b */
32996 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
32997 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT	29
32998 	/* Value is in Mb or MB (base 10). */
32999 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33000 	/* Value is in Kb or KB (base 10). */
33001 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33002 	/* Value is in bits or bytes. */
33003 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33004 	/* Value is in Gb or GB (base 10). */
33005 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33006 	/* Value is in 1/100th of a percentage of total bandwidth. */
33007 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33008 	/* Invalid unit */
33009 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33010 		#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
33011 	/*
33012 	 * Maximum BW allocated to CoS queue.
33013 	 * The HWRM will translate this value into byte counter and
33014 	 * time interval used for this COS inside the device.
33015 	 */
33016 	uint32_t	queue_id1_max_bw;
33017 	/* The bandwidth value. */
33018 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33019 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT		0
33020 	/* The granularity of the value (bits or bytes). */
33021 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE			UINT32_C(0x10000000)
33022 	/* Value is in bits. */
33023 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33024 	/* Value is in bytes. */
33025 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33026 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
33027 	/* bw_value_unit is 3 b */
33028 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33029 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT	29
33030 	/* Value is in Mb or MB (base 10). */
33031 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33032 	/* Value is in Kb or KB (base 10). */
33033 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33034 	/* Value is in bits or bytes. */
33035 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33036 	/* Value is in Gb or GB (base 10). */
33037 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33038 	/* Value is in 1/100th of a percentage of total bandwidth. */
33039 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33040 	/* Invalid unit */
33041 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33042 		#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
33043 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33044 	uint8_t	queue_id1_tsa_assign;
33045 	/* Strict Priority */
33046 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP		UINT32_C(0x0)
33047 	/* Enhanced Transmission Selection */
33048 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS		UINT32_C(0x1)
33049 	/* reserved. */
33050 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33051 	/* reserved. */
33052 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33053 	/*
33054 	 * Priority level for strict priority. Valid only when the
33055 	 * tsa_assign is 0 - Strict Priority (SP)
33056 	 * 0..7 - Valid values.
33057 	 * 8..255 - Reserved.
33058 	 */
33059 	uint8_t	queue_id1_pri_lvl;
33060 	/*
33061 	 * Weight used to allocate remaining BW for this COS after
33062 	 * servicing guaranteed bandwidths for all COS.
33063 	 */
33064 	uint8_t	queue_id1_bw_weight;
33065 	/* ID of CoS Queue 2. */
33066 	uint8_t	queue_id2;
33067 	/*
33068 	 * Minimum BW allocated to CoS Queue.
33069 	 * The HWRM will translate this value into byte counter and
33070 	 * time interval used for this COS inside the device.
33071 	 */
33072 	uint32_t	queue_id2_min_bw;
33073 	/* The bandwidth value. */
33074 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33075 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT		0
33076 	/* The granularity of the value (bits or bytes). */
33077 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE			UINT32_C(0x10000000)
33078 	/* Value is in bits. */
33079 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33080 	/* Value is in bytes. */
33081 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33082 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
33083 	/* bw_value_unit is 3 b */
33084 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33085 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT	29
33086 	/* Value is in Mb or MB (base 10). */
33087 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33088 	/* Value is in Kb or KB (base 10). */
33089 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33090 	/* Value is in bits or bytes. */
33091 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33092 	/* Value is in Gb or GB (base 10). */
33093 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33094 	/* Value is in 1/100th of a percentage of total bandwidth. */
33095 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33096 	/* Invalid unit */
33097 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33098 		#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
33099 	/*
33100 	 * Maximum BW allocated to CoS queue.
33101 	 * The HWRM will translate this value into byte counter and
33102 	 * time interval used for this COS inside the device.
33103 	 */
33104 	uint32_t	queue_id2_max_bw;
33105 	/* The bandwidth value. */
33106 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33107 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT		0
33108 	/* The granularity of the value (bits or bytes). */
33109 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE			UINT32_C(0x10000000)
33110 	/* Value is in bits. */
33111 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33112 	/* Value is in bytes. */
33113 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33114 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
33115 	/* bw_value_unit is 3 b */
33116 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33117 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT	29
33118 	/* Value is in Mb or MB (base 10). */
33119 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33120 	/* Value is in Kb or KB (base 10). */
33121 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33122 	/* Value is in bits or bytes. */
33123 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33124 	/* Value is in Gb or GB (base 10). */
33125 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33126 	/* Value is in 1/100th of a percentage of total bandwidth. */
33127 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33128 	/* Invalid unit */
33129 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33130 		#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
33131 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33132 	uint8_t	queue_id2_tsa_assign;
33133 	/* Strict Priority */
33134 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP		UINT32_C(0x0)
33135 	/* Enhanced Transmission Selection */
33136 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS		UINT32_C(0x1)
33137 	/* reserved. */
33138 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33139 	/* reserved. */
33140 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33141 	/*
33142 	 * Priority level for strict priority. Valid only when the
33143 	 * tsa_assign is 0 - Strict Priority (SP)
33144 	 * 0..7 - Valid values.
33145 	 * 8..255 - Reserved.
33146 	 */
33147 	uint8_t	queue_id2_pri_lvl;
33148 	/*
33149 	 * Weight used to allocate remaining BW for this COS after
33150 	 * servicing guaranteed bandwidths for all COS.
33151 	 */
33152 	uint8_t	queue_id2_bw_weight;
33153 	/* ID of CoS Queue 3. */
33154 	uint8_t	queue_id3;
33155 	/*
33156 	 * Minimum BW allocated to CoS Queue.
33157 	 * The HWRM will translate this value into byte counter and
33158 	 * time interval used for this COS inside the device.
33159 	 */
33160 	uint32_t	queue_id3_min_bw;
33161 	/* The bandwidth value. */
33162 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33163 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT		0
33164 	/* The granularity of the value (bits or bytes). */
33165 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE			UINT32_C(0x10000000)
33166 	/* Value is in bits. */
33167 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33168 	/* Value is in bytes. */
33169 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33170 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
33171 	/* bw_value_unit is 3 b */
33172 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33173 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT	29
33174 	/* Value is in Mb or MB (base 10). */
33175 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33176 	/* Value is in Kb or KB (base 10). */
33177 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33178 	/* Value is in bits or bytes. */
33179 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33180 	/* Value is in Gb or GB (base 10). */
33181 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33182 	/* Value is in 1/100th of a percentage of total bandwidth. */
33183 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33184 	/* Invalid unit */
33185 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33186 		#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
33187 	/*
33188 	 * Maximum BW allocated to CoS queue.
33189 	 * The HWRM will translate this value into byte counter and
33190 	 * time interval used for this COS inside the device.
33191 	 */
33192 	uint32_t	queue_id3_max_bw;
33193 	/* The bandwidth value. */
33194 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33195 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT		0
33196 	/* The granularity of the value (bits or bytes). */
33197 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE			UINT32_C(0x10000000)
33198 	/* Value is in bits. */
33199 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33200 	/* Value is in bytes. */
33201 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33202 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
33203 	/* bw_value_unit is 3 b */
33204 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33205 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT	29
33206 	/* Value is in Mb or MB (base 10). */
33207 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33208 	/* Value is in Kb or KB (base 10). */
33209 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33210 	/* Value is in bits or bytes. */
33211 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33212 	/* Value is in Gb or GB (base 10). */
33213 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33214 	/* Value is in 1/100th of a percentage of total bandwidth. */
33215 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33216 	/* Invalid unit */
33217 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33218 		#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
33219 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33220 	uint8_t	queue_id3_tsa_assign;
33221 	/* Strict Priority */
33222 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP		UINT32_C(0x0)
33223 	/* Enhanced Transmission Selection */
33224 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS		UINT32_C(0x1)
33225 	/* reserved. */
33226 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33227 	/* reserved. */
33228 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33229 	/*
33230 	 * Priority level for strict priority. Valid only when the
33231 	 * tsa_assign is 0 - Strict Priority (SP)
33232 	 * 0..7 - Valid values.
33233 	 * 8..255 - Reserved.
33234 	 */
33235 	uint8_t	queue_id3_pri_lvl;
33236 	/*
33237 	 * Weight used to allocate remaining BW for this COS after
33238 	 * servicing guaranteed bandwidths for all COS.
33239 	 */
33240 	uint8_t	queue_id3_bw_weight;
33241 	/* ID of CoS Queue 4. */
33242 	uint8_t	queue_id4;
33243 	/*
33244 	 * Minimum BW allocated to CoS Queue.
33245 	 * The HWRM will translate this value into byte counter and
33246 	 * time interval used for this COS inside the device.
33247 	 */
33248 	uint32_t	queue_id4_min_bw;
33249 	/* The bandwidth value. */
33250 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33251 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT		0
33252 	/* The granularity of the value (bits or bytes). */
33253 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE			UINT32_C(0x10000000)
33254 	/* Value is in bits. */
33255 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33256 	/* Value is in bytes. */
33257 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33258 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
33259 	/* bw_value_unit is 3 b */
33260 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33261 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT	29
33262 	/* Value is in Mb or MB (base 10). */
33263 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33264 	/* Value is in Kb or KB (base 10). */
33265 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33266 	/* Value is in bits or bytes. */
33267 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33268 	/* Value is in Gb or GB (base 10). */
33269 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33270 	/* Value is in 1/100th of a percentage of total bandwidth. */
33271 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33272 	/* Invalid unit */
33273 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33274 		#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
33275 	/*
33276 	 * Maximum BW allocated to CoS queue.
33277 	 * The HWRM will translate this value into byte counter and
33278 	 * time interval used for this COS inside the device.
33279 	 */
33280 	uint32_t	queue_id4_max_bw;
33281 	/* The bandwidth value. */
33282 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33283 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT		0
33284 	/* The granularity of the value (bits or bytes). */
33285 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE			UINT32_C(0x10000000)
33286 	/* Value is in bits. */
33287 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33288 	/* Value is in bytes. */
33289 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33290 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
33291 	/* bw_value_unit is 3 b */
33292 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33293 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT	29
33294 	/* Value is in Mb or MB (base 10). */
33295 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33296 	/* Value is in Kb or KB (base 10). */
33297 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33298 	/* Value is in bits or bytes. */
33299 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33300 	/* Value is in Gb or GB (base 10). */
33301 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33302 	/* Value is in 1/100th of a percentage of total bandwidth. */
33303 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33304 	/* Invalid unit */
33305 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33306 		#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
33307 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33308 	uint8_t	queue_id4_tsa_assign;
33309 	/* Strict Priority */
33310 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP		UINT32_C(0x0)
33311 	/* Enhanced Transmission Selection */
33312 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS		UINT32_C(0x1)
33313 	/* reserved. */
33314 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33315 	/* reserved. */
33316 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33317 	/*
33318 	 * Priority level for strict priority. Valid only when the
33319 	 * tsa_assign is 0 - Strict Priority (SP)
33320 	 * 0..7 - Valid values.
33321 	 * 8..255 - Reserved.
33322 	 */
33323 	uint8_t	queue_id4_pri_lvl;
33324 	/*
33325 	 * Weight used to allocate remaining BW for this COS after
33326 	 * servicing guaranteed bandwidths for all COS.
33327 	 */
33328 	uint8_t	queue_id4_bw_weight;
33329 	/* ID of CoS Queue 5. */
33330 	uint8_t	queue_id5;
33331 	/*
33332 	 * Minimum BW allocated to CoS Queue.
33333 	 * The HWRM will translate this value into byte counter and
33334 	 * time interval used for this COS inside the device.
33335 	 */
33336 	uint32_t	queue_id5_min_bw;
33337 	/* The bandwidth value. */
33338 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33339 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT		0
33340 	/* The granularity of the value (bits or bytes). */
33341 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE			UINT32_C(0x10000000)
33342 	/* Value is in bits. */
33343 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33344 	/* Value is in bytes. */
33345 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33346 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
33347 	/* bw_value_unit is 3 b */
33348 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33349 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT	29
33350 	/* Value is in Mb or MB (base 10). */
33351 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33352 	/* Value is in Kb or KB (base 10). */
33353 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33354 	/* Value is in bits or bytes. */
33355 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33356 	/* Value is in Gb or GB (base 10). */
33357 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33358 	/* Value is in 1/100th of a percentage of total bandwidth. */
33359 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33360 	/* Invalid unit */
33361 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33362 		#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
33363 	/*
33364 	 * Maximum BW allocated to CoS queue.
33365 	 * The HWRM will translate this value into byte counter and
33366 	 * time interval used for this COS inside the device.
33367 	 */
33368 	uint32_t	queue_id5_max_bw;
33369 	/* The bandwidth value. */
33370 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33371 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT		0
33372 	/* The granularity of the value (bits or bytes). */
33373 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE			UINT32_C(0x10000000)
33374 	/* Value is in bits. */
33375 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33376 	/* Value is in bytes. */
33377 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33378 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
33379 	/* bw_value_unit is 3 b */
33380 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33381 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT	29
33382 	/* Value is in Mb or MB (base 10). */
33383 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33384 	/* Value is in Kb or KB (base 10). */
33385 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33386 	/* Value is in bits or bytes. */
33387 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33388 	/* Value is in Gb or GB (base 10). */
33389 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33390 	/* Value is in 1/100th of a percentage of total bandwidth. */
33391 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33392 	/* Invalid unit */
33393 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33394 		#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
33395 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33396 	uint8_t	queue_id5_tsa_assign;
33397 	/* Strict Priority */
33398 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP		UINT32_C(0x0)
33399 	/* Enhanced Transmission Selection */
33400 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS		UINT32_C(0x1)
33401 	/* reserved. */
33402 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33403 	/* reserved. */
33404 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33405 	/*
33406 	 * Priority level for strict priority. Valid only when the
33407 	 * tsa_assign is 0 - Strict Priority (SP)
33408 	 * 0..7 - Valid values.
33409 	 * 8..255 - Reserved.
33410 	 */
33411 	uint8_t	queue_id5_pri_lvl;
33412 	/*
33413 	 * Weight used to allocate remaining BW for this COS after
33414 	 * servicing guaranteed bandwidths for all COS.
33415 	 */
33416 	uint8_t	queue_id5_bw_weight;
33417 	/* ID of CoS Queue 6. */
33418 	uint8_t	queue_id6;
33419 	/*
33420 	 * Minimum BW allocated to CoS Queue.
33421 	 * The HWRM will translate this value into byte counter and
33422 	 * time interval used for this COS inside the device.
33423 	 */
33424 	uint32_t	queue_id6_min_bw;
33425 	/* The bandwidth value. */
33426 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33427 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT		0
33428 	/* The granularity of the value (bits or bytes). */
33429 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE			UINT32_C(0x10000000)
33430 	/* Value is in bits. */
33431 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33432 	/* Value is in bytes. */
33433 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33434 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
33435 	/* bw_value_unit is 3 b */
33436 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33437 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT	29
33438 	/* Value is in Mb or MB (base 10). */
33439 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33440 	/* Value is in Kb or KB (base 10). */
33441 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33442 	/* Value is in bits or bytes. */
33443 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33444 	/* Value is in Gb or GB (base 10). */
33445 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33446 	/* Value is in 1/100th of a percentage of total bandwidth. */
33447 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33448 	/* Invalid unit */
33449 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33450 		#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
33451 	/*
33452 	 * Maximum BW allocated to CoS queue.
33453 	 * The HWRM will translate this value into byte counter and
33454 	 * time interval used for this COS inside the device.
33455 	 */
33456 	uint32_t	queue_id6_max_bw;
33457 	/* The bandwidth value. */
33458 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33459 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT		0
33460 	/* The granularity of the value (bits or bytes). */
33461 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE			UINT32_C(0x10000000)
33462 	/* Value is in bits. */
33463 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33464 	/* Value is in bytes. */
33465 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33466 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
33467 	/* bw_value_unit is 3 b */
33468 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33469 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT	29
33470 	/* Value is in Mb or MB (base 10). */
33471 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33472 	/* Value is in Kb or KB (base 10). */
33473 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33474 	/* Value is in bits or bytes. */
33475 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33476 	/* Value is in Gb or GB (base 10). */
33477 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33478 	/* Value is in 1/100th of a percentage of total bandwidth. */
33479 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33480 	/* Invalid unit */
33481 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33482 		#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
33483 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33484 	uint8_t	queue_id6_tsa_assign;
33485 	/* Strict Priority */
33486 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP		UINT32_C(0x0)
33487 	/* Enhanced Transmission Selection */
33488 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS		UINT32_C(0x1)
33489 	/* reserved. */
33490 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33491 	/* reserved. */
33492 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33493 	/*
33494 	 * Priority level for strict priority. Valid only when the
33495 	 * tsa_assign is 0 - Strict Priority (SP)
33496 	 * 0..7 - Valid values.
33497 	 * 8..255 - Reserved.
33498 	 */
33499 	uint8_t	queue_id6_pri_lvl;
33500 	/*
33501 	 * Weight used to allocate remaining BW for this COS after
33502 	 * servicing guaranteed bandwidths for all COS.
33503 	 */
33504 	uint8_t	queue_id6_bw_weight;
33505 	/* ID of CoS Queue 7. */
33506 	uint8_t	queue_id7;
33507 	/*
33508 	 * Minimum BW allocated to CoS Queue.
33509 	 * The HWRM will translate this value into byte counter and
33510 	 * time interval used for this COS inside the device.
33511 	 */
33512 	uint32_t	queue_id7_min_bw;
33513 	/* The bandwidth value. */
33514 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33515 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT		0
33516 	/* The granularity of the value (bits or bytes). */
33517 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE			UINT32_C(0x10000000)
33518 	/* Value is in bits. */
33519 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33520 	/* Value is in bytes. */
33521 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33522 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
33523 	/* bw_value_unit is 3 b */
33524 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33525 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT	29
33526 	/* Value is in Mb or MB (base 10). */
33527 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33528 	/* Value is in Kb or KB (base 10). */
33529 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33530 	/* Value is in bits or bytes. */
33531 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33532 	/* Value is in Gb or GB (base 10). */
33533 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33534 	/* Value is in 1/100th of a percentage of total bandwidth. */
33535 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33536 	/* Invalid unit */
33537 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33538 		#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
33539 	/*
33540 	 * Maximum BW allocated to CoS queue.
33541 	 * The HWRM will translate this value into byte counter and
33542 	 * time interval used for this COS inside the device.
33543 	 */
33544 	uint32_t	queue_id7_max_bw;
33545 	/* The bandwidth value. */
33546 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
33547 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT		0
33548 	/* The granularity of the value (bits or bytes). */
33549 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE			UINT32_C(0x10000000)
33550 	/* Value is in bits. */
33551 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
33552 	/* Value is in bytes. */
33553 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
33554 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
33555 	/* bw_value_unit is 3 b */
33556 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
33557 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT	29
33558 	/* Value is in Mb or MB (base 10). */
33559 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
33560 	/* Value is in Kb or KB (base 10). */
33561 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
33562 	/* Value is in bits or bytes. */
33563 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
33564 	/* Value is in Gb or GB (base 10). */
33565 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
33566 	/* Value is in 1/100th of a percentage of total bandwidth. */
33567 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
33568 	/* Invalid unit */
33569 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
33570 		#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
33571 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
33572 	uint8_t	queue_id7_tsa_assign;
33573 	/* Strict Priority */
33574 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP		UINT32_C(0x0)
33575 	/* Enhanced Transmission Selection */
33576 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS		UINT32_C(0x1)
33577 	/* reserved. */
33578 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
33579 	/* reserved. */
33580 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
33581 	/*
33582 	 * Priority level for strict priority. Valid only when the
33583 	 * tsa_assign is 0 - Strict Priority (SP)
33584 	 * 0..7 - Valid values.
33585 	 * 8..255 - Reserved.
33586 	 */
33587 	uint8_t	queue_id7_pri_lvl;
33588 	/*
33589 	 * Weight used to allocate remaining BW for this COS after
33590 	 * servicing guaranteed bandwidths for all COS.
33591 	 */
33592 	uint8_t	queue_id7_bw_weight;
33593 	uint8_t	unused_1[5];
33594 } hwrm_queue_cos2bw_cfg_input_t, *phwrm_queue_cos2bw_cfg_input_t;
33595 
33596 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
33597 
33598 typedef struct hwrm_queue_cos2bw_cfg_output {
33599 	/* The specific error status for the command. */
33600 	uint16_t	error_code;
33601 	/* The HWRM command request type. */
33602 	uint16_t	req_type;
33603 	/* The sequence ID from the original command. */
33604 	uint16_t	seq_id;
33605 	/* The length of the response data in number of bytes. */
33606 	uint16_t	resp_len;
33607 	uint8_t	unused_0[7];
33608 	/*
33609 	 * This field is used in Output records to indicate that the output
33610 	 * is completely written to RAM. This field should be read as '1'
33611 	 * to indicate that the output has been completely written.
33612 	 * When writing a command completion or response to an internal processor,
33613 	 * the order of writes has to be such that this field is written last.
33614 	 */
33615 	uint8_t	valid;
33616 } hwrm_queue_cos2bw_cfg_output_t, *phwrm_queue_cos2bw_cfg_output_t;
33617 
33618 /*************************
33619  * hwrm_queue_dscp_qcaps *
33620  *************************/
33621 
33622 
33623 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
33624 
33625 typedef struct hwrm_queue_dscp_qcaps_input {
33626 	/* The HWRM command request type. */
33627 	uint16_t	req_type;
33628 	/*
33629 	 * The completion ring to send the completion event on. This should
33630 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33631 	 */
33632 	uint16_t	cmpl_ring;
33633 	/*
33634 	 * The sequence ID is used by the driver for tracking multiple
33635 	 * commands. This ID is treated as opaque data by the firmware and
33636 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33637 	 */
33638 	uint16_t	seq_id;
33639 	/*
33640 	 * The target ID of the command:
33641 	 * * 0x0-0xFFF8 - The function ID
33642 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33643 	 * * 0xFFFD - Reserved for user-space HWRM interface
33644 	 * * 0xFFFF - HWRM
33645 	 */
33646 	uint16_t	target_id;
33647 	/*
33648 	 * A physical address pointer pointing to a host buffer that the
33649 	 * command's response data will be written. This can be either a host
33650 	 * physical address (HPA) or a guest physical address (GPA) and must
33651 	 * point to a physically contiguous block of memory.
33652 	 */
33653 	uint64_t	resp_addr;
33654 	/*
33655 	 * Port ID of port for which the table is being configured.
33656 	 * The HWRM needs to check whether this function is allowed
33657 	 * to configure pri2cos mapping on this port.
33658 	 */
33659 	uint8_t	port_id;
33660 	uint8_t	unused_0[7];
33661 } hwrm_queue_dscp_qcaps_input_t, *phwrm_queue_dscp_qcaps_input_t;
33662 
33663 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
33664 
33665 typedef struct hwrm_queue_dscp_qcaps_output {
33666 	/* The specific error status for the command. */
33667 	uint16_t	error_code;
33668 	/* The HWRM command request type. */
33669 	uint16_t	req_type;
33670 	/* The sequence ID from the original command. */
33671 	uint16_t	seq_id;
33672 	/* The length of the response data in number of bytes. */
33673 	uint16_t	resp_len;
33674 	/* The number of bits provided by the hardware for the DSCP value. */
33675 	uint8_t	num_dscp_bits;
33676 	uint8_t	unused_0;
33677 	/* Max number of DSCP-MASK-PRI entries supported. */
33678 	uint16_t	max_entries;
33679 	uint8_t	unused_1[3];
33680 	/*
33681 	 * This field is used in Output records to indicate that the output
33682 	 * is completely written to RAM. This field should be read as '1'
33683 	 * to indicate that the output has been completely written.
33684 	 * When writing a command completion or response to an internal processor,
33685 	 * the order of writes has to be such that this field is written last.
33686 	 */
33687 	uint8_t	valid;
33688 } hwrm_queue_dscp_qcaps_output_t, *phwrm_queue_dscp_qcaps_output_t;
33689 
33690 /****************************
33691  * hwrm_queue_dscp2pri_qcfg *
33692  ****************************/
33693 
33694 
33695 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
33696 
33697 typedef struct hwrm_queue_dscp2pri_qcfg_input {
33698 	/* The HWRM command request type. */
33699 	uint16_t	req_type;
33700 	/*
33701 	 * The completion ring to send the completion event on. This should
33702 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33703 	 */
33704 	uint16_t	cmpl_ring;
33705 	/*
33706 	 * The sequence ID is used by the driver for tracking multiple
33707 	 * commands. This ID is treated as opaque data by the firmware and
33708 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33709 	 */
33710 	uint16_t	seq_id;
33711 	/*
33712 	 * The target ID of the command:
33713 	 * * 0x0-0xFFF8 - The function ID
33714 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33715 	 * * 0xFFFD - Reserved for user-space HWRM interface
33716 	 * * 0xFFFF - HWRM
33717 	 */
33718 	uint16_t	target_id;
33719 	/*
33720 	 * A physical address pointer pointing to a host buffer that the
33721 	 * command's response data will be written. This can be either a host
33722 	 * physical address (HPA) or a guest physical address (GPA) and must
33723 	 * point to a physically contiguous block of memory.
33724 	 */
33725 	uint64_t	resp_addr;
33726 	/*
33727 	 * This is the host address where the 24-bits DSCP-MASK-PRI
33728 	 * tuple(s) will be copied to.
33729 	 */
33730 	uint64_t	dest_data_addr;
33731 	/*
33732 	 * Port ID of port for which the table is being configured.
33733 	 * The HWRM needs to check whether this function is allowed
33734 	 * to configure pri2cos mapping on this port.
33735 	 */
33736 	uint8_t	port_id;
33737 	uint8_t	unused_0;
33738 	/* Size of the buffer pointed to by dest_data_addr. */
33739 	uint16_t	dest_data_buffer_size;
33740 	uint8_t	unused_1[4];
33741 } hwrm_queue_dscp2pri_qcfg_input_t, *phwrm_queue_dscp2pri_qcfg_input_t;
33742 
33743 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
33744 
33745 typedef struct hwrm_queue_dscp2pri_qcfg_output {
33746 	/* The specific error status for the command. */
33747 	uint16_t	error_code;
33748 	/* The HWRM command request type. */
33749 	uint16_t	req_type;
33750 	/* The sequence ID from the original command. */
33751 	uint16_t	seq_id;
33752 	/* The length of the response data in number of bytes. */
33753 	uint16_t	resp_len;
33754 	/*
33755 	 * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
33756 	 * by the dest_data_addr.
33757 	 */
33758 	uint16_t	entry_cnt;
33759 	/*
33760 	 * This is the default PRI which un-initialized DSCP values are
33761 	 * mapped to.
33762 	 */
33763 	uint8_t	default_pri;
33764 	uint8_t	unused_0[4];
33765 	/*
33766 	 * This field is used in Output records to indicate that the output
33767 	 * is completely written to RAM. This field should be read as '1'
33768 	 * to indicate that the output has been completely written.
33769 	 * When writing a command completion or response to an internal processor,
33770 	 * the order of writes has to be such that this field is written last.
33771 	 */
33772 	uint8_t	valid;
33773 } hwrm_queue_dscp2pri_qcfg_output_t, *phwrm_queue_dscp2pri_qcfg_output_t;
33774 
33775 /***************************
33776  * hwrm_queue_dscp2pri_cfg *
33777  ***************************/
33778 
33779 
33780 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
33781 
33782 typedef struct hwrm_queue_dscp2pri_cfg_input {
33783 	/* The HWRM command request type. */
33784 	uint16_t	req_type;
33785 	/*
33786 	 * The completion ring to send the completion event on. This should
33787 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33788 	 */
33789 	uint16_t	cmpl_ring;
33790 	/*
33791 	 * The sequence ID is used by the driver for tracking multiple
33792 	 * commands. This ID is treated as opaque data by the firmware and
33793 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33794 	 */
33795 	uint16_t	seq_id;
33796 	/*
33797 	 * The target ID of the command:
33798 	 * * 0x0-0xFFF8 - The function ID
33799 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33800 	 * * 0xFFFD - Reserved for user-space HWRM interface
33801 	 * * 0xFFFF - HWRM
33802 	 */
33803 	uint16_t	target_id;
33804 	/*
33805 	 * A physical address pointer pointing to a host buffer that the
33806 	 * command's response data will be written. This can be either a host
33807 	 * physical address (HPA) or a guest physical address (GPA) and must
33808 	 * point to a physically contiguous block of memory.
33809 	 */
33810 	uint64_t	resp_addr;
33811 	/*
33812 	 * This is the host address where the 24-bits DSCP-MASK-PRI tuple
33813 	 * will be copied from. A non-zero mask "adds" a tuple, while
33814 	 * a mask equal to 0 triggers the firmware to remove a tuple.
33815 	 * Only tuples with unique DSCP values are stored. On chips
33816 	 * prior to Thor a mask can be 0 - 0x3f, while on Thor it can
33817 	 * be 0 or 0x3f.
33818 	 */
33819 	uint64_t	src_data_addr;
33820 	uint32_t	flags;
33821 	/* use_hw_default_pri is 1 b */
33822 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI	UINT32_C(0x1)
33823 	uint32_t	enables;
33824 	/*
33825 	 * This bit must be '1' for the default_pri field to be
33826 	 * configured.
33827 	 */
33828 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI	UINT32_C(0x1)
33829 	/*
33830 	 * Port ID of port for which the table is being configured.
33831 	 * The HWRM needs to check whether this function is allowed
33832 	 * to configure pri2cos mapping on this port.
33833 	 */
33834 	uint8_t	port_id;
33835 	/*
33836 	 * This is the default PRI which un-initialized DSCP values will be
33837 	 * mapped to.
33838 	 */
33839 	uint8_t	default_pri;
33840 	/*
33841 	 * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
33842 	 * to by src_data_addr.
33843 	 */
33844 	uint16_t	entry_cnt;
33845 	uint8_t	unused_0[4];
33846 } hwrm_queue_dscp2pri_cfg_input_t, *phwrm_queue_dscp2pri_cfg_input_t;
33847 
33848 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
33849 
33850 typedef struct hwrm_queue_dscp2pri_cfg_output {
33851 	/* The specific error status for the command. */
33852 	uint16_t	error_code;
33853 	/* The HWRM command request type. */
33854 	uint16_t	req_type;
33855 	/* The sequence ID from the original command. */
33856 	uint16_t	seq_id;
33857 	/* The length of the response data in number of bytes. */
33858 	uint16_t	resp_len;
33859 	uint8_t	unused_0[7];
33860 	/*
33861 	 * This field is used in Output records to indicate that the output
33862 	 * is completely written to RAM. This field should be read as '1'
33863 	 * to indicate that the output has been completely written.
33864 	 * When writing a command completion or response to an internal processor,
33865 	 * the order of writes has to be such that this field is written last.
33866 	 */
33867 	uint8_t	valid;
33868 } hwrm_queue_dscp2pri_cfg_output_t, *phwrm_queue_dscp2pri_cfg_output_t;
33869 
33870 /*************************
33871  * hwrm_queue_mpls_qcaps *
33872  *************************/
33873 
33874 
33875 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
33876 
33877 typedef struct hwrm_queue_mpls_qcaps_input {
33878 	/* The HWRM command request type. */
33879 	uint16_t	req_type;
33880 	/*
33881 	 * The completion ring to send the completion event on. This should
33882 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33883 	 */
33884 	uint16_t	cmpl_ring;
33885 	/*
33886 	 * The sequence ID is used by the driver for tracking multiple
33887 	 * commands. This ID is treated as opaque data by the firmware and
33888 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33889 	 */
33890 	uint16_t	seq_id;
33891 	/*
33892 	 * The target ID of the command:
33893 	 * * 0x0-0xFFF8 - The function ID
33894 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33895 	 * * 0xFFFD - Reserved for user-space HWRM interface
33896 	 * * 0xFFFF - HWRM
33897 	 */
33898 	uint16_t	target_id;
33899 	/*
33900 	 * A physical address pointer pointing to a host buffer that the
33901 	 * command's response data will be written. This can be either a host
33902 	 * physical address (HPA) or a guest physical address (GPA) and must
33903 	 * point to a physically contiguous block of memory.
33904 	 */
33905 	uint64_t	resp_addr;
33906 	/*
33907 	 * Port ID of port for which the table is being configured.
33908 	 * The HWRM needs to check whether this function is allowed
33909 	 * to configure MPLS TC(EXP) to pri mapping on this port.
33910 	 */
33911 	uint8_t	port_id;
33912 	uint8_t	unused_0[7];
33913 } hwrm_queue_mpls_qcaps_input_t, *phwrm_queue_mpls_qcaps_input_t;
33914 
33915 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
33916 
33917 typedef struct hwrm_queue_mpls_qcaps_output {
33918 	/* The specific error status for the command. */
33919 	uint16_t	error_code;
33920 	/* The HWRM command request type. */
33921 	uint16_t	req_type;
33922 	/* The sequence ID from the original command. */
33923 	uint16_t	seq_id;
33924 	/* The length of the response data in number of bytes. */
33925 	uint16_t	resp_len;
33926 	/*
33927 	 * Bitmask indicating which queues can be configured by the
33928 	 * hwrm_queue_mplstc2pri_cfg command.
33929 	 *
33930 	 * Each bit represents a specific pri where bit 0 represents
33931 	 * pri 0 and bit 7 represents pri 7.
33932 	 * # A value of 0 indicates that the pri is not configurable
33933 	 * by the hwrm_queue_mplstc2pri_cfg command.
33934 	 * # A value of 1 indicates that the pri is configurable.
33935 	 * # A hwrm_queue_mplstc2pri_cfg command shall return error when
33936 	 * trying to configure a pri that is not configurable.
33937 	 */
33938 	uint8_t	queue_mplstc2pri_cfg_allowed;
33939 	/*
33940 	 * This is the default PRI which un-initialized MPLS values will be
33941 	 * mapped to.
33942 	 */
33943 	uint8_t	hw_default_pri;
33944 	uint8_t	unused_0[5];
33945 	/*
33946 	 * This field is used in Output records to indicate that the output
33947 	 * is completely written to RAM. This field should be read as '1'
33948 	 * to indicate that the output has been completely written.
33949 	 * When writing a command completion or response to an internal processor,
33950 	 * the order of writes has to be such that this field is written last.
33951 	 */
33952 	uint8_t	valid;
33953 } hwrm_queue_mpls_qcaps_output_t, *phwrm_queue_mpls_qcaps_output_t;
33954 
33955 /******************************
33956  * hwrm_queue_mplstc2pri_qcfg *
33957  ******************************/
33958 
33959 
33960 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
33961 
33962 typedef struct hwrm_queue_mplstc2pri_qcfg_input {
33963 	/* The HWRM command request type. */
33964 	uint16_t	req_type;
33965 	/*
33966 	 * The completion ring to send the completion event on. This should
33967 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33968 	 */
33969 	uint16_t	cmpl_ring;
33970 	/*
33971 	 * The sequence ID is used by the driver for tracking multiple
33972 	 * commands. This ID is treated as opaque data by the firmware and
33973 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33974 	 */
33975 	uint16_t	seq_id;
33976 	/*
33977 	 * The target ID of the command:
33978 	 * * 0x0-0xFFF8 - The function ID
33979 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33980 	 * * 0xFFFD - Reserved for user-space HWRM interface
33981 	 * * 0xFFFF - HWRM
33982 	 */
33983 	uint16_t	target_id;
33984 	/*
33985 	 * A physical address pointer pointing to a host buffer that the
33986 	 * command's response data will be written. This can be either a host
33987 	 * physical address (HPA) or a guest physical address (GPA) and must
33988 	 * point to a physically contiguous block of memory.
33989 	 */
33990 	uint64_t	resp_addr;
33991 	/*
33992 	 * Port ID of port for which the table is being configured.
33993 	 * The HWRM needs to check whether this function is allowed
33994 	 * to configure MPLS TC(EXP) to pri mapping on this port.
33995 	 */
33996 	uint8_t	port_id;
33997 	uint8_t	unused_0[7];
33998 } hwrm_queue_mplstc2pri_qcfg_input_t, *phwrm_queue_mplstc2pri_qcfg_input_t;
33999 
34000 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
34001 
34002 typedef struct hwrm_queue_mplstc2pri_qcfg_output {
34003 	/* The specific error status for the command. */
34004 	uint16_t	error_code;
34005 	/* The HWRM command request type. */
34006 	uint16_t	req_type;
34007 	/* The sequence ID from the original command. */
34008 	uint16_t	seq_id;
34009 	/* The length of the response data in number of bytes. */
34010 	uint16_t	resp_len;
34011 	/*
34012 	 * pri assigned to MPLS TC(EXP) 0. This value can only be changed
34013 	 * before traffic has started.
34014 	 * A value of 0xff indicates that no pri is assigned to the
34015 	 * MPLS TC(EXP) 0.
34016 	 */
34017 	uint8_t	tc0_pri_queue_id;
34018 	/*
34019 	 * pri assigned to MPLS TC(EXP) 1. This value can only be changed
34020 	 * before traffic has started.
34021 	 * A value of 0xff indicates that no pri is assigned to the
34022 	 * MPLS TC(EXP) 1.
34023 	 */
34024 	uint8_t	tc1_pri_queue_id;
34025 	/*
34026 	 * pri assigned to MPLS TC(EXP) 2. This value can only be changed
34027 	 * before traffic has started.
34028 	 * A value of 0xff indicates that no pri is assigned to the
34029 	 * MPLS TC(EXP) 2.
34030 	 */
34031 	uint8_t	tc2_pri_queue_id;
34032 	/*
34033 	 * pri assigned to MPLS TC(EXP) 3. This value can only be changed
34034 	 * before traffic has started.
34035 	 * A value of 0xff indicates that no pri is assigned to the
34036 	 * MPLS TC(EXP) 3.
34037 	 */
34038 	uint8_t	tc3_pri_queue_id;
34039 	/*
34040 	 * pri assigned to MPLS TC(EXP) 4. This value can only be changed
34041 	 * before traffic has started.
34042 	 * A value of 0xff indicates that no pri is assigned to the
34043 	 * MPLS TC(EXP) 4.
34044 	 */
34045 	uint8_t	tc4_pri_queue_id;
34046 	/*
34047 	 * pri assigned to MPLS TC(EXP) 5. This value can only be changed
34048 	 * before traffic has started.
34049 	 * A value of 0xff indicates that no pri is assigned to the
34050 	 * MPLS TC(EXP) 5.
34051 	 */
34052 	uint8_t	tc5_pri_queue_id;
34053 	/*
34054 	 * pri assigned to MPLS TC(EXP) 6. This value can only
34055 	 * be changed before traffic has started.
34056 	 * A value of 0xff indicates that no pri is assigned to the
34057 	 * MPLS TC(EXP) 6.
34058 	 */
34059 	uint8_t	tc6_pri_queue_id;
34060 	/*
34061 	 * pri assigned to MPLS TC(EXP) 7. This value can only
34062 	 * be changed before traffic has started.
34063 	 * A value of 0xff indicates that no pri is assigned to the
34064 	 * MPLS TC(EXP) 7.
34065 	 */
34066 	uint8_t	tc7_pri_queue_id;
34067 	uint8_t	unused_0[7];
34068 	/*
34069 	 * This field is used in Output records to indicate that the output
34070 	 * is completely written to RAM. This field should be read as '1'
34071 	 * to indicate that the output has been completely written.
34072 	 * When writing a command completion or response to an internal processor,
34073 	 * the order of writes has to be such that this field is written last.
34074 	 */
34075 	uint8_t	valid;
34076 } hwrm_queue_mplstc2pri_qcfg_output_t, *phwrm_queue_mplstc2pri_qcfg_output_t;
34077 
34078 /*****************************
34079  * hwrm_queue_mplstc2pri_cfg *
34080  *****************************/
34081 
34082 
34083 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
34084 
34085 typedef struct hwrm_queue_mplstc2pri_cfg_input {
34086 	/* The HWRM command request type. */
34087 	uint16_t	req_type;
34088 	/*
34089 	 * The completion ring to send the completion event on. This should
34090 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34091 	 */
34092 	uint16_t	cmpl_ring;
34093 	/*
34094 	 * The sequence ID is used by the driver for tracking multiple
34095 	 * commands. This ID is treated as opaque data by the firmware and
34096 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34097 	 */
34098 	uint16_t	seq_id;
34099 	/*
34100 	 * The target ID of the command:
34101 	 * * 0x0-0xFFF8 - The function ID
34102 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34103 	 * * 0xFFFD - Reserved for user-space HWRM interface
34104 	 * * 0xFFFF - HWRM
34105 	 */
34106 	uint16_t	target_id;
34107 	/*
34108 	 * A physical address pointer pointing to a host buffer that the
34109 	 * command's response data will be written. This can be either a host
34110 	 * physical address (HPA) or a guest physical address (GPA) and must
34111 	 * point to a physically contiguous block of memory.
34112 	 */
34113 	uint64_t	resp_addr;
34114 	uint32_t	enables;
34115 	/*
34116 	 * This bit must be '1' for the mplstc0_pri_queue_id field to be
34117 	 * configured.
34118 	 */
34119 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID	UINT32_C(0x1)
34120 	/*
34121 	 * This bit must be '1' for the mplstc1_pri_queue_id field to be
34122 	 * configured.
34123 	 */
34124 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID	UINT32_C(0x2)
34125 	/*
34126 	 * This bit must be '1' for the mplstc2_pri_queue_id field to be
34127 	 * configured.
34128 	 */
34129 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID	UINT32_C(0x4)
34130 	/*
34131 	 * This bit must be '1' for the mplstc3_pri_queue_id field to be
34132 	 * configured.
34133 	 */
34134 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID	UINT32_C(0x8)
34135 	/*
34136 	 * This bit must be '1' for the mplstc4_pri_queue_id field to be
34137 	 * configured.
34138 	 */
34139 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID	UINT32_C(0x10)
34140 	/*
34141 	 * This bit must be '1' for the mplstc5_pri_queue_id field to be
34142 	 * configured.
34143 	 */
34144 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID	UINT32_C(0x20)
34145 	/*
34146 	 * This bit must be '1' for the mplstc6_pri_queue_id field to be
34147 	 * configured.
34148 	 */
34149 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID	UINT32_C(0x40)
34150 	/*
34151 	 * This bit must be '1' for the mplstc7_pri_queue_id field to be
34152 	 * configured.
34153 	 */
34154 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID	UINT32_C(0x80)
34155 	/*
34156 	 * Port ID of port for which the table is being configured.
34157 	 * The HWRM needs to check whether this function is allowed
34158 	 * to configure MPLS TC(EXP)to pri mapping on this port.
34159 	 */
34160 	uint8_t	port_id;
34161 	uint8_t	unused_0[3];
34162 	/*
34163 	 * pri assigned to MPLS TC(EXP) 0. This value can only
34164 	 * be changed before traffic has started.
34165 	 */
34166 	uint8_t	tc0_pri_queue_id;
34167 	/*
34168 	 * pri assigned to MPLS TC(EXP) 1. This value can only
34169 	 * be changed before traffic has started.
34170 	 */
34171 	uint8_t	tc1_pri_queue_id;
34172 	/*
34173 	 * pri assigned to MPLS TC(EXP) 2  This value can only
34174 	 * be changed before traffic has started.
34175 	 */
34176 	uint8_t	tc2_pri_queue_id;
34177 	/*
34178 	 * pri assigned to MPLS TC(EXP) 3. This value can only
34179 	 * be changed before traffic has started.
34180 	 */
34181 	uint8_t	tc3_pri_queue_id;
34182 	/*
34183 	 * pri assigned to MPLS TC(EXP) 4. This value can only
34184 	 * be changed before traffic has started.
34185 	 */
34186 	uint8_t	tc4_pri_queue_id;
34187 	/*
34188 	 * pri assigned to MPLS TC(EXP) 5. This value can only
34189 	 * be changed before traffic has started.
34190 	 */
34191 	uint8_t	tc5_pri_queue_id;
34192 	/*
34193 	 * pri assigned to MPLS TC(EXP) 6. This value can only
34194 	 * be changed before traffic has started.
34195 	 */
34196 	uint8_t	tc6_pri_queue_id;
34197 	/*
34198 	 * pri assigned to MPLS TC(EXP) 7. This value can only
34199 	 * be changed before traffic has started.
34200 	 */
34201 	uint8_t	tc7_pri_queue_id;
34202 } hwrm_queue_mplstc2pri_cfg_input_t, *phwrm_queue_mplstc2pri_cfg_input_t;
34203 
34204 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
34205 
34206 typedef struct hwrm_queue_mplstc2pri_cfg_output {
34207 	/* The specific error status for the command. */
34208 	uint16_t	error_code;
34209 	/* The HWRM command request type. */
34210 	uint16_t	req_type;
34211 	/* The sequence ID from the original command. */
34212 	uint16_t	seq_id;
34213 	/* The length of the response data in number of bytes. */
34214 	uint16_t	resp_len;
34215 	uint8_t	unused_0[7];
34216 	/*
34217 	 * This field is used in Output records to indicate that the output
34218 	 * is completely written to RAM. This field should be read as '1'
34219 	 * to indicate that the output has been completely written.
34220 	 * When writing a command completion or response to an internal processor,
34221 	 * the order of writes has to be such that this field is written last.
34222 	 */
34223 	uint8_t	valid;
34224 } hwrm_queue_mplstc2pri_cfg_output_t, *phwrm_queue_mplstc2pri_cfg_output_t;
34225 
34226 /****************************
34227  * hwrm_queue_vlanpri_qcaps *
34228  ****************************/
34229 
34230 
34231 /* hwrm_queue_vlanpri_qcaps_input (size:192b/24B) */
34232 
34233 typedef struct hwrm_queue_vlanpri_qcaps_input {
34234 	/* The HWRM command request type. */
34235 	uint16_t	req_type;
34236 	/*
34237 	 * The completion ring to send the completion event on. This should
34238 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34239 	 */
34240 	uint16_t	cmpl_ring;
34241 	/*
34242 	 * The sequence ID is used by the driver for tracking multiple
34243 	 * commands. This ID is treated as opaque data by the firmware and
34244 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34245 	 */
34246 	uint16_t	seq_id;
34247 	/*
34248 	 * The target ID of the command:
34249 	 * * 0x0-0xFFF8 - The function ID
34250 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34251 	 * * 0xFFFD - Reserved for user-space HWRM interface
34252 	 * * 0xFFFF - HWRM
34253 	 */
34254 	uint16_t	target_id;
34255 	/*
34256 	 * A physical address pointer pointing to a host buffer that the
34257 	 * command's response data will be written. This can be either a host
34258 	 * physical address (HPA) or a guest physical address (GPA) and must
34259 	 * point to a physically contiguous block of memory.
34260 	 */
34261 	uint64_t	resp_addr;
34262 	/*
34263 	 * Port ID of port for which the table is being configured.
34264 	 * The HWRM needs to check whether this function is allowed
34265 	 * to configure VLAN priority to user priority mapping on this port.
34266 	 */
34267 	uint8_t	port_id;
34268 	uint8_t	unused_0[7];
34269 } hwrm_queue_vlanpri_qcaps_input_t, *phwrm_queue_vlanpri_qcaps_input_t;
34270 
34271 /* hwrm_queue_vlanpri_qcaps_output (size:128b/16B) */
34272 
34273 typedef struct hwrm_queue_vlanpri_qcaps_output {
34274 	/* The specific error status for the command. */
34275 	uint16_t	error_code;
34276 	/* The HWRM command request type. */
34277 	uint16_t	req_type;
34278 	/* The sequence ID from the original command. */
34279 	uint16_t	seq_id;
34280 	/* The length of the response data in number of bytes. */
34281 	uint16_t	resp_len;
34282 	/*
34283 	 * This is the default user priority which all VLAN priority values
34284 	 * are mapped to if there is no VLAN priority to user priority mapping.
34285 	 */
34286 	uint8_t	hw_default_pri;
34287 	uint8_t	unused_0[6];
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.
34292 	 * When 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_queue_vlanpri_qcaps_output_t, *phwrm_queue_vlanpri_qcaps_output_t;
34297 
34298 /*******************************
34299  * hwrm_queue_vlanpri2pri_qcfg *
34300  *******************************/
34301 
34302 
34303 /* hwrm_queue_vlanpri2pri_qcfg_input (size:192b/24B) */
34304 
34305 typedef struct hwrm_queue_vlanpri2pri_qcfg_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 	/*
34335 	 * Port ID of port for which the table is being configured.
34336 	 * The HWRM needs to check whether this function is allowed
34337 	 * to configure VLAN priority to user priority mapping on this port.
34338 	 */
34339 	uint8_t	port_id;
34340 	uint8_t	unused_0[7];
34341 } hwrm_queue_vlanpri2pri_qcfg_input_t, *phwrm_queue_vlanpri2pri_qcfg_input_t;
34342 
34343 /* hwrm_queue_vlanpri2pri_qcfg_output (size:192b/24B) */
34344 
34345 typedef struct hwrm_queue_vlanpri2pri_qcfg_output {
34346 	/* The specific error status for the command. */
34347 	uint16_t	error_code;
34348 	/* The HWRM command request type. */
34349 	uint16_t	req_type;
34350 	/* The sequence ID from the original command. */
34351 	uint16_t	seq_id;
34352 	/* The length of the response data in number of bytes. */
34353 	uint16_t	resp_len;
34354 	/*
34355 	 * User priority assigned to VLAN priority 0. A value of 0xff
34356 	 * indicates that no user priority is assigned. The default user
34357 	 * priority will be used.
34358 	 */
34359 	uint8_t	vlanpri0_user_pri_id;
34360 	/*
34361 	 * User priority assigned to VLAN priority 1. A value of 0xff
34362 	 * indicates that no user priority is assigned. The default user
34363 	 * priority will be used.
34364 	 */
34365 	uint8_t	vlanpri1_user_pri_id;
34366 	/*
34367 	 * User priority assigned to VLAN priority 2. A value of 0xff
34368 	 * indicates that no user priority is assigned. The default user
34369 	 * priority will be used.
34370 	 */
34371 	uint8_t	vlanpri2_user_pri_id;
34372 	/*
34373 	 * User priority assigned to VLAN priority 3. A value of 0xff
34374 	 * indicates that no user priority is assigned. The default user
34375 	 * priority will be used.
34376 	 */
34377 	uint8_t	vlanpri3_user_pri_id;
34378 	/*
34379 	 * User priority assigned to VLAN priority 4. A value of 0xff
34380 	 * indicates that no user priority is assigned. The default user
34381 	 * priority will be used.
34382 	 */
34383 	uint8_t	vlanpri4_user_pri_id;
34384 	/*
34385 	 * User priority assigned to VLAN priority 5. A value of 0xff
34386 	 * indicates that no user priority is assigned. The default user
34387 	 * priority will be used.
34388 	 */
34389 	uint8_t	vlanpri5_user_pri_id;
34390 	/*
34391 	 * User priority assigned to VLAN priority 6. A value of 0xff
34392 	 * indicates that no user priority is assigned. The default user
34393 	 * priority will be used.
34394 	 */
34395 	uint8_t	vlanpri6_user_pri_id;
34396 	/*
34397 	 * User priority assigned to VLAN priority 7. A value of 0xff
34398 	 * indicates that no user priority is assigned. The default user
34399 	 * priority will be used.
34400 	 */
34401 	uint8_t	vlanpri7_user_pri_id;
34402 	uint8_t	unused_0[7];
34403 	/*
34404 	 * This field is used in Output records to indicate that the output
34405 	 * is completely written to RAM. This field should be read as '1'
34406 	 * to indicate that the output has been completely written.
34407 	 * When writing a command completion or response to an internal processor,
34408 	 * the order of writes has to be such that this field is written last.
34409 	 */
34410 	uint8_t	valid;
34411 } hwrm_queue_vlanpri2pri_qcfg_output_t, *phwrm_queue_vlanpri2pri_qcfg_output_t;
34412 
34413 /******************************
34414  * hwrm_queue_vlanpri2pri_cfg *
34415  ******************************/
34416 
34417 
34418 /* hwrm_queue_vlanpri2pri_cfg_input (size:256b/32B) */
34419 
34420 typedef struct hwrm_queue_vlanpri2pri_cfg_input {
34421 	/* The HWRM command request type. */
34422 	uint16_t	req_type;
34423 	/*
34424 	 * The completion ring to send the completion event on. This should
34425 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34426 	 */
34427 	uint16_t	cmpl_ring;
34428 	/*
34429 	 * The sequence ID is used by the driver for tracking multiple
34430 	 * commands. This ID is treated as opaque data by the firmware and
34431 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34432 	 */
34433 	uint16_t	seq_id;
34434 	/*
34435 	 * The target ID of the command:
34436 	 * * 0x0-0xFFF8 - The function ID
34437 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34438 	 * * 0xFFFD - Reserved for user-space HWRM interface
34439 	 * * 0xFFFF - HWRM
34440 	 */
34441 	uint16_t	target_id;
34442 	/*
34443 	 * A physical address pointer pointing to a host buffer that the
34444 	 * command's response data will be written. This can be either a host
34445 	 * physical address (HPA) or a guest physical address (GPA) and must
34446 	 * point to a physically contiguous block of memory.
34447 	 */
34448 	uint64_t	resp_addr;
34449 	uint32_t	enables;
34450 	/*
34451 	 * This bit must be '1' for the vlanpri0_user_pri_id field to be
34452 	 * configured.
34453 	 */
34454 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI0_USER_PRI_ID	UINT32_C(0x1)
34455 	/*
34456 	 * This bit must be '1' for the vlanpri1_user_pri_id field to be
34457 	 * configured.
34458 	 */
34459 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI1_USER_PRI_ID	UINT32_C(0x2)
34460 	/*
34461 	 * This bit must be '1' for the vlanpri2_user_pri_id field to be
34462 	 * configured.
34463 	 */
34464 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI2_USER_PRI_ID	UINT32_C(0x4)
34465 	/*
34466 	 * This bit must be '1' for the vlanpri3_user_pri_id field to be
34467 	 * configured.
34468 	 */
34469 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI3_USER_PRI_ID	UINT32_C(0x8)
34470 	/*
34471 	 * This bit must be '1' for the vlanpri4_user_pri_id field to be
34472 	 * configured.
34473 	 */
34474 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI4_USER_PRI_ID	UINT32_C(0x10)
34475 	/*
34476 	 * This bit must be '1' for the vlanpri5_user_pri_id field to be
34477 	 * configured.
34478 	 */
34479 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI5_USER_PRI_ID	UINT32_C(0x20)
34480 	/*
34481 	 * This bit must be '1' for the vlanpri6_user_pri_id field to be
34482 	 * configured.
34483 	 */
34484 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI6_USER_PRI_ID	UINT32_C(0x40)
34485 	/*
34486 	 * This bit must be '1' for the vlanpri7_user_pri_id field to be
34487 	 * configured.
34488 	 */
34489 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI7_USER_PRI_ID	UINT32_C(0x80)
34490 	/*
34491 	 * Port ID of port for which the table is being configured.
34492 	 * The HWRM needs to check whether this function is allowed
34493 	 * to configure VLAN priority to user priority mapping on this port.
34494 	 */
34495 	uint8_t	port_id;
34496 	uint8_t	unused_0[3];
34497 	/*
34498 	 * User priority assigned to VLAN priority 0. This value can only
34499 	 * be changed before traffic has started.
34500 	 */
34501 	uint8_t	vlanpri0_user_pri_id;
34502 	/*
34503 	 * User priority assigned to VLAN priority 1. This value can only
34504 	 * be changed before traffic has started.
34505 	 */
34506 	uint8_t	vlanpri1_user_pri_id;
34507 	/*
34508 	 * User priority assigned to VLAN priority 2. This value can only
34509 	 * be changed before traffic has started.
34510 	 */
34511 	uint8_t	vlanpri2_user_pri_id;
34512 	/*
34513 	 * User priority assigned to VLAN priority 3. This value can only
34514 	 * be changed before traffic has started.
34515 	 */
34516 	uint8_t	vlanpri3_user_pri_id;
34517 	/*
34518 	 * User priority assigned to VLAN priority 4. This value can only
34519 	 * be changed before traffic has started.
34520 	 */
34521 	uint8_t	vlanpri4_user_pri_id;
34522 	/*
34523 	 * User priority assigned to VLAN priority 5. This value can only
34524 	 * be changed before traffic has started.
34525 	 */
34526 	uint8_t	vlanpri5_user_pri_id;
34527 	/*
34528 	 * User priority assigned to VLAN priority 6. This value can only
34529 	 * be changed before traffic has started.
34530 	 */
34531 	uint8_t	vlanpri6_user_pri_id;
34532 	/*
34533 	 * User priority assigned to VLAN priority 7. This value can only
34534 	 * be changed before traffic has started.
34535 	 */
34536 	uint8_t	vlanpri7_user_pri_id;
34537 } hwrm_queue_vlanpri2pri_cfg_input_t, *phwrm_queue_vlanpri2pri_cfg_input_t;
34538 
34539 /* hwrm_queue_vlanpri2pri_cfg_output (size:128b/16B) */
34540 
34541 typedef struct hwrm_queue_vlanpri2pri_cfg_output {
34542 	/* The specific error status for the command. */
34543 	uint16_t	error_code;
34544 	/* The HWRM command request type. */
34545 	uint16_t	req_type;
34546 	/* The sequence ID from the original command. */
34547 	uint16_t	seq_id;
34548 	/* The length of the response data in number of bytes. */
34549 	uint16_t	resp_len;
34550 	uint8_t	unused_0[7];
34551 	/*
34552 	 * This field is used in Output records to indicate that the output
34553 	 * is completely written to RAM. This field should be read as '1'
34554 	 * to indicate that the output has been completely written.
34555 	 * When writing a command completion or response to an internal processor,
34556 	 * the order of writes has to be such that this field is written last.
34557 	 */
34558 	uint8_t	valid;
34559 } hwrm_queue_vlanpri2pri_cfg_output_t, *phwrm_queue_vlanpri2pri_cfg_output_t;
34560 
34561 /*************************
34562  * hwrm_queue_global_cfg *
34563  *************************/
34564 
34565 
34566 /* hwrm_queue_global_cfg_input (size:192b/24B) */
34567 
34568 typedef struct hwrm_queue_global_cfg_input {
34569 	/* The HWRM command request type. */
34570 	uint16_t	req_type;
34571 	/*
34572 	 * The completion ring to send the completion event on. This should
34573 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34574 	 */
34575 	uint16_t	cmpl_ring;
34576 	/*
34577 	 * The sequence ID is used by the driver for tracking multiple
34578 	 * commands. This ID is treated as opaque data by the firmware and
34579 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34580 	 */
34581 	uint16_t	seq_id;
34582 	/*
34583 	 * The target ID of the command:
34584 	 * * 0x0-0xFFF8 - The function ID
34585 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34586 	 * * 0xFFFD - Reserved for user-space HWRM interface
34587 	 * * 0xFFFF - HWRM
34588 	 */
34589 	uint16_t	target_id;
34590 	/*
34591 	 * A physical address pointer pointing to a host buffer that the
34592 	 * command's response data will be written. This can be either a host
34593 	 * physical address (HPA) or a guest physical address (GPA) and must
34594 	 * point to a physically contiguous block of memory.
34595 	 */
34596 	uint64_t	resp_addr;
34597 	/*
34598 	 * Configuration mode for rx cos queues, configuring whether they
34599 	 * use one shared buffer pool (across ports or PCIe endpoints) or
34600 	 * independent per port or per endpoint buffer pools.
34601 	 */
34602 	uint8_t	mode;
34603 	/* One shared buffer pool to be used by all RX CoS queues */
34604 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_SHARED	UINT32_C(0x0)
34605 	/*
34606 	 * Each port or PCIe endpoint to use an independent buffer pool
34607 	 * for its RX CoS queues
34608 	 */
34609 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT UINT32_C(0x1)
34610 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_LAST	HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT
34611 	uint8_t	unused_0;
34612 	uint16_t	enables;
34613 	/* This bit must be '1' when the mode field is configured. */
34614 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_MODE	UINT32_C(0x1)
34615 	/*
34616 	 * This bit must be '1' when the maximum bandwidth for queue group 0
34617 	 * (g0_max_bw) is configured.
34618 	 */
34619 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G0_MAX_BW	UINT32_C(0x2)
34620 	/*
34621 	 * This bit must be '1' when the maximum bandwidth for queue group 1
34622 	 * (g1_max_bw) is configured.
34623 	 */
34624 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G1_MAX_BW	UINT32_C(0x4)
34625 	/*
34626 	 * This bit must be '1' when the maximum bandwidth for queue group 2
34627 	 * (g2_max_bw) is configured.
34628 	 */
34629 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G2_MAX_BW	UINT32_C(0x8)
34630 	/*
34631 	 * This bit must be '1' when the maximum bandwidth for queue group 3
34632 	 * (g3_max_bw) is configured.
34633 	 */
34634 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G3_MAX_BW	UINT32_C(0x10)
34635 	/*
34636 	 * Specifies the maximum receive rate, as a percentage of total link
34637 	 * bandwidth, of the receive traffic through queue group 0. A value
34638 	 * of 0 indicates no rate limit.
34639 	 *
34640 	 * A queue group is a set of queues, one per traffic class. In
34641 	 * single-host mode, each panel port has its own queue group, and thus,
34642 	 * this rate limit shapes the traffic received on a port, in this case,
34643 	 * through port 0. In multi-root or multi-host mode, each PCIe endpoint
34644 	 * on the NIC has its own queue group. In these cases, the rate limit
34645 	 * shapes the traffic sent to the host through one of the PCIe
34646 	 * endpoints, in this case endpoint 0.
34647 	 */
34648 	uint8_t	g0_max_bw;
34649 	/*
34650 	 * Specifies the maximum rate of the traffic through receive CoS queue
34651 	 * group 1 (for port 1 or PCIe endpoint 1). The rate is a percentage of
34652 	 * total link bandwidth (the sum of the bandwidths of all links). A
34653 	 * value of 0 indicates no rate limit.
34654 	 */
34655 	uint8_t	g1_max_bw;
34656 	/*
34657 	 * Specifies the maximum rate of the traffic through receive CoS queue
34658 	 * group 2 (for port 2 or PCIe endpoint 2). The rate is a percentage of
34659 	 * total link bandwidth (the sum of the bandwidths of all links). A
34660 	 * value of 0 indicates no rate limit.
34661 	 */
34662 	uint8_t	g2_max_bw;
34663 	/*
34664 	 * Specifies the maximum receive rate, in Mbps, of the receive traffic
34665 	 * through queue group 3 (for port 3 or PCIe endpoint 3). A value of 0
34666 	 * indicates no rate limit.
34667 	 */
34668 	uint8_t	g3_max_bw;
34669 } hwrm_queue_global_cfg_input_t, *phwrm_queue_global_cfg_input_t;
34670 
34671 /* hwrm_queue_global_cfg_output (size:128b/16B) */
34672 
34673 typedef struct hwrm_queue_global_cfg_output {
34674 	/* The specific error status for the command. */
34675 	uint16_t	error_code;
34676 	/* The HWRM command request type. */
34677 	uint16_t	req_type;
34678 	/* The sequence ID from the original command. */
34679 	uint16_t	seq_id;
34680 	/* The length of the response data in number of bytes. */
34681 	uint16_t	resp_len;
34682 	uint8_t	unused_0[7];
34683 	/*
34684 	 * This field is used in Output records to indicate that the output
34685 	 * is completely written to RAM. This field should be read as '1'
34686 	 * to indicate that the output has been completely written.
34687 	 * When writing a command completion or response to an internal processor,
34688 	 * the order of writes has to be such that this field is written last.
34689 	 */
34690 	uint8_t	valid;
34691 } hwrm_queue_global_cfg_output_t, *phwrm_queue_global_cfg_output_t;
34692 
34693 /**************************
34694  * hwrm_queue_global_qcfg *
34695  **************************/
34696 
34697 
34698 /* hwrm_queue_global_qcfg_input (size:128b/16B) */
34699 
34700 typedef struct hwrm_queue_global_qcfg_input {
34701 	/* The HWRM command request type. */
34702 	uint16_t	req_type;
34703 	/*
34704 	 * The completion ring to send the completion event on. This should
34705 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34706 	 */
34707 	uint16_t	cmpl_ring;
34708 	/*
34709 	 * The sequence ID is used by the driver for tracking multiple
34710 	 * commands. This ID is treated as opaque data by the firmware and
34711 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34712 	 */
34713 	uint16_t	seq_id;
34714 	/*
34715 	 * The target ID of the command:
34716 	 * * 0x0-0xFFF8 - The function ID
34717 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34718 	 * * 0xFFFD - Reserved for user-space HWRM interface
34719 	 * * 0xFFFF - HWRM
34720 	 */
34721 	uint16_t	target_id;
34722 	/*
34723 	 * A physical address pointer pointing to a host buffer that the
34724 	 * command's response data will be written. This can be either a host
34725 	 * physical address (HPA) or a guest physical address (GPA) and must
34726 	 * point to a physically contiguous block of memory.
34727 	 */
34728 	uint64_t	resp_addr;
34729 } hwrm_queue_global_qcfg_input_t, *phwrm_queue_global_qcfg_input_t;
34730 
34731 /* hwrm_queue_global_qcfg_output (size:320b/40B) */
34732 
34733 typedef struct hwrm_queue_global_qcfg_output {
34734 	/* The specific error status for the command. */
34735 	uint16_t	error_code;
34736 	/* The HWRM command request type. */
34737 	uint16_t	req_type;
34738 	/* The sequence ID from the original command. */
34739 	uint16_t	seq_id;
34740 	/* The length of the response data in number of bytes. */
34741 	uint16_t	resp_len;
34742 	/* Port or PCIe endpoint id to be mapped for buffer pool 0. */
34743 	uint8_t	buffer_pool_id0_map;
34744 	/* Port or PCIe endpoint id to be mapped for buffer pool 1. */
34745 	uint8_t	buffer_pool_id1_map;
34746 	/* Port or PCIe endpoint id to be mapped for buffer pool 2. */
34747 	uint8_t	buffer_pool_id2_map;
34748 	/* Port or PCIe endpoint id to be mapped for buffer pool 3. */
34749 	uint8_t	buffer_pool_id3_map;
34750 	/* Size of buffer pool 0 (KBytes). */
34751 	uint32_t	buffer_pool_id0_size;
34752 	/* Size of buffer pool 1 (KBytes). */
34753 	uint32_t	buffer_pool_id1_size;
34754 	/* Size of buffer pool 2 (KBytes). */
34755 	uint32_t	buffer_pool_id2_size;
34756 	/* Size of buffer pool 3 (KBytes). */
34757 	uint32_t	buffer_pool_id3_size;
34758 	uint16_t	flags;
34759 	/*
34760 	 * Enumeration denoting whether the rx buffer pool mapping is
34761 	 * per port or per PCIe endpoint
34762 	 */
34763 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING			UINT32_C(0x1)
34764 	/*
34765 	 * The buffer_pool_id[0-3]_map field represents mapping of rx
34766 	 * buffer pools to a port.
34767 	 */
34768 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_PORT	UINT32_C(0x0)
34769 	/*
34770 	 * The buffer_pool_id[0-3]_map field represents mapping of rx
34771 	 * buffer pools to a PCIe endpoint.
34772 	 */
34773 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT  UINT32_C(0x1)
34774 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_LAST		HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT
34775 	/*
34776 	 * Configuration mode for rx cos queues, configuring whether they
34777 	 * use one shared buffer pool (across ports or PCIe endpoints) or
34778 	 * independent per port or per endpoint buffer pools.
34779 	 */
34780 	uint8_t	mode;
34781 	/* One shared buffer pool to be used by all RX CoS queues */
34782 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_SHARED	UINT32_C(0x0)
34783 	/*
34784 	 * Each port or PCIe endpoint to use an independent buffer pool
34785 	 * for its RX CoS queues
34786 	 */
34787 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT UINT32_C(0x1)
34788 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_LAST	HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT
34789 	uint8_t	unused_0;
34790 	/*
34791 	 * Reports the rate limit applied to traffic through receive CoS queue
34792 	 * group 0. The rate limit is a percentage of total link bandwidth. A
34793 	 * value of 0 indicates no rate limit.
34794 	 *
34795 	 * A queue group is a set of queues, one per traffic class. In
34796 	 * single-host mode, each panel port has its own queue group, and thus,
34797 	 * this rate limit shapes the traffic received on a port, in this case,
34798 	 * through port 0. In multi-root or multi-host mode, each PCIe endpoint
34799 	 * on the NIC has its own queue group. In these cases, the rate limit
34800 	 * shapes the traffic sent to the host through one of the PCIe
34801 	 * endpoints, in this case endpoint 0.
34802 	 */
34803 	uint8_t	g0_max_bw;
34804 	/*
34805 	 * Reports the rate limit applied to traffic through receive CoS queue
34806 	 * group 1 (for port 1 or PCIe endpoint 1). The rate limit is a
34807 	 * percentage of total link bandwidth. A value of 0 indicates no rate
34808 	 * limit.
34809 	 */
34810 	uint8_t	g1_max_bw;
34811 	/*
34812 	 * Reports the rate limit applied to traffic through receive CoS queue
34813 	 * group 2 (for port 2 or PCIe endpoint 2). The rate limit is a
34814 	 * percentage of total link bandwidth. A value of 0 indicates no rate
34815 	 * limit.
34816 	 */
34817 	uint8_t	g2_max_bw;
34818 	/*
34819 	 * Reports the rate limit applied to traffic through receive CoS queue
34820 	 * group 3 (for port 3 or PCIe endpoint 3). The rate limit is a
34821 	 * percentage of total link bandwidth. A value of 0 indicates no rate
34822 	 * limit.
34823 	 */
34824 	uint8_t	g3_max_bw;
34825 	uint8_t	unused_1[3];
34826 	/*
34827 	 * This field is used in Output records to indicate that the output
34828 	 * is completely written to RAM. This field should be read as '1'
34829 	 * to indicate that the output has been completely written.
34830 	 * When writing a command completion or response to an internal processor,
34831 	 * the order of writes has to be such that this field is written last.
34832 	 */
34833 	uint8_t	valid;
34834 } hwrm_queue_global_qcfg_output_t, *phwrm_queue_global_qcfg_output_t;
34835 
34836 /*******************
34837  * hwrm_vnic_alloc *
34838  *******************/
34839 
34840 
34841 /* hwrm_vnic_alloc_input (size:192b/24B) */
34842 
34843 typedef struct hwrm_vnic_alloc_input {
34844 	/* The HWRM command request type. */
34845 	uint16_t	req_type;
34846 	/*
34847 	 * The completion ring to send the completion event on. This should
34848 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34849 	 */
34850 	uint16_t	cmpl_ring;
34851 	/*
34852 	 * The sequence ID is used by the driver for tracking multiple
34853 	 * commands. This ID is treated as opaque data by the firmware and
34854 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34855 	 */
34856 	uint16_t	seq_id;
34857 	/*
34858 	 * The target ID of the command:
34859 	 * * 0x0-0xFFF8 - The function ID
34860 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34861 	 * * 0xFFFD - Reserved for user-space HWRM interface
34862 	 * * 0xFFFF - HWRM
34863 	 */
34864 	uint16_t	target_id;
34865 	/*
34866 	 * A physical address pointer pointing to a host buffer that the
34867 	 * command's response data will be written. This can be either a host
34868 	 * physical address (HPA) or a guest physical address (GPA) and must
34869 	 * point to a physically contiguous block of memory.
34870 	 */
34871 	uint64_t	resp_addr;
34872 	uint32_t	flags;
34873 	/*
34874 	 * When this bit is '1', this VNIC is requested to
34875 	 * be the default VNIC for this function.
34876 	 */
34877 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT		UINT32_C(0x1)
34878 	/*
34879 	 * When this bit is '1', proxy VEE PF is requesting
34880 	 * allocation of a default VNIC on behalf of virtio-net
34881 	 * function given in virtio_net_fid field.
34882 	 */
34883 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_VIRTIO_NET_FID_VALID	UINT32_C(0x2)
34884 	/*
34885 	 * Virtio-net function's FID.
34886 	 * This virtio-net function is requesting allocation of default
34887 	 * VNIC through proxy VEE PF.
34888 	 */
34889 	uint16_t	virtio_net_fid;
34890 	uint8_t	unused_0[2];
34891 } hwrm_vnic_alloc_input_t, *phwrm_vnic_alloc_input_t;
34892 
34893 /* hwrm_vnic_alloc_output (size:128b/16B) */
34894 
34895 typedef struct hwrm_vnic_alloc_output {
34896 	/* The specific error status for the command. */
34897 	uint16_t	error_code;
34898 	/* The HWRM command request type. */
34899 	uint16_t	req_type;
34900 	/* The sequence ID from the original command. */
34901 	uint16_t	seq_id;
34902 	/* The length of the response data in number of bytes. */
34903 	uint16_t	resp_len;
34904 	/* Logical vnic ID */
34905 	uint32_t	vnic_id;
34906 	uint8_t	unused_0[3];
34907 	/*
34908 	 * This field is used in Output records to indicate that the output
34909 	 * is completely written to RAM.  This field should be read as '1'
34910 	 * to indicate that the output has been completely written.
34911 	 * When writing a command completion or response to an internal processor,
34912 	 * the order of writes has to be such that this field is written last.
34913 	 */
34914 	uint8_t	valid;
34915 } hwrm_vnic_alloc_output_t, *phwrm_vnic_alloc_output_t;
34916 
34917 /********************
34918  * hwrm_vnic_update *
34919  ********************/
34920 
34921 
34922 /* hwrm_vnic_update_input (size:256b/32B) */
34923 
34924 typedef struct hwrm_vnic_update_input {
34925 	/* The HWRM command request type. */
34926 	uint16_t	req_type;
34927 	/*
34928 	 * The completion ring to send the completion event on. This should
34929 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34930 	 */
34931 	uint16_t	cmpl_ring;
34932 	/*
34933 	 * The sequence ID is used by the driver for tracking multiple
34934 	 * commands. This ID is treated as opaque data by the firmware and
34935 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34936 	 */
34937 	uint16_t	seq_id;
34938 	/*
34939 	 * The target ID of the command:
34940 	 * * 0x0-0xFFF8 - The function ID
34941 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34942 	 * * 0xFFFD - Reserved for user-space HWRM interface
34943 	 * * 0xFFFF - HWRM
34944 	 */
34945 	uint16_t	target_id;
34946 	/*
34947 	 * A physical address pointer pointing to a host buffer that the
34948 	 * command's response data will be written. This can be either a host
34949 	 * physical address (HPA) or a guest physical address (GPA) and must
34950 	 * point to a physically contiguous block of memory.
34951 	 */
34952 	uint64_t	resp_addr;
34953 	/* Logical vnic ID */
34954 	uint32_t	vnic_id;
34955 	uint32_t	enables;
34956 	/*
34957 	 * This bit must be '1' for the vnic_state field to be
34958 	 * configured.
34959 	 */
34960 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_VNIC_STATE_VALID		UINT32_C(0x1)
34961 	/*
34962 	 * This bit must be '1' for the mru field to be
34963 	 * configured.
34964 	 */
34965 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_MRU_VALID			UINT32_C(0x2)
34966 	/*
34967 	 * This bit must be '1' for the metadata_format_type field to be
34968 	 * configured.
34969 	 */
34970 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID	UINT32_C(0x4)
34971 	/*
34972 	 * This will update the context variable with the same name if
34973 	 * the corresponding enable is set.
34974 	 */
34975 	uint8_t	vnic_state;
34976 	/* Normal operation state for the VNIC. */
34977 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
34978 	/* All packets are dropped in this state. */
34979 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP   UINT32_C(0x1)
34980 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_LAST  HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP
34981 	/*
34982 	 * The metadata format type used in all the RX packet completions
34983 	 * going through this VNIC.
34984 	 */
34985 	uint8_t	metadata_format_type;
34986 	/* No metadata information. */
34987 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_NONE		UINT32_C(0x0)
34988 	/*
34989 	 * Action record pointer (table_scope[4:0], act_rec_ptr[25:0],
34990 	 * vtag[19:0]).
34991 	 */
34992 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_ACT_RECORD_PTR  UINT32_C(0x1)
34993 	/* Tunnel ID (tunnel_id[31:0], vtag[19:0]) */
34994 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_TUNNEL_ID	UINT32_C(0x2)
34995 	/* Custom header data (updated_chdr_data[31:0], vtag[19:0]) */
34996 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_CUSTOM_HDR_DATA UINT32_C(0x3)
34997 	/* Header offsets (hdr_offsets[31:0], vtag[19:0]) */
34998 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS	UINT32_C(0x4)
34999 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_LAST	HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS
35000 	/*
35001 	 * The maximum receive unit of the vnic.
35002 	 * Each vnic is associated with a function.
35003 	 * The vnic mru value overwrites the mru setting of the
35004 	 * associated function.
35005 	 * The HWRM shall make sure that vnic mru does not exceed
35006 	 * the mru of the port the function is associated with.
35007 	 */
35008 	uint16_t	mru;
35009 	uint8_t	unused_1[4];
35010 } hwrm_vnic_update_input_t, *phwrm_vnic_update_input_t;
35011 
35012 /* hwrm_vnic_update_output (size:128b/16B) */
35013 
35014 typedef struct hwrm_vnic_update_output {
35015 	/* The specific error status for the command. */
35016 	uint16_t	error_code;
35017 	/* The HWRM command request type. */
35018 	uint16_t	req_type;
35019 	/* The sequence ID from the original command. */
35020 	uint16_t	seq_id;
35021 	/* The length of the response data in number of bytes. */
35022 	uint16_t	resp_len;
35023 	uint8_t	unused_0[7];
35024 	/*
35025 	 * This field is used in Output records to indicate that the output
35026 	 * is completely written to RAM.  This field should be read as '1'
35027 	 * to indicate that the output has been completely written.
35028 	 * When writing a command completion or response to an internal
35029 	 * processor, the order of writes has to be such that this field is
35030 	 * written last.
35031 	 */
35032 	uint8_t	valid;
35033 } hwrm_vnic_update_output_t, *phwrm_vnic_update_output_t;
35034 
35035 /******************
35036  * hwrm_vnic_free *
35037  ******************/
35038 
35039 
35040 /* hwrm_vnic_free_input (size:192b/24B) */
35041 
35042 typedef struct hwrm_vnic_free_input {
35043 	/* The HWRM command request type. */
35044 	uint16_t	req_type;
35045 	/*
35046 	 * The completion ring to send the completion event on. This should
35047 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35048 	 */
35049 	uint16_t	cmpl_ring;
35050 	/*
35051 	 * The sequence ID is used by the driver for tracking multiple
35052 	 * commands. This ID is treated as opaque data by the firmware and
35053 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35054 	 */
35055 	uint16_t	seq_id;
35056 	/*
35057 	 * The target ID of the command:
35058 	 * * 0x0-0xFFF8 - The function ID
35059 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35060 	 * * 0xFFFD - Reserved for user-space HWRM interface
35061 	 * * 0xFFFF - HWRM
35062 	 */
35063 	uint16_t	target_id;
35064 	/*
35065 	 * A physical address pointer pointing to a host buffer that the
35066 	 * command's response data will be written. This can be either a host
35067 	 * physical address (HPA) or a guest physical address (GPA) and must
35068 	 * point to a physically contiguous block of memory.
35069 	 */
35070 	uint64_t	resp_addr;
35071 	/* Logical vnic ID */
35072 	uint32_t	vnic_id;
35073 	uint8_t	unused_0[4];
35074 } hwrm_vnic_free_input_t, *phwrm_vnic_free_input_t;
35075 
35076 /* hwrm_vnic_free_output (size:128b/16B) */
35077 
35078 typedef struct hwrm_vnic_free_output {
35079 	/* The specific error status for the command. */
35080 	uint16_t	error_code;
35081 	/* The HWRM command request type. */
35082 	uint16_t	req_type;
35083 	/* The sequence ID from the original command. */
35084 	uint16_t	seq_id;
35085 	/* The length of the response data in number of bytes. */
35086 	uint16_t	resp_len;
35087 	uint8_t	unused_0[7];
35088 	/*
35089 	 * This field is used in Output records to indicate that the output
35090 	 * is completely written to RAM.  This field should be read as '1'
35091 	 * to indicate that the output has been completely written.
35092 	 * When writing a command completion or response to an internal processor,
35093 	 * the order of writes has to be such that this field is written last.
35094 	 */
35095 	uint8_t	valid;
35096 } hwrm_vnic_free_output_t, *phwrm_vnic_free_output_t;
35097 
35098 /*****************
35099  * hwrm_vnic_cfg *
35100  *****************/
35101 
35102 
35103 /* hwrm_vnic_cfg_input (size:384b/48B) */
35104 
35105 typedef struct hwrm_vnic_cfg_input {
35106 	/* The HWRM command request type. */
35107 	uint16_t	req_type;
35108 	/*
35109 	 * The completion ring to send the completion event on. This should
35110 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35111 	 */
35112 	uint16_t	cmpl_ring;
35113 	/*
35114 	 * The sequence ID is used by the driver for tracking multiple
35115 	 * commands. This ID is treated as opaque data by the firmware and
35116 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35117 	 */
35118 	uint16_t	seq_id;
35119 	/*
35120 	 * The target ID of the command:
35121 	 * * 0x0-0xFFF8 - The function ID
35122 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35123 	 * * 0xFFFD - Reserved for user-space HWRM interface
35124 	 * * 0xFFFF - HWRM
35125 	 */
35126 	uint16_t	target_id;
35127 	/*
35128 	 * A physical address pointer pointing to a host buffer that the
35129 	 * command's response data will be written. This can be either a host
35130 	 * physical address (HPA) or a guest physical address (GPA) and must
35131 	 * point to a physically contiguous block of memory.
35132 	 */
35133 	uint64_t	resp_addr;
35134 	uint32_t	flags;
35135 	/*
35136 	 * When this bit is '1', the VNIC is requested to
35137 	 * be the default VNIC for the function.
35138 	 */
35139 	#define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT				UINT32_C(0x1)
35140 	/*
35141 	 * When this bit is '1', the VNIC is being configured to
35142 	 * strip VLAN in the RX path.
35143 	 * If set to '0', then VLAN stripping is disabled on
35144 	 * this VNIC.
35145 	 */
35146 	#define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE			UINT32_C(0x2)
35147 	/*
35148 	 * When this bit is '1', the VNIC is being configured to
35149 	 * buffer receive packets in the hardware until the host
35150 	 * posts new receive buffers.
35151 	 * If set to '0', then bd_stall is being configured to be
35152 	 * disabled on this VNIC.
35153 	 */
35154 	#define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE			UINT32_C(0x4)
35155 	/*
35156 	 * When this bit is '1', the VNIC is being configured to
35157 	 * receive both RoCE and non-RoCE traffic.
35158 	 * If set to '0', then this VNIC is not configured to be
35159 	 * operating in dual VNIC mode.
35160 	 */
35161 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE		UINT32_C(0x8)
35162 	/*
35163 	 * When this flag is set to '1', the VNIC is requested to
35164 	 * be configured to receive only RoCE traffic.
35165 	 * If this flag is set to '0', then this flag shall be
35166 	 * ignored by the HWRM.
35167 	 * If roce_dual_vnic_mode flag is set to '1'
35168 	 * or roce_mirroring_capable_vnic_mode flag to 1,
35169 	 * then the HWRM client shall not set this flag to '1'.
35170 	 */
35171 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE		UINT32_C(0x10)
35172 	/*
35173 	 * When a VNIC uses one destination ring group for certain
35174 	 * application (e.g. Receive Flow Steering) where
35175 	 * exact match is used to direct packets to a VNIC with one
35176 	 * destination ring group only, there is no need to configure
35177 	 * RSS indirection table for that VNIC as only one destination
35178 	 * ring group is used.
35179 	 *
35180 	 * This flag is used to enable a mode where
35181 	 * RSS is enabled in the VNIC using a RSS context
35182 	 * for computing RSS hash but the RSS indirection table is
35183 	 * not configured using hwrm_vnic_rss_cfg.
35184 	 *
35185 	 * If this mode is enabled, then the driver should not program
35186 	 * RSS indirection table for the RSS context that is used for
35187 	 * computing RSS hash only.
35188 	 */
35189 	#define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE			UINT32_C(0x20)
35190 	/*
35191 	 * When this bit is '1', the VNIC is being configured to
35192 	 * receive both RoCE and non-RoCE traffic, but forward only the
35193 	 * RoCE traffic further. Also, RoCE traffic can be mirrored to
35194 	 * L2 driver.
35195 	 */
35196 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE	UINT32_C(0x40)
35197 	/*
35198 	 * When this bit is '1' it enables ring selection using the incoming
35199 	 * spif and lcos for the packet.
35200 	 */
35201 	#define HWRM_VNIC_CFG_INPUT_FLAGS_PORTCOS_MAPPING_MODE		UINT32_C(0x80)
35202 	uint32_t	enables;
35203 	/*
35204 	 * This bit must be '1' for the dflt_ring_grp field to be
35205 	 * configured.
35206 	 */
35207 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP		UINT32_C(0x1)
35208 	/*
35209 	 * This bit must be '1' for the rss_rule field to be
35210 	 * configured.
35211 	 */
35212 	#define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE		UINT32_C(0x2)
35213 	/*
35214 	 * This bit must be '1' for the cos_rule field to be
35215 	 * configured.
35216 	 */
35217 	#define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE		UINT32_C(0x4)
35218 	/*
35219 	 * This bit must be '1' for the lb_rule field to be
35220 	 * configured.
35221 	 */
35222 	#define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE		UINT32_C(0x8)
35223 	/*
35224 	 * This bit must be '1' for the mru field to be
35225 	 * configured.
35226 	 */
35227 	#define HWRM_VNIC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x10)
35228 	/*
35229 	 * This bit must be '1' for the default_rx_ring_id field to be
35230 	 * configured.
35231 	 */
35232 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID	UINT32_C(0x20)
35233 	/*
35234 	 * This bit must be '1' for the default_cmpl_ring_id field to be
35235 	 * configured.
35236 	 */
35237 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID	UINT32_C(0x40)
35238 	/* This bit must be '1' for the queue_id field to be configured. */
35239 	#define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID		UINT32_C(0x80)
35240 	/* This bit must be '1' for the rx_csum_v2_mode field to be configured. */
35241 	#define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE	UINT32_C(0x100)
35242 	/* This bit must be '1' for the l2_cqe_mode field to be configured. */
35243 	#define HWRM_VNIC_CFG_INPUT_ENABLES_L2_CQE_MODE		UINT32_C(0x200)
35244 	/* Logical vnic ID */
35245 	uint16_t	vnic_id;
35246 	/*
35247 	 * Default Completion ring for the VNIC.  This ring will
35248 	 * be chosen if packet does not match any RSS rules and if
35249 	 * there is no COS rule.
35250 	 */
35251 	uint16_t	dflt_ring_grp;
35252 	/*
35253 	 * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
35254 	 * there is no RSS rule.
35255 	 */
35256 	uint16_t	rss_rule;
35257 	/*
35258 	 * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
35259 	 * there is no COS rule.
35260 	 */
35261 	uint16_t	cos_rule;
35262 	/*
35263 	 * RSS ID for load balancing rule/table structure.
35264 	 * 0xFF... (All Fs) if there is no LB rule.
35265 	 */
35266 	uint16_t	lb_rule;
35267 	/*
35268 	 * The maximum receive unit of the vnic.
35269 	 * Each vnic is associated with a function.
35270 	 * The vnic mru value overwrites the mru setting of the
35271 	 * associated function.
35272 	 * The HWRM shall make sure that vnic mru does not exceed
35273 	 * the mru of the port the function is associated with.
35274 	 */
35275 	uint16_t	mru;
35276 	/*
35277 	 * Default Rx ring for the VNIC.  This ring will
35278 	 * be chosen if packet does not match any RSS rules.
35279 	 * The aggregation ring associated with the Rx ring is
35280 	 * implied based on the Rx ring specified when the
35281 	 * aggregation ring was allocated.
35282 	 */
35283 	uint16_t	default_rx_ring_id;
35284 	/*
35285 	 * Default completion ring for the VNIC.  This ring will
35286 	 * be chosen if packet does not match any RSS rules.
35287 	 */
35288 	uint16_t	default_cmpl_ring_id;
35289 	/*
35290 	 * When specified, only incoming packets classified to the specified CoS
35291 	 * queue ID will be arriving on this VNIC.  Packet priority to CoS mapping
35292 	 * rules can be specified using HWRM_QUEUE_PRI2COS_CFG.  In this mode,
35293 	 * ntuple filters with VNIC destination specified are invalid since they
35294 	 * conflict with the CoS to VNIC steering rules in this mode.
35295 	 *
35296 	 * If this field is not specified, packet to VNIC steering will be
35297 	 * subject to the standard L2 filter rules and any additional ntuple
35298 	 * filter rules with destination VNIC specified.
35299 	 */
35300 	uint16_t	queue_id;
35301 	/*
35302 	 * If the device supports the RX V2 and RX TPA start V2 completion
35303 	 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
35304 	 * used to specify the two RX checksum modes supported by these
35305 	 * completion records.
35306 	 */
35307 	uint8_t	rx_csum_v2_mode;
35308 	/*
35309 	 * When configured with this checksum mode, the number of header
35310 	 * groups in the delivered packet with a valid IP checksum and
35311 	 * the number of header groups in the delivered packet with a valid
35312 	 * L4 checksum are reported. Valid checksums are counted from the
35313 	 * outermost header group to the innermost header group, stopping at
35314 	 * the first error.  This is the default checksum mode supported if
35315 	 * the driver doesn't explicitly configure the RX checksum mode.
35316 	 */
35317 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
35318 	/*
35319 	 * When configured with this checksum mode, the checksum status is
35320 	 * reported using 'all ok' mode. In the RX completion record, one
35321 	 * bit indicates if the IP checksum is valid for all the parsed
35322 	 * header groups with an IP checksum. Another bit indicates if the
35323 	 * L4 checksum is valid for all the parsed header groups with an L4
35324 	 * checksum. The number of header groups that were parsed by the
35325 	 * chip and passed in the delivered packet is also reported.
35326 	 */
35327 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
35328 	/*
35329 	 * Any rx_csum_v2_mode value larger than or equal to this is not
35330 	 * valid
35331 	 */
35332 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX	UINT32_C(0x2)
35333 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST   HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
35334 	/*
35335 	 * If the device supports different L2 RX CQE modes, as indicated by
35336 	 * the HWRM_VNIC_QCAPS command, this field is used to configure the
35337 	 * CQE mode.
35338 	 */
35339 	uint8_t	l2_cqe_mode;
35340 	/*
35341 	 * When configured with this cqe mode, A normal (32B) CQE
35342 	 * will be generated. This is the default mode.
35343 	 */
35344 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_DEFAULT	UINT32_C(0x0)
35345 	/*
35346 	 * When configured with this cqe mode, A compressed (16B) CQE
35347 	 * will be generated. In this mode TPA and HDS are not supported.
35348 	 * Host drivers should not configure the TPA and HDS along with
35349 	 * compressed mode, per VNIC. FW returns error, if host drivers
35350 	 * try to configure the VNIC with compressed mode and (TPA or HDS).
35351 	 * The compressed completion does not include PTP data. Host
35352 	 * drivers should not use this mode to receive the PTP data.
35353 	 */
35354 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
35355 	/*
35356 	 * When configured with this cqe mode, HW generates either a 32B
35357 	 * completion or a 16B completion depending on use case within a
35358 	 * VNIC. For ex. a simple L2 packet could use the compressed form
35359 	 * while a PTP packet on the same VNIC would use the 32B form.
35360 	 */
35361 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED	UINT32_C(0x2)
35362 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_LAST	HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED
35363 	uint8_t	unused0[4];
35364 } hwrm_vnic_cfg_input_t, *phwrm_vnic_cfg_input_t;
35365 
35366 /* hwrm_vnic_cfg_output (size:128b/16B) */
35367 
35368 typedef struct hwrm_vnic_cfg_output {
35369 	/* The specific error status for the command. */
35370 	uint16_t	error_code;
35371 	/* The HWRM command request type. */
35372 	uint16_t	req_type;
35373 	/* The sequence ID from the original command. */
35374 	uint16_t	seq_id;
35375 	/* The length of the response data in number of bytes. */
35376 	uint16_t	resp_len;
35377 	uint8_t	unused_0[7];
35378 	/*
35379 	 * This field is used in Output records to indicate that the output
35380 	 * is completely written to RAM.  This field should be read as '1'
35381 	 * to indicate that the output has been completely written.
35382 	 * When writing a command completion or response to an internal processor,
35383 	 * the order of writes has to be such that this field is written last.
35384 	 */
35385 	uint8_t	valid;
35386 } hwrm_vnic_cfg_output_t, *phwrm_vnic_cfg_output_t;
35387 
35388 /******************
35389  * hwrm_vnic_qcfg *
35390  ******************/
35391 
35392 
35393 /* hwrm_vnic_qcfg_input (size:256b/32B) */
35394 
35395 typedef struct hwrm_vnic_qcfg_input {
35396 	/* The HWRM command request type. */
35397 	uint16_t	req_type;
35398 	/*
35399 	 * The completion ring to send the completion event on. This should
35400 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35401 	 */
35402 	uint16_t	cmpl_ring;
35403 	/*
35404 	 * The sequence ID is used by the driver for tracking multiple
35405 	 * commands. This ID is treated as opaque data by the firmware and
35406 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35407 	 */
35408 	uint16_t	seq_id;
35409 	/*
35410 	 * The target ID of the command:
35411 	 * * 0x0-0xFFF8 - The function ID
35412 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35413 	 * * 0xFFFD - Reserved for user-space HWRM interface
35414 	 * * 0xFFFF - HWRM
35415 	 */
35416 	uint16_t	target_id;
35417 	/*
35418 	 * A physical address pointer pointing to a host buffer that the
35419 	 * command's response data will be written. This can be either a host
35420 	 * physical address (HPA) or a guest physical address (GPA) and must
35421 	 * point to a physically contiguous block of memory.
35422 	 */
35423 	uint64_t	resp_addr;
35424 	uint32_t	enables;
35425 	/*
35426 	 * This bit must be '1' for the vf_id_valid field to be
35427 	 * configured.
35428 	 */
35429 	#define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
35430 	/* Logical vnic ID */
35431 	uint32_t	vnic_id;
35432 	/* ID of Virtual Function whose VNIC resource is being queried. */
35433 	uint16_t	vf_id;
35434 	uint8_t	unused_0[6];
35435 } hwrm_vnic_qcfg_input_t, *phwrm_vnic_qcfg_input_t;
35436 
35437 /* hwrm_vnic_qcfg_output (size:256b/32B) */
35438 
35439 typedef struct hwrm_vnic_qcfg_output {
35440 	/* The specific error status for the command. */
35441 	uint16_t	error_code;
35442 	/* The HWRM command request type. */
35443 	uint16_t	req_type;
35444 	/* The sequence ID from the original command. */
35445 	uint16_t	seq_id;
35446 	/* The length of the response data in number of bytes. */
35447 	uint16_t	resp_len;
35448 	/* Default Completion ring for the VNIC. */
35449 	uint16_t	dflt_ring_grp;
35450 	/*
35451 	 * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
35452 	 * there is no RSS rule.
35453 	 */
35454 	uint16_t	rss_rule;
35455 	/*
35456 	 * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
35457 	 * there is no COS rule.
35458 	 */
35459 	uint16_t	cos_rule;
35460 	/*
35461 	 * RSS ID for load balancing rule/table structure.
35462 	 * 0xFF... (All Fs) if there is no LB rule.
35463 	 */
35464 	uint16_t	lb_rule;
35465 	/* The maximum receive unit of the vnic. */
35466 	uint16_t	mru;
35467 	uint8_t	unused_0[2];
35468 	uint32_t	flags;
35469 	/*
35470 	 * When this bit is '1', the VNIC is the default VNIC for
35471 	 * the function.
35472 	 */
35473 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT				UINT32_C(0x1)
35474 	/*
35475 	 * When this bit is '1', the VNIC is configured to
35476 	 * strip VLAN in the RX path.
35477 	 * If set to '0', then VLAN stripping is disabled on
35478 	 * this VNIC.
35479 	 */
35480 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE			UINT32_C(0x2)
35481 	/*
35482 	 * When this bit is '1', the VNIC is configured to
35483 	 * buffer receive packets in the hardware until the host
35484 	 * posts new receive buffers.
35485 	 * If set to '0', then bd_stall is disabled on
35486 	 * this VNIC.
35487 	 */
35488 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE			UINT32_C(0x4)
35489 	/*
35490 	 * When this bit is '1', the VNIC is configured to
35491 	 * receive both RoCE and non-RoCE traffic.
35492 	 * If set to '0', then this VNIC is not configured to
35493 	 * operate in dual VNIC mode.
35494 	 */
35495 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE		UINT32_C(0x8)
35496 	/*
35497 	 * When this flag is set to '1', the VNIC is configured to
35498 	 * receive only RoCE traffic.
35499 	 * When this flag is set to '0', the VNIC is not configured
35500 	 * to receive only RoCE traffic.
35501 	 * If roce_dual_vnic_mode flag and this flag both are set
35502 	 * to '1', then it is an invalid configuration of the
35503 	 * VNIC. The HWRM should not allow that type of
35504 	 * mis-configuration by HWRM clients.
35505 	 */
35506 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE		UINT32_C(0x10)
35507 	/*
35508 	 * When a VNIC uses one destination ring group for certain
35509 	 * application (e.g. Receive Flow Steering) where
35510 	 * exact match is used to direct packets to a VNIC with one
35511 	 * destination ring group only, there is no need to configure
35512 	 * RSS indirection table for that VNIC as only one destination
35513 	 * ring group is used.
35514 	 *
35515 	 * When this bit is set to '1', then the VNIC is enabled in a
35516 	 * mode where RSS is enabled in the VNIC using a RSS context
35517 	 * for computing RSS hash but the RSS indirection table is
35518 	 * not configured.
35519 	 */
35520 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE			UINT32_C(0x20)
35521 	/*
35522 	 * When this bit is '1', the VNIC is configured to
35523 	 * receive both RoCE and non-RoCE traffic, but forward only
35524 	 * RoCE traffic further. Also RoCE traffic can be mirrored to
35525 	 * L2 driver.
35526 	 */
35527 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE	UINT32_C(0x40)
35528 	/*
35529 	 * When this bit is '0', VNIC is in normal operation state.
35530 	 * When this bit is '1', VNIC drops all the received packets.
35531 	 */
35532 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_OPERATION_STATE			UINT32_C(0x80)
35533 	/* When this bit is '1' it indicates port cos_mapping_mode enabled. */
35534 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_PORTCOS_MAPPING_MODE		UINT32_C(0x100)
35535 	/*
35536 	 * When returned with a valid CoS Queue id, the CoS Queue/VNIC association
35537 	 * is valid.  Otherwise it will return 0xFFFF to indicate no VNIC/CoS
35538 	 * queue association.
35539 	 */
35540 	uint16_t	queue_id;
35541 	/*
35542 	 * If the device supports the RX V2 and RX TPA start V2 completion
35543 	 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
35544 	 * used to specify the current RX checksum mode configured for all the
35545 	 * RX rings of a VNIC.
35546 	 */
35547 	uint8_t	rx_csum_v2_mode;
35548 	/*
35549 	 * This value indicates that the VNIC is configured to use the
35550 	 * default RX checksum mode for all the rings associated with this
35551 	 * VNIC.
35552 	 */
35553 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
35554 	/*
35555 	 * This value indicates that the VNIC is configured to use the RX
35556 	 * checksum ‘all_ok’ mode for all the rings associated with this
35557 	 * VNIC.
35558 	 */
35559 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
35560 	/*
35561 	 * Any rx_csum_v2_mode value larger than or equal to this is not
35562 	 * valid
35563 	 */
35564 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX	UINT32_C(0x2)
35565 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST   HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
35566 	/*
35567 	 * If the device supports different L2 RX CQE modes, as indicated by
35568 	 * the HWRM_VNIC_QCAPS command, this field is used to convey the
35569 	 * configured CQE mode.
35570 	 */
35571 	uint8_t	l2_cqe_mode;
35572 	/*
35573 	 * This value indicates that the VNIC is configured with normal
35574 	 * (32B) CQE mode.
35575 	 */
35576 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_DEFAULT	UINT32_C(0x0)
35577 	/*
35578 	 * This value indicates that the VNIC is configured with compressed
35579 	 * (16B) CQE mode.
35580 	 */
35581 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
35582 	/*
35583 	 * This value indicates that the VNIC is configured with mixed
35584 	 * CQE mode. HW generates either a 32B completion or a 16B
35585 	 * completion depending on use case within a VNIC.
35586 	 */
35587 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED	UINT32_C(0x2)
35588 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_LAST	HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED
35589 	uint8_t	unused_1[3];
35590 	/*
35591 	 * This field is used in Output records to indicate that the output
35592 	 * is completely written to RAM.  This field should be read as '1'
35593 	 * to indicate that the output has been completely written.
35594 	 * When writing a command completion or response to an internal processor,
35595 	 * the order of writes has to be such that this field is written last.
35596 	 */
35597 	uint8_t	valid;
35598 } hwrm_vnic_qcfg_output_t, *phwrm_vnic_qcfg_output_t;
35599 
35600 /*******************
35601  * hwrm_vnic_qcaps *
35602  *******************/
35603 
35604 
35605 /* hwrm_vnic_qcaps_input (size:192b/24B) */
35606 
35607 typedef struct hwrm_vnic_qcaps_input {
35608 	/* The HWRM command request type. */
35609 	uint16_t	req_type;
35610 	/*
35611 	 * The completion ring to send the completion event on. This should
35612 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35613 	 */
35614 	uint16_t	cmpl_ring;
35615 	/*
35616 	 * The sequence ID is used by the driver for tracking multiple
35617 	 * commands. This ID is treated as opaque data by the firmware and
35618 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35619 	 */
35620 	uint16_t	seq_id;
35621 	/*
35622 	 * The target ID of the command:
35623 	 * * 0x0-0xFFF8 - The function ID
35624 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35625 	 * * 0xFFFD - Reserved for user-space HWRM interface
35626 	 * * 0xFFFF - HWRM
35627 	 */
35628 	uint16_t	target_id;
35629 	/*
35630 	 * A physical address pointer pointing to a host buffer that the
35631 	 * command's response data will be written. This can be either a host
35632 	 * physical address (HPA) or a guest physical address (GPA) and must
35633 	 * point to a physically contiguous block of memory.
35634 	 */
35635 	uint64_t	resp_addr;
35636 	uint32_t	enables;
35637 	uint8_t	unused_0[4];
35638 } hwrm_vnic_qcaps_input_t, *phwrm_vnic_qcaps_input_t;
35639 
35640 /* hwrm_vnic_qcaps_output (size:192b/24B) */
35641 
35642 typedef struct hwrm_vnic_qcaps_output {
35643 	/* The specific error status for the command. */
35644 	uint16_t	error_code;
35645 	/* The HWRM command request type. */
35646 	uint16_t	req_type;
35647 	/* The sequence ID from the original command. */
35648 	uint16_t	seq_id;
35649 	/* The length of the response data in number of bytes. */
35650 	uint16_t	resp_len;
35651 	/* The maximum receive unit that is settable on a vnic. */
35652 	uint16_t	mru;
35653 	uint8_t	unused_0[2];
35654 	uint32_t	flags;
35655 	/* Unused. */
35656 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED				UINT32_C(0x1)
35657 	/*
35658 	 * When this bit is '1', the capability of stripping VLAN in
35659 	 * the RX path is supported on VNIC(s).
35660 	 * If set to '0', then VLAN stripping capability is
35661 	 * not supported on VNIC(s).
35662 	 */
35663 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP			UINT32_C(0x2)
35664 	/*
35665 	 * When this bit is '1', the capability to buffer receive
35666 	 * packets in the hardware until the host posts new receive buffers
35667 	 * is supported on VNIC(s).
35668 	 * If set to '0', then bd_stall capability is not supported
35669 	 * on VNIC(s).
35670 	 */
35671 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP				UINT32_C(0x4)
35672 	/*
35673 	 * When this bit is '1', the capability to
35674 	 * receive both RoCE and non-RoCE traffic on VNIC(s) is
35675 	 * supported.
35676 	 * If set to '0', then the capability to receive
35677 	 * both RoCE and non-RoCE traffic on VNIC(s) is
35678 	 * not supported.
35679 	 */
35680 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP			UINT32_C(0x8)
35681 	/*
35682 	 * When this bit is set to '1', the capability to configure
35683 	 * a VNIC to receive only RoCE traffic is supported.
35684 	 * When this flag is set to '0', the VNIC capability to
35685 	 * configure to receive only RoCE traffic is not supported.
35686 	 */
35687 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP			UINT32_C(0x10)
35688 	/*
35689 	 * When this bit is set to '1', then the capability to enable
35690 	 * a VNIC in a mode where RSS context without configuring
35691 	 * RSS indirection table is supported (for RSS hash computation).
35692 	 * When this bit is set to '0', then a VNIC can not be configured
35693 	 * with a mode to enable RSS context without configuring RSS
35694 	 * indirection table.
35695 	 */
35696 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP			UINT32_C(0x20)
35697 	/*
35698 	 * When this bit is '1', the capability to
35699 	 * mirror the RoCE traffic is supported.
35700 	 * If set to '0', then the capability to mirror the
35701 	 * RoCE traffic is not supported.
35702 	 */
35703 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP	UINT32_C(0x40)
35704 	/*
35705 	 * When this bit is '1', the outermost RSS hashing capability
35706 	 * is supported. If set to '0', then the outermost RSS hashing
35707 	 * capability is not supported.
35708 	 */
35709 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP			UINT32_C(0x80)
35710 	/*
35711 	 * When this bit is '1', it indicates that firmware supports the
35712 	 * ability to steer incoming packets from one CoS queue to one
35713 	 * VNIC.  This optional feature can then be enabled
35714 	 * using HWRM_VNIC_CFG on any VNIC.  This feature is only
35715 	 * available when NVM option “enable_cos_classification” is set
35716 	 * to 1.  If set to '0', firmware does not support this feature.
35717 	 */
35718 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP			UINT32_C(0x100)
35719 	/*
35720 	 * When this bit is '1', it indicates that HW and firmware supports
35721 	 * the use of RX V2 and RX TPA start V2 completion records for all
35722 	 * the RX rings of a VNIC. Once set, this feature is mandatory to
35723 	 * be used for the RX rings of the VNIC. Additionally, two new RX
35724 	 * checksum features supported by these completion records can be
35725 	 * configured using the HWRM_VNIC_CFG on a VNIC. If set to '0', the
35726 	 * HW and the firmware does not support this feature.
35727 	 */
35728 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP			UINT32_C(0x200)
35729 	/*
35730 	 * When this bit is '1', it indicates that HW and firmware support
35731 	 * vnic state change. Host drivers can change the vnic state using
35732 	 * HWRM_VNIC_UPDATE. If set to '0', the HW and firmware do not
35733 	 * support this feature.
35734 	 */
35735 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_STATE_CAP			UINT32_C(0x400)
35736 	/*
35737 	 * When this bit is '1', it indicates that firmware supports
35738 	 * virtio-net functions default VNIC allocation using
35739 	 * HWRM_VNIC_ALLOC.
35740 	 * This capability is available only on Proxy VEE PF. If set to '0',
35741 	 * firmware does not support this feature.
35742 	 */
35743 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VIRTIO_NET_VNIC_ALLOC_CAP		UINT32_C(0x800)
35744 	/*
35745 	 * When this bit is set '1', then the capability to configure the
35746 	 * metadata format in the RX completion is supported for the VNIC.
35747 	 * When this bit is set to '0', then the capability to configure
35748 	 * the metadata format in the RX completion is not supported for
35749 	 * the VNIC.
35750 	 */
35751 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_METADATA_FORMAT_CAP			UINT32_C(0x1000)
35752 	/*
35753 	 * When this bit is set '1', it indicates that firmware returns
35754 	 * INVALID_PARAM error, if host drivers choose invalid hash type
35755 	 * bit combinations in vnic_rss_cfg.
35756 	 */
35757 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_STRICT_HASH_TYPE_CAP		UINT32_C(0x2000)
35758 	/*
35759 	 * When this bit is set '1', it indicates that firmware supports
35760 	 * the hash_type include and exclude flags in hwrm_vnic_rss_cfg.
35761 	 */
35762 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_HASH_TYPE_DELTA_CAP		UINT32_C(0x4000)
35763 	/*
35764 	 * When this bit is '1', it indicates that HW is capable of using
35765 	 * Toeplitz algorithm. This mode uses Toeplitz algorithm and
35766 	 * provided Toeplitz hash key to hash the packets according to the
35767 	 * configured hash type and hash mode. The Toeplitz hash results and
35768 	 * the provided Toeplitz RSS indirection table are used to determine
35769 	 * the RSS rings.
35770 	 */
35771 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CAP	UINT32_C(0x8000)
35772 	/*
35773 	 * When this bit is '1', it indicates that HW is capable of using
35774 	 * XOR algorithm. This mode uses XOR algorithm to hash the packets
35775 	 * according to the configured hash type and hash mode. The XOR
35776 	 * hash results and the provided XOR RSS indirection table are
35777 	 * used to determine the RSS rings. Host drivers provided hash key
35778 	 * is not honored in this mode.
35779 	 */
35780 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_XOR_CAP		UINT32_C(0x10000)
35781 	/*
35782 	 * When this bit is '1', it indicates that HW is capable of using
35783 	 * checksum algorithm. In this mode, HW uses inner packets checksum
35784 	 * algorithm to distribute the packets across the rings and Toeplitz
35785 	 * algorithm to calculate the hash to convey it in the RX
35786 	 * completions. Host drivers should provide Toeplitz hash key.
35787 	 * As HW uses innermost packets checksum to distribute the packets
35788 	 * across the rings, host drivers can't convey hash  mode to choose
35789 	 * outer headers to calculate Toeplitz hash. FW will fail such
35790 	 * configuration.
35791 	 */
35792 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP	UINT32_C(0x20000)
35793 	/*
35794 	 * When this bit is '1' HW supports hash calculation
35795 	 * based on IPV6 flow labels.
35796 	 */
35797 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP		UINT32_C(0x40000)
35798 	/*
35799 	 * When this bit is '1', it indicates that HW and firmware supports
35800 	 * the use of RX V3 and RX TPA start V3 completion records for all
35801 	 * the RX rings of a VNIC. Once set, this feature is mandatory to
35802 	 * be used for the RX rings of the VNIC. If set to '0', the
35803 	 * HW and the firmware does not support this feature.
35804 	 */
35805 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V3_CAP			UINT32_C(0x80000)
35806 	/*
35807 	 * When this bit is '1' HW supports different RX CQE record types.
35808 	 * Host drivers can choose the mode based on their application
35809 	 * requirements like performance, TPA, HDS and PTP.
35810 	 */
35811 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP			UINT32_C(0x100000)
35812 	/*
35813 	 * When this bit is '1' HW supports hash calculation
35814 	 * based on IPv4 IPSEC AH SPI field.
35815 	 */
35816 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_AH_SPI_IPV4_CAP		UINT32_C(0x200000)
35817 	/*
35818 	 * When this bit is '1' HW supports hash calculation
35819 	 * based on IPv4 IPSEC ESP SPI field.
35820 	 */
35821 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_ESP_SPI_IPV4_CAP		UINT32_C(0x400000)
35822 	/*
35823 	 * When this bit is '1' HW supports hash calculation
35824 	 * based on IPv6 IPSEC AH SPI field.
35825 	 */
35826 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_AH_SPI_IPV6_CAP		UINT32_C(0x800000)
35827 	/*
35828 	 * When this bit is '1' HW supports hash calculation
35829 	 * based on IPv6 IPSEC ESP SPI field.
35830 	 */
35831 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_ESP_SPI_IPV6_CAP		UINT32_C(0x1000000)
35832 	/*
35833 	 * When outermost_rss_cap is '1' and this bit is '1', the outermost
35834 	 * RSS hash mode may be set on a PF or trusted VF.
35835 	 * When outermost_rss_cap is '1' and this bit is '0', the outermost
35836 	 * RSS hash mode may be set on a PF.
35837 	 */
35838 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_TRUSTED_VF_CAP		UINT32_C(0x2000000)
35839 	/*
35840 	 * When this bit is '1' it indicates HW is capable of enabling ring
35841 	 * selection using the incoming spif and lcos for the packet.
35842 	 */
35843 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_PORTCOS_MAPPING_MODE			UINT32_C(0x4000000)
35844 	/*
35845 	 * When this bit is '1', it indicates controller enabled
35846 	 * RSS profile TCAM mode.
35847 	 */
35848 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_PROF_TCAM_MODE_ENABLED		UINT32_C(0x8000000)
35849 	/* When this bit is '1' FW supports VNIC hash mode. */
35850 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_RSS_HASH_MODE_CAP		UINT32_C(0x10000000)
35851 	/*
35852 	 * This field advertises the maximum concurrent TPA aggregations
35853 	 * supported by the VNIC on new devices that support TPA v2 or v3.
35854 	 * '0' means that both the TPA v2 and v3 are not supported.
35855 	 */
35856 	uint16_t	max_aggs_supported;
35857 	uint8_t	unused_1[5];
35858 	/*
35859 	 * This field is used in Output records to indicate that the output
35860 	 * is completely written to RAM.  This field should be read as '1'
35861 	 * to indicate that the output has been completely written.
35862 	 * When writing a command completion or response to an internal processor,
35863 	 * the order of writes has to be such that this field is written last.
35864 	 */
35865 	uint8_t	valid;
35866 } hwrm_vnic_qcaps_output_t, *phwrm_vnic_qcaps_output_t;
35867 
35868 /*********************
35869  * hwrm_vnic_tpa_cfg *
35870  *********************/
35871 
35872 
35873 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
35874 
35875 typedef struct hwrm_vnic_tpa_cfg_input {
35876 	/* The HWRM command request type. */
35877 	uint16_t	req_type;
35878 	/*
35879 	 * The completion ring to send the completion event on. This should
35880 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35881 	 */
35882 	uint16_t	cmpl_ring;
35883 	/*
35884 	 * The sequence ID is used by the driver for tracking multiple
35885 	 * commands. This ID is treated as opaque data by the firmware and
35886 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35887 	 */
35888 	uint16_t	seq_id;
35889 	/*
35890 	 * The target ID of the command:
35891 	 * * 0x0-0xFFF8 - The function ID
35892 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35893 	 * * 0xFFFD - Reserved for user-space HWRM interface
35894 	 * * 0xFFFF - HWRM
35895 	 */
35896 	uint16_t	target_id;
35897 	/*
35898 	 * A physical address pointer pointing to a host buffer that the
35899 	 * command's response data will be written. This can be either a host
35900 	 * physical address (HPA) or a guest physical address (GPA) and must
35901 	 * point to a physically contiguous block of memory.
35902 	 */
35903 	uint64_t	resp_addr;
35904 	uint32_t	flags;
35905 	/*
35906 	 * When this bit is '1', the VNIC shall be configured to
35907 	 * perform transparent packet aggregation (TPA) of
35908 	 * non-tunneled TCP packets.
35909 	 */
35910 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA			UINT32_C(0x1)
35911 	/*
35912 	 * When this bit is '1', the VNIC shall be configured to
35913 	 * perform transparent packet aggregation (TPA) of
35914 	 * tunneled TCP packets.
35915 	 */
35916 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA		UINT32_C(0x2)
35917 	/*
35918 	 * When this bit is '1', the VNIC shall be configured to
35919 	 * perform transparent packet aggregation (TPA) according
35920 	 * to Windows Receive Segment Coalescing (RSC) rules.
35921 	 */
35922 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE		UINT32_C(0x4)
35923 	/*
35924 	 * When this bit is '1', the VNIC shall be configured to
35925 	 * perform transparent packet aggregation (TPA) according
35926 	 * to Linux Generic Receive Offload (GRO) rules.
35927 	 */
35928 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO			UINT32_C(0x8)
35929 	/*
35930 	 * When this bit is '1', the VNIC shall be configured to
35931 	 * perform transparent packet aggregation (TPA) for TCP
35932 	 * packets with IP ECN set to non-zero.
35933 	 */
35934 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN		UINT32_C(0x10)
35935 	/*
35936 	 * When this bit is '1', the VNIC shall be configured to
35937 	 * perform transparent packet aggregation (TPA) for
35938 	 * GRE tunneled TCP packets only if all packets have the
35939 	 * same GRE sequence.
35940 	 */
35941 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ	UINT32_C(0x20)
35942 	/*
35943 	 * When this bit is '1' and the GRO mode is enabled,
35944 	 * the VNIC shall be configured to
35945 	 * perform transparent packet aggregation (TPA) for
35946 	 * TCP/IPv4 packets with consecutively increasing IPIDs.
35947 	 * In other words, the last packet that is being
35948 	 * aggregated to an already existing aggregation context
35949 	 * shall have IPID 1 more than the IPID of the last packet
35950 	 * that was aggregated in that aggregation context.
35951 	 */
35952 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK		UINT32_C(0x40)
35953 	/*
35954 	 * When this bit is '1' and the GRO mode is enabled,
35955 	 * the VNIC shall be configured to
35956 	 * perform transparent packet aggregation (TPA) for
35957 	 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
35958 	 * value.
35959 	 */
35960 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK		UINT32_C(0x80)
35961 	/*
35962 	 * When this bit is '1' and the GRO mode is enabled,
35963 	 * the VNIC shall DMA payload data using GRO rules.
35964 	 * When this bit is '0', the VNIC shall DMA payload data
35965 	 * using the more efficient LRO rules of filling all
35966 	 * aggregation buffers.
35967 	 */
35968 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO	UINT32_C(0x100)
35969 	uint32_t	enables;
35970 	/*
35971 	 * This bit must be '1' for the max_agg_segs field to be
35972 	 * configured.
35973 	 */
35974 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS	UINT32_C(0x1)
35975 	/*
35976 	 * This bit must be '1' for the max_aggs field to be
35977 	 * configured.
35978 	 */
35979 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS	UINT32_C(0x2)
35980 	/*
35981 	 * This bit must be '1' for the max_agg_timer field to be
35982 	 * configured.
35983 	 */
35984 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER	UINT32_C(0x4)
35985 	/* deprecated bit.  Do not use!!! */
35986 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN	UINT32_C(0x8)
35987 	/* Logical vnic ID */
35988 	uint16_t	vnic_id;
35989 	/*
35990 	 * This is the maximum number of TCP segments that can
35991 	 * be aggregated (unit is Log2). Max value is 31. On new
35992 	 * devices supporting TPA v2, the unit is multiples of 4 and
35993 	 * valid values are > 0 and <= 63.
35994 	 */
35995 	uint16_t	max_agg_segs;
35996 	/* 1 segment */
35997 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
35998 	/* 2 segments */
35999 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
36000 	/* 4 segments */
36001 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
36002 	/* 8 segments */
36003 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
36004 	/* Any segment size larger than this is not valid */
36005 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
36006 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
36007 	/*
36008 	 * This is the maximum number of aggregations this VNIC is
36009 	 * allowed (unit is Log2). Max value is 7. On new devices
36010 	 * supporting TPA v2, this is in unit of 1 and must be > 0
36011 	 * and <= max_aggs_supported in the hwrm_vnic_qcaps response
36012 	 * to enable TPA v2.
36013 	 */
36014 	uint16_t	max_aggs;
36015 	/* 1 aggregation */
36016 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
36017 	/* 2 aggregations */
36018 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
36019 	/* 4 aggregations */
36020 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
36021 	/* 8 aggregations */
36022 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
36023 	/* 16 aggregations */
36024 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
36025 	/* Any aggregation size larger than this is not valid */
36026 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
36027 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
36028 	uint8_t	unused_0[2];
36029 	/*
36030 	 * This is the maximum amount of time allowed for
36031 	 * an aggregation context to complete after it was initiated.
36032 	 */
36033 	uint32_t	max_agg_timer;
36034 	/*
36035 	 * This is the minimum amount of payload length required to
36036 	 * start an aggregation context. This field is deprecated and
36037 	 * should be set to 0.  The minimum length is set by firmware
36038 	 * and can be queried using hwrm_vnic_tpa_qcfg.
36039 	 */
36040 	uint32_t	min_agg_len;
36041 } hwrm_vnic_tpa_cfg_input_t, *phwrm_vnic_tpa_cfg_input_t;
36042 
36043 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
36044 
36045 typedef struct hwrm_vnic_tpa_cfg_output {
36046 	/* The specific error status for the command. */
36047 	uint16_t	error_code;
36048 	/* The HWRM command request type. */
36049 	uint16_t	req_type;
36050 	/* The sequence ID from the original command. */
36051 	uint16_t	seq_id;
36052 	/* The length of the response data in number of bytes. */
36053 	uint16_t	resp_len;
36054 	uint8_t	unused_0[7];
36055 	/*
36056 	 * This field is used in Output records to indicate that the output
36057 	 * is completely written to RAM.  This field should be read as '1'
36058 	 * to indicate that the output has been completely written.
36059 	 * When writing a command completion or response to an internal processor,
36060 	 * the order of writes has to be such that this field is written last.
36061 	 */
36062 	uint8_t	valid;
36063 } hwrm_vnic_tpa_cfg_output_t, *phwrm_vnic_tpa_cfg_output_t;
36064 
36065 /**********************
36066  * hwrm_vnic_tpa_qcfg *
36067  **********************/
36068 
36069 
36070 /* hwrm_vnic_tpa_qcfg_input (size:192b/24B) */
36071 
36072 typedef struct hwrm_vnic_tpa_qcfg_input {
36073 	/* The HWRM command request type. */
36074 	uint16_t	req_type;
36075 	/*
36076 	 * The completion ring to send the completion event on. This should
36077 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36078 	 */
36079 	uint16_t	cmpl_ring;
36080 	/*
36081 	 * The sequence ID is used by the driver for tracking multiple
36082 	 * commands. This ID is treated as opaque data by the firmware and
36083 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36084 	 */
36085 	uint16_t	seq_id;
36086 	/*
36087 	 * The target ID of the command:
36088 	 * * 0x0-0xFFF8 - The function ID
36089 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36090 	 * * 0xFFFD - Reserved for user-space HWRM interface
36091 	 * * 0xFFFF - HWRM
36092 	 */
36093 	uint16_t	target_id;
36094 	/*
36095 	 * A physical address pointer pointing to a host buffer that the
36096 	 * command's response data will be written. This can be either a host
36097 	 * physical address (HPA) or a guest physical address (GPA) and must
36098 	 * point to a physically contiguous block of memory.
36099 	 */
36100 	uint64_t	resp_addr;
36101 	/* Logical vnic ID */
36102 	uint16_t	vnic_id;
36103 	uint8_t	unused_0[6];
36104 } hwrm_vnic_tpa_qcfg_input_t, *phwrm_vnic_tpa_qcfg_input_t;
36105 
36106 /* hwrm_vnic_tpa_qcfg_output (size:256b/32B) */
36107 
36108 typedef struct hwrm_vnic_tpa_qcfg_output {
36109 	/* The specific error status for the command. */
36110 	uint16_t	error_code;
36111 	/* The HWRM command request type. */
36112 	uint16_t	req_type;
36113 	/* The sequence ID from the original command. */
36114 	uint16_t	seq_id;
36115 	/* The length of the response data in number of bytes. */
36116 	uint16_t	resp_len;
36117 	uint32_t	flags;
36118 	/*
36119 	 * When this bit is '1', the VNIC is configured to
36120 	 * perform transparent packet aggregation (TPA) of
36121 	 * non-tunneled TCP packets.
36122 	 */
36123 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_TPA			UINT32_C(0x1)
36124 	/*
36125 	 * When this bit is '1', the VNIC is configured to
36126 	 * perform transparent packet aggregation (TPA) of
36127 	 * tunneled TCP packets.
36128 	 */
36129 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_ENCAP_TPA		UINT32_C(0x2)
36130 	/*
36131 	 * When this bit is '1', the VNIC is configured to
36132 	 * perform transparent packet aggregation (TPA) according
36133 	 * to Windows Receive Segment Coalescing (RSC) rules.
36134 	 */
36135 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_RSC_WND_UPDATE		UINT32_C(0x4)
36136 	/*
36137 	 * When this bit is '1', the VNIC is configured to
36138 	 * perform transparent packet aggregation (TPA) according
36139 	 * to Linux Generic Receive Offload (GRO) rules.
36140 	 */
36141 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO			UINT32_C(0x8)
36142 	/*
36143 	 * When this bit is '1', the VNIC is configured to
36144 	 * perform transparent packet aggregation (TPA) for TCP
36145 	 * packets with IP ECN set to non-zero.
36146 	 */
36147 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_ECN		UINT32_C(0x10)
36148 	/*
36149 	 * When this bit is '1', the VNIC is configured to
36150 	 * perform transparent packet aggregation (TPA) for
36151 	 * GRE tunneled TCP packets only if all packets have the
36152 	 * same GRE sequence.
36153 	 */
36154 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ	UINT32_C(0x20)
36155 	/*
36156 	 * When this bit is '1' and the GRO mode is enabled,
36157 	 * the VNIC is configured to
36158 	 * perform transparent packet aggregation (TPA) for
36159 	 * TCP/IPv4 packets with consecutively increasing IPIDs.
36160 	 * In other words, the last packet that is being
36161 	 * aggregated to an already existing aggregation context
36162 	 * shall have IPID 1 more than the IPID of the last packet
36163 	 * that was aggregated in that aggregation context.
36164 	 */
36165 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_IPID_CHECK		UINT32_C(0x40)
36166 	/*
36167 	 * When this bit is '1' and the GRO mode is enabled,
36168 	 * the VNIC is configured to
36169 	 * perform transparent packet aggregation (TPA) for
36170 	 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
36171 	 * value.
36172 	 */
36173 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_TTL_CHECK		UINT32_C(0x80)
36174 	/*
36175 	 * This is the maximum number of TCP segments that can
36176 	 * be aggregated (unit is Log2). Max value is 31.
36177 	 */
36178 	uint16_t	max_agg_segs;
36179 	/* 1 segment */
36180 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
36181 	/* 2 segments */
36182 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
36183 	/* 4 segments */
36184 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
36185 	/* 8 segments */
36186 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
36187 	/* Any segment size larger than this is not valid */
36188 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
36189 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_LAST HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX
36190 	/*
36191 	 * This is the maximum number of aggregations this VNIC is
36192 	 * allowed (unit is Log2). Max value is 7
36193 	 */
36194 	uint16_t	max_aggs;
36195 	/* 1 aggregation */
36196 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_1   UINT32_C(0x0)
36197 	/* 2 aggregations */
36198 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_2   UINT32_C(0x1)
36199 	/* 4 aggregations */
36200 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_4   UINT32_C(0x2)
36201 	/* 8 aggregations */
36202 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_8   UINT32_C(0x3)
36203 	/* 16 aggregations */
36204 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_16  UINT32_C(0x4)
36205 	/* Any aggregation size larger than this is not valid */
36206 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX UINT32_C(0x7)
36207 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_LAST HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX
36208 	/*
36209 	 * This is the maximum amount of time allowed for
36210 	 * an aggregation context to complete after it was initiated.
36211 	 */
36212 	uint32_t	max_agg_timer;
36213 	/*
36214 	 * This is the minimum amount of payload length required to
36215 	 * start an aggregation context.
36216 	 */
36217 	uint32_t	min_agg_len;
36218 	uint8_t	unused_0[7];
36219 	/*
36220 	 * This field is used in Output records to indicate that the output
36221 	 * is completely written to RAM.  This field should be read as '1'
36222 	 * to indicate that the output has been completely written.
36223 	 * When writing a command completion or response to an internal processor,
36224 	 * the order of writes has to be such that this field is written last.
36225 	 */
36226 	uint8_t	valid;
36227 } hwrm_vnic_tpa_qcfg_output_t, *phwrm_vnic_tpa_qcfg_output_t;
36228 
36229 /*********************
36230  * hwrm_vnic_rss_cfg *
36231  *********************/
36232 
36233 
36234 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
36235 
36236 typedef struct hwrm_vnic_rss_cfg_input {
36237 	/* The HWRM command request type. */
36238 	uint16_t	req_type;
36239 	/*
36240 	 * The completion ring to send the completion event on. This should
36241 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36242 	 */
36243 	uint16_t	cmpl_ring;
36244 	/*
36245 	 * The sequence ID is used by the driver for tracking multiple
36246 	 * commands. This ID is treated as opaque data by the firmware and
36247 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36248 	 */
36249 	uint16_t	seq_id;
36250 	/*
36251 	 * The target ID of the command:
36252 	 * * 0x0-0xFFF8 - The function ID
36253 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36254 	 * * 0xFFFD - Reserved for user-space HWRM interface
36255 	 * * 0xFFFF - HWRM
36256 	 */
36257 	uint16_t	target_id;
36258 	/*
36259 	 * A physical address pointer pointing to a host buffer that the
36260 	 * command's response data will be written. This can be either a host
36261 	 * physical address (HPA) or a guest physical address (GPA) and must
36262 	 * point to a physically contiguous block of memory.
36263 	 */
36264 	uint64_t	resp_addr;
36265 	uint32_t	hash_type;
36266 	/*
36267 	 * When this bit is '1', the RSS hash shall be computed
36268 	 * over source and destination IPv4 addresses of IPv4
36269 	 * packets.
36270 	 */
36271 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4		UINT32_C(0x1)
36272 	/*
36273 	 * When this bit is '1', the RSS hash shall be computed
36274 	 * over source/destination IPv4 addresses and
36275 	 * source/destination ports of TCP/IPv4 packets.
36276 	 */
36277 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4		UINT32_C(0x2)
36278 	/*
36279 	 * When this bit is '1', the RSS hash shall be computed
36280 	 * over source/destination IPv4 addresses and
36281 	 * source/destination ports of UDP/IPv4 packets.
36282 	 */
36283 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4		UINT32_C(0x4)
36284 	/*
36285 	 * When this bit is '1', the RSS hash shall be computed
36286 	 * over source and destination IPv6 addresses of IPv6
36287 	 * packets.
36288 	 */
36289 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6		UINT32_C(0x8)
36290 	/*
36291 	 * When this bit is '1', the RSS hash shall be computed
36292 	 * over source/destination IPv6 addresses and
36293 	 * source/destination ports of TCP/IPv6 packets.
36294 	 */
36295 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6		UINT32_C(0x10)
36296 	/*
36297 	 * When this bit is '1', the RSS hash shall be computed
36298 	 * over source/destination IPv6 addresses and
36299 	 * source/destination ports of UDP/IPv6 packets.
36300 	 */
36301 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6		UINT32_C(0x20)
36302 	/*
36303 	 * When this bit is '1', the RSS hash shall be computed
36304 	 * over source, destination IPv6 addresses and flow label of IPv6
36305 	 * packets. Hash type ipv6 and ipv6_flow_label are mutually
36306 	 * exclusive. HW does not include the flow_label in hash
36307 	 * calculation for the packets that are matching tcp_ipv6 and
36308 	 * udp_ipv6 hash types. Host drivers should set this bit based on
36309 	 * rss_ipv6_flow_label_cap.
36310 	 */
36311 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL	UINT32_C(0x40)
36312 	/*
36313 	 * When this bit is '1', the RSS hash shall be computed over
36314 	 * source/destination IPv4 addresses and IPSEC AH SPI field of IPSEC
36315 	 * AH/IPv4 packets. Host drivers should set this bit based on
36316 	 * rss_ipsec_ah_spi_ipv4_cap.
36317 	 */
36318 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV4	UINT32_C(0x80)
36319 	/*
36320 	 * When this bit is '1', the RSS hash shall be computed over
36321 	 * source/destination IPv4 addresses and IPSEC ESP SPI field of IPSEC
36322 	 * ESP/IPv4 packets. Host drivers should set this bit based on
36323 	 * rss_ipsec_esp_spi_ipv4_cap.
36324 	 */
36325 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4	UINT32_C(0x100)
36326 	/*
36327 	 * When this bit is '1', the RSS hash shall be computed over
36328 	 * source/destination IPv6 addresses and IPSEC AH SPI field of IPSEC
36329 	 * AH/IPv6 packets. Host drivers should set this bit based on
36330 	 * rss_ipsec_ah_spi_ipv6_cap.
36331 	 */
36332 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV6	UINT32_C(0x200)
36333 	/*
36334 	 * When this bit is '1', the RSS hash shall be computed over
36335 	 * source/destination IPv6 addresses and IPSEC ESP SPI field of IPSEC
36336 	 * ESP/IPv6 packets. Host drivers should set this bit based on
36337 	 * rss_ipsec_esp_spi_ipv6_cap.
36338 	 */
36339 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6	UINT32_C(0x400)
36340 	/* VNIC ID of VNIC associated with RSS table being configured. */
36341 	uint16_t	vnic_id;
36342 	/*
36343 	 * Specifies which VNIC ring table pair to configure.
36344 	 * Valid values range from 0 to 7.
36345 	 */
36346 	uint8_t	ring_table_pair_index;
36347 	/*
36348 	 * Flags to specify different RSS hash modes. Global RSS hash mode is
36349 	 * indicated when vnic_id and rss_ctx_idx fields are set to value of
36350 	 * 0xffff. Only PF can initiate global RSS hash mode setting changes.
36351 	 * VNIC RSS hash mode is indicated with valid vnic_id and rss_ctx_idx,
36352 	 * if FW is VNIC_RSS_HASH_MODE capable. FW configures the mode based
36353 	 * on first come first serve order. Global RSS hash mode and VNIC RSS
36354 	 * hash modes are mutually exclusive. FW returns invalid error
36355 	 * if FW receives conflicting requests. To change the current hash
36356 	 * mode, the mode associated drivers need to be unloaded and apply
36357 	 * the new configuration.
36358 	 */
36359 	uint8_t	hash_mode_flags;
36360 	/*
36361 	 * When this bit is '1' and FW is VNIC_RSS_HASH_MODE capable,
36362 	 * innermost_4 and innermost_2 hash modes are used to configure
36363 	 * the tuple mode. When this bit is '1' and FW is not
36364 	 * VNIC_RSS_HASH_MODE capable, It indicates using current RSS hash
36365 	 * mode setting configured in the device otherwise.
36366 	 */
36367 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
36368 	/*
36369 	 * When this bit is '1', it indicates requesting support of
36370 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
36371 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
36372 	 * packets, the RSS hash is computed over the normal
36373 	 * src/dest l3 and src/dest l4 headers.
36374 	 */
36375 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
36376 	/*
36377 	 * When this bit is '1', it indicates requesting support of
36378 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
36379 	 * tunnel packets. For none-tunnel packets, the RSS hash is
36380 	 * computed over the normal src/dest l3 headers.
36381 	 */
36382 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
36383 	/*
36384 	 * When this bit is '1', it indicates requesting support of
36385 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
36386 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
36387 	 * packets, the RSS hash is computed over the normal
36388 	 * src/dest l3 and src/dest l4 headers.
36389 	 */
36390 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
36391 	/*
36392 	 * When this bit is '1', it indicates requesting support of
36393 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
36394 	 * tunnel packets. For none-tunnel packets, the RSS hash is
36395 	 * computed over the normal src/dest l3 headers.
36396 	 */
36397 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
36398 	/* This is the address for rss ring group table */
36399 	uint64_t	ring_grp_tbl_addr;
36400 	/* This is the address for rss hash key table */
36401 	uint64_t	hash_key_tbl_addr;
36402 	/* Index to the rss indirection table. */
36403 	uint16_t	rss_ctx_idx;
36404 	uint8_t	flags;
36405 	/*
36406 	 * When this bit is '1', it indicates that the hash_type field is
36407 	 * interpreted as a change relative the current configuration. Each
36408 	 * '1' bit in hash_type represents a header to add to the current
36409 	 * hash. Zeroes designate the hash_type state bits that should remain
36410 	 * unchanged, if possible. If this constraint on the existing state
36411 	 * cannot be satisfied, then the implementation should preference
36412 	 * adding other headers so as to honor the request to add the
36413 	 * specified headers. It is an error to set this flag concurrently
36414 	 * with hash_type_exclude.
36415 	 */
36416 	#define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_INCLUDE	UINT32_C(0x1)
36417 	/*
36418 	 * When this bit is '1', it indicates that the hash_type field is
36419 	 * interpreted as a change relative the current configuration. Each
36420 	 * '1' bit in hash_type represents a header to remove from the
36421 	 * current hash. Zeroes designate the hash_type state bits that
36422 	 * should remain unchanged, if possible. If this constraint on the
36423 	 * existing state cannot be satisfied, then the implementation should
36424 	 * preference removing other headers so as to honor the request to
36425 	 * remove the specified headers. It is an error to set this flag
36426 	 * concurrently with hash_type_include.
36427 	 */
36428 	#define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_EXCLUDE	UINT32_C(0x2)
36429 	uint8_t	ring_select_mode;
36430 	/*
36431 	 * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
36432 	 * hash key to hash the packets according to the configured hash
36433 	 * type and hash mode. The Toeplitz hash results and the provided
36434 	 * Toeplitz RSS indirection table are used to determine the RSS
36435 	 * rings.
36436 	 */
36437 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ	UINT32_C(0x0)
36438 	/*
36439 	 * In this mode, HW uses XOR algorithm to hash the packets according
36440 	 * to the configured hash type and hash mode. The XOR hash results
36441 	 * and the provided XOR RSS indirection table are used to determine
36442 	 * the RSS rings. Host drivers provided hash key is not honored in
36443 	 * this mode.
36444 	 */
36445 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_XOR		UINT32_C(0x1)
36446 	/*
36447 	 * In this mode, HW uses inner packets checksum algorithm to
36448 	 * distribute the packets across the rings and Toeplitz algorithm
36449 	 * to calculate the hash to convey it in the RX completions. Host
36450 	 * drivers should provide Toeplitz hash key. As HW uses innermost
36451 	 * packets checksum to distribute the packets across the rings,
36452 	 * host drivers can't convey hash mode to choose outer headers to
36453 	 * calculate Toeplitz hash. FW will fail such configuration.
36454 	 */
36455 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM UINT32_C(0x2)
36456 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_LAST		HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
36457 	uint8_t	unused_1[4];
36458 } hwrm_vnic_rss_cfg_input_t, *phwrm_vnic_rss_cfg_input_t;
36459 
36460 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
36461 
36462 typedef struct hwrm_vnic_rss_cfg_output {
36463 	/* The specific error status for the command. */
36464 	uint16_t	error_code;
36465 	/* The HWRM command request type. */
36466 	uint16_t	req_type;
36467 	/* The sequence ID from the original command. */
36468 	uint16_t	seq_id;
36469 	/* The length of the response data in number of bytes. */
36470 	uint16_t	resp_len;
36471 	uint8_t	unused_0[7];
36472 	/*
36473 	 * This field is used in Output records to indicate that the output
36474 	 * is completely written to RAM.  This field should be read as '1'
36475 	 * to indicate that the output has been completely written.
36476 	 * When writing a command completion or response to an internal processor,
36477 	 * the order of writes has to be such that this field is written last.
36478 	 */
36479 	uint8_t	valid;
36480 } hwrm_vnic_rss_cfg_output_t, *phwrm_vnic_rss_cfg_output_t;
36481 
36482 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
36483 
36484 typedef struct hwrm_vnic_rss_cfg_cmd_err {
36485 	/*
36486 	 * command specific error codes that goes to
36487 	 * the cmd_err field in Common HWRM Error Response.
36488 	 */
36489 	uint8_t	code;
36490 	/* Unknown error */
36491 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
36492 	/*
36493 	 * Unable to change global RSS mode to outer due to all active
36494 	 * interfaces are not ready to support outer RSS hashing.
36495 	 */
36496 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY UINT32_C(0x1)
36497 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST		HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
36498 	uint8_t	unused_0[7];
36499 } hwrm_vnic_rss_cfg_cmd_err_t, *phwrm_vnic_rss_cfg_cmd_err_t;
36500 
36501 /**********************
36502  * hwrm_vnic_rss_qcfg *
36503  **********************/
36504 
36505 
36506 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
36507 
36508 typedef struct hwrm_vnic_rss_qcfg_input {
36509 	/* The HWRM command request type. */
36510 	uint16_t	req_type;
36511 	/*
36512 	 * The completion ring to send the completion event on. This should
36513 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36514 	 */
36515 	uint16_t	cmpl_ring;
36516 	/*
36517 	 * The sequence ID is used by the driver for tracking multiple
36518 	 * commands. This ID is treated as opaque data by the firmware and
36519 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36520 	 */
36521 	uint16_t	seq_id;
36522 	/*
36523 	 * The target ID of the command:
36524 	 * * 0x0-0xFFF8 - The function ID
36525 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36526 	 * * 0xFFFD - Reserved for user-space HWRM interface
36527 	 * * 0xFFFF - HWRM
36528 	 */
36529 	uint16_t	target_id;
36530 	/*
36531 	 * A physical address pointer pointing to a host buffer that the
36532 	 * command's response data will be written. This can be either a host
36533 	 * physical address (HPA) or a guest physical address (GPA) and must
36534 	 * point to a physically contiguous block of memory.
36535 	 */
36536 	uint64_t	resp_addr;
36537 	/*
36538 	 * Index to the rss indirection table. This field is used as a lookup
36539 	 * for chips before Thor - i.e. Cumulus and Whitney.
36540 	 */
36541 	uint16_t	rss_ctx_idx;
36542 	/*
36543 	 * VNIC ID of VNIC associated with RSS table being queried. This field
36544 	 * is used as a lookup for Thor and later chips.
36545 	 */
36546 	uint16_t	vnic_id;
36547 	uint8_t	unused_0[4];
36548 } hwrm_vnic_rss_qcfg_input_t, *phwrm_vnic_rss_qcfg_input_t;
36549 
36550 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
36551 
36552 typedef struct hwrm_vnic_rss_qcfg_output {
36553 	/* The specific error status for the command. */
36554 	uint16_t	error_code;
36555 	/* The HWRM command request type. */
36556 	uint16_t	req_type;
36557 	/* The sequence ID from the original command. */
36558 	uint16_t	seq_id;
36559 	/* The length of the response data in number of bytes. */
36560 	uint16_t	resp_len;
36561 	uint32_t	hash_type;
36562 	/*
36563 	 * When this bit is '1', the RSS hash shall be computed
36564 	 * over source and destination IPv4 addresses of IPv4
36565 	 * packets.
36566 	 */
36567 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4		UINT32_C(0x1)
36568 	/*
36569 	 * When this bit is '1', the RSS hash shall be computed
36570 	 * over source/destination IPv4 addresses and
36571 	 * source/destination ports of TCP/IPv4 packets.
36572 	 */
36573 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4		UINT32_C(0x2)
36574 	/*
36575 	 * When this bit is '1', the RSS hash shall be computed
36576 	 * over source/destination IPv4 addresses and
36577 	 * source/destination ports of UDP/IPv4 packets.
36578 	 */
36579 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4		UINT32_C(0x4)
36580 	/*
36581 	 * When this bit is '1', the RSS hash shall be computed
36582 	 * over source and destination IPv6 addresses of IPv6
36583 	 * packets.
36584 	 */
36585 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6		UINT32_C(0x8)
36586 	/*
36587 	 * When this bit is '1', the RSS hash shall be computed
36588 	 * over source/destination IPv6 addresses and
36589 	 * source/destination ports of TCP/IPv6 packets.
36590 	 */
36591 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6		UINT32_C(0x10)
36592 	/*
36593 	 * When this bit is '1', the RSS hash shall be computed
36594 	 * over source/destination IPv6 addresses and
36595 	 * source/destination ports of UDP/IPv6 packets.
36596 	 */
36597 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6		UINT32_C(0x20)
36598 	/*
36599 	 * When this bit is '1', the RSS hash shall be computed
36600 	 * over source, destination IPv6 addresses and flow label of IPv6
36601 	 * packets. Hash type ipv6 and ipv6_flow_label are mutually
36602 	 * exclusive. HW does not include the flow_label in hash
36603 	 * calculation for the packets that are matching tcp_ipv6 and
36604 	 * udp_ipv6 hash types. This bit will be '0' if
36605 	 * rss_ipv6_flow_label_cap is '0'.
36606 	 */
36607 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6_FLOW_LABEL	UINT32_C(0x40)
36608 	/*
36609 	 * When this bit is '1', the RSS hash shall be computed over
36610 	 * source/destination IPv4 addresses and IPSEC AH SPI field of IPSEC
36611 	 * AH/IPv4 packets. This bit will be '0' if rss_ipsec_ah_spi_ipv4_cap
36612 	 * is '0'.
36613 	 */
36614 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_AH_SPI_IPV4	UINT32_C(0x80)
36615 	/*
36616 	 * When this bit is '1', the RSS hash shall be computed over
36617 	 * source/destination IPv4 addresses and IPSEC ESP SPI field of IPSEC
36618 	 * ESP/IPv4 packets. This bit will be '0' if
36619 	 * rss_ipsec_esp_spi_ipv4_cap is '0'.
36620 	 */
36621 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_ESP_SPI_IPV4	UINT32_C(0x100)
36622 	/*
36623 	 * When this bit is '1', the RSS hash shall be computed over
36624 	 * source/destination IPv6 addresses and IPSEC AH SPI field of IPSEC
36625 	 * AH/IPv6 packets. This bit will be '0' if
36626 	 * rss_ipsec_ah_spi_ipv6_cap is '0'.
36627 	 */
36628 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_AH_SPI_IPV6	UINT32_C(0x200)
36629 	/*
36630 	 * When this bit is '1', the RSS hash shall be computed over
36631 	 * source/destination IPv6 addresses and IPSEC ESP SPI field of IPSEC
36632 	 * ESP/IPv6 packets. This bit will be '0' if
36633 	 * rss_ipsec_esp_spi_ipv6_cap is '0'.
36634 	 */
36635 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_ESP_SPI_IPV6	UINT32_C(0x400)
36636 	uint8_t	unused_0[4];
36637 	/* This is the value of rss hash key */
36638 	uint32_t	hash_key[10];
36639 	/*
36640 	 * Flags to specify different RSS hash modes. Setting rss_ctx_idx to
36641 	 * the value of 0xffff implies a global RSS configuration query.
36642 	 * hash_mode_flags are only valid for global RSS configuration query.
36643 	 * Only the PF can initiate a global RSS configuration query.
36644 	 * The query request fails if any VNIC is configured with hash mode
36645 	 * and rss_ctx_idx is 0xffff.
36646 	 */
36647 	uint8_t	hash_mode_flags;
36648 	/*
36649 	 * When this bit is '1' and FW is VNIC_RSS_HASH_MODE capable,
36650 	 * it indicates VNIC's configured RSS hash mode.
36651 	 * When this bit is '1' and FW is not VNIC_RSS_HASH_MODE capable,
36652 	 * It indicates using current RSS hash mode setting configured in the
36653 	 * device.
36654 	 */
36655 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
36656 	/*
36657 	 * When this bit is '1', it indicates requesting support of
36658 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
36659 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
36660 	 * packets, the RSS hash is computed over the normal
36661 	 * src/dest l3 and src/dest l4 headers.
36662 	 */
36663 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
36664 	/*
36665 	 * When this bit is '1', it indicates requesting support of
36666 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
36667 	 * tunnel packets. For none-tunnel packets, the RSS hash is
36668 	 * computed over the normal src/dest l3 headers.
36669 	 */
36670 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
36671 	/*
36672 	 * When this bit is '1', it indicates requesting support of
36673 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
36674 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
36675 	 * packets, the RSS hash is computed over the normal
36676 	 * src/dest l3 and src/dest l4 headers.
36677 	 */
36678 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
36679 	/*
36680 	 * When this bit is '1', it indicates requesting support of
36681 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
36682 	 * tunnel packets. For none-tunnel packets, the RSS hash is
36683 	 * computed over the normal src/dest l3 headers.
36684 	 */
36685 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
36686 	uint8_t	ring_select_mode;
36687 	/*
36688 	 * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
36689 	 * hash key to hash the packets according to the configured hash
36690 	 * type and hash mode. The Toeplitz hash results and the provided
36691 	 * Toeplitz RSS indirection table are used to determine the RSS
36692 	 * rings.
36693 	 */
36694 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ	UINT32_C(0x0)
36695 	/*
36696 	 * In this mode, HW uses XOR algorithm to hash the packets according
36697 	 * to the configured hash type and hash mode. The XOR hash results
36698 	 * and the provided XOR RSS indirection table are used to determine
36699 	 * the RSS rings. Host drivers provided hash key is not honored in
36700 	 * this mode.
36701 	 */
36702 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_XOR		UINT32_C(0x1)
36703 	/*
36704 	 * In this mode, HW uses inner packets checksum algorithm to
36705 	 * distribute the packets across the rings and Toeplitz algorithm
36706 	 * to calculate the hash to convey it in the RX completions. Host
36707 	 * drivers should provide Toeplitz hash key. As HW uses innermost
36708 	 * packets checksum to distribute the packets across the rings,
36709 	 * host drivers can't convey hash mode to choose outer headers to
36710 	 * calculate Toeplitz hash. FW will fail such configuration.
36711 	 */
36712 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM UINT32_C(0x2)
36713 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_LAST		HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
36714 	uint8_t	unused_1[5];
36715 	/*
36716 	 * This field is used in Output records to indicate that the output
36717 	 * is completely written to RAM.  This field should be read as '1'
36718 	 * to indicate that the output has been completely written.
36719 	 * When writing a command completion or response to an internal processor,
36720 	 * the order of writes has to be such that this field is written last.
36721 	 */
36722 	uint8_t	valid;
36723 } hwrm_vnic_rss_qcfg_output_t, *phwrm_vnic_rss_qcfg_output_t;
36724 
36725 /**************************
36726  * hwrm_vnic_plcmodes_cfg *
36727  **************************/
36728 
36729 
36730 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
36731 
36732 typedef struct hwrm_vnic_plcmodes_cfg_input {
36733 	/* The HWRM command request type. */
36734 	uint16_t	req_type;
36735 	/*
36736 	 * The completion ring to send the completion event on. This should
36737 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36738 	 */
36739 	uint16_t	cmpl_ring;
36740 	/*
36741 	 * The sequence ID is used by the driver for tracking multiple
36742 	 * commands. This ID is treated as opaque data by the firmware and
36743 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36744 	 */
36745 	uint16_t	seq_id;
36746 	/*
36747 	 * The target ID of the command:
36748 	 * * 0x0-0xFFF8 - The function ID
36749 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36750 	 * * 0xFFFD - Reserved for user-space HWRM interface
36751 	 * * 0xFFFF - HWRM
36752 	 */
36753 	uint16_t	target_id;
36754 	/*
36755 	 * A physical address pointer pointing to a host buffer that the
36756 	 * command's response data will be written. This can be either a host
36757 	 * physical address (HPA) or a guest physical address (GPA) and must
36758 	 * point to a physically contiguous block of memory.
36759 	 */
36760 	uint64_t	resp_addr;
36761 	uint32_t	flags;
36762 	/*
36763 	 * When this bit is '1', the VNIC shall be configured to
36764 	 * use regular placement algorithm.
36765 	 * By default, the regular placement algorithm shall be
36766 	 * enabled on the VNIC.
36767 	 */
36768 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT	UINT32_C(0x1)
36769 	/*
36770 	 * When this bit is '1', the VNIC shall be configured
36771 	 * use the jumbo placement algorithm.
36772 	 */
36773 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT	UINT32_C(0x2)
36774 	/*
36775 	 * When this bit is '1', the VNIC shall be configured
36776 	 * to enable Header-Data split for IPv4 packets according
36777 	 * to the following rules:
36778 	 * # If the packet is identified as TCP/IPv4, then the
36779 	 * packet is split at the beginning of the TCP payload.
36780 	 * # If the packet is identified as UDP/IPv4, then the
36781 	 * packet is split at the beginning of UDP payload.
36782 	 * # If the packet is identified as non-TCP and non-UDP
36783 	 * IPv4 packet, then the packet is split at the beginning
36784 	 * of the upper layer protocol header carried in the IPv4
36785 	 * packet.
36786 	 */
36787 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4		UINT32_C(0x4)
36788 	/*
36789 	 * When this bit is '1', the VNIC shall be configured
36790 	 * to enable Header-Data split for IPv6 packets according
36791 	 * to the following rules:
36792 	 * # If the packet is identified as TCP/IPv6, then the
36793 	 * packet is split at the beginning of the TCP payload.
36794 	 * # If the packet is identified as UDP/IPv6, then the
36795 	 * packet is split at the beginning of UDP payload.
36796 	 * # If the packet is identified as non-TCP and non-UDP
36797 	 * IPv6 packet, then the packet is split at the beginning
36798 	 * of the upper layer protocol header carried in the IPv6
36799 	 * packet.
36800 	 */
36801 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6		UINT32_C(0x8)
36802 	/*
36803 	 * When this bit is '1', the VNIC shall be configured
36804 	 * to enable Header-Data split for FCoE packets at the
36805 	 * beginning of FC payload.
36806 	 */
36807 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE		UINT32_C(0x10)
36808 	/*
36809 	 * When this bit is '1', the VNIC shall be configured
36810 	 * to enable Header-Data split for RoCE packets at the
36811 	 * beginning of RoCE payload (after BTH/GRH headers).
36812 	 */
36813 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE		UINT32_C(0x20)
36814 	/*
36815 	 * When this bit is '1', the VNIC shall be configured use the virtio
36816 	 * placement algorithm. This feature can only be configured when
36817 	 * proxy mode is supported on the function.
36818 	 */
36819 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT	UINT32_C(0x40)
36820 	uint32_t	enables;
36821 	/*
36822 	 * This bit must be '1' for the jumbo_thresh_valid field to be
36823 	 * configured.
36824 	 */
36825 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID	UINT32_C(0x1)
36826 	/*
36827 	 * This bit must be '1' for the hds_offset_valid field to be
36828 	 * configured.
36829 	 */
36830 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID	UINT32_C(0x2)
36831 	/*
36832 	 * This bit must be '1' for the hds_threshold_valid field to be
36833 	 * configured.
36834 	 */
36835 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID	UINT32_C(0x4)
36836 	/*
36837 	 * This bit must be '1' for the max_bds_valid field to be
36838 	 * configured.
36839 	 */
36840 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID	UINT32_C(0x8)
36841 	/* Logical vnic ID */
36842 	uint32_t	vnic_id;
36843 	/*
36844 	 * When jumbo placement algorithm is enabled, this value
36845 	 * is used to determine the threshold for jumbo placement.
36846 	 * Packets with length larger than this value will be
36847 	 * placed according to the jumbo placement algorithm.
36848 	 */
36849 	uint16_t	jumbo_thresh;
36850 	/*
36851 	 * This value is used to determine the offset into
36852 	 * packet buffer where the split data (payload) will be
36853 	 * placed according to one of HDS placement algorithm.
36854 	 *
36855 	 * The lengths of packet buffers provided for split data
36856 	 * shall be larger than this value.
36857 	 */
36858 	uint16_t	hds_offset;
36859 	/*
36860 	 * When one of the HDS placement algorithm is enabled, this
36861 	 * value is used to determine the threshold for HDS
36862 	 * placement.
36863 	 * Packets with length larger than this value will be
36864 	 * placed according to the HDS placement algorithm.
36865 	 * This value shall be in multiple of 4 bytes.
36866 	 */
36867 	uint16_t	hds_threshold;
36868 	/*
36869 	 * When virtio placement algorithm is enabled, this
36870 	 * value is used to determine the maximum number of BDs
36871 	 * that can be used to place an Rx Packet.
36872 	 * If an incoming packet does not fit in the buffers described
36873 	 * by the max BDs, the packet will be dropped and an error
36874 	 * will be reported in the completion. Valid values for this
36875 	 * field are between 1 and 8. If the VNIC uses header-data-
36876 	 * separation and/or TPA with buffer spanning enabled, valid
36877 	 * values for this field are between 2 and 8.
36878 	 * This feature can only be configured when proxy mode is
36879 	 * supported on the function.
36880 	 */
36881 	uint16_t	max_bds;
36882 	uint8_t	unused_0[4];
36883 } hwrm_vnic_plcmodes_cfg_input_t, *phwrm_vnic_plcmodes_cfg_input_t;
36884 
36885 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
36886 
36887 typedef struct hwrm_vnic_plcmodes_cfg_output {
36888 	/* The specific error status for the command. */
36889 	uint16_t	error_code;
36890 	/* The HWRM command request type. */
36891 	uint16_t	req_type;
36892 	/* The sequence ID from the original command. */
36893 	uint16_t	seq_id;
36894 	/* The length of the response data in number of bytes. */
36895 	uint16_t	resp_len;
36896 	uint8_t	unused_0[7];
36897 	/*
36898 	 * This field is used in Output records to indicate that the output
36899 	 * is completely written to RAM.  This field should be read as '1'
36900 	 * to indicate that the output has been completely written.
36901 	 * When writing a command completion or response to an internal
36902 	 * processor, the order of writes has to be such that this field is
36903 	 * written last.
36904 	 */
36905 	uint8_t	valid;
36906 } hwrm_vnic_plcmodes_cfg_output_t, *phwrm_vnic_plcmodes_cfg_output_t;
36907 
36908 /***************************
36909  * hwrm_vnic_plcmodes_qcfg *
36910  ***************************/
36911 
36912 
36913 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
36914 
36915 typedef struct hwrm_vnic_plcmodes_qcfg_input {
36916 	/* The HWRM command request type. */
36917 	uint16_t	req_type;
36918 	/*
36919 	 * The completion ring to send the completion event on. This should
36920 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36921 	 */
36922 	uint16_t	cmpl_ring;
36923 	/*
36924 	 * The sequence ID is used by the driver for tracking multiple
36925 	 * commands. This ID is treated as opaque data by the firmware and
36926 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36927 	 */
36928 	uint16_t	seq_id;
36929 	/*
36930 	 * The target ID of the command:
36931 	 * * 0x0-0xFFF8 - The function ID
36932 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36933 	 * * 0xFFFD - Reserved for user-space HWRM interface
36934 	 * * 0xFFFF - HWRM
36935 	 */
36936 	uint16_t	target_id;
36937 	/*
36938 	 * A physical address pointer pointing to a host buffer that the
36939 	 * command's response data will be written. This can be either a host
36940 	 * physical address (HPA) or a guest physical address (GPA) and must
36941 	 * point to a physically contiguous block of memory.
36942 	 */
36943 	uint64_t	resp_addr;
36944 	/* Logical vnic ID */
36945 	uint32_t	vnic_id;
36946 	uint8_t	unused_0[4];
36947 } hwrm_vnic_plcmodes_qcfg_input_t, *phwrm_vnic_plcmodes_qcfg_input_t;
36948 
36949 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
36950 
36951 typedef struct hwrm_vnic_plcmodes_qcfg_output {
36952 	/* The specific error status for the command. */
36953 	uint16_t	error_code;
36954 	/* The HWRM command request type. */
36955 	uint16_t	req_type;
36956 	/* The sequence ID from the original command. */
36957 	uint16_t	seq_id;
36958 	/* The length of the response data in number of bytes. */
36959 	uint16_t	resp_len;
36960 	uint32_t	flags;
36961 	/*
36962 	 * When this bit is '1', the VNIC is configured to
36963 	 * use regular placement algorithm.
36964 	 */
36965 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT	UINT32_C(0x1)
36966 	/*
36967 	 * When this bit is '1', the VNIC is configured to
36968 	 * use the jumbo placement algorithm.
36969 	 */
36970 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT	UINT32_C(0x2)
36971 	/*
36972 	 * When this bit is '1', the VNIC is configured
36973 	 * to enable Header-Data split for IPv4 packets.
36974 	 */
36975 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4		UINT32_C(0x4)
36976 	/*
36977 	 * When this bit is '1', the VNIC is configured
36978 	 * to enable Header-Data split for IPv6 packets.
36979 	 */
36980 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6		UINT32_C(0x8)
36981 	/*
36982 	 * When this bit is '1', the VNIC is configured
36983 	 * to enable Header-Data split for FCoE packets.
36984 	 */
36985 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE		UINT32_C(0x10)
36986 	/*
36987 	 * When this bit is '1', the VNIC is configured
36988 	 * to enable Header-Data split for RoCE packets.
36989 	 */
36990 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE		UINT32_C(0x20)
36991 	/*
36992 	 * When this bit is '1', the VNIC is configured
36993 	 * to be the default VNIC of the requesting function.
36994 	 */
36995 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC		UINT32_C(0x40)
36996 	/*
36997 	 * When this bit is '1', the VNIC is configured to use the virtio
36998 	 * placement algorithm. This feature can only be configured when
36999 	 * proxy mode is supported on the function.
37000 	 */
37001 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT	UINT32_C(0x80)
37002 	/*
37003 	 * When jumbo placement algorithm is enabled, this value
37004 	 * is used to determine the threshold for jumbo placement.
37005 	 * Packets with length larger than this value will be
37006 	 * placed according to the jumbo placement algorithm.
37007 	 */
37008 	uint16_t	jumbo_thresh;
37009 	/*
37010 	 * This value is used to determine the offset into
37011 	 * packet buffer where the split data (payload) will be
37012 	 * placed according to one of HDS placement algorithm.
37013 	 *
37014 	 * The lengths of packet buffers provided for split data
37015 	 * shall be larger than this value.
37016 	 */
37017 	uint16_t	hds_offset;
37018 	/*
37019 	 * When one of the HDS placement algorithm is enabled, this
37020 	 * value is used to determine the threshold for HDS
37021 	 * placement.
37022 	 * Packets with length larger than this value will be
37023 	 * placed according to the HDS placement algorithm.
37024 	 * This value shall be in multiple of 4 bytes.
37025 	 */
37026 	uint16_t	hds_threshold;
37027 	/*
37028 	 * When virtio placement algorithm is enabled, this
37029 	 * value is used to determine the maximum number of BDs
37030 	 * that can be used to place an Rx Packet.
37031 	 * If an incoming packet does not fit in the buffers described
37032 	 * by the max BDs, the packet will be dropped and an error
37033 	 * will be reported in the completion. Valid values for this
37034 	 * field are between 1 and 8. If the VNIC uses header-data-
37035 	 * separation and/or TPA with buffer spanning enabled, valid
37036 	 * values for this field are between 2 and 8.
37037 	 * This feature can only be configured when proxy mode is supported
37038 	 * on the function
37039 	 */
37040 	uint16_t	max_bds;
37041 	uint8_t	unused_0[3];
37042 	/*
37043 	 * This field is used in Output records to indicate that the output
37044 	 * is completely written to RAM.  This field should be read as '1'
37045 	 * to indicate that the output has been completely written.
37046 	 * When writing a command completion or response to an internal
37047 	 * processor, the order of writes has to be such that this field is
37048 	 * written last.
37049 	 */
37050 	uint8_t	valid;
37051 } hwrm_vnic_plcmodes_qcfg_output_t, *phwrm_vnic_plcmodes_qcfg_output_t;
37052 
37053 /**********************************
37054  * hwrm_vnic_rss_cos_lb_ctx_alloc *
37055  **********************************/
37056 
37057 
37058 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
37059 
37060 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
37061 	/* The HWRM command request type. */
37062 	uint16_t	req_type;
37063 	/*
37064 	 * The completion ring to send the completion event on. This should
37065 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37066 	 */
37067 	uint16_t	cmpl_ring;
37068 	/*
37069 	 * The sequence ID is used by the driver for tracking multiple
37070 	 * commands. This ID is treated as opaque data by the firmware and
37071 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37072 	 */
37073 	uint16_t	seq_id;
37074 	/*
37075 	 * The target ID of the command:
37076 	 * * 0x0-0xFFF8 - The function ID
37077 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37078 	 * * 0xFFFD - Reserved for user-space HWRM interface
37079 	 * * 0xFFFF - HWRM
37080 	 */
37081 	uint16_t	target_id;
37082 	/*
37083 	 * A physical address pointer pointing to a host buffer that the
37084 	 * command's response data will be written. This can be either a host
37085 	 * physical address (HPA) or a guest physical address (GPA) and must
37086 	 * point to a physically contiguous block of memory.
37087 	 */
37088 	uint64_t	resp_addr;
37089 } hwrm_vnic_rss_cos_lb_ctx_alloc_input_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_input_t;
37090 
37091 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
37092 
37093 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
37094 	/* The specific error status for the command. */
37095 	uint16_t	error_code;
37096 	/* The HWRM command request type. */
37097 	uint16_t	req_type;
37098 	/* The sequence ID from the original command. */
37099 	uint16_t	seq_id;
37100 	/* The length of the response data in number of bytes. */
37101 	uint16_t	resp_len;
37102 	/* rss_cos_lb_ctx_id is 16 b */
37103 	uint16_t	rss_cos_lb_ctx_id;
37104 	uint8_t	unused_0[5];
37105 	/*
37106 	 * This field is used in Output records to indicate that the output
37107 	 * is completely written to RAM.  This field should be read as '1'
37108 	 * to indicate that the output has been completely written.
37109 	 * When writing a command completion or response to an internal processor,
37110 	 * the order of writes has to be such that this field is written last.
37111 	 */
37112 	uint8_t	valid;
37113 } hwrm_vnic_rss_cos_lb_ctx_alloc_output_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_output_t;
37114 
37115 /*********************************
37116  * hwrm_vnic_rss_cos_lb_ctx_free *
37117  *********************************/
37118 
37119 
37120 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
37121 
37122 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_input {
37123 	/* The HWRM command request type. */
37124 	uint16_t	req_type;
37125 	/*
37126 	 * The completion ring to send the completion event on. This should
37127 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37128 	 */
37129 	uint16_t	cmpl_ring;
37130 	/*
37131 	 * The sequence ID is used by the driver for tracking multiple
37132 	 * commands. This ID is treated as opaque data by the firmware and
37133 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37134 	 */
37135 	uint16_t	seq_id;
37136 	/*
37137 	 * The target ID of the command:
37138 	 * * 0x0-0xFFF8 - The function ID
37139 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37140 	 * * 0xFFFD - Reserved for user-space HWRM interface
37141 	 * * 0xFFFF - HWRM
37142 	 */
37143 	uint16_t	target_id;
37144 	/*
37145 	 * A physical address pointer pointing to a host buffer that the
37146 	 * command's response data will be written. This can be either a host
37147 	 * physical address (HPA) or a guest physical address (GPA) and must
37148 	 * point to a physically contiguous block of memory.
37149 	 */
37150 	uint64_t	resp_addr;
37151 	/* rss_cos_lb_ctx_id is 16 b */
37152 	uint16_t	rss_cos_lb_ctx_id;
37153 	uint8_t	unused_0[6];
37154 } hwrm_vnic_rss_cos_lb_ctx_free_input_t, *phwrm_vnic_rss_cos_lb_ctx_free_input_t;
37155 
37156 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
37157 
37158 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_output {
37159 	/* The specific error status for the command. */
37160 	uint16_t	error_code;
37161 	/* The HWRM command request type. */
37162 	uint16_t	req_type;
37163 	/* The sequence ID from the original command. */
37164 	uint16_t	seq_id;
37165 	/* The length of the response data in number of bytes. */
37166 	uint16_t	resp_len;
37167 	uint8_t	unused_0[7];
37168 	/*
37169 	 * This field is used in Output records to indicate that the output
37170 	 * is completely written to RAM.  This field should be read as '1'
37171 	 * to indicate that the output has been completely written.
37172 	 * When writing a command completion or response to an internal processor,
37173 	 * the order of writes has to be such that this field is written last.
37174 	 */
37175 	uint8_t	valid;
37176 } hwrm_vnic_rss_cos_lb_ctx_free_output_t, *phwrm_vnic_rss_cos_lb_ctx_free_output_t;
37177 
37178 /*******************
37179  * hwrm_ring_alloc *
37180  *******************/
37181 
37182 
37183 /* hwrm_ring_alloc_input (size:704b/88B) */
37184 
37185 typedef struct hwrm_ring_alloc_input {
37186 	/* The HWRM command request type. */
37187 	uint16_t	req_type;
37188 	/*
37189 	 * The completion ring to send the completion event on. This should
37190 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37191 	 */
37192 	uint16_t	cmpl_ring;
37193 	/*
37194 	 * The sequence ID is used by the driver for tracking multiple
37195 	 * commands. This ID is treated as opaque data by the firmware and
37196 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37197 	 */
37198 	uint16_t	seq_id;
37199 	/*
37200 	 * The target ID of the command:
37201 	 * * 0x0-0xFFF8 - The function ID
37202 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37203 	 * * 0xFFFD - Reserved for user-space HWRM interface
37204 	 * * 0xFFFF - HWRM
37205 	 */
37206 	uint16_t	target_id;
37207 	/*
37208 	 * A physical address pointer pointing to a host buffer that the
37209 	 * command's response data will be written. This can be either a host
37210 	 * physical address (HPA) or a guest physical address (GPA) and must
37211 	 * point to a physically contiguous block of memory.
37212 	 */
37213 	uint64_t	resp_addr;
37214 	uint32_t	enables;
37215 	/*
37216 	 * This bit must be '1' for the ring_arb_cfg field to be
37217 	 * configured.
37218 	 */
37219 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG	UINT32_C(0x2)
37220 	/*
37221 	 * This bit must be '1' for the stat_ctx_id_valid field to be
37222 	 * configured.
37223 	 */
37224 	#define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID	UINT32_C(0x8)
37225 	/*
37226 	 * This bit must be '1' for the max_bw_valid field to be
37227 	 * configured.
37228 	 */
37229 	#define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID	UINT32_C(0x20)
37230 	/*
37231 	 * This bit must be '1' for the rx_ring_id field to be
37232 	 * configured.
37233 	 */
37234 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID	UINT32_C(0x40)
37235 	/*
37236 	 * This bit must be '1' for the nq_ring_id field to be
37237 	 * configured.
37238 	 */
37239 	#define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID	UINT32_C(0x80)
37240 	/*
37241 	 * This bit must be '1' for the rx_buf_size field to be
37242 	 * configured.
37243 	 */
37244 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID	UINT32_C(0x100)
37245 	/*
37246 	 * This bit must be '1' for the schq_id field to be
37247 	 * configured.
37248 	 */
37249 	#define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID		UINT32_C(0x200)
37250 	/*
37251 	 * This bit must be '1' for the mpc_chnls_type field to be
37252 	 * configured.
37253 	 */
37254 	#define HWRM_RING_ALLOC_INPUT_ENABLES_MPC_CHNLS_TYPE	UINT32_C(0x400)
37255 	/* Ring Type. */
37256 	uint8_t	ring_type;
37257 	/* L2 Completion Ring (CR) */
37258 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
37259 	/* TX Ring (TR) */
37260 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX	UINT32_C(0x1)
37261 	/* RX Ring (RR) */
37262 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX	UINT32_C(0x2)
37263 	/* RoCE Notification Completion Ring (ROCE_CR) */
37264 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
37265 	/* RX Aggregation Ring */
37266 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG	UINT32_C(0x4)
37267 	/* Notification Queue */
37268 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ	UINT32_C(0x5)
37269 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST	HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
37270 	/*
37271 	 * This field controls the number of packets transmitted before a TX
37272 	 * completion is generated. Non-zero values for the field are only
37273 	 * valid if HWRM_FUNC_QCAPS indicates that the TX coalesced completion
37274 	 * records capability is supported.
37275 	 */
37276 	uint8_t	cmpl_coal_cnt;
37277 	/* Generates a legacy TX completion on every packet. */
37278 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_OFF UINT32_C(0x0)
37279 	/* Generates a TX coalesced completion for up to 4 TX packets. */
37280 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_4   UINT32_C(0x1)
37281 	/* Generates a TX coalesced completion for up to 8 TX packets. */
37282 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_8   UINT32_C(0x2)
37283 	/* Generates a TX coalesced completion for up to 12 TX packets. */
37284 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_12  UINT32_C(0x3)
37285 	/* Generates a TX coalesced completion for up to 16 TX packets. */
37286 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_16  UINT32_C(0x4)
37287 	/* Generates a TX coalesced completion for up to 24 TX packets. */
37288 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_24  UINT32_C(0x5)
37289 	/* Generates a TX coalesced completion for up to 32 TX packets. */
37290 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_32  UINT32_C(0x6)
37291 	/* Generates a TX coalesced completion for up to 48 TX packets. */
37292 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_48  UINT32_C(0x7)
37293 	/* Generates a TX coalesced completion for up to 64 TX packets. */
37294 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_64  UINT32_C(0x8)
37295 	/* Generates a TX coalesced completion for up to 96 TX packets. */
37296 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_96  UINT32_C(0x9)
37297 	/* Generates a TX coalesced completion for up to 128 TX packets. */
37298 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_128 UINT32_C(0xa)
37299 	/* Generates a TX coalesced completion for up to 192 TX packets. */
37300 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_192 UINT32_C(0xb)
37301 	/* Generates a TX coalesced completion for up to 256 TX packets. */
37302 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_256 UINT32_C(0xc)
37303 	/* Generates a TX coalesced completion for up to 320 TX packets. */
37304 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_320 UINT32_C(0xd)
37305 	/* Generates a TX coalesced completion for up to 384 TX packets. */
37306 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_384 UINT32_C(0xe)
37307 	/* Generates a TX coalesced completion up to the last packet. (Maximum coalescing). */
37308 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX UINT32_C(0xf)
37309 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_LAST	HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX
37310 	/* Ring allocation flags. */
37311 	uint16_t	flags;
37312 	/*
37313 	 * For Rx rings, the incoming packet data can be placed at either
37314 	 * a 0B or 2B offset from the start of the Rx packet buffer. When
37315 	 * '1', the received packet will be padded with 2B of zeros at the
37316 	 * front of the packet. Note that this flag is only used for
37317 	 * Rx rings and is ignored for all other rings included Rx
37318 	 * Aggregation rings.
37319 	 */
37320 	#define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD			UINT32_C(0x1)
37321 	/*
37322 	 * When the HW Doorbell Drop Recovery feature is enabled,
37323 	 * HW can flag false CQ overflow when CQ consumer index
37324 	 * doorbells are dropped when there really wasn't any overflow.
37325 	 * The CQE values could have already been processed by the driver,
37326 	 * but HW doesn't know about this because of the doorbell drop.
37327 	 * To avoid false detection of CQ overflow events,
37328 	 * it is recommended that CQ overflow detection is disabled
37329 	 * by the driver when HW based doorbell recovery is enabled.
37330 	 */
37331 	#define HWRM_RING_ALLOC_INPUT_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x2)
37332 	/*
37333 	 * Used with enhanced Doorbell Pacing feature, when set to '1'
37334 	 * this flag indicates that the NQ id that's allocated should be
37335 	 * used for DBR pacing notifications.
37336 	 */
37337 	#define HWRM_RING_ALLOC_INPUT_FLAGS_NQ_DBR_PACING			UINT32_C(0x4)
37338 	/*
37339 	 * Host driver should set this flag bit to '1' to enable
37340 	 * two-completion TX packet timestamp feature. By enabling this
37341 	 * per QP flag and enabling stamp bit in TX BD lflags, host drivers
37342 	 * expect two completions, one for regular TX completion and the
37343 	 * other completion with timestamp. For a QP with both completion
37344 	 * coalescing and timestamp completion features enabled, completion
37345 	 * coalescing takes place on regular TX completions. The timestamp
37346 	 * completions are not coalesced and a separate timestamp completion
37347 	 * is generated for each packet with stamp bit set in the TX BD
37348 	 * lflags.
37349 	 */
37350 	#define HWRM_RING_ALLOC_INPUT_FLAGS_TX_PKT_TS_CMPL_ENABLE		UINT32_C(0x8)
37351 	/*
37352 	 * This value is a pointer to the page table for the
37353 	 * Ring.
37354 	 */
37355 	uint64_t	page_tbl_addr;
37356 	/* First Byte Offset of the first entry in the first page. */
37357 	uint32_t	fbo;
37358 	/*
37359 	 * Actual page size in 2^page_size. The supported range is increments
37360 	 * in powers of 2 from 16 bytes to 1GB.
37361 	 * - 4 = 16 B
37362 	 *	Page size is 16 B.
37363 	 * - 12 = 4 KB
37364 	 *	Page size is 4 KB.
37365 	 * - 13 = 8 KB
37366 	 *	Page size is 8 KB.
37367 	 * - 16 = 64 KB
37368 	 *	Page size is 64 KB.
37369 	 * - 21 = 2 MB
37370 	 *	Page size is 2 MB.
37371 	 * - 22 = 4 MB
37372 	 *	Page size is 4 MB.
37373 	 * - 30 = 1 GB
37374 	 *	Page size is 1 GB.
37375 	 */
37376 	uint8_t	page_size;
37377 	/*
37378 	 * This value indicates the depth of page table.
37379 	 * For this version of the specification, value other than 0 or
37380 	 * 1 shall be considered as an invalid value.
37381 	 * When the page_tbl_depth = 0, then it is treated as a
37382 	 * special case with the following.
37383 	 * 1. FBO and page size fields are not valid.
37384 	 * 2. page_tbl_addr is the physical address of the first
37385 	 *	element of the ring.
37386 	 */
37387 	uint8_t	page_tbl_depth;
37388 	/* Used by a PF driver to associate a SCHQ with one of its TX rings. */
37389 	uint16_t	schq_id;
37390 	/*
37391 	 * Number of 16B units in the ring.  Minimum size for
37392 	 * a ring is 16 16B entries.
37393 	 */
37394 	uint32_t	length;
37395 	/*
37396 	 * Logical ring number for the ring to be allocated.
37397 	 * This value determines the position in the doorbell
37398 	 * area where the update to the ring will be made.
37399 	 *
37400 	 * For completion rings, this value is also the MSI-X
37401 	 * vector number for the function the completion ring is
37402 	 * associated with.
37403 	 */
37404 	uint16_t	logical_id;
37405 	/*
37406 	 * This field is used only when ring_type is a TX ring.
37407 	 * This value indicates what completion ring the TX ring
37408 	 * is associated with.
37409 	 */
37410 	uint16_t	cmpl_ring_id;
37411 	/*
37412 	 * This field is used only when ring_type is a TX ring.
37413 	 * This value indicates what CoS queue the TX ring
37414 	 * is associated with.
37415 	 */
37416 	uint16_t	queue_id;
37417 	/*
37418 	 * When allocating a Rx ring or Rx aggregation ring, this field
37419 	 * specifies the size of the buffer descriptors posted to the ring.
37420 	 */
37421 	uint16_t	rx_buf_size;
37422 	/*
37423 	 * When allocating an Rx aggregation ring, this field
37424 	 * specifies the associated Rx ring ID.
37425 	 */
37426 	uint16_t	rx_ring_id;
37427 	/*
37428 	 * When allocating a completion ring, this field
37429 	 * specifies the associated NQ ring ID.
37430 	 */
37431 	uint16_t	nq_ring_id;
37432 	/*
37433 	 * This field is used only when ring_type is a TX ring.
37434 	 * This field is used to configure arbitration related
37435 	 * parameters for a TX ring.
37436 	 */
37437 	uint16_t	ring_arb_cfg;
37438 	/* Arbitration policy used for the ring. */
37439 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK	UINT32_C(0xf)
37440 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT	0
37441 	/*
37442 	 * Use strict priority for the TX ring.
37443 	 * Priority value is specified in arb_policy_param
37444 	 */
37445 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP	UINT32_C(0x1)
37446 	/*
37447 	 * Use weighted fair queue arbitration for the TX ring.
37448 	 * Weight is specified in arb_policy_param
37449 	 */
37450 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ	UINT32_C(0x2)
37451 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST	HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
37452 	/* Reserved field. */
37453 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK		UINT32_C(0xf0)
37454 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT		4
37455 	/*
37456 	 * Arbitration policy specific parameter.
37457 	 * # For strict priority arbitration policy, this field
37458 	 * represents a priority value. If set to 0, then the priority
37459 	 * is not specified and the HWRM is allowed to select
37460 	 * any priority for this TX ring.
37461 	 * # For weighted fair queue arbitration policy, this field
37462 	 * represents a weight value. If set to 0, then the weight
37463 	 * is not specified and the HWRM is allowed to select
37464 	 * any weight for this TX ring.
37465 	 */
37466 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK UINT32_C(0xff00)
37467 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
37468 	uint16_t	unused_3;
37469 	/*
37470 	 * This field is reserved for the future use.
37471 	 * It shall be set to 0.
37472 	 */
37473 	uint32_t	reserved3;
37474 	/*
37475 	 * This field is used only when ring_type is a TX ring.
37476 	 * This input indicates what statistics context this ring
37477 	 * should be associated with.
37478 	 */
37479 	uint32_t	stat_ctx_id;
37480 	/*
37481 	 * This field is reserved for the future use.
37482 	 * It shall be set to 0.
37483 	 */
37484 	uint32_t	reserved4;
37485 	/*
37486 	 * This field is used only when ring_type is a TX ring
37487 	 * to specify maximum BW allocated to the TX ring.
37488 	 * The HWRM will translate this value into byte counter and
37489 	 * time interval used for this ring inside the device.
37490 	 */
37491 	uint32_t	max_bw;
37492 	/* The bandwidth value. */
37493 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37494 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT		0
37495 	/* The granularity of the value (bits or bytes). */
37496 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
37497 	/* Value is in bits. */
37498 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37499 	/* Value is in bytes. */
37500 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37501 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST		HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
37502 	/* bw_value_unit is 3 b */
37503 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37504 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
37505 	/* Value is in Mb or MB (base 10). */
37506 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37507 	/* Value is in Kb or KB (base 10). */
37508 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37509 	/* Value is in bits or bytes. */
37510 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37511 	/* Value is in Gb or GB (base 10). */
37512 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37513 	/* Value is in 1/100th of a percentage of total bandwidth. */
37514 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37515 	/* Invalid unit */
37516 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37517 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
37518 	/*
37519 	 * This field is used only when ring_type is a Completion ring.
37520 	 * This value indicates what interrupt mode should be used
37521 	 * on this completion ring.
37522 	 * Note: In the legacy interrupt mode, no more than 16
37523 	 * completion rings are allowed.
37524 	 */
37525 	uint8_t	int_mode;
37526 	/* Legacy INTA (deprecated) */
37527 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
37528 	/* Reserved */
37529 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
37530 	/* MSI-X */
37531 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
37532 	/* No Interrupt - Polled mode */
37533 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
37534 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST  HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
37535 	/* Midpath channel type */
37536 	uint8_t	mpc_chnls_type;
37537 	/*
37538 	 * Indicate the TX ring alloc MPC channel type is a MPC channel
37539 	 * with destination to the TX crypto engine block.
37540 	 */
37541 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TCE	UINT32_C(0x0)
37542 	/*
37543 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
37544 	 * with destination to the RX crypto engine block.
37545 	 */
37546 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RCE	UINT32_C(0x1)
37547 	/*
37548 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
37549 	 * with destination to the TX configurable flow processing block.
37550 	 */
37551 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TE_CFA  UINT32_C(0x2)
37552 	/*
37553 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
37554 	 * with destination to the RX configurable flow processing block.
37555 	 */
37556 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RE_CFA  UINT32_C(0x3)
37557 	/*
37558 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
37559 	 * with destination to the primate processor block.
37560 	 */
37561 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE UINT32_C(0x4)
37562 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_LAST   HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE
37563 	uint8_t	unused_4[2];
37564 	/*
37565 	 * The cq_handle is specified when allocating a completion ring. For
37566 	 * devices that support NQs, this cq_handle will be included in the
37567 	 * NQE to specify which CQ should be read to retrieve the completion
37568 	 * record.
37569 	 */
37570 	uint64_t	cq_handle;
37571 } hwrm_ring_alloc_input_t, *phwrm_ring_alloc_input_t;
37572 
37573 /* hwrm_ring_alloc_output (size:128b/16B) */
37574 
37575 typedef struct hwrm_ring_alloc_output {
37576 	/* The specific error status for the command. */
37577 	uint16_t	error_code;
37578 	/* The HWRM command request type. */
37579 	uint16_t	req_type;
37580 	/* The sequence ID from the original command. */
37581 	uint16_t	seq_id;
37582 	/* The length of the response data in number of bytes. */
37583 	uint16_t	resp_len;
37584 	/*
37585 	 * Physical number of ring allocated.
37586 	 * This value shall be unique for a ring type.
37587 	 */
37588 	uint16_t	ring_id;
37589 	/* Logical number of ring allocated. */
37590 	uint16_t	logical_ring_id;
37591 	/*
37592 	 * This field will tell whether to use ping or pong buffer
37593 	 * for first push operation.
37594 	 */
37595 	uint8_t	push_buffer_index;
37596 	/* Start push from ping buffer index */
37597 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
37598 	/* Start push from pong buffer index */
37599 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
37600 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_LAST	HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
37601 	uint8_t	unused_0[2];
37602 	/*
37603 	 * This field is used in Output records to indicate that the output
37604 	 * is completely written to RAM.  This field should be read as '1'
37605 	 * to indicate that the output has been completely written.
37606 	 * When writing a command completion or response to an internal processor,
37607 	 * the order of writes has to be such that this field is written last.
37608 	 */
37609 	uint8_t	valid;
37610 } hwrm_ring_alloc_output_t, *phwrm_ring_alloc_output_t;
37611 
37612 /******************
37613  * hwrm_ring_free *
37614  ******************/
37615 
37616 
37617 /* hwrm_ring_free_input (size:256b/32B) */
37618 
37619 typedef struct hwrm_ring_free_input {
37620 	/* The HWRM command request type. */
37621 	uint16_t	req_type;
37622 	/*
37623 	 * The completion ring to send the completion event on. This should
37624 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37625 	 */
37626 	uint16_t	cmpl_ring;
37627 	/*
37628 	 * The sequence ID is used by the driver for tracking multiple
37629 	 * commands. This ID is treated as opaque data by the firmware and
37630 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37631 	 */
37632 	uint16_t	seq_id;
37633 	/*
37634 	 * The target ID of the command:
37635 	 * * 0x0-0xFFF8 - The function ID
37636 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37637 	 * * 0xFFFD - Reserved for user-space HWRM interface
37638 	 * * 0xFFFF - HWRM
37639 	 */
37640 	uint16_t	target_id;
37641 	/*
37642 	 * A physical address pointer pointing to a host buffer that the
37643 	 * command's response data will be written. This can be either a host
37644 	 * physical address (HPA) or a guest physical address (GPA) and must
37645 	 * point to a physically contiguous block of memory.
37646 	 */
37647 	uint64_t	resp_addr;
37648 	/* Ring Type. */
37649 	uint8_t	ring_type;
37650 	/* L2 Completion Ring (CR) */
37651 	#define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
37652 	/* TX Ring (TR) */
37653 	#define HWRM_RING_FREE_INPUT_RING_TYPE_TX	UINT32_C(0x1)
37654 	/* RX Ring (RR) */
37655 	#define HWRM_RING_FREE_INPUT_RING_TYPE_RX	UINT32_C(0x2)
37656 	/* RoCE Notification Completion Ring (ROCE_CR) */
37657 	#define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
37658 	/* RX Aggregation Ring */
37659 	#define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG	UINT32_C(0x4)
37660 	/* Notification Queue */
37661 	#define HWRM_RING_FREE_INPUT_RING_TYPE_NQ	UINT32_C(0x5)
37662 	#define HWRM_RING_FREE_INPUT_RING_TYPE_LAST	HWRM_RING_FREE_INPUT_RING_TYPE_NQ
37663 	uint8_t	flags;
37664 	/*
37665 	 * If this bit is set to '1', ring_id in this command belongs to
37666 	 * virtio function. prod_idx in this command corresponds to doorbell
37667 	 * producer index. opaque field in this command needs to be inserted
37668 	 * by firmware in VEE_FLUSH completion record.
37669 	 * Firmware will poll the corresponding ring context to reach the
37670 	 * given producer index before sending successful response. It will
37671 	 * finish the completion using VEE_FLUSH completion record.
37672 	 *
37673 	 * If this bit is '0', firmware will not treat ring_id as virtio
37674 	 * ring and ignore prod_idx, opaque fields.
37675 	 *
37676 	 * This feature is not applicable for L2 or RoCE.
37677 	 */
37678 	#define HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID UINT32_C(0x1)
37679 	#define HWRM_RING_FREE_INPUT_FLAGS_LAST		HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID
37680 	/* Physical number of ring allocated. */
37681 	uint16_t	ring_id;
37682 	/*
37683 	 * Ring BD producer index posted by the virtio block.
37684 	 * This field is valid if virtio_ring_valid flag is set.
37685 	 */
37686 	uint32_t	prod_idx;
37687 	/*
37688 	 * User defined opaque field to be inserted into VEE_FLUSH completion
37689 	 * record. This field is valid if virtio_ring_valid flag is set.
37690 	 */
37691 	uint32_t	opaque;
37692 	uint32_t	unused_1;
37693 } hwrm_ring_free_input_t, *phwrm_ring_free_input_t;
37694 
37695 /* hwrm_ring_free_output (size:128b/16B) */
37696 
37697 typedef struct hwrm_ring_free_output {
37698 	/* The specific error status for the command. */
37699 	uint16_t	error_code;
37700 	/* The HWRM command request type. */
37701 	uint16_t	req_type;
37702 	/* The sequence ID from the original command. */
37703 	uint16_t	seq_id;
37704 	/* The length of the response data in number of bytes. */
37705 	uint16_t	resp_len;
37706 	uint8_t	unused_0[7];
37707 	/*
37708 	 * This field is used in Output records to indicate that the output
37709 	 * is completely written to RAM.  This field should be read as '1'
37710 	 * to indicate that the output has been completely written.
37711 	 * When writing a command completion or response to an internal processor,
37712 	 * the order of writes has to be such that this field is written last.
37713 	 */
37714 	uint8_t	valid;
37715 } hwrm_ring_free_output_t, *phwrm_ring_free_output_t;
37716 
37717 /*******************
37718  * hwrm_ring_reset *
37719  *******************/
37720 
37721 
37722 /* hwrm_ring_reset_input (size:192b/24B) */
37723 
37724 typedef struct hwrm_ring_reset_input {
37725 	/* The HWRM command request type. */
37726 	uint16_t	req_type;
37727 	/*
37728 	 * The completion ring to send the completion event on. This should
37729 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37730 	 */
37731 	uint16_t	cmpl_ring;
37732 	/*
37733 	 * The sequence ID is used by the driver for tracking multiple
37734 	 * commands. This ID is treated as opaque data by the firmware and
37735 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37736 	 */
37737 	uint16_t	seq_id;
37738 	/*
37739 	 * The target ID of the command:
37740 	 * * 0x0-0xFFF8 - The function ID
37741 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37742 	 * * 0xFFFD - Reserved for user-space HWRM interface
37743 	 * * 0xFFFF - HWRM
37744 	 */
37745 	uint16_t	target_id;
37746 	/*
37747 	 * A physical address pointer pointing to a host buffer that the
37748 	 * command's response data will be written. This can be either a host
37749 	 * physical address (HPA) or a guest physical address (GPA) and must
37750 	 * point to a physically contiguous block of memory.
37751 	 */
37752 	uint64_t	resp_addr;
37753 	/* Ring Type. */
37754 	uint8_t	ring_type;
37755 	/* L2 Completion Ring (CR) */
37756 	#define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL	UINT32_C(0x0)
37757 	/* TX Ring (TR) */
37758 	#define HWRM_RING_RESET_INPUT_RING_TYPE_TX	UINT32_C(0x1)
37759 	/* RX Ring (RR) */
37760 	#define HWRM_RING_RESET_INPUT_RING_TYPE_RX	UINT32_C(0x2)
37761 	/* RoCE Notification Completion Ring (ROCE_CR) */
37762 	#define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL   UINT32_C(0x3)
37763 	/*
37764 	 * Rx Ring Group.  This is to reset rx and aggregation in an atomic
37765 	 * operation. Completion ring associated with this ring group is
37766 	 * not reset.
37767 	 */
37768 	#define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
37769 	#define HWRM_RING_RESET_INPUT_RING_TYPE_LAST	HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
37770 	uint8_t	unused_0;
37771 	/*
37772 	 * Physical number of the ring. When ring type is rx_ring_grp, ring id
37773 	 * actually refers to ring group id.
37774 	 */
37775 	uint16_t	ring_id;
37776 	uint8_t	unused_1[4];
37777 } hwrm_ring_reset_input_t, *phwrm_ring_reset_input_t;
37778 
37779 /* hwrm_ring_reset_output (size:128b/16B) */
37780 
37781 typedef struct hwrm_ring_reset_output {
37782 	/* The specific error status for the command. */
37783 	uint16_t	error_code;
37784 	/* The HWRM command request type. */
37785 	uint16_t	req_type;
37786 	/* The sequence ID from the original command. */
37787 	uint16_t	seq_id;
37788 	/* The length of the response data in number of bytes. */
37789 	uint16_t	resp_len;
37790 	/*
37791 	 * This field will tell whether to use ping or pong buffer
37792 	 * for first push operation.
37793 	 */
37794 	uint8_t	push_buffer_index;
37795 	/* Start push from ping buffer index */
37796 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
37797 	/* Start push from pong buffer index */
37798 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
37799 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_LAST	HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
37800 	uint8_t	unused_0[3];
37801 	/* Position of consumer index after ring reset completes. */
37802 	uint8_t	consumer_idx[3];
37803 	/*
37804 	 * This field is used in Output records to indicate that the output
37805 	 * is completely written to RAM.  This field should be read as '1'
37806 	 * to indicate that the output has been completely written.
37807 	 * When writing a command completion or response to an internal processor,
37808 	 * the order of writes has to be such that this field is written last.
37809 	 */
37810 	uint8_t	valid;
37811 } hwrm_ring_reset_output_t, *phwrm_ring_reset_output_t;
37812 
37813 /*****************
37814  * hwrm_ring_cfg *
37815  *****************/
37816 
37817 
37818 /* hwrm_ring_cfg_input (size:320b/40B) */
37819 
37820 typedef struct hwrm_ring_cfg_input {
37821 	/* The HWRM command request type. */
37822 	uint16_t	req_type;
37823 	/*
37824 	 * The completion ring to send the completion event on. This should
37825 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37826 	 */
37827 	uint16_t	cmpl_ring;
37828 	/*
37829 	 * The sequence ID is used by the driver for tracking multiple
37830 	 * commands. This ID is treated as opaque data by the firmware and
37831 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37832 	 */
37833 	uint16_t	seq_id;
37834 	/*
37835 	 * The target ID of the command:
37836 	 * * 0x0-0xFFF8 - The function ID
37837 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37838 	 * * 0xFFFD - Reserved for user-space HWRM interface
37839 	 * * 0xFFFF - HWRM
37840 	 */
37841 	uint16_t	target_id;
37842 	/*
37843 	 * A physical address pointer pointing to a host buffer that the
37844 	 * command's response data will be written. This can be either a host
37845 	 * physical address (HPA) or a guest physical address (GPA) and must
37846 	 * point to a physically contiguous block of memory.
37847 	 */
37848 	uint64_t	resp_addr;
37849 	/* Ring Type. */
37850 	uint8_t	ring_type;
37851 	/* TX Ring (TR) */
37852 	#define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
37853 	/* RX Ring (RR) */
37854 	#define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
37855 	#define HWRM_RING_CFG_INPUT_RING_TYPE_LAST HWRM_RING_CFG_INPUT_RING_TYPE_RX
37856 	uint8_t	unused_0;
37857 	/* Physical number of the ring. */
37858 	uint16_t	ring_id;
37859 	/* Ring config enable bits. */
37860 	uint16_t	enables;
37861 	/*
37862 	 * For Rx rings, the incoming packet data can be placed at either
37863 	 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
37864 	 * buffer.
37865 	 * When '1', the received packet will be padded with 2B, 10B or 12B
37866 	 * of zeros at the front of the packet. The exact offset is specified
37867 	 * by rx_sop_pad_bytes parameter.
37868 	 * When '0', the received packet will not be padded.
37869 	 * Note that this flag is only used for Rx rings and is ignored
37870 	 * for all other rings included Rx Aggregation rings.
37871 	 */
37872 	#define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE		UINT32_C(0x1)
37873 	/*
37874 	 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
37875 	 * When rings are allocated, the PCI function on which driver issues
37876 	 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
37877 	 * the buffer descriptors (BDs) from those rings is assumed to issue
37878 	 * packet payload DMA using same PCI function. When proxy mode is
37879 	 * enabled, hardware can perform payload DMA using another PCI
37880 	 * function on same or different host.
37881 	 * When set to '0', the PCI function on which driver issues
37882 	 * HWRM_RING_CFG command is used for host payload DMA operation.
37883 	 * When set to '1', the host PCI function specified by proxy_fid is
37884 	 * used for host payload DMA operation.
37885 	 */
37886 	#define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE		UINT32_C(0x2)
37887 	/*
37888 	 * Tx ring packet source interface override, for Tx rings only.
37889 	 * When TX rings are allocated, the PCI function on which driver
37890 	 * issues HWRM_RING_CFG is assumed to be source interface of
37891 	 * packets sent from TX ring.
37892 	 * When set to '1', the host PCI function specified by proxy_fid
37893 	 * is used as source interface of the transmitted packets.
37894 	 */
37895 	#define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE	UINT32_C(0x4)
37896 	/* The schq_id field is valid */
37897 	#define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID			UINT32_C(0x8)
37898 	/* Update completion ring ID associated with Tx or Rx ring. */
37899 	#define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE		UINT32_C(0x10)
37900 	/*
37901 	 * When set to '1', metadata value provided by tx_metadata
37902 	 * field in this command is inserted in the lb_header_metadata
37903 	 * QP context field. When set to '0', no change done to metadata.
37904 	 * Firmware rejects the tx ring metadata programming with
37905 	 * HWRM_ERR_CODE_UNSUPPORTED error if the per function CFA BD
37906 	 * metadata feature is not disabled.
37907 	 */
37908 	#define HWRM_RING_CFG_INPUT_ENABLES_TX_METADATA			UINT32_C(0x20)
37909 	/*
37910 	 * Proxy function FID value.
37911 	 * This value is only used when either proxy_mode_enable flag or
37912 	 * tx_proxy_svif_override is set to '1'.
37913 	 * When proxy_mode_enable is set to '1', it identifies a host PCI
37914 	 * function used for host payload DMA operations.
37915 	 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
37916 	 * function as source interface for all transmitted packets from
37917 	 * the TX ring.
37918 	 */
37919 	uint16_t	proxy_fid;
37920 	/*
37921 	 * Identifies the new scheduler queue (SCHQ) to associate with the
37922 	 * ring. Only valid for Tx rings.
37923 	 * A value of zero indicates that the Tx ring should be associated
37924 	 * with the default scheduler queue (SCHQ).
37925 	 */
37926 	uint16_t	schq_id;
37927 	/*
37928 	 * This field is valid for TX or Rx rings. This value identifies the
37929 	 * new completion ring ID to associate with the TX or Rx ring.
37930 	 */
37931 	uint16_t	cmpl_ring_id;
37932 	/*
37933 	 * Rx SOP padding amount in bytes.
37934 	 * This value is only used when rx_sop_pad_enable flag is set to '1'.
37935 	 */
37936 	uint8_t	rx_sop_pad_bytes;
37937 	uint8_t	unused_1[3];
37938 	/*
37939 	 * When tx_metadata enable bit is set, value specified in this field
37940 	 * is copied to lb_header_metadata in the QP context.
37941 	 */
37942 	uint32_t	tx_metadata;
37943 	uint8_t	unused_2[4];
37944 } hwrm_ring_cfg_input_t, *phwrm_ring_cfg_input_t;
37945 
37946 /* hwrm_ring_cfg_output (size:128b/16B) */
37947 
37948 typedef struct hwrm_ring_cfg_output {
37949 	/* The specific error status for the command. */
37950 	uint16_t	error_code;
37951 	/* The HWRM command request type. */
37952 	uint16_t	req_type;
37953 	/* The sequence ID from the original command. */
37954 	uint16_t	seq_id;
37955 	/* The length of the response data in number of bytes. */
37956 	uint16_t	resp_len;
37957 	uint8_t	unused_0[7];
37958 	/*
37959 	 * This field is used in Output records to indicate that the output
37960 	 * is completely written to RAM.  This field should be read as '1'
37961 	 * to indicate that the output has been completely written.
37962 	 * When writing a command completion or response to an internal
37963 	 * processor, the order of writes has to be such that this field is
37964 	 * written last.
37965 	 */
37966 	uint8_t	valid;
37967 } hwrm_ring_cfg_output_t, *phwrm_ring_cfg_output_t;
37968 
37969 /******************
37970  * hwrm_ring_qcfg *
37971  ******************/
37972 
37973 
37974 /* hwrm_ring_qcfg_input (size:192b/24B) */
37975 
37976 typedef struct hwrm_ring_qcfg_input {
37977 	/* The HWRM command request type. */
37978 	uint16_t	req_type;
37979 	/*
37980 	 * The completion ring to send the completion event on. This should
37981 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37982 	 */
37983 	uint16_t	cmpl_ring;
37984 	/*
37985 	 * The sequence ID is used by the driver for tracking multiple
37986 	 * commands. This ID is treated as opaque data by the firmware and
37987 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37988 	 */
37989 	uint16_t	seq_id;
37990 	/*
37991 	 * The target ID of the command:
37992 	 * * 0x0-0xFFF8 - The function ID
37993 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37994 	 * * 0xFFFD - Reserved for user-space HWRM interface
37995 	 * * 0xFFFF - HWRM
37996 	 */
37997 	uint16_t	target_id;
37998 	/*
37999 	 * A physical address pointer pointing to a host buffer that the
38000 	 * command's response data will be written. This can be either a host
38001 	 * physical address (HPA) or a guest physical address (GPA) and must
38002 	 * point to a physically contiguous block of memory.
38003 	 */
38004 	uint64_t	resp_addr;
38005 	/* Ring Type. */
38006 	uint8_t	ring_type;
38007 	/* TX Ring (TR) */
38008 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
38009 	/* RX Ring (RR) */
38010 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
38011 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST HWRM_RING_QCFG_INPUT_RING_TYPE_RX
38012 	uint8_t	unused_0[5];
38013 	/* Physical number of the ring. */
38014 	uint16_t	ring_id;
38015 } hwrm_ring_qcfg_input_t, *phwrm_ring_qcfg_input_t;
38016 
38017 /* hwrm_ring_qcfg_output (size:256b/32B) */
38018 
38019 typedef struct hwrm_ring_qcfg_output {
38020 	/* The specific error status for the command. */
38021 	uint16_t	error_code;
38022 	/* The HWRM command request type. */
38023 	uint16_t	req_type;
38024 	/* The sequence ID from the original command. */
38025 	uint16_t	seq_id;
38026 	/* The length of the response data in number of bytes. */
38027 	uint16_t	resp_len;
38028 	/* Ring config enable bits. */
38029 	uint16_t	enables;
38030 	/*
38031 	 * For Rx rings, the incoming packet data can be placed at either
38032 	 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
38033 	 * buffer.
38034 	 * When '1', the received packet will be padded with 2B, 10B or 12B
38035 	 * of zeros at the front of the packet. The exact offset is specified
38036 	 * by rx_sop_pad_bytes parameter.
38037 	 * When '0', the received packet will not be padded.
38038 	 * Note that this flag is only used for Rx rings and is ignored
38039 	 * for all other rings included Rx Aggregation rings.
38040 	 */
38041 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE		UINT32_C(0x1)
38042 	/*
38043 	 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
38044 	 * When rings are allocated, the PCI function on which driver issues
38045 	 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
38046 	 * the buffer descriptors (BDs) from those rings is assumed to issue
38047 	 * packet payload DMA using same PCI function. When proxy mode is
38048 	 * enabled, hardware can perform payload DMA using another PCI
38049 	 * function on same or different host.
38050 	 * When set to '0', the PCI function on which driver issues
38051 	 * HWRM_RING_CFG command is used for host payload DMA operation.
38052 	 * When set to '1', the host PCI function specified by proxy_fid is
38053 	 * used for host payload DMA operation.
38054 	 */
38055 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE		UINT32_C(0x2)
38056 	/*
38057 	 * Tx ring packet source interface override, for Tx rings only.
38058 	 * When TX rings are allocated, the PCI function on which driver
38059 	 * issues HWRM_RING_CFG is assumed to be source interface of
38060 	 * packets sent from TX ring.
38061 	 * When set to '1', the host PCI function specified by proxy_fid is
38062 	 * used as source interface of the transmitted packets.
38063 	 */
38064 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE	UINT32_C(0x4)
38065 	/*
38066 	 * Proxy function FID value.
38067 	 * This value is only used when either proxy_mode_enable flag or
38068 	 * tx_proxy_svif_override is set to '1'.
38069 	 * When proxy_mode_enable is set to '1', it identifies a host PCI
38070 	 * function used for host payload DMA operations.
38071 	 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
38072 	 * function as source interface for all transmitted packets from the TX
38073 	 * ring.
38074 	 */
38075 	uint16_t	proxy_fid;
38076 	/*
38077 	 * Identifies the new scheduler queue (SCHQ) to associate with the
38078 	 * ring. Only valid for Tx rings.
38079 	 * A value of zero indicates that the Tx ring should be associated with
38080 	 * the default scheduler queue (SCHQ).
38081 	 */
38082 	uint16_t	schq_id;
38083 	/*
38084 	 * This field is used when ring_type is a TX or Rx ring.
38085 	 * This value indicates what completion ring the TX or Rx ring
38086 	 * is associated with.
38087 	 */
38088 	uint16_t	cmpl_ring_id;
38089 	/*
38090 	 * Rx SOP padding amount in bytes.
38091 	 * This value is only used when rx_sop_pad_enable flag is set to '1'.
38092 	 */
38093 	uint8_t	rx_sop_pad_bytes;
38094 	uint8_t	unused_0[3];
38095 	/* lb_header_metadata in the QP context is copied to this field. */
38096 	uint32_t	tx_metadata;
38097 	uint8_t	unused_1[7];
38098 	/*
38099 	 * This field is used in Output records to indicate that the output
38100 	 * is completely written to RAM.  This field should be read as '1'
38101 	 * to indicate that the output has been completely written.
38102 	 * When writing a command completion or response to an internal
38103 	 * processor, the order of writes has to be such that this field is
38104 	 * written last.
38105 	 */
38106 	uint8_t	valid;
38107 } hwrm_ring_qcfg_output_t, *phwrm_ring_qcfg_output_t;
38108 
38109 /**************************
38110  * hwrm_ring_aggint_qcaps *
38111  **************************/
38112 
38113 
38114 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
38115 
38116 typedef struct hwrm_ring_aggint_qcaps_input {
38117 	/* The HWRM command request type. */
38118 	uint16_t	req_type;
38119 	/*
38120 	 * The completion ring to send the completion event on. This should
38121 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38122 	 */
38123 	uint16_t	cmpl_ring;
38124 	/*
38125 	 * The sequence ID is used by the driver for tracking multiple
38126 	 * commands. This ID is treated as opaque data by the firmware and
38127 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38128 	 */
38129 	uint16_t	seq_id;
38130 	/*
38131 	 * The target ID of the command:
38132 	 * * 0x0-0xFFF8 - The function ID
38133 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38134 	 * * 0xFFFD - Reserved for user-space HWRM interface
38135 	 * * 0xFFFF - HWRM
38136 	 */
38137 	uint16_t	target_id;
38138 	/*
38139 	 * A physical address pointer pointing to a host buffer that the
38140 	 * command's response data will be written. This can be either a host
38141 	 * physical address (HPA) or a guest physical address (GPA) and must
38142 	 * point to a physically contiguous block of memory.
38143 	 */
38144 	uint64_t	resp_addr;
38145 } hwrm_ring_aggint_qcaps_input_t, *phwrm_ring_aggint_qcaps_input_t;
38146 
38147 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
38148 
38149 typedef struct hwrm_ring_aggint_qcaps_output {
38150 	/* The specific error status for the command. */
38151 	uint16_t	error_code;
38152 	/* The HWRM command request type. */
38153 	uint16_t	req_type;
38154 	/* The sequence ID from the original command. */
38155 	uint16_t	seq_id;
38156 	/* The length of the response data in number of bytes. */
38157 	uint16_t	resp_len;
38158 	uint32_t	cmpl_params;
38159 	/*
38160 	 * When this bit is set to '1', int_lat_tmr_min can be configured
38161 	 * on completion rings.
38162 	 */
38163 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN		UINT32_C(0x1)
38164 	/*
38165 	 * When this bit is set to '1', int_lat_tmr_max can be configured
38166 	 * on completion rings.
38167 	 */
38168 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX		UINT32_C(0x2)
38169 	/*
38170 	 * When this bit is set to '1', timer_reset can be enabled
38171 	 * on completion rings.
38172 	 */
38173 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET			UINT32_C(0x4)
38174 	/*
38175 	 * When this bit is set to '1', ring_idle can be enabled
38176 	 * on completion rings.
38177 	 */
38178 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE			UINT32_C(0x8)
38179 	/*
38180 	 * When this bit is set to '1', num_cmpl_dma_aggr can be configured
38181 	 * on completion rings.
38182 	 */
38183 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR		UINT32_C(0x10)
38184 	/*
38185 	 * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
38186 	 * on completion rings.
38187 	 */
38188 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT	UINT32_C(0x20)
38189 	/*
38190 	 * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
38191 	 * on completion rings.
38192 	 */
38193 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR		UINT32_C(0x40)
38194 	/*
38195 	 * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
38196 	 * on completion rings.
38197 	 */
38198 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT	UINT32_C(0x80)
38199 	/*
38200 	 * When this bit is set to '1', num_cmpl_aggr_int can be configured
38201 	 * on completion rings.
38202 	 */
38203 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT		UINT32_C(0x100)
38204 	uint32_t	nq_params;
38205 	/*
38206 	 * When this bit is set to '1', int_lat_tmr_min can be configured
38207 	 * on notification queues.
38208 	 */
38209 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN	UINT32_C(0x1)
38210 	/* Minimum value for num_cmpl_dma_aggr */
38211 	uint16_t	num_cmpl_dma_aggr_min;
38212 	/* Maximum value for num_cmpl_dma_aggr */
38213 	uint16_t	num_cmpl_dma_aggr_max;
38214 	/* Minimum value for num_cmpl_dma_aggr_during_int */
38215 	uint16_t	num_cmpl_dma_aggr_during_int_min;
38216 	/* Maximum value for num_cmpl_dma_aggr_during_int */
38217 	uint16_t	num_cmpl_dma_aggr_during_int_max;
38218 	/* Minimum value for cmpl_aggr_dma_tmr */
38219 	uint16_t	cmpl_aggr_dma_tmr_min;
38220 	/* Maximum value for cmpl_aggr_dma_tmr */
38221 	uint16_t	cmpl_aggr_dma_tmr_max;
38222 	/* Minimum value for cmpl_aggr_dma_tmr_during_int */
38223 	uint16_t	cmpl_aggr_dma_tmr_during_int_min;
38224 	/* Maximum value for cmpl_aggr_dma_tmr_during_int */
38225 	uint16_t	cmpl_aggr_dma_tmr_during_int_max;
38226 	/* Minimum value for int_lat_tmr_min */
38227 	uint16_t	int_lat_tmr_min_min;
38228 	/* Maximum value for int_lat_tmr_min */
38229 	uint16_t	int_lat_tmr_min_max;
38230 	/* Minimum value for int_lat_tmr_max */
38231 	uint16_t	int_lat_tmr_max_min;
38232 	/* Maximum value for int_lat_tmr_max */
38233 	uint16_t	int_lat_tmr_max_max;
38234 	/* Minimum value for num_cmpl_aggr_int */
38235 	uint16_t	num_cmpl_aggr_int_min;
38236 	/* Maximum value for num_cmpl_aggr_int */
38237 	uint16_t	num_cmpl_aggr_int_max;
38238 	/* The units for timer parameters, in nanoseconds. */
38239 	uint16_t	timer_units;
38240 	uint8_t	unused_0[1];
38241 	/*
38242 	 * This field is used in Output records to indicate that the output
38243 	 * is completely written to RAM.  This field should be read as '1'
38244 	 * to indicate that the output has been completely written.
38245 	 * When writing a command completion or response to an internal processor,
38246 	 * the order of writes has to be such that this field is written last.
38247 	 */
38248 	uint8_t	valid;
38249 } hwrm_ring_aggint_qcaps_output_t, *phwrm_ring_aggint_qcaps_output_t;
38250 
38251 /**************************************
38252  * hwrm_ring_cmpl_ring_qaggint_params *
38253  **************************************/
38254 
38255 
38256 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
38257 
38258 typedef struct hwrm_ring_cmpl_ring_qaggint_params_input {
38259 	/* The HWRM command request type. */
38260 	uint16_t	req_type;
38261 	/*
38262 	 * The completion ring to send the completion event on. This should
38263 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38264 	 */
38265 	uint16_t	cmpl_ring;
38266 	/*
38267 	 * The sequence ID is used by the driver for tracking multiple
38268 	 * commands. This ID is treated as opaque data by the firmware and
38269 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38270 	 */
38271 	uint16_t	seq_id;
38272 	/*
38273 	 * The target ID of the command:
38274 	 * * 0x0-0xFFF8 - The function ID
38275 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38276 	 * * 0xFFFD - Reserved for user-space HWRM interface
38277 	 * * 0xFFFF - HWRM
38278 	 */
38279 	uint16_t	target_id;
38280 	/*
38281 	 * A physical address pointer pointing to a host buffer that the
38282 	 * command's response data will be written. This can be either a host
38283 	 * physical address (HPA) or a guest physical address (GPA) and must
38284 	 * point to a physically contiguous block of memory.
38285 	 */
38286 	uint64_t	resp_addr;
38287 	/* Physical number of completion ring. */
38288 	uint16_t	ring_id;
38289 	uint16_t	flags;
38290 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK UINT32_C(0x3)
38291 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
38292 	/*
38293 	 * Set this flag to 1 when querying parameters on a notification
38294 	 * queue. Set this flag to 0 when querying parameters on a
38295 	 * completion queue or completion ring.
38296 	 */
38297 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ	UINT32_C(0x4)
38298 	uint8_t	unused_0[4];
38299 } hwrm_ring_cmpl_ring_qaggint_params_input_t, *phwrm_ring_cmpl_ring_qaggint_params_input_t;
38300 
38301 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
38302 
38303 typedef struct hwrm_ring_cmpl_ring_qaggint_params_output {
38304 	/* The specific error status for the command. */
38305 	uint16_t	error_code;
38306 	/* The HWRM command request type. */
38307 	uint16_t	req_type;
38308 	/* The sequence ID from the original command. */
38309 	uint16_t	seq_id;
38310 	/* The length of the response data in number of bytes. */
38311 	uint16_t	resp_len;
38312 	uint16_t	flags;
38313 	/*
38314 	 * When this bit is set to '1', interrupt max
38315 	 * timer is reset whenever a completion is received.
38316 	 */
38317 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET	UINT32_C(0x1)
38318 	/*
38319 	 * When this bit is set to '1', ring idle mode
38320 	 * aggregation will be enabled.
38321 	 */
38322 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE	UINT32_C(0x2)
38323 	/*
38324 	 * Number of completions to aggregate before DMA
38325 	 * during the normal mode.
38326 	 */
38327 	uint16_t	num_cmpl_dma_aggr;
38328 	/*
38329 	 * Number of completions to aggregate before DMA
38330 	 * during the interrupt mode.
38331 	 */
38332 	uint16_t	num_cmpl_dma_aggr_during_int;
38333 	/*
38334 	 * Timer used to aggregate completions before
38335 	 * DMA during the normal mode (not in interrupt mode).
38336 	 */
38337 	uint16_t	cmpl_aggr_dma_tmr;
38338 	/*
38339 	 * Timer used to aggregate completions before
38340 	 * DMA when in interrupt mode.
38341 	 */
38342 	uint16_t	cmpl_aggr_dma_tmr_during_int;
38343 	/* Minimum time between two interrupts. */
38344 	uint16_t	int_lat_tmr_min;
38345 	/*
38346 	 * Maximum wait time spent aggregating
38347 	 * completions before signaling the interrupt after the
38348 	 * interrupt is enabled.
38349 	 */
38350 	uint16_t	int_lat_tmr_max;
38351 	/*
38352 	 * Minimum number of completions aggregated before signaling
38353 	 * an interrupt.
38354 	 */
38355 	uint16_t	num_cmpl_aggr_int;
38356 	uint8_t	unused_0[7];
38357 	/*
38358 	 * This field is used in Output records to indicate that the output
38359 	 * is completely written to RAM.  This field should be read as '1'
38360 	 * to indicate that the output has been completely written.
38361 	 * When writing a command completion or response to an internal processor,
38362 	 * the order of writes has to be such that this field is written last.
38363 	 */
38364 	uint8_t	valid;
38365 } hwrm_ring_cmpl_ring_qaggint_params_output_t, *phwrm_ring_cmpl_ring_qaggint_params_output_t;
38366 
38367 /*****************************************
38368  * hwrm_ring_cmpl_ring_cfg_aggint_params *
38369  *****************************************/
38370 
38371 
38372 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
38373 
38374 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
38375 	/* The HWRM command request type. */
38376 	uint16_t	req_type;
38377 	/*
38378 	 * The completion ring to send the completion event on. This should
38379 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38380 	 */
38381 	uint16_t	cmpl_ring;
38382 	/*
38383 	 * The sequence ID is used by the driver for tracking multiple
38384 	 * commands. This ID is treated as opaque data by the firmware and
38385 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38386 	 */
38387 	uint16_t	seq_id;
38388 	/*
38389 	 * The target ID of the command:
38390 	 * * 0x0-0xFFF8 - The function ID
38391 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38392 	 * * 0xFFFD - Reserved for user-space HWRM interface
38393 	 * * 0xFFFF - HWRM
38394 	 */
38395 	uint16_t	target_id;
38396 	/*
38397 	 * A physical address pointer pointing to a host buffer that the
38398 	 * command's response data will be written. This can be either a host
38399 	 * physical address (HPA) or a guest physical address (GPA) and must
38400 	 * point to a physically contiguous block of memory.
38401 	 */
38402 	uint64_t	resp_addr;
38403 	/* Physical number of completion ring. */
38404 	uint16_t	ring_id;
38405 	uint16_t	flags;
38406 	/*
38407 	 * When this bit is set to '1', interrupt latency max
38408 	 * timer is reset whenever a completion is received.
38409 	 */
38410 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET	UINT32_C(0x1)
38411 	/*
38412 	 * When this bit is set to '1', ring idle mode
38413 	 * aggregation will be enabled.
38414 	 */
38415 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE	UINT32_C(0x2)
38416 	/*
38417 	 * Set this flag to 1 when configuring parameters on a
38418 	 * notification queue. Set this flag to 0 when configuring
38419 	 * parameters on a completion queue or completion ring.
38420 	 */
38421 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ	UINT32_C(0x4)
38422 	/*
38423 	 * Number of completions to aggregate before DMA
38424 	 * during the normal mode.
38425 	 */
38426 	uint16_t	num_cmpl_dma_aggr;
38427 	/*
38428 	 * Number of completions to aggregate before DMA
38429 	 * during the interrupt mode.
38430 	 */
38431 	uint16_t	num_cmpl_dma_aggr_during_int;
38432 	/*
38433 	 * Timer used to aggregate completions before
38434 	 * DMA during the normal mode (not in interrupt mode).
38435 	 */
38436 	uint16_t	cmpl_aggr_dma_tmr;
38437 	/*
38438 	 * Timer used to aggregate completions before
38439 	 * DMA while in interrupt mode.
38440 	 */
38441 	uint16_t	cmpl_aggr_dma_tmr_during_int;
38442 	/* Minimum time between two interrupts. */
38443 	uint16_t	int_lat_tmr_min;
38444 	/*
38445 	 * Maximum wait time spent aggregating
38446 	 * completions before signaling the interrupt after the
38447 	 * interrupt is enabled.
38448 	 */
38449 	uint16_t	int_lat_tmr_max;
38450 	/*
38451 	 * Minimum number of completions aggregated before signaling
38452 	 * an interrupt.
38453 	 */
38454 	uint16_t	num_cmpl_aggr_int;
38455 	/*
38456 	 * Bitfield that indicates which parameters are to be applied. Only
38457 	 * required when configuring devices with notification queues, and
38458 	 * used in that case to set certain parameters on completion queues
38459 	 * and others on notification queues.
38460 	 */
38461 	uint16_t	enables;
38462 	/*
38463 	 * This bit must be '1' for the num_cmpl_dma_aggr field to be
38464 	 * configured.
38465 	 */
38466 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR		UINT32_C(0x1)
38467 	/*
38468 	 * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
38469 	 * configured.
38470 	 */
38471 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT	UINT32_C(0x2)
38472 	/*
38473 	 * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
38474 	 * configured.
38475 	 */
38476 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR		UINT32_C(0x4)
38477 	/*
38478 	 * This bit must be '1' for the int_lat_tmr_min field to be
38479 	 * configured.
38480 	 */
38481 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN		UINT32_C(0x8)
38482 	/*
38483 	 * This bit must be '1' for the int_lat_tmr_max field to be
38484 	 * configured.
38485 	 */
38486 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX		UINT32_C(0x10)
38487 	/*
38488 	 * This bit must be '1' for the num_cmpl_aggr_int field to be
38489 	 * configured.
38490 	 */
38491 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT		UINT32_C(0x20)
38492 	uint8_t	unused_0[4];
38493 } hwrm_ring_cmpl_ring_cfg_aggint_params_input_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_input_t;
38494 
38495 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
38496 
38497 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
38498 	/* The specific error status for the command. */
38499 	uint16_t	error_code;
38500 	/* The HWRM command request type. */
38501 	uint16_t	req_type;
38502 	/* The sequence ID from the original command. */
38503 	uint16_t	seq_id;
38504 	/* The length of the response data in number of bytes. */
38505 	uint16_t	resp_len;
38506 	uint8_t	unused_0[7];
38507 	/*
38508 	 * This field is used in Output records to indicate that the output
38509 	 * is completely written to RAM.  This field should be read as '1'
38510 	 * to indicate that the output has been completely written.
38511 	 * When writing a command completion or response to an internal processor,
38512 	 * the order of writes has to be such that this field is written last.
38513 	 */
38514 	uint8_t	valid;
38515 } hwrm_ring_cmpl_ring_cfg_aggint_params_output_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_output_t;
38516 
38517 /***********************
38518  * hwrm_ring_grp_alloc *
38519  ***********************/
38520 
38521 
38522 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
38523 
38524 typedef struct hwrm_ring_grp_alloc_input {
38525 	/* The HWRM command request type. */
38526 	uint16_t	req_type;
38527 	/*
38528 	 * The completion ring to send the completion event on. This should
38529 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38530 	 */
38531 	uint16_t	cmpl_ring;
38532 	/*
38533 	 * The sequence ID is used by the driver for tracking multiple
38534 	 * commands. This ID is treated as opaque data by the firmware and
38535 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38536 	 */
38537 	uint16_t	seq_id;
38538 	/*
38539 	 * The target ID of the command:
38540 	 * * 0x0-0xFFF8 - The function ID
38541 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38542 	 * * 0xFFFD - Reserved for user-space HWRM interface
38543 	 * * 0xFFFF - HWRM
38544 	 */
38545 	uint16_t	target_id;
38546 	/*
38547 	 * A physical address pointer pointing to a host buffer that the
38548 	 * command's response data will be written. This can be either a host
38549 	 * physical address (HPA) or a guest physical address (GPA) and must
38550 	 * point to a physically contiguous block of memory.
38551 	 */
38552 	uint64_t	resp_addr;
38553 	/*
38554 	 * This value identifies the CR associated with the ring
38555 	 * group.
38556 	 */
38557 	uint16_t	cr;
38558 	/*
38559 	 * This value identifies the main RR associated with the ring
38560 	 * group.
38561 	 */
38562 	uint16_t	rr;
38563 	/*
38564 	 * This value identifies the aggregation RR associated with
38565 	 * the ring group.  If this value is 0xFF... (All Fs), then no
38566 	 * Aggregation ring will be set.
38567 	 */
38568 	uint16_t	ar;
38569 	/*
38570 	 * This value identifies the statistics context associated
38571 	 * with the ring group.
38572 	 */
38573 	uint16_t	sc;
38574 } hwrm_ring_grp_alloc_input_t, *phwrm_ring_grp_alloc_input_t;
38575 
38576 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
38577 
38578 typedef struct hwrm_ring_grp_alloc_output {
38579 	/* The specific error status for the command. */
38580 	uint16_t	error_code;
38581 	/* The HWRM command request type. */
38582 	uint16_t	req_type;
38583 	/* The sequence ID from the original command. */
38584 	uint16_t	seq_id;
38585 	/* The length of the response data in number of bytes. */
38586 	uint16_t	resp_len;
38587 	/*
38588 	 * This is the ring group ID value.  Use this value to program
38589 	 * the default ring group for the VNIC or as table entries
38590 	 * in an RSS/COS context.
38591 	 */
38592 	uint32_t	ring_group_id;
38593 	uint8_t	unused_0[3];
38594 	/*
38595 	 * This field is used in Output records to indicate that the output
38596 	 * is completely written to RAM.  This field should be read as '1'
38597 	 * to indicate that the output has been completely written.
38598 	 * When writing a command completion or response to an internal processor,
38599 	 * the order of writes has to be such that this field is written last.
38600 	 */
38601 	uint8_t	valid;
38602 } hwrm_ring_grp_alloc_output_t, *phwrm_ring_grp_alloc_output_t;
38603 
38604 /**********************
38605  * hwrm_ring_grp_free *
38606  **********************/
38607 
38608 
38609 /* hwrm_ring_grp_free_input (size:192b/24B) */
38610 
38611 typedef struct hwrm_ring_grp_free_input {
38612 	/* The HWRM command request type. */
38613 	uint16_t	req_type;
38614 	/*
38615 	 * The completion ring to send the completion event on. This should
38616 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38617 	 */
38618 	uint16_t	cmpl_ring;
38619 	/*
38620 	 * The sequence ID is used by the driver for tracking multiple
38621 	 * commands. This ID is treated as opaque data by the firmware and
38622 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38623 	 */
38624 	uint16_t	seq_id;
38625 	/*
38626 	 * The target ID of the command:
38627 	 * * 0x0-0xFFF8 - The function ID
38628 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38629 	 * * 0xFFFD - Reserved for user-space HWRM interface
38630 	 * * 0xFFFF - HWRM
38631 	 */
38632 	uint16_t	target_id;
38633 	/*
38634 	 * A physical address pointer pointing to a host buffer that the
38635 	 * command's response data will be written. This can be either a host
38636 	 * physical address (HPA) or a guest physical address (GPA) and must
38637 	 * point to a physically contiguous block of memory.
38638 	 */
38639 	uint64_t	resp_addr;
38640 	/* This is the ring group ID value. */
38641 	uint32_t	ring_group_id;
38642 	uint8_t	unused_0[4];
38643 } hwrm_ring_grp_free_input_t, *phwrm_ring_grp_free_input_t;
38644 
38645 /* hwrm_ring_grp_free_output (size:128b/16B) */
38646 
38647 typedef struct hwrm_ring_grp_free_output {
38648 	/* The specific error status for the command. */
38649 	uint16_t	error_code;
38650 	/* The HWRM command request type. */
38651 	uint16_t	req_type;
38652 	/* The sequence ID from the original command. */
38653 	uint16_t	seq_id;
38654 	/* The length of the response data in number of bytes. */
38655 	uint16_t	resp_len;
38656 	uint8_t	unused_0[7];
38657 	/*
38658 	 * This field is used in Output records to indicate that the output
38659 	 * is completely written to RAM.  This field should be read as '1'
38660 	 * to indicate that the output has been completely written.
38661 	 * When writing a command completion or response to an internal processor,
38662 	 * the order of writes has to be such that this field is written last.
38663 	 */
38664 	uint8_t	valid;
38665 } hwrm_ring_grp_free_output_t, *phwrm_ring_grp_free_output_t;
38666 
38667 /************************
38668  * hwrm_ring_schq_alloc *
38669  ************************/
38670 
38671 
38672 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
38673 
38674 typedef struct hwrm_ring_schq_alloc_input {
38675 	/* The HWRM command request type. */
38676 	uint16_t	req_type;
38677 	/*
38678 	 * The completion ring to send the completion event on. This should
38679 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38680 	 */
38681 	uint16_t	cmpl_ring;
38682 	/*
38683 	 * The sequence ID is used by the driver for tracking multiple
38684 	 * commands. This ID is treated as opaque data by the firmware and
38685 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38686 	 */
38687 	uint16_t	seq_id;
38688 	/*
38689 	 * The target ID of the command:
38690 	 * * 0x0-0xFFF8 - The function ID
38691 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38692 	 * * 0xFFFD - Reserved for user-space HWRM interface
38693 	 * * 0xFFFF - HWRM
38694 	 */
38695 	uint16_t	target_id;
38696 	/*
38697 	 * A physical address pointer pointing to a host buffer that the
38698 	 * command's response data will be written. This can be either a host
38699 	 * physical address (HPA) or a guest physical address (GPA) and must
38700 	 * point to a physically contiguous block of memory.
38701 	 */
38702 	uint64_t	resp_addr;
38703 	uint32_t	enables;
38704 	/*
38705 	 * This bit must be '1' for the tqm_ring0 fields to be
38706 	 * configured.
38707 	 */
38708 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0	UINT32_C(0x1)
38709 	/*
38710 	 * This bit must be '1' for the tqm_ring1 fields to be
38711 	 * configured.
38712 	 */
38713 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1	UINT32_C(0x2)
38714 	/*
38715 	 * This bit must be '1' for the tqm_ring2 fields to be
38716 	 * configured.
38717 	 */
38718 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2	UINT32_C(0x4)
38719 	/*
38720 	 * This bit must be '1' for the tqm_ring3 fields to be
38721 	 * configured.
38722 	 */
38723 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3	UINT32_C(0x8)
38724 	/*
38725 	 * This bit must be '1' for the tqm_ring4 fields to be
38726 	 * configured.
38727 	 */
38728 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4	UINT32_C(0x10)
38729 	/*
38730 	 * This bit must be '1' for the tqm_ring5 fields to be
38731 	 * configured.
38732 	 */
38733 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5	UINT32_C(0x20)
38734 	/*
38735 	 * This bit must be '1' for the tqm_ring6 fields to be
38736 	 * configured.
38737 	 */
38738 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6	UINT32_C(0x40)
38739 	/*
38740 	 * This bit must be '1' for the tqm_ring7 fields to be
38741 	 * configured.
38742 	 */
38743 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7	UINT32_C(0x80)
38744 	/* Reserved for future use. */
38745 	uint32_t	reserved;
38746 	/* TQM ring 0 page size and level. */
38747 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
38748 	/* TQM ring 0 PBL indirect levels. */
38749 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
38750 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT	0
38751 	/* PBL pointer is physical start address. */
38752 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
38753 	/* PBL pointer points to PTE table. */
38754 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
38755 	/*
38756 	 * PBL pointer points to PDE table with each entry pointing to PTE
38757 	 * tables.
38758 	 */
38759 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
38760 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
38761 	/* TQM ring 0 page size. */
38762 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
38763 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT   4
38764 	/* 4KB. */
38765 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38766 	/* 8KB. */
38767 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38768 	/* 64KB. */
38769 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38770 	/* 2MB. */
38771 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38772 	/* 8MB. */
38773 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38774 	/* 1GB. */
38775 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38776 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
38777 	/* TQM ring 1 page size and level. */
38778 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
38779 	/* TQM ring 1 PBL indirect levels. */
38780 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
38781 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT	0
38782 	/* PBL pointer is physical start address. */
38783 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
38784 	/* PBL pointer points to PTE table. */
38785 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
38786 	/*
38787 	 * PBL pointer points to PDE table with each entry pointing to PTE
38788 	 * tables.
38789 	 */
38790 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
38791 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
38792 	/* TQM ring 1 page size. */
38793 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
38794 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT   4
38795 	/* 4KB. */
38796 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38797 	/* 8KB. */
38798 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38799 	/* 64KB. */
38800 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38801 	/* 2MB. */
38802 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38803 	/* 8MB. */
38804 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38805 	/* 1GB. */
38806 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38807 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
38808 	/* TQM ring 2 page size and level. */
38809 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
38810 	/* TQM ring 2 PBL indirect levels. */
38811 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
38812 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT	0
38813 	/* PBL pointer is physical start address. */
38814 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
38815 	/* PBL pointer points to PTE table. */
38816 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
38817 	/*
38818 	 * PBL pointer points to PDE table with each entry pointing to PTE
38819 	 * tables.
38820 	 */
38821 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
38822 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
38823 	/* TQM ring 2 page size. */
38824 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
38825 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT   4
38826 	/* 4KB. */
38827 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38828 	/* 8KB. */
38829 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38830 	/* 64KB. */
38831 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38832 	/* 2MB. */
38833 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38834 	/* 8MB. */
38835 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38836 	/* 1GB. */
38837 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38838 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
38839 	/* TQM ring 3 page size and level. */
38840 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
38841 	/* TQM ring 3 PBL indirect levels. */
38842 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
38843 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT	0
38844 	/* PBL pointer is physical start address. */
38845 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
38846 	/* PBL pointer points to PTE table. */
38847 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
38848 	/*
38849 	 * PBL pointer points to PDE table with each entry pointing to PTE
38850 	 * tables.
38851 	 */
38852 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
38853 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
38854 	/* TQM ring 3 page size. */
38855 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
38856 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT   4
38857 	/* 4KB. */
38858 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38859 	/* 8KB. */
38860 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38861 	/* 64KB. */
38862 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38863 	/* 2MB. */
38864 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38865 	/* 8MB. */
38866 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38867 	/* 1GB. */
38868 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38869 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
38870 	/* TQM ring 4 page size and level. */
38871 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
38872 	/* TQM ring 4 PBL indirect levels. */
38873 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
38874 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT	0
38875 	/* PBL pointer is physical start address. */
38876 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
38877 	/* PBL pointer points to PTE table. */
38878 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
38879 	/*
38880 	 * PBL pointer points to PDE table with each entry pointing to PTE
38881 	 * tables.
38882 	 */
38883 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
38884 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
38885 	/* TQM ring 4 page size. */
38886 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
38887 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT   4
38888 	/* 4KB. */
38889 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38890 	/* 8KB. */
38891 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38892 	/* 64KB. */
38893 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38894 	/* 2MB. */
38895 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38896 	/* 8MB. */
38897 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38898 	/* 1GB. */
38899 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38900 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
38901 	/* TQM ring 5 page size and level. */
38902 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
38903 	/* TQM ring 5 PBL indirect levels. */
38904 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
38905 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT	0
38906 	/* PBL pointer is physical start address. */
38907 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
38908 	/* PBL pointer points to PTE table. */
38909 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
38910 	/*
38911 	 * PBL pointer points to PDE table with each entry pointing to PTE
38912 	 * tables.
38913 	 */
38914 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
38915 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
38916 	/* TQM ring 5 page size. */
38917 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
38918 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT   4
38919 	/* 4KB. */
38920 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38921 	/* 8KB. */
38922 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38923 	/* 64KB. */
38924 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38925 	/* 2MB. */
38926 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38927 	/* 8MB. */
38928 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38929 	/* 1GB. */
38930 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38931 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
38932 	/* TQM ring 6 page size and level. */
38933 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
38934 	/* TQM ring 6 PBL indirect levels. */
38935 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
38936 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT	0
38937 	/* PBL pointer is physical start address. */
38938 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
38939 	/* PBL pointer points to PTE table. */
38940 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
38941 	/*
38942 	 * PBL pointer points to PDE table with each entry pointing to PTE
38943 	 * tables.
38944 	 */
38945 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
38946 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
38947 	/* TQM ring 6 page size. */
38948 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
38949 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT   4
38950 	/* 4KB. */
38951 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38952 	/* 8KB. */
38953 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38954 	/* 64KB. */
38955 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38956 	/* 2MB. */
38957 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38958 	/* 8MB. */
38959 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38960 	/* 1GB. */
38961 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38962 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
38963 	/* TQM ring 7 page size and level. */
38964 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
38965 	/* TQM ring 7 PBL indirect levels. */
38966 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
38967 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT	0
38968 	/* PBL pointer is physical start address. */
38969 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
38970 	/* PBL pointer points to PTE table. */
38971 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
38972 	/*
38973 	 * PBL pointer points to PDE table with each entry pointing to PTE
38974 	 * tables.
38975 	 */
38976 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
38977 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
38978 	/* TQM ring 7 page size. */
38979 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
38980 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT   4
38981 	/* 4KB. */
38982 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
38983 	/* 8KB. */
38984 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
38985 	/* 64KB. */
38986 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
38987 	/* 2MB. */
38988 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
38989 	/* 8MB. */
38990 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
38991 	/* 1GB. */
38992 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
38993 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
38994 	/* TQM ring 0 page directory. */
38995 	uint64_t	tqm_ring0_page_dir;
38996 	/* TQM ring 1 page directory. */
38997 	uint64_t	tqm_ring1_page_dir;
38998 	/* TQM ring 2 page directory. */
38999 	uint64_t	tqm_ring2_page_dir;
39000 	/* TQM ring 3 page directory. */
39001 	uint64_t	tqm_ring3_page_dir;
39002 	/* TQM ring 4 page directory. */
39003 	uint64_t	tqm_ring4_page_dir;
39004 	/* TQM ring 5 page directory. */
39005 	uint64_t	tqm_ring5_page_dir;
39006 	/* TQM ring 6 page directory. */
39007 	uint64_t	tqm_ring6_page_dir;
39008 	/* TQM ring 7 page directory. */
39009 	uint64_t	tqm_ring7_page_dir;
39010 	/*
39011 	 * Number of TQM ring 0 entries.
39012 	 *
39013 	 * TQM fastpath rings should be sized large enough to accommodate the
39014 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39015 	 * that can be enqueued to the TQM ring.
39016 	 *
39017 	 * Note that TQM ring sizes cannot be extended while the system is
39018 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39019 	 * to delete the SCHQ and then reallocate it.
39020 	 */
39021 	uint32_t	tqm_ring0_num_entries;
39022 	/*
39023 	 * Number of TQM ring 1 entries.
39024 	 *
39025 	 * TQM fastpath rings should be sized large enough to accommodate the
39026 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39027 	 * that can be enqueued to the TQM ring.
39028 	 *
39029 	 * Note that TQM ring sizes cannot be extended while the system is
39030 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39031 	 * to delete the SCHQ and then reallocate it.
39032 	 */
39033 	uint32_t	tqm_ring1_num_entries;
39034 	/*
39035 	 * Number of TQM ring 2 entries.
39036 	 *
39037 	 * TQM fastpath rings should be sized large enough to accommodate the
39038 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39039 	 * that can be enqueued to the TQM ring.
39040 	 *
39041 	 * Note that TQM ring sizes cannot be extended while the system is
39042 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39043 	 * to delete the SCHQ and then reallocate it.
39044 	 */
39045 	uint32_t	tqm_ring2_num_entries;
39046 	/*
39047 	 * Number of TQM ring 3 entries.
39048 	 *
39049 	 * TQM fastpath rings should be sized large enough to accommodate the
39050 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39051 	 * that can be enqueued to the TQM ring.
39052 	 *
39053 	 * Note that TQM ring sizes cannot be extended while the system is
39054 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39055 	 * to delete the SCHQ and then reallocate it.
39056 	 */
39057 	uint32_t	tqm_ring3_num_entries;
39058 	/*
39059 	 * Number of TQM ring 4 entries.
39060 	 *
39061 	 * TQM fastpath rings should be sized large enough to accommodate the
39062 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39063 	 * that can be enqueued to the TQM ring.
39064 	 *
39065 	 * Note that TQM ring sizes cannot be extended while the system is
39066 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39067 	 * to delete the SCHQ and then reallocate it.
39068 	 */
39069 	uint32_t	tqm_ring4_num_entries;
39070 	/*
39071 	 * Number of TQM ring 5 entries.
39072 	 *
39073 	 * TQM fastpath rings should be sized large enough to accommodate the
39074 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39075 	 * that can be enqueued to the TQM ring.
39076 	 *
39077 	 * Note that TQM ring sizes cannot be extended while the system is
39078 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39079 	 * to delete the SCHQ and then reallocate it.
39080 	 */
39081 	uint32_t	tqm_ring5_num_entries;
39082 	/*
39083 	 * Number of TQM ring 6 entries.
39084 	 *
39085 	 * TQM fastpath rings should be sized large enough to accommodate the
39086 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39087 	 * that can be enqueued to the TQM ring.
39088 	 *
39089 	 * Note that TQM ring sizes cannot be extended while the system is
39090 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39091 	 * to delete the SCHQ and then reallocate it.
39092 	 */
39093 	uint32_t	tqm_ring6_num_entries;
39094 	/*
39095 	 * Number of TQM ring 7 entries.
39096 	 *
39097 	 * TQM fastpath rings should be sized large enough to accommodate the
39098 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
39099 	 * that can be enqueued to the TQM ring.
39100 	 *
39101 	 * Note that TQM ring sizes cannot be extended while the system is
39102 	 * operational. If a PF driver needs to extend a TQM ring, it needs
39103 	 * to delete the SCHQ and then reallocate it.
39104 	 */
39105 	uint32_t	tqm_ring7_num_entries;
39106 	/* Number of bytes that have been allocated for each context entry. */
39107 	uint16_t	tqm_entry_size;
39108 	uint8_t	unused_0[6];
39109 } hwrm_ring_schq_alloc_input_t, *phwrm_ring_schq_alloc_input_t;
39110 
39111 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
39112 
39113 typedef struct hwrm_ring_schq_alloc_output {
39114 	/* The specific error status for the command. */
39115 	uint16_t	error_code;
39116 	/* The HWRM command request type. */
39117 	uint16_t	req_type;
39118 	/* The sequence ID from the original command. */
39119 	uint16_t	seq_id;
39120 	/* The length of the response data in number of bytes. */
39121 	uint16_t	resp_len;
39122 	/*
39123 	 * This is an identifier for the SCHQ to be used in other HWRM commands
39124 	 * that need to reference this SCHQ. This value is greater than zero
39125 	 * (i.e. a schq_id of zero references the default SCHQ).
39126 	 */
39127 	uint16_t	schq_id;
39128 	uint8_t	unused_0[5];
39129 	/*
39130 	 * This field is used in Output records to indicate that the output
39131 	 * is completely written to RAM.  This field should be read as '1'
39132 	 * to indicate that the output has been completely written.
39133 	 * When writing a command completion or response to an internal processor,
39134 	 * the order of writes has to be such that this field is written last.
39135 	 */
39136 	uint8_t	valid;
39137 } hwrm_ring_schq_alloc_output_t, *phwrm_ring_schq_alloc_output_t;
39138 
39139 /**********************
39140  * hwrm_ring_schq_cfg *
39141  **********************/
39142 
39143 
39144 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
39145 
39146 typedef struct hwrm_ring_schq_cfg_input {
39147 	/* The HWRM command request type. */
39148 	uint16_t	req_type;
39149 	/*
39150 	 * The completion ring to send the completion event on. This should
39151 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39152 	 */
39153 	uint16_t	cmpl_ring;
39154 	/*
39155 	 * The sequence ID is used by the driver for tracking multiple
39156 	 * commands. This ID is treated as opaque data by the firmware and
39157 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39158 	 */
39159 	uint16_t	seq_id;
39160 	/*
39161 	 * The target ID of the command:
39162 	 * * 0x0-0xFFF8 - The function ID
39163 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39164 	 * * 0xFFFD - Reserved for user-space HWRM interface
39165 	 * * 0xFFFF - HWRM
39166 	 */
39167 	uint16_t	target_id;
39168 	/*
39169 	 * A physical address pointer pointing to a host buffer that the
39170 	 * command's response data will be written. This can be either a host
39171 	 * physical address (HPA) or a guest physical address (GPA) and must
39172 	 * point to a physically contiguous block of memory.
39173 	 */
39174 	uint64_t	resp_addr;
39175 	/*
39176 	 * Identifies the SCHQ being configured. A schq_id of zero refers to
39177 	 * the default SCHQ.
39178 	 */
39179 	uint16_t	schq_id;
39180 	/*
39181 	 * This field is an 8 bit bitmap that indicates which TCs are enabled
39182 	 * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
39183 	 * traffic class 7.
39184 	 */
39185 	uint8_t	tc_enabled;
39186 	uint8_t	unused_0;
39187 	uint32_t	flags;
39188 	/* The tc_max_bw array and the max_bw parameters are valid */
39189 	#define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED	UINT32_C(0x1)
39190 	/* The tc_min_bw array is valid */
39191 	#define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MIN_BW_ENABLED	UINT32_C(0x2)
39192 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39193 	uint32_t	max_bw_tc0;
39194 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39195 	uint32_t	max_bw_tc1;
39196 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39197 	uint32_t	max_bw_tc2;
39198 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39199 	uint32_t	max_bw_tc3;
39200 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39201 	uint32_t	max_bw_tc4;
39202 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39203 	uint32_t	max_bw_tc5;
39204 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39205 	uint32_t	max_bw_tc6;
39206 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
39207 	uint32_t	max_bw_tc7;
39208 	/*
39209 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39210 	 * A value of zero signifies that traffic belonging to this class
39211 	 * shares the bandwidth reservation for the same traffic class of
39212 	 * the default SCHQ.
39213 	 */
39214 	uint32_t	min_bw_tc0;
39215 	/*
39216 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39217 	 * A value of zero signifies that traffic belonging to this class
39218 	 * shares the bandwidth reservation for the same traffic class of
39219 	 * the default SCHQ.
39220 	 */
39221 	uint32_t	min_bw_tc1;
39222 	/*
39223 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39224 	 * A value of zero signifies that traffic belonging to this class
39225 	 * shares the bandwidth reservation for the same traffic class of
39226 	 * the default SCHQ.
39227 	 */
39228 	uint32_t	min_bw_tc2;
39229 	/*
39230 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39231 	 * A value of zero signifies that traffic belonging to this class
39232 	 * shares the bandwidth reservation for the same traffic class of
39233 	 * the default SCHQ.
39234 	 */
39235 	uint32_t	min_bw_tc3;
39236 	/*
39237 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39238 	 * A value of zero signifies that traffic belonging to this class
39239 	 * shares the bandwidth reservation for the same traffic class of
39240 	 * the default SCHQ.
39241 	 */
39242 	uint32_t	min_bw_tc4;
39243 	/*
39244 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39245 	 * A value of zero signifies that traffic belonging to this class
39246 	 * shares the bandwidth reservation for the same traffic class of
39247 	 * the default SCHQ.
39248 	 */
39249 	uint32_t	min_bw_tc5;
39250 	/*
39251 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39252 	 * A value of zero signifies that traffic belonging to this class
39253 	 * shares the bandwidth reservation for the same traffic class of
39254 	 * the default SCHQ.
39255 	 */
39256 	uint32_t	min_bw_tc6;
39257 	/*
39258 	 * Bandwidth reservation for the traffic class, specified in Mbps.
39259 	 * A value of zero signifies that traffic belonging to this class
39260 	 * shares the bandwidth reservation for the same traffic class of
39261 	 * the default SCHQ.
39262 	 */
39263 	uint32_t	min_bw_tc7;
39264 	/*
39265 	 * Indicates the max bandwidth for all enabled traffic classes in
39266 	 * this SCHQ, specified in Mbps.
39267 	 */
39268 	uint32_t	max_bw;
39269 	uint8_t	unused_1[4];
39270 } hwrm_ring_schq_cfg_input_t, *phwrm_ring_schq_cfg_input_t;
39271 
39272 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
39273 
39274 typedef struct hwrm_ring_schq_cfg_output {
39275 	/* The specific error status for the command. */
39276 	uint16_t	error_code;
39277 	/* The HWRM command request type. */
39278 	uint16_t	req_type;
39279 	/* The sequence ID from the original command. */
39280 	uint16_t	seq_id;
39281 	/* The length of the response data in number of bytes. */
39282 	uint16_t	resp_len;
39283 	uint8_t	unused_0[7];
39284 	/*
39285 	 * This field is used in Output records to indicate that the output
39286 	 * is completely written to RAM.  This field should be read as '1'
39287 	 * to indicate that the output has been completely written.
39288 	 * When writing a command completion or response to an internal processor,
39289 	 * the order of writes has to be such that this field is written last.
39290 	 */
39291 	uint8_t	valid;
39292 } hwrm_ring_schq_cfg_output_t, *phwrm_ring_schq_cfg_output_t;
39293 
39294 /***********************
39295  * hwrm_ring_schq_free *
39296  ***********************/
39297 
39298 
39299 /* hwrm_ring_schq_free_input (size:192b/24B) */
39300 
39301 typedef struct hwrm_ring_schq_free_input {
39302 	/* The HWRM command request type. */
39303 	uint16_t	req_type;
39304 	/*
39305 	 * The completion ring to send the completion event on. This should
39306 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39307 	 */
39308 	uint16_t	cmpl_ring;
39309 	/*
39310 	 * The sequence ID is used by the driver for tracking multiple
39311 	 * commands. This ID is treated as opaque data by the firmware and
39312 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39313 	 */
39314 	uint16_t	seq_id;
39315 	/*
39316 	 * The target ID of the command:
39317 	 * * 0x0-0xFFF8 - The function ID
39318 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39319 	 * * 0xFFFD - Reserved for user-space HWRM interface
39320 	 * * 0xFFFF - HWRM
39321 	 */
39322 	uint16_t	target_id;
39323 	/*
39324 	 * A physical address pointer pointing to a host buffer that the
39325 	 * command's response data will be written. This can be either a host
39326 	 * physical address (HPA) or a guest physical address (GPA) and must
39327 	 * point to a physically contiguous block of memory.
39328 	 */
39329 	uint64_t	resp_addr;
39330 	/* Identifies the SCHQ being freed. */
39331 	uint16_t	schq_id;
39332 	uint8_t	unused_0[6];
39333 } hwrm_ring_schq_free_input_t, *phwrm_ring_schq_free_input_t;
39334 
39335 /* hwrm_ring_schq_free_output (size:128b/16B) */
39336 
39337 typedef struct hwrm_ring_schq_free_output {
39338 	/* The specific error status for the command. */
39339 	uint16_t	error_code;
39340 	/* The HWRM command request type. */
39341 	uint16_t	req_type;
39342 	/* The sequence ID from the original command. */
39343 	uint16_t	seq_id;
39344 	/* The length of the response data in number of bytes. */
39345 	uint16_t	resp_len;
39346 	uint8_t	unused_0[7];
39347 	/*
39348 	 * This field is used in Output records to indicate that the output
39349 	 * is completely written to RAM.  This field should be read as '1'
39350 	 * to indicate that the output has been completely written.
39351 	 * When writing a command completion or response to an internal processor,
39352 	 * the order of writes has to be such that this field is written last.
39353 	 */
39354 	uint8_t	valid;
39355 } hwrm_ring_schq_free_output_t, *phwrm_ring_schq_free_output_t;
39356 
39357 /*
39358  * special reserved flow ID to identify per function default
39359  * flows for vSwitch offload
39360  */
39361 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
39362 /*
39363  * special reserved flow ID to identify per function RoCEv1
39364  * flows
39365  */
39366 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
39367 /*
39368  * special reserved flow ID to identify per function RoCEv2
39369  * flows
39370  */
39371 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
39372 /*
39373  * special reserved flow ID to identify per function RoCEv2
39374  * CNP flows
39375  */
39376 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
39377 
39378 /****************************
39379  * hwrm_cfa_l2_filter_alloc *
39380  ****************************/
39381 
39382 
39383 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
39384 
39385 typedef struct hwrm_cfa_l2_filter_alloc_input {
39386 	/* The HWRM command request type. */
39387 	uint16_t	req_type;
39388 	/*
39389 	 * The completion ring to send the completion event on. This should
39390 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39391 	 */
39392 	uint16_t	cmpl_ring;
39393 	/*
39394 	 * The sequence ID is used by the driver for tracking multiple
39395 	 * commands. This ID is treated as opaque data by the firmware and
39396 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39397 	 */
39398 	uint16_t	seq_id;
39399 	/*
39400 	 * The target ID of the command:
39401 	 * * 0x0-0xFFF8 - The function ID
39402 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39403 	 * * 0xFFFD - Reserved for user-space HWRM interface
39404 	 * * 0xFFFF - HWRM
39405 	 */
39406 	uint16_t	target_id;
39407 	/*
39408 	 * A physical address pointer pointing to a host buffer that the
39409 	 * command's response data will be written. This can be either a host
39410 	 * physical address (HPA) or a guest physical address (GPA) and must
39411 	 * point to a physically contiguous block of memory.
39412 	 */
39413 	uint64_t	resp_addr;
39414 	uint32_t	flags;
39415 	/*
39416 	 * Enumeration denoting the RX, TX type of the resource.
39417 	 * This enumeration is used for resources that are similar for both
39418 	 * TX and RX paths of the chip.
39419 	 */
39420 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH		UINT32_C(0x1)
39421 	/* tx path */
39422 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
39423 	/* rx path */
39424 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
39425 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
39426 	/*
39427 	 * Setting of this flag indicates the applicability to the loopback
39428 	 * path.
39429 	 */
39430 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x2)
39431 	/*
39432 	 * Setting of this flag indicates drop action. If this flag is not
39433 	 * set, then it should be considered accept action.
39434 	 */
39435 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP		UINT32_C(0x4)
39436 	/*
39437 	 * If this flag is set, all t_l2_* fields are invalid
39438 	 * and they should not be specified.
39439 	 * If this flag is set, then l2_* fields refer to
39440 	 * fields of outermost L2 header.
39441 	 */
39442 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST	UINT32_C(0x8)
39443 	/*
39444 	 * Enumeration denoting NO_ROCE_L2 to support old drivers.
39445 	 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
39446 	 */
39447 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK	UINT32_C(0x30)
39448 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT	4
39449 	/* To support old drivers */
39450 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2  (UINT32_C(0x0) << 4)
39451 	/* Only L2 traffic */
39452 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2	(UINT32_C(0x1) << 4)
39453 	/* Roce & L2 traffic */
39454 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE	(UINT32_C(0x2) << 4)
39455 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
39456 	/*
39457 	 * Setting of this flag indicates that no XDP filter is created with
39458 	 * L2 filter.
39459 	 * 0 - legacy behavior, XDP filter is created with L2 filter
39460 	 * 1 - XDP filter won't be created with L2 filter
39461 	 */
39462 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE	UINT32_C(0x40)
39463 	/*
39464 	 * Setting this flag to 1 indicate the L2 fields in this command
39465 	 * pertain to source fields. Setting this flag to 0 indicate the
39466 	 * L2 fields in this command pertain to the destination fields
39467 	 * and this is the default/legacy behavior.
39468 	 */
39469 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID	UINT32_C(0x80)
39470 	uint32_t	enables;
39471 	/*
39472 	 * This bit must be '1' for the l2_addr field to be
39473 	 * configured.
39474 	 */
39475 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR		UINT32_C(0x1)
39476 	/*
39477 	 * This bit must be '1' for the l2_addr_mask field to be
39478 	 * configured.
39479 	 */
39480 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK	UINT32_C(0x2)
39481 	/*
39482 	 * This bit must be '1' for the l2_ovlan field to be
39483 	 * configured.
39484 	 */
39485 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN		UINT32_C(0x4)
39486 	/*
39487 	 * This bit must be '1' for the l2_ovlan_mask field to be
39488 	 * configured.
39489 	 */
39490 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK	UINT32_C(0x8)
39491 	/*
39492 	 * This bit must be '1' for the l2_ivlan field to be
39493 	 * configured.
39494 	 */
39495 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN		UINT32_C(0x10)
39496 	/*
39497 	 * This bit must be '1' for the l2_ivlan_mask field to be
39498 	 * configured.
39499 	 */
39500 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK	UINT32_C(0x20)
39501 	/*
39502 	 * This bit must be '1' for the t_l2_addr field to be
39503 	 * configured.
39504 	 */
39505 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR	UINT32_C(0x40)
39506 	/*
39507 	 * This bit must be '1' for the t_l2_addr_mask field to be
39508 	 * configured.
39509 	 */
39510 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK	UINT32_C(0x80)
39511 	/*
39512 	 * This bit must be '1' for the t_l2_ovlan field to be
39513 	 * configured.
39514 	 */
39515 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN	UINT32_C(0x100)
39516 	/*
39517 	 * This bit must be '1' for the t_l2_ovlan_mask field to be
39518 	 * configured.
39519 	 */
39520 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK	UINT32_C(0x200)
39521 	/*
39522 	 * This bit must be '1' for the t_l2_ivlan field to be
39523 	 * configured.
39524 	 */
39525 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN	UINT32_C(0x400)
39526 	/*
39527 	 * This bit must be '1' for the t_l2_ivlan_mask field to be
39528 	 * configured.
39529 	 */
39530 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK	UINT32_C(0x800)
39531 	/*
39532 	 * This bit must be '1' for the src_type field to be
39533 	 * configured.
39534 	 */
39535 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE		UINT32_C(0x1000)
39536 	/*
39537 	 * This bit must be '1' for the src_id field to be
39538 	 * configured.
39539 	 */
39540 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID		UINT32_C(0x2000)
39541 	/*
39542 	 * This bit must be '1' for the tunnel_type field to be
39543 	 * configured.
39544 	 */
39545 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x4000)
39546 	/*
39547 	 * This bit must be '1' for the dst_id field to be
39548 	 * configured.
39549 	 */
39550 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x8000)
39551 	/*
39552 	 * This bit must be '1' for the mirror_vnic_id field to be
39553 	 * configured.
39554 	 */
39555 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x10000)
39556 	/*
39557 	 * This bit must be '1' for the num_vlans field to be
39558 	 * configured.
39559 	 */
39560 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS	UINT32_C(0x20000)
39561 	/*
39562 	 * This bit must be '1' for the t_num_vlans field to be
39563 	 * configured.
39564 	 */
39565 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS	UINT32_C(0x40000)
39566 	/*
39567 	 * This value sets the match value for the L2 MAC address.
39568 	 * Destination MAC address for RX path.
39569 	 * Source MAC address for TX path.
39570 	 */
39571 	uint8_t	l2_addr[6];
39572 	/* This value sets the match value for the number of VLANs. */
39573 	uint8_t	num_vlans;
39574 	/*
39575 	 * This value sets the match value for the number of VLANs
39576 	 * in the tunnel headers.
39577 	 */
39578 	uint8_t	t_num_vlans;
39579 	/*
39580 	 * This value sets the mask value for the L2 address.
39581 	 * A value of 0 will mask the corresponding bit from
39582 	 * compare.
39583 	 */
39584 	uint8_t	l2_addr_mask[6];
39585 	/* This value sets VLAN ID value for outer VLAN. */
39586 	uint16_t	l2_ovlan;
39587 	/*
39588 	 * This value sets the mask value for the ovlan id.
39589 	 * A value of 0 will mask the corresponding bit from
39590 	 * compare.
39591 	 */
39592 	uint16_t	l2_ovlan_mask;
39593 	/* This value sets VLAN ID value for inner VLAN. */
39594 	uint16_t	l2_ivlan;
39595 	/*
39596 	 * This value sets the mask value for the ivlan id.
39597 	 * A value of 0 will mask the corresponding bit from
39598 	 * compare.
39599 	 */
39600 	uint16_t	l2_ivlan_mask;
39601 	uint8_t	unused_1[2];
39602 	/*
39603 	 * This value sets the match value for the tunnel
39604 	 * L2 MAC address.
39605 	 * Destination MAC address for RX path.
39606 	 * Source MAC address for TX path.
39607 	 */
39608 	uint8_t	t_l2_addr[6];
39609 	uint8_t	unused_2[2];
39610 	/*
39611 	 * This value sets the mask value for the tunnel L2
39612 	 * address.
39613 	 * A value of 0 will mask the corresponding bit from
39614 	 * compare.
39615 	 */
39616 	uint8_t	t_l2_addr_mask[6];
39617 	/* This value sets VLAN ID value for tunnel outer VLAN. */
39618 	uint16_t	t_l2_ovlan;
39619 	/*
39620 	 * This value sets the mask value for the tunnel ovlan id.
39621 	 * A value of 0 will mask the corresponding bit from
39622 	 * compare.
39623 	 */
39624 	uint16_t	t_l2_ovlan_mask;
39625 	/* This value sets VLAN ID value for tunnel inner VLAN. */
39626 	uint16_t	t_l2_ivlan;
39627 	/*
39628 	 * This value sets the mask value for the tunnel ivlan id.
39629 	 * A value of 0 will mask the corresponding bit from
39630 	 * compare.
39631 	 */
39632 	uint16_t	t_l2_ivlan_mask;
39633 	/* This value identifies the type of source of the packet. */
39634 	uint8_t	src_type;
39635 	/* Network port */
39636 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
39637 	/* Physical function */
39638 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF	UINT32_C(0x1)
39639 	/* Virtual function */
39640 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF	UINT32_C(0x2)
39641 	/* Virtual NIC of a function */
39642 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
39643 	/* Embedded processor for CFA management */
39644 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
39645 	/* Embedded processor for OOB management */
39646 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
39647 	/* Embedded processor for RoCE */
39648 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
39649 	/* Embedded processor for network proxy functions */
39650 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
39651 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
39652 	uint8_t	unused_3;
39653 	/*
39654 	 * This value is the id of the source.
39655 	 * For a network port, it represents port_id.
39656 	 * For a physical function, it represents fid.
39657 	 * For a virtual function, it represents vf_id.
39658 	 * For a vnic, it represents vnic_id.
39659 	 * For embedded processors, this id is not valid.
39660 	 *
39661 	 * Notes:
39662 	 * 1. The function ID is implied if it src_id is
39663 	 *	not provided for a src_type that is either
39664 	 */
39665 	uint32_t	src_id;
39666 	/* Tunnel Type. */
39667 	uint8_t	tunnel_type;
39668 	/* Non-tunnel */
39669 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
39670 	/* Virtual eXtensible Local Area Network (VXLAN) */
39671 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
39672 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
39673 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
39674 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
39675 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
39676 	/* IP in IP */
39677 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
39678 	/* Generic Network Virtualization Encapsulation (Geneve) */
39679 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
39680 	/* Multi-Protocol Label Switching (MPLS) */
39681 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
39682 	/* Stateless Transport Tunnel (STT) */
39683 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
39684 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
39685 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
39686 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
39687 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
39688 	/*
39689 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
39690 	 * datagram payload
39691 	 */
39692 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
39693 	/* Use fixed layer 2 ether type of 0xFFFF */
39694 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
39695 	/*
39696 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
39697 	 * (IPV6oVXLANGPE)
39698 	 */
39699 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
39700 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
39701 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
39702 	/* Any tunneled traffic */
39703 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
39704 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
39705 	uint8_t	unused_4;
39706 	/*
39707 	 * If set, this value shall represent the
39708 	 * Logical VNIC ID of the destination VNIC for the RX
39709 	 * path and network port id of the destination port for
39710 	 * the TX path.
39711 	 */
39712 	uint16_t	dst_id;
39713 	/*
39714 	 * Logical VNIC ID of the VNIC where traffic is
39715 	 * mirrored.
39716 	 */
39717 	uint16_t	mirror_vnic_id;
39718 	/*
39719 	 * This hint is provided to help in placing
39720 	 * the filter in the filter table.
39721 	 */
39722 	uint8_t	pri_hint;
39723 	/* No preference */
39724 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER	UINT32_C(0x0)
39725 	/* Above the given filter */
39726 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER UINT32_C(0x1)
39727 	/* Below the given filter */
39728 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER UINT32_C(0x2)
39729 	/* As high as possible */
39730 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX	UINT32_C(0x3)
39731 	/* As low as possible */
39732 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN	UINT32_C(0x4)
39733 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
39734 	uint8_t	unused_5;
39735 	uint32_t	unused_6;
39736 	/*
39737 	 * This is the ID of the filter that goes along with
39738 	 * the pri_hint.
39739 	 *
39740 	 * This field is valid only for the following values.
39741 	 * 1 - Above the given filter
39742 	 * 2 - Below the given filter
39743 	 */
39744 	uint64_t	l2_filter_id_hint;
39745 } hwrm_cfa_l2_filter_alloc_input_t, *phwrm_cfa_l2_filter_alloc_input_t;
39746 
39747 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
39748 
39749 typedef struct hwrm_cfa_l2_filter_alloc_output {
39750 	/* The specific error status for the command. */
39751 	uint16_t	error_code;
39752 	/* The HWRM command request type. */
39753 	uint16_t	req_type;
39754 	/* The sequence ID from the original command. */
39755 	uint16_t	seq_id;
39756 	/* The length of the response data in number of bytes. */
39757 	uint16_t	resp_len;
39758 	/*
39759 	 * This value identifies a set of CFA data structures used for an L2
39760 	 * context.
39761 	 */
39762 	uint64_t	l2_filter_id;
39763 	/*
39764 	 * The flow id value in bit 0-29 is the actual ID of the flow
39765 	 * associated with this filter and it shall be used to match
39766 	 * and associate the flow identifier returned in completion
39767 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
39768 	 * shall indicate no valid flow id.
39769 	 */
39770 	uint32_t	flow_id;
39771 	/* Indicate the flow id value. */
39772 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
39773 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
39774 	/* Indicate type of the flow. */
39775 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
39776 	/*
39777 	 * If this bit set to 0, then it indicates that the flow is
39778 	 * internal flow.
39779 	 */
39780 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
39781 	/*
39782 	 * If this bit is set to 1, then it indicates that the flow is
39783 	 * external flow.
39784 	 */
39785 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
39786 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
39787 	/* Indicate the flow direction. */
39788 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
39789 	/* If this bit set to 0, then it indicates rx flow. */
39790 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
39791 	/* If this bit is set to 1, then it indicates that tx flow. */
39792 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
39793 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
39794 	uint8_t	unused_0[3];
39795 	/*
39796 	 * This field is used in Output records to indicate that the output
39797 	 * is completely written to RAM. This field should be read as '1'
39798 	 * to indicate that the output has been completely written.
39799 	 * When writing a command completion or response to an internal
39800 	 * processor, the order of writes has to be such that this field is
39801 	 * written last.
39802 	 */
39803 	uint8_t	valid;
39804 } hwrm_cfa_l2_filter_alloc_output_t, *phwrm_cfa_l2_filter_alloc_output_t;
39805 
39806 /***************************
39807  * hwrm_cfa_l2_filter_free *
39808  ***************************/
39809 
39810 
39811 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
39812 
39813 typedef struct hwrm_cfa_l2_filter_free_input {
39814 	/* The HWRM command request type. */
39815 	uint16_t	req_type;
39816 	/*
39817 	 * The completion ring to send the completion event on. This should
39818 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39819 	 */
39820 	uint16_t	cmpl_ring;
39821 	/*
39822 	 * The sequence ID is used by the driver for tracking multiple
39823 	 * commands. This ID is treated as opaque data by the firmware and
39824 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39825 	 */
39826 	uint16_t	seq_id;
39827 	/*
39828 	 * The target ID of the command:
39829 	 * * 0x0-0xFFF8 - The function ID
39830 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39831 	 * * 0xFFFD - Reserved for user-space HWRM interface
39832 	 * * 0xFFFF - HWRM
39833 	 */
39834 	uint16_t	target_id;
39835 	/*
39836 	 * A physical address pointer pointing to a host buffer that the
39837 	 * command's response data will be written. This can be either a host
39838 	 * physical address (HPA) or a guest physical address (GPA) and must
39839 	 * point to a physically contiguous block of memory.
39840 	 */
39841 	uint64_t	resp_addr;
39842 	/*
39843 	 * This value identifies a set of CFA data structures used for an L2
39844 	 * context.
39845 	 */
39846 	uint64_t	l2_filter_id;
39847 } hwrm_cfa_l2_filter_free_input_t, *phwrm_cfa_l2_filter_free_input_t;
39848 
39849 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
39850 
39851 typedef struct hwrm_cfa_l2_filter_free_output {
39852 	/* The specific error status for the command. */
39853 	uint16_t	error_code;
39854 	/* The HWRM command request type. */
39855 	uint16_t	req_type;
39856 	/* The sequence ID from the original command. */
39857 	uint16_t	seq_id;
39858 	/* The length of the response data in number of bytes. */
39859 	uint16_t	resp_len;
39860 	uint8_t	unused_0[7];
39861 	/*
39862 	 * This field is used in Output records to indicate that the output
39863 	 * is completely written to RAM. This field should be read as '1'
39864 	 * to indicate that the output has been completely written.
39865 	 * When writing a command completion or response to an internal
39866 	 * processor, the order of writes has to be such that this field is
39867 	 * written last.
39868 	 */
39869 	uint8_t	valid;
39870 } hwrm_cfa_l2_filter_free_output_t, *phwrm_cfa_l2_filter_free_output_t;
39871 
39872 /**************************
39873  * hwrm_cfa_l2_filter_cfg *
39874  **************************/
39875 
39876 
39877 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
39878 
39879 typedef struct hwrm_cfa_l2_filter_cfg_input {
39880 	/* The HWRM command request type. */
39881 	uint16_t	req_type;
39882 	/*
39883 	 * The completion ring to send the completion event on. This should
39884 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39885 	 */
39886 	uint16_t	cmpl_ring;
39887 	/*
39888 	 * The sequence ID is used by the driver for tracking multiple
39889 	 * commands. This ID is treated as opaque data by the firmware and
39890 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39891 	 */
39892 	uint16_t	seq_id;
39893 	/*
39894 	 * The target ID of the command:
39895 	 * * 0x0-0xFFF8 - The function ID
39896 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39897 	 * * 0xFFFD - Reserved for user-space HWRM interface
39898 	 * * 0xFFFF - HWRM
39899 	 */
39900 	uint16_t	target_id;
39901 	/*
39902 	 * A physical address pointer pointing to a host buffer that the
39903 	 * command's response data will be written. This can be either a host
39904 	 * physical address (HPA) or a guest physical address (GPA) and must
39905 	 * point to a physically contiguous block of memory.
39906 	 */
39907 	uint64_t	resp_addr;
39908 	uint32_t	flags;
39909 	/*
39910 	 * Enumeration denoting the RX, TX type of the resource.
39911 	 * This enumeration is used for resources that are similar for both
39912 	 * TX and RX paths of the chip.
39913 	 */
39914 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH		UINT32_C(0x1)
39915 	/* tx path */
39916 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
39917 	/* rx path */
39918 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
39919 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST	HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
39920 	/*
39921 	 * Setting of this flag indicates drop action. If this flag is not
39922 	 * set, then it should be considered accept action.
39923 	 */
39924 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP		UINT32_C(0x2)
39925 	/*
39926 	 * Enumeration denoting NO_ROCE_L2 to support old drivers.
39927 	 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
39928 	 */
39929 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK	UINT32_C(0xc)
39930 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT	2
39931 	/* To support old drivers */
39932 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2  (UINT32_C(0x0) << 2)
39933 	/* Only L2 traffic */
39934 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2	(UINT32_C(0x1) << 2)
39935 	/* Roce & L2 traffic */
39936 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE	(UINT32_C(0x2) << 2)
39937 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST	HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
39938 	uint32_t	enables;
39939 	/*
39940 	 * This bit must be '1' for the dst_id field to be
39941 	 * configured.
39942 	 */
39943 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID		UINT32_C(0x1)
39944 	/*
39945 	 * This bit must be '1' for the new_mirror_vnic_id field to be
39946 	 * configured.
39947 	 */
39948 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
39949 	/*
39950 	 * This value identifies a set of CFA data structures used for an L2
39951 	 * context.
39952 	 */
39953 	uint64_t	l2_filter_id;
39954 	/*
39955 	 * If set, this value shall represent the
39956 	 * Logical VNIC ID of the destination VNIC for the RX
39957 	 * path and network port id of the destination port for
39958 	 * the TX path.
39959 	 */
39960 	uint32_t	dst_id;
39961 	/*
39962 	 * New Logical VNIC ID of the VNIC where traffic is
39963 	 * mirrored.
39964 	 */
39965 	uint32_t	new_mirror_vnic_id;
39966 } hwrm_cfa_l2_filter_cfg_input_t, *phwrm_cfa_l2_filter_cfg_input_t;
39967 
39968 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
39969 
39970 typedef struct hwrm_cfa_l2_filter_cfg_output {
39971 	/* The specific error status for the command. */
39972 	uint16_t	error_code;
39973 	/* The HWRM command request type. */
39974 	uint16_t	req_type;
39975 	/* The sequence ID from the original command. */
39976 	uint16_t	seq_id;
39977 	/* The length of the response data in number of bytes. */
39978 	uint16_t	resp_len;
39979 	uint8_t	unused_0[7];
39980 	/*
39981 	 * This field is used in Output records to indicate that the output
39982 	 * is completely written to RAM. This field should be read as '1'
39983 	 * to indicate that the output has been completely written.
39984 	 * When writing a command completion or response to an internal
39985 	 * processor, the order of writes has to be such that this field is
39986 	 * written last.
39987 	 */
39988 	uint8_t	valid;
39989 } hwrm_cfa_l2_filter_cfg_output_t, *phwrm_cfa_l2_filter_cfg_output_t;
39990 
39991 /***************************
39992  * hwrm_cfa_l2_set_rx_mask *
39993  ***************************/
39994 
39995 
39996 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
39997 
39998 typedef struct hwrm_cfa_l2_set_rx_mask_input {
39999 	/* The HWRM command request type. */
40000 	uint16_t	req_type;
40001 	/*
40002 	 * The completion ring to send the completion event on. This should
40003 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40004 	 */
40005 	uint16_t	cmpl_ring;
40006 	/*
40007 	 * The sequence ID is used by the driver for tracking multiple
40008 	 * commands. This ID is treated as opaque data by the firmware and
40009 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40010 	 */
40011 	uint16_t	seq_id;
40012 	/*
40013 	 * The target ID of the command:
40014 	 * * 0x0-0xFFF8 - The function ID
40015 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40016 	 * * 0xFFFD - Reserved for user-space HWRM interface
40017 	 * * 0xFFFF - HWRM
40018 	 */
40019 	uint16_t	target_id;
40020 	/*
40021 	 * A physical address pointer pointing to a host buffer that the
40022 	 * command's response data will be written. This can be either a host
40023 	 * physical address (HPA) or a guest physical address (GPA) and must
40024 	 * point to a physically contiguous block of memory.
40025 	 */
40026 	uint64_t	resp_addr;
40027 	/* VNIC ID */
40028 	uint32_t	vnic_id;
40029 	uint32_t	mask;
40030 	/*
40031 	 * When this bit is '1', the function is requested to accept
40032 	 * multi-cast packets specified by the multicast addr table.
40033 	 */
40034 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST		UINT32_C(0x2)
40035 	/*
40036 	 * When this bit is '1', the function is requested to accept
40037 	 * all multi-cast packets.
40038 	 */
40039 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST	UINT32_C(0x4)
40040 	/*
40041 	 * When this bit is '1', the function is requested to accept
40042 	 * broadcast packets.
40043 	 */
40044 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST		UINT32_C(0x8)
40045 	/*
40046 	 * When this bit is '1', the function is requested to be
40047 	 * put in the promiscuous mode.
40048 	 *
40049 	 * The HWRM should accept any function to set up
40050 	 * promiscuous mode.
40051 	 *
40052 	 * The HWRM shall follow the semantics below for the
40053 	 * promiscuous mode support.
40054 	 * # When partitioning is not enabled on a port
40055 	 * (i.e. single PF on the port), then the PF shall
40056 	 * be allowed to be in the promiscuous mode. When the
40057 	 * PF is in the promiscuous mode, then it shall
40058 	 * receive all host bound traffic on that port.
40059 	 * # When partitioning is enabled on a port
40060 	 * (i.e. multiple PFs per port) and a PF on that
40061 	 * port is in the promiscuous mode, then the PF
40062 	 * receives all traffic within that partition as
40063 	 * identified by a unique identifier for the
40064 	 * PF (e.g. S-Tag). If a unique outer VLAN
40065 	 * for the PF is specified, then the setting of
40066 	 * promiscuous mode on that PF shall result in the
40067 	 * PF receiving all host bound traffic with matching
40068 	 * outer VLAN.
40069 	 * # A VF shall can be set in the promiscuous mode.
40070 	 * In the promiscuous mode, the VF does not receive any
40071 	 * traffic unless a unique outer VLAN for the
40072 	 * VF is specified. If a unique outer VLAN
40073 	 * for the VF is specified, then the setting of
40074 	 * promiscuous mode on that VF shall result in the
40075 	 * VF receiving all host bound traffic with the
40076 	 * matching outer VLAN.
40077 	 * # The HWRM shall allow the setting of promiscuous
40078 	 * mode on a function independently from the
40079 	 * promiscuous mode settings on other functions.
40080 	 */
40081 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS	UINT32_C(0x10)
40082 	/*
40083 	 * If this flag is set, the corresponding RX
40084 	 * filters shall be set up to cover multicast/broadcast
40085 	 * filters for the outermost Layer 2 destination MAC
40086 	 * address field.
40087 	 */
40088 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST	UINT32_C(0x20)
40089 	/*
40090 	 * If this flag is set, the corresponding RX
40091 	 * filters shall be set up to cover multicast/broadcast
40092 	 * filters for the VLAN-tagged packets that match the
40093 	 * TPID and VID fields of VLAN tags in the VLAN tag
40094 	 * table specified in this command.
40095 	 */
40096 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY		UINT32_C(0x40)
40097 	/*
40098 	 * If this flag is set, the corresponding RX
40099 	 * filters shall be set up to cover multicast/broadcast
40100 	 * filters for non-VLAN tagged packets and VLAN-tagged
40101 	 * packets that match the TPID and VID fields of VLAN
40102 	 * tags in the VLAN tag table specified in this command.
40103 	 */
40104 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN	UINT32_C(0x80)
40105 	/*
40106 	 * If this flag is set, the corresponding RX
40107 	 * filters shall be set up to cover multicast/broadcast
40108 	 * filters for non-VLAN tagged packets and VLAN-tagged
40109 	 * packets matching any VLAN tag.
40110 	 *
40111 	 * If this flag is set, then the HWRM shall ignore
40112 	 * VLAN tags specified in vlan_tag_tbl.
40113 	 *
40114 	 * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
40115 	 * flags is set, then the HWRM shall ignore
40116 	 * VLAN tags specified in vlan_tag_tbl.
40117 	 *
40118 	 * The HWRM client shall set at most one flag out of
40119 	 * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
40120 	 */
40121 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN	UINT32_C(0x100)
40122 	/* This is the address for mcast address tbl. */
40123 	uint64_t	mc_tbl_addr;
40124 	/*
40125 	 * This value indicates how many entries in mc_tbl are valid.
40126 	 * Each entry is 6 bytes.
40127 	 */
40128 	uint32_t	num_mc_entries;
40129 	uint8_t	unused_0[4];
40130 	/*
40131 	 * This is the address for VLAN tag table.
40132 	 * Each VLAN entry in the table is 4 bytes of a VLAN tag
40133 	 * including TPID, PCP, DEI, and VID fields in network byte
40134 	 * order.
40135 	 */
40136 	uint64_t	vlan_tag_tbl_addr;
40137 	/*
40138 	 * This value indicates how many entries in vlan_tag_tbl are
40139 	 * valid. Each entry is 4 bytes.
40140 	 */
40141 	uint32_t	num_vlan_tags;
40142 	uint8_t	unused_1[4];
40143 } hwrm_cfa_l2_set_rx_mask_input_t, *phwrm_cfa_l2_set_rx_mask_input_t;
40144 
40145 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
40146 
40147 typedef struct hwrm_cfa_l2_set_rx_mask_output {
40148 	/* The specific error status for the command. */
40149 	uint16_t	error_code;
40150 	/* The HWRM command request type. */
40151 	uint16_t	req_type;
40152 	/* The sequence ID from the original command. */
40153 	uint16_t	seq_id;
40154 	/* The length of the response data in number of bytes. */
40155 	uint16_t	resp_len;
40156 	uint8_t	unused_0[7];
40157 	/*
40158 	 * This field is used in Output records to indicate that the output
40159 	 * is completely written to RAM. This field should be read as '1'
40160 	 * to indicate that the output has been completely written.
40161 	 * When writing a command completion or response to an internal
40162 	 * processor, the order of writes has to be such that this field is
40163 	 * written last.
40164 	 */
40165 	uint8_t	valid;
40166 } hwrm_cfa_l2_set_rx_mask_output_t, *phwrm_cfa_l2_set_rx_mask_output_t;
40167 
40168 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
40169 
40170 typedef struct hwrm_cfa_l2_set_rx_mask_cmd_err {
40171 	/*
40172 	 * command specific error codes that goes to
40173 	 * the cmd_err field in Common HWRM Error Response.
40174 	 */
40175 	uint8_t	code;
40176 	/* Unknown error */
40177 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN			UINT32_C(0x0)
40178 	/* Unable to complete operation due to conflict with Ntuple Filter */
40179 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR UINT32_C(0x1)
40180 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST			HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
40181 	uint8_t	unused_0[7];
40182 } hwrm_cfa_l2_set_rx_mask_cmd_err_t, *phwrm_cfa_l2_set_rx_mask_cmd_err_t;
40183 
40184 /*******************************
40185  * hwrm_cfa_vlan_antispoof_cfg *
40186  *******************************/
40187 
40188 
40189 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
40190 
40191 typedef struct hwrm_cfa_vlan_antispoof_cfg_input {
40192 	/* The HWRM command request type. */
40193 	uint16_t	req_type;
40194 	/*
40195 	 * The completion ring to send the completion event on. This should
40196 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40197 	 */
40198 	uint16_t	cmpl_ring;
40199 	/*
40200 	 * The sequence ID is used by the driver for tracking multiple
40201 	 * commands. This ID is treated as opaque data by the firmware and
40202 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40203 	 */
40204 	uint16_t	seq_id;
40205 	/*
40206 	 * The target ID of the command:
40207 	 * * 0x0-0xFFF8 - The function ID
40208 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40209 	 * * 0xFFFD - Reserved for user-space HWRM interface
40210 	 * * 0xFFFF - HWRM
40211 	 */
40212 	uint16_t	target_id;
40213 	/*
40214 	 * A physical address pointer pointing to a host buffer that the
40215 	 * command's response data will be written. This can be either a host
40216 	 * physical address (HPA) or a guest physical address (GPA) and must
40217 	 * point to a physically contiguous block of memory.
40218 	 */
40219 	uint64_t	resp_addr;
40220 	/*
40221 	 * Function ID of the function that is being configured.
40222 	 * Only valid for a VF FID configured by the PF.
40223 	 */
40224 	uint16_t	fid;
40225 	uint8_t	unused_0[2];
40226 	/* Number of VLAN entries in the vlan_tag_mask_tbl. */
40227 	uint32_t	num_vlan_entries;
40228 	/*
40229 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
40230 	 * antispoof table. Each table entry contains the 16-bit TPID
40231 	 * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
40232 	 * all in network order to match hwrm_cfa_l2_set_rx_mask.
40233 	 * For an individual VLAN entry, the mask value should be 0xfff
40234 	 * for the 12-bit VLAN ID.
40235 	 */
40236 	uint64_t	vlan_tag_mask_tbl_addr;
40237 } hwrm_cfa_vlan_antispoof_cfg_input_t, *phwrm_cfa_vlan_antispoof_cfg_input_t;
40238 
40239 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
40240 
40241 typedef struct hwrm_cfa_vlan_antispoof_cfg_output {
40242 	/* The specific error status for the command. */
40243 	uint16_t	error_code;
40244 	/* The HWRM command request type. */
40245 	uint16_t	req_type;
40246 	/* The sequence ID from the original command. */
40247 	uint16_t	seq_id;
40248 	/* The length of the response data in number of bytes. */
40249 	uint16_t	resp_len;
40250 	uint8_t	unused_0[7];
40251 	/*
40252 	 * This field is used in Output records to indicate that the output
40253 	 * is completely written to RAM. This field should be read as '1'
40254 	 * to indicate that the output has been completely written.
40255 	 * When writing a command completion or response to an internal
40256 	 * processor, the order of writes has to be such that this field is
40257 	 * written last.
40258 	 */
40259 	uint8_t	valid;
40260 } hwrm_cfa_vlan_antispoof_cfg_output_t, *phwrm_cfa_vlan_antispoof_cfg_output_t;
40261 
40262 /********************************
40263  * hwrm_cfa_vlan_antispoof_qcfg *
40264  ********************************/
40265 
40266 
40267 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
40268 
40269 typedef struct hwrm_cfa_vlan_antispoof_qcfg_input {
40270 	/* The HWRM command request type. */
40271 	uint16_t	req_type;
40272 	/*
40273 	 * The completion ring to send the completion event on. This should
40274 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40275 	 */
40276 	uint16_t	cmpl_ring;
40277 	/*
40278 	 * The sequence ID is used by the driver for tracking multiple
40279 	 * commands. This ID is treated as opaque data by the firmware and
40280 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40281 	 */
40282 	uint16_t	seq_id;
40283 	/*
40284 	 * The target ID of the command:
40285 	 * * 0x0-0xFFF8 - The function ID
40286 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40287 	 * * 0xFFFD - Reserved for user-space HWRM interface
40288 	 * * 0xFFFF - HWRM
40289 	 */
40290 	uint16_t	target_id;
40291 	/*
40292 	 * A physical address pointer pointing to a host buffer that the
40293 	 * command's response data will be written. This can be either a host
40294 	 * physical address (HPA) or a guest physical address (GPA) and must
40295 	 * point to a physically contiguous block of memory.
40296 	 */
40297 	uint64_t	resp_addr;
40298 	/*
40299 	 * Function ID of the function that is being queried.
40300 	 * Only valid for a VF FID queried by the PF.
40301 	 */
40302 	uint16_t	fid;
40303 	uint8_t	unused_0[2];
40304 	/*
40305 	 * Maximum number of VLAN entries the firmware is allowed to DMA
40306 	 * to vlan_tag_mask_tbl.
40307 	 */
40308 	uint32_t	max_vlan_entries;
40309 	/*
40310 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
40311 	 * antispoof table to which firmware will DMA to. Each table
40312 	 * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
40313 	 * 16-bit VLAN ID, and a 16-bit mask, all in network order to
40314 	 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
40315 	 * the mask value should be 0xfff for the 12-bit VLAN ID.
40316 	 */
40317 	uint64_t	vlan_tag_mask_tbl_addr;
40318 } hwrm_cfa_vlan_antispoof_qcfg_input_t, *phwrm_cfa_vlan_antispoof_qcfg_input_t;
40319 
40320 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
40321 
40322 typedef struct hwrm_cfa_vlan_antispoof_qcfg_output {
40323 	/* The specific error status for the command. */
40324 	uint16_t	error_code;
40325 	/* The HWRM command request type. */
40326 	uint16_t	req_type;
40327 	/* The sequence ID from the original command. */
40328 	uint16_t	seq_id;
40329 	/* The length of the response data in number of bytes. */
40330 	uint16_t	resp_len;
40331 	/* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
40332 	uint32_t	num_vlan_entries;
40333 	uint8_t	unused_0[3];
40334 	/*
40335 	 * This field is used in Output records to indicate that the output
40336 	 * is completely written to RAM. This field should be read as '1'
40337 	 * to indicate that the output has been completely written.
40338 	 * When writing a command completion or response to an internal
40339 	 * processor, the order of writes has to be such that this field is
40340 	 * written last.
40341 	 */
40342 	uint8_t	valid;
40343 } hwrm_cfa_vlan_antispoof_qcfg_output_t, *phwrm_cfa_vlan_antispoof_qcfg_output_t;
40344 
40345 /********************************
40346  * hwrm_cfa_tunnel_filter_alloc *
40347  ********************************/
40348 
40349 
40350 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
40351 
40352 typedef struct hwrm_cfa_tunnel_filter_alloc_input {
40353 	/* The HWRM command request type. */
40354 	uint16_t	req_type;
40355 	/*
40356 	 * The completion ring to send the completion event on. This should
40357 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40358 	 */
40359 	uint16_t	cmpl_ring;
40360 	/*
40361 	 * The sequence ID is used by the driver for tracking multiple
40362 	 * commands. This ID is treated as opaque data by the firmware and
40363 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40364 	 */
40365 	uint16_t	seq_id;
40366 	/*
40367 	 * The target ID of the command:
40368 	 * * 0x0-0xFFF8 - The function ID
40369 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40370 	 * * 0xFFFD - Reserved for user-space HWRM interface
40371 	 * * 0xFFFF - HWRM
40372 	 */
40373 	uint16_t	target_id;
40374 	/*
40375 	 * A physical address pointer pointing to a host buffer that the
40376 	 * command's response data will be written. This can be either a host
40377 	 * physical address (HPA) or a guest physical address (GPA) and must
40378 	 * point to a physically contiguous block of memory.
40379 	 */
40380 	uint64_t	resp_addr;
40381 	uint32_t	flags;
40382 	/*
40383 	 * Setting of this flag indicates the applicability to the loopback
40384 	 * path.
40385 	 */
40386 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x1)
40387 	uint32_t	enables;
40388 	/*
40389 	 * This bit must be '1' for the l2_filter_id field to be
40390 	 * configured.
40391 	 */
40392 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
40393 	/*
40394 	 * This bit must be '1' for the l2_addr field to be
40395 	 * configured.
40396 	 */
40397 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR		UINT32_C(0x2)
40398 	/*
40399 	 * This bit must be '1' for the l2_ivlan field to be
40400 	 * configured.
40401 	 */
40402 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN	UINT32_C(0x4)
40403 	/*
40404 	 * This bit must be '1' for the l3_addr field to be
40405 	 * configured.
40406 	 */
40407 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR		UINT32_C(0x8)
40408 	/*
40409 	 * This bit must be '1' for the l3_addr_type field to be
40410 	 * configured.
40411 	 */
40412 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE	UINT32_C(0x10)
40413 	/*
40414 	 * This bit must be '1' for the t_l3_addr_type field to be
40415 	 * configured.
40416 	 */
40417 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE	UINT32_C(0x20)
40418 	/*
40419 	 * This bit must be '1' for the t_l3_addr field to be
40420 	 * configured.
40421 	 */
40422 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR	UINT32_C(0x40)
40423 	/*
40424 	 * This bit must be '1' for the tunnel_type field to be
40425 	 * configured.
40426 	 */
40427 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x80)
40428 	/*
40429 	 * This bit must be '1' for the vni field to be
40430 	 * configured.
40431 	 */
40432 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI		UINT32_C(0x100)
40433 	/*
40434 	 * This bit must be '1' for the dst_vnic_id field to be
40435 	 * configured.
40436 	 */
40437 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID	UINT32_C(0x200)
40438 	/*
40439 	 * This bit must be '1' for the mirror_vnic_id field to be
40440 	 * configured.
40441 	 */
40442 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x400)
40443 	/*
40444 	 * This value identifies a set of CFA data structures used for an L2
40445 	 * context.
40446 	 */
40447 	uint64_t	l2_filter_id;
40448 	/*
40449 	 * This value sets the match value for the inner L2
40450 	 * MAC address.
40451 	 * Destination MAC address for RX path.
40452 	 * Source MAC address for TX path.
40453 	 */
40454 	uint8_t	l2_addr[6];
40455 	/*
40456 	 * This value sets VLAN ID value for inner VLAN.
40457 	 * Only 12-bits of VLAN ID are used in setting the filter.
40458 	 */
40459 	uint16_t	l2_ivlan;
40460 	/*
40461 	 * The value of inner destination IP address to be used in filtering.
40462 	 * For IPv4, first four bytes represent the IP address.
40463 	 */
40464 	uint32_t	l3_addr[4];
40465 	/*
40466 	 * The value of tunnel destination IP address to be used in filtering.
40467 	 * For IPv4, first four bytes represent the IP address.
40468 	 */
40469 	uint32_t	t_l3_addr[4];
40470 	/*
40471 	 * This value indicates the type of inner IP address.
40472 	 * 4 - IPv4
40473 	 * 6 - IPv6
40474 	 * All others are invalid.
40475 	 */
40476 	uint8_t	l3_addr_type;
40477 	/*
40478 	 * This value indicates the type of tunnel IP address.
40479 	 * 4 - IPv4
40480 	 * 6 - IPv6
40481 	 * All others are invalid.
40482 	 */
40483 	uint8_t	t_l3_addr_type;
40484 	/* Tunnel Type. */
40485 	uint8_t	tunnel_type;
40486 	/* Non-tunnel */
40487 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
40488 	/* Virtual eXtensible Local Area Network (VXLAN) */
40489 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
40490 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40491 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
40492 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40493 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
40494 	/* IP in IP */
40495 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
40496 	/* Generic Network Virtualization Encapsulation (Geneve) */
40497 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
40498 	/* Multi-Protocol Label Switching (MPLS) */
40499 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
40500 	/* Stateless Transport Tunnel (STT) */
40501 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
40502 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40503 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
40504 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40505 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
40506 	/*
40507 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40508 	 * datagram payload
40509 	 */
40510 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
40511 	/* Use fixed layer 2 ether type of 0xFFFF */
40512 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
40513 	/*
40514 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
40515 	 * (IPV6oVXLANGPE)
40516 	 */
40517 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
40518 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
40519 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
40520 	/* Any tunneled traffic */
40521 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
40522 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
40523 	/*
40524 	 * tunnel_flags allows the user to indicate the tunnel tag detection
40525 	 * for the tunnel type specified in tunnel_type.
40526 	 */
40527 	uint8_t	tunnel_flags;
40528 	/*
40529 	 * If the tunnel_type is geneve, then this bit indicates if we
40530 	 * need to match the geneve OAM packet.
40531 	 * If the tunnel_type is nvgre or gre, then this bit indicates if
40532 	 * we need to detect checksum present bit in geneve header.
40533 	 * If the tunnel_type is mpls, then this bit indicates if we need
40534 	 * to match mpls packet with explicit IPV4/IPV6 null header.
40535 	 */
40536 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR	UINT32_C(0x1)
40537 	/*
40538 	 * If the tunnel_type is geneve, then this bit indicates if we
40539 	 * need to detect the critical option bit set in the oam packet.
40540 	 * If the tunnel_type is nvgre or gre, then this bit indicates
40541 	 * if we need to match nvgre packets with key present bit set in
40542 	 * gre header.
40543 	 * If the tunnel_type is mpls, then this bit indicates if we
40544 	 * need to match mpls packet with S bit from inner/second label.
40545 	 */
40546 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1	UINT32_C(0x2)
40547 	/*
40548 	 * If the tunnel_type is geneve, then this bit indicates if we
40549 	 * need to match geneve packet with extended header bit set in
40550 	 * geneve header.
40551 	 * If the tunnel_type is nvgre or gre, then this bit indicates
40552 	 * if we need to match nvgre packets with sequence number
40553 	 * present bit set in gre header.
40554 	 * If the tunnel_type is mpls, then this bit indicates if we
40555 	 * need to match mpls packet with S bit from out/first label.
40556 	 */
40557 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0	UINT32_C(0x4)
40558 	/*
40559 	 * Virtual Network Identifier (VNI). Only valid with
40560 	 * tunnel_types VXLAN, NVGRE, and Geneve.
40561 	 * Only lower 24-bits of VNI field are used
40562 	 * in setting up the filter.
40563 	 */
40564 	uint32_t	vni;
40565 	/* Logical VNIC ID of the destination VNIC. */
40566 	uint32_t	dst_vnic_id;
40567 	/*
40568 	 * Logical VNIC ID of the VNIC where traffic is
40569 	 * mirrored.
40570 	 */
40571 	uint32_t	mirror_vnic_id;
40572 } hwrm_cfa_tunnel_filter_alloc_input_t, *phwrm_cfa_tunnel_filter_alloc_input_t;
40573 
40574 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
40575 
40576 typedef struct hwrm_cfa_tunnel_filter_alloc_output {
40577 	/* The specific error status for the command. */
40578 	uint16_t	error_code;
40579 	/* The HWRM command request type. */
40580 	uint16_t	req_type;
40581 	/* The sequence ID from the original command. */
40582 	uint16_t	seq_id;
40583 	/* The length of the response data in number of bytes. */
40584 	uint16_t	resp_len;
40585 	/* This value is an opaque id into CFA data structures. */
40586 	uint64_t	tunnel_filter_id;
40587 	/*
40588 	 * The flow id value in bit 0-29 is the actual ID of the flow
40589 	 * associated with this filter and it shall be used to match
40590 	 * and associate the flow identifier returned in completion
40591 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
40592 	 * shall indicate no valid flow id.
40593 	 */
40594 	uint32_t	flow_id;
40595 	/* Indicate the flow id value. */
40596 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
40597 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
40598 	/* Indicate type of the flow. */
40599 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
40600 	/*
40601 	 * If this bit set to 0, then it indicates that the flow is
40602 	 * internal flow.
40603 	 */
40604 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
40605 	/*
40606 	 * If this bit is set to 1, then it indicates that the flow is
40607 	 * external flow.
40608 	 */
40609 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
40610 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
40611 	/* Indicate the flow direction. */
40612 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
40613 	/* If this bit set to 0, then it indicates rx flow. */
40614 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
40615 	/* If this bit is set to 1, then it indicates that tx flow. */
40616 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
40617 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
40618 	uint8_t	unused_0[3];
40619 	/*
40620 	 * This field is used in Output records to indicate that the output
40621 	 * is completely written to RAM. This field should be read as '1'
40622 	 * to indicate that the output has been completely written.
40623 	 * When writing a command completion or response to an internal
40624 	 * processor, the order of writes has to be such that this field is
40625 	 * written last.
40626 	 */
40627 	uint8_t	valid;
40628 } hwrm_cfa_tunnel_filter_alloc_output_t, *phwrm_cfa_tunnel_filter_alloc_output_t;
40629 
40630 /*******************************
40631  * hwrm_cfa_tunnel_filter_free *
40632  *******************************/
40633 
40634 
40635 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
40636 
40637 typedef struct hwrm_cfa_tunnel_filter_free_input {
40638 	/* The HWRM command request type. */
40639 	uint16_t	req_type;
40640 	/*
40641 	 * The completion ring to send the completion event on. This should
40642 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40643 	 */
40644 	uint16_t	cmpl_ring;
40645 	/*
40646 	 * The sequence ID is used by the driver for tracking multiple
40647 	 * commands. This ID is treated as opaque data by the firmware and
40648 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40649 	 */
40650 	uint16_t	seq_id;
40651 	/*
40652 	 * The target ID of the command:
40653 	 * * 0x0-0xFFF8 - The function ID
40654 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40655 	 * * 0xFFFD - Reserved for user-space HWRM interface
40656 	 * * 0xFFFF - HWRM
40657 	 */
40658 	uint16_t	target_id;
40659 	/*
40660 	 * A physical address pointer pointing to a host buffer that the
40661 	 * command's response data will be written. This can be either a host
40662 	 * physical address (HPA) or a guest physical address (GPA) and must
40663 	 * point to a physically contiguous block of memory.
40664 	 */
40665 	uint64_t	resp_addr;
40666 	/* This value is an opaque id into CFA data structures. */
40667 	uint64_t	tunnel_filter_id;
40668 } hwrm_cfa_tunnel_filter_free_input_t, *phwrm_cfa_tunnel_filter_free_input_t;
40669 
40670 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
40671 
40672 typedef struct hwrm_cfa_tunnel_filter_free_output {
40673 	/* The specific error status for the command. */
40674 	uint16_t	error_code;
40675 	/* The HWRM command request type. */
40676 	uint16_t	req_type;
40677 	/* The sequence ID from the original command. */
40678 	uint16_t	seq_id;
40679 	/* The length of the response data in number of bytes. */
40680 	uint16_t	resp_len;
40681 	uint8_t	unused_0[7];
40682 	/*
40683 	 * This field is used in Output records to indicate that the output
40684 	 * is completely written to RAM. This field should be read as '1'
40685 	 * to indicate that the output has been completely written.
40686 	 * When writing a command completion or response to an internal
40687 	 * processor, the order of writes has to be such that this field is
40688 	 * written last.
40689 	 */
40690 	uint8_t	valid;
40691 } hwrm_cfa_tunnel_filter_free_output_t, *phwrm_cfa_tunnel_filter_free_output_t;
40692 
40693 /***************************************
40694  * hwrm_cfa_redirect_tunnel_type_alloc *
40695  ***************************************/
40696 
40697 
40698 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
40699 
40700 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_input {
40701 	/* The HWRM command request type. */
40702 	uint16_t	req_type;
40703 	/*
40704 	 * The completion ring to send the completion event on. This should
40705 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40706 	 */
40707 	uint16_t	cmpl_ring;
40708 	/*
40709 	 * The sequence ID is used by the driver for tracking multiple
40710 	 * commands. This ID is treated as opaque data by the firmware and
40711 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40712 	 */
40713 	uint16_t	seq_id;
40714 	/*
40715 	 * The target ID of the command:
40716 	 * * 0x0-0xFFF8 - The function ID
40717 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40718 	 * * 0xFFFD - Reserved for user-space HWRM interface
40719 	 * * 0xFFFF - HWRM
40720 	 */
40721 	uint16_t	target_id;
40722 	/*
40723 	 * A physical address pointer pointing to a host buffer that the
40724 	 * command's response data will be written. This can be either a host
40725 	 * physical address (HPA) or a guest physical address (GPA) and must
40726 	 * point to a physically contiguous block of memory.
40727 	 */
40728 	uint64_t	resp_addr;
40729 	/* The destination function id, to whom the traffic is redirected. */
40730 	uint16_t	dest_fid;
40731 	/* Tunnel Type. */
40732 	uint8_t	tunnel_type;
40733 	/* Non-tunnel */
40734 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
40735 	/* Virtual eXtensible Local Area Network (VXLAN) */
40736 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
40737 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40738 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
40739 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40740 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
40741 	/* IP in IP */
40742 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
40743 	/* Generic Network Virtualization Encapsulation (Geneve) */
40744 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
40745 	/* Multi-Protocol Label Switching (MPLS) */
40746 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
40747 	/* Stateless Transport Tunnel (STT) */
40748 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
40749 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40750 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
40751 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40752 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
40753 	/*
40754 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40755 	 * datagram payload
40756 	 */
40757 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
40758 	/* Use fixed layer 2 ether type of 0xFFFF */
40759 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
40760 	/*
40761 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
40762 	 * (IPV6oVXLANGPE)
40763 	 */
40764 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
40765 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
40766 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
40767 	/* Any tunneled traffic */
40768 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
40769 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
40770 	/* Tunnel alloc flags. */
40771 	uint8_t	flags;
40772 	/*
40773 	 * Setting of this flag indicates modify existing redirect tunnel
40774 	 * to new destination function ID.
40775 	 */
40776 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST	UINT32_C(0x1)
40777 	uint8_t	unused_0[4];
40778 } hwrm_cfa_redirect_tunnel_type_alloc_input_t, *phwrm_cfa_redirect_tunnel_type_alloc_input_t;
40779 
40780 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
40781 
40782 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_output {
40783 	/* The specific error status for the command. */
40784 	uint16_t	error_code;
40785 	/* The HWRM command request type. */
40786 	uint16_t	req_type;
40787 	/* The sequence ID from the original command. */
40788 	uint16_t	seq_id;
40789 	/* The length of the response data in number of bytes. */
40790 	uint16_t	resp_len;
40791 	uint8_t	unused_0[7];
40792 	/*
40793 	 * This field is used in Output records to indicate that the output
40794 	 * is completely written to RAM. This field should be read as '1'
40795 	 * to indicate that the output has been completely written.
40796 	 * When writing a command completion or response to an internal
40797 	 * processor, the order of writes has to be such that this field is
40798 	 * written last.
40799 	 */
40800 	uint8_t	valid;
40801 } hwrm_cfa_redirect_tunnel_type_alloc_output_t, *phwrm_cfa_redirect_tunnel_type_alloc_output_t;
40802 
40803 /**************************************
40804  * hwrm_cfa_redirect_tunnel_type_free *
40805  **************************************/
40806 
40807 
40808 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
40809 
40810 typedef struct hwrm_cfa_redirect_tunnel_type_free_input {
40811 	/* The HWRM command request type. */
40812 	uint16_t	req_type;
40813 	/*
40814 	 * The completion ring to send the completion event on. This should
40815 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40816 	 */
40817 	uint16_t	cmpl_ring;
40818 	/*
40819 	 * The sequence ID is used by the driver for tracking multiple
40820 	 * commands. This ID is treated as opaque data by the firmware and
40821 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40822 	 */
40823 	uint16_t	seq_id;
40824 	/*
40825 	 * The target ID of the command:
40826 	 * * 0x0-0xFFF8 - The function ID
40827 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40828 	 * * 0xFFFD - Reserved for user-space HWRM interface
40829 	 * * 0xFFFF - HWRM
40830 	 */
40831 	uint16_t	target_id;
40832 	/*
40833 	 * A physical address pointer pointing to a host buffer that the
40834 	 * command's response data will be written. This can be either a host
40835 	 * physical address (HPA) or a guest physical address (GPA) and must
40836 	 * point to a physically contiguous block of memory.
40837 	 */
40838 	uint64_t	resp_addr;
40839 	/* The destination function id, to whom the traffic is redirected. */
40840 	uint16_t	dest_fid;
40841 	/* Tunnel Type. */
40842 	uint8_t	tunnel_type;
40843 	/* Non-tunnel */
40844 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
40845 	/* Virtual eXtensible Local Area Network (VXLAN) */
40846 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
40847 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40848 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
40849 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40850 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
40851 	/* IP in IP */
40852 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
40853 	/* Generic Network Virtualization Encapsulation (Geneve) */
40854 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
40855 	/* Multi-Protocol Label Switching (MPLS) */
40856 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
40857 	/* Stateless Transport Tunnel (STT) */
40858 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
40859 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40860 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
40861 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40862 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
40863 	/*
40864 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40865 	 * datagram payload
40866 	 */
40867 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
40868 	/* Use fixed layer 2 ether type of 0xFFFF */
40869 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
40870 	/*
40871 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
40872 	 * (IPV6oVXLANGPE)
40873 	 */
40874 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
40875 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
40876 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
40877 	/* Any tunneled traffic */
40878 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
40879 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
40880 	uint8_t	unused_0[5];
40881 } hwrm_cfa_redirect_tunnel_type_free_input_t, *phwrm_cfa_redirect_tunnel_type_free_input_t;
40882 
40883 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
40884 
40885 typedef struct hwrm_cfa_redirect_tunnel_type_free_output {
40886 	/* The specific error status for the command. */
40887 	uint16_t	error_code;
40888 	/* The HWRM command request type. */
40889 	uint16_t	req_type;
40890 	/* The sequence ID from the original command. */
40891 	uint16_t	seq_id;
40892 	/* The length of the response data in number of bytes. */
40893 	uint16_t	resp_len;
40894 	uint8_t	unused_0[7];
40895 	/*
40896 	 * This field is used in Output records to indicate that the output
40897 	 * is completely written to RAM. This field should be read as '1'
40898 	 * to indicate that the output has been completely written.
40899 	 * When writing a command completion or response to an internal
40900 	 * processor, the order of writes has to be such that this field is
40901 	 * written last.
40902 	 */
40903 	uint8_t	valid;
40904 } hwrm_cfa_redirect_tunnel_type_free_output_t, *phwrm_cfa_redirect_tunnel_type_free_output_t;
40905 
40906 /**************************************
40907  * hwrm_cfa_redirect_tunnel_type_info *
40908  **************************************/
40909 
40910 
40911 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
40912 
40913 typedef struct hwrm_cfa_redirect_tunnel_type_info_input {
40914 	/* The HWRM command request type. */
40915 	uint16_t	req_type;
40916 	/*
40917 	 * The completion ring to send the completion event on. This should
40918 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40919 	 */
40920 	uint16_t	cmpl_ring;
40921 	/*
40922 	 * The sequence ID is used by the driver for tracking multiple
40923 	 * commands. This ID is treated as opaque data by the firmware and
40924 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40925 	 */
40926 	uint16_t	seq_id;
40927 	/*
40928 	 * The target ID of the command:
40929 	 * * 0x0-0xFFF8 - The function ID
40930 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40931 	 * * 0xFFFD - Reserved for user-space HWRM interface
40932 	 * * 0xFFFF - HWRM
40933 	 */
40934 	uint16_t	target_id;
40935 	/*
40936 	 * A physical address pointer pointing to a host buffer that the
40937 	 * command's response data will be written. This can be either a host
40938 	 * physical address (HPA) or a guest physical address (GPA) and must
40939 	 * point to a physically contiguous block of memory.
40940 	 */
40941 	uint64_t	resp_addr;
40942 	/* The source function id. */
40943 	uint16_t	src_fid;
40944 	/* Tunnel Type. */
40945 	uint8_t	tunnel_type;
40946 	/* Non-tunnel */
40947 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
40948 	/* Virtual eXtensible Local Area Network (VXLAN) */
40949 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
40950 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40951 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
40952 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40953 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
40954 	/* IP in IP */
40955 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
40956 	/* Generic Network Virtualization Encapsulation (Geneve) */
40957 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
40958 	/* Multi-Protocol Label Switching (MPLS) */
40959 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
40960 	/* Stateless Transport Tunnel (STT) */
40961 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
40962 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40963 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
40964 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40965 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
40966 	/*
40967 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40968 	 * datagram payload
40969 	 */
40970 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
40971 	/* Use fixed layer 2 ether type of 0xFFFF */
40972 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
40973 	/*
40974 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
40975 	 * (IPV6oVXLANGPE)
40976 	 */
40977 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
40978 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
40979 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
40980 	/* Any tunneled traffic */
40981 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
40982 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
40983 	uint8_t	unused_0[5];
40984 } hwrm_cfa_redirect_tunnel_type_info_input_t, *phwrm_cfa_redirect_tunnel_type_info_input_t;
40985 
40986 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
40987 
40988 typedef struct hwrm_cfa_redirect_tunnel_type_info_output {
40989 	/* The specific error status for the command. */
40990 	uint16_t	error_code;
40991 	/* The HWRM command request type. */
40992 	uint16_t	req_type;
40993 	/* The sequence ID from the original command. */
40994 	uint16_t	seq_id;
40995 	/* The length of the response data in number of bytes. */
40996 	uint16_t	resp_len;
40997 	/* The destination function id, to whom the traffic is redirected. */
40998 	uint16_t	dest_fid;
40999 	uint8_t	unused_0[5];
41000 	/*
41001 	 * This field is used in Output records to indicate that the output
41002 	 * is completely written to RAM. This field should be read as '1'
41003 	 * to indicate that the output has been completely written.
41004 	 * When writing a command completion or response to an internal
41005 	 * processor, the order of writes has to be such that this field is
41006 	 * written last.
41007 	 */
41008 	uint8_t	valid;
41009 } hwrm_cfa_redirect_tunnel_type_info_output_t, *phwrm_cfa_redirect_tunnel_type_info_output_t;
41010 
41011 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
41012 
41013 typedef struct hwrm_vxlan_ipv4_hdr {
41014 	/* IPv4 version and header length. */
41015 	uint8_t	ver_hlen;
41016 	/* IPv4 header length */
41017 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
41018 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
41019 	/* Version */
41020 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK	UINT32_C(0xf0)
41021 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT	4
41022 	/* IPv4 type of service. */
41023 	uint8_t	tos;
41024 	/* IPv4 identification. */
41025 	uint16_t	ip_id;
41026 	/* IPv4 flags and offset. */
41027 	uint16_t	flags_frag_offset;
41028 	/* IPv4 TTL. */
41029 	uint8_t	ttl;
41030 	/* IPv4 protocol. */
41031 	uint8_t	protocol;
41032 	/* IPv4 source address. */
41033 	uint32_t	src_ip_addr;
41034 	/* IPv4 destination address. */
41035 	uint32_t	dest_ip_addr;
41036 } hwrm_vxlan_ipv4_hdr_t, *phwrm_vxlan_ipv4_hdr_t;
41037 
41038 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
41039 
41040 typedef struct hwrm_vxlan_ipv6_hdr {
41041 	/* IPv6 version, traffic class and flow label. */
41042 	uint32_t	ver_tc_flow_label;
41043 	/* IPv6 version shift */
41044 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT	UINT32_C(0x1c)
41045 	/* IPv6 version mask */
41046 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK	UINT32_C(0xf0000000)
41047 	/* IPv6 TC shift */
41048 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT	UINT32_C(0x14)
41049 	/* IPv6 TC mask */
41050 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK	UINT32_C(0xff00000)
41051 	/* IPv6 flow label shift */
41052 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT  UINT32_C(0x0)
41053 	/* IPv6 flow label mask */
41054 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK UINT32_C(0xfffff)
41055 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST	HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
41056 	/* IPv6 payload length. */
41057 	uint16_t	payload_len;
41058 	/* IPv6 next header. */
41059 	uint8_t	next_hdr;
41060 	/* IPv6 TTL. */
41061 	uint8_t	ttl;
41062 	/* IPv6 source address. */
41063 	uint32_t	src_ip_addr[4];
41064 	/* IPv6 destination address. */
41065 	uint32_t	dest_ip_addr[4];
41066 } hwrm_vxlan_ipv6_hdr_t, *phwrm_vxlan_ipv6_hdr_t;
41067 
41068 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
41069 
41070 typedef struct hwrm_cfa_encap_data_vxlan {
41071 	/* Source MAC address. */
41072 	uint8_t	src_mac_addr[6];
41073 	/* reserved. */
41074 	uint16_t	unused_0;
41075 	/* Destination MAC address. */
41076 	uint8_t	dst_mac_addr[6];
41077 	/* Number of VLAN tags. */
41078 	uint8_t	num_vlan_tags;
41079 	/* reserved. */
41080 	uint8_t	unused_1;
41081 	/* Outer VLAN TPID. */
41082 	uint16_t	ovlan_tpid;
41083 	/* Outer VLAN TCI. */
41084 	uint16_t	ovlan_tci;
41085 	/* Inner VLAN TPID. */
41086 	uint16_t	ivlan_tpid;
41087 	/* Inner VLAN TCI. */
41088 	uint16_t	ivlan_tci;
41089 	/* L3 header fields. */
41090 	uint32_t	l3[10];
41091 	/* IP version mask. */
41092 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
41093 	/* IP version 4. */
41094 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
41095 	/* IP version 6. */
41096 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
41097 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST	HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
41098 	/* UDP source port. */
41099 	uint16_t	src_port;
41100 	/* UDP destination port. */
41101 	uint16_t	dst_port;
41102 	/* VXLAN Network Identifier. */
41103 	uint32_t	vni;
41104 	/*
41105 	 * 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN
41106 	 * header.
41107 	 */
41108 	uint8_t	hdr_rsvd0[3];
41109 	/* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
41110 	uint8_t	hdr_rsvd1;
41111 	/* VXLAN header flags field. */
41112 	uint8_t	hdr_flags;
41113 	uint8_t	unused[3];
41114 } hwrm_cfa_encap_data_vxlan_t, *phwrm_cfa_encap_data_vxlan_t;
41115 
41116 /*******************************
41117  * hwrm_cfa_encap_record_alloc *
41118  *******************************/
41119 
41120 
41121 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
41122 
41123 typedef struct hwrm_cfa_encap_record_alloc_input {
41124 	/* The HWRM command request type. */
41125 	uint16_t	req_type;
41126 	/*
41127 	 * The completion ring to send the completion event on. This should
41128 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41129 	 */
41130 	uint16_t	cmpl_ring;
41131 	/*
41132 	 * The sequence ID is used by the driver for tracking multiple
41133 	 * commands. This ID is treated as opaque data by the firmware and
41134 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41135 	 */
41136 	uint16_t	seq_id;
41137 	/*
41138 	 * The target ID of the command:
41139 	 * * 0x0-0xFFF8 - The function ID
41140 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41141 	 * * 0xFFFD - Reserved for user-space HWRM interface
41142 	 * * 0xFFFF - HWRM
41143 	 */
41144 	uint16_t	target_id;
41145 	/*
41146 	 * A physical address pointer pointing to a host buffer that the
41147 	 * command's response data will be written. This can be either a host
41148 	 * physical address (HPA) or a guest physical address (GPA) and must
41149 	 * point to a physically contiguous block of memory.
41150 	 */
41151 	uint64_t	resp_addr;
41152 	uint32_t	flags;
41153 	/*
41154 	 * Setting of this flag indicates the applicability to the loopback
41155 	 * path.
41156 	 */
41157 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x1)
41158 	/*
41159 	 * Setting of this flag indicates this encap record is external
41160 	 * encap record. Resetting of this flag indicates this flag is
41161 	 * internal encap record and this is the default setting.
41162 	 */
41163 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL	UINT32_C(0x2)
41164 	/* Encapsulation Type. */
41165 	uint8_t	encap_type;
41166 	/* Virtual eXtensible Local Area Network (VXLAN) */
41167 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN	UINT32_C(0x1)
41168 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41169 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE	UINT32_C(0x2)
41170 	/* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
41171 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE	UINT32_C(0x3)
41172 	/* IP in IP */
41173 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP	UINT32_C(0x4)
41174 	/* Generic Network Virtualization Encapsulation (Geneve) */
41175 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE	UINT32_C(0x5)
41176 	/* Multi-Protocol Label Switching (MPLS) */
41177 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS	UINT32_C(0x6)
41178 	/* VLAN */
41179 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN	UINT32_C(0x7)
41180 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41181 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE	UINT32_C(0x8)
41182 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41183 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4	UINT32_C(0x9)
41184 	/*
41185 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41186 	 * datagram payload
41187 	 */
41188 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1	UINT32_C(0xa)
41189 	/* Use fixed layer 2 ether type of 0xFFFF */
41190 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE	UINT32_C(0xb)
41191 	/*
41192 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
41193 	 * (IPV6oVXLANGPE)
41194 	 */
41195 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
41196 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
41197 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE	UINT32_C(0x10)
41198 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST	HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE
41199 	uint8_t	unused_0[3];
41200 	/* This value is encap data used for the given encap type. */
41201 	uint32_t	encap_data[20];
41202 } hwrm_cfa_encap_record_alloc_input_t, *phwrm_cfa_encap_record_alloc_input_t;
41203 
41204 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
41205 
41206 typedef struct hwrm_cfa_encap_record_alloc_output {
41207 	/* The specific error status for the command. */
41208 	uint16_t	error_code;
41209 	/* The HWRM command request type. */
41210 	uint16_t	req_type;
41211 	/* The sequence ID from the original command. */
41212 	uint16_t	seq_id;
41213 	/* The length of the response data in number of bytes. */
41214 	uint16_t	resp_len;
41215 	/* This value is an opaque id into CFA data structures. */
41216 	uint32_t	encap_record_id;
41217 	uint8_t	unused_0[3];
41218 	/*
41219 	 * This field is used in Output records to indicate that the output
41220 	 * is completely written to RAM. This field should be read as '1'
41221 	 * to indicate that the output has been completely written.
41222 	 * When writing a command completion or response to an internal
41223 	 * processor, the order of writes has to be such that this field is
41224 	 * written last.
41225 	 */
41226 	uint8_t	valid;
41227 } hwrm_cfa_encap_record_alloc_output_t, *phwrm_cfa_encap_record_alloc_output_t;
41228 
41229 /******************************
41230  * hwrm_cfa_encap_record_free *
41231  ******************************/
41232 
41233 
41234 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
41235 
41236 typedef struct hwrm_cfa_encap_record_free_input {
41237 	/* The HWRM command request type. */
41238 	uint16_t	req_type;
41239 	/*
41240 	 * The completion ring to send the completion event on. This should
41241 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41242 	 */
41243 	uint16_t	cmpl_ring;
41244 	/*
41245 	 * The sequence ID is used by the driver for tracking multiple
41246 	 * commands. This ID is treated as opaque data by the firmware and
41247 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41248 	 */
41249 	uint16_t	seq_id;
41250 	/*
41251 	 * The target ID of the command:
41252 	 * * 0x0-0xFFF8 - The function ID
41253 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41254 	 * * 0xFFFD - Reserved for user-space HWRM interface
41255 	 * * 0xFFFF - HWRM
41256 	 */
41257 	uint16_t	target_id;
41258 	/*
41259 	 * A physical address pointer pointing to a host buffer that the
41260 	 * command's response data will be written. This can be either a host
41261 	 * physical address (HPA) or a guest physical address (GPA) and must
41262 	 * point to a physically contiguous block of memory.
41263 	 */
41264 	uint64_t	resp_addr;
41265 	/* This value is an opaque id into CFA data structures. */
41266 	uint32_t	encap_record_id;
41267 	uint8_t	unused_0[4];
41268 } hwrm_cfa_encap_record_free_input_t, *phwrm_cfa_encap_record_free_input_t;
41269 
41270 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
41271 
41272 typedef struct hwrm_cfa_encap_record_free_output {
41273 	/* The specific error status for the command. */
41274 	uint16_t	error_code;
41275 	/* The HWRM command request type. */
41276 	uint16_t	req_type;
41277 	/* The sequence ID from the original command. */
41278 	uint16_t	seq_id;
41279 	/* The length of the response data in number of bytes. */
41280 	uint16_t	resp_len;
41281 	uint8_t	unused_0[7];
41282 	/*
41283 	 * This field is used in Output records to indicate that the output
41284 	 * is completely written to RAM. This field should be read as '1'
41285 	 * to indicate that the output has been completely written.
41286 	 * When writing a command completion or response to an internal
41287 	 * processor, the order of writes has to be such that this field is
41288 	 * written last.
41289 	 */
41290 	uint8_t	valid;
41291 } hwrm_cfa_encap_record_free_output_t, *phwrm_cfa_encap_record_free_output_t;
41292 
41293 /********************************
41294  * hwrm_cfa_ntuple_filter_alloc *
41295  ********************************/
41296 
41297 
41298 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
41299 
41300 typedef struct hwrm_cfa_ntuple_filter_alloc_input {
41301 	/* The HWRM command request type. */
41302 	uint16_t	req_type;
41303 	/*
41304 	 * The completion ring to send the completion event on. This should
41305 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41306 	 */
41307 	uint16_t	cmpl_ring;
41308 	/*
41309 	 * The sequence ID is used by the driver for tracking multiple
41310 	 * commands. This ID is treated as opaque data by the firmware and
41311 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41312 	 */
41313 	uint16_t	seq_id;
41314 	/*
41315 	 * The target ID of the command:
41316 	 * * 0x0-0xFFF8 - The function ID
41317 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41318 	 * * 0xFFFD - Reserved for user-space HWRM interface
41319 	 * * 0xFFFF - HWRM
41320 	 */
41321 	uint16_t	target_id;
41322 	/*
41323 	 * A physical address pointer pointing to a host buffer that the
41324 	 * command's response data will be written. This can be either a host
41325 	 * physical address (HPA) or a guest physical address (GPA) and must
41326 	 * point to a physically contiguous block of memory.
41327 	 */
41328 	uint64_t	resp_addr;
41329 	uint32_t	flags;
41330 	/*
41331 	 * Setting of this flag indicates the applicability to the loopback
41332 	 * path.
41333 	 */
41334 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK		UINT32_C(0x1)
41335 	/*
41336 	 * Setting of this flag indicates drop action. If this flag is not
41337 	 * set, then it should be considered accept action.
41338 	 */
41339 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP		UINT32_C(0x2)
41340 	/*
41341 	 * Setting of this flag indicates that a meter is expected to be
41342 	 * attached to this flow. This hint can be used when choosing the
41343 	 * action record format required for the flow.
41344 	 */
41345 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER		UINT32_C(0x4)
41346 	/*
41347 	 * Setting of this flag indicates that the dst_id field contains
41348 	 * function ID. If this is not set it indicates dest_id is VNIC
41349 	 * or VPORT.
41350 	 */
41351 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID		UINT32_C(0x8)
41352 	/*
41353 	 * Setting of this flag indicates match on arp reply when ethertype
41354 	 * is 0x0806. If this is not set it indicates no specific arp opcode
41355 	 * matching.
41356 	 */
41357 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY		UINT32_C(0x10)
41358 	/*
41359 	 * Setting of this flag indicates that the dst_id field contains RFS
41360 	 * ring table index. If this is not set it indicates dst_id is VNIC
41361 	 * or VPORT or function ID.  Note dest_fid and dest_rfs_ring_idx
41362 	 * can’t be set at the same time.
41363 	 */
41364 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX	UINT32_C(0x20)
41365 	/*
41366 	 * Setting of this flag indicates that when the ntuple filter is
41367 	 * created, the L2 context should not be used in the filter.  This
41368 	 * allows packet from different L2 contexts to match and be directed
41369 	 * to the same destination.
41370 	 */
41371 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_NO_L2_CONTEXT	UINT32_C(0x40)
41372 	uint32_t	enables;
41373 	/*
41374 	 * This bit must be '1' for the l2_filter_id field to be
41375 	 * configured.
41376 	 */
41377 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
41378 	/*
41379 	 * This bit must be '1' for the ethertype field to be
41380 	 * configured.
41381 	 */
41382 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x2)
41383 	/*
41384 	 * This bit must be '1' for the tunnel_type field to be
41385 	 * configured.
41386 	 */
41387 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x4)
41388 	/*
41389 	 * This bit must be '1' for the src_macaddr field to be
41390 	 * configured.
41391 	 */
41392 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x8)
41393 	/*
41394 	 * This bit must be '1' for the ipaddr_type field to be
41395 	 * configured.
41396 	 */
41397 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x10)
41398 	/*
41399 	 * This bit must be '1' for the src_ipaddr field to be
41400 	 * configured.
41401 	 */
41402 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x20)
41403 	/*
41404 	 * This bit must be '1' for the src_ipaddr_mask field to be
41405 	 * configured.
41406 	 */
41407 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK	UINT32_C(0x40)
41408 	/*
41409 	 * This bit must be '1' for the dst_ipaddr field to be
41410 	 * configured.
41411 	 */
41412 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x80)
41413 	/*
41414 	 * This bit must be '1' for the dst_ipaddr_mask field to be
41415 	 * configured.
41416 	 */
41417 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK	UINT32_C(0x100)
41418 	/*
41419 	 * This bit must be '1' for the ip_protocol field to be
41420 	 * configured.
41421 	 */
41422 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x200)
41423 	/*
41424 	 * This bit must be '1' for the src_port field to be
41425 	 * configured.
41426 	 */
41427 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT		UINT32_C(0x400)
41428 	/*
41429 	 * This bit must be '1' for the src_port_mask field to be
41430 	 * configured.
41431 	 */
41432 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK	UINT32_C(0x800)
41433 	/*
41434 	 * This bit must be '1' for the dst_port field to be
41435 	 * configured.
41436 	 */
41437 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT		UINT32_C(0x1000)
41438 	/*
41439 	 * This bit must be '1' for the dst_port_mask field to be
41440 	 * configured.
41441 	 */
41442 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK	UINT32_C(0x2000)
41443 	/*
41444 	 * This bit must be '1' for the pri_hint field to be
41445 	 * configured.
41446 	 */
41447 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT		UINT32_C(0x4000)
41448 	/*
41449 	 * This bit must be '1' for the ntuple_filter_id field to be
41450 	 * configured.
41451 	 */
41452 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID	UINT32_C(0x8000)
41453 	/*
41454 	 * This bit must be '1' for the dst_id field to be
41455 	 * configured.
41456 	 */
41457 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x10000)
41458 	/*
41459 	 * This bit must be '1' for the mirror_vnic_id field to be
41460 	 * configured.
41461 	 */
41462 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x20000)
41463 	/*
41464 	 * This bit must be '1' for the dst_macaddr field to be
41465 	 * configured.
41466 	 */
41467 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x40000)
41468 	/* This flag is deprecated. */
41469 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX	UINT32_C(0x80000)
41470 	/*
41471 	 * This value identifies a set of CFA data structures used for an L2
41472 	 * context.
41473 	 */
41474 	uint64_t	l2_filter_id;
41475 	/*
41476 	 * This value indicates the source MAC address in
41477 	 * the Ethernet header.
41478 	 */
41479 	uint8_t	src_macaddr[6];
41480 	/* This value indicates the ethertype in the Ethernet header. */
41481 	uint16_t	ethertype;
41482 	/*
41483 	 * This value indicates the type of IP address.
41484 	 * 4 - IPv4
41485 	 * 6 - IPv6
41486 	 * All others are invalid.
41487 	 */
41488 	uint8_t	ip_addr_type;
41489 	/* invalid */
41490 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
41491 	/* IPv4 */
41492 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
41493 	/* IPv6 */
41494 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
41495 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
41496 	/*
41497 	 * The value of protocol filed in IP header.
41498 	 * Applies to UDP and TCP traffic.
41499 	 * 6 - TCP
41500 	 * 17 - UDP
41501 	 * 1 - ICMP
41502 	 * 58 - ICMPV6
41503 	 * 255 - RSVD
41504 	 */
41505 	uint8_t	ip_protocol;
41506 	/* invalid */
41507 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
41508 	/* TCP */
41509 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
41510 	/* UDP */
41511 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
41512 	/* ICMP */
41513 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_ICMP	UINT32_C(0x1)
41514 	/* ICMPV6 */
41515 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_ICMPV6  UINT32_C(0x3a)
41516 	/* RSVD */
41517 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_RSVD	UINT32_C(0xff)
41518 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_RSVD
41519 	/*
41520 	 * If set, this value shall represent the
41521 	 * Logical VNIC ID of the destination VNIC for the RX
41522 	 * path and network port id of the destination port for
41523 	 * the TX path.
41524 	 */
41525 	uint16_t	dst_id;
41526 	/*
41527 	 * Logical VNIC ID of the VNIC where traffic is
41528 	 * mirrored.
41529 	 */
41530 	uint16_t	mirror_vnic_id;
41531 	/*
41532 	 * This value indicates the tunnel type for this filter.
41533 	 * If this field is not specified, then the filter shall
41534 	 * apply to both non-tunneled and tunneled packets.
41535 	 * If this field conflicts with the tunnel_type specified
41536 	 * in the l2_filter_id, then the HWRM shall return an
41537 	 * error for this command.
41538 	 */
41539 	uint8_t	tunnel_type;
41540 	/* Non-tunnel */
41541 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
41542 	/* Virtual eXtensible Local Area Network (VXLAN) */
41543 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
41544 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41545 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
41546 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
41547 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
41548 	/* IP in IP */
41549 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
41550 	/* Generic Network Virtualization Encapsulation (Geneve) */
41551 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
41552 	/* Multi-Protocol Label Switching (MPLS) */
41553 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
41554 	/* Stateless Transport Tunnel (STT) */
41555 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
41556 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41557 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
41558 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41559 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
41560 	/*
41561 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41562 	 * datagram payload
41563 	 */
41564 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
41565 	/* Use fixed layer 2 ether type of 0xFFFF */
41566 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
41567 	/*
41568 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
41569 	 * (IPV6oVXLANGPE)
41570 	 */
41571 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
41572 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
41573 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
41574 	/* Any tunneled traffic */
41575 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
41576 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
41577 	/*
41578 	 * This hint is provided to help in placing
41579 	 * the filter in the filter table.
41580 	 */
41581 	uint8_t	pri_hint;
41582 	/* No preference */
41583 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
41584 	/* Above the given filter */
41585 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE	UINT32_C(0x1)
41586 	/* Below the given filter */
41587 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW	UINT32_C(0x2)
41588 	/* As high as possible */
41589 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST   UINT32_C(0x3)
41590 	/* As low as possible */
41591 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST	UINT32_C(0x4)
41592 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
41593 	/*
41594 	 * The value of source IP address to be used in filtering.
41595 	 * For IPv4, first four bytes represent the IP address.
41596 	 */
41597 	uint32_t	src_ipaddr[4];
41598 	/*
41599 	 * The value of source IP address mask to be used in
41600 	 * filtering.
41601 	 * For IPv4, first four bytes represent the IP address mask.
41602 	 */
41603 	uint32_t	src_ipaddr_mask[4];
41604 	/*
41605 	 * The value of destination IP address to be used in filtering.
41606 	 * For IPv4, first four bytes represent the IP address.
41607 	 */
41608 	uint32_t	dst_ipaddr[4];
41609 	/*
41610 	 * The value of destination IP address mask to be used in
41611 	 * filtering.
41612 	 * For IPv4, first four bytes represent the IP address mask.
41613 	 */
41614 	uint32_t	dst_ipaddr_mask[4];
41615 	/*
41616 	 * The value of source port to be used in filtering.
41617 	 * Applies to UDP and TCP traffic.
41618 	 */
41619 	uint16_t	src_port;
41620 	/*
41621 	 * The value of source port mask to be used in filtering.
41622 	 * Applies to UDP and TCP traffic.
41623 	 */
41624 	uint16_t	src_port_mask;
41625 	/*
41626 	 * The value of destination port to be used in filtering.
41627 	 * Applies to UDP and TCP traffic.
41628 	 */
41629 	uint16_t	dst_port;
41630 	/*
41631 	 * The value of destination port mask to be used in
41632 	 * filtering.
41633 	 * Applies to UDP and TCP traffic.
41634 	 */
41635 	uint16_t	dst_port_mask;
41636 	/*
41637 	 * This is the ID of the filter that goes along with
41638 	 * the pri_hint.
41639 	 */
41640 	uint64_t	ntuple_filter_id_hint;
41641 } hwrm_cfa_ntuple_filter_alloc_input_t, *phwrm_cfa_ntuple_filter_alloc_input_t;
41642 
41643 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
41644 
41645 typedef struct hwrm_cfa_ntuple_filter_alloc_output {
41646 	/* The specific error status for the command. */
41647 	uint16_t	error_code;
41648 	/* The HWRM command request type. */
41649 	uint16_t	req_type;
41650 	/* The sequence ID from the original command. */
41651 	uint16_t	seq_id;
41652 	/* The length of the response data in number of bytes. */
41653 	uint16_t	resp_len;
41654 	/* This value is an opaque id into CFA data structures. */
41655 	uint64_t	ntuple_filter_id;
41656 	/*
41657 	 * The flow id value in bit 0-29 is the actual ID of the flow
41658 	 * associated with this filter and it shall be used to match
41659 	 * and associate the flow identifier returned in completion
41660 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
41661 	 * shall indicate no valid flow id.
41662 	 */
41663 	uint32_t	flow_id;
41664 	/* Indicate the flow id value. */
41665 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
41666 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
41667 	/* Indicate type of the flow. */
41668 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
41669 	/*
41670 	 * If this bit set to 0, then it indicates that the flow is
41671 	 * internal flow.
41672 	 */
41673 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
41674 	/*
41675 	 * If this bit is set to 1, then it indicates that the flow is
41676 	 * external flow.
41677 	 */
41678 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
41679 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
41680 	/* Indicate the flow direction. */
41681 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
41682 	/* If this bit set to 0, then it indicates rx flow. */
41683 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
41684 	/* If this bit is set to 1, then it indicates that tx flow. */
41685 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
41686 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
41687 	uint8_t	unused_0[3];
41688 	/*
41689 	 * This field is used in Output records to indicate that the output
41690 	 * is completely written to RAM. This field should be read as '1'
41691 	 * to indicate that the output has been completely written.
41692 	 * When writing a command completion or response to an internal
41693 	 * processor, the order of writes has to be such that this field is
41694 	 * written last.
41695 	 */
41696 	uint8_t	valid;
41697 } hwrm_cfa_ntuple_filter_alloc_output_t, *phwrm_cfa_ntuple_filter_alloc_output_t;
41698 
41699 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
41700 
41701 typedef struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
41702 	/*
41703 	 * command specific error codes that goes to
41704 	 * the cmd_err field in Common HWRM Error Response.
41705 	 */
41706 	uint8_t	code;
41707 	/* Unknown error */
41708 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
41709 	/* Unable to complete operation due to conflict with Rx Mask VLAN */
41710 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR UINT32_C(0x1)
41711 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST			HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
41712 	uint8_t	unused_0[7];
41713 } hwrm_cfa_ntuple_filter_alloc_cmd_err_t, *phwrm_cfa_ntuple_filter_alloc_cmd_err_t;
41714 
41715 /*******************************
41716  * hwrm_cfa_ntuple_filter_free *
41717  *******************************/
41718 
41719 
41720 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
41721 
41722 typedef struct hwrm_cfa_ntuple_filter_free_input {
41723 	/* The HWRM command request type. */
41724 	uint16_t	req_type;
41725 	/*
41726 	 * The completion ring to send the completion event on. This should
41727 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41728 	 */
41729 	uint16_t	cmpl_ring;
41730 	/*
41731 	 * The sequence ID is used by the driver for tracking multiple
41732 	 * commands. This ID is treated as opaque data by the firmware and
41733 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41734 	 */
41735 	uint16_t	seq_id;
41736 	/*
41737 	 * The target ID of the command:
41738 	 * * 0x0-0xFFF8 - The function ID
41739 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41740 	 * * 0xFFFD - Reserved for user-space HWRM interface
41741 	 * * 0xFFFF - HWRM
41742 	 */
41743 	uint16_t	target_id;
41744 	/*
41745 	 * A physical address pointer pointing to a host buffer that the
41746 	 * command's response data will be written. This can be either a host
41747 	 * physical address (HPA) or a guest physical address (GPA) and must
41748 	 * point to a physically contiguous block of memory.
41749 	 */
41750 	uint64_t	resp_addr;
41751 	/* This value is an opaque id into CFA data structures. */
41752 	uint64_t	ntuple_filter_id;
41753 } hwrm_cfa_ntuple_filter_free_input_t, *phwrm_cfa_ntuple_filter_free_input_t;
41754 
41755 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
41756 
41757 typedef struct hwrm_cfa_ntuple_filter_free_output {
41758 	/* The specific error status for the command. */
41759 	uint16_t	error_code;
41760 	/* The HWRM command request type. */
41761 	uint16_t	req_type;
41762 	/* The sequence ID from the original command. */
41763 	uint16_t	seq_id;
41764 	/* The length of the response data in number of bytes. */
41765 	uint16_t	resp_len;
41766 	uint8_t	unused_0[7];
41767 	/*
41768 	 * This field is used in Output records to indicate that the output
41769 	 * is completely written to RAM. This field should be read as '1'
41770 	 * to indicate that the output has been completely written.
41771 	 * When writing a command completion or response to an internal
41772 	 * processor, the order of writes has to be such that this field is
41773 	 * written last.
41774 	 */
41775 	uint8_t	valid;
41776 } hwrm_cfa_ntuple_filter_free_output_t, *phwrm_cfa_ntuple_filter_free_output_t;
41777 
41778 /******************************
41779  * hwrm_cfa_ntuple_filter_cfg *
41780  ******************************/
41781 
41782 
41783 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
41784 
41785 typedef struct hwrm_cfa_ntuple_filter_cfg_input {
41786 	/* The HWRM command request type. */
41787 	uint16_t	req_type;
41788 	/*
41789 	 * The completion ring to send the completion event on. This should
41790 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41791 	 */
41792 	uint16_t	cmpl_ring;
41793 	/*
41794 	 * The sequence ID is used by the driver for tracking multiple
41795 	 * commands. This ID is treated as opaque data by the firmware and
41796 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41797 	 */
41798 	uint16_t	seq_id;
41799 	/*
41800 	 * The target ID of the command:
41801 	 * * 0x0-0xFFF8 - The function ID
41802 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41803 	 * * 0xFFFD - Reserved for user-space HWRM interface
41804 	 * * 0xFFFF - HWRM
41805 	 */
41806 	uint16_t	target_id;
41807 	/*
41808 	 * A physical address pointer pointing to a host buffer that the
41809 	 * command's response data will be written. This can be either a host
41810 	 * physical address (HPA) or a guest physical address (GPA) and must
41811 	 * point to a physically contiguous block of memory.
41812 	 */
41813 	uint64_t	resp_addr;
41814 	uint32_t	enables;
41815 	/*
41816 	 * This bit must be '1' for the new_dst_id field to be
41817 	 * configured.
41818 	 */
41819 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID		UINT32_C(0x1)
41820 	/*
41821 	 * This bit must be '1' for the new_mirror_vnic_id field to be
41822 	 * configured.
41823 	 */
41824 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
41825 	/*
41826 	 * This bit must be '1' for the new_meter_instance_id field to be
41827 	 * configured.
41828 	 */
41829 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID	UINT32_C(0x4)
41830 	uint32_t	flags;
41831 	/*
41832 	 * Setting this bit to 1 indicates that dest_id field contains FID.
41833 	 * Setting this to 0 indicates that dest_id field contains VNIC or
41834 	 * VPORT.
41835 	 */
41836 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID		UINT32_C(0x1)
41837 	/*
41838 	 * Setting of this flag indicates that the new_dst_id field contains
41839 	 * RFS ring table index. If this is not set it indicates new_dst_id
41840 	 * is VNIC or VPORT or function ID.  Note dest_fid and
41841 	 * dest_rfs_ring_idx can’t be set at the same time.
41842 	 */
41843 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX	UINT32_C(0x2)
41844 	/*
41845 	 * Setting of this flag indicates that when the ntuple filter is
41846 	 * created, the L2 context should not be used in the filter.  This
41847 	 * allows packet from different L2 contexts to match and be directed
41848 	 * to the same destination.
41849 	 */
41850 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_NO_L2_CONTEXT	UINT32_C(0x4)
41851 	/* This value is an opaque id into CFA data structures. */
41852 	uint64_t	ntuple_filter_id;
41853 	/*
41854 	 * If set, this value shall represent the new
41855 	 * Logical VNIC ID of the destination VNIC for the RX
41856 	 * path and new network port id of the destination port for
41857 	 * the TX path.
41858 	 */
41859 	uint32_t	new_dst_id;
41860 	/*
41861 	 * New Logical VNIC ID of the VNIC where traffic is
41862 	 * mirrored.
41863 	 */
41864 	uint32_t	new_mirror_vnic_id;
41865 	/*
41866 	 * New meter to attach to the flow. Specifying the
41867 	 * invalid instance ID is used to remove any existing
41868 	 * meter from the flow.
41869 	 */
41870 	uint16_t	new_meter_instance_id;
41871 	/*
41872 	 * A value of 0xfff is considered invalid and implies the
41873 	 * instance is not configured.
41874 	 */
41875 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
41876 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST   HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
41877 	uint8_t	unused_1[6];
41878 } hwrm_cfa_ntuple_filter_cfg_input_t, *phwrm_cfa_ntuple_filter_cfg_input_t;
41879 
41880 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
41881 
41882 typedef struct hwrm_cfa_ntuple_filter_cfg_output {
41883 	/* The specific error status for the command. */
41884 	uint16_t	error_code;
41885 	/* The HWRM command request type. */
41886 	uint16_t	req_type;
41887 	/* The sequence ID from the original command. */
41888 	uint16_t	seq_id;
41889 	/* The length of the response data in number of bytes. */
41890 	uint16_t	resp_len;
41891 	uint8_t	unused_0[7];
41892 	/*
41893 	 * This field is used in Output records to indicate that the output
41894 	 * is completely written to RAM. This field should be read as '1'
41895 	 * to indicate that the output has been completely written.
41896 	 * When writing a command completion or response to an internal
41897 	 * processor, the order of writes has to be such that this field is
41898 	 * written last.
41899 	 */
41900 	uint8_t	valid;
41901 } hwrm_cfa_ntuple_filter_cfg_output_t, *phwrm_cfa_ntuple_filter_cfg_output_t;
41902 
41903 /**************************
41904  * hwrm_cfa_em_flow_alloc *
41905  **************************/
41906 
41907 
41908 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
41909 
41910 typedef struct hwrm_cfa_em_flow_alloc_input {
41911 	/* The HWRM command request type. */
41912 	uint16_t	req_type;
41913 	/*
41914 	 * The completion ring to send the completion event on. This should
41915 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41916 	 */
41917 	uint16_t	cmpl_ring;
41918 	/*
41919 	 * The sequence ID is used by the driver for tracking multiple
41920 	 * commands. This ID is treated as opaque data by the firmware and
41921 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41922 	 */
41923 	uint16_t	seq_id;
41924 	/*
41925 	 * The target ID of the command:
41926 	 * * 0x0-0xFFF8 - The function ID
41927 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41928 	 * * 0xFFFD - Reserved for user-space HWRM interface
41929 	 * * 0xFFFF - HWRM
41930 	 */
41931 	uint16_t	target_id;
41932 	/*
41933 	 * A physical address pointer pointing to a host buffer that the
41934 	 * command's response data will be written. This can be either a host
41935 	 * physical address (HPA) or a guest physical address (GPA) and must
41936 	 * point to a physically contiguous block of memory.
41937 	 */
41938 	uint64_t	resp_addr;
41939 	uint32_t	flags;
41940 	/*
41941 	 * Enumeration denoting the RX, TX type of the resource.
41942 	 * This enumeration is used for resources that are similar for both
41943 	 * TX and RX paths of the chip.
41944 	 */
41945 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
41946 	/* tx path */
41947 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
41948 	/* rx path */
41949 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
41950 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
41951 	/*
41952 	 * Setting of this flag indicates enabling of a byte counter for a
41953 	 * given flow.
41954 	 */
41955 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR	UINT32_C(0x2)
41956 	/*
41957 	 * Setting of this flag indicates enabling of a packet counter for a
41958 	 * given flow.
41959 	 */
41960 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR	UINT32_C(0x4)
41961 	/*
41962 	 * Setting of this flag indicates de-capsulation action for the
41963 	 * given flow.
41964 	 */
41965 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP	UINT32_C(0x8)
41966 	/*
41967 	 * Setting of this flag indicates encapsulation action for the
41968 	 * given flow.
41969 	 */
41970 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP	UINT32_C(0x10)
41971 	/*
41972 	 * Setting of this flag indicates drop action. If this flag is not
41973 	 * set, then it should be considered accept action.
41974 	 */
41975 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP	UINT32_C(0x20)
41976 	/*
41977 	 * Setting of this flag indicates that a meter is expected to be
41978 	 * attached to this flow. This hint can be used when choosing the
41979 	 * action record format required for the flow.
41980 	 */
41981 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER	UINT32_C(0x40)
41982 	uint32_t	enables;
41983 	/*
41984 	 * This bit must be '1' for the l2_filter_id field to be
41985 	 * configured.
41986 	 */
41987 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
41988 	/*
41989 	 * This bit must be '1' for the tunnel_type field to be
41990 	 * configured.
41991 	 */
41992 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x2)
41993 	/*
41994 	 * This bit must be '1' for the tunnel_id field to be
41995 	 * configured.
41996 	 */
41997 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID		UINT32_C(0x4)
41998 	/*
41999 	 * This bit must be '1' for the src_macaddr field to be
42000 	 * configured.
42001 	 */
42002 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x8)
42003 	/*
42004 	 * This bit must be '1' for the dst_macaddr field to be
42005 	 * configured.
42006 	 */
42007 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x10)
42008 	/*
42009 	 * This bit must be '1' for the ovlan_vid field to be
42010 	 * configured.
42011 	 */
42012 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID		UINT32_C(0x20)
42013 	/*
42014 	 * This bit must be '1' for the ivlan_vid field to be
42015 	 * configured.
42016 	 */
42017 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID		UINT32_C(0x40)
42018 	/*
42019 	 * This bit must be '1' for the ethertype field to be
42020 	 * configured.
42021 	 */
42022 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x80)
42023 	/*
42024 	 * This bit must be '1' for the src_ipaddr field to be
42025 	 * configured.
42026 	 */
42027 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR		UINT32_C(0x100)
42028 	/*
42029 	 * This bit must be '1' for the dst_ipaddr field to be
42030 	 * configured.
42031 	 */
42032 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR		UINT32_C(0x200)
42033 	/*
42034 	 * This bit must be '1' for the ipaddr_type field to be
42035 	 * configured.
42036 	 */
42037 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x400)
42038 	/*
42039 	 * This bit must be '1' for the ip_protocol field to be
42040 	 * configured.
42041 	 */
42042 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x800)
42043 	/*
42044 	 * This bit must be '1' for the src_port field to be
42045 	 * configured.
42046 	 */
42047 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT		UINT32_C(0x1000)
42048 	/*
42049 	 * This bit must be '1' for the dst_port field to be
42050 	 * configured.
42051 	 */
42052 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT		UINT32_C(0x2000)
42053 	/*
42054 	 * This bit must be '1' for the dst_id field to be
42055 	 * configured.
42056 	 */
42057 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x4000)
42058 	/*
42059 	 * This bit must be '1' for the mirror_vnic_id field to be
42060 	 * configured.
42061 	 */
42062 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x8000)
42063 	/*
42064 	 * This bit must be '1' for the encap_record_id field to be
42065 	 * configured.
42066 	 */
42067 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID	UINT32_C(0x10000)
42068 	/*
42069 	 * This bit must be '1' for the meter_instance_id field to be
42070 	 * configured.
42071 	 */
42072 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID	UINT32_C(0x20000)
42073 	/*
42074 	 * This value identifies a set of CFA data structures used for an L2
42075 	 * context.
42076 	 */
42077 	uint64_t	l2_filter_id;
42078 	/* Tunnel Type. */
42079 	uint8_t	tunnel_type;
42080 	/* Non-tunnel */
42081 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
42082 	/* Virtual eXtensible Local Area Network (VXLAN) */
42083 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
42084 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
42085 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
42086 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
42087 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
42088 	/* IP in IP */
42089 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
42090 	/* Generic Network Virtualization Encapsulation (Geneve) */
42091 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
42092 	/* Multi-Protocol Label Switching (MPLS) */
42093 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
42094 	/* Stateless Transport Tunnel (STT) */
42095 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
42096 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
42097 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
42098 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
42099 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
42100 	/*
42101 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
42102 	 * datagram payload
42103 	 */
42104 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
42105 	/* Use fixed layer 2 ether type of 0xFFFF */
42106 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
42107 	/*
42108 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
42109 	 * (IPV6oVXLANGPE)
42110 	 */
42111 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
42112 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
42113 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
42114 	/* Any tunneled traffic */
42115 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
42116 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
42117 	uint8_t	unused_0[3];
42118 	/*
42119 	 * Tunnel identifier.
42120 	 * Virtual Network Identifier (VNI). Only valid with
42121 	 * tunnel_types VXLAN, NVGRE, and Geneve.
42122 	 * Only lower 24-bits of VNI field are used
42123 	 * in setting up the filter.
42124 	 */
42125 	uint32_t	tunnel_id;
42126 	/*
42127 	 * This value indicates the source MAC address in
42128 	 * the Ethernet header.
42129 	 */
42130 	uint8_t	src_macaddr[6];
42131 	/* The meter instance to attach to the flow. */
42132 	uint16_t	meter_instance_id;
42133 	/*
42134 	 * A value of 0xfff is considered invalid and implies the
42135 	 * instance is not configured.
42136 	 */
42137 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
42138 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
42139 	/*
42140 	 * This value indicates the destination MAC address in
42141 	 * the Ethernet header.
42142 	 */
42143 	uint8_t	dst_macaddr[6];
42144 	/*
42145 	 * This value indicates the VLAN ID of the outer VLAN tag
42146 	 * in the Ethernet header.
42147 	 */
42148 	uint16_t	ovlan_vid;
42149 	/*
42150 	 * This value indicates the VLAN ID of the inner VLAN tag
42151 	 * in the Ethernet header.
42152 	 */
42153 	uint16_t	ivlan_vid;
42154 	/* This value indicates the ethertype in the Ethernet header. */
42155 	uint16_t	ethertype;
42156 	/*
42157 	 * This value indicates the type of IP address.
42158 	 * 4 - IPv4
42159 	 * 6 - IPv6
42160 	 * All others are invalid.
42161 	 */
42162 	uint8_t	ip_addr_type;
42163 	/* invalid */
42164 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
42165 	/* IPv4 */
42166 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
42167 	/* IPv6 */
42168 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
42169 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
42170 	/*
42171 	 * The value of protocol filed in IP header.
42172 	 * Applies to UDP and TCP traffic.
42173 	 * 6 - TCP
42174 	 * 17 - UDP
42175 	 */
42176 	uint8_t	ip_protocol;
42177 	/* invalid */
42178 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
42179 	/* TCP */
42180 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
42181 	/* UDP */
42182 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
42183 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
42184 	uint8_t	unused_1[2];
42185 	/*
42186 	 * The value of source IP address to be used in filtering.
42187 	 * For IPv4, first four bytes represent the IP address.
42188 	 */
42189 	uint32_t	src_ipaddr[4];
42190 	/*
42191 	 * big_endian = True
42192 	 *	The value of destination IP address to be used in filtering.
42193 	 *	For IPv4, first four bytes represent the IP address.
42194 	 */
42195 	uint32_t	dst_ipaddr[4];
42196 	/*
42197 	 * The value of source port to be used in filtering.
42198 	 * Applies to UDP and TCP traffic.
42199 	 */
42200 	uint16_t	src_port;
42201 	/*
42202 	 * The value of destination port to be used in filtering.
42203 	 * Applies to UDP and TCP traffic.
42204 	 */
42205 	uint16_t	dst_port;
42206 	/*
42207 	 * If set, this value shall represent the
42208 	 * Logical VNIC ID of the destination VNIC for the RX
42209 	 * path and network port id of the destination port for
42210 	 * the TX path.
42211 	 */
42212 	uint16_t	dst_id;
42213 	/*
42214 	 * Logical VNIC ID of the VNIC where traffic is
42215 	 * mirrored.
42216 	 */
42217 	uint16_t	mirror_vnic_id;
42218 	/* Logical ID of the encapsulation record. */
42219 	uint32_t	encap_record_id;
42220 	uint8_t	unused_2[4];
42221 } hwrm_cfa_em_flow_alloc_input_t, *phwrm_cfa_em_flow_alloc_input_t;
42222 
42223 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
42224 
42225 typedef struct hwrm_cfa_em_flow_alloc_output {
42226 	/* The specific error status for the command. */
42227 	uint16_t	error_code;
42228 	/* The HWRM command request type. */
42229 	uint16_t	req_type;
42230 	/* The sequence ID from the original command. */
42231 	uint16_t	seq_id;
42232 	/* The length of the response data in number of bytes. */
42233 	uint16_t	resp_len;
42234 	/* This value is an opaque id into CFA data structures. */
42235 	uint64_t	em_filter_id;
42236 	/*
42237 	 * The flow id value in bit 0-29 is the actual ID of the flow
42238 	 * associated with this filter and it shall be used to match
42239 	 * and associate the flow identifier returned in completion
42240 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
42241 	 * shall indicate no valid flow id.
42242 	 */
42243 	uint32_t	flow_id;
42244 	/* Indicate the flow id value. */
42245 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
42246 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
42247 	/* Indicate type of the flow. */
42248 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
42249 	/*
42250 	 * If this bit set to 0, then it indicates that the flow is
42251 	 * internal flow.
42252 	 */
42253 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
42254 	/*
42255 	 * If this bit is set to 1, then it indicates that the flow is
42256 	 * external flow.
42257 	 */
42258 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
42259 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
42260 	/* Indicate the flow direction. */
42261 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
42262 	/* If this bit set to 0, then it indicates rx flow. */
42263 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
42264 	/* If this bit is set to 1, then it indicates that tx flow. */
42265 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
42266 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
42267 	uint8_t	unused_0[3];
42268 	/*
42269 	 * This field is used in Output records to indicate that the output
42270 	 * is completely written to RAM. This field should be read as '1'
42271 	 * to indicate that the output has been completely written.
42272 	 * When writing a command completion or response to an internal
42273 	 * processor, the order of writes has to be such that this field is
42274 	 * written last.
42275 	 */
42276 	uint8_t	valid;
42277 } hwrm_cfa_em_flow_alloc_output_t, *phwrm_cfa_em_flow_alloc_output_t;
42278 
42279 /*************************
42280  * hwrm_cfa_em_flow_free *
42281  *************************/
42282 
42283 
42284 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
42285 
42286 typedef struct hwrm_cfa_em_flow_free_input {
42287 	/* The HWRM command request type. */
42288 	uint16_t	req_type;
42289 	/*
42290 	 * The completion ring to send the completion event on. This should
42291 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42292 	 */
42293 	uint16_t	cmpl_ring;
42294 	/*
42295 	 * The sequence ID is used by the driver for tracking multiple
42296 	 * commands. This ID is treated as opaque data by the firmware and
42297 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42298 	 */
42299 	uint16_t	seq_id;
42300 	/*
42301 	 * The target ID of the command:
42302 	 * * 0x0-0xFFF8 - The function ID
42303 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42304 	 * * 0xFFFD - Reserved for user-space HWRM interface
42305 	 * * 0xFFFF - HWRM
42306 	 */
42307 	uint16_t	target_id;
42308 	/*
42309 	 * A physical address pointer pointing to a host buffer that the
42310 	 * command's response data will be written. This can be either a host
42311 	 * physical address (HPA) or a guest physical address (GPA) and must
42312 	 * point to a physically contiguous block of memory.
42313 	 */
42314 	uint64_t	resp_addr;
42315 	/* This value is an opaque id into CFA data structures. */
42316 	uint64_t	em_filter_id;
42317 } hwrm_cfa_em_flow_free_input_t, *phwrm_cfa_em_flow_free_input_t;
42318 
42319 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
42320 
42321 typedef struct hwrm_cfa_em_flow_free_output {
42322 	/* The specific error status for the command. */
42323 	uint16_t	error_code;
42324 	/* The HWRM command request type. */
42325 	uint16_t	req_type;
42326 	/* The sequence ID from the original command. */
42327 	uint16_t	seq_id;
42328 	/* The length of the response data in number of bytes. */
42329 	uint16_t	resp_len;
42330 	uint8_t	unused_0[7];
42331 	/*
42332 	 * This field is used in Output records to indicate that the output
42333 	 * is completely written to RAM. This field should be read as '1'
42334 	 * to indicate that the output has been completely written.
42335 	 * When writing a command completion or response to an internal
42336 	 * processor, the order of writes has to be such that this field is
42337 	 * written last.
42338 	 */
42339 	uint8_t	valid;
42340 } hwrm_cfa_em_flow_free_output_t, *phwrm_cfa_em_flow_free_output_t;
42341 
42342 /************************
42343  * hwrm_cfa_em_flow_cfg *
42344  ************************/
42345 
42346 
42347 /* hwrm_cfa_em_flow_cfg_input (size:384b/48B) */
42348 
42349 typedef struct hwrm_cfa_em_flow_cfg_input {
42350 	/* The HWRM command request type. */
42351 	uint16_t	req_type;
42352 	/*
42353 	 * The completion ring to send the completion event on. This should
42354 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42355 	 */
42356 	uint16_t	cmpl_ring;
42357 	/*
42358 	 * The sequence ID is used by the driver for tracking multiple
42359 	 * commands. This ID is treated as opaque data by the firmware and
42360 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42361 	 */
42362 	uint16_t	seq_id;
42363 	/*
42364 	 * The target ID of the command:
42365 	 * * 0x0-0xFFF8 - The function ID
42366 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42367 	 * * 0xFFFD - Reserved for user-space HWRM interface
42368 	 * * 0xFFFF - HWRM
42369 	 */
42370 	uint16_t	target_id;
42371 	/*
42372 	 * A physical address pointer pointing to a host buffer that the
42373 	 * command's response data will be written. This can be either a host
42374 	 * physical address (HPA) or a guest physical address (GPA) and must
42375 	 * point to a physically contiguous block of memory.
42376 	 */
42377 	uint64_t	resp_addr;
42378 	uint32_t	enables;
42379 	/*
42380 	 * This bit must be '1' for the new_dst_id field to be
42381 	 * configured.
42382 	 */
42383 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_DST_ID		UINT32_C(0x1)
42384 	/*
42385 	 * This bit must be '1' for the new_mirror_vnic_id field to be
42386 	 * configured.
42387 	 */
42388 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
42389 	/*
42390 	 * This bit must be '1' for the new_meter_instance_id field to be
42391 	 * configured.
42392 	 */
42393 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID	UINT32_C(0x4)
42394 	uint8_t	unused_0[4];
42395 	/* This value is an opaque id into CFA data structures. */
42396 	uint64_t	em_filter_id;
42397 	/*
42398 	 * If set, this value shall represent the new
42399 	 * Logical VNIC ID of the destination VNIC for the RX
42400 	 * path and network port id of the destination port for
42401 	 * the TX path.
42402 	 */
42403 	uint32_t	new_dst_id;
42404 	/*
42405 	 * New Logical VNIC ID of the VNIC where traffic is
42406 	 * mirrored.
42407 	 */
42408 	uint32_t	new_mirror_vnic_id;
42409 	/*
42410 	 * New meter to attach to the flow. Specifying the
42411 	 * invalid instance ID is used to remove any existing
42412 	 * meter from the flow.
42413 	 */
42414 	uint16_t	new_meter_instance_id;
42415 	/*
42416 	 * A value of 0xfff is considered invalid and implies the
42417 	 * instance is not configured.
42418 	 */
42419 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
42420 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST   HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
42421 	uint8_t	unused_1[6];
42422 } hwrm_cfa_em_flow_cfg_input_t, *phwrm_cfa_em_flow_cfg_input_t;
42423 
42424 /* hwrm_cfa_em_flow_cfg_output (size:128b/16B) */
42425 
42426 typedef struct hwrm_cfa_em_flow_cfg_output {
42427 	/* The specific error status for the command. */
42428 	uint16_t	error_code;
42429 	/* The HWRM command request type. */
42430 	uint16_t	req_type;
42431 	/* The sequence ID from the original command. */
42432 	uint16_t	seq_id;
42433 	/* The length of the response data in number of bytes. */
42434 	uint16_t	resp_len;
42435 	uint8_t	unused_0[7];
42436 	/*
42437 	 * This field is used in Output records to indicate that the output
42438 	 * is completely written to RAM. This field should be read as '1'
42439 	 * to indicate that the output has been completely written.
42440 	 * When writing a command completion or response to an internal
42441 	 * processor, the order of writes has to be such that this field is
42442 	 * written last.
42443 	 */
42444 	uint8_t	valid;
42445 } hwrm_cfa_em_flow_cfg_output_t, *phwrm_cfa_em_flow_cfg_output_t;
42446 
42447 /************************
42448  * hwrm_cfa_meter_qcaps *
42449  ************************/
42450 
42451 
42452 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
42453 
42454 typedef struct hwrm_cfa_meter_qcaps_input {
42455 	/* The HWRM command request type. */
42456 	uint16_t	req_type;
42457 	/*
42458 	 * The completion ring to send the completion event on. This should
42459 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42460 	 */
42461 	uint16_t	cmpl_ring;
42462 	/*
42463 	 * The sequence ID is used by the driver for tracking multiple
42464 	 * commands. This ID is treated as opaque data by the firmware and
42465 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42466 	 */
42467 	uint16_t	seq_id;
42468 	/*
42469 	 * The target ID of the command:
42470 	 * * 0x0-0xFFF8 - The function ID
42471 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42472 	 * * 0xFFFD - Reserved for user-space HWRM interface
42473 	 * * 0xFFFF - HWRM
42474 	 */
42475 	uint16_t	target_id;
42476 	/*
42477 	 * A physical address pointer pointing to a host buffer that the
42478 	 * command's response data will be written. This can be either a host
42479 	 * physical address (HPA) or a guest physical address (GPA) and must
42480 	 * point to a physically contiguous block of memory.
42481 	 */
42482 	uint64_t	resp_addr;
42483 } hwrm_cfa_meter_qcaps_input_t, *phwrm_cfa_meter_qcaps_input_t;
42484 
42485 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
42486 
42487 typedef struct hwrm_cfa_meter_qcaps_output {
42488 	/* The specific error status for the command. */
42489 	uint16_t	error_code;
42490 	/* The HWRM command request type. */
42491 	uint16_t	req_type;
42492 	/* The sequence ID from the original command. */
42493 	uint16_t	seq_id;
42494 	/* The length of the response data in number of bytes. */
42495 	uint16_t	resp_len;
42496 	uint32_t	flags;
42497 	/*
42498 	 * Enumeration denoting the clock at which the Meter is running
42499 	 * with. This enumeration is used for resources that are similar
42500 	 * for both TX and RX paths of the chip.
42501 	 */
42502 	#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
42503 	#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
42504 	/* 375 MHz */
42505 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
42506 	/* 625 MHz */
42507 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
42508 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST   HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
42509 	uint8_t	unused_0[4];
42510 	/*
42511 	 * The minimum guaranteed number of tx meter profiles supported
42512 	 * for this function.
42513 	 */
42514 	uint16_t	min_tx_profile;
42515 	/*
42516 	 * The maximum non-guaranteed number of tx meter profiles supported
42517 	 * for this function.
42518 	 */
42519 	uint16_t	max_tx_profile;
42520 	/*
42521 	 * The minimum guaranteed number of rx meter profiles supported
42522 	 * for this function.
42523 	 */
42524 	uint16_t	min_rx_profile;
42525 	/*
42526 	 * The maximum non-guaranteed number of rx meter profiles supported
42527 	 * for this function.
42528 	 */
42529 	uint16_t	max_rx_profile;
42530 	/*
42531 	 * The minimum guaranteed number of tx meter instances supported
42532 	 * for this function.
42533 	 */
42534 	uint16_t	min_tx_instance;
42535 	/*
42536 	 * The maximum non-guaranteed number of tx meter instances supported
42537 	 * for this function.
42538 	 */
42539 	uint16_t	max_tx_instance;
42540 	/*
42541 	 * The minimum guaranteed number of rx meter instances supported
42542 	 * for this function.
42543 	 */
42544 	uint16_t	min_rx_instance;
42545 	/*
42546 	 * The maximum non-guaranteed number of rx meter instances supported
42547 	 * for this function.
42548 	 */
42549 	uint16_t	max_rx_instance;
42550 	uint8_t	unused_1[7];
42551 	/*
42552 	 * This field is used in Output records to indicate that the output
42553 	 * is completely written to RAM. This field should be read as '1'
42554 	 * to indicate that the output has been completely written.
42555 	 * When writing a command completion or response to an internal
42556 	 * processor, the order of writes has to be such that this field is
42557 	 * written last.
42558 	 */
42559 	uint8_t	valid;
42560 } hwrm_cfa_meter_qcaps_output_t, *phwrm_cfa_meter_qcaps_output_t;
42561 
42562 /********************************
42563  * hwrm_cfa_meter_profile_alloc *
42564  ********************************/
42565 
42566 
42567 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
42568 
42569 typedef struct hwrm_cfa_meter_profile_alloc_input {
42570 	/* The HWRM command request type. */
42571 	uint16_t	req_type;
42572 	/*
42573 	 * The completion ring to send the completion event on. This should
42574 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42575 	 */
42576 	uint16_t	cmpl_ring;
42577 	/*
42578 	 * The sequence ID is used by the driver for tracking multiple
42579 	 * commands. This ID is treated as opaque data by the firmware and
42580 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42581 	 */
42582 	uint16_t	seq_id;
42583 	/*
42584 	 * The target ID of the command:
42585 	 * * 0x0-0xFFF8 - The function ID
42586 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42587 	 * * 0xFFFD - Reserved for user-space HWRM interface
42588 	 * * 0xFFFF - HWRM
42589 	 */
42590 	uint16_t	target_id;
42591 	/*
42592 	 * A physical address pointer pointing to a host buffer that the
42593 	 * command's response data will be written. This can be either a host
42594 	 * physical address (HPA) or a guest physical address (GPA) and must
42595 	 * point to a physically contiguous block of memory.
42596 	 */
42597 	uint64_t	resp_addr;
42598 	uint8_t	flags;
42599 	/*
42600 	 * Enumeration denoting the RX, TX type of the resource.
42601 	 * This enumeration is used for resources that are similar for both
42602 	 * TX and RX paths of the chip.
42603 	 */
42604 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
42605 	/* tx path */
42606 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
42607 	/* rx path */
42608 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
42609 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
42610 	/* The meter algorithm type. */
42611 	uint8_t	meter_type;
42612 	/* RFC 2697 (srTCM) */
42613 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
42614 	/* RFC 2698 (trTCM) */
42615 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
42616 	/* RFC 4115 (trTCM) */
42617 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
42618 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST   HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
42619 	/*
42620 	 * This field is reserved for the future use.
42621 	 * It shall be set to 0.
42622 	 */
42623 	uint16_t	reserved1;
42624 	/*
42625 	 * This field is reserved for the future use.
42626 	 * It shall be set to 0.
42627 	 */
42628 	uint32_t	reserved2;
42629 	/* A meter rate specified in bytes-per-second. */
42630 	uint32_t	commit_rate;
42631 	/* The bandwidth value. */
42632 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
42633 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT		0
42634 	/* The granularity of the value (bits or bytes). */
42635 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE			UINT32_C(0x10000000)
42636 	/* Value is in bits. */
42637 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
42638 	/* Value is in bytes. */
42639 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
42640 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
42641 	/* bw_value_unit is 3 b */
42642 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42643 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT	29
42644 	/* Value is in Mb or MB (base 10). */
42645 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42646 	/* Value is in Kb or KB (base 10). */
42647 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42648 	/* Value is in bits or bytes. */
42649 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42650 	/* Value is in Gb or GB (base 10). */
42651 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42652 	/* Value is in 1/100th of a percentage of total bandwidth. */
42653 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42654 	/* Raw value */
42655 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
42656 		#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
42657 	/* A meter burst size specified in bytes. */
42658 	uint32_t	commit_burst;
42659 	/* The bandwidth value. */
42660 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
42661 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT		0
42662 	/* The granularity of the value (bits or bytes). */
42663 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE			UINT32_C(0x10000000)
42664 	/* Value is in bits. */
42665 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
42666 	/* Value is in bytes. */
42667 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
42668 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
42669 	/* bw_value_unit is 3 b */
42670 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42671 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT	29
42672 	/* Value is in Mb or MB (base 10). */
42673 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42674 	/* Value is in Kb or KB (base 10). */
42675 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42676 	/* Value is in bits or bytes. */
42677 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42678 	/* Value is in Gb or GB (base 10). */
42679 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42680 	/* Value is in 1/100th of a percentage of total bandwidth. */
42681 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42682 	/* Invalid value */
42683 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
42684 		#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
42685 	/* A meter rate specified in bytes-per-second. */
42686 	uint32_t	excess_peak_rate;
42687 	/* The bandwidth value. */
42688 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
42689 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT		0
42690 	/* The granularity of the value (bits or bytes). */
42691 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE			UINT32_C(0x10000000)
42692 	/* Value is in bits. */
42693 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
42694 	/* Value is in bytes. */
42695 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
42696 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
42697 	/* bw_value_unit is 3 b */
42698 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42699 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT	29
42700 	/* Value is in Mb or MB (base 10). */
42701 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42702 	/* Value is in Kb or KB (base 10). */
42703 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42704 	/* Value is in bits or bytes. */
42705 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42706 	/* Value is in Gb or GB (base 10). */
42707 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42708 	/* Value is in 1/100th of a percentage of total bandwidth. */
42709 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42710 	/* Raw unit */
42711 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
42712 		#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
42713 	/* A meter burst size specified in bytes. */
42714 	uint32_t	excess_peak_burst;
42715 	/* The bandwidth value. */
42716 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
42717 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT		0
42718 	/* The granularity of the value (bits or bytes). */
42719 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE			UINT32_C(0x10000000)
42720 	/* Value is in bits. */
42721 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
42722 	/* Value is in bytes. */
42723 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
42724 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
42725 	/* bw_value_unit is 3 b */
42726 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42727 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT	29
42728 	/* Value is in Mb or MB (base 10). */
42729 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42730 	/* Value is in Kb or KB (base 10). */
42731 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42732 	/* Value is in bits or bytes. */
42733 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42734 	/* Value is in Gb or GB (base 10). */
42735 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42736 	/* Value is in 1/100th of a percentage of total bandwidth. */
42737 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42738 	/* Invalid unit */
42739 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
42740 		#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
42741 } hwrm_cfa_meter_profile_alloc_input_t, *phwrm_cfa_meter_profile_alloc_input_t;
42742 
42743 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
42744 
42745 typedef struct hwrm_cfa_meter_profile_alloc_output {
42746 	/* The specific error status for the command. */
42747 	uint16_t	error_code;
42748 	/* The HWRM command request type. */
42749 	uint16_t	req_type;
42750 	/* The sequence ID from the original command. */
42751 	uint16_t	seq_id;
42752 	/* The length of the response data in number of bytes. */
42753 	uint16_t	resp_len;
42754 	/* This value identifies a meter profile in CFA. */
42755 	uint16_t	meter_profile_id;
42756 	/*
42757 	 * A value of 0xfff is considered invalid and implies the
42758 	 * profile is not configured.
42759 	 */
42760 	#define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
42761 	#define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
42762 	uint8_t	unused_0[5];
42763 	/*
42764 	 * This field is used in Output records to indicate that the output
42765 	 * is completely written to RAM. This field should be read as '1'
42766 	 * to indicate that the output has been completely written.
42767 	 * When writing a command completion or response to an internal
42768 	 * processor, the order of writes has to be such that this field is
42769 	 * written last.
42770 	 */
42771 	uint8_t	valid;
42772 } hwrm_cfa_meter_profile_alloc_output_t, *phwrm_cfa_meter_profile_alloc_output_t;
42773 
42774 /*******************************
42775  * hwrm_cfa_meter_profile_free *
42776  *******************************/
42777 
42778 
42779 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
42780 
42781 typedef struct hwrm_cfa_meter_profile_free_input {
42782 	/* The HWRM command request type. */
42783 	uint16_t	req_type;
42784 	/*
42785 	 * The completion ring to send the completion event on. This should
42786 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42787 	 */
42788 	uint16_t	cmpl_ring;
42789 	/*
42790 	 * The sequence ID is used by the driver for tracking multiple
42791 	 * commands. This ID is treated as opaque data by the firmware and
42792 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42793 	 */
42794 	uint16_t	seq_id;
42795 	/*
42796 	 * The target ID of the command:
42797 	 * * 0x0-0xFFF8 - The function ID
42798 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42799 	 * * 0xFFFD - Reserved for user-space HWRM interface
42800 	 * * 0xFFFF - HWRM
42801 	 */
42802 	uint16_t	target_id;
42803 	/*
42804 	 * A physical address pointer pointing to a host buffer that the
42805 	 * command's response data will be written. This can be either a host
42806 	 * physical address (HPA) or a guest physical address (GPA) and must
42807 	 * point to a physically contiguous block of memory.
42808 	 */
42809 	uint64_t	resp_addr;
42810 	uint8_t	flags;
42811 	/*
42812 	 * Enumeration denoting the RX, TX type of the resource.
42813 	 * This enumeration is used for resources that are similar for both
42814 	 * TX and RX paths of the chip.
42815 	 */
42816 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
42817 	/* tx path */
42818 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
42819 	/* rx path */
42820 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
42821 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
42822 	uint8_t	unused_0;
42823 	/* This value identifies a meter profile in CFA. */
42824 	uint16_t	meter_profile_id;
42825 	/*
42826 	 * A value of 0xfff is considered invalid and implies the
42827 	 * profile is not configured.
42828 	 */
42829 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
42830 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
42831 	uint8_t	unused_1[4];
42832 } hwrm_cfa_meter_profile_free_input_t, *phwrm_cfa_meter_profile_free_input_t;
42833 
42834 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
42835 
42836 typedef struct hwrm_cfa_meter_profile_free_output {
42837 	/* The specific error status for the command. */
42838 	uint16_t	error_code;
42839 	/* The HWRM command request type. */
42840 	uint16_t	req_type;
42841 	/* The sequence ID from the original command. */
42842 	uint16_t	seq_id;
42843 	/* The length of the response data in number of bytes. */
42844 	uint16_t	resp_len;
42845 	uint8_t	unused_0[7];
42846 	/*
42847 	 * This field is used in Output records to indicate that the output
42848 	 * is completely written to RAM. This field should be read as '1'
42849 	 * to indicate that the output has been completely written.
42850 	 * When writing a command completion or response to an internal
42851 	 * processor, the order of writes has to be such that this field is
42852 	 * written last.
42853 	 */
42854 	uint8_t	valid;
42855 } hwrm_cfa_meter_profile_free_output_t, *phwrm_cfa_meter_profile_free_output_t;
42856 
42857 /******************************
42858  * hwrm_cfa_meter_profile_cfg *
42859  ******************************/
42860 
42861 
42862 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
42863 
42864 typedef struct hwrm_cfa_meter_profile_cfg_input {
42865 	/* The HWRM command request type. */
42866 	uint16_t	req_type;
42867 	/*
42868 	 * The completion ring to send the completion event on. This should
42869 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42870 	 */
42871 	uint16_t	cmpl_ring;
42872 	/*
42873 	 * The sequence ID is used by the driver for tracking multiple
42874 	 * commands. This ID is treated as opaque data by the firmware and
42875 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42876 	 */
42877 	uint16_t	seq_id;
42878 	/*
42879 	 * The target ID of the command:
42880 	 * * 0x0-0xFFF8 - The function ID
42881 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42882 	 * * 0xFFFD - Reserved for user-space HWRM interface
42883 	 * * 0xFFFF - HWRM
42884 	 */
42885 	uint16_t	target_id;
42886 	/*
42887 	 * A physical address pointer pointing to a host buffer that the
42888 	 * command's response data will be written. This can be either a host
42889 	 * physical address (HPA) or a guest physical address (GPA) and must
42890 	 * point to a physically contiguous block of memory.
42891 	 */
42892 	uint64_t	resp_addr;
42893 	uint8_t	flags;
42894 	/*
42895 	 * Enumeration denoting the RX, TX type of the resource.
42896 	 * This enumeration is used for resources that are similar for both
42897 	 * TX and RX paths of the chip.
42898 	 */
42899 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
42900 	/* tx path */
42901 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
42902 	/* rx path */
42903 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
42904 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
42905 	/* The meter algorithm type. */
42906 	uint8_t	meter_type;
42907 	/* RFC 2697 (srTCM) */
42908 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
42909 	/* RFC 2698 (trTCM) */
42910 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
42911 	/* RFC 4115 (trTCM) */
42912 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
42913 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST   HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
42914 	/* This value identifies a meter profile in CFA. */
42915 	uint16_t	meter_profile_id;
42916 	/*
42917 	 * A value of 0xfff is considered invalid and implies the
42918 	 * profile is not configured.
42919 	 */
42920 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
42921 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
42922 	/*
42923 	 * This field is reserved for the future use.
42924 	 * It shall be set to 0.
42925 	 */
42926 	uint32_t	reserved;
42927 	/* A meter rate specified in bytes-per-second. */
42928 	uint32_t	commit_rate;
42929 	/* The bandwidth value. */
42930 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
42931 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT		0
42932 	/* The granularity of the value (bits or bytes). */
42933 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE			UINT32_C(0x10000000)
42934 	/* Value is in bits. */
42935 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
42936 	/* Value is in bytes. */
42937 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
42938 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
42939 	/* bw_value_unit is 3 b */
42940 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42941 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT	29
42942 	/* Value is in Mb or MB (base 10). */
42943 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42944 	/* Value is in Kb or KB (base 10). */
42945 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42946 	/* Value is in bits or bytes. */
42947 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42948 	/* Value is in Gb or GB (base 10). */
42949 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42950 	/* Value is in 1/100th of a percentage of total bandwidth. */
42951 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42952 	/* Raw value */
42953 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
42954 		#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
42955 	/* A meter burst size specified in bytes. */
42956 	uint32_t	commit_burst;
42957 	/* The bandwidth value. */
42958 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
42959 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT		0
42960 	/* The granularity of the value (bits or bytes). */
42961 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE			UINT32_C(0x10000000)
42962 	/* Value is in bits. */
42963 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
42964 	/* Value is in bytes. */
42965 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
42966 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
42967 	/* bw_value_unit is 3 b */
42968 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42969 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT	29
42970 	/* Value is in Mb or MB (base 10). */
42971 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
42972 	/* Value is in Kb or KB (base 10). */
42973 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
42974 	/* Value is in bits or bytes. */
42975 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
42976 	/* Value is in Gb or GB (base 10). */
42977 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
42978 	/* Value is in 1/100th of a percentage of total bandwidth. */
42979 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
42980 	/* Invalid value */
42981 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
42982 		#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
42983 	/* A meter rate specified in bytes-per-second. */
42984 	uint32_t	excess_peak_rate;
42985 	/* The bandwidth value. */
42986 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
42987 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT		0
42988 	/* The granularity of the value (bits or bytes). */
42989 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE			UINT32_C(0x10000000)
42990 	/* Value is in bits. */
42991 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
42992 	/* Value is in bytes. */
42993 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
42994 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
42995 	/* bw_value_unit is 3 b */
42996 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
42997 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT	29
42998 	/* Value is in Mb or MB (base 10). */
42999 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
43000 	/* Value is in Kb or KB (base 10). */
43001 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
43002 	/* Value is in bits or bytes. */
43003 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
43004 	/* Value is in Gb or GB (base 10). */
43005 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
43006 	/* Value is in 1/100th of a percentage of total bandwidth. */
43007 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
43008 	/* Raw unit */
43009 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
43010 		#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
43011 	/* A meter burst size specified in bytes. */
43012 	uint32_t	excess_peak_burst;
43013 	/* The bandwidth value. */
43014 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
43015 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT		0
43016 	/* The granularity of the value (bits or bytes). */
43017 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE			UINT32_C(0x10000000)
43018 	/* Value is in bits. */
43019 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
43020 	/* Value is in bytes. */
43021 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
43022 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
43023 	/* bw_value_unit is 3 b */
43024 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
43025 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT	29
43026 	/* Value is in Mb or MB (base 10). */
43027 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
43028 	/* Value is in Kb or KB (base 10). */
43029 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
43030 	/* Value is in bits or bytes. */
43031 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
43032 	/* Value is in Gb or GB (base 10). */
43033 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
43034 	/* Value is in 1/100th of a percentage of total bandwidth. */
43035 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
43036 	/* Invalid unit */
43037 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
43038 		#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
43039 } hwrm_cfa_meter_profile_cfg_input_t, *phwrm_cfa_meter_profile_cfg_input_t;
43040 
43041 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
43042 
43043 typedef struct hwrm_cfa_meter_profile_cfg_output {
43044 	/* The specific error status for the command. */
43045 	uint16_t	error_code;
43046 	/* The HWRM command request type. */
43047 	uint16_t	req_type;
43048 	/* The sequence ID from the original command. */
43049 	uint16_t	seq_id;
43050 	/* The length of the response data in number of bytes. */
43051 	uint16_t	resp_len;
43052 	uint8_t	unused_0[7];
43053 	/*
43054 	 * This field is used in Output records to indicate that the output
43055 	 * is completely written to RAM. This field should be read as '1'
43056 	 * to indicate that the output has been completely written.
43057 	 * When writing a command completion or response to an internal
43058 	 * processor, the order of writes has to be such that this field is
43059 	 * written last.
43060 	 */
43061 	uint8_t	valid;
43062 } hwrm_cfa_meter_profile_cfg_output_t, *phwrm_cfa_meter_profile_cfg_output_t;
43063 
43064 /*********************************
43065  * hwrm_cfa_meter_instance_alloc *
43066  *********************************/
43067 
43068 
43069 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
43070 
43071 typedef struct hwrm_cfa_meter_instance_alloc_input {
43072 	/* The HWRM command request type. */
43073 	uint16_t	req_type;
43074 	/*
43075 	 * The completion ring to send the completion event on. This should
43076 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43077 	 */
43078 	uint16_t	cmpl_ring;
43079 	/*
43080 	 * The sequence ID is used by the driver for tracking multiple
43081 	 * commands. This ID is treated as opaque data by the firmware and
43082 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43083 	 */
43084 	uint16_t	seq_id;
43085 	/*
43086 	 * The target ID of the command:
43087 	 * * 0x0-0xFFF8 - The function ID
43088 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43089 	 * * 0xFFFD - Reserved for user-space HWRM interface
43090 	 * * 0xFFFF - HWRM
43091 	 */
43092 	uint16_t	target_id;
43093 	/*
43094 	 * A physical address pointer pointing to a host buffer that the
43095 	 * command's response data will be written. This can be either a host
43096 	 * physical address (HPA) or a guest physical address (GPA) and must
43097 	 * point to a physically contiguous block of memory.
43098 	 */
43099 	uint64_t	resp_addr;
43100 	uint8_t	flags;
43101 	/*
43102 	 * Enumeration denoting the RX, TX type of the resource.
43103 	 * This enumeration is used for resources that are similar for both
43104 	 * TX and RX paths of the chip.
43105 	 */
43106 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
43107 	/* tx path */
43108 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
43109 	/* rx path */
43110 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
43111 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
43112 	uint8_t	unused_0;
43113 	/* This value identifies a meter profile in CFA. */
43114 	uint16_t	meter_profile_id;
43115 	/*
43116 	 * A value of 0xffff is considered invalid and implies the
43117 	 * profile is not configured.
43118 	 */
43119 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
43120 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
43121 	uint8_t	unused_1[4];
43122 } hwrm_cfa_meter_instance_alloc_input_t, *phwrm_cfa_meter_instance_alloc_input_t;
43123 
43124 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
43125 
43126 typedef struct hwrm_cfa_meter_instance_alloc_output {
43127 	/* The specific error status for the command. */
43128 	uint16_t	error_code;
43129 	/* The HWRM command request type. */
43130 	uint16_t	req_type;
43131 	/* The sequence ID from the original command. */
43132 	uint16_t	seq_id;
43133 	/* The length of the response data in number of bytes. */
43134 	uint16_t	resp_len;
43135 	/* This value identifies a meter instance in CFA. */
43136 	uint16_t	meter_instance_id;
43137 	/*
43138 	 * A value of 0xffff is considered invalid and implies the
43139 	 * instance is not configured.
43140 	 */
43141 	#define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
43142 	#define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
43143 	uint8_t	unused_0[5];
43144 	/*
43145 	 * This field is used in Output records to indicate that the output
43146 	 * is completely written to RAM. This field should be read as '1'
43147 	 * to indicate that the output has been completely written.
43148 	 * When writing a command completion or response to an internal
43149 	 * processor, the order of writes has to be such that this field is
43150 	 * written last.
43151 	 */
43152 	uint8_t	valid;
43153 } hwrm_cfa_meter_instance_alloc_output_t, *phwrm_cfa_meter_instance_alloc_output_t;
43154 
43155 /*******************************
43156  * hwrm_cfa_meter_instance_cfg *
43157  *******************************/
43158 
43159 
43160 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
43161 
43162 typedef struct hwrm_cfa_meter_instance_cfg_input {
43163 	/* The HWRM command request type. */
43164 	uint16_t	req_type;
43165 	/*
43166 	 * The completion ring to send the completion event on. This should
43167 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43168 	 */
43169 	uint16_t	cmpl_ring;
43170 	/*
43171 	 * The sequence ID is used by the driver for tracking multiple
43172 	 * commands. This ID is treated as opaque data by the firmware and
43173 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43174 	 */
43175 	uint16_t	seq_id;
43176 	/*
43177 	 * The target ID of the command:
43178 	 * * 0x0-0xFFF8 - The function ID
43179 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43180 	 * * 0xFFFD - Reserved for user-space HWRM interface
43181 	 * * 0xFFFF - HWRM
43182 	 */
43183 	uint16_t	target_id;
43184 	/*
43185 	 * A physical address pointer pointing to a host buffer that the
43186 	 * command's response data will be written. This can be either a host
43187 	 * physical address (HPA) or a guest physical address (GPA) and must
43188 	 * point to a physically contiguous block of memory.
43189 	 */
43190 	uint64_t	resp_addr;
43191 	uint8_t	flags;
43192 	/*
43193 	 * Enumeration denoting the RX, TX type of the resource.
43194 	 * This enumeration is used for resources that are similar for both
43195 	 * TX and RX paths of the chip.
43196 	 */
43197 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
43198 	/* tx path */
43199 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
43200 	/* rx path */
43201 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
43202 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
43203 	uint8_t	unused_0;
43204 	/*
43205 	 * This value identifies a new meter profile to be associated with
43206 	 * the meter instance specified in this command.
43207 	 */
43208 	uint16_t	meter_profile_id;
43209 	/*
43210 	 * A value of 0xffff is considered invalid and implies the
43211 	 * profile is not configured.
43212 	 */
43213 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
43214 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
43215 	/*
43216 	 * This value identifies the ID of a meter instance that needs to be
43217 	 * updated with a new meter profile specified in this command.
43218 	 */
43219 	uint16_t	meter_instance_id;
43220 	uint8_t	unused_1[2];
43221 } hwrm_cfa_meter_instance_cfg_input_t, *phwrm_cfa_meter_instance_cfg_input_t;
43222 
43223 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
43224 
43225 typedef struct hwrm_cfa_meter_instance_cfg_output {
43226 	/* The specific error status for the command. */
43227 	uint16_t	error_code;
43228 	/* The HWRM command request type. */
43229 	uint16_t	req_type;
43230 	/* The sequence ID from the original command. */
43231 	uint16_t	seq_id;
43232 	/* The length of the response data in number of bytes. */
43233 	uint16_t	resp_len;
43234 	uint8_t	unused_0[7];
43235 	/*
43236 	 * This field is used in Output records to indicate that the output
43237 	 * is completely written to RAM. This field should be read as '1'
43238 	 * to indicate that the output has been completely written.
43239 	 * When writing a command completion or response to an internal
43240 	 * processor, the order of writes has to be such that this field is
43241 	 * written last.
43242 	 */
43243 	uint8_t	valid;
43244 } hwrm_cfa_meter_instance_cfg_output_t, *phwrm_cfa_meter_instance_cfg_output_t;
43245 
43246 /********************************
43247  * hwrm_cfa_meter_instance_free *
43248  ********************************/
43249 
43250 
43251 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
43252 
43253 typedef struct hwrm_cfa_meter_instance_free_input {
43254 	/* The HWRM command request type. */
43255 	uint16_t	req_type;
43256 	/*
43257 	 * The completion ring to send the completion event on. This should
43258 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43259 	 */
43260 	uint16_t	cmpl_ring;
43261 	/*
43262 	 * The sequence ID is used by the driver for tracking multiple
43263 	 * commands. This ID is treated as opaque data by the firmware and
43264 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43265 	 */
43266 	uint16_t	seq_id;
43267 	/*
43268 	 * The target ID of the command:
43269 	 * * 0x0-0xFFF8 - The function ID
43270 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43271 	 * * 0xFFFD - Reserved for user-space HWRM interface
43272 	 * * 0xFFFF - HWRM
43273 	 */
43274 	uint16_t	target_id;
43275 	/*
43276 	 * A physical address pointer pointing to a host buffer that the
43277 	 * command's response data will be written. This can be either a host
43278 	 * physical address (HPA) or a guest physical address (GPA) and must
43279 	 * point to a physically contiguous block of memory.
43280 	 */
43281 	uint64_t	resp_addr;
43282 	uint8_t	flags;
43283 	/*
43284 	 * Enumeration denoting the RX, TX type of the resource.
43285 	 * This enumeration is used for resources that are similar for both
43286 	 * TX and RX paths of the chip.
43287 	 */
43288 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
43289 	/* tx path */
43290 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
43291 	/* rx path */
43292 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
43293 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
43294 	uint8_t	unused_0;
43295 	/* This value identifies a meter instance in CFA. */
43296 	uint16_t	meter_instance_id;
43297 	/*
43298 	 * A value of 0xfff is considered invalid and implies the
43299 	 * instance is not configured.
43300 	 */
43301 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
43302 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
43303 	uint8_t	unused_1[4];
43304 } hwrm_cfa_meter_instance_free_input_t, *phwrm_cfa_meter_instance_free_input_t;
43305 
43306 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
43307 
43308 typedef struct hwrm_cfa_meter_instance_free_output {
43309 	/* The specific error status for the command. */
43310 	uint16_t	error_code;
43311 	/* The HWRM command request type. */
43312 	uint16_t	req_type;
43313 	/* The sequence ID from the original command. */
43314 	uint16_t	seq_id;
43315 	/* The length of the response data in number of bytes. */
43316 	uint16_t	resp_len;
43317 	uint8_t	unused_0[7];
43318 	/*
43319 	 * This field is used in Output records to indicate that the output
43320 	 * is completely written to RAM. This field should be read as '1'
43321 	 * to indicate that the output has been completely written.
43322 	 * When writing a command completion or response to an internal
43323 	 * processor, the order of writes has to be such that this field is
43324 	 * written last.
43325 	 */
43326 	uint8_t	valid;
43327 } hwrm_cfa_meter_instance_free_output_t, *phwrm_cfa_meter_instance_free_output_t;
43328 
43329 /*******************************
43330  * hwrm_cfa_decap_filter_alloc *
43331  *******************************/
43332 
43333 
43334 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
43335 
43336 typedef struct hwrm_cfa_decap_filter_alloc_input {
43337 	/* The HWRM command request type. */
43338 	uint16_t	req_type;
43339 	/*
43340 	 * The completion ring to send the completion event on. This should
43341 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43342 	 */
43343 	uint16_t	cmpl_ring;
43344 	/*
43345 	 * The sequence ID is used by the driver for tracking multiple
43346 	 * commands. This ID is treated as opaque data by the firmware and
43347 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43348 	 */
43349 	uint16_t	seq_id;
43350 	/*
43351 	 * The target ID of the command:
43352 	 * * 0x0-0xFFF8 - The function ID
43353 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43354 	 * * 0xFFFD - Reserved for user-space HWRM interface
43355 	 * * 0xFFFF - HWRM
43356 	 */
43357 	uint16_t	target_id;
43358 	/*
43359 	 * A physical address pointer pointing to a host buffer that the
43360 	 * command's response data will be written. This can be either a host
43361 	 * physical address (HPA) or a guest physical address (GPA) and must
43362 	 * point to a physically contiguous block of memory.
43363 	 */
43364 	uint64_t	resp_addr;
43365 	uint32_t	flags;
43366 	/* ovs_tunnel is 1 b */
43367 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL	UINT32_C(0x1)
43368 	uint32_t	enables;
43369 	/*
43370 	 * This bit must be '1' for the tunnel_type field to be
43371 	 * configured.
43372 	 */
43373 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x1)
43374 	/*
43375 	 * This bit must be '1' for the tunnel_id field to be
43376 	 * configured.
43377 	 */
43378 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID	UINT32_C(0x2)
43379 	/*
43380 	 * This bit must be '1' for the src_macaddr field to be
43381 	 * configured.
43382 	 */
43383 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x4)
43384 	/*
43385 	 * This bit must be '1' for the dst_macaddr field to be
43386 	 * configured.
43387 	 */
43388 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x8)
43389 	/*
43390 	 * This bit must be '1' for the ovlan_vid field to be
43391 	 * configured.
43392 	 */
43393 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID	UINT32_C(0x10)
43394 	/*
43395 	 * This bit must be '1' for the ivlan_vid field to be
43396 	 * configured.
43397 	 */
43398 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID	UINT32_C(0x20)
43399 	/*
43400 	 * This bit must be '1' for the t_ovlan_vid field to be
43401 	 * configured.
43402 	 */
43403 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID	UINT32_C(0x40)
43404 	/*
43405 	 * This bit must be '1' for the t_ivlan_vid field to be
43406 	 * configured.
43407 	 */
43408 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID	UINT32_C(0x80)
43409 	/*
43410 	 * This bit must be '1' for the ethertype field to be
43411 	 * configured.
43412 	 */
43413 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE	UINT32_C(0x100)
43414 	/*
43415 	 * This bit must be '1' for the src_ipaddr field to be
43416 	 * configured.
43417 	 */
43418 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x200)
43419 	/*
43420 	 * This bit must be '1' for the dst_ipaddr field to be
43421 	 * configured.
43422 	 */
43423 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x400)
43424 	/*
43425 	 * This bit must be '1' for the ipaddr_type field to be
43426 	 * configured.
43427 	 */
43428 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x800)
43429 	/*
43430 	 * This bit must be '1' for the ip_protocol field to be
43431 	 * configured.
43432 	 */
43433 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x1000)
43434 	/*
43435 	 * This bit must be '1' for the src_port field to be
43436 	 * configured.
43437 	 */
43438 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT	UINT32_C(0x2000)
43439 	/*
43440 	 * This bit must be '1' for the dst_port field to be
43441 	 * configured.
43442 	 */
43443 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT	UINT32_C(0x4000)
43444 	/*
43445 	 * This bit must be '1' for the dst_id field to be
43446 	 * configured.
43447 	 */
43448 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x8000)
43449 	/*
43450 	 * This bit must be '1' for the mirror_vnic_id field to be
43451 	 * configured.
43452 	 */
43453 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x10000)
43454 	/*
43455 	 * Tunnel identifier.
43456 	 * Virtual Network Identifier (VNI). Only valid with
43457 	 * tunnel_types VXLAN, NVGRE, and Geneve.
43458 	 * Only lower 24-bits of VNI field are used
43459 	 * in setting up the filter.
43460 	 */
43461 	uint32_t	tunnel_id;
43462 	/* Tunnel Type. */
43463 	uint8_t	tunnel_type;
43464 	/* Non-tunnel */
43465 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
43466 	/* Virtual eXtensible Local Area Network (VXLAN) */
43467 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
43468 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
43469 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
43470 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
43471 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
43472 	/* IP in IP */
43473 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
43474 	/* Generic Network Virtualization Encapsulation (Geneve) */
43475 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
43476 	/* Multi-Protocol Label Switching (MPLS) */
43477 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
43478 	/* Stateless Transport Tunnel (STT) */
43479 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
43480 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
43481 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
43482 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
43483 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
43484 	/*
43485 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
43486 	 * datagram payload
43487 	 */
43488 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
43489 	/* Use fixed layer 2 ether type of 0xFFFF */
43490 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
43491 	/*
43492 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
43493 	 * (IPV6oVXLANGPE)
43494 	 */
43495 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
43496 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
43497 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
43498 	/* Any tunneled traffic */
43499 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
43500 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
43501 	uint8_t	unused_0;
43502 	uint16_t	unused_1;
43503 	/*
43504 	 * This value indicates the source MAC address in
43505 	 * the Ethernet header.
43506 	 */
43507 	uint8_t	src_macaddr[6];
43508 	uint8_t	unused_2[2];
43509 	/*
43510 	 * This value indicates the destination MAC address in
43511 	 * the Ethernet header.
43512 	 */
43513 	uint8_t	dst_macaddr[6];
43514 	/*
43515 	 * This value indicates the VLAN ID of the outer VLAN tag
43516 	 * in the Ethernet header.
43517 	 */
43518 	uint16_t	ovlan_vid;
43519 	/*
43520 	 * This value indicates the VLAN ID of the inner VLAN tag
43521 	 * in the Ethernet header.
43522 	 */
43523 	uint16_t	ivlan_vid;
43524 	/*
43525 	 * This value indicates the VLAN ID of the outer VLAN tag
43526 	 * in the tunnel Ethernet header.
43527 	 */
43528 	uint16_t	t_ovlan_vid;
43529 	/*
43530 	 * This value indicates the VLAN ID of the inner VLAN tag
43531 	 * in the tunnel Ethernet header.
43532 	 */
43533 	uint16_t	t_ivlan_vid;
43534 	/* This value indicates the ethertype in the Ethernet header. */
43535 	uint16_t	ethertype;
43536 	/*
43537 	 * This value indicates the type of IP address.
43538 	 * 4 - IPv4
43539 	 * 6 - IPv6
43540 	 * All others are invalid.
43541 	 */
43542 	uint8_t	ip_addr_type;
43543 	/* invalid */
43544 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
43545 	/* IPv4 */
43546 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
43547 	/* IPv6 */
43548 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
43549 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
43550 	/*
43551 	 * The value of protocol filed in IP header.
43552 	 * Applies to UDP and TCP traffic.
43553 	 * 6 - TCP
43554 	 * 17 - UDP
43555 	 */
43556 	uint8_t	ip_protocol;
43557 	/* invalid */
43558 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
43559 	/* TCP */
43560 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
43561 	/* UDP */
43562 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
43563 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
43564 	uint16_t	unused_3;
43565 	uint32_t	unused_4;
43566 	/*
43567 	 * The value of source IP address to be used in filtering.
43568 	 * For IPv4, first four bytes represent the IP address.
43569 	 */
43570 	uint32_t	src_ipaddr[4];
43571 	/*
43572 	 * The value of destination IP address to be used in filtering.
43573 	 * For IPv4, first four bytes represent the IP address.
43574 	 */
43575 	uint32_t	dst_ipaddr[4];
43576 	/*
43577 	 * The value of source port to be used in filtering.
43578 	 * Applies to UDP and TCP traffic.
43579 	 */
43580 	uint16_t	src_port;
43581 	/*
43582 	 * The value of destination port to be used in filtering.
43583 	 * Applies to UDP and TCP traffic.
43584 	 */
43585 	uint16_t	dst_port;
43586 	/*
43587 	 * If set, this value shall represent the
43588 	 * Logical VNIC ID of the destination VNIC for the RX
43589 	 * path.
43590 	 */
43591 	uint16_t	dst_id;
43592 	/*
43593 	 * If set, this value shall represent the L2 context that matches the
43594 	 * L2 information of the decap filter.
43595 	 */
43596 	uint16_t	l2_ctxt_ref_id;
43597 } hwrm_cfa_decap_filter_alloc_input_t, *phwrm_cfa_decap_filter_alloc_input_t;
43598 
43599 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
43600 
43601 typedef struct hwrm_cfa_decap_filter_alloc_output {
43602 	/* The specific error status for the command. */
43603 	uint16_t	error_code;
43604 	/* The HWRM command request type. */
43605 	uint16_t	req_type;
43606 	/* The sequence ID from the original command. */
43607 	uint16_t	seq_id;
43608 	/* The length of the response data in number of bytes. */
43609 	uint16_t	resp_len;
43610 	/* This value is an opaque id into CFA data structures. */
43611 	uint32_t	decap_filter_id;
43612 	uint8_t	unused_0[3];
43613 	/*
43614 	 * This field is used in Output records to indicate that the output
43615 	 * is completely written to RAM. This field should be read as '1'
43616 	 * to indicate that the output has been completely written.
43617 	 * When writing a command completion or response to an internal
43618 	 * processor, the order of writes has to be such that this field is
43619 	 * written last.
43620 	 */
43621 	uint8_t	valid;
43622 } hwrm_cfa_decap_filter_alloc_output_t, *phwrm_cfa_decap_filter_alloc_output_t;
43623 
43624 /******************************
43625  * hwrm_cfa_decap_filter_free *
43626  ******************************/
43627 
43628 
43629 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
43630 
43631 typedef struct hwrm_cfa_decap_filter_free_input {
43632 	/* The HWRM command request type. */
43633 	uint16_t	req_type;
43634 	/*
43635 	 * The completion ring to send the completion event on. This should
43636 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43637 	 */
43638 	uint16_t	cmpl_ring;
43639 	/*
43640 	 * The sequence ID is used by the driver for tracking multiple
43641 	 * commands. This ID is treated as opaque data by the firmware and
43642 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43643 	 */
43644 	uint16_t	seq_id;
43645 	/*
43646 	 * The target ID of the command:
43647 	 * * 0x0-0xFFF8 - The function ID
43648 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43649 	 * * 0xFFFD - Reserved for user-space HWRM interface
43650 	 * * 0xFFFF - HWRM
43651 	 */
43652 	uint16_t	target_id;
43653 	/*
43654 	 * A physical address pointer pointing to a host buffer that the
43655 	 * command's response data will be written. This can be either a host
43656 	 * physical address (HPA) or a guest physical address (GPA) and must
43657 	 * point to a physically contiguous block of memory.
43658 	 */
43659 	uint64_t	resp_addr;
43660 	/* This value is an opaque id into CFA data structures. */
43661 	uint32_t	decap_filter_id;
43662 	uint8_t	unused_0[4];
43663 } hwrm_cfa_decap_filter_free_input_t, *phwrm_cfa_decap_filter_free_input_t;
43664 
43665 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
43666 
43667 typedef struct hwrm_cfa_decap_filter_free_output {
43668 	/* The specific error status for the command. */
43669 	uint16_t	error_code;
43670 	/* The HWRM command request type. */
43671 	uint16_t	req_type;
43672 	/* The sequence ID from the original command. */
43673 	uint16_t	seq_id;
43674 	/* The length of the response data in number of bytes. */
43675 	uint16_t	resp_len;
43676 	uint8_t	unused_0[7];
43677 	/*
43678 	 * This field is used in Output records to indicate that the output
43679 	 * is completely written to RAM. This field should be read as '1'
43680 	 * to indicate that the output has been completely written.
43681 	 * When writing a command completion or response to an internal
43682 	 * processor, the order of writes has to be such that this field is
43683 	 * written last.
43684 	 */
43685 	uint8_t	valid;
43686 } hwrm_cfa_decap_filter_free_output_t, *phwrm_cfa_decap_filter_free_output_t;
43687 
43688 /***********************
43689  * hwrm_cfa_flow_alloc *
43690  ***********************/
43691 
43692 
43693 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
43694 
43695 typedef struct hwrm_cfa_flow_alloc_input {
43696 	/* The HWRM command request type. */
43697 	uint16_t	req_type;
43698 	/*
43699 	 * The completion ring to send the completion event on. This should
43700 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43701 	 */
43702 	uint16_t	cmpl_ring;
43703 	/*
43704 	 * The sequence ID is used by the driver for tracking multiple
43705 	 * commands. This ID is treated as opaque data by the firmware and
43706 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43707 	 */
43708 	uint16_t	seq_id;
43709 	/*
43710 	 * The target ID of the command:
43711 	 * * 0x0-0xFFF8 - The function ID
43712 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43713 	 * * 0xFFFD - Reserved for user-space HWRM interface
43714 	 * * 0xFFFF - HWRM
43715 	 */
43716 	uint16_t	target_id;
43717 	/*
43718 	 * A physical address pointer pointing to a host buffer that the
43719 	 * command's response data will be written. This can be either a host
43720 	 * physical address (HPA) or a guest physical address (GPA) and must
43721 	 * point to a physically contiguous block of memory.
43722 	 */
43723 	uint64_t	resp_addr;
43724 	uint16_t	flags;
43725 	/* tunnel is 1 b */
43726 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL		UINT32_C(0x1)
43727 	/* num_vlan is 2 b */
43728 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK	UINT32_C(0x6)
43729 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT	1
43730 	/* no tags */
43731 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE		(UINT32_C(0x0) << 1)
43732 	/* 1 tag */
43733 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE		(UINT32_C(0x1) << 1)
43734 	/* 2 tags */
43735 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO		(UINT32_C(0x2) << 1)
43736 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
43737 	/* Enumeration denoting the Flow Type. */
43738 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK	UINT32_C(0x38)
43739 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT	3
43740 	/* L2 flow */
43741 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2		(UINT32_C(0x0) << 3)
43742 	/* IPV4 flow */
43743 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4		(UINT32_C(0x1) << 3)
43744 	/* IPV6 flow */
43745 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6		(UINT32_C(0x2) << 3)
43746 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
43747 	/*
43748 	 * when set to 1, indicates TX flow offload for function specified
43749 	 * in src_fid and the dst_fid should be set to invalid value. To
43750 	 * indicate a VM to VM flow, both of the path_tx and path_rx flags
43751 	 * need to be set. For virtio vSwitch offload case, the src_fid and
43752 	 * dst_fid is set to the same fid value. For the SRIOV vSwitch
43753 	 * offload case, the src_fid and dst_fid must be set to the same VF
43754 	 * FID belong to the children VFs of the same PF to indicate VM to
43755 	 * VM flow.
43756 	 */
43757 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX		UINT32_C(0x40)
43758 	/*
43759 	 * when set to 1, indicates RX flow offload for function specified
43760 	 * in dst_fid and the src_fid should be set to invalid value.
43761 	 */
43762 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX		UINT32_C(0x80)
43763 	/*
43764 	 * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan
43765 	 * header is required and the VXLAN VNI value is stored in the first
43766 	 * 24 bits of the dmac field. This flag is only valid when the flow
43767 	 * direction is RX.
43768 	 */
43769 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI	UINT32_C(0x100)
43770 	/*
43771 	 * Set to 1 to indicate vhost_id is specified in the outer_vlan_tci
43772 	 * field.
43773 	 */
43774 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN	UINT32_C(0x200)
43775 	/*
43776 	 * Tx Flow: vf fid.
43777 	 * Rx Flow: pf fid.
43778 	 */
43779 	uint16_t	src_fid;
43780 	/* Tunnel handle valid when tunnel flag is set. */
43781 	uint32_t	tunnel_handle;
43782 	uint16_t	action_flags;
43783 	/*
43784 	 * Setting of this flag indicates drop action. If this flag is not
43785 	 * set, then it should be considered accept action.
43786 	 */
43787 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD			UINT32_C(0x1)
43788 	/* recycle is 1 b */
43789 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE		UINT32_C(0x2)
43790 	/*
43791 	 * Setting of this flag indicates drop action. If this flag is not
43792 	 * set, then it should be considered accept action.
43793 	 */
43794 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP			UINT32_C(0x4)
43795 	/* meter is 1 b */
43796 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER			UINT32_C(0x8)
43797 	/* tunnel is 1 b */
43798 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL			UINT32_C(0x10)
43799 	/* nat_src is 1 b */
43800 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC		UINT32_C(0x20)
43801 	/* nat_dest is 1 b */
43802 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST		UINT32_C(0x40)
43803 	/* nat_ipv4_address is 1 b */
43804 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS	UINT32_C(0x80)
43805 	/* l2_header_rewrite is 1 b */
43806 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE	UINT32_C(0x100)
43807 	/* ttl_decrement is 1 b */
43808 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT		UINT32_C(0x200)
43809 	/*
43810 	 * If set to 1 and flow direction is TX, it indicates decap of L2
43811 	 * header and encap of tunnel header. If set to 1 and flow direction
43812 	 * is RX, it indicates decap of tunnel header and encap L2 header.
43813 	 * The type of tunnel is specified in the tunnel_type field.
43814 	 */
43815 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP		UINT32_C(0x400)
43816 	/* If set to 1, flow aging is enabled for this flow. */
43817 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED	UINT32_C(0x800)
43818 	/*
43819 	 * If set to 1 an attempt will be made to try to offload this flow
43820 	 * to the most optimal flow table resource. If set to 0, the flow
43821 	 * will be placed to the default flow table resource.
43822 	 */
43823 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT		UINT32_C(0x1000)
43824 	/*
43825 	 * If set to 1 there will be no attempt to allocate an on-chip try
43826 	 * to offload this flow. If set to 0, which will keep compatibility
43827 	 * with the older drivers, will cause the FW to attempt to allocate
43828 	 * an on-chip flow counter for the newly created flow. This will
43829 	 * keep the existing behavior with EM flows which always had an
43830 	 * associated flow counter.
43831 	 */
43832 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC	UINT32_C(0x2000)
43833 	/*
43834 	 * Tx Flow: pf or vf fid.
43835 	 * Rx Flow: vf fid.
43836 	 */
43837 	uint16_t	dst_fid;
43838 	/* VLAN tpid, valid when push_vlan flag is set. */
43839 	uint16_t	l2_rewrite_vlan_tpid;
43840 	/* VLAN tci, valid when push_vlan flag is set. */
43841 	uint16_t	l2_rewrite_vlan_tci;
43842 	/* Meter id, valid when meter flag is set. */
43843 	uint16_t	act_meter_id;
43844 	/* Flow with the same l2 context tcam key. */
43845 	uint16_t	ref_flow_handle;
43846 	/* This value sets the match value for the ethertype. */
43847 	uint16_t	ethertype;
43848 	/* valid when num tags is 1 or 2. */
43849 	uint16_t	outer_vlan_tci;
43850 	/* This value sets the match value for the Destination MAC address. */
43851 	uint16_t	dmac[3];
43852 	/* valid when num tags is 2. */
43853 	uint16_t	inner_vlan_tci;
43854 	/* This value sets the match value for the Source MAC address. */
43855 	uint16_t	smac[3];
43856 	/* The bit length of destination IP address mask. */
43857 	uint8_t	ip_dst_mask_len;
43858 	/* The bit length of source IP address mask. */
43859 	uint8_t	ip_src_mask_len;
43860 	/* The value of destination IPv4/IPv6 address. */
43861 	uint32_t	ip_dst[4];
43862 	/* The source IPv4/IPv6 address. */
43863 	uint32_t	ip_src[4];
43864 	/*
43865 	 * The value of source port.
43866 	 * Applies to UDP and TCP traffic.
43867 	 */
43868 	uint16_t	l4_src_port;
43869 	/*
43870 	 * The value of source port mask.
43871 	 * Applies to UDP and TCP traffic.
43872 	 */
43873 	uint16_t	l4_src_port_mask;
43874 	/*
43875 	 * The value of destination port.
43876 	 * Applies to UDP and TCP traffic.
43877 	 */
43878 	uint16_t	l4_dst_port;
43879 	/*
43880 	 * The value of destination port mask.
43881 	 * Applies to UDP and TCP traffic.
43882 	 */
43883 	uint16_t	l4_dst_port_mask;
43884 	/*
43885 	 * NAT IPv4/6 address based on address type flag.
43886 	 * 0 values are ignored.
43887 	 */
43888 	uint32_t	nat_ip_address[4];
43889 	/* L2 header re-write Destination MAC address. */
43890 	uint16_t	l2_rewrite_dmac[3];
43891 	/*
43892 	 * The NAT source/destination port based on direction flag.
43893 	 * Applies to UDP and TCP traffic.
43894 	 * 0 values are ignored.
43895 	 */
43896 	uint16_t	nat_port;
43897 	/* L2 header re-write Source MAC address. */
43898 	uint16_t	l2_rewrite_smac[3];
43899 	/* The value of ip protocol. */
43900 	uint8_t	ip_proto;
43901 	/* Tunnel Type. */
43902 	uint8_t	tunnel_type;
43903 	/* Non-tunnel */
43904 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
43905 	/* Virtual eXtensible Local Area Network (VXLAN) */
43906 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
43907 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
43908 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
43909 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
43910 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
43911 	/* IP in IP */
43912 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
43913 	/* Generic Network Virtualization Encapsulation (Geneve) */
43914 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
43915 	/* Multi-Protocol Label Switching (MPLS) */
43916 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
43917 	/* Stateless Transport Tunnel (STT) */
43918 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
43919 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
43920 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
43921 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
43922 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
43923 	/*
43924 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
43925 	 * datagram payload
43926 	 */
43927 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
43928 	/* Use fixed layer 2 ether type of 0xFFFF */
43929 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
43930 	/*
43931 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
43932 	 * (IPV6oVXLANGPE)
43933 	 */
43934 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
43935 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
43936 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
43937 	/* Any tunneled traffic */
43938 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
43939 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
43940 } hwrm_cfa_flow_alloc_input_t, *phwrm_cfa_flow_alloc_input_t;
43941 
43942 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
43943 
43944 typedef struct hwrm_cfa_flow_alloc_output {
43945 	/* The specific error status for the command. */
43946 	uint16_t	error_code;
43947 	/* The HWRM command request type. */
43948 	uint16_t	req_type;
43949 	/* The sequence ID from the original command. */
43950 	uint16_t	seq_id;
43951 	/* The length of the response data in number of bytes. */
43952 	uint16_t	resp_len;
43953 	/* Flow record index. */
43954 	uint16_t	flow_handle;
43955 	uint8_t	unused_0[2];
43956 	/*
43957 	 * The flow id value in bit 0-29 is the actual ID of the flow
43958 	 * associated with this filter and it shall be used to match
43959 	 * and associate the flow identifier returned in completion
43960 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
43961 	 * shall indicate no valid flow id.
43962 	 */
43963 	uint32_t	flow_id;
43964 	/* Indicate the flow id value. */
43965 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
43966 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
43967 	/* Indicate type of the flow. */
43968 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
43969 	/*
43970 	 * If this bit set to 0, then it indicates that the flow is
43971 	 * internal flow.
43972 	 */
43973 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
43974 	/*
43975 	 * If this bit is set to 1, then it indicates that the flow is
43976 	 * external flow.
43977 	 */
43978 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
43979 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
43980 	/* Indicate the flow direction. */
43981 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
43982 	/* If this bit set to 0, then it indicates rx flow. */
43983 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
43984 	/* If this bit is set to 1, then it indicates that tx flow. */
43985 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
43986 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
43987 	/* This value identifies a set of CFA data structures used for a flow. */
43988 	uint64_t	ext_flow_handle;
43989 	uint32_t	flow_counter_id;
43990 	uint8_t	unused_1[3];
43991 	/*
43992 	 * This field is used in Output records to indicate that the output
43993 	 * is completely written to RAM. This field should be read as '1'
43994 	 * to indicate that the output has been completely written.
43995 	 * When writing a command completion or response to an internal
43996 	 * processor, the order of writes has to be such that this field is
43997 	 * written last.
43998 	 */
43999 	uint8_t	valid;
44000 } hwrm_cfa_flow_alloc_output_t, *phwrm_cfa_flow_alloc_output_t;
44001 
44002 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
44003 
44004 typedef struct hwrm_cfa_flow_alloc_cmd_err {
44005 	/*
44006 	 * command specific error codes that goes to
44007 	 * the cmd_err field in Common HWRM Error Response.
44008 	 */
44009 	uint8_t	code;
44010 	/* Unknown error */
44011 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
44012 	/* No more L2 Context TCAM */
44013 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
44014 	/* No more action records */
44015 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
44016 	/* No more flow counters */
44017 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER	UINT32_C(0x3)
44018 	/* No more wild-card TCAM */
44019 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
44020 	/* Hash collision in exact match tables */
44021 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
44022 	/* Key is already installed */
44023 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS	UINT32_C(0x6)
44024 	/* Flow Context DB is out of resource */
44025 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB	UINT32_C(0x7)
44026 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST	HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
44027 	uint8_t	unused_0[7];
44028 } hwrm_cfa_flow_alloc_cmd_err_t, *phwrm_cfa_flow_alloc_cmd_err_t;
44029 
44030 /**********************
44031  * hwrm_cfa_flow_free *
44032  **********************/
44033 
44034 
44035 /* hwrm_cfa_flow_free_input (size:256b/32B) */
44036 
44037 typedef struct hwrm_cfa_flow_free_input {
44038 	/* The HWRM command request type. */
44039 	uint16_t	req_type;
44040 	/*
44041 	 * The completion ring to send the completion event on. This should
44042 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44043 	 */
44044 	uint16_t	cmpl_ring;
44045 	/*
44046 	 * The sequence ID is used by the driver for tracking multiple
44047 	 * commands. This ID is treated as opaque data by the firmware and
44048 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44049 	 */
44050 	uint16_t	seq_id;
44051 	/*
44052 	 * The target ID of the command:
44053 	 * * 0x0-0xFFF8 - The function ID
44054 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44055 	 * * 0xFFFD - Reserved for user-space HWRM interface
44056 	 * * 0xFFFF - HWRM
44057 	 */
44058 	uint16_t	target_id;
44059 	/*
44060 	 * A physical address pointer pointing to a host buffer that the
44061 	 * command's response data will be written. This can be either a host
44062 	 * physical address (HPA) or a guest physical address (GPA) and must
44063 	 * point to a physically contiguous block of memory.
44064 	 */
44065 	uint64_t	resp_addr;
44066 	/* Flow record index. */
44067 	uint16_t	flow_handle;
44068 	uint16_t	unused_0;
44069 	/* Flow counter id to be freed. */
44070 	uint32_t	flow_counter_id;
44071 	/* This value identifies a set of CFA data structures used for a flow. */
44072 	uint64_t	ext_flow_handle;
44073 } hwrm_cfa_flow_free_input_t, *phwrm_cfa_flow_free_input_t;
44074 
44075 /* hwrm_cfa_flow_free_output (size:256b/32B) */
44076 
44077 typedef struct hwrm_cfa_flow_free_output {
44078 	/* The specific error status for the command. */
44079 	uint16_t	error_code;
44080 	/* The HWRM command request type. */
44081 	uint16_t	req_type;
44082 	/* The sequence ID from the original command. */
44083 	uint16_t	seq_id;
44084 	/* The length of the response data in number of bytes. */
44085 	uint16_t	resp_len;
44086 	/* packet is 64 b */
44087 	uint64_t	packet;
44088 	/* byte is 64 b */
44089 	uint64_t	byte;
44090 	uint8_t	unused_0[7];
44091 	/*
44092 	 * This field is used in Output records to indicate that the output
44093 	 * is completely written to RAM. This field should be read as '1'
44094 	 * to indicate that the output has been completely written.
44095 	 * When writing a command completion or response to an internal
44096 	 * processor, the order of writes has to be such that this field is
44097 	 * written last.
44098 	 */
44099 	uint8_t	valid;
44100 } hwrm_cfa_flow_free_output_t, *phwrm_cfa_flow_free_output_t;
44101 
44102 /* hwrm_cfa_flow_action_data (size:960b/120B) */
44103 
44104 typedef struct hwrm_cfa_flow_action_data {
44105 	uint16_t	action_flags;
44106 	/* Setting of this flag indicates accept action. */
44107 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD			UINT32_C(0x1)
44108 	/* Setting of this flag indicates recycle action. */
44109 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE		UINT32_C(0x2)
44110 	/* Setting of this flag indicates drop action. */
44111 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP		UINT32_C(0x4)
44112 	/* Setting of this flag indicates meter action. */
44113 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER		UINT32_C(0x8)
44114 	/* Setting of this flag indicates tunnel action. */
44115 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL		UINT32_C(0x10)
44116 	/*
44117 	 * If set to 1 and flow direction is TX, it indicates decap of L2
44118 	 * header and encap of tunnel header. If set to 1 and flow direction
44119 	 * is RX, it indicates decap of tunnel header and encap L2 header.
44120 	 */
44121 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP		UINT32_C(0x20)
44122 	/* Setting of this flag indicates ttl decrement action. */
44123 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT	UINT32_C(0x40)
44124 	/* If set to 1, flow aging is enabled for this flow. */
44125 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED	UINT32_C(0x80)
44126 	/* Setting of this flag indicates encap action. */
44127 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP		UINT32_C(0x100)
44128 	/* Setting of this flag indicates decap action. */
44129 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP		UINT32_C(0x200)
44130 	/* Meter id. */
44131 	uint16_t	act_meter_id;
44132 	/* VNIC id. */
44133 	uint16_t	vnic_id;
44134 	/* vport number. */
44135 	uint16_t	vport_id;
44136 	/* The NAT source/destination. */
44137 	uint16_t	nat_port;
44138 	uint16_t	unused_0[3];
44139 	/* NAT IPv4/IPv6 address. */
44140 	uint32_t	nat_ip_address[4];
44141 	/* Encapsulation Type. */
44142 	uint8_t	encap_type;
44143 	/* Virtual eXtensible Local Area Network (VXLAN) */
44144 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN	UINT32_C(0x1)
44145 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
44146 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE	UINT32_C(0x2)
44147 	/* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
44148 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE	UINT32_C(0x3)
44149 	/* IP in IP */
44150 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP	UINT32_C(0x4)
44151 	/* Generic Network Virtualization Encapsulation (Geneve) */
44152 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE	UINT32_C(0x5)
44153 	/* Multi-Protocol Label Switching (MPLS) */
44154 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS	UINT32_C(0x6)
44155 	/* VLAN */
44156 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN	UINT32_C(0x7)
44157 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
44158 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE	UINT32_C(0x8)
44159 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44160 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4	UINT32_C(0x9)
44161 	/*
44162 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
44163 	 * datagram payload
44164 	 */
44165 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1	UINT32_C(0xa)
44166 	/* Use fixed layer 2 ether type of 0xFFFF */
44167 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE	UINT32_C(0xb)
44168 	/*
44169 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
44170 	 * (IPV6oVXLANGPE)
44171 	 */
44172 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
44173 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
44174 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE	UINT32_C(0x10)
44175 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST	HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE
44176 	uint8_t	unused[7];
44177 	/* This value is encap data for the associated encap type. */
44178 	uint32_t	encap_data[20];
44179 } hwrm_cfa_flow_action_data_t, *phwrm_cfa_flow_action_data_t;
44180 
44181 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
44182 
44183 typedef struct hwrm_cfa_flow_tunnel_hdr_data {
44184 	/* Tunnel Type. */
44185 	uint8_t	tunnel_type;
44186 	/* Non-tunnel */
44187 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
44188 	/* Virtual eXtensible Local Area Network (VXLAN) */
44189 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
44190 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
44191 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
44192 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
44193 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
44194 	/* IP in IP */
44195 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
44196 	/* Generic Network Virtualization Encapsulation (Geneve) */
44197 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
44198 	/* Multi-Protocol Label Switching (MPLS) */
44199 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
44200 	/* Stateless Transport Tunnel (STT) */
44201 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT	UINT32_C(0x7)
44202 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
44203 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
44204 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44205 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
44206 	/*
44207 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
44208 	 * datagram payload
44209 	 */
44210 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
44211 	/* Use fixed layer 2 ether type of 0xFFFF */
44212 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
44213 	/*
44214 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
44215 	 * (IPV6oVXLANGPE)
44216 	 */
44217 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
44218 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
44219 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
44220 	/* Any tunneled traffic */
44221 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
44222 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST	HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
44223 	uint8_t	unused[3];
44224 	/*
44225 	 * Tunnel identifier.
44226 	 * Virtual Network Identifier (VNI).
44227 	 */
44228 	uint32_t	tunnel_id;
44229 } hwrm_cfa_flow_tunnel_hdr_data_t, *phwrm_cfa_flow_tunnel_hdr_data_t;
44230 
44231 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
44232 
44233 typedef struct hwrm_cfa_flow_l4_key_data {
44234 	/* The value of source port. */
44235 	uint16_t	l4_src_port;
44236 	/* The value of destination port. */
44237 	uint16_t	l4_dst_port;
44238 	uint32_t	unused;
44239 } hwrm_cfa_flow_l4_key_data_t, *phwrm_cfa_flow_l4_key_data_t;
44240 
44241 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
44242 
44243 typedef struct hwrm_cfa_flow_l3_key_data {
44244 	/* The value of ip protocol. */
44245 	uint8_t	ip_protocol;
44246 	uint8_t	unused_0[7];
44247 	/* The value of destination IPv4/IPv6 address. */
44248 	uint32_t	ip_dst[4];
44249 	/* The source IPv4/IPv6 address. */
44250 	uint32_t	ip_src[4];
44251 	/* NAT IPv4/IPv6 address. */
44252 	uint32_t	nat_ip_address[4];
44253 	uint64_t	unused;
44254 } hwrm_cfa_flow_l3_key_data_t, *phwrm_cfa_flow_l3_key_data_t;
44255 
44256 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
44257 
44258 typedef struct hwrm_cfa_flow_l2_key_data {
44259 	/* Destination MAC address. */
44260 	uint16_t	dmac[3];
44261 	uint16_t	unused_0;
44262 	/* Source MAC address. */
44263 	uint16_t	smac[3];
44264 	uint16_t	unused_1;
44265 	/* L2 header re-write Destination MAC address. */
44266 	uint16_t	l2_rewrite_dmac[3];
44267 	uint16_t	unused_2;
44268 	/* L2 header re-write Source MAC address. */
44269 	uint16_t	l2_rewrite_smac[3];
44270 	/* Ethertype. */
44271 	uint16_t	ethertype;
44272 	/* Number of VLAN tags. */
44273 	uint16_t	num_vlan_tags;
44274 	/* VLAN tpid. */
44275 	uint16_t	l2_rewrite_vlan_tpid;
44276 	/* VLAN tci. */
44277 	uint16_t	l2_rewrite_vlan_tci;
44278 	uint8_t	unused_3[2];
44279 	/* Outer VLAN TPID. */
44280 	uint16_t	ovlan_tpid;
44281 	/* Outer VLAN TCI. */
44282 	uint16_t	ovlan_tci;
44283 	/* Inner VLAN TPID. */
44284 	uint16_t	ivlan_tpid;
44285 	/* Inner VLAN TCI. */
44286 	uint16_t	ivlan_tci;
44287 	uint8_t	unused[8];
44288 } hwrm_cfa_flow_l2_key_data_t, *phwrm_cfa_flow_l2_key_data_t;
44289 
44290 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
44291 
44292 typedef struct hwrm_cfa_flow_key_data {
44293 	/* Flow associated tunnel L2 header key info. */
44294 	uint32_t	t_l2_key_data[14];
44295 	/* Flow associated tunnel L2 header mask info. */
44296 	uint32_t	t_l2_key_mask[14];
44297 	/* Flow associated tunnel L3 header key info. */
44298 	uint32_t	t_l3_key_data[16];
44299 	/* Flow associated tunnel L3 header mask info. */
44300 	uint32_t	t_l3_key_mask[16];
44301 	/* Flow associated tunnel L4 header key info. */
44302 	uint64_t	t_l4_key_data;
44303 	/* Flow associated tunnel L4 header mask info. */
44304 	uint64_t	t_l4_key_mask;
44305 	/* Flow associated tunnel header info. */
44306 	uint64_t	tunnel_hdr;
44307 	/* Flow associated L2 header key info. */
44308 	uint32_t	l2_key_data[14];
44309 	/* Flow associated L2 header mask info. */
44310 	uint32_t	l2_key_mask[14];
44311 	/* Flow associated L3 header key info. */
44312 	uint32_t	l3_key_data[16];
44313 	/* Flow associated L3 header mask info. */
44314 	uint32_t	l3_key_mask[16];
44315 	/* Flow associated L4 header key info. */
44316 	uint64_t	l4_key_data;
44317 	/* Flow associated L4 header mask info. */
44318 	uint64_t	l4_key_mask;
44319 } hwrm_cfa_flow_key_data_t, *phwrm_cfa_flow_key_data_t;
44320 
44321 /**********************
44322  * hwrm_cfa_flow_info *
44323  **********************/
44324 
44325 
44326 /* hwrm_cfa_flow_info_input (size:256b/32B) */
44327 
44328 typedef struct hwrm_cfa_flow_info_input {
44329 	/* The HWRM command request type. */
44330 	uint16_t	req_type;
44331 	/*
44332 	 * The completion ring to send the completion event on. This should
44333 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44334 	 */
44335 	uint16_t	cmpl_ring;
44336 	/*
44337 	 * The sequence ID is used by the driver for tracking multiple
44338 	 * commands. This ID is treated as opaque data by the firmware and
44339 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44340 	 */
44341 	uint16_t	seq_id;
44342 	/*
44343 	 * The target ID of the command:
44344 	 * * 0x0-0xFFF8 - The function ID
44345 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44346 	 * * 0xFFFD - Reserved for user-space HWRM interface
44347 	 * * 0xFFFF - HWRM
44348 	 */
44349 	uint16_t	target_id;
44350 	/*
44351 	 * A physical address pointer pointing to a host buffer that the
44352 	 * command's response data will be written. This can be either a host
44353 	 * physical address (HPA) or a guest physical address (GPA) and must
44354 	 * point to a physically contiguous block of memory.
44355 	 */
44356 	uint64_t	resp_addr;
44357 	/* Flow record index. */
44358 	uint16_t	flow_handle;
44359 	/* Max flow handle */
44360 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK	UINT32_C(0xfff)
44361 	/* CNP flow handle */
44362 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT	UINT32_C(0x1000)
44363 	/* RoCEv1 flow handle */
44364 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT	UINT32_C(0x2000)
44365 	/* NIC flow handle */
44366 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_NIC_TX	UINT32_C(0x3000)
44367 	/* RoCEv2 flow handle */
44368 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT	UINT32_C(0x4000)
44369 	/* Direction rx = 1 */
44370 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX	UINT32_C(0x8000)
44371 	/* CNP flow handle */
44372 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT_RX	UINT32_C(0x9000)
44373 	/* RoCEv1 flow handle */
44374 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT_RX UINT32_C(0xa000)
44375 	/* NIC flow handle */
44376 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_NIC_RX	UINT32_C(0xb000)
44377 	/* RoCEv2 flow handle */
44378 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT_RX UINT32_C(0xc000)
44379 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_LAST	HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT_RX
44380 	uint8_t	unused_0[6];
44381 	/* This value identifies a set of CFA data structures used for a flow. */
44382 	uint64_t	ext_flow_handle;
44383 } hwrm_cfa_flow_info_input_t, *phwrm_cfa_flow_info_input_t;
44384 
44385 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
44386 
44387 typedef struct hwrm_cfa_flow_info_output {
44388 	/* The specific error status for the command. */
44389 	uint16_t	error_code;
44390 	/* The HWRM command request type. */
44391 	uint16_t	req_type;
44392 	/* The sequence ID from the original command. */
44393 	uint16_t	seq_id;
44394 	/* The length of the response data in number of bytes. */
44395 	uint16_t	resp_len;
44396 	uint8_t	flags;
44397 	/* When set to 1, indicates the configuration is the TX flow. */
44398 	#define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX	UINT32_C(0x1)
44399 	/* When set to 1, indicates the configuration is the RX flow. */
44400 	#define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX	UINT32_C(0x2)
44401 	/* profile is 8 b */
44402 	uint8_t	profile;
44403 	/* src_fid is 16 b */
44404 	uint16_t	src_fid;
44405 	/* dst_fid is 16 b */
44406 	uint16_t	dst_fid;
44407 	/* l2_ctxt_id is 16 b */
44408 	uint16_t	l2_ctxt_id;
44409 	/* em_info is 64 b */
44410 	uint64_t	em_info;
44411 	/* tcam_info is 64 b */
44412 	uint64_t	tcam_info;
44413 	/* vfp_tcam_info is 64 b */
44414 	uint64_t	vfp_tcam_info;
44415 	/* ar_id is 16 b */
44416 	uint16_t	ar_id;
44417 	/* flow_handle is 16 b */
44418 	uint16_t	flow_handle;
44419 	/* tunnel_handle is 32 b */
44420 	uint32_t	tunnel_handle;
44421 	/* The flow aging timer for the flow, the unit is 100 milliseconds */
44422 	uint16_t	flow_timer;
44423 	uint8_t	unused_0[6];
44424 	/* Flow associated L2, L3 and L4 headers info. */
44425 	uint32_t	flow_key_data[130];
44426 	/* Flow associated action record info. */
44427 	uint32_t	flow_action_info[30];
44428 	uint8_t	unused_1[7];
44429 	/*
44430 	 * This field is used in Output records to indicate that the output
44431 	 * is completely written to RAM. This field should be read as '1'
44432 	 * to indicate that the output has been completely written.
44433 	 * When writing a command completion or response to an internal
44434 	 * processor, the order of writes has to be such that this field is
44435 	 * written last.
44436 	 */
44437 	uint8_t	valid;
44438 } hwrm_cfa_flow_info_output_t, *phwrm_cfa_flow_info_output_t;
44439 
44440 /***********************
44441  * hwrm_cfa_flow_flush *
44442  ***********************/
44443 
44444 
44445 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
44446 
44447 typedef struct hwrm_cfa_flow_flush_input {
44448 	/* The HWRM command request type. */
44449 	uint16_t	req_type;
44450 	/*
44451 	 * The completion ring to send the completion event on. This should
44452 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44453 	 */
44454 	uint16_t	cmpl_ring;
44455 	/*
44456 	 * The sequence ID is used by the driver for tracking multiple
44457 	 * commands. This ID is treated as opaque data by the firmware and
44458 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44459 	 */
44460 	uint16_t	seq_id;
44461 	/*
44462 	 * The target ID of the command:
44463 	 * * 0x0-0xFFF8 - The function ID
44464 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44465 	 * * 0xFFFD - Reserved for user-space HWRM interface
44466 	 * * 0xFFFF - HWRM
44467 	 */
44468 	uint16_t	target_id;
44469 	/*
44470 	 * A physical address pointer pointing to a host buffer that the
44471 	 * command's response data will be written. This can be either a host
44472 	 * physical address (HPA) or a guest physical address (GPA) and must
44473 	 * point to a physically contiguous block of memory.
44474 	 */
44475 	uint64_t	resp_addr;
44476 	/* flags is 32 b */
44477 	uint32_t	flags;
44478 	/*
44479 	 * Set to 1 to indicate the page size, page layers, and
44480 	 * flow_handle_table_dma_addr fields are valid. The flow flush
44481 	 * operation should only flush the flows from the flow table
44482 	 * specified. This flag is set to 0 by older driver. For older
44483 	 * firmware, setting this flag has no effect.
44484 	 */
44485 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID			UINT32_C(0x1)
44486 	/*
44487 	 * Set to 1 to indicate flow flush operation to cleanup all the
44488 	 * flows, meters, CFA context memory tables etc. This flag is set to
44489 	 * 0 by older driver. For older firmware, setting this flag has no
44490 	 * effect.
44491 	 */
44492 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL			UINT32_C(0x2)
44493 	/*
44494 	 * Set to 1 to indicate flow flush operation to cleanup all the
44495 	 * flows by the caller. This flag is set to 0 by older driver. For
44496 	 * older firmware, setting this flag has no effect.
44497 	 */
44498 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT			UINT32_C(0x4)
44499 	/*
44500 	 * Set to 1 to indicate the flow counter IDs are included in the
44501 	 * flow table.
44502 	 */
44503 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC		UINT32_C(0x8000000)
44504 	/*
44505 	 * This specifies the size of flow handle entries provided by the
44506 	 * driver in the flow table specified below. Only two flow handle
44507 	 * size enums are defined.
44508 	 */
44509 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK	UINT32_C(0xc0000000)
44510 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT	30
44511 	/* The flow handle is 16bit */
44512 		#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT  (UINT32_C(0x0) << 30)
44513 	/* The flow handle is 64bit */
44514 		#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT  (UINT32_C(0x1) << 30)
44515 		#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
44516 	/* Specify page size of the flow table memory. */
44517 	uint8_t	page_size;
44518 	/* The page size is 4K */
44519 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
44520 	/* The page size is 8K */
44521 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
44522 	/* The page size is 64K */
44523 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
44524 	/* The page size is 256K */
44525 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
44526 	/* The page size is 1M */
44527 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
44528 	/* The page size is 2M */
44529 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
44530 	/* The page size is 4M */
44531 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
44532 	/* The page size is 1G */
44533 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
44534 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
44535 	/* FLow table memory indirect levels. */
44536 	uint8_t	page_level;
44537 	/* PBL pointer is physical start address. */
44538 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
44539 	/* PBL pointer points to PTE table. */
44540 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
44541 	/*
44542 	 * PBL pointer points to PDE table with each entry pointing to PTE
44543 	 * tables.
44544 	 */
44545 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
44546 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
44547 	/* number of flows in the flow table */
44548 	uint16_t	num_flows;
44549 	/* Pointer to the PBL, or PDL depending on number of levels */
44550 	uint64_t	page_dir;
44551 } hwrm_cfa_flow_flush_input_t, *phwrm_cfa_flow_flush_input_t;
44552 
44553 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
44554 
44555 typedef struct hwrm_cfa_flow_flush_output {
44556 	/* The specific error status for the command. */
44557 	uint16_t	error_code;
44558 	/* The HWRM command request type. */
44559 	uint16_t	req_type;
44560 	/* The sequence ID from the original command. */
44561 	uint16_t	seq_id;
44562 	/* The length of the response data in number of bytes. */
44563 	uint16_t	resp_len;
44564 	uint8_t	unused_0[7];
44565 	/*
44566 	 * This field is used in Output records to indicate that the output
44567 	 * is completely written to RAM. This field should be read as '1'
44568 	 * to indicate that the output has been completely written.
44569 	 * When writing a command completion or response to an internal
44570 	 * processor, the order of writes has to be such that this field is
44571 	 * written last.
44572 	 */
44573 	uint8_t	valid;
44574 } hwrm_cfa_flow_flush_output_t, *phwrm_cfa_flow_flush_output_t;
44575 
44576 /***********************
44577  * hwrm_cfa_flow_stats *
44578  ***********************/
44579 
44580 
44581 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
44582 
44583 typedef struct hwrm_cfa_flow_stats_input {
44584 	/* The HWRM command request type. */
44585 	uint16_t	req_type;
44586 	/*
44587 	 * The completion ring to send the completion event on. This should
44588 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44589 	 */
44590 	uint16_t	cmpl_ring;
44591 	/*
44592 	 * The sequence ID is used by the driver for tracking multiple
44593 	 * commands. This ID is treated as opaque data by the firmware and
44594 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44595 	 */
44596 	uint16_t	seq_id;
44597 	/*
44598 	 * The target ID of the command:
44599 	 * * 0x0-0xFFF8 - The function ID
44600 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44601 	 * * 0xFFFD - Reserved for user-space HWRM interface
44602 	 * * 0xFFFF - HWRM
44603 	 */
44604 	uint16_t	target_id;
44605 	/*
44606 	 * A physical address pointer pointing to a host buffer that the
44607 	 * command's response data will be written. This can be either a host
44608 	 * physical address (HPA) or a guest physical address (GPA) and must
44609 	 * point to a physically contiguous block of memory.
44610 	 */
44611 	uint64_t	resp_addr;
44612 	/* Number of valid flows in this command. */
44613 	uint16_t	num_flows;
44614 	/*
44615 	 * Flow handle.
44616 	 * For a listing of applicable flow_handle_0 values, see enumeration
44617 	 * in hwrm_cfa_flow_info_input.
44618 	 */
44619 	uint16_t	flow_handle_0;
44620 	/*
44621 	 * Flow handle.
44622 	 * For a listing of applicable flow_handle_1 values, see enumeration
44623 	 * in hwrm_cfa_flow_info_input.
44624 	 */
44625 	uint16_t	flow_handle_1;
44626 	/*
44627 	 * Flow handle.
44628 	 * For a listing of applicable flow_handle_2 values, see enumeration
44629 	 * in hwrm_cfa_flow_info_input.
44630 	 */
44631 	uint16_t	flow_handle_2;
44632 	/*
44633 	 * Flow handle.
44634 	 * For a listing of applicable flow_handle_3 values, see enumeration
44635 	 * in hwrm_cfa_flow_info_input.
44636 	 */
44637 	uint16_t	flow_handle_3;
44638 	/*
44639 	 * Flow handle.
44640 	 * For a listing of applicable flow_handle_4 values, see enumeration
44641 	 * in hwrm_cfa_flow_info_input.
44642 	 */
44643 	uint16_t	flow_handle_4;
44644 	/*
44645 	 * Flow handle.
44646 	 * For a listing of applicable flow_handle_5 values, see enumeration
44647 	 * in hwrm_cfa_flow_info_input.
44648 	 */
44649 	uint16_t	flow_handle_5;
44650 	/*
44651 	 * Flow handle.
44652 	 * For a listing of applicable flow_handle_6 values, see enumeration
44653 	 * in hwrm_cfa_flow_info_input.
44654 	 */
44655 	uint16_t	flow_handle_6;
44656 	/*
44657 	 * Flow handle.
44658 	 * For a listing of applicable flow_handle_7 values, see enumeration
44659 	 * in hwrm_cfa_flow_info_input.
44660 	 */
44661 	uint16_t	flow_handle_7;
44662 	/*
44663 	 * Flow handle.
44664 	 * For a listing of applicable flow_handle_8 values, see enumeration
44665 	 * in hwrm_cfa_flow_info_input.
44666 	 */
44667 	uint16_t	flow_handle_8;
44668 	/*
44669 	 * Flow handle.
44670 	 * For a listing of applicable flow_handle_9 values, see enumeration
44671 	 * in hwrm_cfa_flow_info_input.
44672 	 */
44673 	uint16_t	flow_handle_9;
44674 	uint8_t	unused_0[2];
44675 	/* Flow ID of a flow. */
44676 	uint32_t	flow_id_0;
44677 	/* Flow ID of a flow. */
44678 	uint32_t	flow_id_1;
44679 	/* Flow ID of a flow. */
44680 	uint32_t	flow_id_2;
44681 	/* Flow ID of a flow. */
44682 	uint32_t	flow_id_3;
44683 	/* Flow ID of a flow. */
44684 	uint32_t	flow_id_4;
44685 	/* Flow ID of a flow. */
44686 	uint32_t	flow_id_5;
44687 	/* Flow ID of a flow. */
44688 	uint32_t	flow_id_6;
44689 	/* Flow ID of a flow. */
44690 	uint32_t	flow_id_7;
44691 	/* Flow ID of a flow. */
44692 	uint32_t	flow_id_8;
44693 	/* Flow ID of a flow. */
44694 	uint32_t	flow_id_9;
44695 } hwrm_cfa_flow_stats_input_t, *phwrm_cfa_flow_stats_input_t;
44696 
44697 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
44698 
44699 typedef struct hwrm_cfa_flow_stats_output {
44700 	/* The specific error status for the command. */
44701 	uint16_t	error_code;
44702 	/* The HWRM command request type. */
44703 	uint16_t	req_type;
44704 	/* The sequence ID from the original command. */
44705 	uint16_t	seq_id;
44706 	/* The length of the response data in number of bytes. */
44707 	uint16_t	resp_len;
44708 	/* packet_0 is 64 b */
44709 	uint64_t	packet_0;
44710 	/* packet_1 is 64 b */
44711 	uint64_t	packet_1;
44712 	/* packet_2 is 64 b */
44713 	uint64_t	packet_2;
44714 	/* packet_3 is 64 b */
44715 	uint64_t	packet_3;
44716 	/* packet_4 is 64 b */
44717 	uint64_t	packet_4;
44718 	/* packet_5 is 64 b */
44719 	uint64_t	packet_5;
44720 	/* packet_6 is 64 b */
44721 	uint64_t	packet_6;
44722 	/* packet_7 is 64 b */
44723 	uint64_t	packet_7;
44724 	/* packet_8 is 64 b */
44725 	uint64_t	packet_8;
44726 	/* packet_9 is 64 b */
44727 	uint64_t	packet_9;
44728 	/* byte_0 is 64 b */
44729 	uint64_t	byte_0;
44730 	/* byte_1 is 64 b */
44731 	uint64_t	byte_1;
44732 	/* byte_2 is 64 b */
44733 	uint64_t	byte_2;
44734 	/* byte_3 is 64 b */
44735 	uint64_t	byte_3;
44736 	/* byte_4 is 64 b */
44737 	uint64_t	byte_4;
44738 	/* byte_5 is 64 b */
44739 	uint64_t	byte_5;
44740 	/* byte_6 is 64 b */
44741 	uint64_t	byte_6;
44742 	/* byte_7 is 64 b */
44743 	uint64_t	byte_7;
44744 	/* byte_8 is 64 b */
44745 	uint64_t	byte_8;
44746 	/* byte_9 is 64 b */
44747 	uint64_t	byte_9;
44748 	/*
44749 	 * If a flow has been hit, the bit representing the flow will be 1.
44750 	 * Likewise, if a flow has not, the bit representing the flow
44751 	 * will be 0. Mapping will match flow numbers where bitX is for flowX
44752 	 * (ex: bit 0 is flow0).  This only applies for NIC flows. Upon
44753 	 * reading of the flow, the bit will be cleared for the flow and only
44754 	 * set again when traffic is received by the flow.
44755 	 */
44756 	uint16_t	flow_hits;
44757 	uint8_t	unused_0[5];
44758 	/*
44759 	 * This field is used in Output records to indicate that the output
44760 	 * is completely written to RAM. This field should be read as '1'
44761 	 * to indicate that the output has been completely written.
44762 	 * When writing a command completion or response to an internal
44763 	 * processor, the order of writes has to be such that this field is
44764 	 * written last.
44765 	 */
44766 	uint8_t	valid;
44767 } hwrm_cfa_flow_stats_output_t, *phwrm_cfa_flow_stats_output_t;
44768 
44769 /***********************************
44770  * hwrm_cfa_flow_aging_timer_reset *
44771  ***********************************/
44772 
44773 
44774 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
44775 
44776 typedef struct hwrm_cfa_flow_aging_timer_reset_input {
44777 	/* The HWRM command request type. */
44778 	uint16_t	req_type;
44779 	/*
44780 	 * The completion ring to send the completion event on. This should
44781 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44782 	 */
44783 	uint16_t	cmpl_ring;
44784 	/*
44785 	 * The sequence ID is used by the driver for tracking multiple
44786 	 * commands. This ID is treated as opaque data by the firmware and
44787 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44788 	 */
44789 	uint16_t	seq_id;
44790 	/*
44791 	 * The target ID of the command:
44792 	 * * 0x0-0xFFF8 - The function ID
44793 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44794 	 * * 0xFFFD - Reserved for user-space HWRM interface
44795 	 * * 0xFFFF - HWRM
44796 	 */
44797 	uint16_t	target_id;
44798 	/*
44799 	 * A physical address pointer pointing to a host buffer that the
44800 	 * command's response data will be written. This can be either a host
44801 	 * physical address (HPA) or a guest physical address (GPA) and must
44802 	 * point to a physically contiguous block of memory.
44803 	 */
44804 	uint64_t	resp_addr;
44805 	/* Flow record index. */
44806 	uint16_t	flow_handle;
44807 	uint8_t	unused_0[2];
44808 	/*
44809 	 * New flow timer value for the flow specified in the ext_flow_handle.
44810 	 * The flow timer unit is 100ms.
44811 	 */
44812 	uint32_t	flow_timer;
44813 	/* This value identifies a set of CFA data structures used for a flow. */
44814 	uint64_t	ext_flow_handle;
44815 } hwrm_cfa_flow_aging_timer_reset_input_t, *phwrm_cfa_flow_aging_timer_reset_input_t;
44816 
44817 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
44818 
44819 typedef struct hwrm_cfa_flow_aging_timer_reset_output {
44820 	/* The specific error status for the command. */
44821 	uint16_t	error_code;
44822 	/* The HWRM command request type. */
44823 	uint16_t	req_type;
44824 	/* The sequence ID from the original command. */
44825 	uint16_t	seq_id;
44826 	/* The length of the response data in number of bytes. */
44827 	uint16_t	resp_len;
44828 	uint8_t	unused_0[7];
44829 	/*
44830 	 * This field is used in Output records to indicate that the output
44831 	 * is completely written to RAM. This field should be read as '1'
44832 	 * to indicate that the output has been completely written.
44833 	 * When writing a command completion or response to an internal
44834 	 * processor, the order of writes has to be such that this field is
44835 	 * written last.
44836 	 */
44837 	uint8_t	valid;
44838 } hwrm_cfa_flow_aging_timer_reset_output_t, *phwrm_cfa_flow_aging_timer_reset_output_t;
44839 
44840 /***************************
44841  * hwrm_cfa_flow_aging_cfg *
44842  ***************************/
44843 
44844 
44845 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
44846 
44847 typedef struct hwrm_cfa_flow_aging_cfg_input {
44848 	/* The HWRM command request type. */
44849 	uint16_t	req_type;
44850 	/*
44851 	 * The completion ring to send the completion event on. This should
44852 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44853 	 */
44854 	uint16_t	cmpl_ring;
44855 	/*
44856 	 * The sequence ID is used by the driver for tracking multiple
44857 	 * commands. This ID is treated as opaque data by the firmware and
44858 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44859 	 */
44860 	uint16_t	seq_id;
44861 	/*
44862 	 * The target ID of the command:
44863 	 * * 0x0-0xFFF8 - The function ID
44864 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44865 	 * * 0xFFFD - Reserved for user-space HWRM interface
44866 	 * * 0xFFFF - HWRM
44867 	 */
44868 	uint16_t	target_id;
44869 	/*
44870 	 * A physical address pointer pointing to a host buffer that the
44871 	 * command's response data will be written. This can be either a host
44872 	 * physical address (HPA) or a guest physical address (GPA) and must
44873 	 * point to a physically contiguous block of memory.
44874 	 */
44875 	uint64_t	resp_addr;
44876 	/* The bit field to enable per flow aging configuration. */
44877 	uint16_t	enables;
44878 	/*
44879 	 * This bit must be '1' for the tcp flow timer field to be
44880 	 * configured
44881 	 */
44882 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER	UINT32_C(0x1)
44883 	/*
44884 	 * This bit must be '1' for the tcp finish timer field to be
44885 	 * configured
44886 	 */
44887 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER	UINT32_C(0x2)
44888 	/*
44889 	 * This bit must be '1' for the udp flow timer field to be
44890 	 * configured
44891 	 */
44892 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER	UINT32_C(0x4)
44893 	/*
44894 	 * This bit must be '1' for the eem dma interval field to be
44895 	 * configured
44896 	 */
44897 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL	UINT32_C(0x8)
44898 	/*
44899 	 * This bit must be '1' for the eem notice interval field to be
44900 	 * configured
44901 	 */
44902 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL	UINT32_C(0x10)
44903 	/*
44904 	 * This bit must be '1' for the eem context memory maximum entries
44905 	 * field to be configured
44906 	 */
44907 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES	UINT32_C(0x20)
44908 	/*
44909 	 * This bit must be '1' for the eem context memory ID field to be
44910 	 * configured
44911 	 */
44912 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID		UINT32_C(0x40)
44913 	/*
44914 	 * This bit must be '1' for the eem context memory type field to be
44915 	 * configured
44916 	 */
44917 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE	UINT32_C(0x80)
44918 	uint8_t	flags;
44919 	/* Enumeration denoting the RX, TX type of the resource. */
44920 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
44921 	/* tx path */
44922 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
44923 	/* rx path */
44924 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
44925 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST   HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
44926 	/*
44927 	 * Enumeration denoting the enable, disable eem flow aging
44928 	 * configuration.
44929 	 */
44930 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM	UINT32_C(0x2)
44931 	/* tx path */
44932 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE  (UINT32_C(0x0) << 1)
44933 	/* rx path */
44934 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE   (UINT32_C(0x1) << 1)
44935 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST	HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
44936 	uint8_t	unused_0;
44937 	/*
44938 	 * The flow aging timer for all TCP flows, the unit is 100
44939 	 * milliseconds.
44940 	 */
44941 	uint32_t	tcp_flow_timer;
44942 	/*
44943 	 * The TCP finished timer for all TCP flows, the unit is 100
44944 	 * milliseconds.
44945 	 */
44946 	uint32_t	tcp_fin_timer;
44947 	/*
44948 	 * The flow aging timer for all UDP flows, the unit is 100
44949 	 * milliseconds.
44950 	 */
44951 	uint32_t	udp_flow_timer;
44952 	/*
44953 	 * The interval to dma eem ejection data to host memory, the unit is
44954 	 * milliseconds.
44955 	 */
44956 	uint16_t	eem_dma_interval;
44957 	/*
44958 	 * The interval to notify driver to read the eem ejection data, the
44959 	 * unit is milliseconds.
44960 	 */
44961 	uint16_t	eem_notice_interval;
44962 	/* The maximum entries number in the eem context memory. */
44963 	uint32_t	eem_ctx_max_entries;
44964 	/* The context memory ID for eem flow aging. */
44965 	uint16_t	eem_ctx_id;
44966 	uint16_t	eem_ctx_mem_type;
44967 	/*
44968 	 * The content of context memory is eem ejection data, the size of
44969 	 * each entry is 4 bytes.
44970 	 */
44971 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA UINT32_C(0x0)
44972 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST	HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
44973 	uint8_t	unused_1[4];
44974 } hwrm_cfa_flow_aging_cfg_input_t, *phwrm_cfa_flow_aging_cfg_input_t;
44975 
44976 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
44977 
44978 typedef struct hwrm_cfa_flow_aging_cfg_output {
44979 	/* The specific error status for the command. */
44980 	uint16_t	error_code;
44981 	/* The HWRM command request type. */
44982 	uint16_t	req_type;
44983 	/* The sequence ID from the original command. */
44984 	uint16_t	seq_id;
44985 	/* The length of the response data in number of bytes. */
44986 	uint16_t	resp_len;
44987 	uint8_t	unused_0[7];
44988 	/*
44989 	 * This field is used in Output records to indicate that the output
44990 	 * is completely written to RAM. This field should be read as '1'
44991 	 * to indicate that the output has been completely written.
44992 	 * When writing a command completion or response to an internal
44993 	 * processor, the order of writes has to be such that this field is
44994 	 * written last.
44995 	 */
44996 	uint8_t	valid;
44997 } hwrm_cfa_flow_aging_cfg_output_t, *phwrm_cfa_flow_aging_cfg_output_t;
44998 
44999 /****************************
45000  * hwrm_cfa_flow_aging_qcfg *
45001  ****************************/
45002 
45003 
45004 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
45005 
45006 typedef struct hwrm_cfa_flow_aging_qcfg_input {
45007 	/* The HWRM command request type. */
45008 	uint16_t	req_type;
45009 	/*
45010 	 * The completion ring to send the completion event on. This should
45011 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45012 	 */
45013 	uint16_t	cmpl_ring;
45014 	/*
45015 	 * The sequence ID is used by the driver for tracking multiple
45016 	 * commands. This ID is treated as opaque data by the firmware and
45017 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45018 	 */
45019 	uint16_t	seq_id;
45020 	/*
45021 	 * The target ID of the command:
45022 	 * * 0x0-0xFFF8 - The function ID
45023 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45024 	 * * 0xFFFD - Reserved for user-space HWRM interface
45025 	 * * 0xFFFF - HWRM
45026 	 */
45027 	uint16_t	target_id;
45028 	/*
45029 	 * A physical address pointer pointing to a host buffer that the
45030 	 * command's response data will be written. This can be either a host
45031 	 * physical address (HPA) or a guest physical address (GPA) and must
45032 	 * point to a physically contiguous block of memory.
45033 	 */
45034 	uint64_t	resp_addr;
45035 	/*
45036 	 * The direction for the flow aging configuration, 1 is rx path, 2 is
45037 	 * tx path.
45038 	 */
45039 	uint8_t	flags;
45040 	/* Enumeration denoting the RX, TX type of the resource. */
45041 	#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
45042 	/* tx path */
45043 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
45044 	/* rx path */
45045 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
45046 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
45047 	uint8_t	unused_0[7];
45048 } hwrm_cfa_flow_aging_qcfg_input_t, *phwrm_cfa_flow_aging_qcfg_input_t;
45049 
45050 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
45051 
45052 typedef struct hwrm_cfa_flow_aging_qcfg_output {
45053 	/* The specific error status for the command. */
45054 	uint16_t	error_code;
45055 	/* The HWRM command request type. */
45056 	uint16_t	req_type;
45057 	/* The sequence ID from the original command. */
45058 	uint16_t	seq_id;
45059 	/* The length of the response data in number of bytes. */
45060 	uint16_t	resp_len;
45061 	/*
45062 	 * The current flow aging timer for all TCP flows, the unit is 100
45063 	 * millisecond.
45064 	 */
45065 	uint32_t	tcp_flow_timer;
45066 	/*
45067 	 * The current TCP finished timer for all TCP flows, the unit is 100
45068 	 * millisecond.
45069 	 */
45070 	uint32_t	tcp_fin_timer;
45071 	/*
45072 	 * The current flow aging timer for all UDP flows, the unit is 100
45073 	 * millisecond.
45074 	 */
45075 	uint32_t	udp_flow_timer;
45076 	/*
45077 	 * The interval to dma eem ejection data to host memory, the unit is
45078 	 * milliseconds.
45079 	 */
45080 	uint16_t	eem_dma_interval;
45081 	/*
45082 	 * The interval to notify driver to read the eem ejection data, the
45083 	 * unit is milliseconds.
45084 	 */
45085 	uint16_t	eem_notice_interval;
45086 	/* The maximum entries number in the eem context memory. */
45087 	uint32_t	eem_ctx_max_entries;
45088 	/* The context memory ID for eem flow aging. */
45089 	uint16_t	eem_ctx_id;
45090 	/* The context memory type for eem flow aging. */
45091 	uint16_t	eem_ctx_mem_type;
45092 	uint8_t	unused_0[7];
45093 	/*
45094 	 * This field is used in Output records to indicate that the output
45095 	 * is completely written to RAM. This field should be read as '1'
45096 	 * to indicate that the output has been completely written.
45097 	 * When writing a command completion or response to an internal
45098 	 * processor, the order of writes has to be such that this field is
45099 	 * written last.
45100 	 */
45101 	uint8_t	valid;
45102 } hwrm_cfa_flow_aging_qcfg_output_t, *phwrm_cfa_flow_aging_qcfg_output_t;
45103 
45104 /*****************************
45105  * hwrm_cfa_flow_aging_qcaps *
45106  *****************************/
45107 
45108 
45109 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
45110 
45111 typedef struct hwrm_cfa_flow_aging_qcaps_input {
45112 	/* The HWRM command request type. */
45113 	uint16_t	req_type;
45114 	/*
45115 	 * The completion ring to send the completion event on. This should
45116 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45117 	 */
45118 	uint16_t	cmpl_ring;
45119 	/*
45120 	 * The sequence ID is used by the driver for tracking multiple
45121 	 * commands. This ID is treated as opaque data by the firmware and
45122 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45123 	 */
45124 	uint16_t	seq_id;
45125 	/*
45126 	 * The target ID of the command:
45127 	 * * 0x0-0xFFF8 - The function ID
45128 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45129 	 * * 0xFFFD - Reserved for user-space HWRM interface
45130 	 * * 0xFFFF - HWRM
45131 	 */
45132 	uint16_t	target_id;
45133 	/*
45134 	 * A physical address pointer pointing to a host buffer that the
45135 	 * command's response data will be written. This can be either a host
45136 	 * physical address (HPA) or a guest physical address (GPA) and must
45137 	 * point to a physically contiguous block of memory.
45138 	 */
45139 	uint64_t	resp_addr;
45140 	/*
45141 	 * The direction for the flow aging configuration, 1 is rx path, 2 is
45142 	 * tx path.
45143 	 */
45144 	uint8_t	flags;
45145 	/* Enumeration denoting the RX, TX type of the resource. */
45146 	#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH	UINT32_C(0x1)
45147 	/* tx path */
45148 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
45149 	/* rx path */
45150 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
45151 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
45152 	uint8_t	unused_0[7];
45153 } hwrm_cfa_flow_aging_qcaps_input_t, *phwrm_cfa_flow_aging_qcaps_input_t;
45154 
45155 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
45156 
45157 typedef struct hwrm_cfa_flow_aging_qcaps_output {
45158 	/* The specific error status for the command. */
45159 	uint16_t	error_code;
45160 	/* The HWRM command request type. */
45161 	uint16_t	req_type;
45162 	/* The sequence ID from the original command. */
45163 	uint16_t	seq_id;
45164 	/* The length of the response data in number of bytes. */
45165 	uint16_t	resp_len;
45166 	/*
45167 	 * The maximum flow aging timer for all TCP flows, the unit is 100
45168 	 * millisecond.
45169 	 */
45170 	uint32_t	max_tcp_flow_timer;
45171 	/*
45172 	 * The maximum TCP finished timer for all TCP flows, the unit is 100
45173 	 * millisecond.
45174 	 */
45175 	uint32_t	max_tcp_fin_timer;
45176 	/*
45177 	 * The maximum flow aging timer for all UDP flows, the unit is 100
45178 	 * millisecond.
45179 	 */
45180 	uint32_t	max_udp_flow_timer;
45181 	/* The maximum aging flows that HW can support. */
45182 	uint32_t	max_aging_flows;
45183 	uint8_t	unused_0[7];
45184 	/*
45185 	 * This field is used in Output records to indicate that the output
45186 	 * is completely written to RAM. This field should be read as '1'
45187 	 * to indicate that the output has been completely written.
45188 	 * When writing a command completion or response to an internal
45189 	 * processor, the order of writes has to be such that this field is
45190 	 * written last.
45191 	 */
45192 	uint8_t	valid;
45193 } hwrm_cfa_flow_aging_qcaps_output_t, *phwrm_cfa_flow_aging_qcaps_output_t;
45194 
45195 /**********************************
45196  * hwrm_cfa_tcp_flag_process_qcfg *
45197  **********************************/
45198 
45199 
45200 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
45201 
45202 typedef struct hwrm_cfa_tcp_flag_process_qcfg_input {
45203 	/* The HWRM command request type. */
45204 	uint16_t	req_type;
45205 	/*
45206 	 * The completion ring to send the completion event on. This should
45207 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45208 	 */
45209 	uint16_t	cmpl_ring;
45210 	/*
45211 	 * The sequence ID is used by the driver for tracking multiple
45212 	 * commands. This ID is treated as opaque data by the firmware and
45213 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45214 	 */
45215 	uint16_t	seq_id;
45216 	/*
45217 	 * The target ID of the command:
45218 	 * * 0x0-0xFFF8 - The function ID
45219 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45220 	 * * 0xFFFD - Reserved for user-space HWRM interface
45221 	 * * 0xFFFF - HWRM
45222 	 */
45223 	uint16_t	target_id;
45224 	/*
45225 	 * A physical address pointer pointing to a host buffer that the
45226 	 * command's response data will be written. This can be either a host
45227 	 * physical address (HPA) or a guest physical address (GPA) and must
45228 	 * point to a physically contiguous block of memory.
45229 	 */
45230 	uint64_t	resp_addr;
45231 } hwrm_cfa_tcp_flag_process_qcfg_input_t, *phwrm_cfa_tcp_flag_process_qcfg_input_t;
45232 
45233 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
45234 
45235 typedef struct hwrm_cfa_tcp_flag_process_qcfg_output {
45236 	/* The specific error status for the command. */
45237 	uint16_t	error_code;
45238 	/* The HWRM command request type. */
45239 	uint16_t	req_type;
45240 	/* The sequence ID from the original command. */
45241 	uint16_t	seq_id;
45242 	/* The length of the response data in number of bytes. */
45243 	uint16_t	resp_len;
45244 	/* The port 0 RX mirror action record ID. */
45245 	uint16_t	rx_ar_id_port0;
45246 	/* The port 1 RX mirror action record ID. */
45247 	uint16_t	rx_ar_id_port1;
45248 	/*
45249 	 * The port 0 RX action record ID for TX TCP flag packets from
45250 	 * loopback path.
45251 	 */
45252 	uint16_t	tx_ar_id_port0;
45253 	/*
45254 	 * The port 1 RX action record ID for TX TCP flag packets from
45255 	 * loopback path.
45256 	 */
45257 	uint16_t	tx_ar_id_port1;
45258 	uint8_t	unused_0[7];
45259 	/*
45260 	 * This field is used in Output records to indicate that the output
45261 	 * is completely written to RAM. This field should be read as '1'
45262 	 * to indicate that the output has been completely written.
45263 	 * When writing a command completion or response to an internal
45264 	 * processor, the order of writes has to be such that this field is
45265 	 * written last.
45266 	 */
45267 	uint8_t	valid;
45268 } hwrm_cfa_tcp_flag_process_qcfg_output_t, *phwrm_cfa_tcp_flag_process_qcfg_output_t;
45269 
45270 /**************************
45271  * hwrm_cfa_vf_pair_alloc *
45272  **************************/
45273 
45274 
45275 /* hwrm_cfa_vf_pair_alloc_input (size:448b/56B) */
45276 
45277 typedef struct hwrm_cfa_vf_pair_alloc_input {
45278 	/* The HWRM command request type. */
45279 	uint16_t	req_type;
45280 	/*
45281 	 * The completion ring to send the completion event on. This should
45282 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45283 	 */
45284 	uint16_t	cmpl_ring;
45285 	/*
45286 	 * The sequence ID is used by the driver for tracking multiple
45287 	 * commands. This ID is treated as opaque data by the firmware and
45288 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45289 	 */
45290 	uint16_t	seq_id;
45291 	/*
45292 	 * The target ID of the command:
45293 	 * * 0x0-0xFFF8 - The function ID
45294 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45295 	 * * 0xFFFD - Reserved for user-space HWRM interface
45296 	 * * 0xFFFF - HWRM
45297 	 */
45298 	uint16_t	target_id;
45299 	/*
45300 	 * A physical address pointer pointing to a host buffer that the
45301 	 * command's response data will be written. This can be either a host
45302 	 * physical address (HPA) or a guest physical address (GPA) and must
45303 	 * point to a physically contiguous block of memory.
45304 	 */
45305 	uint64_t	resp_addr;
45306 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45307 	uint16_t	vf_a_id;
45308 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45309 	uint16_t	vf_b_id;
45310 	uint8_t	unused_0[4];
45311 	/* VF Pair name (32 byte string). */
45312 	char	pair_name[32];
45313 } hwrm_cfa_vf_pair_alloc_input_t, *phwrm_cfa_vf_pair_alloc_input_t;
45314 
45315 /* hwrm_cfa_vf_pair_alloc_output (size:128b/16B) */
45316 
45317 typedef struct hwrm_cfa_vf_pair_alloc_output {
45318 	/* The specific error status for the command. */
45319 	uint16_t	error_code;
45320 	/* The HWRM command request type. */
45321 	uint16_t	req_type;
45322 	/* The sequence ID from the original command. */
45323 	uint16_t	seq_id;
45324 	/* The length of the response data in number of bytes. */
45325 	uint16_t	resp_len;
45326 	uint8_t	unused_0[7];
45327 	/*
45328 	 * This field is used in Output records to indicate that the output
45329 	 * is completely written to RAM. This field should be read as '1'
45330 	 * to indicate that the output has been completely written.
45331 	 * When writing a command completion or response to an internal
45332 	 * processor, the order of writes has to be such that this field is
45333 	 * written last.
45334 	 */
45335 	uint8_t	valid;
45336 } hwrm_cfa_vf_pair_alloc_output_t, *phwrm_cfa_vf_pair_alloc_output_t;
45337 
45338 /*************************
45339  * hwrm_cfa_vf_pair_free *
45340  *************************/
45341 
45342 
45343 /* hwrm_cfa_vf_pair_free_input (size:384b/48B) */
45344 
45345 typedef struct hwrm_cfa_vf_pair_free_input {
45346 	/* The HWRM command request type. */
45347 	uint16_t	req_type;
45348 	/*
45349 	 * The completion ring to send the completion event on. This should
45350 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45351 	 */
45352 	uint16_t	cmpl_ring;
45353 	/*
45354 	 * The sequence ID is used by the driver for tracking multiple
45355 	 * commands. This ID is treated as opaque data by the firmware and
45356 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45357 	 */
45358 	uint16_t	seq_id;
45359 	/*
45360 	 * The target ID of the command:
45361 	 * * 0x0-0xFFF8 - The function ID
45362 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45363 	 * * 0xFFFD - Reserved for user-space HWRM interface
45364 	 * * 0xFFFF - HWRM
45365 	 */
45366 	uint16_t	target_id;
45367 	/*
45368 	 * A physical address pointer pointing to a host buffer that the
45369 	 * command's response data will be written. This can be either a host
45370 	 * physical address (HPA) or a guest physical address (GPA) and must
45371 	 * point to a physically contiguous block of memory.
45372 	 */
45373 	uint64_t	resp_addr;
45374 	/* VF Pair name (32 byte string). */
45375 	char	pair_name[32];
45376 } hwrm_cfa_vf_pair_free_input_t, *phwrm_cfa_vf_pair_free_input_t;
45377 
45378 /* hwrm_cfa_vf_pair_free_output (size:128b/16B) */
45379 
45380 typedef struct hwrm_cfa_vf_pair_free_output {
45381 	/* The specific error status for the command. */
45382 	uint16_t	error_code;
45383 	/* The HWRM command request type. */
45384 	uint16_t	req_type;
45385 	/* The sequence ID from the original command. */
45386 	uint16_t	seq_id;
45387 	/* The length of the response data in number of bytes. */
45388 	uint16_t	resp_len;
45389 	uint8_t	unused_0[7];
45390 	/*
45391 	 * This field is used in Output records to indicate that the output
45392 	 * is completely written to RAM. This field should be read as '1'
45393 	 * to indicate that the output has been completely written.
45394 	 * When writing a command completion or response to an internal
45395 	 * processor, the order of writes has to be such that this field is
45396 	 * written last.
45397 	 */
45398 	uint8_t	valid;
45399 } hwrm_cfa_vf_pair_free_output_t, *phwrm_cfa_vf_pair_free_output_t;
45400 
45401 /*************************
45402  * hwrm_cfa_vf_pair_info *
45403  *************************/
45404 
45405 
45406 /* hwrm_cfa_vf_pair_info_input (size:448b/56B) */
45407 
45408 typedef struct hwrm_cfa_vf_pair_info_input {
45409 	/* The HWRM command request type. */
45410 	uint16_t	req_type;
45411 	/*
45412 	 * The completion ring to send the completion event on. This should
45413 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45414 	 */
45415 	uint16_t	cmpl_ring;
45416 	/*
45417 	 * The sequence ID is used by the driver for tracking multiple
45418 	 * commands. This ID is treated as opaque data by the firmware and
45419 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45420 	 */
45421 	uint16_t	seq_id;
45422 	/*
45423 	 * The target ID of the command:
45424 	 * * 0x0-0xFFF8 - The function ID
45425 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45426 	 * * 0xFFFD - Reserved for user-space HWRM interface
45427 	 * * 0xFFFF - HWRM
45428 	 */
45429 	uint16_t	target_id;
45430 	/*
45431 	 * A physical address pointer pointing to a host buffer that the
45432 	 * command's response data will be written. This can be either a host
45433 	 * physical address (HPA) or a guest physical address (GPA) and must
45434 	 * point to a physically contiguous block of memory.
45435 	 */
45436 	uint64_t	resp_addr;
45437 	uint32_t	flags;
45438 	/* If this flag is set, lookup by name else lookup by index. */
45439 	#define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE	UINT32_C(0x1)
45440 	/* vf pair table index. */
45441 	uint16_t	vf_pair_index;
45442 	uint8_t	unused_0[2];
45443 	/* VF Pair name (32 byte string). */
45444 	char	vf_pair_name[32];
45445 } hwrm_cfa_vf_pair_info_input_t, *phwrm_cfa_vf_pair_info_input_t;
45446 
45447 /* hwrm_cfa_vf_pair_info_output (size:512b/64B) */
45448 
45449 typedef struct hwrm_cfa_vf_pair_info_output {
45450 	/* The specific error status for the command. */
45451 	uint16_t	error_code;
45452 	/* The HWRM command request type. */
45453 	uint16_t	req_type;
45454 	/* The sequence ID from the original command. */
45455 	uint16_t	seq_id;
45456 	/* The length of the response data in number of bytes. */
45457 	uint16_t	resp_len;
45458 	/* vf pair table index. */
45459 	uint16_t	next_vf_pair_index;
45460 	/* vf pair member a's vf_fid. */
45461 	uint16_t	vf_a_fid;
45462 	/* vf pair member a's Linux logical VF number. */
45463 	uint16_t	vf_a_index;
45464 	/* vf pair member b's vf_fid. */
45465 	uint16_t	vf_b_fid;
45466 	/* vf pair member a's Linux logical VF number. */
45467 	uint16_t	vf_b_index;
45468 	/* vf pair state. */
45469 	uint8_t	pair_state;
45470 	/* Pair has been allocated */
45471 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
45472 	/* Both pair members are active */
45473 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE	UINT32_C(0x2)
45474 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_LAST	HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
45475 	uint8_t	unused_0[5];
45476 	/* VF Pair name (32 byte string). */
45477 	char	pair_name[32];
45478 	uint8_t	unused_1[7];
45479 	/*
45480 	 * This field is used in Output records to indicate that the output
45481 	 * is completely written to RAM. This field should be read as '1'
45482 	 * to indicate that the output has been completely written.
45483 	 * When writing a command completion or response to an internal
45484 	 * processor, the order of writes has to be such that this field is
45485 	 * written last.
45486 	 */
45487 	uint8_t	valid;
45488 } hwrm_cfa_vf_pair_info_output_t, *phwrm_cfa_vf_pair_info_output_t;
45489 
45490 /***********************
45491  * hwrm_cfa_pair_alloc *
45492  ***********************/
45493 
45494 
45495 /* hwrm_cfa_pair_alloc_input (size:576b/72B) */
45496 
45497 typedef struct hwrm_cfa_pair_alloc_input {
45498 	/* The HWRM command request type. */
45499 	uint16_t	req_type;
45500 	/*
45501 	 * The completion ring to send the completion event on. This should
45502 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45503 	 */
45504 	uint16_t	cmpl_ring;
45505 	/*
45506 	 * The sequence ID is used by the driver for tracking multiple
45507 	 * commands. This ID is treated as opaque data by the firmware and
45508 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45509 	 */
45510 	uint16_t	seq_id;
45511 	/*
45512 	 * The target ID of the command:
45513 	 * * 0x0-0xFFF8 - The function ID
45514 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45515 	 * * 0xFFFD - Reserved for user-space HWRM interface
45516 	 * * 0xFFFF - HWRM
45517 	 */
45518 	uint16_t	target_id;
45519 	/*
45520 	 * A physical address pointer pointing to a host buffer that the
45521 	 * command's response data will be written. This can be either a host
45522 	 * physical address (HPA) or a guest physical address (GPA) and must
45523 	 * point to a physically contiguous block of memory.
45524 	 */
45525 	uint64_t	resp_addr;
45526 	/*
45527 	 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
45528 	 *		5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
45529 	 */
45530 	uint16_t	pair_mode;
45531 	/*
45532 	 * Pair between VF on local host with PF or VF on specified host.
45533 	 * (deprecated)
45534 	 */
45535 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_VF2FN	UINT32_C(0x0)
45536 	/*
45537 	 * Pair between REP on local host with PF or VF on specified host.
45538 	 * (deprecated)
45539 	 */
45540 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN	UINT32_C(0x1)
45541 	/*
45542 	 * Pair between REP on local host with REP on specified host.
45543 	 * (deprecated)
45544 	 */
45545 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2REP	UINT32_C(0x2)
45546 	/* Pair for the proxy interface. (deprecated) */
45547 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PROXY	UINT32_C(0x3)
45548 	/* Pair for the PF interface. (deprecated) */
45549 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PFPAIR	UINT32_C(0x4)
45550 	/* Modify existing rep2fn pair and move pair to new PF. (deprecated) */
45551 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MOD	UINT32_C(0x5)
45552 	/*
45553 	 * Modify existing rep2fn pairs paired with same PF and move pairs
45554 	 * to new PF. (deprecated)
45555 	 */
45556 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
45557 	/*
45558 	 * Truflow pair between REP on local host with PF or VF on specified
45559 	 * host.
45560 	 */
45561 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
45562 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_LAST	HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW
45563 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45564 	uint16_t	vf_a_id;
45565 	/* Logical Host (0xff-local host). */
45566 	uint8_t	host_b_id;
45567 	/* Logical PF (0xff-PF for command channel). */
45568 	uint8_t	pf_b_id;
45569 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45570 	uint16_t	vf_b_id;
45571 	/* Loopback port (0xff-internal loopback), valid for mode-3. */
45572 	uint8_t	port_id;
45573 	/* Priority used for encap of loopback packets valid for mode-3. */
45574 	uint8_t	pri;
45575 	/* New PF for rep2fn modify, valid for mode 5. */
45576 	uint16_t	new_pf_fid;
45577 	uint32_t	enables;
45578 	/*
45579 	 * This bit must be '1' for the q_ab field to be
45580 	 * configured.
45581 	 */
45582 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_AB_VALID	UINT32_C(0x1)
45583 	/*
45584 	 * This bit must be '1' for the q_ba field to be
45585 	 * configured.
45586 	 */
45587 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_BA_VALID	UINT32_C(0x2)
45588 	/*
45589 	 * This bit must be '1' for the fc_ab field to be
45590 	 * configured.
45591 	 */
45592 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_AB_VALID	UINT32_C(0x4)
45593 	/*
45594 	 * This bit must be '1' for the fc_ba field to be
45595 	 * configured.
45596 	 */
45597 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_BA_VALID	UINT32_C(0x8)
45598 	/* VF Pair name (32 byte string). */
45599 	char	pair_name[32];
45600 	/*
45601 	 * The q_ab value specifies the logical index of the TX/RX CoS
45602 	 * queue to be assigned for traffic in the A to B direction of
45603 	 * the interface pair. The default value is 0.
45604 	 */
45605 	uint8_t	q_ab;
45606 	/*
45607 	 * The q_ba value specifies the logical index of the TX/RX CoS
45608 	 * queue to be assigned for traffic in the B to A direction of
45609 	 * the interface pair. The default value is 1.
45610 	 */
45611 	uint8_t	q_ba;
45612 	/*
45613 	 * Specifies whether RX ring flow control is disabled (0) or enabled
45614 	 * (1) in the A to B direction. The default value is 0, meaning that
45615 	 * packets will be dropped when the B-side RX rings are full.
45616 	 */
45617 	uint8_t	fc_ab;
45618 	/*
45619 	 * Specifies whether RX ring flow control is disabled (0) or enabled
45620 	 * (1) in the B to A direction. The default value is 1, meaning that
45621 	 * the RX CoS queue will be flow controlled when the A-side RX rings
45622 	 * are full.
45623 	 */
45624 	uint8_t	fc_ba;
45625 	uint8_t	unused_1[4];
45626 } hwrm_cfa_pair_alloc_input_t, *phwrm_cfa_pair_alloc_input_t;
45627 
45628 /* hwrm_cfa_pair_alloc_output (size:192b/24B) */
45629 
45630 typedef struct hwrm_cfa_pair_alloc_output {
45631 	/* The specific error status for the command. */
45632 	uint16_t	error_code;
45633 	/* The HWRM command request type. */
45634 	uint16_t	req_type;
45635 	/* The sequence ID from the original command. */
45636 	uint16_t	seq_id;
45637 	/* The length of the response data in number of bytes. */
45638 	uint16_t	resp_len;
45639 	/* Only valid for modes 1 and 2. */
45640 	uint16_t	rx_cfa_code_a;
45641 	/* Only valid for modes 1 and 2. */
45642 	uint16_t	tx_cfa_action_a;
45643 	/* Only valid for mode 2. */
45644 	uint16_t	rx_cfa_code_b;
45645 	/* Only valid for mode 2. */
45646 	uint16_t	tx_cfa_action_b;
45647 	uint8_t	unused_0[7];
45648 	/*
45649 	 * This field is used in Output records to indicate that the output
45650 	 * is completely written to RAM. This field should be read as '1'
45651 	 * to indicate that the output has been completely written.
45652 	 * When writing a command completion or response to an internal
45653 	 * processor, the order of writes has to be such that this field is
45654 	 * written last.
45655 	 */
45656 	uint8_t	valid;
45657 } hwrm_cfa_pair_alloc_output_t, *phwrm_cfa_pair_alloc_output_t;
45658 
45659 /**********************
45660  * hwrm_cfa_pair_free *
45661  **********************/
45662 
45663 
45664 /* hwrm_cfa_pair_free_input (size:448b/56B) */
45665 
45666 typedef struct hwrm_cfa_pair_free_input {
45667 	/* The HWRM command request type. */
45668 	uint16_t	req_type;
45669 	/*
45670 	 * The completion ring to send the completion event on. This should
45671 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45672 	 */
45673 	uint16_t	cmpl_ring;
45674 	/*
45675 	 * The sequence ID is used by the driver for tracking multiple
45676 	 * commands. This ID is treated as opaque data by the firmware and
45677 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45678 	 */
45679 	uint16_t	seq_id;
45680 	/*
45681 	 * The target ID of the command:
45682 	 * * 0x0-0xFFF8 - The function ID
45683 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45684 	 * * 0xFFFD - Reserved for user-space HWRM interface
45685 	 * * 0xFFFF - HWRM
45686 	 */
45687 	uint16_t	target_id;
45688 	/*
45689 	 * A physical address pointer pointing to a host buffer that the
45690 	 * command's response data will be written. This can be either a host
45691 	 * physical address (HPA) or a guest physical address (GPA) and must
45692 	 * point to a physically contiguous block of memory.
45693 	 */
45694 	uint64_t	resp_addr;
45695 	/* VF Pair name (32 byte string). */
45696 	char	pair_name[32];
45697 	/* Logical PF (0xff-PF for command channel). */
45698 	uint8_t	pf_b_id;
45699 	uint8_t	unused_0[3];
45700 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45701 	uint16_t	vf_id;
45702 	/*
45703 	 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
45704 	 *		5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
45705 	 */
45706 	uint16_t	pair_mode;
45707 	/*
45708 	 * Pair between VF on local host with PF or VF on specified host.
45709 	 * (deprecated)
45710 	 */
45711 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_VF2FN	UINT32_C(0x0)
45712 	/*
45713 	 * Pair between REP on local host with PF or VF on specified host.
45714 	 * (deprecated)
45715 	 */
45716 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN	UINT32_C(0x1)
45717 	/*
45718 	 * Pair between REP on local host with REP on specified host.
45719 	 * (deprecated)
45720 	 */
45721 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2REP	UINT32_C(0x2)
45722 	/* Pair for the proxy interface. (deprecated) */
45723 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PROXY	UINT32_C(0x3)
45724 	/* Pair for the PF interface. (deprecated) */
45725 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PFPAIR	UINT32_C(0x4)
45726 	/* Modify existing rep2fn pair and move pair to new PF. (deprecated) */
45727 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MOD	UINT32_C(0x5)
45728 	/*
45729 	 * Modify existing rep2fn pairs paired with same PF and move pairs
45730 	 * to new PF. (deprecated)
45731 	 */
45732 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
45733 	/*
45734 	 * Truflow pair between REP on local host with PF or VF on
45735 	 * specified host.
45736 	 */
45737 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
45738 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_LAST	HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW
45739 } hwrm_cfa_pair_free_input_t, *phwrm_cfa_pair_free_input_t;
45740 
45741 /* hwrm_cfa_pair_free_output (size:128b/16B) */
45742 
45743 typedef struct hwrm_cfa_pair_free_output {
45744 	/* The specific error status for the command. */
45745 	uint16_t	error_code;
45746 	/* The HWRM command request type. */
45747 	uint16_t	req_type;
45748 	/* The sequence ID from the original command. */
45749 	uint16_t	seq_id;
45750 	/* The length of the response data in number of bytes. */
45751 	uint16_t	resp_len;
45752 	uint8_t	unused_0[7];
45753 	/*
45754 	 * This field is used in Output records to indicate that the output
45755 	 * is completely written to RAM. This field should be read as '1'
45756 	 * to indicate that the output has been completely written.
45757 	 * When writing a command completion or response to an internal
45758 	 * processor, the order of writes has to be such that this field is
45759 	 * written last.
45760 	 */
45761 	uint8_t	valid;
45762 } hwrm_cfa_pair_free_output_t, *phwrm_cfa_pair_free_output_t;
45763 
45764 /**********************
45765  * hwrm_cfa_pair_info *
45766  **********************/
45767 
45768 
45769 /* hwrm_cfa_pair_info_input (size:448b/56B) */
45770 
45771 typedef struct hwrm_cfa_pair_info_input {
45772 	/* The HWRM command request type. */
45773 	uint16_t	req_type;
45774 	/*
45775 	 * The completion ring to send the completion event on. This should
45776 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45777 	 */
45778 	uint16_t	cmpl_ring;
45779 	/*
45780 	 * The sequence ID is used by the driver for tracking multiple
45781 	 * commands. This ID is treated as opaque data by the firmware and
45782 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45783 	 */
45784 	uint16_t	seq_id;
45785 	/*
45786 	 * The target ID of the command:
45787 	 * * 0x0-0xFFF8 - The function ID
45788 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45789 	 * * 0xFFFD - Reserved for user-space HWRM interface
45790 	 * * 0xFFFF - HWRM
45791 	 */
45792 	uint16_t	target_id;
45793 	/*
45794 	 * A physical address pointer pointing to a host buffer that the
45795 	 * command's response data will be written. This can be either a host
45796 	 * physical address (HPA) or a guest physical address (GPA) and must
45797 	 * point to a physically contiguous block of memory.
45798 	 */
45799 	uint64_t	resp_addr;
45800 	uint32_t	flags;
45801 	/* If this flag is set, lookup by name else lookup by index. */
45802 	#define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE	UINT32_C(0x1)
45803 	/* If this flag is set, lookup by PF id and VF id. */
45804 	#define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE	UINT32_C(0x2)
45805 	/* Pair table index. */
45806 	uint16_t	pair_index;
45807 	/* Pair pf index. */
45808 	uint8_t	pair_pfid;
45809 	/* Pair vf index. */
45810 	uint8_t	pair_vfid;
45811 	/* Pair name (32 byte string). */
45812 	char	pair_name[32];
45813 } hwrm_cfa_pair_info_input_t, *phwrm_cfa_pair_info_input_t;
45814 
45815 /* hwrm_cfa_pair_info_output (size:576b/72B) */
45816 
45817 typedef struct hwrm_cfa_pair_info_output {
45818 	/* The specific error status for the command. */
45819 	uint16_t	error_code;
45820 	/* The HWRM command request type. */
45821 	uint16_t	req_type;
45822 	/* The sequence ID from the original command. */
45823 	uint16_t	seq_id;
45824 	/* The length of the response data in number of bytes. */
45825 	uint16_t	resp_len;
45826 	/* Pair table index. */
45827 	uint16_t	next_pair_index;
45828 	/* Pair member a's fid. */
45829 	uint16_t	a_fid;
45830 	/* Logical host number. */
45831 	uint8_t	host_a_index;
45832 	/* Logical PF number. */
45833 	uint8_t	pf_a_index;
45834 	/* Pair member a's Linux logical VF number. */
45835 	uint16_t	vf_a_index;
45836 	/* Rx CFA code. */
45837 	uint16_t	rx_cfa_code_a;
45838 	/* Tx CFA action. */
45839 	uint16_t	tx_cfa_action_a;
45840 	/* Pair member b's fid. */
45841 	uint16_t	b_fid;
45842 	/* Logical host number. */
45843 	uint8_t	host_b_index;
45844 	/* Logical PF number. */
45845 	uint8_t	pf_b_index;
45846 	/* Pair member a's Linux logical VF number. */
45847 	uint16_t	vf_b_index;
45848 	/* Rx CFA code. */
45849 	uint16_t	rx_cfa_code_b;
45850 	/* Tx CFA action. */
45851 	uint16_t	tx_cfa_action_b;
45852 	/* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
45853 	uint8_t	pair_mode;
45854 	/*
45855 	 * Pair between VF on local host with PF or VF on specified host.
45856 	 * (deprecated)
45857 	 */
45858 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
45859 	/*
45860 	 * Pair between REP on local host with PF or VF on specified host.
45861 	 * (deprecated)
45862 	 */
45863 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
45864 	/*
45865 	 * Pair between REP on local host with REP on specified host.
45866 	 * (deprecated)
45867 	 */
45868 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
45869 	/* Pair for the proxy interface. (deprecated) */
45870 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
45871 	/* Pair for the PF interface. (deprecated) */
45872 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
45873 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST   HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
45874 	/* Pair state. */
45875 	uint8_t	pair_state;
45876 	/* Pair has been allocated */
45877 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
45878 	/* Both pair members are active */
45879 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE	UINT32_C(0x2)
45880 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST	HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
45881 	/* Pair name (32 byte string). */
45882 	char	pair_name[32];
45883 	uint8_t	unused_0[7];
45884 	/*
45885 	 * This field is used in Output records to indicate that the output
45886 	 * is completely written to RAM. This field should be read as '1'
45887 	 * to indicate that the output has been completely written.
45888 	 * When writing a command completion or response to an internal
45889 	 * processor, the order of writes has to be such that this field is
45890 	 * written last.
45891 	 */
45892 	uint8_t	valid;
45893 } hwrm_cfa_pair_info_output_t, *phwrm_cfa_pair_info_output_t;
45894 
45895 /**********************
45896  * hwrm_cfa_vfr_alloc *
45897  **********************/
45898 
45899 
45900 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
45901 
45902 typedef struct hwrm_cfa_vfr_alloc_input {
45903 	/* The HWRM command request type. */
45904 	uint16_t	req_type;
45905 	/*
45906 	 * The completion ring to send the completion event on. This should
45907 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45908 	 */
45909 	uint16_t	cmpl_ring;
45910 	/*
45911 	 * The sequence ID is used by the driver for tracking multiple
45912 	 * commands. This ID is treated as opaque data by the firmware and
45913 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45914 	 */
45915 	uint16_t	seq_id;
45916 	/*
45917 	 * The target ID of the command:
45918 	 * * 0x0-0xFFF8 - The function ID
45919 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45920 	 * * 0xFFFD - Reserved for user-space HWRM interface
45921 	 * * 0xFFFF - HWRM
45922 	 */
45923 	uint16_t	target_id;
45924 	/*
45925 	 * A physical address pointer pointing to a host buffer that the
45926 	 * command's response data will be written. This can be either a host
45927 	 * physical address (HPA) or a guest physical address (GPA) and must
45928 	 * point to a physically contiguous block of memory.
45929 	 */
45930 	uint64_t	resp_addr;
45931 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
45932 	uint16_t	vf_id;
45933 	/*
45934 	 * This field is reserved for the future use.
45935 	 * It shall be set to 0.
45936 	 */
45937 	uint16_t	reserved;
45938 	uint8_t	unused_0[4];
45939 	/* VF Representor name (32 byte string). */
45940 	char	vfr_name[32];
45941 } hwrm_cfa_vfr_alloc_input_t, *phwrm_cfa_vfr_alloc_input_t;
45942 
45943 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
45944 
45945 typedef struct hwrm_cfa_vfr_alloc_output {
45946 	/* The specific error status for the command. */
45947 	uint16_t	error_code;
45948 	/* The HWRM command request type. */
45949 	uint16_t	req_type;
45950 	/* The sequence ID from the original command. */
45951 	uint16_t	seq_id;
45952 	/* The length of the response data in number of bytes. */
45953 	uint16_t	resp_len;
45954 	/* Rx CFA code. */
45955 	uint16_t	rx_cfa_code;
45956 	/* Tx CFA action. */
45957 	uint16_t	tx_cfa_action;
45958 	uint8_t	unused_0[3];
45959 	/*
45960 	 * This field is used in Output records to indicate that the output
45961 	 * is completely written to RAM. This field should be read as '1'
45962 	 * to indicate that the output has been completely written.
45963 	 * When writing a command completion or response to an internal
45964 	 * processor, the order of writes has to be such that this field is
45965 	 * written last.
45966 	 */
45967 	uint8_t	valid;
45968 } hwrm_cfa_vfr_alloc_output_t, *phwrm_cfa_vfr_alloc_output_t;
45969 
45970 /*********************
45971  * hwrm_cfa_vfr_free *
45972  *********************/
45973 
45974 
45975 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
45976 
45977 typedef struct hwrm_cfa_vfr_free_input {
45978 	/* The HWRM command request type. */
45979 	uint16_t	req_type;
45980 	/*
45981 	 * The completion ring to send the completion event on. This should
45982 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45983 	 */
45984 	uint16_t	cmpl_ring;
45985 	/*
45986 	 * The sequence ID is used by the driver for tracking multiple
45987 	 * commands. This ID is treated as opaque data by the firmware and
45988 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45989 	 */
45990 	uint16_t	seq_id;
45991 	/*
45992 	 * The target ID of the command:
45993 	 * * 0x0-0xFFF8 - The function ID
45994 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45995 	 * * 0xFFFD - Reserved for user-space HWRM interface
45996 	 * * 0xFFFF - HWRM
45997 	 */
45998 	uint16_t	target_id;
45999 	/*
46000 	 * A physical address pointer pointing to a host buffer that the
46001 	 * command's response data will be written. This can be either a host
46002 	 * physical address (HPA) or a guest physical address (GPA) and must
46003 	 * point to a physically contiguous block of memory.
46004 	 */
46005 	uint64_t	resp_addr;
46006 	/* VF Representor name (32 byte string). */
46007 	char	vfr_name[32];
46008 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
46009 	uint16_t	vf_id;
46010 	/*
46011 	 * This field is reserved for the future use.
46012 	 * It shall be set to 0.
46013 	 */
46014 	uint16_t	reserved;
46015 	uint8_t	unused_0[4];
46016 } hwrm_cfa_vfr_free_input_t, *phwrm_cfa_vfr_free_input_t;
46017 
46018 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
46019 
46020 typedef struct hwrm_cfa_vfr_free_output {
46021 	/* The specific error status for the command. */
46022 	uint16_t	error_code;
46023 	/* The HWRM command request type. */
46024 	uint16_t	req_type;
46025 	/* The sequence ID from the original command. */
46026 	uint16_t	seq_id;
46027 	/* The length of the response data in number of bytes. */
46028 	uint16_t	resp_len;
46029 	uint8_t	unused_0[7];
46030 	/*
46031 	 * This field is used in Output records to indicate that the output
46032 	 * is completely written to RAM. This field should be read as '1'
46033 	 * to indicate that the output has been completely written.
46034 	 * When writing a command completion or response to an internal
46035 	 * processor, the order of writes has to be such that this field is
46036 	 * written last.
46037 	 */
46038 	uint8_t	valid;
46039 } hwrm_cfa_vfr_free_output_t, *phwrm_cfa_vfr_free_output_t;
46040 
46041 /***************************************
46042  * hwrm_cfa_redirect_query_tunnel_type *
46043  ***************************************/
46044 
46045 
46046 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
46047 
46048 typedef struct hwrm_cfa_redirect_query_tunnel_type_input {
46049 	/* The HWRM command request type. */
46050 	uint16_t	req_type;
46051 	/*
46052 	 * The completion ring to send the completion event on. This should
46053 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46054 	 */
46055 	uint16_t	cmpl_ring;
46056 	/*
46057 	 * The sequence ID is used by the driver for tracking multiple
46058 	 * commands. This ID is treated as opaque data by the firmware and
46059 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46060 	 */
46061 	uint16_t	seq_id;
46062 	/*
46063 	 * The target ID of the command:
46064 	 * * 0x0-0xFFF8 - The function ID
46065 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46066 	 * * 0xFFFD - Reserved for user-space HWRM interface
46067 	 * * 0xFFFF - HWRM
46068 	 */
46069 	uint16_t	target_id;
46070 	/*
46071 	 * A physical address pointer pointing to a host buffer that the
46072 	 * command's response data will be written. This can be either a host
46073 	 * physical address (HPA) or a guest physical address (GPA) and must
46074 	 * point to a physically contiguous block of memory.
46075 	 */
46076 	uint64_t	resp_addr;
46077 	/* The source function id. */
46078 	uint16_t	src_fid;
46079 	uint8_t	unused_0[6];
46080 } hwrm_cfa_redirect_query_tunnel_type_input_t, *phwrm_cfa_redirect_query_tunnel_type_input_t;
46081 
46082 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
46083 
46084 typedef struct hwrm_cfa_redirect_query_tunnel_type_output {
46085 	/* The specific error status for the command. */
46086 	uint16_t	error_code;
46087 	/* The HWRM command request type. */
46088 	uint16_t	req_type;
46089 	/* The sequence ID from the original command. */
46090 	uint16_t	seq_id;
46091 	/* The length of the response data in number of bytes. */
46092 	uint16_t	resp_len;
46093 	/* Tunnel Mask. */
46094 	uint32_t	tunnel_mask;
46095 	/* Non-tunnel */
46096 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL	UINT32_C(0x1)
46097 	/* Virtual eXtensible Local Area Network (VXLAN) */
46098 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN		UINT32_C(0x2)
46099 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46100 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE		UINT32_C(0x4)
46101 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
46102 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE		UINT32_C(0x8)
46103 	/* IP in IP */
46104 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP		UINT32_C(0x10)
46105 	/* Generic Network Virtualization Encapsulation (Geneve) */
46106 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE	UINT32_C(0x20)
46107 	/* Multi-Protocol Label Switching (MPLS) */
46108 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS		UINT32_C(0x40)
46109 	/* Stateless Transport Tunnel (STT) */
46110 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT		UINT32_C(0x80)
46111 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46112 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE		UINT32_C(0x100)
46113 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46114 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4	UINT32_C(0x200)
46115 	/*
46116 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46117 	 * datagram payload
46118 	 */
46119 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1	UINT32_C(0x400)
46120 	/* Any tunneled traffic */
46121 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL	UINT32_C(0x800)
46122 	/* Use fixed layer 2 ether type of 0xFFFF */
46123 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE	UINT32_C(0x1000)
46124 	/*
46125 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46126 	 * (IPV6oVXLANGPE)
46127 	 */
46128 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6	UINT32_C(0x2000)
46129 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46130 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE	UINT32_C(0x4000)
46131 	uint8_t	unused_0[3];
46132 	/*
46133 	 * This field is used in Output records to indicate that the output
46134 	 * is completely written to RAM. This field should be read as '1'
46135 	 * to indicate that the output has been completely written.
46136 	 * When writing a command completion or response to an internal
46137 	 * processor, the order of writes has to be such that this field is
46138 	 * written last.
46139 	 */
46140 	uint8_t	valid;
46141 } hwrm_cfa_redirect_query_tunnel_type_output_t, *phwrm_cfa_redirect_query_tunnel_type_output_t;
46142 
46143 /*************************
46144  * hwrm_cfa_ctx_mem_rgtr *
46145  *************************/
46146 
46147 
46148 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
46149 
46150 typedef struct hwrm_cfa_ctx_mem_rgtr_input {
46151 	/* The HWRM command request type. */
46152 	uint16_t	req_type;
46153 	/*
46154 	 * The completion ring to send the completion event on. This should
46155 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46156 	 */
46157 	uint16_t	cmpl_ring;
46158 	/*
46159 	 * The sequence ID is used by the driver for tracking multiple
46160 	 * commands. This ID is treated as opaque data by the firmware and
46161 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46162 	 */
46163 	uint16_t	seq_id;
46164 	/*
46165 	 * The target ID of the command:
46166 	 * * 0x0-0xFFF8 - The function ID
46167 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46168 	 * * 0xFFFD - Reserved for user-space HWRM interface
46169 	 * * 0xFFFF - HWRM
46170 	 */
46171 	uint16_t	target_id;
46172 	/*
46173 	 * A physical address pointer pointing to a host buffer that the
46174 	 * command's response data will be written. This can be either a host
46175 	 * physical address (HPA) or a guest physical address (GPA) and must
46176 	 * point to a physically contiguous block of memory.
46177 	 */
46178 	uint64_t	resp_addr;
46179 	uint16_t	flags;
46180 	/* Counter PBL indirect levels. */
46181 	uint8_t	page_level;
46182 	/* PBL pointer is physical start address. */
46183 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
46184 	/* PBL pointer points to PTE table. */
46185 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
46186 	/*
46187 	 * PBL pointer points to PDE table with each entry pointing to PTE
46188 	 * tables.
46189 	 */
46190 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
46191 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
46192 	/* Page size. */
46193 	uint8_t	page_size;
46194 	/* 4KB page size. */
46195 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
46196 	/* 8KB page size. */
46197 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
46198 	/* 64KB page size. */
46199 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
46200 	/* 256KB page size. */
46201 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
46202 	/* 1MB page size. */
46203 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
46204 	/* 2MB page size. */
46205 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
46206 	/* 4MB page size. */
46207 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
46208 	/* 1GB page size. */
46209 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
46210 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
46211 	uint32_t	unused_0;
46212 	/* Pointer to the PBL, or PDL depending on number of levels */
46213 	uint64_t	page_dir;
46214 } hwrm_cfa_ctx_mem_rgtr_input_t, *phwrm_cfa_ctx_mem_rgtr_input_t;
46215 
46216 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
46217 
46218 typedef struct hwrm_cfa_ctx_mem_rgtr_output {
46219 	/* The specific error status for the command. */
46220 	uint16_t	error_code;
46221 	/* The HWRM command request type. */
46222 	uint16_t	req_type;
46223 	/* The sequence ID from the original command. */
46224 	uint16_t	seq_id;
46225 	/* The length of the response data in number of bytes. */
46226 	uint16_t	resp_len;
46227 	/*
46228 	 * Id/Handle to the recently register context memory. This handle is
46229 	 * passed to the CFA feature.
46230 	 */
46231 	uint16_t	ctx_id;
46232 	uint8_t	unused_0[5];
46233 	/*
46234 	 * This field is used in Output records to indicate that the output
46235 	 * is completely written to RAM. This field should be read as '1'
46236 	 * to indicate that the output has been completely written.
46237 	 * When writing a command completion or response to an internal
46238 	 * processor, the order of writes has to be such that this field is
46239 	 * written last.
46240 	 */
46241 	uint8_t	valid;
46242 } hwrm_cfa_ctx_mem_rgtr_output_t, *phwrm_cfa_ctx_mem_rgtr_output_t;
46243 
46244 /***************************
46245  * hwrm_cfa_ctx_mem_unrgtr *
46246  ***************************/
46247 
46248 
46249 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
46250 
46251 typedef struct hwrm_cfa_ctx_mem_unrgtr_input {
46252 	/* The HWRM command request type. */
46253 	uint16_t	req_type;
46254 	/*
46255 	 * The completion ring to send the completion event on. This should
46256 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46257 	 */
46258 	uint16_t	cmpl_ring;
46259 	/*
46260 	 * The sequence ID is used by the driver for tracking multiple
46261 	 * commands. This ID is treated as opaque data by the firmware and
46262 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46263 	 */
46264 	uint16_t	seq_id;
46265 	/*
46266 	 * The target ID of the command:
46267 	 * * 0x0-0xFFF8 - The function ID
46268 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46269 	 * * 0xFFFD - Reserved for user-space HWRM interface
46270 	 * * 0xFFFF - HWRM
46271 	 */
46272 	uint16_t	target_id;
46273 	/*
46274 	 * A physical address pointer pointing to a host buffer that the
46275 	 * command's response data will be written. This can be either a host
46276 	 * physical address (HPA) or a guest physical address (GPA) and must
46277 	 * point to a physically contiguous block of memory.
46278 	 */
46279 	uint64_t	resp_addr;
46280 	/*
46281 	 * Id/Handle to the recently register context memory. This handle is
46282 	 * passed to the CFA feature.
46283 	 */
46284 	uint16_t	ctx_id;
46285 	uint8_t	unused_0[6];
46286 } hwrm_cfa_ctx_mem_unrgtr_input_t, *phwrm_cfa_ctx_mem_unrgtr_input_t;
46287 
46288 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
46289 
46290 typedef struct hwrm_cfa_ctx_mem_unrgtr_output {
46291 	/* The specific error status for the command. */
46292 	uint16_t	error_code;
46293 	/* The HWRM command request type. */
46294 	uint16_t	req_type;
46295 	/* The sequence ID from the original command. */
46296 	uint16_t	seq_id;
46297 	/* The length of the response data in number of bytes. */
46298 	uint16_t	resp_len;
46299 	uint8_t	unused_0[7];
46300 	/*
46301 	 * This field is used in Output records to indicate that the output
46302 	 * is completely written to RAM. This field should be read as '1'
46303 	 * to indicate that the output has been completely written.
46304 	 * When writing a command completion or response to an internal
46305 	 * processor, the order of writes has to be such that this field is
46306 	 * written last.
46307 	 */
46308 	uint8_t	valid;
46309 } hwrm_cfa_ctx_mem_unrgtr_output_t, *phwrm_cfa_ctx_mem_unrgtr_output_t;
46310 
46311 /*************************
46312  * hwrm_cfa_ctx_mem_qctx *
46313  *************************/
46314 
46315 
46316 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
46317 
46318 typedef struct hwrm_cfa_ctx_mem_qctx_input {
46319 	/* The HWRM command request type. */
46320 	uint16_t	req_type;
46321 	/*
46322 	 * The completion ring to send the completion event on. This should
46323 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46324 	 */
46325 	uint16_t	cmpl_ring;
46326 	/*
46327 	 * The sequence ID is used by the driver for tracking multiple
46328 	 * commands. This ID is treated as opaque data by the firmware and
46329 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46330 	 */
46331 	uint16_t	seq_id;
46332 	/*
46333 	 * The target ID of the command:
46334 	 * * 0x0-0xFFF8 - The function ID
46335 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46336 	 * * 0xFFFD - Reserved for user-space HWRM interface
46337 	 * * 0xFFFF - HWRM
46338 	 */
46339 	uint16_t	target_id;
46340 	/*
46341 	 * A physical address pointer pointing to a host buffer that the
46342 	 * command's response data will be written. This can be either a host
46343 	 * physical address (HPA) or a guest physical address (GPA) and must
46344 	 * point to a physically contiguous block of memory.
46345 	 */
46346 	uint64_t	resp_addr;
46347 	/*
46348 	 * Id/Handle to the recently register context memory. This handle is
46349 	 * passed to the CFA feature.
46350 	 */
46351 	uint16_t	ctx_id;
46352 	uint8_t	unused_0[6];
46353 } hwrm_cfa_ctx_mem_qctx_input_t, *phwrm_cfa_ctx_mem_qctx_input_t;
46354 
46355 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
46356 
46357 typedef struct hwrm_cfa_ctx_mem_qctx_output {
46358 	/* The specific error status for the command. */
46359 	uint16_t	error_code;
46360 	/* The HWRM command request type. */
46361 	uint16_t	req_type;
46362 	/* The sequence ID from the original command. */
46363 	uint16_t	seq_id;
46364 	/* The length of the response data in number of bytes. */
46365 	uint16_t	resp_len;
46366 	uint16_t	flags;
46367 	/* Counter PBL indirect levels. */
46368 	uint8_t	page_level;
46369 	/* PBL pointer is physical start address. */
46370 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
46371 	/* PBL pointer points to PTE table. */
46372 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
46373 	/*
46374 	 * PBL pointer points to PDE table with each entry pointing to PTE
46375 	 * tables.
46376 	 */
46377 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
46378 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
46379 	/* Page size. */
46380 	uint8_t	page_size;
46381 	/* 4KB page size. */
46382 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
46383 	/* 8KB page size. */
46384 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
46385 	/* 64KB page size. */
46386 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
46387 	/* 256KB page size. */
46388 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
46389 	/* 1MB page size. */
46390 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
46391 	/* 2MB page size. */
46392 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
46393 	/* 4MB page size. */
46394 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
46395 	/* 1GB page size. */
46396 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
46397 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
46398 	uint8_t	unused_0[4];
46399 	/* Pointer to the PBL, or PDL depending on number of levels */
46400 	uint64_t	page_dir;
46401 	uint8_t	unused_1[7];
46402 	/*
46403 	 * This field is used in Output records to indicate that the output
46404 	 * is completely written to RAM. This field should be read as '1'
46405 	 * to indicate that the output has been completely written.
46406 	 * When writing a command completion or response to an internal
46407 	 * processor, the order of writes has to be such that this field is
46408 	 * written last.
46409 	 */
46410 	uint8_t	valid;
46411 } hwrm_cfa_ctx_mem_qctx_output_t, *phwrm_cfa_ctx_mem_qctx_output_t;
46412 
46413 /**************************
46414  * hwrm_cfa_ctx_mem_qcaps *
46415  **************************/
46416 
46417 
46418 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
46419 
46420 typedef struct hwrm_cfa_ctx_mem_qcaps_input {
46421 	/* The HWRM command request type. */
46422 	uint16_t	req_type;
46423 	/*
46424 	 * The completion ring to send the completion event on. This should
46425 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46426 	 */
46427 	uint16_t	cmpl_ring;
46428 	/*
46429 	 * The sequence ID is used by the driver for tracking multiple
46430 	 * commands. This ID is treated as opaque data by the firmware and
46431 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46432 	 */
46433 	uint16_t	seq_id;
46434 	/*
46435 	 * The target ID of the command:
46436 	 * * 0x0-0xFFF8 - The function ID
46437 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46438 	 * * 0xFFFD - Reserved for user-space HWRM interface
46439 	 * * 0xFFFF - HWRM
46440 	 */
46441 	uint16_t	target_id;
46442 	/*
46443 	 * A physical address pointer pointing to a host buffer that the
46444 	 * command's response data will be written. This can be either a host
46445 	 * physical address (HPA) or a guest physical address (GPA) and must
46446 	 * point to a physically contiguous block of memory.
46447 	 */
46448 	uint64_t	resp_addr;
46449 } hwrm_cfa_ctx_mem_qcaps_input_t, *phwrm_cfa_ctx_mem_qcaps_input_t;
46450 
46451 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
46452 
46453 typedef struct hwrm_cfa_ctx_mem_qcaps_output {
46454 	/* The specific error status for the command. */
46455 	uint16_t	error_code;
46456 	/* The HWRM command request type. */
46457 	uint16_t	req_type;
46458 	/* The sequence ID from the original command. */
46459 	uint16_t	seq_id;
46460 	/* The length of the response data in number of bytes. */
46461 	uint16_t	resp_len;
46462 	/*
46463 	 * Indicates the maximum number of context memory which can be
46464 	 * registered.
46465 	 */
46466 	uint16_t	max_entries;
46467 	uint8_t	unused_0[5];
46468 	/*
46469 	 * This field is used in Output records to indicate that the output
46470 	 * is completely written to RAM. This field should be read as '1'
46471 	 * to indicate that the output has been completely written.
46472 	 * When writing a command completion or response to an internal
46473 	 * processor, the order of writes has to be such that this field is
46474 	 * written last.
46475 	 */
46476 	uint8_t	valid;
46477 } hwrm_cfa_ctx_mem_qcaps_output_t, *phwrm_cfa_ctx_mem_qcaps_output_t;
46478 
46479 /**************************
46480  * hwrm_cfa_counter_qcaps *
46481  **************************/
46482 
46483 
46484 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
46485 
46486 typedef struct hwrm_cfa_counter_qcaps_input {
46487 	/* The HWRM command request type. */
46488 	uint16_t	req_type;
46489 	/*
46490 	 * The completion ring to send the completion event on. This should
46491 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46492 	 */
46493 	uint16_t	cmpl_ring;
46494 	/*
46495 	 * The sequence ID is used by the driver for tracking multiple
46496 	 * commands. This ID is treated as opaque data by the firmware and
46497 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46498 	 */
46499 	uint16_t	seq_id;
46500 	/*
46501 	 * The target ID of the command:
46502 	 * * 0x0-0xFFF8 - The function ID
46503 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46504 	 * * 0xFFFD - Reserved for user-space HWRM interface
46505 	 * * 0xFFFF - HWRM
46506 	 */
46507 	uint16_t	target_id;
46508 	/*
46509 	 * A physical address pointer pointing to a host buffer that the
46510 	 * command's response data will be written. This can be either a host
46511 	 * physical address (HPA) or a guest physical address (GPA) and must
46512 	 * point to a physically contiguous block of memory.
46513 	 */
46514 	uint64_t	resp_addr;
46515 } hwrm_cfa_counter_qcaps_input_t, *phwrm_cfa_counter_qcaps_input_t;
46516 
46517 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
46518 
46519 typedef struct hwrm_cfa_counter_qcaps_output {
46520 	/* The specific error status for the command. */
46521 	uint16_t	error_code;
46522 	/* The HWRM command request type. */
46523 	uint16_t	req_type;
46524 	/* The sequence ID from the original command. */
46525 	uint16_t	seq_id;
46526 	/* The length of the response data in number of bytes. */
46527 	uint16_t	resp_len;
46528 	uint32_t	flags;
46529 	/* Enumeration denoting the supported CFA counter format. */
46530 	#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT	UINT32_C(0x1)
46531 	/* CFA counter types are not supported. */
46532 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE	UINT32_C(0x0)
46533 	/* 64-bit packet counters followed by 64-bit byte counters format. */
46534 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT  UINT32_C(0x1)
46535 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST   HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
46536 	uint32_t	unused_0;
46537 	/*
46538 	 * Minimum guaranteed number of flow counters supported for this
46539 	 * function, in RX direction.
46540 	 */
46541 	uint32_t	min_rx_fc;
46542 	/*
46543 	 * Maximum non-guaranteed number of flow counters supported for this
46544 	 * function, in RX direction.
46545 	 */
46546 	uint32_t	max_rx_fc;
46547 	/*
46548 	 * Minimum guaranteed number of flow counters supported for this
46549 	 * function, in TX direction.
46550 	 */
46551 	uint32_t	min_tx_fc;
46552 	/*
46553 	 * Maximum non-guaranteed number of flow counters supported for this
46554 	 * function, in TX direction.
46555 	 */
46556 	uint32_t	max_tx_fc;
46557 	/*
46558 	 * Minimum guaranteed number of extension flow counters supported for
46559 	 * this function, in RX direction.
46560 	 */
46561 	uint32_t	min_rx_efc;
46562 	/*
46563 	 * Maximum non-guaranteed number of extension flow counters supported
46564 	 * for this function, in RX direction.
46565 	 */
46566 	uint32_t	max_rx_efc;
46567 	/*
46568 	 * Minimum guaranteed number of extension flow counters supported for
46569 	 * this function, in TX direction.
46570 	 */
46571 	uint32_t	min_tx_efc;
46572 	/*
46573 	 * Maximum non-guaranteed number of extension flow counters supported
46574 	 * for this function, in TX direction.
46575 	 */
46576 	uint32_t	max_tx_efc;
46577 	/*
46578 	 * Minimum guaranteed number of meter drop counters supported for
46579 	 * this function, in RX direction.
46580 	 */
46581 	uint32_t	min_rx_mdc;
46582 	/*
46583 	 * Maximum non-guaranteed number of meter drop counters supported for
46584 	 * this function, in RX direction.
46585 	 */
46586 	uint32_t	max_rx_mdc;
46587 	/*
46588 	 * Minimum guaranteed number of meter drop counters supported for this
46589 	 * function, in TX direction.
46590 	 */
46591 	uint32_t	min_tx_mdc;
46592 	/*
46593 	 * Maximum non-guaranteed number of meter drop counters supported for
46594 	 * this function, in TX direction.
46595 	 */
46596 	uint32_t	max_tx_mdc;
46597 	/*
46598 	 * Maximum guaranteed number of flow counters which can be used during
46599 	 * flow alloc.
46600 	 */
46601 	uint32_t	max_flow_alloc_fc;
46602 	uint8_t	unused_1[3];
46603 	/*
46604 	 * This field is used in Output records to indicate that the output
46605 	 * is completely written to RAM. This field should be read as '1'
46606 	 * to indicate that the output has been completely written.
46607 	 * When writing a command completion or response to an internal
46608 	 * processor, the order of writes has to be such that this field is
46609 	 * written last.
46610 	 */
46611 	uint8_t	valid;
46612 } hwrm_cfa_counter_qcaps_output_t, *phwrm_cfa_counter_qcaps_output_t;
46613 
46614 /************************
46615  * hwrm_cfa_counter_cfg *
46616  ************************/
46617 
46618 
46619 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
46620 
46621 typedef struct hwrm_cfa_counter_cfg_input {
46622 	/* The HWRM command request type. */
46623 	uint16_t	req_type;
46624 	/*
46625 	 * The completion ring to send the completion event on. This should
46626 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46627 	 */
46628 	uint16_t	cmpl_ring;
46629 	/*
46630 	 * The sequence ID is used by the driver for tracking multiple
46631 	 * commands. This ID is treated as opaque data by the firmware and
46632 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46633 	 */
46634 	uint16_t	seq_id;
46635 	/*
46636 	 * The target ID of the command:
46637 	 * * 0x0-0xFFF8 - The function ID
46638 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46639 	 * * 0xFFFD - Reserved for user-space HWRM interface
46640 	 * * 0xFFFF - HWRM
46641 	 */
46642 	uint16_t	target_id;
46643 	/*
46644 	 * A physical address pointer pointing to a host buffer that the
46645 	 * command's response data will be written. This can be either a host
46646 	 * physical address (HPA) or a guest physical address (GPA) and must
46647 	 * point to a physically contiguous block of memory.
46648 	 */
46649 	uint64_t	resp_addr;
46650 	uint16_t	flags;
46651 	/* Enumeration denoting the configuration mode. */
46652 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE			UINT32_C(0x1)
46653 	/* Disable the configuration mode. */
46654 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE		UINT32_C(0x0)
46655 	/* Enable the configuration mode. */
46656 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE		UINT32_C(0x1)
46657 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST		HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
46658 	/* Enumeration denoting the RX, TX type of the resource. */
46659 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH			UINT32_C(0x2)
46660 	/* Tx path. */
46661 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX			(UINT32_C(0x0) << 1)
46662 	/* Rx path. */
46663 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX			(UINT32_C(0x1) << 1)
46664 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST			HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
46665 	/* Enumeration denoting the data transfer mode. */
46666 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK	UINT32_C(0xc)
46667 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT	2
46668 	/* Push mode. */
46669 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH	(UINT32_C(0x0) << 2)
46670 	/* Pull mode. */
46671 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL	(UINT32_C(0x1) << 2)
46672 	/* Pull on async update. */
46673 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC  (UINT32_C(0x2) << 2)
46674 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST	HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
46675 	uint16_t	counter_type;
46676 	/* Flow counters. */
46677 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC  UINT32_C(0x0)
46678 	/* Extended flow counters. */
46679 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
46680 	/* Meter drop counters. */
46681 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
46682 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
46683 	/* Ctx memory handle to be used for the counter. */
46684 	uint16_t	ctx_id;
46685 	/* Counter update cadence hint (only in Push mode). */
46686 	uint16_t	update_tmr_ms;
46687 	/* Total number of entries. */
46688 	uint32_t	num_entries;
46689 	uint32_t	unused_0;
46690 } hwrm_cfa_counter_cfg_input_t, *phwrm_cfa_counter_cfg_input_t;
46691 
46692 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
46693 
46694 typedef struct hwrm_cfa_counter_cfg_output {
46695 	/* The specific error status for the command. */
46696 	uint16_t	error_code;
46697 	/* The HWRM command request type. */
46698 	uint16_t	req_type;
46699 	/* The sequence ID from the original command. */
46700 	uint16_t	seq_id;
46701 	/* The length of the response data in number of bytes. */
46702 	uint16_t	resp_len;
46703 	uint8_t	unused_0[7];
46704 	/*
46705 	 * This field is used in Output records to indicate that the output
46706 	 * is completely written to RAM. This field should be read as '1'
46707 	 * to indicate that the output has been completely written.
46708 	 * When writing a command completion or response to an internal
46709 	 * processor, the order of writes has to be such that this field is
46710 	 * written last.
46711 	 */
46712 	uint8_t	valid;
46713 } hwrm_cfa_counter_cfg_output_t, *phwrm_cfa_counter_cfg_output_t;
46714 
46715 /*************************
46716  * hwrm_cfa_counter_qcfg *
46717  *************************/
46718 
46719 
46720 /* hwrm_cfa_counter_qcfg_input (size:192b/24B) */
46721 
46722 typedef struct hwrm_cfa_counter_qcfg_input {
46723 	/* The HWRM command request type. */
46724 	uint16_t	req_type;
46725 	/*
46726 	 * The completion ring to send the completion event on. This should
46727 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46728 	 */
46729 	uint16_t	cmpl_ring;
46730 	/*
46731 	 * The sequence ID is used by the driver for tracking multiple
46732 	 * commands. This ID is treated as opaque data by the firmware and
46733 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46734 	 */
46735 	uint16_t	seq_id;
46736 	/*
46737 	 * The target ID of the command:
46738 	 * * 0x0-0xFFF8 - The function ID
46739 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46740 	 * * 0xFFFD - Reserved for user-space HWRM interface
46741 	 * * 0xFFFF - HWRM
46742 	 */
46743 	uint16_t	target_id;
46744 	/*
46745 	 * A physical address pointer pointing to a host buffer that the
46746 	 * command's response data will be written. This can be either a host
46747 	 * physical address (HPA) or a guest physical address (GPA) and must
46748 	 * point to a physically contiguous block of memory.
46749 	 */
46750 	uint64_t	resp_addr;
46751 	uint16_t	flags;
46752 	/* Enumeration denoting the RX, TX type of the resource. */
46753 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH			UINT32_C(0x1)
46754 	/* Tx path. */
46755 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_TX			UINT32_C(0x0)
46756 	/* Rx path. */
46757 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_RX			UINT32_C(0x1)
46758 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_LAST			HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_RX
46759 	/* Enumeration denoting the data transfer mode. */
46760 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK	UINT32_C(0x6)
46761 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT	1
46762 	/* Push mode. */
46763 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH	(UINT32_C(0x0) << 1)
46764 	/* Pull mode. */
46765 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL	(UINT32_C(0x1) << 1)
46766 	/* Pull on async update. */
46767 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC  (UINT32_C(0x2) << 1)
46768 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST	HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
46769 	uint16_t	counter_type;
46770 	uint32_t	unused_0;
46771 } hwrm_cfa_counter_qcfg_input_t, *phwrm_cfa_counter_qcfg_input_t;
46772 
46773 /* hwrm_cfa_counter_qcfg_output (size:192b/24B) */
46774 
46775 typedef struct hwrm_cfa_counter_qcfg_output {
46776 	/* The specific error status for the command. */
46777 	uint16_t	error_code;
46778 	/* The HWRM command request type. */
46779 	uint16_t	req_type;
46780 	/* The sequence ID from the original command. */
46781 	uint16_t	seq_id;
46782 	/* The length of the response data in number of bytes. */
46783 	uint16_t	resp_len;
46784 	uint16_t	ctx_id;
46785 	uint16_t	update_tmr_ms;
46786 	uint32_t	num_entries;
46787 	uint8_t	unused_0[7];
46788 	/*
46789 	 * This field is used in Output records to indicate that the output
46790 	 * is completely written to RAM. This field should be read as '1'
46791 	 * to indicate that the output has been completely written.
46792 	 * When writing a command completion or response to an internal
46793 	 * processor, the order of writes has to be such that this field is
46794 	 * written last.
46795 	 */
46796 	uint8_t	valid;
46797 } hwrm_cfa_counter_qcfg_output_t, *phwrm_cfa_counter_qcfg_output_t;
46798 
46799 /***************************
46800  * hwrm_cfa_counter_qstats *
46801  ***************************/
46802 
46803 
46804 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
46805 
46806 typedef struct hwrm_cfa_counter_qstats_input {
46807 	/* The HWRM command request type. */
46808 	uint16_t	req_type;
46809 	/*
46810 	 * The completion ring to send the completion event on. This should
46811 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46812 	 */
46813 	uint16_t	cmpl_ring;
46814 	/*
46815 	 * The sequence ID is used by the driver for tracking multiple
46816 	 * commands. This ID is treated as opaque data by the firmware and
46817 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46818 	 */
46819 	uint16_t	seq_id;
46820 	/*
46821 	 * The target ID of the command:
46822 	 * * 0x0-0xFFF8 - The function ID
46823 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46824 	 * * 0xFFFD - Reserved for user-space HWRM interface
46825 	 * * 0xFFFF - HWRM
46826 	 */
46827 	uint16_t	target_id;
46828 	/*
46829 	 * A physical address pointer pointing to a host buffer that the
46830 	 * command's response data will be written. This can be either a host
46831 	 * physical address (HPA) or a guest physical address (GPA) and must
46832 	 * point to a physically contiguous block of memory.
46833 	 */
46834 	uint64_t	resp_addr;
46835 	uint16_t	flags;
46836 	/* Enumeration denoting the RX, TX type of the resource. */
46837 	#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH	UINT32_C(0x1)
46838 	/* Tx path. */
46839 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
46840 	/* Rx path. */
46841 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
46842 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
46843 	uint16_t	counter_type;
46844 	uint16_t	input_flow_ctx_id;
46845 	uint16_t	num_entries;
46846 	uint16_t	delta_time_ms;
46847 	uint16_t	meter_instance_id;
46848 	uint16_t	mdc_ctx_id;
46849 	uint8_t	unused_0[2];
46850 	uint64_t	expected_count;
46851 } hwrm_cfa_counter_qstats_input_t, *phwrm_cfa_counter_qstats_input_t;
46852 
46853 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
46854 
46855 typedef struct hwrm_cfa_counter_qstats_output {
46856 	/* The specific error status for the command. */
46857 	uint16_t	error_code;
46858 	/* The HWRM command request type. */
46859 	uint16_t	req_type;
46860 	/* The sequence ID from the original command. */
46861 	uint16_t	seq_id;
46862 	/* The length of the response data in number of bytes. */
46863 	uint16_t	resp_len;
46864 	uint8_t	unused_0[7];
46865 	/*
46866 	 * This field is used in Output records to indicate that the output
46867 	 * is completely written to RAM. This field should be read as '1'
46868 	 * to indicate that the output has been completely written.
46869 	 * When writing a command completion or response to an internal
46870 	 * processor, the order of writes has to be such that this field is
46871 	 * written last.
46872 	 */
46873 	uint8_t	valid;
46874 } hwrm_cfa_counter_qstats_output_t, *phwrm_cfa_counter_qstats_output_t;
46875 
46876 /**********************
46877  * hwrm_cfa_eem_qcaps *
46878  **********************/
46879 
46880 
46881 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
46882 
46883 typedef struct hwrm_cfa_eem_qcaps_input {
46884 	/* The HWRM command request type. */
46885 	uint16_t	req_type;
46886 	/*
46887 	 * The completion ring to send the completion event on. This should
46888 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46889 	 */
46890 	uint16_t	cmpl_ring;
46891 	/*
46892 	 * The sequence ID is used by the driver for tracking multiple
46893 	 * commands. This ID is treated as opaque data by the firmware and
46894 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46895 	 */
46896 	uint16_t	seq_id;
46897 	/*
46898 	 * The target ID of the command:
46899 	 * * 0x0-0xFFF8 - The function ID
46900 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46901 	 * * 0xFFFD - Reserved for user-space HWRM interface
46902 	 * * 0xFFFF - HWRM
46903 	 */
46904 	uint16_t	target_id;
46905 	/*
46906 	 * A physical address pointer pointing to a host buffer that the
46907 	 * command's response data will be written. This can be either a host
46908 	 * physical address (HPA) or a guest physical address (GPA) and must
46909 	 * point to a physically contiguous block of memory.
46910 	 */
46911 	uint64_t	resp_addr;
46912 	uint32_t	flags;
46913 	/*
46914 	 * When set to 1, indicates the configuration will apply to TX flows
46915 	 * which are to be offloaded.
46916 	 * Note if this bit is set then the path_rx bit can't be set.
46917 	 */
46918 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX		UINT32_C(0x1)
46919 	/*
46920 	 * When set to 1, indicates the configuration will apply to RX flows
46921 	 * which are to be offloaded.
46922 	 * Note if this bit is set then the path_tx bit can't be set.
46923 	 */
46924 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX		UINT32_C(0x2)
46925 	/* When set to 1, all offloaded flows will be sent to EEM. */
46926 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
46927 	uint32_t	unused_0;
46928 } hwrm_cfa_eem_qcaps_input_t, *phwrm_cfa_eem_qcaps_input_t;
46929 
46930 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
46931 
46932 typedef struct hwrm_cfa_eem_qcaps_output {
46933 	/* The specific error status for the command. */
46934 	uint16_t	error_code;
46935 	/* The HWRM command request type. */
46936 	uint16_t	req_type;
46937 	/* The sequence ID from the original command. */
46938 	uint16_t	seq_id;
46939 	/* The length of the response data in number of bytes. */
46940 	uint16_t	resp_len;
46941 	uint32_t	flags;
46942 	/*
46943 	 * When set to 1, indicates the configuration will apply to TX flows
46944 	 * which are to be offloaded.
46945 	 * Note if this bit is set then the path_rx bit can't be set.
46946 	 */
46947 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX					UINT32_C(0x1)
46948 	/*
46949 	 * When set to 1, indicates the configuration will apply to RX flows
46950 	 * which are to be offloaded.
46951 	 * Note if this bit is set then the path_tx bit can't be set.
46952 	 */
46953 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX					UINT32_C(0x2)
46954 	/*
46955 	 * When set to 1, indicates the FW supports the Centralized
46956 	 * Memory Model. The concept designates one entity for the
46957 	 * memory allocation while all others ‘subscribe’ to it.
46958 	 */
46959 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED		UINT32_C(0x4)
46960 	/*
46961 	 * When set to 1, indicates the FW supports the Detached
46962 	 * Centralized Memory Model. The memory is allocated and managed
46963 	 * as a separate entity. All PFs and VFs will be granted direct
46964 	 * or semi-direct access to the allocated memory while none of
46965 	 * which can interfere with the management of the memory.
46966 	 */
46967 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED	UINT32_C(0x8)
46968 	uint32_t	unused_0;
46969 	uint32_t	supported;
46970 	/*
46971 	 * If set to 1, then EEM KEY0 table is supported using crc32 hash.
46972 	 * If set to 0, EEM KEY0 table is not supported.
46973 	 */
46974 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE			UINT32_C(0x1)
46975 	/*
46976 	 * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
46977 	 * If set to 0, EEM KEY1 table is not supported.
46978 	 */
46979 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE			UINT32_C(0x2)
46980 	/*
46981 	 * If set to 1, then EEM External Record table is supported.
46982 	 * If set to 0, EEM External Record table is not supported.
46983 	 * (This table includes action record, EFC pointers, encap pointers)
46984 	 */
46985 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE		UINT32_C(0x4)
46986 	/*
46987 	 * If set to 1, then EEM External Flow Counters table is supported.
46988 	 * If set to 0, EEM External Flow Counters table is not supported.
46989 	 */
46990 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE	UINT32_C(0x8)
46991 	/*
46992 	 * If set to 1, then FID table used for implicit flow flush is
46993 	 * supported.
46994 	 * If set to 0, then FID table used for implicit flow flush is
46995 	 * not supported.
46996 	 */
46997 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE			UINT32_C(0x10)
46998 	/*
46999 	 * The maximum number of entries supported by EEM. When configuring
47000 	 * the host memory, the number of numbers of entries that can
47001 	 * supported are:
47002 	 *	32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M
47003 	 *	entries.
47004 	 * Any value that are not these values, the FW will round down to the
47005 	 * closest support number of entries.
47006 	 */
47007 	uint32_t	max_entries_supported;
47008 	/* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
47009 	uint16_t	key_entry_size;
47010 	/* The entry size in bytes of each entry in the EEM RECORD tables. */
47011 	uint16_t	record_entry_size;
47012 	/* The entry size in bytes of each entry in the EEM EFC tables. */
47013 	uint16_t	efc_entry_size;
47014 	/* The FID size in bytes of each entry in the EEM FID tables. */
47015 	uint16_t	fid_entry_size;
47016 	uint8_t	unused_1[7];
47017 	/*
47018 	 * This field is used in Output records to indicate that the output
47019 	 * is completely written to RAM. This field should be read as '1'
47020 	 * to indicate that the output has been completely written.
47021 	 * When writing a command completion or response to an internal
47022 	 * processor, the order of writes has to be such that this field is
47023 	 * written last.
47024 	 */
47025 	uint8_t	valid;
47026 } hwrm_cfa_eem_qcaps_output_t, *phwrm_cfa_eem_qcaps_output_t;
47027 
47028 /********************
47029  * hwrm_cfa_eem_cfg *
47030  ********************/
47031 
47032 
47033 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
47034 
47035 typedef struct hwrm_cfa_eem_cfg_input {
47036 	/* The HWRM command request type. */
47037 	uint16_t	req_type;
47038 	/*
47039 	 * The completion ring to send the completion event on. This should
47040 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47041 	 */
47042 	uint16_t	cmpl_ring;
47043 	/*
47044 	 * The sequence ID is used by the driver for tracking multiple
47045 	 * commands. This ID is treated as opaque data by the firmware and
47046 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47047 	 */
47048 	uint16_t	seq_id;
47049 	/*
47050 	 * The target ID of the command:
47051 	 * * 0x0-0xFFF8 - The function ID
47052 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47053 	 * * 0xFFFD - Reserved for user-space HWRM interface
47054 	 * * 0xFFFF - HWRM
47055 	 */
47056 	uint16_t	target_id;
47057 	/*
47058 	 * A physical address pointer pointing to a host buffer that the
47059 	 * command's response data will be written. This can be either a host
47060 	 * physical address (HPA) or a guest physical address (GPA) and must
47061 	 * point to a physically contiguous block of memory.
47062 	 */
47063 	uint64_t	resp_addr;
47064 	uint32_t	flags;
47065 	/*
47066 	 * When set to 1, indicates the configuration will apply to TX flows
47067 	 * which are to be offloaded.
47068 	 * Note if this bit is set then the path_rx bit can't be set.
47069 	 */
47070 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x1)
47071 	/*
47072 	 * When set to 1, indicates the configuration will apply to RX flows
47073 	 * which are to be offloaded.
47074 	 * Note if this bit is set then the path_tx bit can't be set.
47075 	 */
47076 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x2)
47077 	/* When set to 1, all offloaded flows will be sent to EEM. */
47078 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
47079 	/* When set to 1, secondary, 0 means primary. */
47080 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF	UINT32_C(0x8)
47081 	/*
47082 	 * Group_id which used by Firmware to identify memory pools belonging
47083 	 * to certain group.
47084 	 */
47085 	uint16_t	group_id;
47086 	uint16_t	unused_0;
47087 	/*
47088 	 * Configured EEM with the given number of entries. All the EEM tables
47089 	 * KEY0, KEY1, RECORD, EFC all have the same number of entries and all
47090 	 * tables will be configured using this value. Current minimum value
47091 	 * is 32k. Current maximum value is 128M.
47092 	 */
47093 	uint32_t	num_entries;
47094 	uint32_t	unused_1;
47095 	/* Configured EEM with the given context if for KEY0 table. */
47096 	uint16_t	key0_ctx_id;
47097 	/* Configured EEM with the given context if for KEY1 table. */
47098 	uint16_t	key1_ctx_id;
47099 	/* Configured EEM with the given context if for RECORD table. */
47100 	uint16_t	record_ctx_id;
47101 	/* Configured EEM with the given context if for EFC table. */
47102 	uint16_t	efc_ctx_id;
47103 	/* Configured EEM with the given context if for EFC table. */
47104 	uint16_t	fid_ctx_id;
47105 	uint16_t	unused_2;
47106 	uint32_t	unused_3;
47107 } hwrm_cfa_eem_cfg_input_t, *phwrm_cfa_eem_cfg_input_t;
47108 
47109 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
47110 
47111 typedef struct hwrm_cfa_eem_cfg_output {
47112 	/* The specific error status for the command. */
47113 	uint16_t	error_code;
47114 	/* The HWRM command request type. */
47115 	uint16_t	req_type;
47116 	/* The sequence ID from the original command. */
47117 	uint16_t	seq_id;
47118 	/* The length of the response data in number of bytes. */
47119 	uint16_t	resp_len;
47120 	uint8_t	unused_0[7];
47121 	/*
47122 	 * This field is used in Output records to indicate that the output
47123 	 * is completely written to RAM. This field should be read as '1'
47124 	 * to indicate that the output has been completely written.
47125 	 * When writing a command completion or response to an internal
47126 	 * processor, the order of writes has to be such that this field is
47127 	 * written last.
47128 	 */
47129 	uint8_t	valid;
47130 } hwrm_cfa_eem_cfg_output_t, *phwrm_cfa_eem_cfg_output_t;
47131 
47132 /*********************
47133  * hwrm_cfa_eem_qcfg *
47134  *********************/
47135 
47136 
47137 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
47138 
47139 typedef struct hwrm_cfa_eem_qcfg_input {
47140 	/* The HWRM command request type. */
47141 	uint16_t	req_type;
47142 	/*
47143 	 * The completion ring to send the completion event on. This should
47144 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47145 	 */
47146 	uint16_t	cmpl_ring;
47147 	/*
47148 	 * The sequence ID is used by the driver for tracking multiple
47149 	 * commands. This ID is treated as opaque data by the firmware and
47150 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47151 	 */
47152 	uint16_t	seq_id;
47153 	/*
47154 	 * The target ID of the command:
47155 	 * * 0x0-0xFFF8 - The function ID
47156 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47157 	 * * 0xFFFD - Reserved for user-space HWRM interface
47158 	 * * 0xFFFF - HWRM
47159 	 */
47160 	uint16_t	target_id;
47161 	/*
47162 	 * A physical address pointer pointing to a host buffer that the
47163 	 * command's response data will be written. This can be either a host
47164 	 * physical address (HPA) or a guest physical address (GPA) and must
47165 	 * point to a physically contiguous block of memory.
47166 	 */
47167 	uint64_t	resp_addr;
47168 	uint32_t	flags;
47169 	/* When set to 1, indicates the configuration is the TX flow. */
47170 	#define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x1)
47171 	/* When set to 1, indicates the configuration is the RX flow. */
47172 	#define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x2)
47173 	uint32_t	unused_0;
47174 } hwrm_cfa_eem_qcfg_input_t, *phwrm_cfa_eem_qcfg_input_t;
47175 
47176 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
47177 
47178 typedef struct hwrm_cfa_eem_qcfg_output {
47179 	/* The specific error status for the command. */
47180 	uint16_t	error_code;
47181 	/* The HWRM command request type. */
47182 	uint16_t	req_type;
47183 	/* The sequence ID from the original command. */
47184 	uint16_t	seq_id;
47185 	/* The length of the response data in number of bytes. */
47186 	uint16_t	resp_len;
47187 	uint32_t	flags;
47188 	/* When set to 1, indicates the configuration is the TX flow. */
47189 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX		UINT32_C(0x1)
47190 	/* When set to 1, indicates the configuration is the RX flow. */
47191 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX		UINT32_C(0x2)
47192 	/* When set to 1, all offloaded flows will be sent to EEM. */
47193 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
47194 	/* The number of entries the FW has configured for EEM. */
47195 	uint32_t	num_entries;
47196 	/* Configured EEM with the given context if for KEY0 table. */
47197 	uint16_t	key0_ctx_id;
47198 	/* Configured EEM with the given context if for KEY1 table. */
47199 	uint16_t	key1_ctx_id;
47200 	/* Configured EEM with the given context if for RECORD table. */
47201 	uint16_t	record_ctx_id;
47202 	/* Configured EEM with the given context if for EFC table. */
47203 	uint16_t	efc_ctx_id;
47204 	/* Configured EEM with the given context if for EFC table. */
47205 	uint16_t	fid_ctx_id;
47206 	uint8_t	unused_2[5];
47207 	/*
47208 	 * This field is used in Output records to indicate that the output
47209 	 * is completely written to RAM. This field should be read as '1'
47210 	 * to indicate that the output has been completely written.
47211 	 * When writing a command completion or response to an internal
47212 	 * processor, the order of writes has to be such that this field is
47213 	 * written last.
47214 	 */
47215 	uint8_t	valid;
47216 } hwrm_cfa_eem_qcfg_output_t, *phwrm_cfa_eem_qcfg_output_t;
47217 
47218 /*******************
47219  * hwrm_cfa_eem_op *
47220  *******************/
47221 
47222 
47223 /* hwrm_cfa_eem_op_input (size:192b/24B) */
47224 
47225 typedef struct hwrm_cfa_eem_op_input {
47226 	/* The HWRM command request type. */
47227 	uint16_t	req_type;
47228 	/*
47229 	 * The completion ring to send the completion event on. This should
47230 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47231 	 */
47232 	uint16_t	cmpl_ring;
47233 	/*
47234 	 * The sequence ID is used by the driver for tracking multiple
47235 	 * commands. This ID is treated as opaque data by the firmware and
47236 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47237 	 */
47238 	uint16_t	seq_id;
47239 	/*
47240 	 * The target ID of the command:
47241 	 * * 0x0-0xFFF8 - The function ID
47242 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47243 	 * * 0xFFFD - Reserved for user-space HWRM interface
47244 	 * * 0xFFFF - HWRM
47245 	 */
47246 	uint16_t	target_id;
47247 	/*
47248 	 * A physical address pointer pointing to a host buffer that the
47249 	 * command's response data will be written. This can be either a host
47250 	 * physical address (HPA) or a guest physical address (GPA) and must
47251 	 * point to a physically contiguous block of memory.
47252 	 */
47253 	uint64_t	resp_addr;
47254 	uint32_t	flags;
47255 	/*
47256 	 * When set to 1, indicates the host memory which is passed will be
47257 	 * used for the TX flow offload function specified in fid.
47258 	 * Note if this bit is set then the path_rx bit can't be set.
47259 	 */
47260 	#define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX	UINT32_C(0x1)
47261 	/*
47262 	 * When set to 1, indicates the host memory which is passed will be
47263 	 * used for the RX flow offload function specified in fid.
47264 	 * Note if this bit is set then the path_tx bit can't be set.
47265 	 */
47266 	#define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX	UINT32_C(0x2)
47267 	uint16_t	unused_0;
47268 	/* The number of EEM key table entries to be configured. */
47269 	uint16_t	op;
47270 	/* This value is reserved and should not be used. */
47271 	#define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED	UINT32_C(0x0)
47272 	/*
47273 	 * To properly stop EEM and ensure there are no DMA's, the caller
47274 	 * must disable EEM for the given PF, using this call. This will
47275 	 * safely disable EEM and ensure that all DMA'ed to the
47276 	 * keys/records/efc have been completed.
47277 	 */
47278 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
47279 	/*
47280 	 * Once the EEM host memory has been configured, EEM options have
47281 	 * been configured. Then the caller should enable EEM for the given
47282 	 * PF. Note once this call has been made, then the EEM mechanism
47283 	 * will be active and DMA's will occur as packets are processed.
47284 	 */
47285 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
47286 	/*
47287 	 * Clear EEM settings for the given PF so that the register values
47288 	 * are reset back to there initial state.
47289 	 */
47290 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
47291 	#define HWRM_CFA_EEM_OP_INPUT_OP_LAST	HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
47292 } hwrm_cfa_eem_op_input_t, *phwrm_cfa_eem_op_input_t;
47293 
47294 /* hwrm_cfa_eem_op_output (size:128b/16B) */
47295 
47296 typedef struct hwrm_cfa_eem_op_output {
47297 	/* The specific error status for the command. */
47298 	uint16_t	error_code;
47299 	/* The HWRM command request type. */
47300 	uint16_t	req_type;
47301 	/* The sequence ID from the original command. */
47302 	uint16_t	seq_id;
47303 	/* The length of the response data in number of bytes. */
47304 	uint16_t	resp_len;
47305 	uint8_t	unused_0[7];
47306 	/*
47307 	 * This field is used in Output records to indicate that the output
47308 	 * is completely written to RAM. This field should be read as '1'
47309 	 * to indicate that the output has been completely written.
47310 	 * When writing a command completion or response to an internal
47311 	 * processor, the order of writes has to be such that this field is
47312 	 * written last.
47313 	 */
47314 	uint8_t	valid;
47315 } hwrm_cfa_eem_op_output_t, *phwrm_cfa_eem_op_output_t;
47316 
47317 /********************************
47318  * hwrm_cfa_adv_flow_mgnt_qcaps *
47319  ********************************/
47320 
47321 
47322 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
47323 
47324 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
47325 	/* The HWRM command request type. */
47326 	uint16_t	req_type;
47327 	/*
47328 	 * The completion ring to send the completion event on. This should
47329 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47330 	 */
47331 	uint16_t	cmpl_ring;
47332 	/*
47333 	 * The sequence ID is used by the driver for tracking multiple
47334 	 * commands. This ID is treated as opaque data by the firmware and
47335 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47336 	 */
47337 	uint16_t	seq_id;
47338 	/*
47339 	 * The target ID of the command:
47340 	 * * 0x0-0xFFF8 - The function ID
47341 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47342 	 * * 0xFFFD - Reserved for user-space HWRM interface
47343 	 * * 0xFFFF - HWRM
47344 	 */
47345 	uint16_t	target_id;
47346 	/*
47347 	 * A physical address pointer pointing to a host buffer that the
47348 	 * command's response data will be written. This can be either a host
47349 	 * physical address (HPA) or a guest physical address (GPA) and must
47350 	 * point to a physically contiguous block of memory.
47351 	 */
47352 	uint64_t	resp_addr;
47353 	uint32_t	unused_0[4];
47354 } hwrm_cfa_adv_flow_mgnt_qcaps_input_t, *phwrm_cfa_adv_flow_mgnt_qcaps_input_t;
47355 
47356 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
47357 
47358 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
47359 	/* The specific error status for the command. */
47360 	uint16_t	error_code;
47361 	/* The HWRM command request type. */
47362 	uint16_t	req_type;
47363 	/* The sequence ID from the original command. */
47364 	uint16_t	seq_id;
47365 	/* The length of the response data in number of bytes. */
47366 	uint16_t	resp_len;
47367 	uint32_t	flags;
47368 	/*
47369 	 * Value of 1 to indicate firmware support 16-bit flow handle.
47370 	 * Value of 0 to indicate firmware not support 16-bit flow handle.
47371 	 */
47372 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED			UINT32_C(0x1)
47373 	/*
47374 	 * Value of 1 to indicate firmware support 64-bit flow handle.
47375 	 * Value of 0 to indicate firmware not support 64-bit flow handle.
47376 	 */
47377 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED			UINT32_C(0x2)
47378 	/*
47379 	 * Value of 1 to indicate firmware support flow batch delete
47380 	 * operation through HWRM_CFA_FLOW_FLUSH command.
47381 	 * Value of 0 to indicate that the firmware does not support flow
47382 	 * batch delete operation. (deprecated)
47383 	 */
47384 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED		UINT32_C(0x4)
47385 	/*
47386 	 * Value of 1 to indicate that the firmware support flow reset all
47387 	 * operation through HWRM_CFA_FLOW_FLUSH command.
47388 	 * Value of 0 indicates firmware does not support flow reset all
47389 	 * operation. (deprecated)
47390 	 */
47391 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED			UINT32_C(0x8)
47392 	/*
47393 	 * Value of 1 to indicate that firmware supports use of FID as
47394 	 * dest_id in HWRM_CFA_NTUPLE_ALLOC/CFG commands.
47395 	 * Value of 0 indicates firmware does not support use of FID as
47396 	 * dest_id.
47397 	 */
47398 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED		UINT32_C(0x10)
47399 	/*
47400 	 * Value of 1 to indicate that firmware supports TX EEM flows.
47401 	 * Value of 0 indicates firmware does not support TX EEM flows.
47402 	 * (deprecated)
47403 	 */
47404 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED			UINT32_C(0x20)
47405 	/*
47406 	 * Value of 1 to indicate that firmware supports RX EEM flows.
47407 	 * Value of 0 indicates firmware does not support RX EEM flows.
47408 	 * (deprecated)
47409 	 */
47410 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED			UINT32_C(0x40)
47411 	/*
47412 	 * Value of 1 to indicate that firmware supports the dynamic
47413 	 * allocation of an on-chip flow counter which can be used for EEM
47414 	 * flows. Value of 0 indicates firmware does not support the dynamic
47415 	 * allocation of an on-chip flow counter.
47416 	 * (deprecated)
47417 	 */
47418 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED		UINT32_C(0x80)
47419 	/*
47420 	 * Value of 1 to indicate that firmware supports setting of
47421 	 * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
47422 	 * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
47423 	 */
47424 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED		UINT32_C(0x100)
47425 	/*
47426 	 * Value of 1 to indicate that firmware supports untagged matching
47427 	 * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
47428 	 * indicates firmware does not support untagged matching.
47429 	 */
47430 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED			UINT32_C(0x200)
47431 	/*
47432 	 * Value of 1 to indicate that firmware supports XDP filter. Value
47433 	 * of 0 indicates firmware does not support XDP filter.
47434 	 */
47435 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED				UINT32_C(0x400)
47436 	/*
47437 	 * Value of 1 to indicate that the firmware support L2 header source
47438 	 * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
47439 	 * Value of 0 indicates firmware does not support L2 header source
47440 	 * fields matching.
47441 	 */
47442 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED		UINT32_C(0x800)
47443 	/*
47444 	 * If set to 1, firmware is capable of supporting ARP ethertype as
47445 	 * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
47446 	 * RX direction. By default, this flag should be 0 for older version
47447 	 * of firmware.
47448 	 */
47449 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED		UINT32_C(0x1000)
47450 	/*
47451 	 * Value of 1 to indicate that firmware supports setting of
47452 	 * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
47453 	 * command. Value of 0 indicates firmware does not support
47454 	 * rfs_ring_tbl_idx in dst_id field.
47455 	 */
47456 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED		UINT32_C(0x2000)
47457 	/*
47458 	 * If set to 1, firmware is capable of supporting IPv4/IPv6 as
47459 	 * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
47460 	 * direction. By default, this flag should be 0 for older version
47461 	 * of firmware.
47462 	 */
47463 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED	UINT32_C(0x4000)
47464 	/*
47465 	 * When this bit is '1', it indicates that core firmware is
47466 	 * capable of TruFlow. Driver can restrict sending HWRM CFA_FLOW_XXX
47467 	 * and CFA_ENCAP_XXX, CFA_DECAP_XXX commands.
47468 	 */
47469 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TRUFLOW_CAPABLE				UINT32_C(0x8000)
47470 	/*
47471 	 * If set to 1, firmware is capable of supporting L2/ROCE as
47472 	 * traffic type in flags field of HWRM_CFA_L2_FILTER_ALLOC command.
47473 	 * By default, this flag should be 0 for older version of firmware.
47474 	 */
47475 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_FILTER_TRAFFIC_TYPE_L2_ROCE_SUPPORTED	UINT32_C(0x10000)
47476 	/*
47477 	 * If set to 1, firmware is capable of HW LAG. This bit is only
47478 	 * advertised if the calling function is a PAXC function.
47479 	 */
47480 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_LAG_SUPPORTED				UINT32_C(0x20000)
47481 	/*
47482 	 * If set to 1, firmware is capable installing ntuple rules without
47483 	 * additional classification on the L2 Context.
47484 	 */
47485 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_NO_L2CTX_SUPPORTED		UINT32_C(0x40000)
47486 	/*
47487 	 * If set to 1, firmware is capable returning stats for nic flows
47488 	 * in cfa_flow_stats command where flow_handle value 0xF000.
47489 	 */
47490 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NIC_FLOW_STATS_SUPPORTED			UINT32_C(0x80000)
47491 	/*
47492 	 * If set to 1, firmware is capable of supporting these additional
47493 	 * ip_protoccols: ICMP, ICMPV6, RSVD for ntuple rules. By default,
47494 	 * this flag should be 0 for older version of firmware.
47495 	 */
47496 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_EXT_IP_PROTO_SUPPORTED	UINT32_C(0x100000)
47497 	uint8_t	unused_0[3];
47498 	/*
47499 	 * This field is used in Output records to indicate that the output
47500 	 * is completely written to RAM. This field should be read as '1'
47501 	 * to indicate that the output has been completely written.
47502 	 * When writing a command completion or response to an internal
47503 	 * processor, the order of writes has to be such that this field is
47504 	 * written last.
47505 	 */
47506 	uint8_t	valid;
47507 } hwrm_cfa_adv_flow_mgnt_qcaps_output_t, *phwrm_cfa_adv_flow_mgnt_qcaps_output_t;
47508 
47509 /******************
47510  * hwrm_cfa_tflib *
47511  ******************/
47512 
47513 
47514 /* hwrm_cfa_tflib_input (size:1024b/128B) */
47515 
47516 typedef struct hwrm_cfa_tflib_input {
47517 	/* The HWRM command request type. */
47518 	uint16_t	req_type;
47519 	/*
47520 	 * The completion ring to send the completion event on. This should
47521 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47522 	 */
47523 	uint16_t	cmpl_ring;
47524 	/*
47525 	 * The sequence ID is used by the driver for tracking multiple
47526 	 * commands. This ID is treated as opaque data by the firmware and
47527 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47528 	 */
47529 	uint16_t	seq_id;
47530 	/*
47531 	 * The target ID of the command:
47532 	 * * 0x0-0xFFF8 - The function ID
47533 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47534 	 * * 0xFFFD - Reserved for user-space HWRM interface
47535 	 * * 0xFFFF - HWRM
47536 	 */
47537 	uint16_t	target_id;
47538 	/*
47539 	 * A physical address pointer pointing to a host buffer that the
47540 	 * command's response data will be written. This can be either a host
47541 	 * physical address (HPA) or a guest physical address (GPA) and must
47542 	 * point to a physically contiguous block of memory.
47543 	 */
47544 	uint64_t	resp_addr;
47545 	/* TFLIB message type. */
47546 	uint16_t	tf_type;
47547 	/* TFLIB message subtype. */
47548 	uint16_t	tf_subtype;
47549 	/* unused. */
47550 	uint8_t	unused0[4];
47551 	/* TFLIB request data. */
47552 	uint32_t	tf_req[26];
47553 } hwrm_cfa_tflib_input_t, *phwrm_cfa_tflib_input_t;
47554 
47555 /* hwrm_cfa_tflib_output (size:5632b/704B) */
47556 
47557 typedef struct hwrm_cfa_tflib_output {
47558 	/* The specific error status for the command. */
47559 	uint16_t	error_code;
47560 	/* The HWRM command request type. */
47561 	uint16_t	req_type;
47562 	/* The sequence ID from the original command. */
47563 	uint16_t	seq_id;
47564 	/* The length of the response data in number of bytes. */
47565 	uint16_t	resp_len;
47566 	/* TFLIB message type. */
47567 	uint16_t	tf_type;
47568 	/* TFLIB message subtype. */
47569 	uint16_t	tf_subtype;
47570 	/* TFLIB response code */
47571 	uint32_t	tf_resp_code;
47572 	/* TFLIB response data. */
47573 	uint32_t	tf_resp[170];
47574 	/* unused. */
47575 	uint8_t	unused1[7];
47576 	/*
47577 	 * This field is used in Output records to indicate that the output
47578 	 * is completely written to RAM. This field should be read as '1'
47579 	 * to indicate that the output has been completely written.
47580 	 * When writing a command completion or response to an internal
47581 	 * processor, the order of writes has to be such that this field is
47582 	 * written last.
47583 	 */
47584 	uint8_t	valid;
47585 } hwrm_cfa_tflib_output_t, *phwrm_cfa_tflib_output_t;
47586 
47587 /**********************************
47588  * hwrm_cfa_lag_group_member_rgtr *
47589  **********************************/
47590 
47591 
47592 /* hwrm_cfa_lag_group_member_rgtr_input (size:192b/24B) */
47593 
47594 typedef struct hwrm_cfa_lag_group_member_rgtr_input {
47595 	/* The HWRM command request type. */
47596 	uint16_t	req_type;
47597 	/*
47598 	 * The completion ring to send the completion event on. This should
47599 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47600 	 */
47601 	uint16_t	cmpl_ring;
47602 	/*
47603 	 * The sequence ID is used by the driver for tracking multiple
47604 	 * commands. This ID is treated as opaque data by the firmware and
47605 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47606 	 */
47607 	uint16_t	seq_id;
47608 	/*
47609 	 * The target ID of the command:
47610 	 * * 0x0-0xFFF8 - The function ID
47611 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47612 	 * * 0xFFFD - Reserved for user-space HWRM interface
47613 	 * * 0xFFFF - HWRM
47614 	 */
47615 	uint16_t	target_id;
47616 	/*
47617 	 * A physical address pointer pointing to a host buffer that the
47618 	 * command's response data will be written. This can be either a host
47619 	 * physical address (HPA) or a guest physical address (GPA) and must
47620 	 * point to a physically contiguous block of memory.
47621 	 */
47622 	uint64_t	resp_addr;
47623 	uint8_t	mode;
47624 	/*
47625 	 * Transmit only on the active port. Automatically failover
47626 	 * to backup port.
47627 	 */
47628 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_ACTIVE_BACKUP UINT32_C(0x1)
47629 	/*
47630 	 * Transmit based on packet header ntuple hash. Packet with only
47631 	 * layer 2 headers will hash using the destination MAC, source MAC
47632 	 * and Ethertype fields.  Packets with layer 3 (IP) headers will
47633 	 * hash using the destination MAC, source MAC, IP protocol/next
47634 	 * header, source IP address and destination IP address. Packets
47635 	 * with layer 4 (TCP/UDP) headers will hash using the destination
47636 	 * MAC, source MAC, IP protocol/next header, source IP address,
47637 	 * destination IP address, source port and destination port fields.
47638 	 */
47639 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BALANCE_XOR   UINT32_C(0x2)
47640 	/* Transmit packets on all specified ports. */
47641 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST	UINT32_C(0x3)
47642 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_LAST	HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST
47643 	/*
47644 	 * Supports up to 5 ports. bit0 = port 0, bit1 = port 1,
47645 	 * bit2 = port 2, bit3 = port 4, bit4 = loopback port
47646 	 */
47647 	uint8_t	port_bitmap;
47648 	/* Specify the active port when active-backup mode is specified */
47649 	uint8_t	active_port;
47650 	uint8_t	unused_0[5];
47651 } hwrm_cfa_lag_group_member_rgtr_input_t, *phwrm_cfa_lag_group_member_rgtr_input_t;
47652 
47653 /* hwrm_cfa_lag_group_member_rgtr_output (size:128b/16B) */
47654 
47655 typedef struct hwrm_cfa_lag_group_member_rgtr_output {
47656 	/* The specific error status for the command. */
47657 	uint16_t	error_code;
47658 	/* The HWRM command request type. */
47659 	uint16_t	req_type;
47660 	/* The sequence ID from the original command. */
47661 	uint16_t	seq_id;
47662 	/* The length of the response data in number of bytes. */
47663 	uint16_t	resp_len;
47664 	/* lag group ID configured for the function */
47665 	uint16_t	lag_id;
47666 	uint8_t	unused_0[5];
47667 	/*
47668 	 * This field is used in Output records to indicate that the output
47669 	 * is completely written to RAM. This field should be read as '1'
47670 	 * to indicate that the output has been completely written.
47671 	 * When writing a command completion or response to an internal
47672 	 * processor, the order of writes has to be such that this field is
47673 	 * written last.
47674 	 */
47675 	uint8_t	valid;
47676 } hwrm_cfa_lag_group_member_rgtr_output_t, *phwrm_cfa_lag_group_member_rgtr_output_t;
47677 
47678 /************************************
47679  * hwrm_cfa_lag_group_member_unrgtr *
47680  ************************************/
47681 
47682 
47683 /* hwrm_cfa_lag_group_member_unrgtr_input (size:192b/24B) */
47684 
47685 typedef struct hwrm_cfa_lag_group_member_unrgtr_input {
47686 	/* The HWRM command request type. */
47687 	uint16_t	req_type;
47688 	/*
47689 	 * The completion ring to send the completion event on. This should
47690 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47691 	 */
47692 	uint16_t	cmpl_ring;
47693 	/*
47694 	 * The sequence ID is used by the driver for tracking multiple
47695 	 * commands. This ID is treated as opaque data by the firmware and
47696 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47697 	 */
47698 	uint16_t	seq_id;
47699 	/*
47700 	 * The target ID of the command:
47701 	 * * 0x0-0xFFF8 - The function ID
47702 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47703 	 * * 0xFFFD - Reserved for user-space HWRM interface
47704 	 * * 0xFFFF - HWRM
47705 	 */
47706 	uint16_t	target_id;
47707 	/*
47708 	 * A physical address pointer pointing to a host buffer that the
47709 	 * command's response data will be written. This can be either a host
47710 	 * physical address (HPA) or a guest physical address (GPA) and must
47711 	 * point to a physically contiguous block of memory.
47712 	 */
47713 	uint64_t	resp_addr;
47714 	/* lag group ID configured for the function */
47715 	uint16_t	lag_id;
47716 	uint8_t	unused_0[6];
47717 } hwrm_cfa_lag_group_member_unrgtr_input_t, *phwrm_cfa_lag_group_member_unrgtr_input_t;
47718 
47719 /* hwrm_cfa_lag_group_member_unrgtr_output (size:128b/16B) */
47720 
47721 typedef struct hwrm_cfa_lag_group_member_unrgtr_output {
47722 	/* The specific error status for the command. */
47723 	uint16_t	error_code;
47724 	/* The HWRM command request type. */
47725 	uint16_t	req_type;
47726 	/* The sequence ID from the original command. */
47727 	uint16_t	seq_id;
47728 	/* The length of the response data in number of bytes. */
47729 	uint16_t	resp_len;
47730 	uint8_t	unused_0[7];
47731 	/*
47732 	 * This field is used in Output records to indicate that the output
47733 	 * is completely written to RAM. This field should be read as '1'
47734 	 * to indicate that the output has been completely written.
47735 	 * When writing a command completion or response to an internal
47736 	 * processor, the order of writes has to be such that this field is
47737 	 * written last.
47738 	 */
47739 	uint8_t	valid;
47740 } hwrm_cfa_lag_group_member_unrgtr_output_t, *phwrm_cfa_lag_group_member_unrgtr_output_t;
47741 
47742 /*****************************
47743  * hwrm_cfa_tls_filter_alloc *
47744  *****************************/
47745 
47746 
47747 /* hwrm_cfa_tls_filter_alloc_input (size:704b/88B) */
47748 
47749 typedef struct hwrm_cfa_tls_filter_alloc_input {
47750 	/* The HWRM command request type. */
47751 	uint16_t	req_type;
47752 	/*
47753 	 * The completion ring to send the completion event on. This should
47754 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47755 	 */
47756 	uint16_t	cmpl_ring;
47757 	/*
47758 	 * The sequence ID is used by the driver for tracking multiple
47759 	 * commands. This ID is treated as opaque data by the firmware and
47760 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47761 	 */
47762 	uint16_t	seq_id;
47763 	/*
47764 	 * The target ID of the command:
47765 	 * * 0x0-0xFFF8 - The function ID
47766 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47767 	 * * 0xFFFD - Reserved for user-space HWRM interface
47768 	 * * 0xFFFF - HWRM
47769 	 */
47770 	uint16_t	target_id;
47771 	/*
47772 	 * A physical address pointer pointing to a host buffer that the
47773 	 * command's response data will be written. This can be either a host
47774 	 * physical address (HPA) or a guest physical address (GPA) and must
47775 	 * point to a physically contiguous block of memory.
47776 	 */
47777 	uint64_t	resp_addr;
47778 	uint32_t	unused_0;
47779 	uint32_t	enables;
47780 	/*
47781 	 * This bit must be '1' for the l2_filter_id field to be
47782 	 * configured.
47783 	 */
47784 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
47785 	/*
47786 	 * This bit must be '1' for the ethertype field to be
47787 	 * configured.
47788 	 */
47789 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE	UINT32_C(0x2)
47790 	/*
47791 	 * This bit must be '1' for the ipaddr_type field to be
47792 	 * configured.
47793 	 */
47794 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x4)
47795 	/*
47796 	 * This bit must be '1' for the src_ipaddr field to be
47797 	 * configured.
47798 	 */
47799 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x8)
47800 	/*
47801 	 * This bit must be '1' for the dst_ipaddr field to be
47802 	 * configured.
47803 	 */
47804 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x10)
47805 	/*
47806 	 * This bit must be '1' for the ip_protocol field to be
47807 	 * configured.
47808 	 */
47809 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x20)
47810 	/*
47811 	 * This bit must be '1' for the src_port field to be
47812 	 * configured.
47813 	 */
47814 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT	UINT32_C(0x40)
47815 	/*
47816 	 * This bit must be '1' for the dst_port field to be
47817 	 * configured.
47818 	 */
47819 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_PORT	UINT32_C(0x80)
47820 	/*
47821 	 * This bit must be '1' for the kid field to be
47822 	 * configured.
47823 	 */
47824 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_KID		UINT32_C(0x100)
47825 	/*
47826 	 * This bit must be '1' for the dst_id field to be
47827 	 * configured.
47828 	 */
47829 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x200)
47830 	/*
47831 	 * This bit must be '1' for the mirror_vnic_id field to be
47832 	 * configured.
47833 	 */
47834 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x400)
47835 	/*
47836 	 * This value identifies a set of CFA data structures used for an L2
47837 	 * context.
47838 	 */
47839 	uint64_t	l2_filter_id;
47840 	uint8_t	unused_1[6];
47841 	/* This value indicates the ethertype in the Ethernet header. */
47842 	uint16_t	ethertype;
47843 	/*
47844 	 * This value indicates the type of IP address.
47845 	 * 4 - IPv4
47846 	 * 6 - IPv6
47847 	 * All others are invalid.
47848 	 */
47849 	uint8_t	ip_addr_type;
47850 	/* invalid */
47851 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
47852 	/* IPv4 */
47853 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
47854 	/* IPv6 */
47855 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
47856 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
47857 	/*
47858 	 * The value of protocol filed in IP header.
47859 	 * Applies to UDP and TCP traffic.
47860 	 * 6 - TCP
47861 	 * 17 - UDP
47862 	 */
47863 	uint8_t	ip_protocol;
47864 	/* invalid */
47865 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
47866 	/* TCP */
47867 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
47868 	/* UDP */
47869 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
47870 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
47871 	/*
47872 	 * If set, this value shall represent the
47873 	 * Logical VNIC ID of the destination VNIC for the RX
47874 	 * path and network port id of the destination port for
47875 	 * the TX path.
47876 	 */
47877 	uint16_t	dst_id;
47878 	/*
47879 	 * Logical VNIC ID of the VNIC where traffic is
47880 	 * mirrored.
47881 	 */
47882 	uint16_t	mirror_vnic_id;
47883 	uint8_t	unused_2[2];
47884 	/*
47885 	 * The value of source IP address to be used in filtering.
47886 	 * For IPv4, first four bytes represent the IP address.
47887 	 */
47888 	uint32_t	src_ipaddr[4];
47889 	/*
47890 	 * The value of destination IP address to be used in filtering.
47891 	 * For IPv4, first four bytes represent the IP address.
47892 	 */
47893 	uint32_t	dst_ipaddr[4];
47894 	/*
47895 	 * The value of source port to be used in filtering.
47896 	 * Applies to UDP and TCP traffic.
47897 	 */
47898 	uint16_t	src_port;
47899 	/*
47900 	 * The value of destination port to be used in filtering.
47901 	 * Applies to UDP and TCP traffic.
47902 	 */
47903 	uint16_t	dst_port;
47904 	/*
47905 	 * The Key Context Identifier (KID) for use with KTLS.
47906 	 * KID is limited to 20-bits.
47907 	 */
47908 	uint32_t	kid;
47909 } hwrm_cfa_tls_filter_alloc_input_t, *phwrm_cfa_tls_filter_alloc_input_t;
47910 
47911 /* hwrm_cfa_tls_filter_alloc_output (size:192b/24B) */
47912 
47913 typedef struct hwrm_cfa_tls_filter_alloc_output {
47914 	/* The specific error status for the command. */
47915 	uint16_t	error_code;
47916 	/* The HWRM command request type. */
47917 	uint16_t	req_type;
47918 	/* The sequence ID from the original command. */
47919 	uint16_t	seq_id;
47920 	/* The length of the response data in number of bytes. */
47921 	uint16_t	resp_len;
47922 	/* This value is an opaque id into CFA data structures. */
47923 	uint64_t	tls_filter_id;
47924 	/*
47925 	 * The flow id value in bit 0-29 is the actual ID of the flow
47926 	 * associated with this filter and it shall be used to match
47927 	 * and associate the flow identifier returned in completion
47928 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
47929 	 * shall indicate no valid flow id.
47930 	 */
47931 	uint32_t	flow_id;
47932 	/* Indicate the flow id value. */
47933 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
47934 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
47935 	/* Indicate type of the flow. */
47936 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
47937 	/*
47938 	 * If this bit set to 0, then it indicates that the flow is
47939 	 * internal flow.
47940 	 */
47941 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
47942 	/*
47943 	 * If this bit is set to 1, then it indicates that the flow is
47944 	 * external flow.
47945 	 */
47946 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
47947 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
47948 	/* Indicate the flow direction. */
47949 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
47950 	/* If this bit set to 0, then it indicates rx flow. */
47951 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
47952 	/* If this bit is set to 1, then it indicates that tx flow. */
47953 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
47954 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
47955 	uint8_t	unused_0[3];
47956 	/*
47957 	 * This field is used in Output records to indicate that the output
47958 	 * is completely written to RAM. This field should be read as '1'
47959 	 * to indicate that the output has been completely written.
47960 	 * When writing a command completion or response to an internal
47961 	 * processor, the order of writes has to be such that this field is
47962 	 * written last.
47963 	 */
47964 	uint8_t	valid;
47965 } hwrm_cfa_tls_filter_alloc_output_t, *phwrm_cfa_tls_filter_alloc_output_t;
47966 
47967 /****************************
47968  * hwrm_cfa_tls_filter_free *
47969  ****************************/
47970 
47971 
47972 /* hwrm_cfa_tls_filter_free_input (size:192b/24B) */
47973 
47974 typedef struct hwrm_cfa_tls_filter_free_input {
47975 	/* The HWRM command request type. */
47976 	uint16_t	req_type;
47977 	/*
47978 	 * The completion ring to send the completion event on. This should
47979 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47980 	 */
47981 	uint16_t	cmpl_ring;
47982 	/*
47983 	 * The sequence ID is used by the driver for tracking multiple
47984 	 * commands. This ID is treated as opaque data by the firmware and
47985 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47986 	 */
47987 	uint16_t	seq_id;
47988 	/*
47989 	 * The target ID of the command:
47990 	 * * 0x0-0xFFF8 - The function ID
47991 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47992 	 * * 0xFFFD - Reserved for user-space HWRM interface
47993 	 * * 0xFFFF - HWRM
47994 	 */
47995 	uint16_t	target_id;
47996 	/*
47997 	 * A physical address pointer pointing to a host buffer that the
47998 	 * command's response data will be written. This can be either a host
47999 	 * physical address (HPA) or a guest physical address (GPA) and must
48000 	 * point to a physically contiguous block of memory.
48001 	 */
48002 	uint64_t	resp_addr;
48003 	/* This value is an opaque id into CFA data structures. */
48004 	uint64_t	tls_filter_id;
48005 } hwrm_cfa_tls_filter_free_input_t, *phwrm_cfa_tls_filter_free_input_t;
48006 
48007 /* hwrm_cfa_tls_filter_free_output (size:128b/16B) */
48008 
48009 typedef struct hwrm_cfa_tls_filter_free_output {
48010 	/* The specific error status for the command. */
48011 	uint16_t	error_code;
48012 	/* The HWRM command request type. */
48013 	uint16_t	req_type;
48014 	/* The sequence ID from the original command. */
48015 	uint16_t	seq_id;
48016 	/* The length of the response data in number of bytes. */
48017 	uint16_t	resp_len;
48018 	uint8_t	unused_0[7];
48019 	/*
48020 	 * This field is used in Output records to indicate that the output
48021 	 * is completely written to RAM. This field should be read as '1'
48022 	 * to indicate that the output has been completely written.
48023 	 * When writing a command completion or response to an internal
48024 	 * processor, the order of writes has to be such that this field is
48025 	 * written last.
48026 	 */
48027 	uint8_t	valid;
48028 } hwrm_cfa_tls_filter_free_output_t, *phwrm_cfa_tls_filter_free_output_t;
48029 
48030 /***********
48031  * hwrm_tf *
48032  ***********/
48033 
48034 
48035 /* hwrm_tf_input (size:1024b/128B) */
48036 
48037 typedef struct hwrm_tf_input {
48038 	/* The HWRM command request type. */
48039 	uint16_t	req_type;
48040 	/*
48041 	 * The completion ring to send the completion event on. This should
48042 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48043 	 */
48044 	uint16_t	cmpl_ring;
48045 	/*
48046 	 * The sequence ID is used by the driver for tracking multiple
48047 	 * commands. This ID is treated as opaque data by the firmware and
48048 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48049 	 */
48050 	uint16_t	seq_id;
48051 	/*
48052 	 * The target ID of the command:
48053 	 * * 0x0-0xFFF8 - The function ID
48054 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48055 	 * * 0xFFFD - Reserved for user-space HWRM interface
48056 	 * * 0xFFFF - HWRM
48057 	 */
48058 	uint16_t	target_id;
48059 	/*
48060 	 * A physical address pointer pointing to a host buffer that the
48061 	 * command's response data will be written. This can be either a host
48062 	 * physical address (HPA) or a guest physical address (GPA) and must
48063 	 * point to a physically contiguous block of memory.
48064 	 */
48065 	uint64_t	resp_addr;
48066 	/* TF message type. */
48067 	uint16_t	type;
48068 	/* TF message subtype. */
48069 	uint16_t	subtype;
48070 	/* unused. */
48071 	uint8_t	unused0[4];
48072 	/* TF request data. */
48073 	uint32_t	req[26];
48074 } hwrm_tf_input_t, *phwrm_tf_input_t;
48075 
48076 /* hwrm_tf_output (size:5632b/704B) */
48077 
48078 typedef struct hwrm_tf_output {
48079 	/* The specific error status for the command. */
48080 	uint16_t	error_code;
48081 	/* The HWRM command request type. */
48082 	uint16_t	req_type;
48083 	/* The sequence ID from the original command. */
48084 	uint16_t	seq_id;
48085 	/* The length of the response data in number of bytes. */
48086 	uint16_t	resp_len;
48087 	/* TF message type. */
48088 	uint16_t	type;
48089 	/* TF message subtype. */
48090 	uint16_t	subtype;
48091 	/* TF response code */
48092 	uint32_t	resp_code;
48093 	/* TF response data. */
48094 	uint32_t	resp[170];
48095 	/* unused. */
48096 	uint8_t	unused1[7];
48097 	/*
48098 	 * This field is used in Output records to indicate that the
48099 	 * output is completely written to RAM. This field should be
48100 	 * read as '1' to indicate that the output has been
48101 	 * completely written.  When writing a command completion or
48102 	 * response to an internal processor, the order of writes has
48103 	 * to be such that this field is written last.
48104 	 */
48105 	uint8_t	valid;
48106 } hwrm_tf_output_t, *phwrm_tf_output_t;
48107 
48108 /***********************
48109  * hwrm_tf_version_get *
48110  ***********************/
48111 
48112 
48113 /* hwrm_tf_version_get_input (size:128b/16B) */
48114 
48115 typedef struct hwrm_tf_version_get_input {
48116 	/* The HWRM command request type. */
48117 	uint16_t	req_type;
48118 	/*
48119 	 * The completion ring to send the completion event on. This should
48120 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48121 	 */
48122 	uint16_t	cmpl_ring;
48123 	/*
48124 	 * The sequence ID is used by the driver for tracking multiple
48125 	 * commands. This ID is treated as opaque data by the firmware and
48126 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48127 	 */
48128 	uint16_t	seq_id;
48129 	/*
48130 	 * The target ID of the command:
48131 	 * * 0x0-0xFFF8 - The function ID
48132 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48133 	 * * 0xFFFD - Reserved for user-space HWRM interface
48134 	 * * 0xFFFF - HWRM
48135 	 */
48136 	uint16_t	target_id;
48137 	/*
48138 	 * A physical address pointer pointing to a host buffer that the
48139 	 * command's response data will be written. This can be either a host
48140 	 * physical address (HPA) or a guest physical address (GPA) and must
48141 	 * point to a physically contiguous block of memory.
48142 	 */
48143 	uint64_t	resp_addr;
48144 } hwrm_tf_version_get_input_t, *phwrm_tf_version_get_input_t;
48145 
48146 /* hwrm_tf_version_get_output (size:256b/32B) */
48147 
48148 typedef struct hwrm_tf_version_get_output {
48149 	/* The specific error status for the command. */
48150 	uint16_t	error_code;
48151 	/* The HWRM command request type. */
48152 	uint16_t	req_type;
48153 	/* The sequence ID from the original command. */
48154 	uint16_t	seq_id;
48155 	/* The length of the response data in number of bytes. */
48156 	uint16_t	resp_len;
48157 	/* Version Major number. */
48158 	uint8_t	major;
48159 	/* Version Minor number. */
48160 	uint8_t	minor;
48161 	/* Version Update number. */
48162 	uint8_t	update;
48163 	/* unused. */
48164 	uint8_t	unused0[5];
48165 	/*
48166 	 * This field is used to indicate device's capabilities and
48167 	 * configurations.
48168 	 */
48169 	uint64_t	dev_caps_cfg;
48170 	/* unused. */
48171 	uint8_t	unused1[7];
48172 	/*
48173 	 * This field is used in Output records to indicate that the output
48174 	 * is completely written to RAM. This field should be read as '1'
48175 	 * to indicate that the output has been completely written.
48176 	 * When writing a command completion or response to an internal
48177 	 * processor, the order of writes has to be such that this field is
48178 	 * written last.
48179 	 */
48180 	uint8_t	valid;
48181 } hwrm_tf_version_get_output_t, *phwrm_tf_version_get_output_t;
48182 
48183 /************************
48184  * hwrm_tf_session_open *
48185  ************************/
48186 
48187 
48188 /* hwrm_tf_session_open_input (size:640b/80B) */
48189 
48190 typedef struct hwrm_tf_session_open_input {
48191 	/* The HWRM command request type. */
48192 	uint16_t	req_type;
48193 	/*
48194 	 * The completion ring to send the completion event on. This should
48195 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48196 	 */
48197 	uint16_t	cmpl_ring;
48198 	/*
48199 	 * The sequence ID is used by the driver for tracking multiple
48200 	 * commands. This ID is treated as opaque data by the firmware and
48201 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48202 	 */
48203 	uint16_t	seq_id;
48204 	/*
48205 	 * The target ID of the command:
48206 	 * * 0x0-0xFFF8 - The function ID
48207 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48208 	 * * 0xFFFD - Reserved for user-space HWRM interface
48209 	 * * 0xFFFF - HWRM
48210 	 */
48211 	uint16_t	target_id;
48212 	/*
48213 	 * A physical address pointer pointing to a host buffer that the
48214 	 * command's response data will be written. This can be either a host
48215 	 * physical address (HPA) or a guest physical address (GPA) and must
48216 	 * point to a physically contiguous block of memory.
48217 	 */
48218 	uint64_t	resp_addr;
48219 	/* Name of the session. */
48220 	uint8_t	session_name[64];
48221 } hwrm_tf_session_open_input_t, *phwrm_tf_session_open_input_t;
48222 
48223 /* hwrm_tf_session_open_output (size:192b/24B) */
48224 
48225 typedef struct hwrm_tf_session_open_output {
48226 	/* The specific error status for the command. */
48227 	uint16_t	error_code;
48228 	/* The HWRM command request type. */
48229 	uint16_t	req_type;
48230 	/* The sequence ID from the original command. */
48231 	uint16_t	seq_id;
48232 	/* The length of the response data in number of bytes. */
48233 	uint16_t	resp_len;
48234 	/*
48235 	 * Unique session identifier for the session created by the
48236 	 * firmware.
48237 	 */
48238 	uint32_t	fw_session_id;
48239 	/*
48240 	 * Unique session client identifier for the first client on
48241 	 * the newly created session.
48242 	 */
48243 	uint32_t	fw_session_client_id;
48244 	/* This field is used to return the status of fw session to host. */
48245 	uint32_t	flags;
48246 	/*
48247 	 * Indicates if the shared session has been created. Shared session
48248 	 * should be the first session created ever. Its fw_rm_client_id
48249 	 * should be 1. The AFM session's fw_rm_client_id is 0.
48250 	 */
48251 	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION		UINT32_C(0x1)
48252 	/*
48253 	 * If this bit set to 0, then it indicates the shared session
48254 	 * has been created by another session.
48255 	 */
48256 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR  UINT32_C(0x0)
48257 	/*
48258 	 * If this bit is set to 1, then it indicates the shared session
48259 	 * is created by this session.
48260 	 */
48261 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR	UINT32_C(0x1)
48262 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST	HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
48263 	/* unused. */
48264 	uint8_t	unused1[3];
48265 	/*
48266 	 * This field is used in Output records to indicate that the output
48267 	 * is completely written to RAM. This field should be read as '1'
48268 	 * to indicate that the output has been completely written.
48269 	 * When writing a command completion or response to an internal
48270 	 * processor, the order of writes has to be such that this field is
48271 	 * written last.
48272 	 */
48273 	uint8_t	valid;
48274 } hwrm_tf_session_open_output_t, *phwrm_tf_session_open_output_t;
48275 
48276 /**************************
48277  * hwrm_tf_session_attach *
48278  **************************/
48279 
48280 
48281 /* hwrm_tf_session_attach_input (size:704b/88B) */
48282 
48283 typedef struct hwrm_tf_session_attach_input {
48284 	/* The HWRM command request type. */
48285 	uint16_t	req_type;
48286 	/*
48287 	 * The completion ring to send the completion event on. This should
48288 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48289 	 */
48290 	uint16_t	cmpl_ring;
48291 	/*
48292 	 * The sequence ID is used by the driver for tracking multiple
48293 	 * commands. This ID is treated as opaque data by the firmware and
48294 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48295 	 */
48296 	uint16_t	seq_id;
48297 	/*
48298 	 * The target ID of the command:
48299 	 * * 0x0-0xFFF8 - The function ID
48300 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48301 	 * * 0xFFFD - Reserved for user-space HWRM interface
48302 	 * * 0xFFFF - HWRM
48303 	 */
48304 	uint16_t	target_id;
48305 	/*
48306 	 * A physical address pointer pointing to a host buffer that the
48307 	 * command's response data will be written. This can be either a host
48308 	 * physical address (HPA) or a guest physical address (GPA) and must
48309 	 * point to a physically contiguous block of memory.
48310 	 */
48311 	uint64_t	resp_addr;
48312 	/*
48313 	 * Unique session identifier for the session that the attach
48314 	 * request want to attach to. This value originates from the
48315 	 * shared session memory that the attach request opened by
48316 	 * way of the 'attach name' that was passed in to the core
48317 	 * attach API.
48318 	 * The fw_session_id of the attach session includes PCIe bus
48319 	 * info to distinguish the PF and session info to identify
48320 	 * the associated TruFlow session.
48321 	 */
48322 	uint32_t	attach_fw_session_id;
48323 	/* unused. */
48324 	uint32_t	unused0;
48325 	/* Name of the session it self. */
48326 	uint8_t	session_name[64];
48327 } hwrm_tf_session_attach_input_t, *phwrm_tf_session_attach_input_t;
48328 
48329 /* hwrm_tf_session_attach_output (size:128b/16B) */
48330 
48331 typedef struct hwrm_tf_session_attach_output {
48332 	/* The specific error status for the command. */
48333 	uint16_t	error_code;
48334 	/* The HWRM command request type. */
48335 	uint16_t	req_type;
48336 	/* The sequence ID from the original command. */
48337 	uint16_t	seq_id;
48338 	/* The length of the response data in number of bytes. */
48339 	uint16_t	resp_len;
48340 	/*
48341 	 * Unique session identifier for the session created by the
48342 	 * firmware. It includes PCIe bus info to distinguish the PF
48343 	 * and session info to identify the associated TruFlow
48344 	 * session. This fw_session_id is unique to the attach
48345 	 * request.
48346 	 */
48347 	uint32_t	fw_session_id;
48348 	/* unused. */
48349 	uint8_t	unused0[3];
48350 	/*
48351 	 * This field is used in Output records to indicate that the output
48352 	 * is completely written to RAM. This field should be read as '1'
48353 	 * to indicate that the output has been completely written.
48354 	 * When writing a command completion or response to an internal
48355 	 * processor, the order of writes has to be such that this field is
48356 	 * written last.
48357 	 */
48358 	uint8_t	valid;
48359 } hwrm_tf_session_attach_output_t, *phwrm_tf_session_attach_output_t;
48360 
48361 /****************************
48362  * hwrm_tf_session_register *
48363  ****************************/
48364 
48365 
48366 /* hwrm_tf_session_register_input (size:704b/88B) */
48367 
48368 typedef struct hwrm_tf_session_register_input {
48369 	/* The HWRM command request type. */
48370 	uint16_t	req_type;
48371 	/*
48372 	 * The completion ring to send the completion event on. This should
48373 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48374 	 */
48375 	uint16_t	cmpl_ring;
48376 	/*
48377 	 * The sequence ID is used by the driver for tracking multiple
48378 	 * commands. This ID is treated as opaque data by the firmware and
48379 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48380 	 */
48381 	uint16_t	seq_id;
48382 	/*
48383 	 * The target ID of the command:
48384 	 * * 0x0-0xFFF8 - The function ID
48385 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48386 	 * * 0xFFFD - Reserved for user-space HWRM interface
48387 	 * * 0xFFFF - HWRM
48388 	 */
48389 	uint16_t	target_id;
48390 	/*
48391 	 * A physical address pointer pointing to a host buffer that the
48392 	 * command's response data will be written. This can be either a host
48393 	 * physical address (HPA) or a guest physical address (GPA) and must
48394 	 * point to a physically contiguous block of memory.
48395 	 */
48396 	uint64_t	resp_addr;
48397 	/*
48398 	 * Unique session identifier for the session that the
48399 	 * register request want to create a new client on. This
48400 	 * value originates from the first open request.
48401 	 * The fw_session_id of the attach session includes PCIe bus
48402 	 * info to distinguish the PF and session info to identify
48403 	 * the associated TruFlow session.
48404 	 */
48405 	uint32_t	fw_session_id;
48406 	/* unused. */
48407 	uint32_t	unused0;
48408 	/* Name of the session client. */
48409 	uint8_t	session_client_name[64];
48410 } hwrm_tf_session_register_input_t, *phwrm_tf_session_register_input_t;
48411 
48412 /* hwrm_tf_session_register_output (size:128b/16B) */
48413 
48414 typedef struct hwrm_tf_session_register_output {
48415 	/* The specific error status for the command. */
48416 	uint16_t	error_code;
48417 	/* The HWRM command request type. */
48418 	uint16_t	req_type;
48419 	/* The sequence ID from the original command. */
48420 	uint16_t	seq_id;
48421 	/* The length of the response data in number of bytes. */
48422 	uint16_t	resp_len;
48423 	/*
48424 	 * Unique session client identifier for the session created
48425 	 * by the firmware. It includes the session the client it
48426 	 * attached to and session client info.
48427 	 */
48428 	uint32_t	fw_session_client_id;
48429 	/* unused. */
48430 	uint8_t	unused0[3];
48431 	/*
48432 	 * This field is used in Output records to indicate that the output
48433 	 * is completely written to RAM. This field should be read as '1'
48434 	 * to indicate that the output has been completely written.
48435 	 * When writing a command completion or response to an internal
48436 	 * processor, the order of writes has to be such that this field is
48437 	 * written last.
48438 	 */
48439 	uint8_t	valid;
48440 } hwrm_tf_session_register_output_t, *phwrm_tf_session_register_output_t;
48441 
48442 /******************************
48443  * hwrm_tf_session_unregister *
48444  ******************************/
48445 
48446 
48447 /* hwrm_tf_session_unregister_input (size:192b/24B) */
48448 
48449 typedef struct hwrm_tf_session_unregister_input {
48450 	/* The HWRM command request type. */
48451 	uint16_t	req_type;
48452 	/*
48453 	 * The completion ring to send the completion event on. This should
48454 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48455 	 */
48456 	uint16_t	cmpl_ring;
48457 	/*
48458 	 * The sequence ID is used by the driver for tracking multiple
48459 	 * commands. This ID is treated as opaque data by the firmware and
48460 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48461 	 */
48462 	uint16_t	seq_id;
48463 	/*
48464 	 * The target ID of the command:
48465 	 * * 0x0-0xFFF8 - The function ID
48466 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48467 	 * * 0xFFFD - Reserved for user-space HWRM interface
48468 	 * * 0xFFFF - HWRM
48469 	 */
48470 	uint16_t	target_id;
48471 	/*
48472 	 * A physical address pointer pointing to a host buffer that the
48473 	 * command's response data will be written. This can be either a host
48474 	 * physical address (HPA) or a guest physical address (GPA) and must
48475 	 * point to a physically contiguous block of memory.
48476 	 */
48477 	uint64_t	resp_addr;
48478 	/*
48479 	 * Unique session identifier for the session that the
48480 	 * unregister request want to close a session client on.
48481 	 */
48482 	uint32_t	fw_session_id;
48483 	/*
48484 	 * Unique session client identifier for the session that the
48485 	 * unregister request want to close.
48486 	 */
48487 	uint32_t	fw_session_client_id;
48488 } hwrm_tf_session_unregister_input_t, *phwrm_tf_session_unregister_input_t;
48489 
48490 /* hwrm_tf_session_unregister_output (size:128b/16B) */
48491 
48492 typedef struct hwrm_tf_session_unregister_output {
48493 	/* The specific error status for the command. */
48494 	uint16_t	error_code;
48495 	/* The HWRM command request type. */
48496 	uint16_t	req_type;
48497 	/* The sequence ID from the original command. */
48498 	uint16_t	seq_id;
48499 	/* The length of the response data in number of bytes. */
48500 	uint16_t	resp_len;
48501 	/* unused. */
48502 	uint8_t	unused0[7];
48503 	/*
48504 	 * This field is used in Output records to indicate that the output
48505 	 * is completely written to RAM. This field should be read as '1'
48506 	 * to indicate that the output has been completely written.
48507 	 * When writing a command completion or response to an internal
48508 	 * processor, the order of writes has to be such that this field is
48509 	 * written last.
48510 	 */
48511 	uint8_t	valid;
48512 } hwrm_tf_session_unregister_output_t, *phwrm_tf_session_unregister_output_t;
48513 
48514 /*************************
48515  * hwrm_tf_session_close *
48516  *************************/
48517 
48518 
48519 /* hwrm_tf_session_close_input (size:192b/24B) */
48520 
48521 typedef struct hwrm_tf_session_close_input {
48522 	/* The HWRM command request type. */
48523 	uint16_t	req_type;
48524 	/*
48525 	 * The completion ring to send the completion event on. This should
48526 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48527 	 */
48528 	uint16_t	cmpl_ring;
48529 	/*
48530 	 * The sequence ID is used by the driver for tracking multiple
48531 	 * commands. This ID is treated as opaque data by the firmware and
48532 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48533 	 */
48534 	uint16_t	seq_id;
48535 	/*
48536 	 * The target ID of the command:
48537 	 * * 0x0-0xFFF8 - The function ID
48538 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48539 	 * * 0xFFFD - Reserved for user-space HWRM interface
48540 	 * * 0xFFFF - HWRM
48541 	 */
48542 	uint16_t	target_id;
48543 	/*
48544 	 * A physical address pointer pointing to a host buffer that the
48545 	 * command's response data will be written. This can be either a host
48546 	 * physical address (HPA) or a guest physical address (GPA) and must
48547 	 * point to a physically contiguous block of memory.
48548 	 */
48549 	uint64_t	resp_addr;
48550 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
48551 	uint32_t	fw_session_id;
48552 	/* unused. */
48553 	uint8_t	unused0[4];
48554 } hwrm_tf_session_close_input_t, *phwrm_tf_session_close_input_t;
48555 
48556 /* hwrm_tf_session_close_output (size:128b/16B) */
48557 
48558 typedef struct hwrm_tf_session_close_output {
48559 	/* The specific error status for the command. */
48560 	uint16_t	error_code;
48561 	/* The HWRM command request type. */
48562 	uint16_t	req_type;
48563 	/* The sequence ID from the original command. */
48564 	uint16_t	seq_id;
48565 	/* The length of the response data in number of bytes. */
48566 	uint16_t	resp_len;
48567 	/* unused. */
48568 	uint8_t	unused0[7];
48569 	/*
48570 	 * This field is used in Output records to indicate that the output
48571 	 * is completely written to RAM. This field should be read as '1'
48572 	 * to indicate that the output has been completely written.
48573 	 * When writing a command completion or response to an internal
48574 	 * processor, the order of writes has to be such that this field
48575 	 * is written last.
48576 	 */
48577 	uint8_t	valid;
48578 } hwrm_tf_session_close_output_t, *phwrm_tf_session_close_output_t;
48579 
48580 /************************
48581  * hwrm_tf_session_qcfg *
48582  ************************/
48583 
48584 
48585 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
48586 
48587 typedef struct hwrm_tf_session_qcfg_input {
48588 	/* The HWRM command request type. */
48589 	uint16_t	req_type;
48590 	/*
48591 	 * The completion ring to send the completion event on. This should
48592 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48593 	 */
48594 	uint16_t	cmpl_ring;
48595 	/*
48596 	 * The sequence ID is used by the driver for tracking multiple
48597 	 * commands. This ID is treated as opaque data by the firmware and
48598 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48599 	 */
48600 	uint16_t	seq_id;
48601 	/*
48602 	 * The target ID of the command:
48603 	 * * 0x0-0xFFF8 - The function ID
48604 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48605 	 * * 0xFFFD - Reserved for user-space HWRM interface
48606 	 * * 0xFFFF - HWRM
48607 	 */
48608 	uint16_t	target_id;
48609 	/*
48610 	 * A physical address pointer pointing to a host buffer that the
48611 	 * command's response data will be written. This can be either a host
48612 	 * physical address (HPA) or a guest physical address (GPA) and must
48613 	 * point to a physically contiguous block of memory.
48614 	 */
48615 	uint64_t	resp_addr;
48616 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
48617 	uint32_t	fw_session_id;
48618 	/* unused. */
48619 	uint8_t	unused0[4];
48620 } hwrm_tf_session_qcfg_input_t, *phwrm_tf_session_qcfg_input_t;
48621 
48622 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
48623 
48624 typedef struct hwrm_tf_session_qcfg_output {
48625 	/* The specific error status for the command. */
48626 	uint16_t	error_code;
48627 	/* The HWRM command request type. */
48628 	uint16_t	req_type;
48629 	/* The sequence ID from the original command. */
48630 	uint16_t	seq_id;
48631 	/* The length of the response data in number of bytes. */
48632 	uint16_t	resp_len;
48633 	/* RX action control settings flags. */
48634 	uint8_t	rx_act_flags;
48635 	/*
48636 	 * A value of 1 in this field indicates that Global Flow ID
48637 	 * reporting into cfa_code and cfa_metadata is enabled.
48638 	 */
48639 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN		UINT32_C(0x1)
48640 	/*
48641 	 * A value of 1 in this field indicates that both inner and outer
48642 	 * are stripped and inner tag is passed.
48643 	 * Enabled.
48644 	 */
48645 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH	UINT32_C(0x2)
48646 	/*
48647 	 * A value of 1 in this field indicates that the re-use of
48648 	 * existing tunnel L2 header SMAC is enabled for
48649 	 * Non-tunnel L2, L2-L3 and IP-IP tunnel.
48650 	 */
48651 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2	UINT32_C(0x4)
48652 	/* TX Action control settings flags. */
48653 	uint8_t	tx_act_flags;
48654 	/* Disabled. */
48655 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN	UINT32_C(0x1)
48656 	/*
48657 	 * When set to 1 any GRE tunnels will include the
48658 	 * optional Key field.
48659 	 */
48660 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K	UINT32_C(0x2)
48661 	/*
48662 	 * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
48663 	 * field of the outer header is inherited from the inner header
48664 	 * (if present) or the fixed value as taken from the encap
48665 	 * record.
48666 	 */
48667 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH	UINT32_C(0x4)
48668 	/*
48669 	 * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
48670 	 * field of the outer header is inherited from the inner header
48671 	 * (if present) or the fixed value as taken from the encap record.
48672 	 */
48673 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH	UINT32_C(0x8)
48674 	/* unused. */
48675 	uint8_t	unused0[5];
48676 	/*
48677 	 * This field is used in Output records to indicate that the output
48678 	 * is completely written to RAM. This field should be read as '1'
48679 	 * to indicate that the output has been completely written.
48680 	 * When writing a command completion or response to an internal
48681 	 * processor, the order of writes has to be such that this field
48682 	 * is written last.
48683 	 */
48684 	uint8_t	valid;
48685 } hwrm_tf_session_qcfg_output_t, *phwrm_tf_session_qcfg_output_t;
48686 
48687 /******************************
48688  * hwrm_tf_session_resc_qcaps *
48689  ******************************/
48690 
48691 
48692 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
48693 
48694 typedef struct hwrm_tf_session_resc_qcaps_input {
48695 	/* The HWRM command request type. */
48696 	uint16_t	req_type;
48697 	/*
48698 	 * The completion ring to send the completion event on. This should
48699 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48700 	 */
48701 	uint16_t	cmpl_ring;
48702 	/*
48703 	 * The sequence ID is used by the driver for tracking multiple
48704 	 * commands. This ID is treated as opaque data by the firmware and
48705 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48706 	 */
48707 	uint16_t	seq_id;
48708 	/*
48709 	 * The target ID of the command:
48710 	 * * 0x0-0xFFF8 - The function ID
48711 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48712 	 * * 0xFFFD - Reserved for user-space HWRM interface
48713 	 * * 0xFFFF - HWRM
48714 	 */
48715 	uint16_t	target_id;
48716 	/*
48717 	 * A physical address pointer pointing to a host buffer that the
48718 	 * command's response data will be written. This can be either a host
48719 	 * physical address (HPA) or a guest physical address (GPA) and must
48720 	 * point to a physically contiguous block of memory.
48721 	 */
48722 	uint64_t	resp_addr;
48723 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
48724 	uint32_t	fw_session_id;
48725 	/* Control flags. */
48726 	uint16_t	flags;
48727 	/* Indicates the flow direction. */
48728 	#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR	UINT32_C(0x1)
48729 	/* If this bit set to 0, then it indicates rx flow. */
48730 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
48731 	/* If this bit is set to 1, then it indicates tx flow. */
48732 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
48733 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
48734 	/*
48735 	 * Defines the size of the provided qcaps_addr array
48736 	 * buffer. The size should be set to the Resource Manager
48737 	 * provided max number of qcaps entries which is device
48738 	 * specific. Resource Manager gets the max size from HCAPI
48739 	 * RM.
48740 	 */
48741 	uint16_t	qcaps_size;
48742 	/*
48743 	 * This is the DMA address for the qcaps output data array
48744 	 * buffer. Array is of tf_rm_resc_req_entry type and is
48745 	 * device specific.
48746 	 */
48747 	uint64_t	qcaps_addr;
48748 } hwrm_tf_session_resc_qcaps_input_t, *phwrm_tf_session_resc_qcaps_input_t;
48749 
48750 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
48751 
48752 typedef struct hwrm_tf_session_resc_qcaps_output {
48753 	/* The specific error status for the command. */
48754 	uint16_t	error_code;
48755 	/* The HWRM command request type. */
48756 	uint16_t	req_type;
48757 	/* The sequence ID from the original command. */
48758 	uint16_t	seq_id;
48759 	/* The length of the response data in number of bytes. */
48760 	uint16_t	resp_len;
48761 	/* Control flags. */
48762 	uint32_t	flags;
48763 	/* Session reservation strategy. */
48764 	#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK  UINT32_C(0x3)
48765 	#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT   0
48766 	/* Static partitioning. */
48767 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC  UINT32_C(0x0)
48768 	/* Strategy 1. */
48769 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1	UINT32_C(0x1)
48770 	/* Strategy 2. */
48771 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2	UINT32_C(0x2)
48772 	/* Strategy 3. */
48773 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3	UINT32_C(0x3)
48774 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST   HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
48775 	/*
48776 	 * Size of the returned qcaps_addr data array buffer. The
48777 	 * value cannot exceed the size defined by the input msg,
48778 	 * qcaps_size.
48779 	 */
48780 	uint16_t	size;
48781 	/*
48782 	 * SRAM profile number that sets the partition of SRAM memory
48783 	 * between TF and AFM within the 4 internal memory banks (Thor).
48784 	 */
48785 	uint8_t	sram_profile;
48786 	/* unused. */
48787 	uint8_t	unused0;
48788 	/* unused. */
48789 	uint8_t	unused1[7];
48790 	/*
48791 	 * This field is used in Output records to indicate that the output
48792 	 * is completely written to RAM. This field should be read as '1'
48793 	 * to indicate that the output has been completely written.
48794 	 * When writing a command completion or response to an internal
48795 	 * processor, the order of writes has to be such that this field is
48796 	 * written last.
48797 	 */
48798 	uint8_t	valid;
48799 } hwrm_tf_session_resc_qcaps_output_t, *phwrm_tf_session_resc_qcaps_output_t;
48800 
48801 /******************************
48802  * hwrm_tf_session_resc_alloc *
48803  ******************************/
48804 
48805 
48806 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
48807 
48808 typedef struct hwrm_tf_session_resc_alloc_input {
48809 	/* The HWRM command request type. */
48810 	uint16_t	req_type;
48811 	/*
48812 	 * The completion ring to send the completion event on. This should
48813 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48814 	 */
48815 	uint16_t	cmpl_ring;
48816 	/*
48817 	 * The sequence ID is used by the driver for tracking multiple
48818 	 * commands. This ID is treated as opaque data by the firmware and
48819 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48820 	 */
48821 	uint16_t	seq_id;
48822 	/*
48823 	 * The target ID of the command:
48824 	 * * 0x0-0xFFF8 - The function ID
48825 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48826 	 * * 0xFFFD - Reserved for user-space HWRM interface
48827 	 * * 0xFFFF - HWRM
48828 	 */
48829 	uint16_t	target_id;
48830 	/*
48831 	 * A physical address pointer pointing to a host buffer that the
48832 	 * command's response data will be written. This can be either a host
48833 	 * physical address (HPA) or a guest physical address (GPA) and must
48834 	 * point to a physically contiguous block of memory.
48835 	 */
48836 	uint64_t	resp_addr;
48837 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
48838 	uint32_t	fw_session_id;
48839 	/* Control flags. */
48840 	uint16_t	flags;
48841 	/* Indicates the flow direction. */
48842 	#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
48843 	/* If this bit set to 0, then it indicates rx flow. */
48844 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
48845 	/* If this bit is set to 1, then it indicates tx flow. */
48846 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
48847 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
48848 	/*
48849 	 * Defines the array size of the provided req_addr and
48850 	 * resv_addr array buffers. Should be set to the number of
48851 	 * request entries.
48852 	 */
48853 	uint16_t	req_size;
48854 	/*
48855 	 * This is the DMA address for the request input data array
48856 	 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
48857 	 * array buffer is provided by the 'req_size' field in this
48858 	 * message.
48859 	 */
48860 	uint64_t	req_addr;
48861 	/*
48862 	 * This is the DMA address for the resc output data array
48863 	 * buffer. Array is of tf_rm_resc_entry type. Size of the array
48864 	 * buffer is provided by the 'req_size' field in this
48865 	 * message.
48866 	 */
48867 	uint64_t	resc_addr;
48868 } hwrm_tf_session_resc_alloc_input_t, *phwrm_tf_session_resc_alloc_input_t;
48869 
48870 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
48871 
48872 typedef struct hwrm_tf_session_resc_alloc_output {
48873 	/* The specific error status for the command. */
48874 	uint16_t	error_code;
48875 	/* The HWRM command request type. */
48876 	uint16_t	req_type;
48877 	/* The sequence ID from the original command. */
48878 	uint16_t	seq_id;
48879 	/* The length of the response data in number of bytes. */
48880 	uint16_t	resp_len;
48881 	/*
48882 	 * Size of the returned tf_rm_resc_entry data array. The value
48883 	 * cannot exceed the req_size defined by the input msg. The data
48884 	 * array is returned using the resv_addr specified DMA
48885 	 * address also provided by the input msg.
48886 	 */
48887 	uint16_t	size;
48888 	/* unused. */
48889 	uint8_t	unused0[5];
48890 	/*
48891 	 * This field is used in Output records to indicate that the output
48892 	 * is completely written to RAM. This field should be read as '1'
48893 	 * to indicate that the output has been completely written.
48894 	 * When writing a command completion or response to an internal
48895 	 * processor, the order of writes has to be such that this field is
48896 	 * written last.
48897 	 */
48898 	uint8_t	valid;
48899 } hwrm_tf_session_resc_alloc_output_t, *phwrm_tf_session_resc_alloc_output_t;
48900 
48901 /*****************************
48902  * hwrm_tf_session_resc_free *
48903  *****************************/
48904 
48905 
48906 /* hwrm_tf_session_resc_free_input (size:256b/32B) */
48907 
48908 typedef struct hwrm_tf_session_resc_free_input {
48909 	/* The HWRM command request type. */
48910 	uint16_t	req_type;
48911 	/*
48912 	 * The completion ring to send the completion event on. This should
48913 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48914 	 */
48915 	uint16_t	cmpl_ring;
48916 	/*
48917 	 * The sequence ID is used by the driver for tracking multiple
48918 	 * commands. This ID is treated as opaque data by the firmware and
48919 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48920 	 */
48921 	uint16_t	seq_id;
48922 	/*
48923 	 * The target ID of the command:
48924 	 * * 0x0-0xFFF8 - The function ID
48925 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48926 	 * * 0xFFFD - Reserved for user-space HWRM interface
48927 	 * * 0xFFFF - HWRM
48928 	 */
48929 	uint16_t	target_id;
48930 	/*
48931 	 * A physical address pointer pointing to a host buffer that the
48932 	 * command's response data will be written. This can be either a host
48933 	 * physical address (HPA) or a guest physical address (GPA) and must
48934 	 * point to a physically contiguous block of memory.
48935 	 */
48936 	uint64_t	resp_addr;
48937 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
48938 	uint32_t	fw_session_id;
48939 	/* Control flags. */
48940 	uint16_t	flags;
48941 	/* Indicates the flow direction. */
48942 	#define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
48943 	/* If this bit set to 0, then it indicates rx flow. */
48944 		#define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
48945 	/* If this bit is set to 1, then it indicates tx flow. */
48946 		#define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
48947 		#define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX
48948 	/*
48949 	 * Defines the size, in bytes, of the provided free_addr
48950 	 * buffer.
48951 	 */
48952 	uint16_t	free_size;
48953 	/*
48954 	 * This is the DMA address for the free input data array
48955 	 * buffer.  Array is of tf_rm_resc_entry type. Size of the
48956 	 * buffer is provided by the 'free_size' field of this
48957 	 * message.
48958 	 */
48959 	uint64_t	free_addr;
48960 } hwrm_tf_session_resc_free_input_t, *phwrm_tf_session_resc_free_input_t;
48961 
48962 /* hwrm_tf_session_resc_free_output (size:128b/16B) */
48963 
48964 typedef struct hwrm_tf_session_resc_free_output {
48965 	/* The specific error status for the command. */
48966 	uint16_t	error_code;
48967 	/* The HWRM command request type. */
48968 	uint16_t	req_type;
48969 	/* The sequence ID from the original command. */
48970 	uint16_t	seq_id;
48971 	/* The length of the response data in number of bytes. */
48972 	uint16_t	resp_len;
48973 	/* unused. */
48974 	uint8_t	unused0[7];
48975 	/*
48976 	 * This field is used in Output records to indicate that the output
48977 	 * is completely written to RAM. This field should be read as '1'
48978 	 * to indicate that the output has been completely written.
48979 	 * When writing a command completion or response to an internal
48980 	 * processor, the order of writes has to be such that this field is
48981 	 * written last.
48982 	 */
48983 	uint8_t	valid;
48984 } hwrm_tf_session_resc_free_output_t, *phwrm_tf_session_resc_free_output_t;
48985 
48986 /******************************
48987  * hwrm_tf_session_resc_flush *
48988  ******************************/
48989 
48990 
48991 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
48992 
48993 typedef struct hwrm_tf_session_resc_flush_input {
48994 	/* The HWRM command request type. */
48995 	uint16_t	req_type;
48996 	/*
48997 	 * The completion ring to send the completion event on. This should
48998 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48999 	 */
49000 	uint16_t	cmpl_ring;
49001 	/*
49002 	 * The sequence ID is used by the driver for tracking multiple
49003 	 * commands. This ID is treated as opaque data by the firmware and
49004 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49005 	 */
49006 	uint16_t	seq_id;
49007 	/*
49008 	 * The target ID of the command:
49009 	 * * 0x0-0xFFF8 - The function ID
49010 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49011 	 * * 0xFFFD - Reserved for user-space HWRM interface
49012 	 * * 0xFFFF - HWRM
49013 	 */
49014 	uint16_t	target_id;
49015 	/*
49016 	 * A physical address pointer pointing to a host buffer that the
49017 	 * command's response data will be written. This can be either a host
49018 	 * physical address (HPA) or a guest physical address (GPA) and must
49019 	 * point to a physically contiguous block of memory.
49020 	 */
49021 	uint64_t	resp_addr;
49022 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49023 	uint32_t	fw_session_id;
49024 	/* Control flags. */
49025 	uint16_t	flags;
49026 	/* Indicates the flow direction. */
49027 	#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR	UINT32_C(0x1)
49028 	/* If this bit set to 0, then it indicates rx flow. */
49029 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
49030 	/* If this bit is set to 1, then it indicates tx flow. */
49031 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
49032 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
49033 	/*
49034 	 * Defines the size, in bytes, of the provided flush_addr
49035 	 * buffer.
49036 	 */
49037 	uint16_t	flush_size;
49038 	/*
49039 	 * This is the DMA address for the flush input data array
49040 	 * buffer.  Array of tf_rm_resc_entry type. Size of the
49041 	 * buffer is provided by the 'flush_size' field in this
49042 	 * message.
49043 	 */
49044 	uint64_t	flush_addr;
49045 } hwrm_tf_session_resc_flush_input_t, *phwrm_tf_session_resc_flush_input_t;
49046 
49047 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
49048 
49049 typedef struct hwrm_tf_session_resc_flush_output {
49050 	/* The specific error status for the command. */
49051 	uint16_t	error_code;
49052 	/* The HWRM command request type. */
49053 	uint16_t	req_type;
49054 	/* The sequence ID from the original command. */
49055 	uint16_t	seq_id;
49056 	/* The length of the response data in number of bytes. */
49057 	uint16_t	resp_len;
49058 	/* unused. */
49059 	uint8_t	unused0[7];
49060 	/*
49061 	 * This field is used in Output records to indicate that the output
49062 	 * is completely written to RAM. This field should be read as '1'
49063 	 * to indicate that the output has been completely written.
49064 	 * When writing a command completion or response to an internal
49065 	 * processor, the order of writes has to be such that this field is
49066 	 * written last.
49067 	 */
49068 	uint8_t	valid;
49069 } hwrm_tf_session_resc_flush_output_t, *phwrm_tf_session_resc_flush_output_t;
49070 
49071 /*****************************
49072  * hwrm_tf_session_resc_info *
49073  *****************************/
49074 
49075 
49076 /* hwrm_tf_session_resc_info_input (size:320b/40B) */
49077 
49078 typedef struct hwrm_tf_session_resc_info_input {
49079 	/* The HWRM command request type. */
49080 	uint16_t	req_type;
49081 	/*
49082 	 * The completion ring to send the completion event on. This should
49083 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49084 	 */
49085 	uint16_t	cmpl_ring;
49086 	/*
49087 	 * The sequence ID is used by the driver for tracking multiple
49088 	 * commands. This ID is treated as opaque data by the firmware and
49089 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49090 	 */
49091 	uint16_t	seq_id;
49092 	/*
49093 	 * The target ID of the command:
49094 	 * * 0x0-0xFFF8 - The function ID
49095 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49096 	 * * 0xFFFD - Reserved for user-space HWRM interface
49097 	 * * 0xFFFF - HWRM
49098 	 */
49099 	uint16_t	target_id;
49100 	/*
49101 	 * A physical address pointer pointing to a host buffer that the
49102 	 * command's response data will be written. This can be either a host
49103 	 * physical address (HPA) or a guest physical address (GPA) and must
49104 	 * point to a physically contiguous block of memory.
49105 	 */
49106 	uint64_t	resp_addr;
49107 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49108 	uint32_t	fw_session_id;
49109 	/* Control flags. */
49110 	uint16_t	flags;
49111 	/* Indicates the flow direction. */
49112 	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR	UINT32_C(0x1)
49113 	/* If this bit set to 0, then it indicates rx flow. */
49114 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
49115 	/* If this bit is set to 1, then it indicates tx flow. */
49116 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
49117 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
49118 	/*
49119 	 * Defines the array size of the provided req_addr and
49120 	 * resv_addr array buffers. Should be set to the number of
49121 	 * request entries.
49122 	 */
49123 	uint16_t	req_size;
49124 	/*
49125 	 * This is the DMA address for the request input data array
49126 	 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
49127 	 * array buffer is provided by the 'req_size' field in this
49128 	 * message.
49129 	 */
49130 	uint64_t	req_addr;
49131 	/*
49132 	 * This is the DMA address for the resc output data array
49133 	 * buffer. Array is of tf_rm_resc_entry type. Size of the array
49134 	 * buffer is provided by the 'req_size' field in this
49135 	 * message.
49136 	 */
49137 	uint64_t	resc_addr;
49138 } hwrm_tf_session_resc_info_input_t, *phwrm_tf_session_resc_info_input_t;
49139 
49140 /* hwrm_tf_session_resc_info_output (size:128b/16B) */
49141 
49142 typedef struct hwrm_tf_session_resc_info_output {
49143 	/* The specific error status for the command. */
49144 	uint16_t	error_code;
49145 	/* The HWRM command request type. */
49146 	uint16_t	req_type;
49147 	/* The sequence ID from the original command. */
49148 	uint16_t	seq_id;
49149 	/* The length of the response data in number of bytes. */
49150 	uint16_t	resp_len;
49151 	/*
49152 	 * Size of the returned tf_rm_resc_entry data array. The value
49153 	 * cannot exceed the req_size defined by the input msg. The data
49154 	 * array is returned using the resv_addr specified DMA
49155 	 * address also provided by the input msg.
49156 	 */
49157 	uint16_t	size;
49158 	/* unused. */
49159 	uint8_t	unused0[5];
49160 	/*
49161 	 * This field is used in Output records to indicate that the output
49162 	 * is completely written to RAM. This field should be read as '1'
49163 	 * to indicate that the output has been completely written.
49164 	 * When writing a command completion or response to an internal
49165 	 * processor, the order of writes has to be such that this field is
49166 	 * written last.
49167 	 */
49168 	uint8_t	valid;
49169 } hwrm_tf_session_resc_info_output_t, *phwrm_tf_session_resc_info_output_t;
49170 
49171 /* TruFlow RM capability of a resource. */
49172 /* tf_rm_resc_req_entry (size:64b/8B) */
49173 
49174 typedef struct tf_rm_resc_req_entry {
49175 	/* Type of the resource, defined globally in HCAPI RM. */
49176 	uint32_t	type;
49177 	/* Minimum value. */
49178 	uint16_t	min;
49179 	/* Maximum value. */
49180 	uint16_t	max;
49181 } tf_rm_resc_req_entry_t, *ptf_rm_resc_req_entry_t;
49182 
49183 /* TruFlow RM reservation information. */
49184 /* tf_rm_resc_entry (size:64b/8B) */
49185 
49186 typedef struct tf_rm_resc_entry {
49187 	/* Type of the resource, defined globally in HCAPI RM. */
49188 	uint32_t	type;
49189 	/* Start offset. */
49190 	uint16_t	start;
49191 	/* Number of resources. */
49192 	uint16_t	stride;
49193 } tf_rm_resc_entry_t, *ptf_rm_resc_entry_t;
49194 
49195 /************************
49196  * hwrm_tf_tbl_type_get *
49197  ************************/
49198 
49199 
49200 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
49201 
49202 typedef struct hwrm_tf_tbl_type_get_input {
49203 	/* The HWRM command request type. */
49204 	uint16_t	req_type;
49205 	/*
49206 	 * The completion ring to send the completion event on. This should
49207 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49208 	 */
49209 	uint16_t	cmpl_ring;
49210 	/*
49211 	 * The sequence ID is used by the driver for tracking multiple
49212 	 * commands. This ID is treated as opaque data by the firmware and
49213 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49214 	 */
49215 	uint16_t	seq_id;
49216 	/*
49217 	 * The target ID of the command:
49218 	 * * 0x0-0xFFF8 - The function ID
49219 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49220 	 * * 0xFFFD - Reserved for user-space HWRM interface
49221 	 * * 0xFFFF - HWRM
49222 	 */
49223 	uint16_t	target_id;
49224 	/*
49225 	 * A physical address pointer pointing to a host buffer that the
49226 	 * command's response data will be written. This can be either a host
49227 	 * physical address (HPA) or a guest physical address (GPA) and must
49228 	 * point to a physically contiguous block of memory.
49229 	 */
49230 	uint64_t	resp_addr;
49231 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49232 	uint32_t	fw_session_id;
49233 	/* Control flags. */
49234 	uint16_t	flags;
49235 	/* Indicates the flow direction. */
49236 	#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
49237 	/* If this bit set to 0, then it indicates rx flow. */
49238 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
49239 	/* If this bit is set to 1, then it indicates tx flow. */
49240 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
49241 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST	HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
49242 	/*
49243 	 * When set use the special access register access to clear
49244 	 * the table entry on read.
49245 	 */
49246 	#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
49247 	/* unused. */
49248 	uint8_t	unused0[2];
49249 	/*
49250 	 * Type of the resource, defined globally in the
49251 	 * hwrm_tf_resc_type enum.
49252 	 */
49253 	uint32_t	type;
49254 	/* Index of the type to retrieve. */
49255 	uint32_t	index;
49256 } hwrm_tf_tbl_type_get_input_t, *phwrm_tf_tbl_type_get_input_t;
49257 
49258 /* hwrm_tf_tbl_type_get_output (size:2240b/280B) */
49259 
49260 typedef struct hwrm_tf_tbl_type_get_output {
49261 	/* The specific error status for the command. */
49262 	uint16_t	error_code;
49263 	/* The HWRM command request type. */
49264 	uint16_t	req_type;
49265 	/* The sequence ID from the original command. */
49266 	uint16_t	seq_id;
49267 	/* The length of the response data in number of bytes. */
49268 	uint16_t	resp_len;
49269 	/* Response code. */
49270 	uint32_t	resp_code;
49271 	/* Response size. */
49272 	uint16_t	size;
49273 	/* unused */
49274 	uint16_t	unused0;
49275 	/* Response data. */
49276 	uint8_t	data[256];
49277 	/* unused */
49278 	uint8_t	unused1[7];
49279 	/*
49280 	 * This field is used in Output records to indicate that the output
49281 	 * is completely written to RAM. This field should be read as '1'
49282 	 * to indicate that the output has been completely written.
49283 	 * When writing a command completion or response to an internal
49284 	 * processor, the order of writes has to be such that this field
49285 	 * is written last.
49286 	 */
49287 	uint8_t	valid;
49288 } hwrm_tf_tbl_type_get_output_t, *phwrm_tf_tbl_type_get_output_t;
49289 
49290 /************************
49291  * hwrm_tf_tbl_type_set *
49292  ************************/
49293 
49294 
49295 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
49296 
49297 typedef struct hwrm_tf_tbl_type_set_input {
49298 	/* The HWRM command request type. */
49299 	uint16_t	req_type;
49300 	/*
49301 	 * The completion ring to send the completion event on. This should
49302 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49303 	 */
49304 	uint16_t	cmpl_ring;
49305 	/*
49306 	 * The sequence ID is used by the driver for tracking multiple
49307 	 * commands. This ID is treated as opaque data by the firmware and
49308 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49309 	 */
49310 	uint16_t	seq_id;
49311 	/*
49312 	 * The target ID of the command:
49313 	 * * 0x0-0xFFF8 - The function ID
49314 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49315 	 * * 0xFFFD - Reserved for user-space HWRM interface
49316 	 * * 0xFFFF - HWRM
49317 	 */
49318 	uint16_t	target_id;
49319 	/*
49320 	 * A physical address pointer pointing to a host buffer that the
49321 	 * command's response data will be written. This can be either a host
49322 	 * physical address (HPA) or a guest physical address (GPA) and must
49323 	 * point to a physically contiguous block of memory.
49324 	 */
49325 	uint64_t	resp_addr;
49326 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49327 	uint32_t	fw_session_id;
49328 	/* Control flags. */
49329 	uint16_t	flags;
49330 	/* Indicates the flow direction. */
49331 	#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
49332 	/* If this bit set to 0, then it indicates rx flow. */
49333 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
49334 	/* If this bit is set to 1, then it indicates tx flow. */
49335 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
49336 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
49337 	/* Indicate table data is being sent via DMA. */
49338 	#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
49339 	/* unused. */
49340 	uint8_t	unused0[2];
49341 	/*
49342 	 * Type of the resource, defined globally in the
49343 	 * hwrm_tf_resc_type enum.
49344 	 */
49345 	uint32_t	type;
49346 	/* Index of the type to retrieve. */
49347 	uint32_t	index;
49348 	/* Size of the data to set. */
49349 	uint16_t	size;
49350 	/* unused */
49351 	uint8_t	unused1[6];
49352 	/* Data to be set. */
49353 	uint8_t	data[88];
49354 } hwrm_tf_tbl_type_set_input_t, *phwrm_tf_tbl_type_set_input_t;
49355 
49356 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
49357 
49358 typedef struct hwrm_tf_tbl_type_set_output {
49359 	/* The specific error status for the command. */
49360 	uint16_t	error_code;
49361 	/* The HWRM command request type. */
49362 	uint16_t	req_type;
49363 	/* The sequence ID from the original command. */
49364 	uint16_t	seq_id;
49365 	/* The length of the response data in number of bytes. */
49366 	uint16_t	resp_len;
49367 	/* unused. */
49368 	uint8_t	unused0[7];
49369 	/*
49370 	 * This field is used in Output records to indicate that the output
49371 	 * is completely written to RAM. This field should be read as '1'
49372 	 * to indicate that the output has been completely written.
49373 	 * When writing a command completion or response to an internal
49374 	 * processor, the order of writes has to be such that this field
49375 	 * is written last.
49376 	 */
49377 	uint8_t	valid;
49378 } hwrm_tf_tbl_type_set_output_t, *phwrm_tf_tbl_type_set_output_t;
49379 
49380 /**************************
49381  * hwrm_tf_ctxt_mem_alloc *
49382  **************************/
49383 
49384 
49385 /* hwrm_tf_ctxt_mem_alloc_input (size:192b/24B) */
49386 
49387 typedef struct hwrm_tf_ctxt_mem_alloc_input {
49388 	/* The HWRM command request type. */
49389 	uint16_t	req_type;
49390 	/*
49391 	 * The completion ring to send the completion event on. This should
49392 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49393 	 */
49394 	uint16_t	cmpl_ring;
49395 	/*
49396 	 * The sequence ID is used by the driver for tracking multiple
49397 	 * commands. This ID is treated as opaque data by the firmware and
49398 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49399 	 */
49400 	uint16_t	seq_id;
49401 	/*
49402 	 * The target ID of the command:
49403 	 * * 0x0-0xFFF8 - The function ID
49404 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49405 	 * * 0xFFFD - Reserved for user-space HWRM interface
49406 	 * * 0xFFFF - HWRM
49407 	 */
49408 	uint16_t	target_id;
49409 	/*
49410 	 * A physical address pointer pointing to a host buffer that the
49411 	 * command's response data will be written. This can be either a host
49412 	 * physical address (HPA) or a guest physical address (GPA) and must
49413 	 * point to a physically contiguous block of memory.
49414 	 */
49415 	uint64_t	resp_addr;
49416 	/* Size in KB of memory to be allocated. */
49417 	uint32_t	mem_size;
49418 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49419 	uint32_t	fw_session_id;
49420 } hwrm_tf_ctxt_mem_alloc_input_t, *phwrm_tf_ctxt_mem_alloc_input_t;
49421 
49422 /* hwrm_tf_ctxt_mem_alloc_output (size:192b/24B) */
49423 
49424 typedef struct hwrm_tf_ctxt_mem_alloc_output {
49425 	/* The specific error status for the command. */
49426 	uint16_t	error_code;
49427 	/* The HWRM command request type. */
49428 	uint16_t	req_type;
49429 	/* The sequence ID from the original command. */
49430 	uint16_t	seq_id;
49431 	/* The length of the response data in number of bytes. */
49432 	uint16_t	resp_len;
49433 	/* Pointer to the PBL, or PDL depending on number of levels */
49434 	uint64_t	page_dir;
49435 	/* Size of memory allocated. */
49436 	uint32_t	mem_size;
49437 	/* Counter PBL indirect levels. */
49438 	uint8_t	page_level;
49439 	/* PBL pointer is physical start address. */
49440 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
49441 	/* PBL pointer points to PTE table. */
49442 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
49443 	/*
49444 	 * PBL pointer points to PDE table with each entry pointing
49445 	 * to PTE tables.
49446 	 */
49447 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
49448 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2
49449 	/* Page size. */
49450 	uint8_t	page_size;
49451 	/* 4KB page size. */
49452 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
49453 	/* 8KB page size. */
49454 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
49455 	/* 64KB page size. */
49456 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
49457 	/* 128KB page size. */
49458 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_128K UINT32_C(0x5)
49459 	/* 256KB page size. */
49460 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
49461 	/* 512KB page size. */
49462 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_512K UINT32_C(0x7)
49463 	/* 1MB page size. */
49464 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
49465 	/* 2MB page size. */
49466 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
49467 	/* 4MB page size. */
49468 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
49469 	/* 8MB page size. */
49470 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8M   UINT32_C(0xb)
49471 	/* 1GB page size. */
49472 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
49473 	#define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G
49474 	/* unused. */
49475 	uint8_t	unused0;
49476 	/*
49477 	 * This field is used in Output records to indicate that the
49478 	 * output is completely written to RAM. This field should be
49479 	 * read as '1' to indicate that the output has been
49480 	 * completely written.  When writing a command completion or
49481 	 * response to an internal processor, the order of writes has
49482 	 * to be such that this field is written last.
49483 	 */
49484 	uint8_t	valid;
49485 } hwrm_tf_ctxt_mem_alloc_output_t, *phwrm_tf_ctxt_mem_alloc_output_t;
49486 
49487 /*************************
49488  * hwrm_tf_ctxt_mem_free *
49489  *************************/
49490 
49491 
49492 /* hwrm_tf_ctxt_mem_free_input (size:320b/40B) */
49493 
49494 typedef struct hwrm_tf_ctxt_mem_free_input {
49495 	/* The HWRM command request type. */
49496 	uint16_t	req_type;
49497 	/*
49498 	 * The completion ring to send the completion event on. This should
49499 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49500 	 */
49501 	uint16_t	cmpl_ring;
49502 	/*
49503 	 * The sequence ID is used by the driver for tracking multiple
49504 	 * commands. This ID is treated as opaque data by the firmware and
49505 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49506 	 */
49507 	uint16_t	seq_id;
49508 	/*
49509 	 * The target ID of the command:
49510 	 * * 0x0-0xFFF8 - The function ID
49511 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49512 	 * * 0xFFFD - Reserved for user-space HWRM interface
49513 	 * * 0xFFFF - HWRM
49514 	 */
49515 	uint16_t	target_id;
49516 	/*
49517 	 * A physical address pointer pointing to a host buffer that the
49518 	 * command's response data will be written. This can be either a host
49519 	 * physical address (HPA) or a guest physical address (GPA) and must
49520 	 * point to a physically contiguous block of memory.
49521 	 */
49522 	uint64_t	resp_addr;
49523 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49524 	uint32_t	fw_session_id;
49525 	/* Counter PBL indirect levels. */
49526 	uint8_t	page_level;
49527 	/* PBL pointer is physical start address. */
49528 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
49529 	/* PBL pointer points to PTE table. */
49530 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
49531 	/*
49532 	 * PBL pointer points to PDE table with each entry pointing
49533 	 * to PTE tables.
49534 	 */
49535 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
49536 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2
49537 	/* Page size. */
49538 	uint8_t	page_size;
49539 	/* 4KB page size. */
49540 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
49541 	/* 8KB page size. */
49542 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
49543 	/* 64KB page size. */
49544 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
49545 	/* 128KB page size. */
49546 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
49547 	/* 256KB page size. */
49548 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
49549 	/* 512KB page size. */
49550 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
49551 	/* 1MB page size. */
49552 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
49553 	/* 2MB page size. */
49554 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
49555 	/* 4MB page size. */
49556 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
49557 	/* 8MB page size. */
49558 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
49559 	/* 1GB page size. */
49560 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
49561 	#define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G
49562 	/* unused. */
49563 	uint8_t	unused0[2];
49564 	/* Pointer to the PBL, or PDL depending on number of levels */
49565 	uint64_t	page_dir;
49566 	/* Size of memory allocated. */
49567 	uint32_t	mem_size;
49568 	/* unused. */
49569 	uint8_t	unused1[4];
49570 } hwrm_tf_ctxt_mem_free_input_t, *phwrm_tf_ctxt_mem_free_input_t;
49571 
49572 /* hwrm_tf_ctxt_mem_free_output (size:128b/16B) */
49573 
49574 typedef struct hwrm_tf_ctxt_mem_free_output {
49575 	/* The specific error status for the command. */
49576 	uint16_t	error_code;
49577 	/* The HWRM command request type. */
49578 	uint16_t	req_type;
49579 	/* The sequence ID from the original command. */
49580 	uint16_t	seq_id;
49581 	/* The length of the response data in number of bytes. */
49582 	uint16_t	resp_len;
49583 	/* unused. */
49584 	uint8_t	unused0[7];
49585 	/*
49586 	 * This field is used in Output records to indicate that the
49587 	 * output is completely written to RAM. This field should be
49588 	 * read as '1' to indicate that the output has been
49589 	 * completely written.  When writing a command completion or
49590 	 * response to an internal processor, the order of writes has
49591 	 * to be such that this field is written last.
49592 	 */
49593 	uint8_t	valid;
49594 } hwrm_tf_ctxt_mem_free_output_t, *phwrm_tf_ctxt_mem_free_output_t;
49595 
49596 /*************************
49597  * hwrm_tf_ctxt_mem_rgtr *
49598  *************************/
49599 
49600 
49601 /* hwrm_tf_ctxt_mem_rgtr_input (size:256b/32B) */
49602 
49603 typedef struct hwrm_tf_ctxt_mem_rgtr_input {
49604 	/* The HWRM command request type. */
49605 	uint16_t	req_type;
49606 	/*
49607 	 * The completion ring to send the completion event on. This should
49608 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49609 	 */
49610 	uint16_t	cmpl_ring;
49611 	/*
49612 	 * The sequence ID is used by the driver for tracking multiple
49613 	 * commands. This ID is treated as opaque data by the firmware and
49614 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49615 	 */
49616 	uint16_t	seq_id;
49617 	/*
49618 	 * The target ID of the command:
49619 	 * * 0x0-0xFFF8 - The function ID
49620 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49621 	 * * 0xFFFD - Reserved for user-space HWRM interface
49622 	 * * 0xFFFF - HWRM
49623 	 */
49624 	uint16_t	target_id;
49625 	/*
49626 	 * A physical address pointer pointing to a host buffer that the
49627 	 * command's response data will be written. This can be either a host
49628 	 * physical address (HPA) or a guest physical address (GPA) and must
49629 	 * point to a physically contiguous block of memory.
49630 	 */
49631 	uint64_t	resp_addr;
49632 	/* Control flags. */
49633 	uint16_t	flags;
49634 	/* Counter PBL indirect levels. */
49635 	uint8_t	page_level;
49636 	/* PBL pointer is physical start address. */
49637 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
49638 	/* PBL pointer points to PTE table. */
49639 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
49640 	/*
49641 	 * PBL pointer points to PDE table with each entry pointing
49642 	 * to PTE tables.
49643 	 */
49644 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
49645 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LAST HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
49646 	/* Page size. */
49647 	uint8_t	page_size;
49648 	/* 4KB page size. */
49649 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
49650 	/* 8KB page size. */
49651 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
49652 	/* 64KB page size. */
49653 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
49654 	/* 128KB page size. */
49655 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
49656 	/* 256KB page size. */
49657 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
49658 	/* 512KB page size. */
49659 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
49660 	/* 1MB page size. */
49661 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
49662 	/* 2MB page size. */
49663 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
49664 	/* 4MB page size. */
49665 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
49666 	/* 8MB page size. */
49667 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
49668 	/* 1GB page size. */
49669 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
49670 	#define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_LAST HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G
49671 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49672 	uint32_t	fw_session_id;
49673 	/* Pointer to the PBL, or PDL depending on number of levels */
49674 	uint64_t	page_dir;
49675 } hwrm_tf_ctxt_mem_rgtr_input_t, *phwrm_tf_ctxt_mem_rgtr_input_t;
49676 
49677 /* hwrm_tf_ctxt_mem_rgtr_output (size:128b/16B) */
49678 
49679 typedef struct hwrm_tf_ctxt_mem_rgtr_output {
49680 	/* The specific error status for the command. */
49681 	uint16_t	error_code;
49682 	/* The HWRM command request type. */
49683 	uint16_t	req_type;
49684 	/* The sequence ID from the original command. */
49685 	uint16_t	seq_id;
49686 	/* The length of the response data in number of bytes. */
49687 	uint16_t	resp_len;
49688 	/*
49689 	 * Id/Handle to the recently register context memory. This
49690 	 * handle is passed to the TF session.
49691 	 */
49692 	uint16_t	ctx_id;
49693 	/* unused. */
49694 	uint8_t	unused0[5];
49695 	/*
49696 	 * This field is used in Output records to indicate that the
49697 	 * output is completely written to RAM. This field should be
49698 	 * read as '1' to indicate that the output has been
49699 	 * completely written.  When writing a command completion or
49700 	 * response to an internal processor, the order of writes has
49701 	 * to be such that this field is written last.
49702 	 */
49703 	uint8_t	valid;
49704 } hwrm_tf_ctxt_mem_rgtr_output_t, *phwrm_tf_ctxt_mem_rgtr_output_t;
49705 
49706 /***************************
49707  * hwrm_tf_ctxt_mem_unrgtr *
49708  ***************************/
49709 
49710 
49711 /* hwrm_tf_ctxt_mem_unrgtr_input (size:192b/24B) */
49712 
49713 typedef struct hwrm_tf_ctxt_mem_unrgtr_input {
49714 	/* The HWRM command request type. */
49715 	uint16_t	req_type;
49716 	/*
49717 	 * The completion ring to send the completion event on. This should
49718 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49719 	 */
49720 	uint16_t	cmpl_ring;
49721 	/*
49722 	 * The sequence ID is used by the driver for tracking multiple
49723 	 * commands. This ID is treated as opaque data by the firmware and
49724 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49725 	 */
49726 	uint16_t	seq_id;
49727 	/*
49728 	 * The target ID of the command:
49729 	 * * 0x0-0xFFF8 - The function ID
49730 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49731 	 * * 0xFFFD - Reserved for user-space HWRM interface
49732 	 * * 0xFFFF - HWRM
49733 	 */
49734 	uint16_t	target_id;
49735 	/*
49736 	 * A physical address pointer pointing to a host buffer that the
49737 	 * command's response data will be written. This can be either a host
49738 	 * physical address (HPA) or a guest physical address (GPA) and must
49739 	 * point to a physically contiguous block of memory.
49740 	 */
49741 	uint64_t	resp_addr;
49742 	/*
49743 	 * Id/Handle to the recently register context memory. This
49744 	 * handle is passed to the TF session.
49745 	 */
49746 	uint16_t	ctx_id;
49747 	/* unused. */
49748 	uint8_t	unused0[2];
49749 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49750 	uint32_t	fw_session_id;
49751 } hwrm_tf_ctxt_mem_unrgtr_input_t, *phwrm_tf_ctxt_mem_unrgtr_input_t;
49752 
49753 /* hwrm_tf_ctxt_mem_unrgtr_output (size:128b/16B) */
49754 
49755 typedef struct hwrm_tf_ctxt_mem_unrgtr_output {
49756 	/* The specific error status for the command. */
49757 	uint16_t	error_code;
49758 	/* The HWRM command request type. */
49759 	uint16_t	req_type;
49760 	/* The sequence ID from the original command. */
49761 	uint16_t	seq_id;
49762 	/* The length of the response data in number of bytes. */
49763 	uint16_t	resp_len;
49764 	/* unused. */
49765 	uint8_t	unused0[7];
49766 	/*
49767 	 * This field is used in Output records to indicate that the
49768 	 * output is completely written to RAM. This field should be
49769 	 * read as '1' to indicate that the output has been
49770 	 * completely written.  When writing a command completion or
49771 	 * response to an internal processor, the order of writes has
49772 	 * to be such that this field is written last.
49773 	 */
49774 	uint8_t	valid;
49775 } hwrm_tf_ctxt_mem_unrgtr_output_t, *phwrm_tf_ctxt_mem_unrgtr_output_t;
49776 
49777 /************************
49778  * hwrm_tf_ext_em_qcaps *
49779  ************************/
49780 
49781 
49782 /* hwrm_tf_ext_em_qcaps_input (size:192b/24B) */
49783 
49784 typedef struct hwrm_tf_ext_em_qcaps_input {
49785 	/* The HWRM command request type. */
49786 	uint16_t	req_type;
49787 	/*
49788 	 * The completion ring to send the completion event on. This should
49789 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49790 	 */
49791 	uint16_t	cmpl_ring;
49792 	/*
49793 	 * The sequence ID is used by the driver for tracking multiple
49794 	 * commands. This ID is treated as opaque data by the firmware and
49795 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49796 	 */
49797 	uint16_t	seq_id;
49798 	/*
49799 	 * The target ID of the command:
49800 	 * * 0x0-0xFFF8 - The function ID
49801 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49802 	 * * 0xFFFD - Reserved for user-space HWRM interface
49803 	 * * 0xFFFF - HWRM
49804 	 */
49805 	uint16_t	target_id;
49806 	/*
49807 	 * A physical address pointer pointing to a host buffer that the
49808 	 * command's response data will be written. This can be either a host
49809 	 * physical address (HPA) or a guest physical address (GPA) and must
49810 	 * point to a physically contiguous block of memory.
49811 	 */
49812 	uint64_t	resp_addr;
49813 	/* Control flags. */
49814 	uint32_t	flags;
49815 	/* Indicates the flow direction. */
49816 	#define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR		UINT32_C(0x1)
49817 	/* If this bit set to 0, then it indicates rx flow. */
49818 		#define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
49819 	/* If this bit is set to 1, then it indicates tx flow. */
49820 		#define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
49821 		#define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_LAST		HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX
49822 	/* When set to 1, all offloaded flows will be sent to EXT EM. */
49823 	#define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x2)
49824 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49825 	uint32_t	fw_session_id;
49826 } hwrm_tf_ext_em_qcaps_input_t, *phwrm_tf_ext_em_qcaps_input_t;
49827 
49828 /* hwrm_tf_ext_em_qcaps_output (size:384b/48B) */
49829 
49830 typedef struct hwrm_tf_ext_em_qcaps_output {
49831 	/* The specific error status for the command. */
49832 	uint16_t	error_code;
49833 	/* The HWRM command request type. */
49834 	uint16_t	req_type;
49835 	/* The sequence ID from the original command. */
49836 	uint16_t	seq_id;
49837 	/* The length of the response data in number of bytes. */
49838 	uint16_t	resp_len;
49839 	uint32_t	flags;
49840 	/*
49841 	 * When set to 1, indicates the FW supports the Centralized
49842 	 * Memory Model. The concept designates one entity for the
49843 	 * memory allocation while all others ‘subscribe’ to it.
49844 	 */
49845 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED		UINT32_C(0x1)
49846 	/*
49847 	 * When set to 1, indicates the FW supports the Detached
49848 	 * Centralized Memory Model. The memory is allocated and managed
49849 	 * as a separate entity. All PFs and VFs will be granted direct
49850 	 * or semi-direct access to the allocated memory while none of
49851 	 * which can interfere with the management of the memory.
49852 	 */
49853 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED	UINT32_C(0x2)
49854 	/* When set to 1, indicates FW support for host based EEM memory. */
49855 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_HOST_MEMORY_SUPPORTED			UINT32_C(0x4)
49856 	/* When set to 1, indicates FW support for on-chip based EEM memory. */
49857 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_FW_MEMORY_SUPPORTED				UINT32_C(0x8)
49858 	/* unused. */
49859 	uint32_t	unused0;
49860 	/* Support flags. */
49861 	uint32_t	supported;
49862 	/*
49863 	 * If set to 1, then EXT EM KEY0 table is supported using
49864 	 * crc32 hash.
49865 	 * If set to 0, EXT EM KEY0 table is not supported.
49866 	 */
49867 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE			UINT32_C(0x1)
49868 	/*
49869 	 * If set to 1, then EXT EM KEY1 table is supported using
49870 	 * lookup3 hash.
49871 	 * If set to 0, EXT EM KEY1 table is not supported.
49872 	 */
49873 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE			UINT32_C(0x2)
49874 	/*
49875 	 * If set to 1, then EXT EM External Record table is supported.
49876 	 * If set to 0, EXT EM External Record table is not
49877 	 * supported.  (This table includes action record, EFC
49878 	 * pointers, encap pointers)
49879 	 */
49880 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE		UINT32_C(0x4)
49881 	/*
49882 	 * If set to 1, then EXT EM External Flow Counters table is
49883 	 * supported.
49884 	 * If set to 0, EXT EM External Flow Counters table is not
49885 	 * supported.
49886 	 */
49887 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE	UINT32_C(0x8)
49888 	/*
49889 	 * If set to 1, then FID table used for implicit flow flush
49890 	 * is supported.
49891 	 * If set to 0, then FID table used for implicit flow flush
49892 	 * is not supported.
49893 	 */
49894 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE			UINT32_C(0x10)
49895 	/*
49896 	 * If set to 1, then table scopes are supported.
49897 	 * If set to 0, then table scopes are not supported.
49898 	 */
49899 	#define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_TBL_SCOPES			UINT32_C(0x20)
49900 	/*
49901 	 * The maximum number of entries supported by EXT EM. When
49902 	 * configuring the host memory the number of numbers of
49903 	 * entries that can supported are -
49904 	 *	32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M,
49905 	 *	128M entries.
49906 	 * Any value that are not these values, the FW will round
49907 	 * down to the closest support number of entries.
49908 	 */
49909 	uint32_t	max_entries_supported;
49910 	/*
49911 	 * The entry size in bytes of each entry in the EXT EM
49912 	 * KEY0/KEY1 tables.
49913 	 */
49914 	uint16_t	key_entry_size;
49915 	/*
49916 	 * The entry size in bytes of each entry in the EXT EM RECORD
49917 	 * tables.
49918 	 */
49919 	uint16_t	record_entry_size;
49920 	/* The entry size in bytes of each entry in the EXT EM EFC tables. */
49921 	uint16_t	efc_entry_size;
49922 	/* The FID size in bytes of each entry in the EXT EM FID tables. */
49923 	uint16_t	fid_entry_size;
49924 	/* Maximum number of ctxt mem allocations allowed. */
49925 	uint32_t	max_ctxt_mem_allocs;
49926 	/*
49927 	 * Maximum number of static buckets that can be assigned to lookup
49928 	 * table scopes.
49929 	 */
49930 	uint32_t	max_static_buckets;
49931 	/* unused. */
49932 	uint8_t	unused1[7];
49933 	/*
49934 	 * This field is used in Output records to indicate that the
49935 	 * output is completely written to RAM. This field should be
49936 	 * read as '1' to indicate that the output has been
49937 	 * completely written.  When writing a command completion or
49938 	 * response to an internal processor, the order of writes has
49939 	 * to be such that this field is written last.
49940 	 */
49941 	uint8_t	valid;
49942 } hwrm_tf_ext_em_qcaps_output_t, *phwrm_tf_ext_em_qcaps_output_t;
49943 
49944 /*********************
49945  * hwrm_tf_ext_em_op *
49946  *********************/
49947 
49948 
49949 /* hwrm_tf_ext_em_op_input (size:256b/32B) */
49950 
49951 typedef struct hwrm_tf_ext_em_op_input {
49952 	/* The HWRM command request type. */
49953 	uint16_t	req_type;
49954 	/*
49955 	 * The completion ring to send the completion event on. This should
49956 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49957 	 */
49958 	uint16_t	cmpl_ring;
49959 	/*
49960 	 * The sequence ID is used by the driver for tracking multiple
49961 	 * commands. This ID is treated as opaque data by the firmware and
49962 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49963 	 */
49964 	uint16_t	seq_id;
49965 	/*
49966 	 * The target ID of the command:
49967 	 * * 0x0-0xFFF8 - The function ID
49968 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49969 	 * * 0xFFFD - Reserved for user-space HWRM interface
49970 	 * * 0xFFFF - HWRM
49971 	 */
49972 	uint16_t	target_id;
49973 	/*
49974 	 * A physical address pointer pointing to a host buffer that the
49975 	 * command's response data will be written. This can be either a host
49976 	 * physical address (HPA) or a guest physical address (GPA) and must
49977 	 * point to a physically contiguous block of memory.
49978 	 */
49979 	uint64_t	resp_addr;
49980 	/* Control flags. */
49981 	uint16_t	flags;
49982 	/* Indicates the flow direction. */
49983 	#define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR	UINT32_C(0x1)
49984 	/* If this bit set to 0, then it indicates rx flow. */
49985 		#define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
49986 	/* If this bit is set to 1, then it indicates tx flow. */
49987 		#define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
49988 		#define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX
49989 	/* unused. */
49990 	uint16_t	unused0;
49991 	/* The number of EXT EM key table entries to be configured. */
49992 	uint16_t	op;
49993 	/* This value is reserved and should not be used. */
49994 	#define HWRM_TF_EXT_EM_OP_INPUT_OP_RESERVED	UINT32_C(0x0)
49995 	/*
49996 	 * To properly stop EXT EM and ensure there are no DMA's,
49997 	 * the caller must disable EXT EM for the given PF, using
49998 	 * this call. This will safely disable EXT EM and ensure
49999 	 * that all DMA'ed to the keys/records/efc have been
50000 	 * completed.
50001 	 */
50002 	#define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_DISABLE UINT32_C(0x1)
50003 	/*
50004 	 * Once the EXT EM host memory has been configured, EXT EM
50005 	 * options have been configured. Then the caller should
50006 	 * enable EXT EM for the given PF. Note once this call has
50007 	 * been made, then the EXT EM mechanism will be active and
50008 	 * DMA's will occur as packets are processed.
50009 	 */
50010 	#define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_ENABLE  UINT32_C(0x2)
50011 	/*
50012 	 * Clear EXT EM settings for the given PF so that the
50013 	 * register values are reset back to their initial state.
50014 	 */
50015 	#define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP UINT32_C(0x3)
50016 	#define HWRM_TF_EXT_EM_OP_INPUT_OP_LAST	HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP
50017 	/* unused. */
50018 	uint16_t	unused1;
50019 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50020 	uint32_t	fw_session_id;
50021 	/* unused. */
50022 	uint32_t	unused2;
50023 } hwrm_tf_ext_em_op_input_t, *phwrm_tf_ext_em_op_input_t;
50024 
50025 /* hwrm_tf_ext_em_op_output (size:128b/16B) */
50026 
50027 typedef struct hwrm_tf_ext_em_op_output {
50028 	/* The specific error status for the command. */
50029 	uint16_t	error_code;
50030 	/* The HWRM command request type. */
50031 	uint16_t	req_type;
50032 	/* The sequence ID from the original command. */
50033 	uint16_t	seq_id;
50034 	/* The length of the response data in number of bytes. */
50035 	uint16_t	resp_len;
50036 	/* unused. */
50037 	uint8_t	unused0[7];
50038 	/*
50039 	 * This field is used in Output records to indicate that the
50040 	 * output is completely written to RAM. This field should be
50041 	 * read as '1' to indicate that the output has been
50042 	 * completely written.  When writing a command completion or
50043 	 * response to an internal processor, the order of writes has
50044 	 * to be such that this field is written last.
50045 	 */
50046 	uint8_t	valid;
50047 } hwrm_tf_ext_em_op_output_t, *phwrm_tf_ext_em_op_output_t;
50048 
50049 /**********************
50050  * hwrm_tf_ext_em_cfg *
50051  **********************/
50052 
50053 
50054 /* hwrm_tf_ext_em_cfg_input (size:512b/64B) */
50055 
50056 typedef struct hwrm_tf_ext_em_cfg_input {
50057 	/* The HWRM command request type. */
50058 	uint16_t	req_type;
50059 	/*
50060 	 * The completion ring to send the completion event on. This should
50061 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50062 	 */
50063 	uint16_t	cmpl_ring;
50064 	/*
50065 	 * The sequence ID is used by the driver for tracking multiple
50066 	 * commands. This ID is treated as opaque data by the firmware and
50067 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50068 	 */
50069 	uint16_t	seq_id;
50070 	/*
50071 	 * The target ID of the command:
50072 	 * * 0x0-0xFFF8 - The function ID
50073 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50074 	 * * 0xFFFD - Reserved for user-space HWRM interface
50075 	 * * 0xFFFF - HWRM
50076 	 */
50077 	uint16_t	target_id;
50078 	/*
50079 	 * A physical address pointer pointing to a host buffer that the
50080 	 * command's response data will be written. This can be either a host
50081 	 * physical address (HPA) or a guest physical address (GPA) and must
50082 	 * point to a physically contiguous block of memory.
50083 	 */
50084 	uint64_t	resp_addr;
50085 	/* Control flags. */
50086 	uint32_t	flags;
50087 	/* Indicates the flow direction. */
50088 	#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR		UINT32_C(0x1)
50089 	/* If this bit set to 0, then it indicates rx flow. */
50090 		#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
50091 	/* If this bit is set to 1, then it indicates tx flow. */
50092 		#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
50093 		#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_LAST		HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX
50094 	/* When set to 1, all offloaded flows will be sent to EXT EM. */
50095 	#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x2)
50096 	/* When set to 1, secondary, 0 means primary. */
50097 	#define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_SECONDARY_PF	UINT32_C(0x4)
50098 	/*
50099 	 * Group_id which used by Firmware to identify memory pools belonging
50100 	 * to certain group.
50101 	 */
50102 	uint16_t	group_id;
50103 	/*
50104 	 * Dynamically reconfigure EEM pending cache every 1/10th of second.
50105 	 * If set to 0 it will disable the EEM HW flush of the pending cache.
50106 	 */
50107 	uint8_t	flush_interval;
50108 	/* unused. */
50109 	uint8_t	unused0;
50110 	/*
50111 	 * Configured EXT EM with the given number of entries. All
50112 	 * the EXT EM tables KEY0, KEY1, RECORD, EFC all have the
50113 	 * same number of entries and all tables will be configured
50114 	 * using this value. Current minimum value is 32k. Current
50115 	 * maximum value is 128M.
50116 	 */
50117 	uint32_t	num_entries;
50118 	uint32_t	enables;
50119 	/*
50120 	 * This bit must be '1' for the group_id field to be
50121 	 * configured.
50122 	 */
50123 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_GROUP_ID		UINT32_C(0x1)
50124 	/*
50125 	 * This bit must be '1' for the flush_interval field to be
50126 	 * configured.
50127 	 */
50128 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FLUSH_INTERVAL	UINT32_C(0x2)
50129 	/*
50130 	 * This bit must be '1' for the num_entries field to be
50131 	 * configured.
50132 	 */
50133 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_NUM_ENTRIES		UINT32_C(0x4)
50134 	/*
50135 	 * This bit must be '1' for the key0_ctx_id field to be
50136 	 * configured.
50137 	 */
50138 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY0_CTX_ID		UINT32_C(0x8)
50139 	/*
50140 	 * This bit must be '1' for the key1_ctx_id field to be
50141 	 * configured.
50142 	 */
50143 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY1_CTX_ID		UINT32_C(0x10)
50144 	/*
50145 	 * This bit must be '1' for the record_ctx_id field to be
50146 	 * configured.
50147 	 */
50148 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_RECORD_CTX_ID	UINT32_C(0x20)
50149 	/*
50150 	 * This bit must be '1' for the efc_ctx_id field to be
50151 	 * configured.
50152 	 */
50153 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_EFC_CTX_ID		UINT32_C(0x40)
50154 	/*
50155 	 * This bit must be '1' for the fid_ctx_id field to be
50156 	 * configured.
50157 	 */
50158 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FID_CTX_ID		UINT32_C(0x80)
50159 	/*
50160 	 * This bit must be '1' for the action_ctx_id field to be
50161 	 * configured.
50162 	 */
50163 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_CTX_ID	UINT32_C(0x100)
50164 	/*
50165 	 * This bit must be '1' for the action_tbl_scope field to be
50166 	 * configured.
50167 	 */
50168 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_TBL_SCOPE	UINT32_C(0x200)
50169 	/*
50170 	 * This bit must be '1' for the lkup_ctx_id field to be
50171 	 * configured.
50172 	 */
50173 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_CTX_ID		UINT32_C(0x400)
50174 	/*
50175 	 * This bit must be '1' for the lkup_tbl_scope field to be
50176 	 * configured.
50177 	 */
50178 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_TBL_SCOPE	UINT32_C(0x800)
50179 	/*
50180 	 * This bit must be '1' for the lkup_static_buckets field to be
50181 	 * configured.
50182 	 */
50183 	#define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_STATIC_BUCKETS	UINT32_C(0x1000)
50184 	/* Configured EXT EM with the given context if for KEY0 table. */
50185 	uint16_t	key0_ctx_id;
50186 	/* Configured EXT EM with the given context if for KEY1 table. */
50187 	uint16_t	key1_ctx_id;
50188 	/* Configured EXT EM with the given context if for RECORD table. */
50189 	uint16_t	record_ctx_id;
50190 	/* Configured EXT EM with the given context if for EFC table. */
50191 	uint16_t	efc_ctx_id;
50192 	/* Configured EXT EM with the given context if for EFC table. */
50193 	uint16_t	fid_ctx_id;
50194 	/* Context id of action table scope. */
50195 	uint16_t	action_ctx_id;
50196 	/* Table scope id used for action record entries. */
50197 	uint16_t	action_tbl_scope;
50198 	/* Context id of lookup table scope. */
50199 	uint16_t	lkup_ctx_id;
50200 	/* Table scope id used for EM lookup entries. */
50201 	uint16_t	lkup_tbl_scope;
50202 	/* unused. */
50203 	uint16_t	unused1;
50204 	/*
50205 	 * Number of 32B static buckets to be allocated at the beginning
50206 	 * of table scope.
50207 	 */
50208 	uint32_t	lkup_static_buckets;
50209 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50210 	uint32_t	fw_session_id;
50211 	/* unused. */
50212 	uint32_t	unused2;
50213 } hwrm_tf_ext_em_cfg_input_t, *phwrm_tf_ext_em_cfg_input_t;
50214 
50215 /* hwrm_tf_ext_em_cfg_output (size:128b/16B) */
50216 
50217 typedef struct hwrm_tf_ext_em_cfg_output {
50218 	/* The specific error status for the command. */
50219 	uint16_t	error_code;
50220 	/* The HWRM command request type. */
50221 	uint16_t	req_type;
50222 	/* The sequence ID from the original command. */
50223 	uint16_t	seq_id;
50224 	/* The length of the response data in number of bytes. */
50225 	uint16_t	resp_len;
50226 	/* unused. */
50227 	uint8_t	unused0[7];
50228 	/*
50229 	 * This field is used in Output records to indicate that the
50230 	 * output is completely written to RAM. This field should be
50231 	 * read as '1' to indicate that the output has been
50232 	 * completely written.  When writing a command completion or
50233 	 * response to an internal processor, the order of writes has
50234 	 * to be such that this field is written last.
50235 	 */
50236 	uint8_t	valid;
50237 } hwrm_tf_ext_em_cfg_output_t, *phwrm_tf_ext_em_cfg_output_t;
50238 
50239 /***********************
50240  * hwrm_tf_ext_em_qcfg *
50241  ***********************/
50242 
50243 
50244 /* hwrm_tf_ext_em_qcfg_input (size:192b/24B) */
50245 
50246 typedef struct hwrm_tf_ext_em_qcfg_input {
50247 	/* The HWRM command request type. */
50248 	uint16_t	req_type;
50249 	/*
50250 	 * The completion ring to send the completion event on. This should
50251 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50252 	 */
50253 	uint16_t	cmpl_ring;
50254 	/*
50255 	 * The sequence ID is used by the driver for tracking multiple
50256 	 * commands. This ID is treated as opaque data by the firmware and
50257 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50258 	 */
50259 	uint16_t	seq_id;
50260 	/*
50261 	 * The target ID of the command:
50262 	 * * 0x0-0xFFF8 - The function ID
50263 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50264 	 * * 0xFFFD - Reserved for user-space HWRM interface
50265 	 * * 0xFFFF - HWRM
50266 	 */
50267 	uint16_t	target_id;
50268 	/*
50269 	 * A physical address pointer pointing to a host buffer that the
50270 	 * command's response data will be written. This can be either a host
50271 	 * physical address (HPA) or a guest physical address (GPA) and must
50272 	 * point to a physically contiguous block of memory.
50273 	 */
50274 	uint64_t	resp_addr;
50275 	/* Control flags. */
50276 	uint32_t	flags;
50277 	/* Indicates the flow direction. */
50278 	#define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR	UINT32_C(0x1)
50279 	/* If this bit set to 0, then it indicates rx flow. */
50280 		#define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50281 	/* If this bit is set to 1, then it indicates tx flow. */
50282 		#define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50283 		#define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_LAST HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX
50284 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50285 	uint32_t	fw_session_id;
50286 } hwrm_tf_ext_em_qcfg_input_t, *phwrm_tf_ext_em_qcfg_input_t;
50287 
50288 /* hwrm_tf_ext_em_qcfg_output (size:448b/56B) */
50289 
50290 typedef struct hwrm_tf_ext_em_qcfg_output {
50291 	/* The specific error status for the command. */
50292 	uint16_t	error_code;
50293 	/* The HWRM command request type. */
50294 	uint16_t	req_type;
50295 	/* The sequence ID from the original command. */
50296 	uint16_t	seq_id;
50297 	/* The length of the response data in number of bytes. */
50298 	uint16_t	resp_len;
50299 	/* Control flags. */
50300 	uint32_t	flags;
50301 	/* Indicates the flow direction. */
50302 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR		UINT32_C(0x1)
50303 	/* If this bit set to 0, then it indicates rx flow. */
50304 		#define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_RX		UINT32_C(0x0)
50305 	/* If this bit is set to 1, then it indicates tx flow. */
50306 		#define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX		UINT32_C(0x1)
50307 		#define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_LAST		HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX
50308 	/* When set to 1, all offloaded flows will be sent to EXT EM. */
50309 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x2)
50310 	/* The number of entries the FW has configured for EXT EM. */
50311 	uint32_t	num_entries;
50312 	/* Configured EXT EM with the given context if for KEY0 table. */
50313 	uint16_t	key0_ctx_id;
50314 	/* Configured EXT EM with the given context if for KEY1 table. */
50315 	uint16_t	key1_ctx_id;
50316 	/* Configured EXT EM with the given context if for RECORD table. */
50317 	uint16_t	record_ctx_id;
50318 	/* Configured EXT EM with the given context if for EFC table. */
50319 	uint16_t	efc_ctx_id;
50320 	/* Configured EXT EM with the given context if for EFC table. */
50321 	uint16_t	fid_ctx_id;
50322 	/* unused. */
50323 	uint16_t	unused0;
50324 	uint32_t	supported;
50325 	/* This bit must be '1' for the group_id field is set. */
50326 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_GROUP_ID		UINT32_C(0x1)
50327 	/* This bit must be '1' for the flush_interval field is set. */
50328 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FLUSH_INTERVAL	UINT32_C(0x2)
50329 	/* This bit must be '1' for the num_entries field is set. */
50330 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_NUM_ENTRIES		UINT32_C(0x4)
50331 	/* This bit must be '1' for the key0_ctx_id field is set. */
50332 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY0_CTX_ID		UINT32_C(0x8)
50333 	/* This bit must be '1' for the key1_ctx_id field is set. */
50334 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY1_CTX_ID		UINT32_C(0x10)
50335 	/* This bit must be '1' for the record_ctx_id field is set. */
50336 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_RECORD_CTX_ID	UINT32_C(0x20)
50337 	/* This bit must be '1' for the efc_ctx_id field is set. */
50338 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_EFC_CTX_ID		UINT32_C(0x40)
50339 	/* This bit must be '1' for the fid_ctx_id field is set. */
50340 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FID_CTX_ID		UINT32_C(0x80)
50341 	/* This bit must be '1' for the action_ctx_id field is set. */
50342 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_CTX_ID	UINT32_C(0x100)
50343 	/* This bit must be '1' for the action_tbl_scope field is set. */
50344 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_TBL_SCOPE	UINT32_C(0x200)
50345 	/* This bit must be '1' for the lkup_ctx_id field is set. */
50346 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_CTX_ID		UINT32_C(0x400)
50347 	/* This bit must be '1' for the lkup_tbl_scope field is set. */
50348 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_TBL_SCOPE	UINT32_C(0x800)
50349 	/* This bit must be '1' for the lkup_static_buckets field is set. */
50350 	#define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_STATIC_BUCKETS	UINT32_C(0x1000)
50351 	/*
50352 	 * Group id is used by firmware to identify memory pools belonging
50353 	 * to certain group.
50354 	 */
50355 	uint16_t	group_id;
50356 	/* EEM pending cache flush interval in 1/10th of second. */
50357 	uint8_t	flush_interval;
50358 	/* unused. */
50359 	uint8_t	unused1;
50360 	/* Context id of action table scope. */
50361 	uint16_t	action_ctx_id;
50362 	/* Table scope id used for action record entries. */
50363 	uint16_t	action_tbl_scope;
50364 	/* Context id of lookup table scope. */
50365 	uint16_t	lkup_ctx_id;
50366 	/* Table scope id used for EM lookup entries. */
50367 	uint16_t	lkup_tbl_scope;
50368 	/*
50369 	 * Number of 32B static buckets to be allocated at the beginning
50370 	 * of table scope.
50371 	 */
50372 	uint32_t	lkup_static_buckets;
50373 	/* unused. */
50374 	uint8_t	unused2[7];
50375 	/*
50376 	 * This field is used in Output records to indicate that the
50377 	 * output is completely written to RAM. This field should be
50378 	 * read as '1' to indicate that the output has been
50379 	 * completely written.  When writing a command completion or
50380 	 * response to an internal processor, the order of writes has
50381 	 * to be such that this field is written last.
50382 	 */
50383 	uint8_t	valid;
50384 } hwrm_tf_ext_em_qcfg_output_t, *phwrm_tf_ext_em_qcfg_output_t;
50385 
50386 /*********************
50387  * hwrm_tf_em_insert *
50388  *********************/
50389 
50390 
50391 /* hwrm_tf_em_insert_input (size:832b/104B) */
50392 
50393 typedef struct hwrm_tf_em_insert_input {
50394 	/* The HWRM command request type. */
50395 	uint16_t	req_type;
50396 	/*
50397 	 * The completion ring to send the completion event on. This should
50398 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50399 	 */
50400 	uint16_t	cmpl_ring;
50401 	/*
50402 	 * The sequence ID is used by the driver for tracking multiple
50403 	 * commands. This ID is treated as opaque data by the firmware and
50404 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50405 	 */
50406 	uint16_t	seq_id;
50407 	/*
50408 	 * The target ID of the command:
50409 	 * * 0x0-0xFFF8 - The function ID
50410 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50411 	 * * 0xFFFD - Reserved for user-space HWRM interface
50412 	 * * 0xFFFF - HWRM
50413 	 */
50414 	uint16_t	target_id;
50415 	/*
50416 	 * A physical address pointer pointing to a host buffer that the
50417 	 * command's response data will be written. This can be either a host
50418 	 * physical address (HPA) or a guest physical address (GPA) and must
50419 	 * point to a physically contiguous block of memory.
50420 	 */
50421 	uint64_t	resp_addr;
50422 	/* Firmware Session Id. */
50423 	uint32_t	fw_session_id;
50424 	/* Control Flags. */
50425 	uint16_t	flags;
50426 	/* Indicates the flow direction. */
50427 	#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR	UINT32_C(0x1)
50428 	/* If this bit set to 0, then it indicates rx flow. */
50429 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50430 	/* If this bit is set to 1, then it indicates tx flow. */
50431 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50432 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
50433 	/* Reported match strength. */
50434 	uint16_t	strength;
50435 	/* Index to action. */
50436 	uint32_t	action_ptr;
50437 	/* Index of EM record. */
50438 	uint32_t	em_record_idx;
50439 	/* EM Key value. */
50440 	uint64_t	em_key[8];
50441 	/* Number of bits in em_key. */
50442 	uint16_t	em_key_bitlen;
50443 	/* unused. */
50444 	uint16_t	unused0[3];
50445 } hwrm_tf_em_insert_input_t, *phwrm_tf_em_insert_input_t;
50446 
50447 /* hwrm_tf_em_insert_output (size:128b/16B) */
50448 
50449 typedef struct hwrm_tf_em_insert_output {
50450 	/* The specific error status for the command. */
50451 	uint16_t	error_code;
50452 	/* The HWRM command request type. */
50453 	uint16_t	req_type;
50454 	/* The sequence ID from the original command. */
50455 	uint16_t	seq_id;
50456 	/* The length of the response data in number of bytes. */
50457 	uint16_t	resp_len;
50458 	/* EM record pointer index. */
50459 	uint16_t	rptr_index;
50460 	/* EM record offset 0~3. */
50461 	uint8_t	rptr_entry;
50462 	/* Number of word entries consumed by the key. */
50463 	uint8_t	num_of_entries;
50464 	/* unused. */
50465 	uint32_t	unused0;
50466 } hwrm_tf_em_insert_output_t, *phwrm_tf_em_insert_output_t;
50467 
50468 /**************************
50469  * hwrm_tf_em_hash_insert *
50470  **************************/
50471 
50472 
50473 /* hwrm_tf_em_hash_insert_input (size:1024b/128B) */
50474 
50475 typedef struct hwrm_tf_em_hash_insert_input {
50476 	/* The HWRM command request type. */
50477 	uint16_t	req_type;
50478 	/*
50479 	 * The completion ring to send the completion event on. This should
50480 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50481 	 */
50482 	uint16_t	cmpl_ring;
50483 	/*
50484 	 * The sequence ID is used by the driver for tracking multiple
50485 	 * commands. This ID is treated as opaque data by the firmware and
50486 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50487 	 */
50488 	uint16_t	seq_id;
50489 	/*
50490 	 * The target ID of the command:
50491 	 * * 0x0-0xFFF8 - The function ID
50492 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50493 	 * * 0xFFFD - Reserved for user-space HWRM interface
50494 	 * * 0xFFFF - HWRM
50495 	 */
50496 	uint16_t	target_id;
50497 	/*
50498 	 * A physical address pointer pointing to a host buffer that the
50499 	 * command's response data will be written. This can be either a host
50500 	 * physical address (HPA) or a guest physical address (GPA) and must
50501 	 * point to a physically contiguous block of memory.
50502 	 */
50503 	uint64_t	resp_addr;
50504 	/* Firmware Session Id. */
50505 	uint32_t	fw_session_id;
50506 	/* Control Flags. */
50507 	uint16_t	flags;
50508 	/* Indicates the flow direction. */
50509 	#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR	UINT32_C(0x1)
50510 	/* If this bit set to 0, then it indicates rx flow. */
50511 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50512 	/* If this bit is set to 1, then it indicates tx flow. */
50513 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50514 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX
50515 	/* Number of bits in the EM record. */
50516 	uint16_t	em_record_size_bits;
50517 	/* CRC32 hash of key. */
50518 	uint32_t	key0_hash;
50519 	/* Lookup3 hash of key. */
50520 	uint32_t	key1_hash;
50521 	/* Index of EM record. */
50522 	uint32_t	em_record_idx;
50523 	/* Unused. */
50524 	uint32_t	unused0;
50525 	/* EM record. */
50526 	uint64_t	em_record[11];
50527 } hwrm_tf_em_hash_insert_input_t, *phwrm_tf_em_hash_insert_input_t;
50528 
50529 /* hwrm_tf_em_hash_insert_output (size:128b/16B) */
50530 
50531 typedef struct hwrm_tf_em_hash_insert_output {
50532 	/* The specific error status for the command. */
50533 	uint16_t	error_code;
50534 	/* The HWRM command request type. */
50535 	uint16_t	req_type;
50536 	/* The sequence ID from the original command. */
50537 	uint16_t	seq_id;
50538 	/* The length of the response data in number of bytes. */
50539 	uint16_t	resp_len;
50540 	/* EM record pointer index. */
50541 	uint16_t	rptr_index;
50542 	/* EM record offset 0~3. */
50543 	uint8_t	rptr_entry;
50544 	/* Number of word entries consumed by the key. */
50545 	uint8_t	num_of_entries;
50546 	/* unused. */
50547 	uint32_t	unused0;
50548 } hwrm_tf_em_hash_insert_output_t, *phwrm_tf_em_hash_insert_output_t;
50549 
50550 /*********************
50551  * hwrm_tf_em_delete *
50552  *********************/
50553 
50554 
50555 /* hwrm_tf_em_delete_input (size:832b/104B) */
50556 
50557 typedef struct hwrm_tf_em_delete_input {
50558 	/* The HWRM command request type. */
50559 	uint16_t	req_type;
50560 	/*
50561 	 * The completion ring to send the completion event on. This should
50562 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50563 	 */
50564 	uint16_t	cmpl_ring;
50565 	/*
50566 	 * The sequence ID is used by the driver for tracking multiple
50567 	 * commands. This ID is treated as opaque data by the firmware and
50568 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50569 	 */
50570 	uint16_t	seq_id;
50571 	/*
50572 	 * The target ID of the command:
50573 	 * * 0x0-0xFFF8 - The function ID
50574 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50575 	 * * 0xFFFD - Reserved for user-space HWRM interface
50576 	 * * 0xFFFF - HWRM
50577 	 */
50578 	uint16_t	target_id;
50579 	/*
50580 	 * A physical address pointer pointing to a host buffer that the
50581 	 * command's response data will be written. This can be either a host
50582 	 * physical address (HPA) or a guest physical address (GPA) and must
50583 	 * point to a physically contiguous block of memory.
50584 	 */
50585 	uint64_t	resp_addr;
50586 	/* Session Id. */
50587 	uint32_t	fw_session_id;
50588 	/* Control flags. */
50589 	uint16_t	flags;
50590 	/* Indicates the flow direction. */
50591 	#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR	UINT32_C(0x1)
50592 	/* If this bit set to 0, then it indicates rx flow. */
50593 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50594 	/* If this bit is set to 1, then it indicates tx flow. */
50595 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50596 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
50597 	/* Unused0 */
50598 	uint16_t	unused0;
50599 	/* EM internal flow handle. */
50600 	uint64_t	flow_handle;
50601 	/* EM Key value */
50602 	uint64_t	em_key[8];
50603 	/* Number of bits in em_key. */
50604 	uint16_t	em_key_bitlen;
50605 	/* unused. */
50606 	uint16_t	unused1[3];
50607 } hwrm_tf_em_delete_input_t, *phwrm_tf_em_delete_input_t;
50608 
50609 /* hwrm_tf_em_delete_output (size:128b/16B) */
50610 
50611 typedef struct hwrm_tf_em_delete_output {
50612 	/* The specific error status for the command. */
50613 	uint16_t	error_code;
50614 	/* The HWRM command request type. */
50615 	uint16_t	req_type;
50616 	/* The sequence ID from the original command. */
50617 	uint16_t	seq_id;
50618 	/* The length of the response data in number of bytes. */
50619 	uint16_t	resp_len;
50620 	/* Original stack allocation index. */
50621 	uint16_t	em_index;
50622 	/* unused. */
50623 	uint16_t	unused0[3];
50624 } hwrm_tf_em_delete_output_t, *phwrm_tf_em_delete_output_t;
50625 
50626 /*******************
50627  * hwrm_tf_em_move *
50628  *******************/
50629 
50630 
50631 /* hwrm_tf_em_move_input (size:320b/40B) */
50632 
50633 typedef struct hwrm_tf_em_move_input {
50634 	/* The HWRM command request type. */
50635 	uint16_t	req_type;
50636 	/*
50637 	 * The completion ring to send the completion event on. This should
50638 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50639 	 */
50640 	uint16_t	cmpl_ring;
50641 	/*
50642 	 * The sequence ID is used by the driver for tracking multiple
50643 	 * commands. This ID is treated as opaque data by the firmware and
50644 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50645 	 */
50646 	uint16_t	seq_id;
50647 	/*
50648 	 * The target ID of the command:
50649 	 * * 0x0-0xFFF8 - The function ID
50650 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50651 	 * * 0xFFFD - Reserved for user-space HWRM interface
50652 	 * * 0xFFFF - HWRM
50653 	 */
50654 	uint16_t	target_id;
50655 	/*
50656 	 * A physical address pointer pointing to a host buffer that the
50657 	 * command's response data will be written. This can be either a host
50658 	 * physical address (HPA) or a guest physical address (GPA) and must
50659 	 * point to a physically contiguous block of memory.
50660 	 */
50661 	uint64_t	resp_addr;
50662 	/* Session Id. */
50663 	uint32_t	fw_session_id;
50664 	/* Control flags. */
50665 	uint16_t	flags;
50666 	/* Indicates the flow direction. */
50667 	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR	UINT32_C(0x1)
50668 	/* If this bit set to 0, then it indicates rx flow. */
50669 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50670 	/* If this bit is set to 1, then it indicates tx flow. */
50671 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50672 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
50673 	/* Number of EM entry blocks */
50674 	uint16_t	num_blocks;
50675 	/* New index for entry */
50676 	uint32_t	new_index;
50677 	/* Unused */
50678 	uint32_t	unused0;
50679 	/* EM internal flow handle. */
50680 	uint64_t	flow_handle;
50681 } hwrm_tf_em_move_input_t, *phwrm_tf_em_move_input_t;
50682 
50683 /* hwrm_tf_em_move_output (size:128b/16B) */
50684 
50685 typedef struct hwrm_tf_em_move_output {
50686 	/* The specific error status for the command. */
50687 	uint16_t	error_code;
50688 	/* The HWRM command request type. */
50689 	uint16_t	req_type;
50690 	/* The sequence ID from the original command. */
50691 	uint16_t	seq_id;
50692 	/* The length of the response data in number of bytes. */
50693 	uint16_t	resp_len;
50694 	/* Index of old entry. */
50695 	uint16_t	em_index;
50696 	/* unused. */
50697 	uint16_t	unused0[3];
50698 } hwrm_tf_em_move_output_t, *phwrm_tf_em_move_output_t;
50699 
50700 /********************
50701  * hwrm_tf_tcam_set *
50702  ********************/
50703 
50704 
50705 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
50706 
50707 typedef struct hwrm_tf_tcam_set_input {
50708 	/* The HWRM command request type. */
50709 	uint16_t	req_type;
50710 	/*
50711 	 * The completion ring to send the completion event on. This should
50712 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50713 	 */
50714 	uint16_t	cmpl_ring;
50715 	/*
50716 	 * The sequence ID is used by the driver for tracking multiple
50717 	 * commands. This ID is treated as opaque data by the firmware and
50718 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50719 	 */
50720 	uint16_t	seq_id;
50721 	/*
50722 	 * The target ID of the command:
50723 	 * * 0x0-0xFFF8 - The function ID
50724 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50725 	 * * 0xFFFD - Reserved for user-space HWRM interface
50726 	 * * 0xFFFF - HWRM
50727 	 */
50728 	uint16_t	target_id;
50729 	/*
50730 	 * A physical address pointer pointing to a host buffer that the
50731 	 * command's response data will be written. This can be either a host
50732 	 * physical address (HPA) or a guest physical address (GPA) and must
50733 	 * point to a physically contiguous block of memory.
50734 	 */
50735 	uint64_t	resp_addr;
50736 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50737 	uint32_t	fw_session_id;
50738 	/* Control flags. */
50739 	uint32_t	flags;
50740 	/* Indicates the flow direction. */
50741 	#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
50742 	/* If this bit set to 0, then it indicates rx flow. */
50743 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50744 	/* If this bit is set to 1, then it indicates tx flow. */
50745 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50746 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
50747 	/*
50748 	 * Indicate device data is being sent via DMA, the device
50749 	 * data is packing does not change.
50750 	 */
50751 	#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
50752 	/*
50753 	 * TCAM type of the resource, defined globally in the
50754 	 * hwrm_tf_resc_type enum.
50755 	 */
50756 	uint32_t	type;
50757 	/* Index of TCAM entry. */
50758 	uint16_t	idx;
50759 	/* Number of bytes in the TCAM key. */
50760 	uint8_t	key_size;
50761 	/* Number of bytes in the TCAM result. */
50762 	uint8_t	result_size;
50763 	/*
50764 	 * Offset from which the mask bytes start in the device data
50765 	 * array, key offset is always 0.
50766 	 */
50767 	uint8_t	mask_offset;
50768 	/* Offset from which the result bytes start in the device data array. */
50769 	uint8_t	result_offset;
50770 	/* unused. */
50771 	uint8_t	unused0[6];
50772 	/*
50773 	 * TCAM key located at offset 0, mask located at mask_offset
50774 	 * and result at result_offset for the device.
50775 	 */
50776 	uint8_t	dev_data[88];
50777 } hwrm_tf_tcam_set_input_t, *phwrm_tf_tcam_set_input_t;
50778 
50779 /* hwrm_tf_tcam_set_output (size:128b/16B) */
50780 
50781 typedef struct hwrm_tf_tcam_set_output {
50782 	/* The specific error status for the command. */
50783 	uint16_t	error_code;
50784 	/* The HWRM command request type. */
50785 	uint16_t	req_type;
50786 	/* The sequence ID from the original command. */
50787 	uint16_t	seq_id;
50788 	/* The length of the response data in number of bytes. */
50789 	uint16_t	resp_len;
50790 	/* unused. */
50791 	uint8_t	unused0[7];
50792 	/*
50793 	 * This field is used in Output records to indicate that the
50794 	 * output is completely written to RAM. This field should be
50795 	 * read as '1' to indicate that the output has been
50796 	 * completely written.  When writing a command completion or
50797 	 * response to an internal processor, the order of writes has
50798 	 * to be such that this field is written last.
50799 	 */
50800 	uint8_t	valid;
50801 } hwrm_tf_tcam_set_output_t, *phwrm_tf_tcam_set_output_t;
50802 
50803 /********************
50804  * hwrm_tf_tcam_get *
50805  ********************/
50806 
50807 
50808 /* hwrm_tf_tcam_get_input (size:256b/32B) */
50809 
50810 typedef struct hwrm_tf_tcam_get_input {
50811 	/* The HWRM command request type. */
50812 	uint16_t	req_type;
50813 	/*
50814 	 * The completion ring to send the completion event on. This should
50815 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50816 	 */
50817 	uint16_t	cmpl_ring;
50818 	/*
50819 	 * The sequence ID is used by the driver for tracking multiple
50820 	 * commands. This ID is treated as opaque data by the firmware and
50821 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50822 	 */
50823 	uint16_t	seq_id;
50824 	/*
50825 	 * The target ID of the command:
50826 	 * * 0x0-0xFFF8 - The function ID
50827 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50828 	 * * 0xFFFD - Reserved for user-space HWRM interface
50829 	 * * 0xFFFF - HWRM
50830 	 */
50831 	uint16_t	target_id;
50832 	/*
50833 	 * A physical address pointer pointing to a host buffer that the
50834 	 * command's response data will be written. This can be either a host
50835 	 * physical address (HPA) or a guest physical address (GPA) and must
50836 	 * point to a physically contiguous block of memory.
50837 	 */
50838 	uint64_t	resp_addr;
50839 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50840 	uint32_t	fw_session_id;
50841 	/* Control flags. */
50842 	uint32_t	flags;
50843 	/* Indicates the flow direction. */
50844 	#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
50845 	/* If this bit set to 0, then it indicates rx flow. */
50846 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50847 	/* If this bit is set to 1, then it indicates tx flow. */
50848 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50849 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
50850 	/*
50851 	 * TCAM type of the resource, defined globally in the
50852 	 * hwrm_tf_resc_type enum.
50853 	 */
50854 	uint32_t	type;
50855 	/* Index of a TCAM entry. */
50856 	uint16_t	idx;
50857 	/* unused. */
50858 	uint16_t	unused0;
50859 } hwrm_tf_tcam_get_input_t, *phwrm_tf_tcam_get_input_t;
50860 
50861 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
50862 
50863 typedef struct hwrm_tf_tcam_get_output {
50864 	/* The specific error status for the command. */
50865 	uint16_t	error_code;
50866 	/* The HWRM command request type. */
50867 	uint16_t	req_type;
50868 	/* The sequence ID from the original command. */
50869 	uint16_t	seq_id;
50870 	/* The length of the response data in number of bytes. */
50871 	uint16_t	resp_len;
50872 	/* Number of bytes in the TCAM key. */
50873 	uint8_t	key_size;
50874 	/* Number of bytes in the TCAM entry. */
50875 	uint8_t	result_size;
50876 	/* Offset from which the mask bytes start in the device data array. */
50877 	uint8_t	mask_offset;
50878 	/* Offset from which the result bytes start in the device data array. */
50879 	uint8_t	result_offset;
50880 	/* unused. */
50881 	uint8_t	unused0[4];
50882 	/*
50883 	 * TCAM key located at offset 0, mask located at mask_offset
50884 	 * and result at result_offset for the device.
50885 	 */
50886 	uint8_t	dev_data[272];
50887 	/* unused. */
50888 	uint8_t	unused1[7];
50889 	/*
50890 	 * This field is used in Output records to indicate that the
50891 	 * output is completely written to RAM. This field should be
50892 	 * read as '1' to indicate that the output has been
50893 	 * completely written.  When writing a command completion or
50894 	 * response to an internal processor, the order of writes has
50895 	 * to be such that this field is written last.
50896 	 */
50897 	uint8_t	valid;
50898 } hwrm_tf_tcam_get_output_t, *phwrm_tf_tcam_get_output_t;
50899 
50900 /*********************
50901  * hwrm_tf_tcam_move *
50902  *********************/
50903 
50904 
50905 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
50906 
50907 typedef struct hwrm_tf_tcam_move_input {
50908 	/* The HWRM command request type. */
50909 	uint16_t	req_type;
50910 	/*
50911 	 * The completion ring to send the completion event on. This should
50912 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50913 	 */
50914 	uint16_t	cmpl_ring;
50915 	/*
50916 	 * The sequence ID is used by the driver for tracking multiple
50917 	 * commands. This ID is treated as opaque data by the firmware and
50918 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50919 	 */
50920 	uint16_t	seq_id;
50921 	/*
50922 	 * The target ID of the command:
50923 	 * * 0x0-0xFFF8 - The function ID
50924 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50925 	 * * 0xFFFD - Reserved for user-space HWRM interface
50926 	 * * 0xFFFF - HWRM
50927 	 */
50928 	uint16_t	target_id;
50929 	/*
50930 	 * A physical address pointer pointing to a host buffer that the
50931 	 * command's response data will be written. This can be either a host
50932 	 * physical address (HPA) or a guest physical address (GPA) and must
50933 	 * point to a physically contiguous block of memory.
50934 	 */
50935 	uint64_t	resp_addr;
50936 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50937 	uint32_t	fw_session_id;
50938 	/* Control flags. */
50939 	uint32_t	flags;
50940 	/* Indicates the flow direction. */
50941 	#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR	UINT32_C(0x1)
50942 	/* If this bit set to 0, then it indicates rx flow. */
50943 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
50944 	/* If this bit is set to 1, then it indicates tx flow. */
50945 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
50946 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
50947 	/*
50948 	 * TCAM type of the resource, defined globally in the
50949 	 * hwrm_tf_resc_type enum.
50950 	 */
50951 	uint32_t	type;
50952 	/* Number of TCAM index pairs to be swapped for the device. */
50953 	uint16_t	count;
50954 	/* unused. */
50955 	uint16_t	unused0;
50956 	/* TCAM index pairs to be swapped for the device. */
50957 	uint16_t	idx_pairs[48];
50958 } hwrm_tf_tcam_move_input_t, *phwrm_tf_tcam_move_input_t;
50959 
50960 /* hwrm_tf_tcam_move_output (size:128b/16B) */
50961 
50962 typedef struct hwrm_tf_tcam_move_output {
50963 	/* The specific error status for the command. */
50964 	uint16_t	error_code;
50965 	/* The HWRM command request type. */
50966 	uint16_t	req_type;
50967 	/* The sequence ID from the original command. */
50968 	uint16_t	seq_id;
50969 	/* The length of the response data in number of bytes. */
50970 	uint16_t	resp_len;
50971 	/* unused. */
50972 	uint8_t	unused0[7];
50973 	/*
50974 	 * This field is used in Output records to indicate that the
50975 	 * output is completely written to RAM. This field should be
50976 	 * read as '1' to indicate that the output has been
50977 	 * completely written.  When writing a command completion or
50978 	 * response to an internal processor, the order of writes has
50979 	 * to be such that this field is written last.
50980 	 */
50981 	uint8_t	valid;
50982 } hwrm_tf_tcam_move_output_t, *phwrm_tf_tcam_move_output_t;
50983 
50984 /*********************
50985  * hwrm_tf_tcam_free *
50986  *********************/
50987 
50988 
50989 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
50990 
50991 typedef struct hwrm_tf_tcam_free_input {
50992 	/* The HWRM command request type. */
50993 	uint16_t	req_type;
50994 	/*
50995 	 * The completion ring to send the completion event on. This should
50996 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50997 	 */
50998 	uint16_t	cmpl_ring;
50999 	/*
51000 	 * The sequence ID is used by the driver for tracking multiple
51001 	 * commands. This ID is treated as opaque data by the firmware and
51002 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51003 	 */
51004 	uint16_t	seq_id;
51005 	/*
51006 	 * The target ID of the command:
51007 	 * * 0x0-0xFFF8 - The function ID
51008 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51009 	 * * 0xFFFD - Reserved for user-space HWRM interface
51010 	 * * 0xFFFF - HWRM
51011 	 */
51012 	uint16_t	target_id;
51013 	/*
51014 	 * A physical address pointer pointing to a host buffer that the
51015 	 * command's response data will be written. This can be either a host
51016 	 * physical address (HPA) or a guest physical address (GPA) and must
51017 	 * point to a physically contiguous block of memory.
51018 	 */
51019 	uint64_t	resp_addr;
51020 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51021 	uint32_t	fw_session_id;
51022 	/* Control flags. */
51023 	uint32_t	flags;
51024 	/* Indicates the flow direction. */
51025 	#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
51026 	/* If this bit set to 0, then it indicates rx flow. */
51027 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51028 	/* If this bit is set to 1, then it indicates tx flow. */
51029 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51030 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
51031 	/*
51032 	 * TCAM type of the resource, defined globally in the
51033 	 * hwrm_tf_resc_type enum.
51034 	 */
51035 	uint32_t	type;
51036 	/* Number of TCAM index to be deleted for the device. */
51037 	uint16_t	count;
51038 	/* unused. */
51039 	uint16_t	unused0;
51040 	/* TCAM index list to be deleted for the device. */
51041 	uint16_t	idx_list[48];
51042 } hwrm_tf_tcam_free_input_t, *phwrm_tf_tcam_free_input_t;
51043 
51044 /* hwrm_tf_tcam_free_output (size:128b/16B) */
51045 
51046 typedef struct hwrm_tf_tcam_free_output {
51047 	/* The specific error status for the command. */
51048 	uint16_t	error_code;
51049 	/* The HWRM command request type. */
51050 	uint16_t	req_type;
51051 	/* The sequence ID from the original command. */
51052 	uint16_t	seq_id;
51053 	/* The length of the response data in number of bytes. */
51054 	uint16_t	resp_len;
51055 	/* unused. */
51056 	uint8_t	unused0[7];
51057 	/*
51058 	 * This field is used in Output records to indicate that the
51059 	 * output is completely written to RAM. This field should be
51060 	 * read as '1' to indicate that the output has been
51061 	 * completely written.  When writing a command completion or
51062 	 * response to an internal processor, the order of writes has
51063 	 * to be such that this field is written last.
51064 	 */
51065 	uint8_t	valid;
51066 } hwrm_tf_tcam_free_output_t, *phwrm_tf_tcam_free_output_t;
51067 
51068 /**************************
51069  * hwrm_tf_global_cfg_set *
51070  **************************/
51071 
51072 
51073 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
51074 
51075 typedef struct hwrm_tf_global_cfg_set_input {
51076 	/* The HWRM command request type. */
51077 	uint16_t	req_type;
51078 	/*
51079 	 * The completion ring to send the completion event on. This should
51080 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51081 	 */
51082 	uint16_t	cmpl_ring;
51083 	/*
51084 	 * The sequence ID is used by the driver for tracking multiple
51085 	 * commands. This ID is treated as opaque data by the firmware and
51086 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51087 	 */
51088 	uint16_t	seq_id;
51089 	/*
51090 	 * The target ID of the command:
51091 	 * * 0x0-0xFFF8 - The function ID
51092 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51093 	 * * 0xFFFD - Reserved for user-space HWRM interface
51094 	 * * 0xFFFF - HWRM
51095 	 */
51096 	uint16_t	target_id;
51097 	/*
51098 	 * A physical address pointer pointing to a host buffer that the
51099 	 * command's response data will be written. This can be either a host
51100 	 * physical address (HPA) or a guest physical address (GPA) and must
51101 	 * point to a physically contiguous block of memory.
51102 	 */
51103 	uint64_t	resp_addr;
51104 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51105 	uint32_t	fw_session_id;
51106 	/* Control flags. */
51107 	uint32_t	flags;
51108 	/* Indicates the flow direction. */
51109 	#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51110 	/* If this bit set to 0, then it indicates rx flow. */
51111 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51112 	/* If this bit is set to 1, then it indicates tx flow. */
51113 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51114 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
51115 	/* Global Cfg type */
51116 	uint32_t	type;
51117 	/* Offset of the type */
51118 	uint32_t	offset;
51119 	/* Size of the data to set in bytes */
51120 	uint16_t	size;
51121 	/* unused. */
51122 	uint8_t	unused0[6];
51123 	/* Data to set */
51124 	uint8_t	data[8];
51125 	/* Mask of data to set, 0 indicates no mask */
51126 	uint8_t	mask[8];
51127 } hwrm_tf_global_cfg_set_input_t, *phwrm_tf_global_cfg_set_input_t;
51128 
51129 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
51130 
51131 typedef struct hwrm_tf_global_cfg_set_output {
51132 	/* The specific error status for the command. */
51133 	uint16_t	error_code;
51134 	/* The HWRM command request type. */
51135 	uint16_t	req_type;
51136 	/* The sequence ID from the original command. */
51137 	uint16_t	seq_id;
51138 	/* The length of the response data in number of bytes. */
51139 	uint16_t	resp_len;
51140 	/* unused. */
51141 	uint8_t	unused0[7];
51142 	/*
51143 	 * This field is used in Output records to indicate that the
51144 	 * output is completely written to RAM. This field should be
51145 	 * read as '1' to indicate that the output has been
51146 	 * completely written.  When writing a command completion or
51147 	 * response to an internal processor, the order of writes has
51148 	 * to be such that this field is written last.
51149 	 */
51150 	uint8_t	valid;
51151 } hwrm_tf_global_cfg_set_output_t, *phwrm_tf_global_cfg_set_output_t;
51152 
51153 /**************************
51154  * hwrm_tf_global_cfg_get *
51155  **************************/
51156 
51157 
51158 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
51159 
51160 typedef struct hwrm_tf_global_cfg_get_input {
51161 	/* The HWRM command request type. */
51162 	uint16_t	req_type;
51163 	/*
51164 	 * The completion ring to send the completion event on. This should
51165 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51166 	 */
51167 	uint16_t	cmpl_ring;
51168 	/*
51169 	 * The sequence ID is used by the driver for tracking multiple
51170 	 * commands. This ID is treated as opaque data by the firmware and
51171 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51172 	 */
51173 	uint16_t	seq_id;
51174 	/*
51175 	 * The target ID of the command:
51176 	 * * 0x0-0xFFF8 - The function ID
51177 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51178 	 * * 0xFFFD - Reserved for user-space HWRM interface
51179 	 * * 0xFFFF - HWRM
51180 	 */
51181 	uint16_t	target_id;
51182 	/*
51183 	 * A physical address pointer pointing to a host buffer that the
51184 	 * command's response data will be written. This can be either a host
51185 	 * physical address (HPA) or a guest physical address (GPA) and must
51186 	 * point to a physically contiguous block of memory.
51187 	 */
51188 	uint64_t	resp_addr;
51189 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51190 	uint32_t	fw_session_id;
51191 	/* Control flags. */
51192 	uint32_t	flags;
51193 	/* Indicates the flow direction. */
51194 	#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51195 	/* If this bit set to 0, then it indicates rx flow. */
51196 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51197 	/* If this bit is set to 1, then it indicates tx flow. */
51198 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51199 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
51200 	/* Global Cfg type */
51201 	uint32_t	type;
51202 	/* Offset of the type */
51203 	uint32_t	offset;
51204 	/* Size of the data to set in bytes */
51205 	uint16_t	size;
51206 	/* unused. */
51207 	uint8_t	unused0[6];
51208 } hwrm_tf_global_cfg_get_input_t, *phwrm_tf_global_cfg_get_input_t;
51209 
51210 /* hwrm_tf_global_cfg_get_output (size:256b/32B) */
51211 
51212 typedef struct hwrm_tf_global_cfg_get_output {
51213 	/* The specific error status for the command. */
51214 	uint16_t	error_code;
51215 	/* The HWRM command request type. */
51216 	uint16_t	req_type;
51217 	/* The sequence ID from the original command. */
51218 	uint16_t	seq_id;
51219 	/* The length of the response data in number of bytes. */
51220 	uint16_t	resp_len;
51221 	/* Size of the data read in bytes */
51222 	uint16_t	size;
51223 	/* unused. */
51224 	uint8_t	unused0[6];
51225 	/* Data to set */
51226 	uint8_t	data[16];
51227 } hwrm_tf_global_cfg_get_output_t, *phwrm_tf_global_cfg_get_output_t;
51228 
51229 /**********************
51230  * hwrm_tf_if_tbl_get *
51231  **********************/
51232 
51233 
51234 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
51235 
51236 typedef struct hwrm_tf_if_tbl_get_input {
51237 	/* The HWRM command request type. */
51238 	uint16_t	req_type;
51239 	/*
51240 	 * The completion ring to send the completion event on. This should
51241 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51242 	 */
51243 	uint16_t	cmpl_ring;
51244 	/*
51245 	 * The sequence ID is used by the driver for tracking multiple
51246 	 * commands. This ID is treated as opaque data by the firmware and
51247 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51248 	 */
51249 	uint16_t	seq_id;
51250 	/*
51251 	 * The target ID of the command:
51252 	 * * 0x0-0xFFF8 - The function ID
51253 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51254 	 * * 0xFFFD - Reserved for user-space HWRM interface
51255 	 * * 0xFFFF - HWRM
51256 	 */
51257 	uint16_t	target_id;
51258 	/*
51259 	 * A physical address pointer pointing to a host buffer that the
51260 	 * command's response data will be written. This can be either a host
51261 	 * physical address (HPA) or a guest physical address (GPA) and must
51262 	 * point to a physically contiguous block of memory.
51263 	 */
51264 	uint64_t	resp_addr;
51265 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51266 	uint32_t	fw_session_id;
51267 	/* Control flags. */
51268 	uint16_t	flags;
51269 	/* Indicates the flow direction. */
51270 	#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51271 	/* If this bit set to 0, then it indicates rx flow. */
51272 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51273 	/* If this bit is set to 1, then it indicates tx flow. */
51274 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51275 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
51276 	/* Size of the data to set. */
51277 	uint16_t	size;
51278 	/*
51279 	 * Type of the resource, defined globally in the
51280 	 * hwrm_tf_resc_type enum.
51281 	 */
51282 	uint32_t	type;
51283 	/* Index of the type to retrieve. */
51284 	uint32_t	index;
51285 } hwrm_tf_if_tbl_get_input_t, *phwrm_tf_if_tbl_get_input_t;
51286 
51287 /* hwrm_tf_if_tbl_get_output (size:1216b/152B) */
51288 
51289 typedef struct hwrm_tf_if_tbl_get_output {
51290 	/* The specific error status for the command. */
51291 	uint16_t	error_code;
51292 	/* The HWRM command request type. */
51293 	uint16_t	req_type;
51294 	/* The sequence ID from the original command. */
51295 	uint16_t	seq_id;
51296 	/* The length of the response data in number of bytes. */
51297 	uint16_t	resp_len;
51298 	/* Response code. */
51299 	uint32_t	resp_code;
51300 	/* Response size. */
51301 	uint16_t	size;
51302 	/* unused */
51303 	uint16_t	unused0;
51304 	/* Response data. */
51305 	uint8_t	data[128];
51306 	/* unused */
51307 	uint8_t	unused1[7];
51308 	/*
51309 	 * This field is used in Output records to indicate that the output
51310 	 * is completely written to RAM. This field should be read as '1'
51311 	 * to indicate that the output has been completely written.
51312 	 * When writing a command completion or response to an internal
51313 	 * processor, the order of writes has to be such that this field
51314 	 * is written last.
51315 	 */
51316 	uint8_t	valid;
51317 } hwrm_tf_if_tbl_get_output_t, *phwrm_tf_if_tbl_get_output_t;
51318 
51319 /***************************
51320  * hwrm_tf_if_tbl_type_set *
51321  ***************************/
51322 
51323 
51324 /* hwrm_tf_if_tbl_set_input (size:1024b/128B) */
51325 
51326 typedef struct hwrm_tf_if_tbl_set_input {
51327 	/* The HWRM command request type. */
51328 	uint16_t	req_type;
51329 	/*
51330 	 * The completion ring to send the completion event on. This should
51331 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51332 	 */
51333 	uint16_t	cmpl_ring;
51334 	/*
51335 	 * The sequence ID is used by the driver for tracking multiple
51336 	 * commands. This ID is treated as opaque data by the firmware and
51337 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51338 	 */
51339 	uint16_t	seq_id;
51340 	/*
51341 	 * The target ID of the command:
51342 	 * * 0x0-0xFFF8 - The function ID
51343 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51344 	 * * 0xFFFD - Reserved for user-space HWRM interface
51345 	 * * 0xFFFF - HWRM
51346 	 */
51347 	uint16_t	target_id;
51348 	/*
51349 	 * A physical address pointer pointing to a host buffer that the
51350 	 * command's response data will be written. This can be either a host
51351 	 * physical address (HPA) or a guest physical address (GPA) and must
51352 	 * point to a physically contiguous block of memory.
51353 	 */
51354 	uint64_t	resp_addr;
51355 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51356 	uint32_t	fw_session_id;
51357 	/* Control flags. */
51358 	uint16_t	flags;
51359 	/* Indicates the flow direction. */
51360 	#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51361 	/* If this bit set to 0, then it indicates rx flow. */
51362 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51363 	/* If this bit is set to 1, then it indicates tx flow. */
51364 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51365 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
51366 	/* unused. */
51367 	uint8_t	unused0[2];
51368 	/*
51369 	 * Type of the resource, defined globally in the
51370 	 * hwrm_tf_resc_type enum.
51371 	 */
51372 	uint32_t	type;
51373 	/* Index of the type to set. */
51374 	uint32_t	index;
51375 	/* Size of the data to set. */
51376 	uint16_t	size;
51377 	/* unused */
51378 	uint8_t	unused1[6];
51379 	/* Data to be set. */
51380 	uint8_t	data[88];
51381 } hwrm_tf_if_tbl_set_input_t, *phwrm_tf_if_tbl_set_input_t;
51382 
51383 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
51384 
51385 typedef struct hwrm_tf_if_tbl_set_output {
51386 	/* The specific error status for the command. */
51387 	uint16_t	error_code;
51388 	/* The HWRM command request type. */
51389 	uint16_t	req_type;
51390 	/* The sequence ID from the original command. */
51391 	uint16_t	seq_id;
51392 	/* The length of the response data in number of bytes. */
51393 	uint16_t	resp_len;
51394 	/* unused. */
51395 	uint8_t	unused0[7];
51396 	/*
51397 	 * This field is used in Output records to indicate that the output
51398 	 * is completely written to RAM. This field should be read as '1'
51399 	 * to indicate that the output has been completely written.
51400 	 * When writing a command completion or response to an internal
51401 	 * processor, the order of writes has to be such that this field
51402 	 * is written last.
51403 	 */
51404 	uint8_t	valid;
51405 } hwrm_tf_if_tbl_set_output_t, *phwrm_tf_if_tbl_set_output_t;
51406 
51407 /*****************************
51408  * hwrm_tf_tbl_type_bulk_get *
51409  *****************************/
51410 
51411 
51412 /* hwrm_tf_tbl_type_bulk_get_input (size:384b/48B) */
51413 
51414 typedef struct hwrm_tf_tbl_type_bulk_get_input {
51415 	/* The HWRM command request type. */
51416 	uint16_t	req_type;
51417 	/*
51418 	 * The completion ring to send the completion event on. This should
51419 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51420 	 */
51421 	uint16_t	cmpl_ring;
51422 	/*
51423 	 * The sequence ID is used by the driver for tracking multiple
51424 	 * commands. This ID is treated as opaque data by the firmware and
51425 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51426 	 */
51427 	uint16_t	seq_id;
51428 	/*
51429 	 * The target ID of the command:
51430 	 * * 0x0-0xFFF8 - The function ID
51431 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51432 	 * * 0xFFFD - Reserved for user-space HWRM interface
51433 	 * * 0xFFFF - HWRM
51434 	 */
51435 	uint16_t	target_id;
51436 	/*
51437 	 * A physical address pointer pointing to a host buffer that the
51438 	 * command's response data will be written. This can be either a host
51439 	 * physical address (HPA) or a guest physical address (GPA) and must
51440 	 * point to a physically contiguous block of memory.
51441 	 */
51442 	uint64_t	resp_addr;
51443 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51444 	uint32_t	fw_session_id;
51445 	/* Control flags. */
51446 	uint16_t	flags;
51447 	/* Indicates the flow direction. */
51448 	#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
51449 	/* If this bit set to 0, then it indicates rx flow. */
51450 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
51451 	/* If this bit is set to 1, then it indicates tx flow. */
51452 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
51453 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_LAST	HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX
51454 	/*
51455 	 * When set use the special access register access to clear
51456 	 * the table entries on read.
51457 	 */
51458 	#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
51459 	/* unused. */
51460 	uint8_t	unused0[2];
51461 	/*
51462 	 * Type of the resource, defined globally in the
51463 	 * hwrm_tf_resc_type enum.
51464 	 */
51465 	uint32_t	type;
51466 	/* Starting index of the type to retrieve. */
51467 	uint32_t	start_index;
51468 	/* Number of entries to retrieve. */
51469 	uint32_t	num_entries;
51470 	/* Number of entries to retrieve. */
51471 	uint32_t	unused1;
51472 	/* Host memory where data will be stored. */
51473 	uint64_t	host_addr;
51474 } hwrm_tf_tbl_type_bulk_get_input_t, *phwrm_tf_tbl_type_bulk_get_input_t;
51475 
51476 /* hwrm_tf_tbl_type_bulk_get_output (size:128b/16B) */
51477 
51478 typedef struct hwrm_tf_tbl_type_bulk_get_output {
51479 	/* The specific error status for the command. */
51480 	uint16_t	error_code;
51481 	/* The HWRM command request type. */
51482 	uint16_t	req_type;
51483 	/* The sequence ID from the original command. */
51484 	uint16_t	seq_id;
51485 	/* The length of the response data in number of bytes. */
51486 	uint16_t	resp_len;
51487 	/* Response code. */
51488 	uint32_t	resp_code;
51489 	/* Response size. */
51490 	uint16_t	size;
51491 	/* unused */
51492 	uint8_t	unused0;
51493 	/*
51494 	 * This field is used in Output records to indicate that the output
51495 	 * is completely written to RAM. This field should be read as '1'
51496 	 * to indicate that the output has been completely written.
51497 	 * When writing a command completion or response to an internal
51498 	 * processor, the order of writes has to be such that this field
51499 	 * is written last.
51500 	 */
51501 	uint8_t	valid;
51502 } hwrm_tf_tbl_type_bulk_get_output_t, *phwrm_tf_tbl_type_bulk_get_output_t;
51503 
51504 /***********************************
51505  * hwrm_tf_session_hotup_state_set *
51506  ***********************************/
51507 
51508 
51509 /* hwrm_tf_session_hotup_state_set_input (size:192b/24B) */
51510 
51511 typedef struct hwrm_tf_session_hotup_state_set_input {
51512 	/* The HWRM command request type. */
51513 	uint16_t	req_type;
51514 	/*
51515 	 * The completion ring to send the completion event on. This should
51516 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51517 	 */
51518 	uint16_t	cmpl_ring;
51519 	/*
51520 	 * The sequence ID is used by the driver for tracking multiple
51521 	 * commands. This ID is treated as opaque data by the firmware and
51522 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51523 	 */
51524 	uint16_t	seq_id;
51525 	/*
51526 	 * The target ID of the command:
51527 	 * * 0x0-0xFFF8 - The function ID
51528 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51529 	 * * 0xFFFD - Reserved for user-space HWRM interface
51530 	 * * 0xFFFF - HWRM
51531 	 */
51532 	uint16_t	target_id;
51533 	/*
51534 	 * A physical address pointer pointing to a host buffer that the
51535 	 * command's response data will be written. This can be either a host
51536 	 * physical address (HPA) or a guest physical address (GPA) and must
51537 	 * point to a physically contiguous block of memory.
51538 	 */
51539 	uint64_t	resp_addr;
51540 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51541 	uint32_t	fw_session_id;
51542 	/* Shared session state. */
51543 	uint16_t	state;
51544 	/* Control flags. */
51545 	uint16_t	flags;
51546 	/* Indicates the flow direction. */
51547 	#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51548 	/* If this bit set to 0, then it indicates rx flow. */
51549 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51550 	/* If this bit is set to 1, then it indicates tx flow. */
51551 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51552 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_TX
51553 } hwrm_tf_session_hotup_state_set_input_t, *phwrm_tf_session_hotup_state_set_input_t;
51554 
51555 /* hwrm_tf_session_hotup_state_set_output (size:128b/16B) */
51556 
51557 typedef struct hwrm_tf_session_hotup_state_set_output {
51558 	/* The specific error status for the command. */
51559 	uint16_t	error_code;
51560 	/* The HWRM command request type. */
51561 	uint16_t	req_type;
51562 	/* The sequence ID from the original command. */
51563 	uint16_t	seq_id;
51564 	/* The length of the response data in number of bytes. */
51565 	uint16_t	resp_len;
51566 	/* unused. */
51567 	uint8_t	unused0[7];
51568 	/*
51569 	 * This field is used in Output records to indicate that the output
51570 	 * is completely written to RAM. This field should be read as '1'
51571 	 * to indicate that the output has been completely written.
51572 	 * When writing a command completion or response to an internal
51573 	 * processor, the order of writes has to be such that this field
51574 	 * is written last.
51575 	 */
51576 	uint8_t	valid;
51577 } hwrm_tf_session_hotup_state_set_output_t, *phwrm_tf_session_hotup_state_set_output_t;
51578 
51579 /***********************************
51580  * hwrm_tf_session_hotup_state_get *
51581  ***********************************/
51582 
51583 
51584 /* hwrm_tf_session_hotup_state_get_input (size:192b/24B) */
51585 
51586 typedef struct hwrm_tf_session_hotup_state_get_input {
51587 	/* The HWRM command request type. */
51588 	uint16_t	req_type;
51589 	/*
51590 	 * The completion ring to send the completion event on. This should
51591 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51592 	 */
51593 	uint16_t	cmpl_ring;
51594 	/*
51595 	 * The sequence ID is used by the driver for tracking multiple
51596 	 * commands. This ID is treated as opaque data by the firmware and
51597 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51598 	 */
51599 	uint16_t	seq_id;
51600 	/*
51601 	 * The target ID of the command:
51602 	 * * 0x0-0xFFF8 - The function ID
51603 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51604 	 * * 0xFFFD - Reserved for user-space HWRM interface
51605 	 * * 0xFFFF - HWRM
51606 	 */
51607 	uint16_t	target_id;
51608 	/*
51609 	 * A physical address pointer pointing to a host buffer that the
51610 	 * command's response data will be written. This can be either a host
51611 	 * physical address (HPA) or a guest physical address (GPA) and must
51612 	 * point to a physically contiguous block of memory.
51613 	 */
51614 	uint64_t	resp_addr;
51615 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51616 	uint32_t	fw_session_id;
51617 	/* Control flags. */
51618 	uint16_t	flags;
51619 	/* Indicates the flow direction. */
51620 	#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
51621 	/* If this bit set to 0, then it indicates rx flow. */
51622 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
51623 	/* If this bit is set to 1, then it indicates tx flow. */
51624 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
51625 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_TX
51626 	/* unused. */
51627 	uint8_t	unused0[2];
51628 } hwrm_tf_session_hotup_state_get_input_t, *phwrm_tf_session_hotup_state_get_input_t;
51629 
51630 /* hwrm_tf_session_hotup_state_get_output (size:128b/16B) */
51631 
51632 typedef struct hwrm_tf_session_hotup_state_get_output {
51633 	/* The specific error status for the command. */
51634 	uint16_t	error_code;
51635 	/* The HWRM command request type. */
51636 	uint16_t	req_type;
51637 	/* The sequence ID from the original command. */
51638 	uint16_t	seq_id;
51639 	/* The length of the response data in number of bytes. */
51640 	uint16_t	resp_len;
51641 	/* Shared session HA state. */
51642 	uint16_t	state;
51643 	/* Shared session HA reference count. */
51644 	uint16_t	ref_cnt;
51645 	/* unused. */
51646 	uint8_t	unused0[3];
51647 	/*
51648 	 * This field is used in Output records to indicate that the output
51649 	 * is completely written to RAM. This field should be read as '1'
51650 	 * to indicate that the output has been completely written.
51651 	 * When writing a command completion or response to an internal
51652 	 * processor, the order of writes has to be such that this field
51653 	 * is written last.
51654 	 */
51655 	uint8_t	valid;
51656 } hwrm_tf_session_hotup_state_get_output_t, *phwrm_tf_session_hotup_state_get_output_t;
51657 
51658 /****************************
51659  * hwrm_tfc_tbl_scope_qcaps *
51660  ****************************/
51661 
51662 
51663 /*
51664  * TruFlow command to check if firmware is capable of
51665  * supporting table scopes.
51666  */
51667 /* hwrm_tfc_tbl_scope_qcaps_input (size:128b/16B) */
51668 
51669 typedef struct hwrm_tfc_tbl_scope_qcaps_input {
51670 	/* The HWRM command request type. */
51671 	uint16_t	req_type;
51672 	/*
51673 	 * The completion ring to send the completion event on. This should
51674 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51675 	 */
51676 	uint16_t	cmpl_ring;
51677 	/*
51678 	 * The sequence ID is used by the driver for tracking multiple
51679 	 * commands. This ID is treated as opaque data by the firmware and
51680 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51681 	 */
51682 	uint16_t	seq_id;
51683 	/*
51684 	 * The target ID of the command:
51685 	 * * 0x0-0xFFF8 - The function ID
51686 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51687 	 * * 0xFFFD - Reserved for user-space HWRM interface
51688 	 * * 0xFFFF - HWRM
51689 	 */
51690 	uint16_t	target_id;
51691 	/*
51692 	 * A physical address pointer pointing to a host buffer that the
51693 	 * command's response data will be written. This can be either a host
51694 	 * physical address (HPA) or a guest physical address (GPA) and must
51695 	 * point to a physically contiguous block of memory.
51696 	 */
51697 	uint64_t	resp_addr;
51698 } hwrm_tfc_tbl_scope_qcaps_input_t, *phwrm_tfc_tbl_scope_qcaps_input_t;
51699 
51700 /* hwrm_tfc_tbl_scope_qcaps_output (size:192b/24B) */
51701 
51702 typedef struct hwrm_tfc_tbl_scope_qcaps_output {
51703 	/* The specific error status for the command. */
51704 	uint16_t	error_code;
51705 	/* The HWRM command request type. */
51706 	uint16_t	req_type;
51707 	/* The sequence ID from the original command. */
51708 	uint16_t	seq_id;
51709 	/* The length of the response data in number of bytes. */
51710 	uint16_t	resp_len;
51711 	/*
51712 	 * The maximum number of lookup records that a table scope can support.
51713 	 * This field is only valid if tbl_scope_capable is not zero.
51714 	 */
51715 	uint32_t	max_lkup_rec_cnt;
51716 	/*
51717 	 * The maximum number of action records that a table scope can support.
51718 	 * This field is only valid if tbl_scope_capable is not zero.
51719 	 */
51720 	uint32_t	max_act_rec_cnt;
51721 	/* Not zero if firmware capable of table scopes. */
51722 	uint8_t	tbl_scope_capable;
51723 	/*
51724 	 * log2 of the number of lookup static buckets that a table scope can
51725 	 * support.  This field is only valid if tbl_scope_capable is not zero.
51726 	 */
51727 	uint8_t	max_lkup_static_buckets_exp;
51728 	/* unused. */
51729 	uint8_t	unused0[5];
51730 	/*
51731 	 * This field is used in Output records to indicate that the output
51732 	 * is completely written to RAM. This field should be read as '1'
51733 	 * to indicate that the output has been completely written.
51734 	 * When writing a command completion or response to an internal
51735 	 * processor, the order of writes has to be such that this field
51736 	 * is written last.
51737 	 */
51738 	uint8_t	valid;
51739 } hwrm_tfc_tbl_scope_qcaps_output_t, *phwrm_tfc_tbl_scope_qcaps_output_t;
51740 
51741 /*******************************
51742  * hwrm_tfc_tbl_scope_id_alloc *
51743  *******************************/
51744 
51745 
51746 /*
51747  * TruFlow command to allocate a table scope ID and create the pools.
51748  *
51749  * There is no corresponding free command since a table scope
51750  * ID will automatically be freed once the last FID is removed.
51751  * That is, when the hwrm_tfc_tbl_scope_fid_rem command returns
51752  * a fid_cnt of 0 that also means that the table scope ID has
51753  * been freed.
51754  */
51755 /* hwrm_tfc_tbl_scope_id_alloc_input (size:192b/24B) */
51756 
51757 typedef struct hwrm_tfc_tbl_scope_id_alloc_input {
51758 	/* The HWRM command request type. */
51759 	uint16_t	req_type;
51760 	/*
51761 	 * The completion ring to send the completion event on. This should
51762 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51763 	 */
51764 	uint16_t	cmpl_ring;
51765 	/*
51766 	 * The sequence ID is used by the driver for tracking multiple
51767 	 * commands. This ID is treated as opaque data by the firmware and
51768 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51769 	 */
51770 	uint16_t	seq_id;
51771 	/*
51772 	 * The target ID of the command:
51773 	 * * 0x0-0xFFF8 - The function ID
51774 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51775 	 * * 0xFFFD - Reserved for user-space HWRM interface
51776 	 * * 0xFFFF - HWRM
51777 	 */
51778 	uint16_t	target_id;
51779 	/*
51780 	 * A physical address pointer pointing to a host buffer that the
51781 	 * command's response data will be written. This can be either a host
51782 	 * physical address (HPA) or a guest physical address (GPA) and must
51783 	 * point to a physically contiguous block of memory.
51784 	 */
51785 	uint64_t	resp_addr;
51786 	/* The maximum number of pools for this table scope. */
51787 	uint16_t	max_pools;
51788 	/* Non-zero if this table scope is shared. */
51789 	uint8_t	shared;
51790 	/*
51791 	 * The size of the lookup pools per direction expressed as
51792 	 * log2(max_records/max_pools).  That is, size=2^exp.
51793 	 *
51794 	 * Array is indexed by enum cfa_dir.
51795 	 */
51796 	uint8_t	lkup_pool_sz_exp[2];
51797 	/*
51798 	 * The size of the action pools per direction expressed as
51799 	 * log2(max_records/max_pools).  That is, size=2^exp.
51800 	 *
51801 	 * Array is indexed by enum cfa_dir.
51802 	 */
51803 	uint8_t	act_pool_sz_exp[2];
51804 	/* unused. */
51805 	uint8_t	unused0;
51806 } hwrm_tfc_tbl_scope_id_alloc_input_t, *phwrm_tfc_tbl_scope_id_alloc_input_t;
51807 
51808 /* hwrm_tfc_tbl_scope_id_alloc_output (size:128b/16B) */
51809 
51810 typedef struct hwrm_tfc_tbl_scope_id_alloc_output {
51811 	/* The specific error status for the command. */
51812 	uint16_t	error_code;
51813 	/* The HWRM command request type. */
51814 	uint16_t	req_type;
51815 	/* The sequence ID from the original command. */
51816 	uint16_t	seq_id;
51817 	/* The length of the response data in number of bytes. */
51818 	uint16_t	resp_len;
51819 	/* The table scope ID that was allocated. */
51820 	uint8_t	tsid;
51821 	/*
51822 	 * Non-zero if this is the first FID associated with this table scope
51823 	 * ID.
51824 	 */
51825 	uint8_t	first;
51826 	/* unused. */
51827 	uint8_t	unused0[5];
51828 	/*
51829 	 * This field is used in Output records to indicate that the output
51830 	 * is completely written to RAM. This field should be read as '1'
51831 	 * to indicate that the output has been completely written.
51832 	 * When writing a command completion or response to an internal
51833 	 * processor, the order of writes has to be such that this field
51834 	 * is written last.
51835 	 */
51836 	uint8_t	valid;
51837 } hwrm_tfc_tbl_scope_id_alloc_output_t, *phwrm_tfc_tbl_scope_id_alloc_output_t;
51838 
51839 /*****************************
51840  * hwrm_tfc_tbl_scope_config *
51841  *****************************/
51842 
51843 
51844 /* TruFlow command to configure the table scope memory. */
51845 /* hwrm_tfc_tbl_scope_config_input (size:704b/88B) */
51846 
51847 typedef struct hwrm_tfc_tbl_scope_config_input {
51848 	/* The HWRM command request type. */
51849 	uint16_t	req_type;
51850 	/*
51851 	 * The completion ring to send the completion event on. This should
51852 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51853 	 */
51854 	uint16_t	cmpl_ring;
51855 	/*
51856 	 * The sequence ID is used by the driver for tracking multiple
51857 	 * commands. This ID is treated as opaque data by the firmware and
51858 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51859 	 */
51860 	uint16_t	seq_id;
51861 	/*
51862 	 * The target ID of the command:
51863 	 * * 0x0-0xFFF8 - The function ID
51864 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51865 	 * * 0xFFFD - Reserved for user-space HWRM interface
51866 	 * * 0xFFFF - HWRM
51867 	 */
51868 	uint16_t	target_id;
51869 	/*
51870 	 * A physical address pointer pointing to a host buffer that the
51871 	 * command's response data will be written. This can be either a host
51872 	 * physical address (HPA) or a guest physical address (GPA) and must
51873 	 * point to a physically contiguous block of memory.
51874 	 */
51875 	uint64_t	resp_addr;
51876 	/*
51877 	 * The base addresses for lookup memory.
51878 	 * Array is indexed by enum cfa_dir.
51879 	 */
51880 	uint64_t	lkup_base_addr[2];
51881 	/*
51882 	 * The base addresses for action memory.
51883 	 * Array is indexed by enum cfa_dir.
51884 	 */
51885 	uint64_t	act_base_addr[2];
51886 	/*
51887 	 * The number of minimum sized lkup records per direction.
51888 	 * In this usage, records are the minimum lookup memory
51889 	 * allocation unit in a table scope.  This value is the total
51890 	 * memory required for buckets and entries.
51891 	 *
51892 	 * Array is indexed by enum cfa_dir.
51893 	 */
51894 	uint64_t	lkup_rec_cnt;
51895 	/*
51896 	 * The number of minimum sized action records per direction.
51897 	 * Similar to the lkup_rec_cnt, records are the minimum
51898 	 * action memory allocation unit in a table scope.
51899 	 *
51900 	 * Array is indexed by enum cfa_dir.
51901 	 */
51902 	uint64_t	act_rec_cnt;
51903 	/*
51904 	 * The number of static lookup buckets in the table scope.
51905 	 * Array is indexed by enum cfa_dir.
51906 	 */
51907 	uint64_t	lkup_static_bucket_cnt;
51908 	/* The page size of the table scope. */
51909 	uint32_t	pbl_page_sz;
51910 	/*
51911 	 * The PBL level for lookup memory.
51912 	 * Array is indexed by enum cfa_dir.
51913 	 */
51914 	uint8_t	lkup_pbl_level[2];
51915 	/*
51916 	 * The PBL level for action memory.
51917 	 * Array is indexed by enum cfa_dir.
51918 	 */
51919 	uint8_t	act_pbl_level[2];
51920 	/* The table scope ID. */
51921 	uint8_t	tsid;
51922 	/* unused. */
51923 	uint8_t	unused0[7];
51924 } hwrm_tfc_tbl_scope_config_input_t, *phwrm_tfc_tbl_scope_config_input_t;
51925 
51926 /* hwrm_tfc_tbl_scope_config_output (size:128b/16B) */
51927 
51928 typedef struct hwrm_tfc_tbl_scope_config_output {
51929 	/* The specific error status for the command. */
51930 	uint16_t	error_code;
51931 	/* The HWRM command request type. */
51932 	uint16_t	req_type;
51933 	/* The sequence ID from the original command. */
51934 	uint16_t	seq_id;
51935 	/* The length of the response data in number of bytes. */
51936 	uint16_t	resp_len;
51937 	/* unused. */
51938 	uint8_t	unused0[7];
51939 	/*
51940 	 * This field is used in Output records to indicate that the output
51941 	 * is completely written to RAM. This field should be read as '1'
51942 	 * to indicate that the output has been completely written.
51943 	 * When writing a command completion or response to an internal
51944 	 * processor, the order of writes has to be such that this field
51945 	 * is written last.
51946 	 */
51947 	uint8_t	valid;
51948 } hwrm_tfc_tbl_scope_config_output_t, *phwrm_tfc_tbl_scope_config_output_t;
51949 
51950 /*******************************
51951  * hwrm_tfc_tbl_scope_deconfig *
51952  *******************************/
51953 
51954 
51955 /* TruFlow command to deconfigure the table scope memory. */
51956 /* hwrm_tfc_tbl_scope_deconfig_input (size:192b/24B) */
51957 
51958 typedef struct hwrm_tfc_tbl_scope_deconfig_input {
51959 	/* The HWRM command request type. */
51960 	uint16_t	req_type;
51961 	/*
51962 	 * The completion ring to send the completion event on. This should
51963 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51964 	 */
51965 	uint16_t	cmpl_ring;
51966 	/*
51967 	 * The sequence ID is used by the driver for tracking multiple
51968 	 * commands. This ID is treated as opaque data by the firmware and
51969 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51970 	 */
51971 	uint16_t	seq_id;
51972 	/*
51973 	 * The target ID of the command:
51974 	 * * 0x0-0xFFF8 - The function ID
51975 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51976 	 * * 0xFFFD - Reserved for user-space HWRM interface
51977 	 * * 0xFFFF - HWRM
51978 	 */
51979 	uint16_t	target_id;
51980 	/*
51981 	 * A physical address pointer pointing to a host buffer that the
51982 	 * command's response data will be written. This can be either a host
51983 	 * physical address (HPA) or a guest physical address (GPA) and must
51984 	 * point to a physically contiguous block of memory.
51985 	 */
51986 	uint64_t	resp_addr;
51987 	/* The table scope ID. */
51988 	uint8_t	tsid;
51989 	/* unused. */
51990 	uint8_t	unused0[7];
51991 } hwrm_tfc_tbl_scope_deconfig_input_t, *phwrm_tfc_tbl_scope_deconfig_input_t;
51992 
51993 /* hwrm_tfc_tbl_scope_deconfig_output (size:128b/16B) */
51994 
51995 typedef struct hwrm_tfc_tbl_scope_deconfig_output {
51996 	/* The specific error status for the command. */
51997 	uint16_t	error_code;
51998 	/* The HWRM command request type. */
51999 	uint16_t	req_type;
52000 	/* The sequence ID from the original command. */
52001 	uint16_t	seq_id;
52002 	/* The length of the response data in number of bytes. */
52003 	uint16_t	resp_len;
52004 	/* unused. */
52005 	uint8_t	unused0[7];
52006 	/*
52007 	 * This field is used in Output records to indicate that the output
52008 	 * is completely written to RAM. This field should be read as '1'
52009 	 * to indicate that the output has been completely written.
52010 	 * When writing a command completion or response to an internal
52011 	 * processor, the order of writes has to be such that this field
52012 	 * is written last.
52013 	 */
52014 	uint8_t	valid;
52015 } hwrm_tfc_tbl_scope_deconfig_output_t, *phwrm_tfc_tbl_scope_deconfig_output_t;
52016 
52017 /******************************
52018  * hwrm_tfc_tbl_scope_fid_add *
52019  ******************************/
52020 
52021 
52022 /* TruFlow command to add a FID to a table scope. */
52023 /* hwrm_tfc_tbl_scope_fid_add_input (size:192b/24B) */
52024 
52025 typedef struct hwrm_tfc_tbl_scope_fid_add_input {
52026 	/* The HWRM command request type. */
52027 	uint16_t	req_type;
52028 	/*
52029 	 * The completion ring to send the completion event on. This should
52030 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52031 	 */
52032 	uint16_t	cmpl_ring;
52033 	/*
52034 	 * The sequence ID is used by the driver for tracking multiple
52035 	 * commands. This ID is treated as opaque data by the firmware and
52036 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52037 	 */
52038 	uint16_t	seq_id;
52039 	/*
52040 	 * The target ID of the command:
52041 	 * * 0x0-0xFFF8 - The function ID
52042 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52043 	 * * 0xFFFD - Reserved for user-space HWRM interface
52044 	 * * 0xFFFF - HWRM
52045 	 */
52046 	uint16_t	target_id;
52047 	/*
52048 	 * A physical address pointer pointing to a host buffer that the
52049 	 * command's response data will be written. This can be either a host
52050 	 * physical address (HPA) or a guest physical address (GPA) and must
52051 	 * point to a physically contiguous block of memory.
52052 	 */
52053 	uint64_t	resp_addr;
52054 	/* The table scope ID. */
52055 	uint8_t	tsid;
52056 	/* unused. */
52057 	uint8_t	unused0[7];
52058 } hwrm_tfc_tbl_scope_fid_add_input_t, *phwrm_tfc_tbl_scope_fid_add_input_t;
52059 
52060 /* hwrm_tfc_tbl_scope_fid_add_output (size:128b/16B) */
52061 
52062 typedef struct hwrm_tfc_tbl_scope_fid_add_output {
52063 	/* The specific error status for the command. */
52064 	uint16_t	error_code;
52065 	/* The HWRM command request type. */
52066 	uint16_t	req_type;
52067 	/* The sequence ID from the original command. */
52068 	uint16_t	seq_id;
52069 	/* The length of the response data in number of bytes. */
52070 	uint16_t	resp_len;
52071 	/* The number of FIDs currently in the table scope ID. */
52072 	uint8_t	fid_cnt;
52073 	/* unused. */
52074 	uint8_t	unused0[6];
52075 	/*
52076 	 * This field is used in Output records to indicate that the output
52077 	 * is completely written to RAM. This field should be read as '1'
52078 	 * to indicate that the output has been completely written.
52079 	 * When writing a command completion or response to an internal
52080 	 * processor, the order of writes has to be such that this field
52081 	 * is written last.
52082 	 */
52083 	uint8_t	valid;
52084 } hwrm_tfc_tbl_scope_fid_add_output_t, *phwrm_tfc_tbl_scope_fid_add_output_t;
52085 
52086 /******************************
52087  * hwrm_tfc_tbl_scope_fid_rem *
52088  ******************************/
52089 
52090 
52091 /* TruFlow command to remove a FID from a table scope. */
52092 /* hwrm_tfc_tbl_scope_fid_rem_input (size:192b/24B) */
52093 
52094 typedef struct hwrm_tfc_tbl_scope_fid_rem_input {
52095 	/* The HWRM command request type. */
52096 	uint16_t	req_type;
52097 	/*
52098 	 * The completion ring to send the completion event on. This should
52099 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52100 	 */
52101 	uint16_t	cmpl_ring;
52102 	/*
52103 	 * The sequence ID is used by the driver for tracking multiple
52104 	 * commands. This ID is treated as opaque data by the firmware and
52105 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52106 	 */
52107 	uint16_t	seq_id;
52108 	/*
52109 	 * The target ID of the command:
52110 	 * * 0x0-0xFFF8 - The function ID
52111 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52112 	 * * 0xFFFD - Reserved for user-space HWRM interface
52113 	 * * 0xFFFF - HWRM
52114 	 */
52115 	uint16_t	target_id;
52116 	/*
52117 	 * A physical address pointer pointing to a host buffer that the
52118 	 * command's response data will be written. This can be either a host
52119 	 * physical address (HPA) or a guest physical address (GPA) and must
52120 	 * point to a physically contiguous block of memory.
52121 	 */
52122 	uint64_t	resp_addr;
52123 	/* The table scope ID. */
52124 	uint8_t	tsid;
52125 	/* unused. */
52126 	uint8_t	unused0[7];
52127 } hwrm_tfc_tbl_scope_fid_rem_input_t, *phwrm_tfc_tbl_scope_fid_rem_input_t;
52128 
52129 /* hwrm_tfc_tbl_scope_fid_rem_output (size:128b/16B) */
52130 
52131 typedef struct hwrm_tfc_tbl_scope_fid_rem_output {
52132 	/* The specific error status for the command. */
52133 	uint16_t	error_code;
52134 	/* The HWRM command request type. */
52135 	uint16_t	req_type;
52136 	/* The sequence ID from the original command. */
52137 	uint16_t	seq_id;
52138 	/* The length of the response data in number of bytes. */
52139 	uint16_t	resp_len;
52140 	/* The number of FIDs remaining in the table scope ID. */
52141 	uint16_t	fid_cnt;
52142 	/* unused. */
52143 	uint8_t	unused0[5];
52144 	/*
52145 	 * This field is used in Output records to indicate that the output
52146 	 * is completely written to RAM. This field should be read as '1'
52147 	 * to indicate that the output has been completely written.
52148 	 * When writing a command completion or response to an internal
52149 	 * processor, the order of writes has to be such that this field
52150 	 * is written last.
52151 	 */
52152 	uint8_t	valid;
52153 } hwrm_tfc_tbl_scope_fid_rem_output_t, *phwrm_tfc_tbl_scope_fid_rem_output_t;
52154 
52155 /*********************************
52156  * hwrm_tfc_tbl_scope_pool_alloc *
52157  *********************************/
52158 
52159 
52160 /* hwrm_tfc_tbl_scope_pool_alloc_input (size:192b/24B) */
52161 
52162 typedef struct hwrm_tfc_tbl_scope_pool_alloc_input {
52163 	/* The HWRM command request type. */
52164 	uint16_t	req_type;
52165 	/*
52166 	 * The completion ring to send the completion event on. This should
52167 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52168 	 */
52169 	uint16_t	cmpl_ring;
52170 	/*
52171 	 * The sequence ID is used by the driver for tracking multiple
52172 	 * commands. This ID is treated as opaque data by the firmware and
52173 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52174 	 */
52175 	uint16_t	seq_id;
52176 	/*
52177 	 * The target ID of the command:
52178 	 * * 0x0-0xFFF8 - The function ID
52179 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52180 	 * * 0xFFFD - Reserved for user-space HWRM interface
52181 	 * * 0xFFFF - HWRM
52182 	 */
52183 	uint16_t	target_id;
52184 	/*
52185 	 * A physical address pointer pointing to a host buffer that the
52186 	 * command's response data will be written. This can be either a host
52187 	 * physical address (HPA) or a guest physical address (GPA) and must
52188 	 * point to a physically contiguous block of memory.
52189 	 */
52190 	uint64_t	resp_addr;
52191 	/* Table Scope ID */
52192 	uint8_t	tsid;
52193 	/* Control flags. Direction and type. */
52194 	uint8_t	flags;
52195 	/* Indicates the flow direction. */
52196 	#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
52197 	/* If this bit set to 0, then it indicates rx flow. */
52198 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52199 	/* If this bit is set to 1, then it indicates tx flow. */
52200 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52201 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_DIR_LAST	HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_DIR_TX
52202 	/* Indicates the table type. */
52203 	#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_TYPE	UINT32_C(0x2)
52204 	/* Lookup table */
52205 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_TYPE_LOOKUP  (UINT32_C(0x0) << 1)
52206 	/* Action table */
52207 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_TYPE_ACTION  (UINT32_C(0x1) << 1)
52208 		#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_TYPE_LAST   HWRM_TFC_TBL_SCOPE_POOL_ALLOC_INPUT_FLAGS_TYPE_ACTION
52209 	/* Unused */
52210 	uint8_t	unused[6];
52211 } hwrm_tfc_tbl_scope_pool_alloc_input_t, *phwrm_tfc_tbl_scope_pool_alloc_input_t;
52212 
52213 /* hwrm_tfc_tbl_scope_pool_alloc_output (size:128b/16B) */
52214 
52215 typedef struct hwrm_tfc_tbl_scope_pool_alloc_output {
52216 	/* The specific error status for the command. */
52217 	uint16_t	error_code;
52218 	/* The HWRM command request type. */
52219 	uint16_t	req_type;
52220 	/* The sequence ID from the original command. */
52221 	uint16_t	seq_id;
52222 	/* The length of the response data in number of bytes. */
52223 	uint16_t	resp_len;
52224 	/* Pool ID */
52225 	uint16_t	pool_id;
52226 	/* Pool size exponent. An exponent of 0 indicates a failure. */
52227 	uint8_t	pool_sz_exp;
52228 	/* unused. */
52229 	uint8_t	unused1[4];
52230 	/*
52231 	 * This field is used in Output records to indicate that the
52232 	 * output is completely written to RAM. This field should be
52233 	 * read as '1' to indicate that the output has been
52234 	 * completely written.  When writing a command completion or
52235 	 * response to an internal processor, the order of writes has
52236 	 * to be such that this field is written last.
52237 	 */
52238 	uint8_t	valid;
52239 } hwrm_tfc_tbl_scope_pool_alloc_output_t, *phwrm_tfc_tbl_scope_pool_alloc_output_t;
52240 
52241 /********************************
52242  * hwrm_tfc_tbl_scope_pool_free *
52243  ********************************/
52244 
52245 
52246 /* hwrm_tfc_tbl_scope_pool_free_input (size:192b/24B) */
52247 
52248 typedef struct hwrm_tfc_tbl_scope_pool_free_input {
52249 	/* The HWRM command request type. */
52250 	uint16_t	req_type;
52251 	/*
52252 	 * The completion ring to send the completion event on. This should
52253 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52254 	 */
52255 	uint16_t	cmpl_ring;
52256 	/*
52257 	 * The sequence ID is used by the driver for tracking multiple
52258 	 * commands. This ID is treated as opaque data by the firmware and
52259 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52260 	 */
52261 	uint16_t	seq_id;
52262 	/*
52263 	 * The target ID of the command:
52264 	 * * 0x0-0xFFF8 - The function ID
52265 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52266 	 * * 0xFFFD - Reserved for user-space HWRM interface
52267 	 * * 0xFFFF - HWRM
52268 	 */
52269 	uint16_t	target_id;
52270 	/*
52271 	 * A physical address pointer pointing to a host buffer that the
52272 	 * command's response data will be written. This can be either a host
52273 	 * physical address (HPA) or a guest physical address (GPA) and must
52274 	 * point to a physically contiguous block of memory.
52275 	 */
52276 	uint64_t	resp_addr;
52277 	/* Table Scope ID */
52278 	uint8_t	tsid;
52279 	/* Control flags. Direction and type. */
52280 	uint8_t	flags;
52281 	/* Indicates the flow direction. */
52282 	#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
52283 	/* If this bit set to 0, then it indicates rx flow. */
52284 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52285 	/* If this bit is set to 1, then it indicates tx flow. */
52286 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52287 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_DIR_LAST	HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_DIR_TX
52288 	/* Indicates the table type. */
52289 	#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_TYPE	UINT32_C(0x2)
52290 	/* Lookup table */
52291 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_TYPE_LOOKUP  (UINT32_C(0x0) << 1)
52292 	/* Action table */
52293 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_TYPE_ACTION  (UINT32_C(0x1) << 1)
52294 		#define HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_TYPE_LAST   HWRM_TFC_TBL_SCOPE_POOL_FREE_INPUT_FLAGS_TYPE_ACTION
52295 	/* Pool ID */
52296 	uint16_t	pool_id;
52297 	/* Unused */
52298 	uint8_t	unused[4];
52299 } hwrm_tfc_tbl_scope_pool_free_input_t, *phwrm_tfc_tbl_scope_pool_free_input_t;
52300 
52301 /* hwrm_tfc_tbl_scope_pool_free_output (size:128b/16B) */
52302 
52303 typedef struct hwrm_tfc_tbl_scope_pool_free_output {
52304 	/* The specific error status for the command. */
52305 	uint16_t	error_code;
52306 	/* The HWRM command request type. */
52307 	uint16_t	req_type;
52308 	/* The sequence ID from the original command. */
52309 	uint16_t	seq_id;
52310 	/* The length of the response data in number of bytes. */
52311 	uint16_t	resp_len;
52312 	/* unused. */
52313 	uint8_t	unused1[7];
52314 	/*
52315 	 * This field is used in Output records to indicate that the
52316 	 * output is completely written to RAM. This field should be
52317 	 * read as '1' to indicate that the output has been
52318 	 * completely written.  When writing a command completion or
52319 	 * response to an internal processor, the order of writes has
52320 	 * to be such that this field is written last.
52321 	 */
52322 	uint8_t	valid;
52323 } hwrm_tfc_tbl_scope_pool_free_output_t, *phwrm_tfc_tbl_scope_pool_free_output_t;
52324 
52325 /*****************************
52326  * hwrm_tfc_session_id_alloc *
52327  *****************************/
52328 
52329 
52330 /*
52331  * Allocate a TFC session. Requests the firmware to allocate a TFC
52332  * session identifier and associate a forwarding function with the
52333  * session.  Though there's not an explicit matching free for a session
52334  * id alloc, dis-associating the last fid from a session id (fid_cnt goes
52335  * to 0), will result in this session id being freed automatically.
52336  */
52337 /* hwrm_tfc_session_id_alloc_input (size:128b/16B) */
52338 
52339 typedef struct hwrm_tfc_session_id_alloc_input {
52340 	/* The HWRM command request type. */
52341 	uint16_t	req_type;
52342 	/*
52343 	 * The completion ring to send the completion event on. This should
52344 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52345 	 */
52346 	uint16_t	cmpl_ring;
52347 	/*
52348 	 * The sequence ID is used by the driver for tracking multiple
52349 	 * commands. This ID is treated as opaque data by the firmware and
52350 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52351 	 */
52352 	uint16_t	seq_id;
52353 	/*
52354 	 * The target ID of the command:
52355 	 * * 0x0-0xFFF8 - The function ID
52356 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52357 	 * * 0xFFFD - Reserved for user-space HWRM interface
52358 	 * * 0xFFFF - HWRM
52359 	 */
52360 	uint16_t	target_id;
52361 	/*
52362 	 * A physical address pointer pointing to a host buffer that the
52363 	 * command's response data will be written. This can be either a host
52364 	 * physical address (HPA) or a guest physical address (GPA) and must
52365 	 * point to a physically contiguous block of memory.
52366 	 */
52367 	uint64_t	resp_addr;
52368 } hwrm_tfc_session_id_alloc_input_t, *phwrm_tfc_session_id_alloc_input_t;
52369 
52370 /* hwrm_tfc_session_id_alloc_output (size:128b/16B) */
52371 
52372 typedef struct hwrm_tfc_session_id_alloc_output {
52373 	/* The specific error status for the command. */
52374 	uint16_t	error_code;
52375 	/* The HWRM command request type. */
52376 	uint16_t	req_type;
52377 	/* The sequence ID from the original command. */
52378 	uint16_t	seq_id;
52379 	/* The length of the response data in number of bytes. */
52380 	uint16_t	resp_len;
52381 	/*
52382 	 * Unique session identifier for the session created by the
52383 	 * firmware.
52384 	 */
52385 	uint16_t	sid;
52386 	/* Unused field */
52387 	uint8_t	unused0[5];
52388 	/*
52389 	 * This field is used in Output records to indicate that the output
52390 	 * is completely written to RAM. This field should be read as '1'
52391 	 * to indicate that the output has been completely written.
52392 	 * When writing a command completion or response to an internal
52393 	 * processor, the order of writes has to be such that this field is
52394 	 * written last.
52395 	 */
52396 	uint8_t	valid;
52397 } hwrm_tfc_session_id_alloc_output_t, *phwrm_tfc_session_id_alloc_output_t;
52398 
52399 /****************************
52400  * hwrm_tfc_session_fid_add *
52401  ****************************/
52402 
52403 
52404 /*
52405  * Associate a TFC session id with a forwarding function. The target_fid
52406  * will be associated with the passed in sid.
52407  */
52408 /* hwrm_tfc_session_fid_add_input (size:192b/24B) */
52409 
52410 typedef struct hwrm_tfc_session_fid_add_input {
52411 	/* The HWRM command request type. */
52412 	uint16_t	req_type;
52413 	/*
52414 	 * The completion ring to send the completion event on. This should
52415 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52416 	 */
52417 	uint16_t	cmpl_ring;
52418 	/*
52419 	 * The sequence ID is used by the driver for tracking multiple
52420 	 * commands. This ID is treated as opaque data by the firmware and
52421 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52422 	 */
52423 	uint16_t	seq_id;
52424 	/*
52425 	 * The target ID of the command:
52426 	 * * 0x0-0xFFF8 - The function ID
52427 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52428 	 * * 0xFFFD - Reserved for user-space HWRM interface
52429 	 * * 0xFFFF - HWRM
52430 	 */
52431 	uint16_t	target_id;
52432 	/*
52433 	 * A physical address pointer pointing to a host buffer that the
52434 	 * command's response data will be written. This can be either a host
52435 	 * physical address (HPA) or a guest physical address (GPA) and must
52436 	 * point to a physically contiguous block of memory.
52437 	 */
52438 	uint64_t	resp_addr;
52439 	/*
52440 	 * Unique session identifier for the session created by the
52441 	 * firmware.
52442 	 */
52443 	uint16_t	sid;
52444 	/* Unused field */
52445 	uint8_t	unused0[6];
52446 } hwrm_tfc_session_fid_add_input_t, *phwrm_tfc_session_fid_add_input_t;
52447 
52448 /* hwrm_tfc_session_fid_add_output (size:128b/16B) */
52449 
52450 typedef struct hwrm_tfc_session_fid_add_output {
52451 	/* The specific error status for the command. */
52452 	uint16_t	error_code;
52453 	/* The HWRM command request type. */
52454 	uint16_t	req_type;
52455 	/* The sequence ID from the original command. */
52456 	uint16_t	seq_id;
52457 	/* The length of the response data in number of bytes. */
52458 	uint16_t	resp_len;
52459 	/* The number of FIDs that share this session. */
52460 	uint16_t	fid_cnt;
52461 	/* Unused field */
52462 	uint8_t	unused0[5];
52463 	/*
52464 	 * This field is used in Output records to indicate that the output
52465 	 * is completely written to RAM. This field should be read as '1'
52466 	 * to indicate that the output has been completely written.
52467 	 * When writing a command completion or response to an internal
52468 	 * processor, the order of writes has to be such that this field is
52469 	 * written last.
52470 	 */
52471 	uint8_t	valid;
52472 } hwrm_tfc_session_fid_add_output_t, *phwrm_tfc_session_fid_add_output_t;
52473 
52474 /****************************
52475  * hwrm_tfc_session_fid_rem *
52476  ****************************/
52477 
52478 
52479 /*
52480  * Dis-associate a TFC session from the target_fid.
52481  * Though there's not an explicit matching free for a
52482  * session id alloc, dis-associating the last fid from a session id
52483  * (fid_cnt goes to 0), will result in this session id being freed
52484  * automatically.
52485  */
52486 /* hwrm_tfc_session_fid_rem_input (size:192b/24B) */
52487 
52488 typedef struct hwrm_tfc_session_fid_rem_input {
52489 	/* The HWRM command request type. */
52490 	uint16_t	req_type;
52491 	/*
52492 	 * The completion ring to send the completion event on. This should
52493 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52494 	 */
52495 	uint16_t	cmpl_ring;
52496 	/*
52497 	 * The sequence ID is used by the driver for tracking multiple
52498 	 * commands. This ID is treated as opaque data by the firmware and
52499 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52500 	 */
52501 	uint16_t	seq_id;
52502 	/*
52503 	 * The target ID of the command:
52504 	 * * 0x0-0xFFF8 - The function ID
52505 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52506 	 * * 0xFFFD - Reserved for user-space HWRM interface
52507 	 * * 0xFFFF - HWRM
52508 	 */
52509 	uint16_t	target_id;
52510 	/*
52511 	 * A physical address pointer pointing to a host buffer that the
52512 	 * command's response data will be written. This can be either a host
52513 	 * physical address (HPA) or a guest physical address (GPA) and must
52514 	 * point to a physically contiguous block of memory.
52515 	 */
52516 	uint64_t	resp_addr;
52517 	/*
52518 	 * Unique session identifier for the session created by the
52519 	 * firmware.
52520 	 */
52521 	uint16_t	sid;
52522 	/* Unused field */
52523 	uint8_t	unused0[6];
52524 } hwrm_tfc_session_fid_rem_input_t, *phwrm_tfc_session_fid_rem_input_t;
52525 
52526 /* hwrm_tfc_session_fid_rem_output (size:128b/16B) */
52527 
52528 typedef struct hwrm_tfc_session_fid_rem_output {
52529 	/* The specific error status for the command. */
52530 	uint16_t	error_code;
52531 	/* The HWRM command request type. */
52532 	uint16_t	req_type;
52533 	/* The sequence ID from the original command. */
52534 	uint16_t	seq_id;
52535 	/* The length of the response data in number of bytes. */
52536 	uint16_t	resp_len;
52537 	/* The number of FIDs that share this session. */
52538 	uint16_t	fid_cnt;
52539 	/* Unused field */
52540 	uint8_t	unused0[5];
52541 	/*
52542 	 * This field is used in Output records to indicate that the output
52543 	 * is completely written to RAM. This field should be read as '1'
52544 	 * to indicate that the output has been completely written.
52545 	 * When writing a command completion or response to an internal
52546 	 * processor, the order of writes has to be such that this field is
52547 	 * written last.
52548 	 */
52549 	uint8_t	valid;
52550 } hwrm_tfc_session_fid_rem_output_t, *phwrm_tfc_session_fid_rem_output_t;
52551 
52552 /************************
52553  * hwrm_tfc_ident_alloc *
52554  ************************/
52555 
52556 
52557 /*
52558  * Allocate a TFC identifier. Requests the firmware to
52559  * allocate a TFC identifier. The session id and track_type are passed
52560  * in. The tracking_id is either the sid or target_fid depends on the
52561  * track_type. The resource subtype is passed in, an id corresponding
52562  * to all these is allocated and returned in the HWRM response.
52563  */
52564 /* hwrm_tfc_ident_alloc_input (size:192b/24B) */
52565 
52566 typedef struct hwrm_tfc_ident_alloc_input {
52567 	/* The HWRM command request type. */
52568 	uint16_t	req_type;
52569 	/*
52570 	 * The completion ring to send the completion event on. This should
52571 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52572 	 */
52573 	uint16_t	cmpl_ring;
52574 	/*
52575 	 * The sequence ID is used by the driver for tracking multiple
52576 	 * commands. This ID is treated as opaque data by the firmware and
52577 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52578 	 */
52579 	uint16_t	seq_id;
52580 	/*
52581 	 * The target ID of the command:
52582 	 * * 0x0-0xFFF8 - The function ID
52583 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52584 	 * * 0xFFFD - Reserved for user-space HWRM interface
52585 	 * * 0xFFFF - HWRM
52586 	 */
52587 	uint16_t	target_id;
52588 	/*
52589 	 * A physical address pointer pointing to a host buffer that the
52590 	 * command's response data will be written. This can be either a host
52591 	 * physical address (HPA) or a guest physical address (GPA) and must
52592 	 * point to a physically contiguous block of memory.
52593 	 */
52594 	uint64_t	resp_addr;
52595 	/*
52596 	 * Unique session identifier for the session created by the
52597 	 * firmware. Will be used to track this identifier.
52598 	 */
52599 	uint16_t	sid;
52600 	/* Control flags. Direction. */
52601 	uint8_t	flags;
52602 	/* Indicates the flow direction. */
52603 	#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
52604 	/* If this bit set to 0, then it indicates rx flow. */
52605 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52606 	/* If this bit is set to 1, then it indicates tx flow. */
52607 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52608 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_TX
52609 	/*
52610 	 * CFA resource subtype. For definitions, please see
52611 	 * cfa_v3/include/cfa_resources.h.
52612 	 */
52613 	uint8_t	subtype;
52614 	/* Describes the type of tracking tag to be used */
52615 	uint8_t	track_type;
52616 	/* Invalid track type */
52617 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
52618 	/* Tracked by session id */
52619 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
52620 	/* Tracked by function id */
52621 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
52622 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
52623 	/* Unused field */
52624 	uint8_t	unused0[3];
52625 } hwrm_tfc_ident_alloc_input_t, *phwrm_tfc_ident_alloc_input_t;
52626 
52627 /* hwrm_tfc_ident_alloc_output (size:128b/16B) */
52628 
52629 typedef struct hwrm_tfc_ident_alloc_output {
52630 	/* The specific error status for the command. */
52631 	uint16_t	error_code;
52632 	/* The HWRM command request type. */
52633 	uint16_t	req_type;
52634 	/* The sequence ID from the original command. */
52635 	uint16_t	seq_id;
52636 	/* The length of the response data in number of bytes. */
52637 	uint16_t	resp_len;
52638 	/*
52639 	 * Resource identifier allocated by the firmware using
52640 	 * parameters above.
52641 	 */
52642 	uint16_t	ident_id;
52643 	/* Unused field */
52644 	uint8_t	unused0[5];
52645 	/*
52646 	 * This field is used in Output records to indicate that the output
52647 	 * is completely written to RAM. This field should be read as '1'
52648 	 * to indicate that the output has been completely written.
52649 	 * When writing a command completion or response to an internal
52650 	 * processor, the order of writes has to be such that this field is
52651 	 * written last.
52652 	 */
52653 	uint8_t	valid;
52654 } hwrm_tfc_ident_alloc_output_t, *phwrm_tfc_ident_alloc_output_t;
52655 
52656 /***********************
52657  * hwrm_tfc_ident_free *
52658  ***********************/
52659 
52660 
52661 /*
52662  * Requests the firmware to free a TFC resource identifier.
52663  * A resource subtype and session id are passed in.
52664  * An identifier (previously allocated) corresponding to all these is
52665  * freed, only after various sanity checks are completed.
52666  */
52667 /* hwrm_tfc_ident_free_input (size:192b/24B) */
52668 
52669 typedef struct hwrm_tfc_ident_free_input {
52670 	/* The HWRM command request type. */
52671 	uint16_t	req_type;
52672 	/*
52673 	 * The completion ring to send the completion event on. This should
52674 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52675 	 */
52676 	uint16_t	cmpl_ring;
52677 	/*
52678 	 * The sequence ID is used by the driver for tracking multiple
52679 	 * commands. This ID is treated as opaque data by the firmware and
52680 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52681 	 */
52682 	uint16_t	seq_id;
52683 	/*
52684 	 * The target ID of the command:
52685 	 * * 0x0-0xFFF8 - The function ID
52686 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52687 	 * * 0xFFFD - Reserved for user-space HWRM interface
52688 	 * * 0xFFFF - HWRM
52689 	 */
52690 	uint16_t	target_id;
52691 	/*
52692 	 * A physical address pointer pointing to a host buffer that the
52693 	 * command's response data will be written. This can be either a host
52694 	 * physical address (HPA) or a guest physical address (GPA) and must
52695 	 * point to a physically contiguous block of memory.
52696 	 */
52697 	uint64_t	resp_addr;
52698 	/*
52699 	 * Unique session identifier for the session created by the
52700 	 * firmware. Will be used to validate this request.
52701 	 */
52702 	uint16_t	sid;
52703 	/*
52704 	 * CFA resource subtype. For definitions, please see
52705 	 * cfa_v3/include/cfa_resources.h.
52706 	 */
52707 	uint8_t	subtype;
52708 	/* Control flags. Direction. */
52709 	uint8_t	flags;
52710 	/* Indicates the flow direction. */
52711 	#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
52712 	/* If this bit set to 0, then it indicates rx flow. */
52713 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52714 	/* If this bit is set to 1, then it indicates tx flow. */
52715 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52716 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_TX
52717 	/* The resource identifier to be freed */
52718 	uint16_t	ident_id;
52719 	/* Reserved */
52720 	uint8_t	unused0[2];
52721 } hwrm_tfc_ident_free_input_t, *phwrm_tfc_ident_free_input_t;
52722 
52723 /* hwrm_tfc_ident_free_output (size:128b/16B) */
52724 
52725 typedef struct hwrm_tfc_ident_free_output {
52726 	/* The specific error status for the command. */
52727 	uint16_t	error_code;
52728 	/* The HWRM command request type. */
52729 	uint16_t	req_type;
52730 	/* The sequence ID from the original command. */
52731 	uint16_t	seq_id;
52732 	/* The length of the response data in number of bytes. */
52733 	uint16_t	resp_len;
52734 	/* Reserved */
52735 	uint8_t	unused0[7];
52736 	/*
52737 	 * This field is used in Output records to indicate that the output
52738 	 * is completely written to RAM. This field should be read as '1'
52739 	 * to indicate that the output has been completely written.
52740 	 * When writing a command completion or response to an internal
52741 	 * processor, the order of writes has to be such that this field is
52742 	 * written last.
52743 	 */
52744 	uint8_t	valid;
52745 } hwrm_tfc_ident_free_output_t, *phwrm_tfc_ident_free_output_t;
52746 
52747 /**************************
52748  * hwrm_tfc_idx_tbl_alloc *
52749  **************************/
52750 
52751 
52752 /* hwrm_tfc_idx_tbl_alloc_input (size:192b/24B) */
52753 
52754 typedef struct hwrm_tfc_idx_tbl_alloc_input {
52755 	/* The HWRM command request type. */
52756 	uint16_t	req_type;
52757 	/*
52758 	 * The completion ring to send the completion event on. This should
52759 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52760 	 */
52761 	uint16_t	cmpl_ring;
52762 	/*
52763 	 * The sequence ID is used by the driver for tracking multiple
52764 	 * commands. This ID is treated as opaque data by the firmware and
52765 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52766 	 */
52767 	uint16_t	seq_id;
52768 	/*
52769 	 * The target ID of the command:
52770 	 * * 0x0-0xFFF8 - The function ID
52771 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52772 	 * * 0xFFFD - Reserved for user-space HWRM interface
52773 	 * * 0xFFFF - HWRM
52774 	 */
52775 	uint16_t	target_id;
52776 	/*
52777 	 * A physical address pointer pointing to a host buffer that the
52778 	 * command's response data will be written. This can be either a host
52779 	 * physical address (HPA) or a guest physical address (GPA) and must
52780 	 * point to a physically contiguous block of memory.
52781 	 */
52782 	uint64_t	resp_addr;
52783 	/*
52784 	 * Unique session id for the session created by the
52785 	 * firmware. Will be used to track this index table entry
52786 	 * only if track type is track_type_sid.
52787 	 */
52788 	uint16_t	sid;
52789 	/* Control flags. */
52790 	uint8_t	flags;
52791 	/* Indicates the flow direction. */
52792 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
52793 	/* If this bit set to 0, then it indicates rx flow. */
52794 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52795 	/* If this bit is set to 1, then it indicates tx flow. */
52796 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52797 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_TX
52798 	/*
52799 	 * CFA resource subtype. For definitions, please see
52800 	 * cfa_v3/include/cfa_resources.h.
52801 	 */
52802 	uint8_t	subtype;
52803 	/* Describes the type of tracking id to be used */
52804 	uint8_t	track_type;
52805 	/* Invalid track type */
52806 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
52807 	/* Tracked by session id */
52808 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
52809 	/* Tracked by function id */
52810 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
52811 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
52812 	/* Reserved */
52813 	uint8_t	unused0[3];
52814 } hwrm_tfc_idx_tbl_alloc_input_t, *phwrm_tfc_idx_tbl_alloc_input_t;
52815 
52816 /* hwrm_tfc_idx_tbl_alloc_output (size:128b/16B) */
52817 
52818 typedef struct hwrm_tfc_idx_tbl_alloc_output {
52819 	/* The specific error status for the command. */
52820 	uint16_t	error_code;
52821 	/* The HWRM command request type. */
52822 	uint16_t	req_type;
52823 	/* The sequence ID from the original command. */
52824 	uint16_t	seq_id;
52825 	/* The length of the response data in number of bytes. */
52826 	uint16_t	resp_len;
52827 	/*
52828 	 * Index table entry allocated by the firmware using the
52829 	 * parameters above.
52830 	 */
52831 	uint16_t	idx_tbl_id;
52832 	/* Reserved */
52833 	uint8_t	unused0[5];
52834 	/*
52835 	 * This field is used in Output records to indicate that the output
52836 	 * is completely written to RAM. This field should be read as '1'
52837 	 * to indicate that the output has been completely written.
52838 	 * When writing a command completion or response to an internal
52839 	 * processor, the order of writes has to be such that this field
52840 	 * is written last.
52841 	 */
52842 	uint8_t	valid;
52843 } hwrm_tfc_idx_tbl_alloc_output_t, *phwrm_tfc_idx_tbl_alloc_output_t;
52844 
52845 /******************************
52846  * hwrm_tfc_idx_tbl_alloc_set *
52847  ******************************/
52848 
52849 
52850 /* hwrm_tfc_idx_tbl_alloc_set_input (size:1088b/136B) */
52851 
52852 typedef struct hwrm_tfc_idx_tbl_alloc_set_input {
52853 	/* The HWRM command request type. */
52854 	uint16_t	req_type;
52855 	/*
52856 	 * The completion ring to send the completion event on. This should
52857 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52858 	 */
52859 	uint16_t	cmpl_ring;
52860 	/*
52861 	 * The sequence ID is used by the driver for tracking multiple
52862 	 * commands. This ID is treated as opaque data by the firmware and
52863 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52864 	 */
52865 	uint16_t	seq_id;
52866 	/*
52867 	 * The target ID of the command:
52868 	 * * 0x0-0xFFF8 - The function ID
52869 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52870 	 * * 0xFFFD - Reserved for user-space HWRM interface
52871 	 * * 0xFFFF - HWRM
52872 	 */
52873 	uint16_t	target_id;
52874 	/*
52875 	 * A physical address pointer pointing to a host buffer that the
52876 	 * command's response data will be written. This can be either a host
52877 	 * physical address (HPA) or a guest physical address (GPA) and must
52878 	 * point to a physically contiguous block of memory.
52879 	 */
52880 	uint64_t	resp_addr;
52881 	/*
52882 	 * Unique session id for the session created by the
52883 	 * firmware. Will be used to track this index table entry
52884 	 * only if track type is track_type_sid.
52885 	 */
52886 	uint16_t	sid;
52887 	/* Control flags. */
52888 	uint8_t	flags;
52889 	/* Indicates the flow direction. */
52890 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
52891 	/* If this bit set to 0, then it indicates rx flow. */
52892 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52893 	/* If this bit is set to 1, then it indicates tx flow. */
52894 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
52895 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_TX
52896 	/*
52897 	 * Indicate device data is being sent via DMA, the device
52898 	 * data packing does not change.
52899 	 */
52900 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
52901 	/*
52902 	 * CFA resource subtype. For definitions, please see
52903 	 * cfa_v3/include/cfa_resources.h.
52904 	 */
52905 	uint8_t	subtype;
52906 	/* Describes the type of tracking id to be used */
52907 	uint8_t	track_type;
52908 	/* Invalid track type */
52909 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
52910 	/* Tracked by session id */
52911 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
52912 	/* Tracked by function id */
52913 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
52914 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID
52915 	/* Reserved */
52916 	uint8_t	unused0;
52917 	/* The size of the index table entry in bytes. */
52918 	uint16_t	data_size;
52919 	/* The location of the dma buffer */
52920 	uint64_t	dma_addr;
52921 	/*
52922 	 * Index table data located at offset 0.  If dma bit is set,
52923 	 * then this field contains the DMA buffer pointer.
52924 	 */
52925 	uint8_t	dev_data[104];
52926 } hwrm_tfc_idx_tbl_alloc_set_input_t, *phwrm_tfc_idx_tbl_alloc_set_input_t;
52927 
52928 /* hwrm_tfc_idx_tbl_alloc_set_output (size:128b/16B) */
52929 
52930 typedef struct hwrm_tfc_idx_tbl_alloc_set_output {
52931 	/* The specific error status for the command. */
52932 	uint16_t	error_code;
52933 	/* The HWRM command request type. */
52934 	uint16_t	req_type;
52935 	/* The sequence ID from the original command. */
52936 	uint16_t	seq_id;
52937 	/* The length of the response data in number of bytes. */
52938 	uint16_t	resp_len;
52939 	/*
52940 	 * Index table entry allocated by the firmware using the
52941 	 * parameters above.
52942 	 */
52943 	uint16_t	idx_tbl_id;
52944 	/* Reserved */
52945 	uint8_t	unused0[5];
52946 	/*
52947 	 * This field is used in Output records to indicate that the output
52948 	 * is completely written to RAM. This field should be read as '1'
52949 	 * to indicate that the output has been completely written.
52950 	 * When writing a command completion or response to an internal
52951 	 * processor, the order of writes has to be such that this field
52952 	 * is written last.
52953 	 */
52954 	uint8_t	valid;
52955 } hwrm_tfc_idx_tbl_alloc_set_output_t, *phwrm_tfc_idx_tbl_alloc_set_output_t;
52956 
52957 /************************
52958  * hwrm_tfc_idx_tbl_set *
52959  ************************/
52960 
52961 
52962 /* hwrm_tfc_idx_tbl_set_input (size:1088b/136B) */
52963 
52964 typedef struct hwrm_tfc_idx_tbl_set_input {
52965 	/* The HWRM command request type. */
52966 	uint16_t	req_type;
52967 	/*
52968 	 * The completion ring to send the completion event on. This should
52969 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52970 	 */
52971 	uint16_t	cmpl_ring;
52972 	/*
52973 	 * The sequence ID is used by the driver for tracking multiple
52974 	 * commands. This ID is treated as opaque data by the firmware and
52975 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52976 	 */
52977 	uint16_t	seq_id;
52978 	/*
52979 	 * The target ID of the command:
52980 	 * * 0x0-0xFFF8 - The function ID
52981 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52982 	 * * 0xFFFD - Reserved for user-space HWRM interface
52983 	 * * 0xFFFF - HWRM
52984 	 */
52985 	uint16_t	target_id;
52986 	/*
52987 	 * A physical address pointer pointing to a host buffer that the
52988 	 * command's response data will be written. This can be either a host
52989 	 * physical address (HPA) or a guest physical address (GPA) and must
52990 	 * point to a physically contiguous block of memory.
52991 	 */
52992 	uint64_t	resp_addr;
52993 	/* Control flags. */
52994 	uint8_t	flags;
52995 	/* Indicates the flow direction. */
52996 	#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
52997 	/* If this bit set to 0, then it indicates rx flow. */
52998 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
52999 	/* If this bit is set to 1, then it indicates tx flow. */
53000 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53001 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_TX
53002 	/*
53003 	 * Indicate device data is being sent via DMA, the device
53004 	 * data packing does not change.
53005 	 */
53006 	#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
53007 	/*
53008 	 * CFA resource subtype. For definitions, please see
53009 	 * cfa_v3/include/cfa_resources.h.
53010 	 */
53011 	uint8_t	subtype;
53012 	/*
53013 	 * Session id associated with the firmware. Will be used
53014 	 * for validation if the track type matches.
53015 	 */
53016 	uint16_t	sid;
53017 	/*
53018 	 * Index table index returned during alloc by the
53019 	 * firmware.
53020 	 */
53021 	uint16_t	idx_tbl_id;
53022 	/* The size of the index table entry in bytes. */
53023 	uint16_t	data_size;
53024 	/* The location of the dma buffer */
53025 	uint64_t	dma_addr;
53026 	/*
53027 	 * Index table data located at offset 0.  If dma bit is set,
53028 	 * then this field contains the DMA buffer pointer.
53029 	 */
53030 	uint8_t	dev_data[104];
53031 } hwrm_tfc_idx_tbl_set_input_t, *phwrm_tfc_idx_tbl_set_input_t;
53032 
53033 /* hwrm_tfc_idx_tbl_set_output (size:128b/16B) */
53034 
53035 typedef struct hwrm_tfc_idx_tbl_set_output {
53036 	/* The specific error status for the command. */
53037 	uint16_t	error_code;
53038 	/* The HWRM command request type. */
53039 	uint16_t	req_type;
53040 	/* The sequence ID from the original command. */
53041 	uint16_t	seq_id;
53042 	/* The length of the response data in number of bytes. */
53043 	uint16_t	resp_len;
53044 	/* unused. */
53045 	uint8_t	unused0[7];
53046 	/*
53047 	 * This field is used in Output records to indicate that the output
53048 	 * is completely written to RAM. This field should be read as '1'
53049 	 * to indicate that the output has been completely written.
53050 	 * When writing a command completion or response to an internal
53051 	 * processor, the order of writes has to be such that this field
53052 	 * is written last.
53053 	 */
53054 	uint8_t	valid;
53055 } hwrm_tfc_idx_tbl_set_output_t, *phwrm_tfc_idx_tbl_set_output_t;
53056 
53057 /************************
53058  * hwrm_tfc_idx_tbl_get *
53059  ************************/
53060 
53061 
53062 /* hwrm_tfc_idx_tbl_get_input (size:256b/32B) */
53063 
53064 typedef struct hwrm_tfc_idx_tbl_get_input {
53065 	/* The HWRM command request type. */
53066 	uint16_t	req_type;
53067 	/*
53068 	 * The completion ring to send the completion event on. This should
53069 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53070 	 */
53071 	uint16_t	cmpl_ring;
53072 	/*
53073 	 * The sequence ID is used by the driver for tracking multiple
53074 	 * commands. This ID is treated as opaque data by the firmware and
53075 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53076 	 */
53077 	uint16_t	seq_id;
53078 	/*
53079 	 * The target ID of the command:
53080 	 * * 0x0-0xFFF8 - The function ID
53081 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53082 	 * * 0xFFFD - Reserved for user-space HWRM interface
53083 	 * * 0xFFFF - HWRM
53084 	 */
53085 	uint16_t	target_id;
53086 	/*
53087 	 * A physical address pointer pointing to a host buffer that the
53088 	 * command's response data will be written. This can be either a host
53089 	 * physical address (HPA) or a guest physical address (GPA) and must
53090 	 * point to a physically contiguous block of memory.
53091 	 */
53092 	uint64_t	resp_addr;
53093 	/* Control flags. */
53094 	uint8_t	flags;
53095 	/* Indicates the flow direction. */
53096 	#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
53097 	/* If this bit set to 0, then it indicates rx flow. */
53098 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
53099 	/* If this bit is set to 1, then it indicates tx flow. */
53100 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
53101 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_LAST	HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_TX
53102 	/*
53103 	 * When set use the special access register access to clear
53104 	 * the table entry on read.
53105 	 */
53106 	#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
53107 	/*
53108 	 * CFA resource subtype. For definitions, please see
53109 	 * cfa_v3/include/cfa_resources.h.
53110 	 */
53111 	uint8_t	subtype;
53112 	/*
53113 	 * Session id associated with the firmware. Will be used
53114 	 * for validation if the track type matches.
53115 	 */
53116 	uint16_t	sid;
53117 	/*
53118 	 * Index table index returned during alloc by the
53119 	 * firmware.
53120 	 */
53121 	uint16_t	idx_tbl_id;
53122 	/* The size of the index table entry buffer in bytes. */
53123 	uint16_t	buffer_size;
53124 	/* The location of the response dma buffer */
53125 	uint64_t	dma_addr;
53126 } hwrm_tfc_idx_tbl_get_input_t, *phwrm_tfc_idx_tbl_get_input_t;
53127 
53128 /* hwrm_tfc_idx_tbl_get_output (size:128b/16B) */
53129 
53130 typedef struct hwrm_tfc_idx_tbl_get_output {
53131 	/* The specific error status for the command. */
53132 	uint16_t	error_code;
53133 	/* The HWRM command request type. */
53134 	uint16_t	req_type;
53135 	/* The sequence ID from the original command. */
53136 	uint16_t	seq_id;
53137 	/* The length of the response data in number of bytes. */
53138 	uint16_t	resp_len;
53139 	/* The size of the index table buffer returned in device size bytes. */
53140 	uint16_t	data_size;
53141 	/* unused */
53142 	uint8_t	unused1[5];
53143 	/*
53144 	 * This field is used in Output records to indicate that the output
53145 	 * is completely written to RAM. This field should be read as '1'
53146 	 * to indicate that the output has been completely written.
53147 	 * When writing a command completion or response to an internal
53148 	 * processor, the order of writes has to be such that this field
53149 	 * is written last.
53150 	 */
53151 	uint8_t	valid;
53152 } hwrm_tfc_idx_tbl_get_output_t, *phwrm_tfc_idx_tbl_get_output_t;
53153 
53154 /*************************
53155  * hwrm_tfc_idx_tbl_free *
53156  *************************/
53157 
53158 
53159 /* hwrm_tfc_idx_tbl_free_input (size:192b/24B) */
53160 
53161 typedef struct hwrm_tfc_idx_tbl_free_input {
53162 	/* The HWRM command request type. */
53163 	uint16_t	req_type;
53164 	/*
53165 	 * The completion ring to send the completion event on. This should
53166 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53167 	 */
53168 	uint16_t	cmpl_ring;
53169 	/*
53170 	 * The sequence ID is used by the driver for tracking multiple
53171 	 * commands. This ID is treated as opaque data by the firmware and
53172 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53173 	 */
53174 	uint16_t	seq_id;
53175 	/*
53176 	 * The target ID of the command:
53177 	 * * 0x0-0xFFF8 - The function ID
53178 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53179 	 * * 0xFFFD - Reserved for user-space HWRM interface
53180 	 * * 0xFFFF - HWRM
53181 	 */
53182 	uint16_t	target_id;
53183 	/*
53184 	 * A physical address pointer pointing to a host buffer that the
53185 	 * command's response data will be written. This can be either a host
53186 	 * physical address (HPA) or a guest physical address (GPA) and must
53187 	 * point to a physically contiguous block of memory.
53188 	 */
53189 	uint64_t	resp_addr;
53190 	/* Control flags. */
53191 	uint8_t	flags;
53192 	/* Indicates the flow direction. */
53193 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
53194 	/* If this bit set to 0, then it indicates rx flow. */
53195 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53196 	/* If this bit is set to 1, then it indicates tx flow. */
53197 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53198 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_TX
53199 	/*
53200 	 * CFA resource subtype. For definitions, please see
53201 	 * cfa_v3/include/cfa_resources.h.
53202 	 */
53203 	uint8_t	subtype;
53204 	/*
53205 	 * Session id associated with the firmware. Will be used
53206 	 * for validation if the track type matches.
53207 	 */
53208 	uint16_t	sid;
53209 	/* Index table id to be freed by the firmware. */
53210 	uint16_t	idx_tbl_id;
53211 	/* Reserved */
53212 	uint8_t	unused0[2];
53213 } hwrm_tfc_idx_tbl_free_input_t, *phwrm_tfc_idx_tbl_free_input_t;
53214 
53215 /* hwrm_tfc_idx_tbl_free_output (size:128b/16B) */
53216 
53217 typedef struct hwrm_tfc_idx_tbl_free_output {
53218 	/* The specific error status for the command. */
53219 	uint16_t	error_code;
53220 	/* The HWRM command request type. */
53221 	uint16_t	req_type;
53222 	/* The sequence ID from the original command. */
53223 	uint16_t	seq_id;
53224 	/* The length of the response data in number of bytes. */
53225 	uint16_t	resp_len;
53226 	/* Reserved */
53227 	uint8_t	unused0[7];
53228 	/*
53229 	 * This field is used in Output records to indicate that the output
53230 	 * is completely written to RAM. This field should be read as '1'
53231 	 * to indicate that the output has been completely written.
53232 	 * When writing a command completion or response to an internal
53233 	 * processor, the order of writes has to be such that this field
53234 	 * is written last.
53235 	 */
53236 	uint8_t	valid;
53237 } hwrm_tfc_idx_tbl_free_output_t, *phwrm_tfc_idx_tbl_free_output_t;
53238 
53239 /* TruFlow resources request for a global id. */
53240 /* tfc_global_id_hwrm_req (size:64b/8B) */
53241 
53242 typedef struct tfc_global_id_hwrm_req {
53243 	/* Type of the resource, defined in enum cfa_resource_type HCAPI RM. */
53244 	uint16_t	rtype;
53245 	/* Indicates the flow direction in type of cfa_dir. */
53246 	uint16_t	dir;
53247 	/* Subtype of the resource type. */
53248 	uint16_t	subtype;
53249 	/* Number of the type of resources. */
53250 	uint16_t	cnt;
53251 } tfc_global_id_hwrm_req_t, *ptfc_global_id_hwrm_req_t;
53252 
53253 /* The reserved resources for the global id. */
53254 /* tfc_global_id_hwrm_rsp (size:64b/8B) */
53255 
53256 typedef struct tfc_global_id_hwrm_rsp {
53257 	/* Type of the resource, defined in enum cfa_resource_type HCAPI RM. */
53258 	uint16_t	rtype;
53259 	/* Indicates the flow direction in type of cfa_dir. */
53260 	uint16_t	dir;
53261 	/* Subtype of the resource type. */
53262 	uint16_t	subtype;
53263 	/* The global id that the resources reserved for. */
53264 	uint16_t	id;
53265 } tfc_global_id_hwrm_rsp_t, *ptfc_global_id_hwrm_rsp_t;
53266 
53267 /****************************
53268  * hwrm_tfc_global_id_alloc *
53269  ****************************/
53270 
53271 
53272 /* hwrm_tfc_global_id_alloc_input (size:320b/40B) */
53273 
53274 typedef struct hwrm_tfc_global_id_alloc_input {
53275 	/* The HWRM command request type. */
53276 	uint16_t	req_type;
53277 	/*
53278 	 * The completion ring to send the completion event on. This should
53279 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53280 	 */
53281 	uint16_t	cmpl_ring;
53282 	/*
53283 	 * The sequence ID is used by the driver for tracking multiple
53284 	 * commands. This ID is treated as opaque data by the firmware and
53285 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53286 	 */
53287 	uint16_t	seq_id;
53288 	/*
53289 	 * The target ID of the command:
53290 	 * * 0x0-0xFFF8 - The function ID
53291 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53292 	 * * 0xFFFD - Reserved for user-space HWRM interface
53293 	 * * 0xFFFF - HWRM
53294 	 */
53295 	uint16_t	target_id;
53296 	/*
53297 	 * A physical address pointer pointing to a host buffer that the
53298 	 * command's response data will be written. This can be either a host
53299 	 * physical address (HPA) or a guest physical address (GPA) and must
53300 	 * point to a physically contiguous block of memory.
53301 	 */
53302 	uint64_t	resp_addr;
53303 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
53304 	uint16_t	sid;
53305 	/* Global domain id. */
53306 	uint16_t	global_id;
53307 	/*
53308 	 * Defines the array size of the provided req_addr and
53309 	 * resv_addr array buffers. Should be set to the number of
53310 	 * request entries.
53311 	 */
53312 	uint16_t	req_cnt;
53313 	/* unused. */
53314 	uint8_t	unused0[2];
53315 	/*
53316 	 * This is the DMA address for the request input data array
53317 	 * buffer. Array is of tfc_global_id_hwrm_req type. Size of the
53318 	 * array buffer is provided by the 'req_cnt' field in this
53319 	 * message.
53320 	 */
53321 	uint64_t	req_addr;
53322 	/*
53323 	 * This is the DMA address for the resc output data array
53324 	 * buffer. Array is of tfc_global_id_hwrm_rsp type. Size of the array
53325 	 * buffer is provided by the 'req_cnt' field in this
53326 	 * message.
53327 	 */
53328 	uint64_t	resc_addr;
53329 } hwrm_tfc_global_id_alloc_input_t, *phwrm_tfc_global_id_alloc_input_t;
53330 
53331 /* hwrm_tfc_global_id_alloc_output (size:128b/16B) */
53332 
53333 typedef struct hwrm_tfc_global_id_alloc_output {
53334 	/* The specific error status for the command. */
53335 	uint16_t	error_code;
53336 	/* The HWRM command request type. */
53337 	uint16_t	req_type;
53338 	/* The sequence ID from the original command. */
53339 	uint16_t	seq_id;
53340 	/* The length of the response data in number of bytes. */
53341 	uint16_t	resp_len;
53342 	/*
53343 	 * Size of the returned hwrm_tfc_global_id_req data array. The value
53344 	 * cannot exceed the req_cnt defined by the input msg. The data
53345 	 * array is returned using the resv_addr specified DMA
53346 	 * address also provided by the input msg.
53347 	 */
53348 	uint16_t	rsp_cnt;
53349 	/* Non-zero if this is the first allocation for the global ID. */
53350 	uint8_t	first;
53351 	/* unused. */
53352 	uint8_t	unused0[4];
53353 	/*
53354 	 * This field is used in Output records to indicate that the output
53355 	 * is completely written to RAM. This field should be read as '1'
53356 	 * to indicate that the output has been completely written.
53357 	 * When writing a command completion or response to an internal
53358 	 * processor, the order of writes has to be such that this field
53359 	 * is written last.
53360 	 */
53361 	uint8_t	valid;
53362 } hwrm_tfc_global_id_alloc_output_t, *phwrm_tfc_global_id_alloc_output_t;
53363 
53364 /*********************
53365  * hwrm_tfc_tcam_set *
53366  *********************/
53367 
53368 
53369 /* hwrm_tfc_tcam_set_input (size:1088b/136B) */
53370 
53371 typedef struct hwrm_tfc_tcam_set_input {
53372 	/* The HWRM command request type. */
53373 	uint16_t	req_type;
53374 	/*
53375 	 * The completion ring to send the completion event on. This should
53376 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53377 	 */
53378 	uint16_t	cmpl_ring;
53379 	/*
53380 	 * The sequence ID is used by the driver for tracking multiple
53381 	 * commands. This ID is treated as opaque data by the firmware and
53382 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53383 	 */
53384 	uint16_t	seq_id;
53385 	/*
53386 	 * The target ID of the command:
53387 	 * * 0x0-0xFFF8 - The function ID
53388 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53389 	 * * 0xFFFD - Reserved for user-space HWRM interface
53390 	 * * 0xFFFF - HWRM
53391 	 */
53392 	uint16_t	target_id;
53393 	/*
53394 	 * A physical address pointer pointing to a host buffer that the
53395 	 * command's response data will be written. This can be either a host
53396 	 * physical address (HPA) or a guest physical address (GPA) and must
53397 	 * point to a physically contiguous block of memory.
53398 	 */
53399 	uint64_t	resp_addr;
53400 	/*
53401 	 * Session id associated with the firmware. Will be used
53402 	 * for validation if the track type matches.
53403 	 */
53404 	uint16_t	sid;
53405 	/* Logical TCAM ID. */
53406 	uint16_t	tcam_id;
53407 	/* Number of bytes in the TCAM key. */
53408 	uint16_t	key_size;
53409 	/* Number of bytes in the TCAM result. */
53410 	uint16_t	result_size;
53411 	/* Control flags. */
53412 	uint8_t	flags;
53413 	/* Indicates the flow direction. */
53414 	#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
53415 	/* If this bit set to 0, then it indicates rx flow. */
53416 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53417 	/* If this bit is set to 1, then it indicates tx flow. */
53418 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53419 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_TX
53420 	/* Indicate device data is being sent via DMA. */
53421 	#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
53422 	/*
53423 	 * Subtype of TCAM resource. See
53424 	 * cfa_v3/include/cfa_resources.h.
53425 	 */
53426 	uint8_t	subtype;
53427 	/* unused. */
53428 	uint8_t	unused0[6];
53429 	/* The location of the response dma buffer */
53430 	uint64_t	dma_addr;
53431 	/*
53432 	 * TCAM key located at offset 0, mask located at mask_offset
53433 	 * and result at result_offset for the device.
53434 	 */
53435 	uint8_t	dev_data[96];
53436 } hwrm_tfc_tcam_set_input_t, *phwrm_tfc_tcam_set_input_t;
53437 
53438 /* hwrm_tfc_tcam_set_output (size:128b/16B) */
53439 
53440 typedef struct hwrm_tfc_tcam_set_output {
53441 	/* The specific error status for the command. */
53442 	uint16_t	error_code;
53443 	/* The HWRM command request type. */
53444 	uint16_t	req_type;
53445 	/* The sequence ID from the original command. */
53446 	uint16_t	seq_id;
53447 	/* The length of the response data in number of bytes. */
53448 	uint16_t	resp_len;
53449 	/* unused. */
53450 	uint8_t	unused0[7];
53451 	/*
53452 	 * This field is used in Output records to indicate that the
53453 	 * output is completely written to RAM. This field should be
53454 	 * read as '1' to indicate that the output has been
53455 	 * completely written.  When writing a command completion or
53456 	 * response to an internal processor, the order of writes has
53457 	 * to be such that this field is written last.
53458 	 */
53459 	uint8_t	valid;
53460 } hwrm_tfc_tcam_set_output_t, *phwrm_tfc_tcam_set_output_t;
53461 
53462 /*********************
53463  * hwrm_tfc_tcam_get *
53464  *********************/
53465 
53466 
53467 /* hwrm_tfc_tcam_get_input (size:192b/24B) */
53468 
53469 typedef struct hwrm_tfc_tcam_get_input {
53470 	/* The HWRM command request type. */
53471 	uint16_t	req_type;
53472 	/*
53473 	 * The completion ring to send the completion event on. This should
53474 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53475 	 */
53476 	uint16_t	cmpl_ring;
53477 	/*
53478 	 * The sequence ID is used by the driver for tracking multiple
53479 	 * commands. This ID is treated as opaque data by the firmware and
53480 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53481 	 */
53482 	uint16_t	seq_id;
53483 	/*
53484 	 * The target ID of the command:
53485 	 * * 0x0-0xFFF8 - The function ID
53486 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53487 	 * * 0xFFFD - Reserved for user-space HWRM interface
53488 	 * * 0xFFFF - HWRM
53489 	 */
53490 	uint16_t	target_id;
53491 	/*
53492 	 * A physical address pointer pointing to a host buffer that the
53493 	 * command's response data will be written. This can be either a host
53494 	 * physical address (HPA) or a guest physical address (GPA) and must
53495 	 * point to a physically contiguous block of memory.
53496 	 */
53497 	uint64_t	resp_addr;
53498 	/* Control flags. */
53499 	uint8_t	flags;
53500 	/* Indicates the flow direction. */
53501 	#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
53502 	/* If this bit set to 0, then it indicates rx flow. */
53503 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53504 	/* If this bit is set to 1, then it indicates tx flow. */
53505 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53506 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_TX
53507 	/*
53508 	 * Subtype of TCAM resource See
53509 	 * cfa_v3/include/cfa_resources.h.
53510 	 */
53511 	uint8_t	subtype;
53512 	/*
53513 	 * Session id associated with the firmware. Will be used
53514 	 * for validation if the track type matches.
53515 	 */
53516 	uint16_t	sid;
53517 	/* Logical TCAM ID. */
53518 	uint16_t	tcam_id;
53519 	/* unused. */
53520 	uint8_t	unused0[2];
53521 } hwrm_tfc_tcam_get_input_t, *phwrm_tfc_tcam_get_input_t;
53522 
53523 /* hwrm_tfc_tcam_get_output (size:2368b/296B) */
53524 
53525 typedef struct hwrm_tfc_tcam_get_output {
53526 	/* The specific error status for the command. */
53527 	uint16_t	error_code;
53528 	/* The HWRM command request type. */
53529 	uint16_t	req_type;
53530 	/* The sequence ID from the original command. */
53531 	uint16_t	seq_id;
53532 	/* The length of the response data in number of bytes. */
53533 	uint16_t	resp_len;
53534 	/* Number of bytes in the TCAM key. */
53535 	uint16_t	key_size;
53536 	/* Number of bytes in the TCAM result. */
53537 	uint16_t	result_size;
53538 	/* unused. */
53539 	uint8_t	unused0[4];
53540 	/*
53541 	 * TCAM key located at offset 0, mask located at key_size
53542 	 * and result at 2 * key_size for the device.
53543 	 */
53544 	uint8_t	dev_data[272];
53545 	/* unused. */
53546 	uint8_t	unused1[7];
53547 	/*
53548 	 * This field is used in Output records to indicate that the
53549 	 * output is completely written to RAM. This field should be
53550 	 * read as '1' to indicate that the output has been
53551 	 * completely written.  When writing a command completion or
53552 	 * response to an internal processor, the order of writes has
53553 	 * to be such that this field is written last.
53554 	 */
53555 	uint8_t	valid;
53556 } hwrm_tfc_tcam_get_output_t, *phwrm_tfc_tcam_get_output_t;
53557 
53558 /***********************
53559  * hwrm_tfc_tcam_alloc *
53560  ***********************/
53561 
53562 
53563 /* hwrm_tfc_tcam_alloc_input (size:256b/32B) */
53564 
53565 typedef struct hwrm_tfc_tcam_alloc_input {
53566 	/* The HWRM command request type. */
53567 	uint16_t	req_type;
53568 	/*
53569 	 * The completion ring to send the completion event on. This should
53570 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53571 	 */
53572 	uint16_t	cmpl_ring;
53573 	/*
53574 	 * The sequence ID is used by the driver for tracking multiple
53575 	 * commands. This ID is treated as opaque data by the firmware and
53576 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53577 	 */
53578 	uint16_t	seq_id;
53579 	/*
53580 	 * The target ID of the command:
53581 	 * * 0x0-0xFFF8 - The function ID
53582 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53583 	 * * 0xFFFD - Reserved for user-space HWRM interface
53584 	 * * 0xFFFF - HWRM
53585 	 */
53586 	uint16_t	target_id;
53587 	/*
53588 	 * A physical address pointer pointing to a host buffer that the
53589 	 * command's response data will be written. This can be either a host
53590 	 * physical address (HPA) or a guest physical address (GPA) and must
53591 	 * point to a physically contiguous block of memory.
53592 	 */
53593 	uint64_t	resp_addr;
53594 	/* Control flags. */
53595 	uint8_t	flags;
53596 	/* Indicates the flow direction. */
53597 	#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
53598 	/* If this bit set to 0, then it indicates rx flow. */
53599 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53600 	/* If this bit is set to 1, then it indicates tx flow. */
53601 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53602 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_TX
53603 	/*
53604 	 * Subtype of TCAM resource. See
53605 	 * cfa_v3/include/cfa_resources.h.
53606 	 */
53607 	uint8_t	subtype;
53608 	/*
53609 	 * Unique session id for the session created by the
53610 	 * firmware. Will be used to track this index table entry
53611 	 * only if track type is track_type_sid.
53612 	 */
53613 	uint16_t	sid;
53614 	/* Number of bytes in the TCAM key. */
53615 	uint16_t	key_size;
53616 	/* Entry priority. */
53617 	uint16_t	priority;
53618 	/* Describes the type of tracking id to be used */
53619 	uint8_t	track_type;
53620 	/* Invalid track type */
53621 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
53622 	/* Tracked by session id */
53623 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
53624 	/* Tracked by function id */
53625 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
53626 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
53627 	/* Unused. */
53628 	uint8_t	unused0[7];
53629 } hwrm_tfc_tcam_alloc_input_t, *phwrm_tfc_tcam_alloc_input_t;
53630 
53631 /* hwrm_tfc_tcam_alloc_output (size:128b/16B) */
53632 
53633 typedef struct hwrm_tfc_tcam_alloc_output {
53634 	/* The specific error status for the command. */
53635 	uint16_t	error_code;
53636 	/* The HWRM command request type. */
53637 	uint16_t	req_type;
53638 	/* The sequence ID from the original command. */
53639 	uint16_t	seq_id;
53640 	/* The length of the response data in number of bytes. */
53641 	uint16_t	resp_len;
53642 	/*
53643 	 * Index table entry allocated by the firmware using the
53644 	 * parameters above.
53645 	 */
53646 	uint16_t	idx;
53647 	/* Reserved */
53648 	uint8_t	unused0[5];
53649 	/*
53650 	 * This field is used in Output records to indicate that the output
53651 	 * is completely written to RAM. This field should be read as '1'
53652 	 * to indicate that the output has been completely written.
53653 	 * When writing a command completion or response to an internal
53654 	 * processor, the order of writes has to be such that this field
53655 	 * is written last.
53656 	 */
53657 	uint8_t	valid;
53658 } hwrm_tfc_tcam_alloc_output_t, *phwrm_tfc_tcam_alloc_output_t;
53659 
53660 /***************************
53661  * hwrm_tfc_tcam_alloc_set *
53662  ***************************/
53663 
53664 
53665 /* hwrm_tfc_tcam_alloc_set_input (size:1088b/136B) */
53666 
53667 typedef struct hwrm_tfc_tcam_alloc_set_input {
53668 	/* The HWRM command request type. */
53669 	uint16_t	req_type;
53670 	/*
53671 	 * The completion ring to send the completion event on. This should
53672 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53673 	 */
53674 	uint16_t	cmpl_ring;
53675 	/*
53676 	 * The sequence ID is used by the driver for tracking multiple
53677 	 * commands. This ID is treated as opaque data by the firmware and
53678 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53679 	 */
53680 	uint16_t	seq_id;
53681 	/*
53682 	 * The target ID of the command:
53683 	 * * 0x0-0xFFF8 - The function ID
53684 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53685 	 * * 0xFFFD - Reserved for user-space HWRM interface
53686 	 * * 0xFFFF - HWRM
53687 	 */
53688 	uint16_t	target_id;
53689 	/*
53690 	 * A physical address pointer pointing to a host buffer that the
53691 	 * command's response data will be written. This can be either a host
53692 	 * physical address (HPA) or a guest physical address (GPA) and must
53693 	 * point to a physically contiguous block of memory.
53694 	 */
53695 	uint64_t	resp_addr;
53696 	/* Control flags. */
53697 	uint8_t	flags;
53698 	/* Indicates the flow direction. */
53699 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
53700 	/* If this bit set to 0, then it indicates rx flow. */
53701 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53702 	/* If this bit is set to 1, then it indicates tx flow. */
53703 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53704 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_TX
53705 	/* Indicate device data is being sent via DMA. */
53706 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
53707 	/*
53708 	 * Subtype of TCAM resource. See
53709 	 * cfa_v3/include/cfa_resources.h.
53710 	 */
53711 	uint8_t	subtype;
53712 	/*
53713 	 * Unique session id for the session created by the
53714 	 * firmware. Will be used to track this index table entry
53715 	 * only if track type is track_type_sid.
53716 	 */
53717 	uint16_t	sid;
53718 	/* Number of bytes in the TCAM key. */
53719 	uint16_t	key_size;
53720 	/* The size of the TCAM table entry in bytes. */
53721 	uint16_t	result_size;
53722 	/* Entry priority. */
53723 	uint16_t	priority;
53724 	/* Describes the type of tracking id to be used */
53725 	uint8_t	track_type;
53726 	/* Invalid track type */
53727 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
53728 	/* Tracked by session id */
53729 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
53730 	/* Tracked by function id */
53731 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
53732 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_LAST		HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID
53733 	/* Unused */
53734 	uint8_t	unused[5];
53735 	/* The location of the response dma buffer */
53736 	uint64_t	dma_addr;
53737 	/*
53738 	 * Index table data located at offset 0.  If dma bit is set,
53739 	 * then this field contains the DMA buffer pointer.
53740 	 */
53741 	uint8_t	dev_data[96];
53742 } hwrm_tfc_tcam_alloc_set_input_t, *phwrm_tfc_tcam_alloc_set_input_t;
53743 
53744 /* hwrm_tfc_tcam_alloc_set_output (size:128b/16B) */
53745 
53746 typedef struct hwrm_tfc_tcam_alloc_set_output {
53747 	/* The specific error status for the command. */
53748 	uint16_t	error_code;
53749 	/* The HWRM command request type. */
53750 	uint16_t	req_type;
53751 	/* The sequence ID from the original command. */
53752 	uint16_t	seq_id;
53753 	/* The length of the response data in number of bytes. */
53754 	uint16_t	resp_len;
53755 	/* Logical TCAM ID. */
53756 	uint16_t	tcam_id;
53757 	/* Reserved */
53758 	uint8_t	unused0[5];
53759 	/*
53760 	 * This field is used in Output records to indicate that the output
53761 	 * is completely written to RAM. This field should be read as '1'
53762 	 * to indicate that the output has been completely written.
53763 	 * When writing a command completion or response to an internal
53764 	 * processor, the order of writes has to be such that this field
53765 	 * is written last.
53766 	 */
53767 	uint8_t	valid;
53768 } hwrm_tfc_tcam_alloc_set_output_t, *phwrm_tfc_tcam_alloc_set_output_t;
53769 
53770 /**********************
53771  * hwrm_tfc_tcam_free *
53772  **********************/
53773 
53774 
53775 /* hwrm_tfc_tcam_free_input (size:192b/24B) */
53776 
53777 typedef struct hwrm_tfc_tcam_free_input {
53778 	/* The HWRM command request type. */
53779 	uint16_t	req_type;
53780 	/*
53781 	 * The completion ring to send the completion event on. This should
53782 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53783 	 */
53784 	uint16_t	cmpl_ring;
53785 	/*
53786 	 * The sequence ID is used by the driver for tracking multiple
53787 	 * commands. This ID is treated as opaque data by the firmware and
53788 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53789 	 */
53790 	uint16_t	seq_id;
53791 	/*
53792 	 * The target ID of the command:
53793 	 * * 0x0-0xFFF8 - The function ID
53794 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53795 	 * * 0xFFFD - Reserved for user-space HWRM interface
53796 	 * * 0xFFFF - HWRM
53797 	 */
53798 	uint16_t	target_id;
53799 	/*
53800 	 * A physical address pointer pointing to a host buffer that the
53801 	 * command's response data will be written. This can be either a host
53802 	 * physical address (HPA) or a guest physical address (GPA) and must
53803 	 * point to a physically contiguous block of memory.
53804 	 */
53805 	uint64_t	resp_addr;
53806 	/* Control flags. */
53807 	uint8_t	flags;
53808 	/* Indicates the flow direction. */
53809 	#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
53810 	/* If this bit set to 0, then it indicates rx flow. */
53811 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
53812 	/* If this bit is set to 1, then it indicates tx flow. */
53813 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
53814 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_TX
53815 	/*
53816 	 * Subtype of TCAM resource. See
53817 	 * cfa_v3/include/cfa_resources.h.
53818 	 */
53819 	uint8_t	subtype;
53820 	/*
53821 	 * Session id associated with the firmware. Will be used
53822 	 * for validation if the track type matches.
53823 	 */
53824 	uint16_t	sid;
53825 	/* Logical TCAM ID. */
53826 	uint16_t	tcam_id;
53827 	/* Reserved */
53828 	uint8_t	unused0[2];
53829 } hwrm_tfc_tcam_free_input_t, *phwrm_tfc_tcam_free_input_t;
53830 
53831 /* hwrm_tfc_tcam_free_output (size:128b/16B) */
53832 
53833 typedef struct hwrm_tfc_tcam_free_output {
53834 	/* The specific error status for the command. */
53835 	uint16_t	error_code;
53836 	/* The HWRM command request type. */
53837 	uint16_t	req_type;
53838 	/* The sequence ID from the original command. */
53839 	uint16_t	seq_id;
53840 	/* The length of the response data in number of bytes. */
53841 	uint16_t	resp_len;
53842 	/* Reserved */
53843 	uint8_t	unused0[7];
53844 	/*
53845 	 * This field is used in Output records to indicate that the output
53846 	 * is completely written to RAM. This field should be read as '1'
53847 	 * to indicate that the output has been completely written.
53848 	 * When writing a command completion or response to an internal
53849 	 * processor, the order of writes has to be such that this field
53850 	 * is written last.
53851 	 */
53852 	uint8_t	valid;
53853 } hwrm_tfc_tcam_free_output_t, *phwrm_tfc_tcam_free_output_t;
53854 
53855 /******************************
53856  * hwrm_tunnel_dst_port_query *
53857  ******************************/
53858 
53859 
53860 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
53861 
53862 typedef struct hwrm_tunnel_dst_port_query_input {
53863 	/* The HWRM command request type. */
53864 	uint16_t	req_type;
53865 	/*
53866 	 * The completion ring to send the completion event on. This should
53867 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53868 	 */
53869 	uint16_t	cmpl_ring;
53870 	/*
53871 	 * The sequence ID is used by the driver for tracking multiple
53872 	 * commands. This ID is treated as opaque data by the firmware and
53873 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53874 	 */
53875 	uint16_t	seq_id;
53876 	/*
53877 	 * The target ID of the command:
53878 	 * * 0x0-0xFFF8 - The function ID
53879 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53880 	 * * 0xFFFD - Reserved for user-space HWRM interface
53881 	 * * 0xFFFF - HWRM
53882 	 */
53883 	uint16_t	target_id;
53884 	/*
53885 	 * A physical address pointer pointing to a host buffer that the
53886 	 * command's response data will be written. This can be either a host
53887 	 * physical address (HPA) or a guest physical address (GPA) and must
53888 	 * point to a physically contiguous block of memory.
53889 	 */
53890 	uint64_t	resp_addr;
53891 	/* Tunnel Type. */
53892 	uint8_t	tunnel_type;
53893 	/* Virtual eXtensible Local Area Network (VXLAN) */
53894 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
53895 	/* Generic Network Virtualization Encapsulation (Geneve) */
53896 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
53897 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
53898 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
53899 	/* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
53900 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
53901 	/* Use fixed layer 2 ether type of 0xFFFF */
53902 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
53903 	/* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
53904 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
53905 	/* Custom GRE uses UPAR to parse customized GRE packets */
53906 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_CUSTOM_GRE   UINT32_C(0xd)
53907 	/* Enhanced Common Packet Radio Interface (eCPRI) */
53908 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ECPRI	UINT32_C(0xe)
53909 	/* IPv6 Segment Routing (SRv6) */
53910 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_SRV6	UINT32_C(0xf)
53911 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
53912 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
53913 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST	HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE
53914 	uint8_t	unused_0[7];
53915 } hwrm_tunnel_dst_port_query_input_t, *phwrm_tunnel_dst_port_query_input_t;
53916 
53917 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
53918 
53919 typedef struct hwrm_tunnel_dst_port_query_output {
53920 	/* The specific error status for the command. */
53921 	uint16_t	error_code;
53922 	/* The HWRM command request type. */
53923 	uint16_t	req_type;
53924 	/* The sequence ID from the original command. */
53925 	uint16_t	seq_id;
53926 	/* The length of the response data in number of bytes. */
53927 	uint16_t	resp_len;
53928 	/*
53929 	 * This field represents the identifier of L4 destination port
53930 	 * used for the given tunnel type. This field is valid for
53931 	 * specific tunnel types that use layer 4 (e.g. UDP)
53932 	 * transports for tunneling.
53933 	 */
53934 	uint16_t	tunnel_dst_port_id;
53935 	/*
53936 	 * This field represents the value of L4 destination port
53937 	 * identified by tunnel_dst_port_id. This field is valid for
53938 	 * specific tunnel types that use layer 4 (e.g. UDP)
53939 	 * transports for tunneling.
53940 	 * This field is in network byte order.
53941 	 *
53942 	 * A value of 0 means that the destination port is not
53943 	 * configured.
53944 	 */
53945 	uint16_t	tunnel_dst_port_val;
53946 	/*
53947 	 * This field represents the UPAR usage status.
53948 	 * Available UPARs on wh+ are UPAR0 and UPAR1
53949 	 * Available UPARs on Thor are UPAR0 to UPAR3
53950 	 * Available UPARs on Thor2 are UPAR0 to UPAR7
53951 	 */
53952 	uint8_t	upar_in_use;
53953 	/* This bit will be '1' when UPAR0 is IN_USE */
53954 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR0	UINT32_C(0x1)
53955 	/* This bit will be '1' when UPAR1 is IN_USE */
53956 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR1	UINT32_C(0x2)
53957 	/* This bit will be '1' when UPAR2 is IN_USE */
53958 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR2	UINT32_C(0x4)
53959 	/* This bit will be '1' when UPAR3 is IN_USE */
53960 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR3	UINT32_C(0x8)
53961 	/* This bit will be '1' when UPAR4 is IN_USE */
53962 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR4	UINT32_C(0x10)
53963 	/* This bit will be '1' when UPAR5 is IN_USE */
53964 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR5	UINT32_C(0x20)
53965 	/* This bit will be '1' when UPAR6 is IN_USE */
53966 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR6	UINT32_C(0x40)
53967 	/* This bit will be '1' when UPAR7 is IN_USE */
53968 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR7	UINT32_C(0x80)
53969 	uint8_t	unused_0[2];
53970 	/*
53971 	 * This field is used in Output records to indicate that the output
53972 	 * is completely written to RAM.  This field should be read as '1'
53973 	 * to indicate that the output has been completely written.
53974 	 * When writing a command completion or response to an internal processor,
53975 	 * the order of writes has to be such that this field is written last.
53976 	 */
53977 	uint8_t	valid;
53978 } hwrm_tunnel_dst_port_query_output_t, *phwrm_tunnel_dst_port_query_output_t;
53979 
53980 /******************************
53981  * hwrm_tunnel_dst_port_alloc *
53982  ******************************/
53983 
53984 
53985 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
53986 
53987 typedef struct hwrm_tunnel_dst_port_alloc_input {
53988 	/* The HWRM command request type. */
53989 	uint16_t	req_type;
53990 	/*
53991 	 * The completion ring to send the completion event on. This should
53992 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53993 	 */
53994 	uint16_t	cmpl_ring;
53995 	/*
53996 	 * The sequence ID is used by the driver for tracking multiple
53997 	 * commands. This ID is treated as opaque data by the firmware and
53998 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53999 	 */
54000 	uint16_t	seq_id;
54001 	/*
54002 	 * The target ID of the command:
54003 	 * * 0x0-0xFFF8 - The function ID
54004 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54005 	 * * 0xFFFD - Reserved for user-space HWRM interface
54006 	 * * 0xFFFF - HWRM
54007 	 */
54008 	uint16_t	target_id;
54009 	/*
54010 	 * A physical address pointer pointing to a host buffer that the
54011 	 * command's response data will be written. This can be either a host
54012 	 * physical address (HPA) or a guest physical address (GPA) and must
54013 	 * point to a physically contiguous block of memory.
54014 	 */
54015 	uint64_t	resp_addr;
54016 	/* Tunnel Type. */
54017 	uint8_t	tunnel_type;
54018 	/* Virtual eXtensible Local Area Network (VXLAN) */
54019 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
54020 	/* Generic Network Virtualization Encapsulation (Geneve) */
54021 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
54022 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
54023 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
54024 	/* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
54025 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
54026 	/* Use fixed layer 2 ether type of 0xFFFF */
54027 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
54028 	/* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
54029 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
54030 	/* Custom GRE uses UPAR to parse customized GRE packets. This is not supported. */
54031 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_CUSTOM_GRE   UINT32_C(0xd)
54032 	/* Enhanced Common Packet Radio Interface (eCPRI) */
54033 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ECPRI	UINT32_C(0xe)
54034 	/* IPv6 Segment Routing (SRv6) */
54035 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_SRV6	UINT32_C(0xf)
54036 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
54037 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
54038 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE
54039 	uint8_t	unused_0;
54040 	/*
54041 	 * This field represents the value of L4 destination port used
54042 	 * for the given tunnel type. This field is valid for
54043 	 * specific tunnel types that use layer 4 (e.g. UDP)
54044 	 * transports for tunneling.
54045 	 *
54046 	 * This field is in network byte order.
54047 	 *
54048 	 * A value of 0 shall fail the command.
54049 	 */
54050 	uint16_t	tunnel_dst_port_val;
54051 	uint8_t	unused_1[4];
54052 } hwrm_tunnel_dst_port_alloc_input_t, *phwrm_tunnel_dst_port_alloc_input_t;
54053 
54054 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
54055 
54056 typedef struct hwrm_tunnel_dst_port_alloc_output {
54057 	/* The specific error status for the command. */
54058 	uint16_t	error_code;
54059 	/* The HWRM command request type. */
54060 	uint16_t	req_type;
54061 	/* The sequence ID from the original command. */
54062 	uint16_t	seq_id;
54063 	/* The length of the response data in number of bytes. */
54064 	uint16_t	resp_len;
54065 	/*
54066 	 * Identifier of a tunnel L4 destination port value. Only applies to tunnel
54067 	 * types that has l4 destination port parameters.
54068 	 */
54069 	uint16_t	tunnel_dst_port_id;
54070 	/* Error information */
54071 	uint8_t	error_info;
54072 	/* No error */
54073 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_SUCCESS	UINT32_C(0x0)
54074 	/* Tunnel port is already allocated */
54075 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED   UINT32_C(0x1)
54076 	/* Out of resources error */
54077 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_NO_RESOURCE UINT32_C(0x2)
54078 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_LAST	HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_NO_RESOURCE
54079 	/*
54080 	 * This field represents the UPAR usage status.
54081 	 * Available UPARs on wh+ are UPAR0 and UPAR1
54082 	 * Available UPARs on Thor are UPAR0 to UPAR3
54083 	 * Available UPARs on Thor2 are UPAR0 to UPAR7
54084 	 */
54085 	uint8_t	upar_in_use;
54086 	/* This bit will be '1' when UPAR0 is IN_USE */
54087 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR0	UINT32_C(0x1)
54088 	/* This bit will be '1' when UPAR1 is IN_USE */
54089 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR1	UINT32_C(0x2)
54090 	/* This bit will be '1' when UPAR2 is IN_USE */
54091 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR2	UINT32_C(0x4)
54092 	/* This bit will be '1' when UPAR3 is IN_USE */
54093 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR3	UINT32_C(0x8)
54094 	/* This bit will be '1' when UPAR4 is IN_USE */
54095 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR4	UINT32_C(0x10)
54096 	/* This bit will be '1' when UPAR5 is IN_USE */
54097 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR5	UINT32_C(0x20)
54098 	/* This bit will be '1' when UPAR6 is IN_USE */
54099 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR6	UINT32_C(0x40)
54100 	/* This bit will be '1' when UPAR7 is IN_USE */
54101 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR7	UINT32_C(0x80)
54102 	uint8_t	unused_0[3];
54103 	/*
54104 	 * This field is used in Output records to indicate that the output
54105 	 * is completely written to RAM.  This field should be read as '1'
54106 	 * to indicate that the output has been completely written.
54107 	 * When writing a command completion or response to an internal processor,
54108 	 * the order of writes has to be such that this field is written last.
54109 	 */
54110 	uint8_t	valid;
54111 } hwrm_tunnel_dst_port_alloc_output_t, *phwrm_tunnel_dst_port_alloc_output_t;
54112 
54113 /*****************************
54114  * hwrm_tunnel_dst_port_free *
54115  *****************************/
54116 
54117 
54118 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
54119 
54120 typedef struct hwrm_tunnel_dst_port_free_input {
54121 	/* The HWRM command request type. */
54122 	uint16_t	req_type;
54123 	/*
54124 	 * The completion ring to send the completion event on. This should
54125 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54126 	 */
54127 	uint16_t	cmpl_ring;
54128 	/*
54129 	 * The sequence ID is used by the driver for tracking multiple
54130 	 * commands. This ID is treated as opaque data by the firmware and
54131 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54132 	 */
54133 	uint16_t	seq_id;
54134 	/*
54135 	 * The target ID of the command:
54136 	 * * 0x0-0xFFF8 - The function ID
54137 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54138 	 * * 0xFFFD - Reserved for user-space HWRM interface
54139 	 * * 0xFFFF - HWRM
54140 	 */
54141 	uint16_t	target_id;
54142 	/*
54143 	 * A physical address pointer pointing to a host buffer that the
54144 	 * command's response data will be written. This can be either a host
54145 	 * physical address (HPA) or a guest physical address (GPA) and must
54146 	 * point to a physically contiguous block of memory.
54147 	 */
54148 	uint64_t	resp_addr;
54149 	/* Tunnel Type. */
54150 	uint8_t	tunnel_type;
54151 	/* Virtual eXtensible Local Area Network (VXLAN) */
54152 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
54153 	/* Generic Network Virtualization Encapsulation (Geneve) */
54154 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
54155 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
54156 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
54157 	/* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
54158 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
54159 	/* Use fixed layer 2 ether type of 0xFFFF */
54160 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
54161 	/* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
54162 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
54163 	/* Custom GRE uses UPAR to parse customized GRE packets. This is not supported. */
54164 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_CUSTOM_GRE   UINT32_C(0xd)
54165 	/* Enhanced Common Packet Radio Interface (eCPRI) */
54166 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ECPRI	UINT32_C(0xe)
54167 	/* IPv6 Segment Routing (SRv6) */
54168 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_SRV6	UINT32_C(0xf)
54169 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
54170 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
54171 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST	HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE
54172 	uint8_t	unused_0;
54173 	/*
54174 	 * Identifier of a tunnel L4 destination port value. Only applies to tunnel
54175 	 * types that has l4 destination port parameters.
54176 	 */
54177 	uint16_t	tunnel_dst_port_id;
54178 	uint8_t	unused_1[4];
54179 } hwrm_tunnel_dst_port_free_input_t, *phwrm_tunnel_dst_port_free_input_t;
54180 
54181 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
54182 
54183 typedef struct hwrm_tunnel_dst_port_free_output {
54184 	/* The specific error status for the command. */
54185 	uint16_t	error_code;
54186 	/* The HWRM command request type. */
54187 	uint16_t	req_type;
54188 	/* The sequence ID from the original command. */
54189 	uint16_t	seq_id;
54190 	/* The length of the response data in number of bytes. */
54191 	uint16_t	resp_len;
54192 	/* Error information */
54193 	uint8_t	error_info;
54194 	/* No error */
54195 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_SUCCESS	UINT32_C(0x0)
54196 	/* Not owner error */
54197 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_OWNER	UINT32_C(0x1)
54198 	/* Not allocated error */
54199 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_ALLOCATED UINT32_C(0x2)
54200 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_LAST		HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_ALLOCATED
54201 	uint8_t	unused_1[6];
54202 	/*
54203 	 * This field is used in Output records to indicate that the output
54204 	 * is completely written to RAM.  This field should be read as '1'
54205 	 * to indicate that the output has been completely written.
54206 	 * When writing a command completion or response to an internal processor,
54207 	 * the order of writes has to be such that this field is written last.
54208 	 */
54209 	uint8_t	valid;
54210 } hwrm_tunnel_dst_port_free_output_t, *phwrm_tunnel_dst_port_free_output_t;
54211 
54212 /* Periodic statistics context DMA to host. */
54213 /* ctx_hw_stats (size:1280b/160B) */
54214 
54215 typedef struct ctx_hw_stats {
54216 	/* Number of received unicast packets */
54217 	uint64_t	rx_ucast_pkts;
54218 	/* Number of received multicast packets */
54219 	uint64_t	rx_mcast_pkts;
54220 	/* Number of received broadcast packets */
54221 	uint64_t	rx_bcast_pkts;
54222 	/* Number of discarded packets on receive path */
54223 	uint64_t	rx_discard_pkts;
54224 	/* Number of packets on receive path with error */
54225 	uint64_t	rx_error_pkts;
54226 	/* Number of received bytes for unicast traffic */
54227 	uint64_t	rx_ucast_bytes;
54228 	/* Number of received bytes for multicast traffic */
54229 	uint64_t	rx_mcast_bytes;
54230 	/* Number of received bytes for broadcast traffic */
54231 	uint64_t	rx_bcast_bytes;
54232 	/* Number of transmitted unicast packets */
54233 	uint64_t	tx_ucast_pkts;
54234 	/* Number of transmitted multicast packets */
54235 	uint64_t	tx_mcast_pkts;
54236 	/* Number of transmitted broadcast packets */
54237 	uint64_t	tx_bcast_pkts;
54238 	/* Number of packets on transmit path with error */
54239 	uint64_t	tx_error_pkts;
54240 	/* Number of discarded packets on transmit path */
54241 	uint64_t	tx_discard_pkts;
54242 	/* Number of transmitted bytes for unicast traffic */
54243 	uint64_t	tx_ucast_bytes;
54244 	/* Number of transmitted bytes for multicast traffic */
54245 	uint64_t	tx_mcast_bytes;
54246 	/* Number of transmitted bytes for broadcast traffic */
54247 	uint64_t	tx_bcast_bytes;
54248 	/* Number of TPA packets */
54249 	uint64_t	tpa_pkts;
54250 	/* Number of TPA bytes */
54251 	uint64_t	tpa_bytes;
54252 	/* Number of TPA events */
54253 	uint64_t	tpa_events;
54254 	/* Number of TPA aborts */
54255 	uint64_t	tpa_aborts;
54256 } ctx_hw_stats_t, *pctx_hw_stats_t;
54257 
54258 /*
54259  * Extended periodic statistics context DMA to host. On cards that
54260  * support TPA v2, additional TPA related stats exist and can be retrieved
54261  * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
54262  */
54263 /* ctx_hw_stats_ext (size:1408b/176B) */
54264 
54265 typedef struct ctx_hw_stats_ext {
54266 	/* Number of received unicast packets */
54267 	uint64_t	rx_ucast_pkts;
54268 	/* Number of received multicast packets */
54269 	uint64_t	rx_mcast_pkts;
54270 	/* Number of received broadcast packets */
54271 	uint64_t	rx_bcast_pkts;
54272 	/* Number of discarded packets on receive path */
54273 	uint64_t	rx_discard_pkts;
54274 	/* Number of packets on receive path with error */
54275 	uint64_t	rx_error_pkts;
54276 	/* Number of received bytes for unicast traffic */
54277 	uint64_t	rx_ucast_bytes;
54278 	/* Number of received bytes for multicast traffic */
54279 	uint64_t	rx_mcast_bytes;
54280 	/* Number of received bytes for broadcast traffic */
54281 	uint64_t	rx_bcast_bytes;
54282 	/* Number of transmitted unicast packets */
54283 	uint64_t	tx_ucast_pkts;
54284 	/* Number of transmitted multicast packets */
54285 	uint64_t	tx_mcast_pkts;
54286 	/* Number of transmitted broadcast packets */
54287 	uint64_t	tx_bcast_pkts;
54288 	/* Number of packets on transmit path with error */
54289 	uint64_t	tx_error_pkts;
54290 	/* Number of discarded packets on transmit path */
54291 	uint64_t	tx_discard_pkts;
54292 	/* Number of transmitted bytes for unicast traffic */
54293 	uint64_t	tx_ucast_bytes;
54294 	/* Number of transmitted bytes for multicast traffic */
54295 	uint64_t	tx_mcast_bytes;
54296 	/* Number of transmitted bytes for broadcast traffic */
54297 	uint64_t	tx_bcast_bytes;
54298 	/* Number of TPA eligible packets */
54299 	uint64_t	rx_tpa_eligible_pkt;
54300 	/* Number of TPA eligible bytes */
54301 	uint64_t	rx_tpa_eligible_bytes;
54302 	/* Number of TPA packets */
54303 	uint64_t	rx_tpa_pkt;
54304 	/* Number of TPA bytes */
54305 	uint64_t	rx_tpa_bytes;
54306 	/* Number of TPA errors */
54307 	uint64_t	rx_tpa_errors;
54308 	/* Number of TPA events */
54309 	uint64_t	rx_tpa_events;
54310 } ctx_hw_stats_ext_t, *pctx_hw_stats_ext_t;
54311 
54312 /* Periodic Engine statistics context DMA to host. */
54313 /* ctx_eng_stats (size:512b/64B) */
54314 
54315 typedef struct ctx_eng_stats {
54316 	/*
54317 	 * Count of data bytes into the Engine.
54318 	 * This includes any user supplied prefix,
54319 	 * but does not include any predefined
54320 	 * prefix data.
54321 	 */
54322 	uint64_t	eng_bytes_in;
54323 	/* Count of data bytes out of the Engine. */
54324 	uint64_t	eng_bytes_out;
54325 	/*
54326 	 * Count, in 4-byte (dword) units, of bytes
54327 	 * that are input as auxiliary data.
54328 	 * This includes the aux_cmd data.
54329 	 */
54330 	uint64_t	aux_bytes_in;
54331 	/*
54332 	 * Count, in 4-byte (dword) units, of bytes
54333 	 * that are output as auxiliary data.
54334 	 * This count is the buffer space for aux_data
54335 	 * output provided in the RQE, not the actual
54336 	 * aux_data written
54337 	 */
54338 	uint64_t	aux_bytes_out;
54339 	/* Count of number of commands executed. */
54340 	uint64_t	commands;
54341 	/*
54342 	 * Count of number of error commands.
54343 	 * These are the commands with a
54344 	 * non-zero status value.
54345 	 */
54346 	uint64_t	error_commands;
54347 	/*
54348 	 * Compression/Encryption Engine usage,
54349 	 * the unit is count of clock cycles
54350 	 */
54351 	uint64_t	cce_engine_usage;
54352 	/*
54353 	 * De-Compression/De-cryption Engine usage,
54354 	 * the unit is count of clock cycles
54355 	 */
54356 	uint64_t	cdd_engine_usage;
54357 } ctx_eng_stats_t, *pctx_eng_stats_t;
54358 
54359 /***********************
54360  * hwrm_stat_ctx_alloc *
54361  ***********************/
54362 
54363 
54364 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
54365 
54366 typedef struct hwrm_stat_ctx_alloc_input {
54367 	/* The HWRM command request type. */
54368 	uint16_t	req_type;
54369 	/*
54370 	 * The completion ring to send the completion event on. This should
54371 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54372 	 */
54373 	uint16_t	cmpl_ring;
54374 	/*
54375 	 * The sequence ID is used by the driver for tracking multiple
54376 	 * commands. This ID is treated as opaque data by the firmware and
54377 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54378 	 */
54379 	uint16_t	seq_id;
54380 	/*
54381 	 * The target ID of the command:
54382 	 * * 0x0-0xFFF8 - The function ID
54383 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54384 	 * * 0xFFFD - Reserved for user-space HWRM interface
54385 	 * * 0xFFFF - HWRM
54386 	 */
54387 	uint16_t	target_id;
54388 	/*
54389 	 * A physical address pointer pointing to a host buffer that the
54390 	 * command's response data will be written. This can be either a host
54391 	 * physical address (HPA) or a guest physical address (GPA) and must
54392 	 * point to a physically contiguous block of memory.
54393 	 */
54394 	uint64_t	resp_addr;
54395 	/*
54396 	 * This is the address for statistic block.
54397 	 * > For new versions of the chip, this address should be 128B
54398 	 * > aligned.
54399 	 */
54400 	uint64_t	stats_dma_addr;
54401 	/*
54402 	 * The statistic block update period in ms.
54403 	 * e.g. 250ms, 500ms, 750ms, 1000ms.
54404 	 * If update_period_ms is 0, then the stats update
54405 	 * shall be never done and the DMA address shall not be used.
54406 	 * In this case, the stat block can only be read by
54407 	 * hwrm_stat_ctx_query command.
54408 	 * On Ethernet/L2 based devices:
54409 	 *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
54410 	 *	ctx_hw_stats_ext is used for DMA,
54411 	 *   else
54412 	 *	ctx_hw_stats is used for DMA.
54413 	 */
54414 	uint32_t	update_period_ms;
54415 	/*
54416 	 * This field is used to specify statistics context specific
54417 	 * configuration flags.
54418 	 */
54419 	uint8_t	stat_ctx_flags;
54420 	/*
54421 	 * When this bit is set to '1', the statistics context shall be
54422 	 * allocated for RoCE traffic only. In this case, traffic other
54423 	 * than offloaded RoCE traffic shall not be included in this
54424 	 * statistic context.
54425 	 * When this bit is set to '0', the statistics context shall be
54426 	 * used for network traffic or engine traffic.
54427 	 */
54428 	#define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE	UINT32_C(0x1)
54429 	uint8_t	unused_0;
54430 	/*
54431 	 * This is the size of the structure (ctx_hw_stats or
54432 	 * ctx_hw_stats_ext) that the driver has allocated to be used
54433 	 * for the periodic DMA updates.
54434 	 */
54435 	uint16_t	stats_dma_length;
54436 } hwrm_stat_ctx_alloc_input_t, *phwrm_stat_ctx_alloc_input_t;
54437 
54438 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
54439 
54440 typedef struct hwrm_stat_ctx_alloc_output {
54441 	/* The specific error status for the command. */
54442 	uint16_t	error_code;
54443 	/* The HWRM command request type. */
54444 	uint16_t	req_type;
54445 	/* The sequence ID from the original command. */
54446 	uint16_t	seq_id;
54447 	/* The length of the response data in number of bytes. */
54448 	uint16_t	resp_len;
54449 	/* This is the statistics context ID value. */
54450 	uint32_t	stat_ctx_id;
54451 	uint8_t	unused_0[3];
54452 	/*
54453 	 * This field is used in Output records to indicate that the output
54454 	 * is completely written to RAM.  This field should be read as '1'
54455 	 * to indicate that the output has been completely written.
54456 	 * When writing a command completion or response to an internal processor,
54457 	 * the order of writes has to be such that this field is written last.
54458 	 */
54459 	uint8_t	valid;
54460 } hwrm_stat_ctx_alloc_output_t, *phwrm_stat_ctx_alloc_output_t;
54461 
54462 /**********************
54463  * hwrm_stat_ctx_free *
54464  **********************/
54465 
54466 
54467 /* hwrm_stat_ctx_free_input (size:192b/24B) */
54468 
54469 typedef struct hwrm_stat_ctx_free_input {
54470 	/* The HWRM command request type. */
54471 	uint16_t	req_type;
54472 	/*
54473 	 * The completion ring to send the completion event on. This should
54474 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54475 	 */
54476 	uint16_t	cmpl_ring;
54477 	/*
54478 	 * The sequence ID is used by the driver for tracking multiple
54479 	 * commands. This ID is treated as opaque data by the firmware and
54480 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54481 	 */
54482 	uint16_t	seq_id;
54483 	/*
54484 	 * The target ID of the command:
54485 	 * * 0x0-0xFFF8 - The function ID
54486 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54487 	 * * 0xFFFD - Reserved for user-space HWRM interface
54488 	 * * 0xFFFF - HWRM
54489 	 */
54490 	uint16_t	target_id;
54491 	/*
54492 	 * A physical address pointer pointing to a host buffer that the
54493 	 * command's response data will be written. This can be either a host
54494 	 * physical address (HPA) or a guest physical address (GPA) and must
54495 	 * point to a physically contiguous block of memory.
54496 	 */
54497 	uint64_t	resp_addr;
54498 	/* ID of the statistics context that is being queried. */
54499 	uint32_t	stat_ctx_id;
54500 	uint8_t	unused_0[4];
54501 } hwrm_stat_ctx_free_input_t, *phwrm_stat_ctx_free_input_t;
54502 
54503 /* hwrm_stat_ctx_free_output (size:128b/16B) */
54504 
54505 typedef struct hwrm_stat_ctx_free_output {
54506 	/* The specific error status for the command. */
54507 	uint16_t	error_code;
54508 	/* The HWRM command request type. */
54509 	uint16_t	req_type;
54510 	/* The sequence ID from the original command. */
54511 	uint16_t	seq_id;
54512 	/* The length of the response data in number of bytes. */
54513 	uint16_t	resp_len;
54514 	/* This is the statistics context ID value. */
54515 	uint32_t	stat_ctx_id;
54516 	uint8_t	unused_0[3];
54517 	/*
54518 	 * This field is used in Output records to indicate that the output
54519 	 * is completely written to RAM.  This field should be read as '1'
54520 	 * to indicate that the output has been completely written.
54521 	 * When writing a command completion or response to an internal processor,
54522 	 * the order of writes has to be such that this field is written last.
54523 	 */
54524 	uint8_t	valid;
54525 } hwrm_stat_ctx_free_output_t, *phwrm_stat_ctx_free_output_t;
54526 
54527 /***********************
54528  * hwrm_stat_ctx_query *
54529  ***********************/
54530 
54531 
54532 /* hwrm_stat_ctx_query_input (size:192b/24B) */
54533 
54534 typedef struct hwrm_stat_ctx_query_input {
54535 	/* The HWRM command request type. */
54536 	uint16_t	req_type;
54537 	/*
54538 	 * The completion ring to send the completion event on. This should
54539 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54540 	 */
54541 	uint16_t	cmpl_ring;
54542 	/*
54543 	 * The sequence ID is used by the driver for tracking multiple
54544 	 * commands. This ID is treated as opaque data by the firmware and
54545 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54546 	 */
54547 	uint16_t	seq_id;
54548 	/*
54549 	 * The target ID of the command:
54550 	 * * 0x0-0xFFF8 - The function ID
54551 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54552 	 * * 0xFFFD - Reserved for user-space HWRM interface
54553 	 * * 0xFFFF - HWRM
54554 	 */
54555 	uint16_t	target_id;
54556 	/*
54557 	 * A physical address pointer pointing to a host buffer that the
54558 	 * command's response data will be written. This can be either a host
54559 	 * physical address (HPA) or a guest physical address (GPA) and must
54560 	 * point to a physically contiguous block of memory.
54561 	 */
54562 	uint64_t	resp_addr;
54563 	/* ID of the statistics context that is being queried. */
54564 	uint32_t	stat_ctx_id;
54565 	uint8_t	flags;
54566 	/*
54567 	 * This bit is set to 1 when request is for a counter mask,
54568 	 * representing the width of each of the stats counters, rather
54569 	 * than counters themselves.
54570 	 */
54571 	#define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
54572 	uint8_t	unused_0[3];
54573 } hwrm_stat_ctx_query_input_t, *phwrm_stat_ctx_query_input_t;
54574 
54575 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
54576 
54577 typedef struct hwrm_stat_ctx_query_output {
54578 	/* The specific error status for the command. */
54579 	uint16_t	error_code;
54580 	/* The HWRM command request type. */
54581 	uint16_t	req_type;
54582 	/* The sequence ID from the original command. */
54583 	uint16_t	seq_id;
54584 	/* The length of the response data in number of bytes. */
54585 	uint16_t	resp_len;
54586 	/* Number of transmitted unicast packets */
54587 	uint64_t	tx_ucast_pkts;
54588 	/* Number of transmitted multicast packets */
54589 	uint64_t	tx_mcast_pkts;
54590 	/* Number of transmitted broadcast packets */
54591 	uint64_t	tx_bcast_pkts;
54592 	/* Number of packets discarded in transmit path */
54593 	uint64_t	tx_discard_pkts;
54594 	/* Number of packets in transmit path with error */
54595 	uint64_t	tx_error_pkts;
54596 	/* Number of transmitted bytes for unicast traffic */
54597 	uint64_t	tx_ucast_bytes;
54598 	/* Number of transmitted bytes for multicast traffic */
54599 	uint64_t	tx_mcast_bytes;
54600 	/* Number of transmitted bytes for broadcast traffic */
54601 	uint64_t	tx_bcast_bytes;
54602 	/* Number of received unicast packets */
54603 	uint64_t	rx_ucast_pkts;
54604 	/* Number of received multicast packets */
54605 	uint64_t	rx_mcast_pkts;
54606 	/* Number of received broadcast packets */
54607 	uint64_t	rx_bcast_pkts;
54608 	/* Number of packets discarded in receive path */
54609 	uint64_t	rx_discard_pkts;
54610 	/* Number of packets in receive path with errors */
54611 	uint64_t	rx_error_pkts;
54612 	/* Number of received bytes for unicast traffic */
54613 	uint64_t	rx_ucast_bytes;
54614 	/* Number of received bytes for multicast traffic */
54615 	uint64_t	rx_mcast_bytes;
54616 	/* Number of received bytes for broadcast traffic */
54617 	uint64_t	rx_bcast_bytes;
54618 	/* Number of aggregated unicast packets */
54619 	uint64_t	rx_agg_pkts;
54620 	/* Number of aggregated unicast bytes */
54621 	uint64_t	rx_agg_bytes;
54622 	/* Number of aggregation events */
54623 	uint64_t	rx_agg_events;
54624 	/* Number of aborted aggregations */
54625 	uint64_t	rx_agg_aborts;
54626 	uint8_t	unused_0[7];
54627 	/*
54628 	 * This field is used in Output records to indicate that the output
54629 	 * is completely written to RAM.  This field should be read as '1'
54630 	 * to indicate that the output has been completely written.
54631 	 * When writing a command completion or response to an internal processor,
54632 	 * the order of writes has to be such that this field is written last.
54633 	 */
54634 	uint8_t	valid;
54635 } hwrm_stat_ctx_query_output_t, *phwrm_stat_ctx_query_output_t;
54636 
54637 /***************************
54638  * hwrm_stat_ext_ctx_query *
54639  ***************************/
54640 
54641 
54642 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
54643 
54644 typedef struct hwrm_stat_ext_ctx_query_input {
54645 	/* The HWRM command request type. */
54646 	uint16_t	req_type;
54647 	/*
54648 	 * The completion ring to send the completion event on. This should
54649 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54650 	 */
54651 	uint16_t	cmpl_ring;
54652 	/*
54653 	 * The sequence ID is used by the driver for tracking multiple
54654 	 * commands. This ID is treated as opaque data by the firmware and
54655 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54656 	 */
54657 	uint16_t	seq_id;
54658 	/*
54659 	 * The target ID of the command:
54660 	 * * 0x0-0xFFF8 - The function ID
54661 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54662 	 * * 0xFFFD - Reserved for user-space HWRM interface
54663 	 * * 0xFFFF - HWRM
54664 	 */
54665 	uint16_t	target_id;
54666 	/*
54667 	 * A physical address pointer pointing to a host buffer that the
54668 	 * command's response data will be written. This can be either a host
54669 	 * physical address (HPA) or a guest physical address (GPA) and must
54670 	 * point to a physically contiguous block of memory.
54671 	 */
54672 	uint64_t	resp_addr;
54673 	/* ID of the extended statistics context that is being queried. */
54674 	uint32_t	stat_ctx_id;
54675 	uint8_t	flags;
54676 	/*
54677 	 * This bit is set to 1 when request is for a counter mask,
54678 	 * representing the width of each of the stats counters, rather
54679 	 * than counters themselves.
54680 	 */
54681 	#define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
54682 	uint8_t	unused_0[3];
54683 } hwrm_stat_ext_ctx_query_input_t, *phwrm_stat_ext_ctx_query_input_t;
54684 
54685 /* hwrm_stat_ext_ctx_query_output (size:1536b/192B) */
54686 
54687 typedef struct hwrm_stat_ext_ctx_query_output {
54688 	/* The specific error status for the command. */
54689 	uint16_t	error_code;
54690 	/* The HWRM command request type. */
54691 	uint16_t	req_type;
54692 	/* The sequence ID from the original command. */
54693 	uint16_t	seq_id;
54694 	/* The length of the response data in number of bytes. */
54695 	uint16_t	resp_len;
54696 	/* Number of received unicast packets */
54697 	uint64_t	rx_ucast_pkts;
54698 	/* Number of received multicast packets */
54699 	uint64_t	rx_mcast_pkts;
54700 	/* Number of received broadcast packets */
54701 	uint64_t	rx_bcast_pkts;
54702 	/* Number of discarded packets on receive path */
54703 	uint64_t	rx_discard_pkts;
54704 	/* Number of packets on receive path with error */
54705 	uint64_t	rx_error_pkts;
54706 	/* Number of received bytes for unicast traffic */
54707 	uint64_t	rx_ucast_bytes;
54708 	/* Number of received bytes for multicast traffic */
54709 	uint64_t	rx_mcast_bytes;
54710 	/* Number of received bytes for broadcast traffic */
54711 	uint64_t	rx_bcast_bytes;
54712 	/* Number of transmitted unicast packets */
54713 	uint64_t	tx_ucast_pkts;
54714 	/* Number of transmitted multicast packets */
54715 	uint64_t	tx_mcast_pkts;
54716 	/* Number of transmitted broadcast packets */
54717 	uint64_t	tx_bcast_pkts;
54718 	/* Number of packets on transmit path with error */
54719 	uint64_t	tx_error_pkts;
54720 	/* Number of discarded packets on transmit path */
54721 	uint64_t	tx_discard_pkts;
54722 	/* Number of transmitted bytes for unicast traffic */
54723 	uint64_t	tx_ucast_bytes;
54724 	/* Number of transmitted bytes for multicast traffic */
54725 	uint64_t	tx_mcast_bytes;
54726 	/* Number of transmitted bytes for broadcast traffic */
54727 	uint64_t	tx_bcast_bytes;
54728 	/* Number of TPA eligible packets */
54729 	uint64_t	rx_tpa_eligible_pkt;
54730 	/* Number of TPA eligible bytes */
54731 	uint64_t	rx_tpa_eligible_bytes;
54732 	/* Number of TPA packets */
54733 	uint64_t	rx_tpa_pkt;
54734 	/* Number of TPA bytes */
54735 	uint64_t	rx_tpa_bytes;
54736 	/* Number of TPA errors */
54737 	uint64_t	rx_tpa_errors;
54738 	/* Number of TPA events */
54739 	uint64_t	rx_tpa_events;
54740 	uint8_t	unused_0[7];
54741 	/*
54742 	 * This field is used in Output records to indicate that the output
54743 	 * is completely written to RAM.  This field should be read as '1'
54744 	 * to indicate that the output has been completely written.
54745 	 * When writing a command completion or response to an internal processor,
54746 	 * the order of writes has to be such that this field is written last.
54747 	 */
54748 	uint8_t	valid;
54749 } hwrm_stat_ext_ctx_query_output_t, *phwrm_stat_ext_ctx_query_output_t;
54750 
54751 /***************************
54752  * hwrm_stat_ctx_eng_query *
54753  ***************************/
54754 
54755 
54756 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
54757 
54758 typedef struct hwrm_stat_ctx_eng_query_input {
54759 	/* The HWRM command request type. */
54760 	uint16_t	req_type;
54761 	/*
54762 	 * The completion ring to send the completion event on. This should
54763 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54764 	 */
54765 	uint16_t	cmpl_ring;
54766 	/*
54767 	 * The sequence ID is used by the driver for tracking multiple
54768 	 * commands. This ID is treated as opaque data by the firmware and
54769 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54770 	 */
54771 	uint16_t	seq_id;
54772 	/*
54773 	 * The target ID of the command:
54774 	 * * 0x0-0xFFF8 - The function ID
54775 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54776 	 * * 0xFFFD - Reserved for user-space HWRM interface
54777 	 * * 0xFFFF - HWRM
54778 	 */
54779 	uint16_t	target_id;
54780 	/*
54781 	 * A physical address pointer pointing to a host buffer that the
54782 	 * command's response data will be written. This can be either a host
54783 	 * physical address (HPA) or a guest physical address (GPA) and must
54784 	 * point to a physically contiguous block of memory.
54785 	 */
54786 	uint64_t	resp_addr;
54787 	/* ID of the statistics context that is being queried. */
54788 	uint32_t	stat_ctx_id;
54789 	uint8_t	unused_0[4];
54790 } hwrm_stat_ctx_eng_query_input_t, *phwrm_stat_ctx_eng_query_input_t;
54791 
54792 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
54793 
54794 typedef struct hwrm_stat_ctx_eng_query_output {
54795 	/* The specific error status for the command. */
54796 	uint16_t	error_code;
54797 	/* The HWRM command request type. */
54798 	uint16_t	req_type;
54799 	/* The sequence ID from the original command. */
54800 	uint16_t	seq_id;
54801 	/* The length of the response data in number of bytes. */
54802 	uint16_t	resp_len;
54803 	/*
54804 	 * Count of data bytes into the Engine.
54805 	 * This includes any user supplied prefix,
54806 	 * but does not include any predefined
54807 	 * prefix data.
54808 	 */
54809 	uint64_t	eng_bytes_in;
54810 	/* Count of data bytes out of the Engine. */
54811 	uint64_t	eng_bytes_out;
54812 	/*
54813 	 * Count, in 4-byte (dword) units, of bytes
54814 	 * that are input as auxiliary data.
54815 	 * This includes the aux_cmd data.
54816 	 */
54817 	uint64_t	aux_bytes_in;
54818 	/*
54819 	 * Count, in 4-byte (dword) units, of bytes
54820 	 * that are output as auxiliary data.
54821 	 * This count is the buffer space for aux_data
54822 	 * output provided in the RQE, not the actual
54823 	 * aux_data written
54824 	 */
54825 	uint64_t	aux_bytes_out;
54826 	/* Count of number of commands executed. */
54827 	uint64_t	commands;
54828 	/*
54829 	 * Count of number of error commands.
54830 	 * These are the commands with a
54831 	 * non-zero status value.
54832 	 */
54833 	uint64_t	error_commands;
54834 	/*
54835 	 * Compression/Encryption Engine usage,
54836 	 * the unit is count of clock cycles
54837 	 */
54838 	uint64_t	cce_engine_usage;
54839 	/*
54840 	 * De-Compression/De-cryption Engine usage,
54841 	 * the unit is count of clock cycles
54842 	 */
54843 	uint64_t	cdd_engine_usage;
54844 	uint8_t	unused_0[7];
54845 	/*
54846 	 * This field is used in Output records to indicate that the output
54847 	 * is completely written to RAM.  This field should be read as '1'
54848 	 * to indicate that the output has been completely written.
54849 	 * When writing a command completion or response to an internal processor,
54850 	 * the order of writes has to be such that this field is written last.
54851 	 */
54852 	uint8_t	valid;
54853 } hwrm_stat_ctx_eng_query_output_t, *phwrm_stat_ctx_eng_query_output_t;
54854 
54855 /***************************
54856  * hwrm_stat_ctx_clr_stats *
54857  ***************************/
54858 
54859 
54860 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
54861 
54862 typedef struct hwrm_stat_ctx_clr_stats_input {
54863 	/* The HWRM command request type. */
54864 	uint16_t	req_type;
54865 	/*
54866 	 * The completion ring to send the completion event on. This should
54867 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54868 	 */
54869 	uint16_t	cmpl_ring;
54870 	/*
54871 	 * The sequence ID is used by the driver for tracking multiple
54872 	 * commands. This ID is treated as opaque data by the firmware and
54873 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54874 	 */
54875 	uint16_t	seq_id;
54876 	/*
54877 	 * The target ID of the command:
54878 	 * * 0x0-0xFFF8 - The function ID
54879 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54880 	 * * 0xFFFD - Reserved for user-space HWRM interface
54881 	 * * 0xFFFF - HWRM
54882 	 */
54883 	uint16_t	target_id;
54884 	/*
54885 	 * A physical address pointer pointing to a host buffer that the
54886 	 * command's response data will be written. This can be either a host
54887 	 * physical address (HPA) or a guest physical address (GPA) and must
54888 	 * point to a physically contiguous block of memory.
54889 	 */
54890 	uint64_t	resp_addr;
54891 	/* ID of the statistics context that is being queried. */
54892 	uint32_t	stat_ctx_id;
54893 	uint8_t	unused_0[4];
54894 } hwrm_stat_ctx_clr_stats_input_t, *phwrm_stat_ctx_clr_stats_input_t;
54895 
54896 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
54897 
54898 typedef struct hwrm_stat_ctx_clr_stats_output {
54899 	/* The specific error status for the command. */
54900 	uint16_t	error_code;
54901 	/* The HWRM command request type. */
54902 	uint16_t	req_type;
54903 	/* The sequence ID from the original command. */
54904 	uint16_t	seq_id;
54905 	/* The length of the response data in number of bytes. */
54906 	uint16_t	resp_len;
54907 	uint8_t	unused_0[7];
54908 	/*
54909 	 * This field is used in Output records to indicate that the output
54910 	 * is completely written to RAM.  This field should be read as '1'
54911 	 * to indicate that the output has been completely written.
54912 	 * When writing a command completion or response to an internal processor,
54913 	 * the order of writes has to be such that this field is written last.
54914 	 */
54915 	uint8_t	valid;
54916 } hwrm_stat_ctx_clr_stats_output_t, *phwrm_stat_ctx_clr_stats_output_t;
54917 
54918 /********************
54919  * hwrm_pcie_qstats *
54920  ********************/
54921 
54922 
54923 /* hwrm_pcie_qstats_input (size:256b/32B) */
54924 
54925 typedef struct hwrm_pcie_qstats_input {
54926 	/* The HWRM command request type. */
54927 	uint16_t	req_type;
54928 	/*
54929 	 * The completion ring to send the completion event on. This should
54930 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54931 	 */
54932 	uint16_t	cmpl_ring;
54933 	/*
54934 	 * The sequence ID is used by the driver for tracking multiple
54935 	 * commands. This ID is treated as opaque data by the firmware and
54936 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54937 	 */
54938 	uint16_t	seq_id;
54939 	/*
54940 	 * The target ID of the command:
54941 	 * * 0x0-0xFFF8 - The function ID
54942 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54943 	 * * 0xFFFD - Reserved for user-space HWRM interface
54944 	 * * 0xFFFF - HWRM
54945 	 */
54946 	uint16_t	target_id;
54947 	/*
54948 	 * A physical address pointer pointing to a host buffer that the
54949 	 * command's response data will be written. This can be either a host
54950 	 * physical address (HPA) or a guest physical address (GPA) and must
54951 	 * point to a physically contiguous block of memory.
54952 	 */
54953 	uint64_t	resp_addr;
54954 	/*
54955 	 * The size of PCIe statistics block in bytes.
54956 	 * Firmware will DMA the PCIe statistics to
54957 	 * the host with this field size in the response.
54958 	 */
54959 	uint16_t	pcie_stat_size;
54960 	uint8_t	unused_0[6];
54961 	/*
54962 	 * This is the host address where
54963 	 * PCIe statistics will be stored
54964 	 */
54965 	uint64_t	pcie_stat_host_addr;
54966 } hwrm_pcie_qstats_input_t, *phwrm_pcie_qstats_input_t;
54967 
54968 /* hwrm_pcie_qstats_output (size:128b/16B) */
54969 
54970 typedef struct hwrm_pcie_qstats_output {
54971 	/* The specific error status for the command. */
54972 	uint16_t	error_code;
54973 	/* The HWRM command request type. */
54974 	uint16_t	req_type;
54975 	/* The sequence ID from the original command. */
54976 	uint16_t	seq_id;
54977 	/* The length of the response data in number of bytes. */
54978 	uint16_t	resp_len;
54979 	/* The size of PCIe statistics block in bytes. */
54980 	uint16_t	pcie_stat_size;
54981 	uint8_t	unused_0[5];
54982 	/*
54983 	 * This field is used in Output records to indicate that the output
54984 	 * is completely written to RAM.  This field should be read as '1'
54985 	 * to indicate that the output has been completely written.
54986 	 * When writing a command completion or response to an internal processor,
54987 	 * the order of writes has to be such that this field is written last.
54988 	 */
54989 	uint8_t	valid;
54990 } hwrm_pcie_qstats_output_t, *phwrm_pcie_qstats_output_t;
54991 
54992 /* PCIe Statistics Formats */
54993 /* pcie_ctx_hw_stats (size:768b/96B) */
54994 
54995 typedef struct pcie_ctx_hw_stats {
54996 	/* Number of physical layer receiver errors */
54997 	uint64_t	pcie_pl_signal_integrity;
54998 	/* Number of DLLP CRC errors detected by Data Link Layer */
54999 	uint64_t	pcie_dl_signal_integrity;
55000 	/*
55001 	 * Number of TLP LCRC and sequence number errors detected
55002 	 * by Data Link Layer
55003 	 */
55004 	uint64_t	pcie_tl_signal_integrity;
55005 	/* Number of times LTSSM entered Recovery state */
55006 	uint64_t	pcie_link_integrity;
55007 	/* Report number of TLP bits that have been transmitted in Mbps */
55008 	uint64_t	pcie_tx_traffic_rate;
55009 	/* Report number of TLP bits that have been received in Mbps */
55010 	uint64_t	pcie_rx_traffic_rate;
55011 	/* Number of DLLP bytes that have been transmitted */
55012 	uint64_t	pcie_tx_dllp_statistics;
55013 	/* Number of DLLP bytes that have been received */
55014 	uint64_t	pcie_rx_dllp_statistics;
55015 	/*
55016 	 * Number of times spent in each phase of gen3
55017 	 * equalization
55018 	 */
55019 	uint64_t	pcie_equalization_time;
55020 	/* Records the last 16 transitions of the LTSSM */
55021 	uint32_t	pcie_ltssm_histogram[4];
55022 	/*
55023 	 * Record the last 8 reasons on why LTSSM transitioned
55024 	 * to Recovery
55025 	 */
55026 	uint64_t	pcie_recovery_histogram;
55027 } pcie_ctx_hw_stats_t, *ppcie_ctx_hw_stats_t;
55028 
55029 /****************************
55030  * hwrm_stat_generic_qstats *
55031  ****************************/
55032 
55033 
55034 /* hwrm_stat_generic_qstats_input (size:256b/32B) */
55035 
55036 typedef struct hwrm_stat_generic_qstats_input {
55037 	/* The HWRM command request type. */
55038 	uint16_t	req_type;
55039 	/*
55040 	 * The completion ring to send the completion event on. This should
55041 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55042 	 */
55043 	uint16_t	cmpl_ring;
55044 	/*
55045 	 * The sequence ID is used by the driver for tracking multiple
55046 	 * commands. This ID is treated as opaque data by the firmware and
55047 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55048 	 */
55049 	uint16_t	seq_id;
55050 	/*
55051 	 * The target ID of the command:
55052 	 * * 0x0-0xFFF8 - The function ID
55053 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55054 	 * * 0xFFFD - Reserved for user-space HWRM interface
55055 	 * * 0xFFFF - HWRM
55056 	 */
55057 	uint16_t	target_id;
55058 	/*
55059 	 * A physical address pointer pointing to a host buffer that the
55060 	 * command's response data will be written. This can be either a host
55061 	 * physical address (HPA) or a guest physical address (GPA) and must
55062 	 * point to a physically contiguous block of memory.
55063 	 */
55064 	uint64_t	resp_addr;
55065 	/*
55066 	 * The size of the generic statistics buffer passed in the
55067 	 * generic_stat_host_addr in bytes.
55068 	 * Firmware will not exceed this size when it DMAs the
55069 	 * statistics structure to the host.  The actual DMA size
55070 	 * will be returned in the response.
55071 	 */
55072 	uint16_t	generic_stat_size;
55073 	uint8_t	flags;
55074 	/*
55075 	 * The bit should be set to 1 when request is for the counter mask
55076 	 * representing the width of each of the stats counters, rather
55077 	 * than counters themselves.
55078 	 */
55079 	#define HWRM_STAT_GENERIC_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
55080 	uint8_t	unused_0[5];
55081 	/*
55082 	 * This is the host address where
55083 	 * generic statistics will be stored
55084 	 */
55085 	uint64_t	generic_stat_host_addr;
55086 } hwrm_stat_generic_qstats_input_t, *phwrm_stat_generic_qstats_input_t;
55087 
55088 /* hwrm_stat_generic_qstats_output (size:128b/16B) */
55089 
55090 typedef struct hwrm_stat_generic_qstats_output {
55091 	/* The specific error status for the command. */
55092 	uint16_t	error_code;
55093 	/* The HWRM command request type. */
55094 	uint16_t	req_type;
55095 	/* The sequence ID from the original command. */
55096 	uint16_t	seq_id;
55097 	/* The length of the response data in number of bytes. */
55098 	uint16_t	resp_len;
55099 	/* The size of Generic Statistics block in bytes. */
55100 	uint16_t	generic_stat_size;
55101 	uint8_t	unused_0[5];
55102 	/*
55103 	 * This field is used in Output records to indicate that the output
55104 	 * is completely written to RAM.  This field should be read as '1'
55105 	 * to indicate that the output has been completely written.
55106 	 * When writing a command completion or response to an internal
55107 	 * processor, the order of writes has to be such that this field is
55108 	 * written last.
55109 	 */
55110 	uint8_t	valid;
55111 } hwrm_stat_generic_qstats_output_t, *phwrm_stat_generic_qstats_output_t;
55112 
55113 /* Generic Statistic Format */
55114 /* generic_sw_hw_stats (size:1408b/176B) */
55115 
55116 typedef struct generic_sw_hw_stats {
55117 	/*
55118 	 * This is the number of TLP bytes that have been transmitted for
55119 	 * the caller PF.
55120 	 */
55121 	uint64_t	pcie_statistics_tx_tlp;
55122 	/*
55123 	 * This is the number of TLP bytes that have been received
55124 	 * for the caller PF.
55125 	 */
55126 	uint64_t	pcie_statistics_rx_tlp;
55127 	/* Posted Header Flow Control credits available for the caller PF. */
55128 	uint64_t	pcie_credit_fc_hdr_posted;
55129 	/* Non-posted Header Flow Control credits available for the caller PF. */
55130 	uint64_t	pcie_credit_fc_hdr_nonposted;
55131 	/* Completion Header Flow Control credits available for the caller PF. */
55132 	uint64_t	pcie_credit_fc_hdr_cmpl;
55133 	/* Posted Data Flow Control credits available for the caller PF. */
55134 	uint64_t	pcie_credit_fc_data_posted;
55135 	/* Non-Posted Data Flow Control credits available for the caller PF. */
55136 	uint64_t	pcie_credit_fc_data_nonposted;
55137 	/* Completion Data Flow Control credits available for the caller PF. */
55138 	uint64_t	pcie_credit_fc_data_cmpl;
55139 	/*
55140 	 * Available Non-posted credit for target flow control reads or
55141 	 * config for the caller PF.
55142 	 */
55143 	uint64_t	pcie_credit_fc_tgt_nonposted;
55144 	/*
55145 	 * Available posted data credit for target flow control writes
55146 	 * for the caller PF.
55147 	 */
55148 	uint64_t	pcie_credit_fc_tgt_data_posted;
55149 	/*
55150 	 * Available posted header credit for target flow control writes
55151 	 * for the caller PF.
55152 	 */
55153 	uint64_t	pcie_credit_fc_tgt_hdr_posted;
55154 	/* Available completion flow control header credits for the caller PF. */
55155 	uint64_t	pcie_credit_fc_cmpl_hdr_posted;
55156 	/* Available completion flow control data credits. */
55157 	uint64_t	pcie_credit_fc_cmpl_data_posted;
55158 	/*
55159 	 * Displays Time information of the longest completon time from any of
55160 	 * the 4 tags for the caller PF.  The unit of time recorded is in
55161 	 * microseconds.
55162 	 */
55163 	uint64_t	pcie_cmpl_longest;
55164 	/*
55165 	 * Displays Time information of the shortest completon time from any of
55166 	 * the 4 tags for the caller PF.  The unit of time recorded is in
55167 	 * microseconds.
55168 	 */
55169 	uint64_t	pcie_cmpl_shortest;
55170 	/*
55171 	 * This field containts the total number of CFCQ 'misses' observed for
55172 	 * all the PF's.
55173 	 */
55174 	uint64_t	cache_miss_count_cfcq;
55175 	/*
55176 	 * This field containts the total number of CFCS 'misses' observed for
55177 	 * all the PF's.
55178 	 */
55179 	uint64_t	cache_miss_count_cfcs;
55180 	/*
55181 	 * This field containts the total number of CFCC 'misses' observed for
55182 	 * all the PF's.
55183 	 */
55184 	uint64_t	cache_miss_count_cfcc;
55185 	/*
55186 	 * This field containts the total number of CFCM 'misses' observed
55187 	 * for all the PF's.
55188 	 */
55189 	uint64_t	cache_miss_count_cfcm;
55190 	/*
55191 	 * Total number of Doorbell messages dropped from the DB FIFO.
55192 	 * This counter is only applicable for devices that support
55193 	 * the hardware based doorbell drop recovery feature.
55194 	 */
55195 	uint64_t	hw_db_recov_dbs_dropped;
55196 	/*
55197 	 * Total number of doorbell drops serviced.
55198 	 * This counter is only applicable for devices that support
55199 	 * the hardware based doorbell drop recovery feature.
55200 	 */
55201 	uint64_t	hw_db_recov_drops_serviced;
55202 	/*
55203 	 * Total number of dropped doorbells recovered.
55204 	 * This counter is only applicable for devices that support
55205 	 * the hardware based doorbell drop recovery feature.
55206 	 */
55207 	uint64_t	hw_db_recov_dbs_recovered;
55208 } generic_sw_hw_stats_t, *pgeneric_sw_hw_stats_t;
55209 
55210 /*****************
55211  * hwrm_fw_reset *
55212  *****************/
55213 
55214 
55215 /* hwrm_fw_reset_input (size:192b/24B) */
55216 
55217 typedef struct hwrm_fw_reset_input {
55218 	/* The HWRM command request type. */
55219 	uint16_t	req_type;
55220 	/*
55221 	 * The completion ring to send the completion event on. This should
55222 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55223 	 */
55224 	uint16_t	cmpl_ring;
55225 	/*
55226 	 * The sequence ID is used by the driver for tracking multiple
55227 	 * commands. This ID is treated as opaque data by the firmware and
55228 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55229 	 */
55230 	uint16_t	seq_id;
55231 	/*
55232 	 * The target ID of the command:
55233 	 * * 0x0-0xFFF8 - The function ID
55234 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55235 	 * * 0xFFFD - Reserved for user-space HWRM interface
55236 	 * * 0xFFFF - HWRM
55237 	 */
55238 	uint16_t	target_id;
55239 	/*
55240 	 * A physical address pointer pointing to a host buffer that the
55241 	 * command's response data will be written. This can be either a host
55242 	 * physical address (HPA) or a guest physical address (GPA) and must
55243 	 * point to a physically contiguous block of memory.
55244 	 */
55245 	uint64_t	resp_addr;
55246 	/* Type of embedded processor. */
55247 	uint8_t	embedded_proc_type;
55248 	/* Boot Processor */
55249 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT		UINT32_C(0x0)
55250 	/* Management Processor */
55251 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT		UINT32_C(0x1)
55252 	/* Network control processor */
55253 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL		UINT32_C(0x2)
55254 	/* RoCE control processor */
55255 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE		UINT32_C(0x3)
55256 	/*
55257 	 * Host (in multi-host environment): This is only valid if requester is IPC.
55258 	 * Reinit host hardware resources and PCIe.
55259 	 */
55260 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST		UINT32_C(0x4)
55261 	/*
55262 	 * AP processor complex (in multi-host environment).
55263 	 * Use host_idx to control which core is reset.
55264 	 */
55265 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP			UINT32_C(0x5)
55266 	/* Reset all blocks of the chip (including all processors) */
55267 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP		UINT32_C(0x6)
55268 	/*
55269 	 * Host (in multi-host environment): This is only valid if requester is IPC.
55270 	 * Reinit host hardware resources.
55271 	 */
55272 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT  UINT32_C(0x7)
55273 	/*
55274 	 * Activate firmware that has been programmed to NVM.  The
55275 	 * activation is done in an impactless manner as part of the scheme
55276 	 * where hwrm_fw_state_backup precedes the call, and
55277 	 * hwrm_fw_state_restore follows it.  Before this call returns, FW
55278 	 * status is set to a non-0x8000 value to disambiguate reset pending
55279 	 * from reset complete.  The reset process begins after this call
55280 	 * returns to ensure this HWRM has completed before reset begins.
55281 	 */
55282 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION UINT32_C(0x8)
55283 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST		HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION
55284 	/* Type of self reset. */
55285 	uint8_t	selfrst_status;
55286 	/* No Self Reset */
55287 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
55288 	/* Self Reset as soon as possible to do so safely */
55289 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
55290 	/* Self Reset on PCIe Reset */
55291 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST   UINT32_C(0x2)
55292 	/* Self Reset immediately after notification to all clients. */
55293 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
55294 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST		HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
55295 	/*
55296 	 * Indicate which host is being reset. 0 means first host.
55297 	 * Only valid when embedded_proc_type is host in multihost
55298 	 * environment
55299 	 */
55300 	uint8_t	host_idx;
55301 	uint8_t	flags;
55302 	/*
55303 	 * When this bit is '1', then the core firmware initiates
55304 	 * the reset only after graceful shut down of all registered instances.
55305 	 * If not, the device will continue with the existing firmware.
55306 	 */
55307 	#define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL	UINT32_C(0x1)
55308 	/*
55309 	 * When this bit is '1', then drivers will be notified that
55310 	 * that the purpose of the reset was a firmware activation.
55311 	 * Such notifications are delivered via the RESET_NOTIFY async
55312 	 * event (reason_code: fw_activation).
55313 	 */
55314 	#define HWRM_FW_RESET_INPUT_FLAGS_FW_ACTIVATION	UINT32_C(0x2)
55315 	uint8_t	unused_0[4];
55316 } hwrm_fw_reset_input_t, *phwrm_fw_reset_input_t;
55317 
55318 /* hwrm_fw_reset_output (size:128b/16B) */
55319 
55320 typedef struct hwrm_fw_reset_output {
55321 	/* The specific error status for the command. */
55322 	uint16_t	error_code;
55323 	/* The HWRM command request type. */
55324 	uint16_t	req_type;
55325 	/* The sequence ID from the original command. */
55326 	uint16_t	seq_id;
55327 	/* The length of the response data in number of bytes. */
55328 	uint16_t	resp_len;
55329 	/* Type of self reset. */
55330 	uint8_t	selfrst_status;
55331 	/* No Self Reset */
55332 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
55333 	/* Self Reset as soon as possible to do so safely */
55334 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
55335 	/* Self Reset on PCIe Reset */
55336 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST   UINT32_C(0x2)
55337 	/* Self Reset immediately after notification to all clients. */
55338 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
55339 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST		HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
55340 	uint8_t	unused_0[6];
55341 	/*
55342 	 * This field is used in Output records to indicate that the output
55343 	 * is completely written to RAM.  This field should be read as '1'
55344 	 * to indicate that the output has been completely written.
55345 	 * When writing a command completion or response to an internal processor,
55346 	 * the order of writes has to be such that this field is written last.
55347 	 */
55348 	uint8_t	valid;
55349 } hwrm_fw_reset_output_t, *phwrm_fw_reset_output_t;
55350 
55351 /*******************
55352  * hwrm_fw_qstatus *
55353  *******************/
55354 
55355 
55356 /* hwrm_fw_qstatus_input (size:192b/24B) */
55357 
55358 typedef struct hwrm_fw_qstatus_input {
55359 	/* The HWRM command request type. */
55360 	uint16_t	req_type;
55361 	/*
55362 	 * The completion ring to send the completion event on. This should
55363 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55364 	 */
55365 	uint16_t	cmpl_ring;
55366 	/*
55367 	 * The sequence ID is used by the driver for tracking multiple
55368 	 * commands. This ID is treated as opaque data by the firmware and
55369 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55370 	 */
55371 	uint16_t	seq_id;
55372 	/*
55373 	 * The target ID of the command:
55374 	 * * 0x0-0xFFF8 - The function ID
55375 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55376 	 * * 0xFFFD - Reserved for user-space HWRM interface
55377 	 * * 0xFFFF - HWRM
55378 	 */
55379 	uint16_t	target_id;
55380 	/*
55381 	 * A physical address pointer pointing to a host buffer that the
55382 	 * command's response data will be written. This can be either a host
55383 	 * physical address (HPA) or a guest physical address (GPA) and must
55384 	 * point to a physically contiguous block of memory.
55385 	 */
55386 	uint64_t	resp_addr;
55387 	/* Type of embedded processor. */
55388 	uint8_t	embedded_proc_type;
55389 	/* Boot Processor */
55390 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_BOOT	UINT32_C(0x0)
55391 	/* Management Processor */
55392 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_MGMT	UINT32_C(0x1)
55393 	/* Network control processor */
55394 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_NETCTRL UINT32_C(0x2)
55395 	/* RoCE control processor */
55396 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_ROCE	UINT32_C(0x3)
55397 	/* Host (in multi-host environment): This is only valid if requester is IPC */
55398 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_HOST	UINT32_C(0x4)
55399 	/* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
55400 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_AP	UINT32_C(0x5)
55401 	/* Reset all blocks of the chip (including all processors) */
55402 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP	UINT32_C(0x6)
55403 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_LAST   HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP
55404 	uint8_t	unused_0[7];
55405 } hwrm_fw_qstatus_input_t, *phwrm_fw_qstatus_input_t;
55406 
55407 /* hwrm_fw_qstatus_output (size:128b/16B) */
55408 
55409 typedef struct hwrm_fw_qstatus_output {
55410 	/* The specific error status for the command. */
55411 	uint16_t	error_code;
55412 	/* The HWRM command request type. */
55413 	uint16_t	req_type;
55414 	/* The sequence ID from the original command. */
55415 	uint16_t	seq_id;
55416 	/* The length of the response data in number of bytes. */
55417 	uint16_t	resp_len;
55418 	/* Type of self reset. */
55419 	uint8_t	selfrst_status;
55420 	/* No Self Reset */
55421 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
55422 	/* Self Reset as soon as possible to do so safely */
55423 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
55424 	/* Self Reset on PCIe Reset */
55425 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
55426 	/* NIC power cycle (system cold boot) required */
55427 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER   UINT32_C(0x3)
55428 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_LAST	HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER
55429 	/*
55430 	 * The action needed to apply any pend nvm option changes.
55431 	 * If multiple options have been set the highest level
55432 	 * action is reported.
55433 	 */
55434 	uint8_t	nvm_option_action_status;
55435 	/* No Action needed */
55436 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_NONE	UINT32_C(0x0)
55437 	/* Hot reset needed to apply nvm options */
55438 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_HOTRESET UINT32_C(0x1)
55439 	/* Warm boot needed to apply nvm options */
55440 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_WARMBOOT UINT32_C(0x2)
55441 	/* Cold boot needed to apply nvm options */
55442 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT UINT32_C(0x3)
55443 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_LAST		HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT
55444 	uint8_t	unused_0[5];
55445 	/*
55446 	 * This field is used in Output records to indicate that the output
55447 	 * is completely written to RAM.  This field should be read as '1'
55448 	 * to indicate that the output has been completely written.
55449 	 * When writing a command completion or response to an internal processor,
55450 	 * the order of writes has to be such that this field is written last.
55451 	 */
55452 	uint8_t	valid;
55453 } hwrm_fw_qstatus_output_t, *phwrm_fw_qstatus_output_t;
55454 
55455 /********************
55456  * hwrm_fw_set_time *
55457  ********************/
55458 
55459 
55460 /* hwrm_fw_set_time_input (size:256b/32B) */
55461 
55462 typedef struct hwrm_fw_set_time_input {
55463 	/* The HWRM command request type. */
55464 	uint16_t	req_type;
55465 	/*
55466 	 * The completion ring to send the completion event on. This should
55467 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55468 	 */
55469 	uint16_t	cmpl_ring;
55470 	/*
55471 	 * The sequence ID is used by the driver for tracking multiple
55472 	 * commands. This ID is treated as opaque data by the firmware and
55473 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55474 	 */
55475 	uint16_t	seq_id;
55476 	/*
55477 	 * The target ID of the command:
55478 	 * * 0x0-0xFFF8 - The function ID
55479 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55480 	 * * 0xFFFD - Reserved for user-space HWRM interface
55481 	 * * 0xFFFF - HWRM
55482 	 */
55483 	uint16_t	target_id;
55484 	/*
55485 	 * A physical address pointer pointing to a host buffer that the
55486 	 * command's response data will be written. This can be either a host
55487 	 * physical address (HPA) or a guest physical address (GPA) and must
55488 	 * point to a physically contiguous block of memory.
55489 	 */
55490 	uint64_t	resp_addr;
55491 	/* Current year */
55492 	uint16_t	year;
55493 	/* Date/time is not known */
55494 	#define HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN UINT32_C(0x0)
55495 	#define HWRM_FW_SET_TIME_INPUT_YEAR_LAST   HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN
55496 	/* Current month of year (1-12) */
55497 	uint8_t	month;
55498 	/* Current day of month (1-31) */
55499 	uint8_t	day;
55500 	/* Current hour (0-23) */
55501 	uint8_t	hour;
55502 	/* Current minute (0-59) */
55503 	uint8_t	minute;
55504 	/* Current second (0-59) */
55505 	uint8_t	second;
55506 	uint8_t	unused_0;
55507 	/* Current millisecond (0-999) */
55508 	uint16_t	millisecond;
55509 	/* Minutes east of UTC, 0xffff if TZ is not known */
55510 	int16_t	zone;
55511 	/* Time zone is Coordinated Universal Time (UTC) */
55512 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UTC	0
55513 	/* Time zone is not known */
55514 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN 65535
55515 	#define HWRM_FW_SET_TIME_INPUT_ZONE_LAST   HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN
55516 	uint8_t	unused_1[4];
55517 } hwrm_fw_set_time_input_t, *phwrm_fw_set_time_input_t;
55518 
55519 /* hwrm_fw_set_time_output (size:128b/16B) */
55520 
55521 typedef struct hwrm_fw_set_time_output {
55522 	/* The specific error status for the command. */
55523 	uint16_t	error_code;
55524 	/* The HWRM command request type. */
55525 	uint16_t	req_type;
55526 	/* The sequence ID from the original command. */
55527 	uint16_t	seq_id;
55528 	/* The length of the response data in number of bytes. */
55529 	uint16_t	resp_len;
55530 	uint8_t	unused_0[7];
55531 	/*
55532 	 * This field is used in Output records to indicate that the output
55533 	 * is completely written to RAM.  This field should be read as '1'
55534 	 * to indicate that the output has been completely written.
55535 	 * When writing a command completion or response to an internal processor,
55536 	 * the order of writes has to be such that this field is written last.
55537 	 */
55538 	uint8_t	valid;
55539 } hwrm_fw_set_time_output_t, *phwrm_fw_set_time_output_t;
55540 
55541 /********************
55542  * hwrm_fw_get_time *
55543  ********************/
55544 
55545 
55546 /* hwrm_fw_get_time_input (size:128b/16B) */
55547 
55548 typedef struct hwrm_fw_get_time_input {
55549 	/* The HWRM command request type. */
55550 	uint16_t	req_type;
55551 	/*
55552 	 * The completion ring to send the completion event on. This should
55553 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55554 	 */
55555 	uint16_t	cmpl_ring;
55556 	/*
55557 	 * The sequence ID is used by the driver for tracking multiple
55558 	 * commands. This ID is treated as opaque data by the firmware and
55559 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55560 	 */
55561 	uint16_t	seq_id;
55562 	/*
55563 	 * The target ID of the command:
55564 	 * * 0x0-0xFFF8 - The function ID
55565 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55566 	 * * 0xFFFD - Reserved for user-space HWRM interface
55567 	 * * 0xFFFF - HWRM
55568 	 */
55569 	uint16_t	target_id;
55570 	/*
55571 	 * A physical address pointer pointing to a host buffer that the
55572 	 * command's response data will be written. This can be either a host
55573 	 * physical address (HPA) or a guest physical address (GPA) and must
55574 	 * point to a physically contiguous block of memory.
55575 	 */
55576 	uint64_t	resp_addr;
55577 } hwrm_fw_get_time_input_t, *phwrm_fw_get_time_input_t;
55578 
55579 /* hwrm_fw_get_time_output (size:192b/24B) */
55580 
55581 typedef struct hwrm_fw_get_time_output {
55582 	/* The specific error status for the command. */
55583 	uint16_t	error_code;
55584 	/* The HWRM command request type. */
55585 	uint16_t	req_type;
55586 	/* The sequence ID from the original command. */
55587 	uint16_t	seq_id;
55588 	/* The length of the response data in number of bytes. */
55589 	uint16_t	resp_len;
55590 	/* Current year */
55591 	uint16_t	year;
55592 	/* Date/time is not known */
55593 	#define HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN UINT32_C(0x0)
55594 	#define HWRM_FW_GET_TIME_OUTPUT_YEAR_LAST   HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN
55595 	/* Current month of year (1-12) */
55596 	uint8_t	month;
55597 	/* Current day of month (1-31) */
55598 	uint8_t	day;
55599 	/* Current hour (0-23) */
55600 	uint8_t	hour;
55601 	/* Current minute (0-59) */
55602 	uint8_t	minute;
55603 	/* Current second (0-59) */
55604 	uint8_t	second;
55605 	uint8_t	unused_0;
55606 	/* Current millisecond (0-999) */
55607 	uint16_t	millisecond;
55608 	/* Minutes east of UTC, 0xffff if TZ is not known */
55609 	int16_t	zone;
55610 	/* Time zone is Coordinated Universal Time (UTC) */
55611 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UTC	0
55612 	/* Time zone is not known */
55613 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN 65535
55614 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_LAST   HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN
55615 	uint8_t	unused_1[3];
55616 	/*
55617 	 * This field is used in Output records to indicate that the output
55618 	 * is completely written to RAM.  This field should be read as '1'
55619 	 * to indicate that the output has been completely written.
55620 	 * When writing a command completion or response to an internal processor,
55621 	 * the order of writes has to be such that this field is written last.
55622 	 */
55623 	uint8_t	valid;
55624 } hwrm_fw_get_time_output_t, *phwrm_fw_get_time_output_t;
55625 
55626 /* hwrm_struct_hdr (size:128b/16B) */
55627 
55628 typedef struct hwrm_struct_hdr {
55629 	/* This value indicates the structured data ID. */
55630 	uint16_t	struct_id;
55631 	/* LLDP configuration structured data ID. */
55632 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_CFG	UINT32_C(0x41b)
55633 	/* DCBX ETS configuration structured data ID. */
55634 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_ETS	UINT32_C(0x41d)
55635 	/* DCBX PFC configuration structured data ID. */
55636 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_PFC	UINT32_C(0x41f)
55637 	/* DCBX APP configuration structured data ID. */
55638 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP	UINT32_C(0x421)
55639 	/* DCBX state configuration structured data ID for all DCBX features. */
55640 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_FEATURE_STATE UINT32_C(0x422)
55641 	/* LLDP generic structured data ID. This is used with GET_STRUCTURED_DATA only. */
55642 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_GENERIC	UINT32_C(0x424)
55643 	/* LLDP device structured data ID. This is used with GET_STRUCTURED_DATA only. */
55644 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_DEVICE	UINT32_C(0x426)
55645 	/* Power Backup info */
55646 	#define HWRM_STRUCT_HDR_STRUCT_ID_POWER_BKUP	UINT32_C(0x427)
55647 	/* reserved for AFM usage. */
55648 	#define HWRM_STRUCT_HDR_STRUCT_ID_AFM_OPAQUE	UINT32_C(0x1)
55649 	/* Port description. */
55650 	#define HWRM_STRUCT_HDR_STRUCT_ID_PORT_DESCRIPTION   UINT32_C(0xa)
55651 	/* RSSv2 Configuration. */
55652 	#define HWRM_STRUCT_HDR_STRUCT_ID_RSS_V2		UINT32_C(0x64)
55653 	/* MSI-X vectors per VF table. */
55654 	#define HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF	UINT32_C(0xc8)
55655 	#define HWRM_STRUCT_HDR_STRUCT_ID_LAST		HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF
55656 	/* This value indicates the length of structured data. */
55657 	uint16_t	len;
55658 	/* This value indicates the version of structured data. */
55659 	uint8_t	version;
55660 	/* This value indicates the number of structured data elements. */
55661 	uint8_t	count;
55662 	/* This value indicates the subtype. */
55663 	uint16_t	subtype;
55664 	/*
55665 	 * This value indicates the count of 64-bit values that point to the next header.
55666 	 * A value of 0 means that this is the last element.  The value is a count of 64-bit
55667 	 * words from the beginning of the current header.
55668 	 */
55669 	uint16_t	next_offset;
55670 	/* This value indicates this is the last element */
55671 	#define HWRM_STRUCT_HDR_NEXT_OFFSET_LAST UINT32_C(0x0)
55672 	uint8_t	unused_0[6];
55673 } hwrm_struct_hdr_t, *phwrm_struct_hdr_t;
55674 
55675 /* hwrm_struct_data_dcbx_ets (size:256b/32B) */
55676 
55677 typedef struct hwrm_struct_data_dcbx_ets {
55678 	/*
55679 	 * This field indicates if this configuration is ETS recommendation or ETS configuration.
55680 	 * A value 1 means it is ETS configuration, A value of 2 means it is a ETS recommendation.
55681 	 */
55682 	uint8_t	destination;
55683 	/* ETS configuration */
55684 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_CONFIGURATION   UINT32_C(0x1)
55685 	/* ETS recommendation */
55686 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION UINT32_C(0x2)
55687 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_LAST	HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION
55688 	/* This value indicates maximum ETS TCs supported. */
55689 	uint8_t	max_tcs;
55690 	/* unused. */
55691 	uint16_t	unused1;
55692 	/* ETS priority 0 to TC map. */
55693 	uint8_t	pri0_to_tc_map;
55694 	/* ETS priority 1 to TC map. */
55695 	uint8_t	pri1_to_tc_map;
55696 	/* ETS priority 2 to TC map. */
55697 	uint8_t	pri2_to_tc_map;
55698 	/* ETS priority 3 to TC map. */
55699 	uint8_t	pri3_to_tc_map;
55700 	/* ETS priority 4 to TC map. */
55701 	uint8_t	pri4_to_tc_map;
55702 	/* ETS priority 5 to TC map. */
55703 	uint8_t	pri5_to_tc_map;
55704 	/* ETS priority 6 to TC map. */
55705 	uint8_t	pri6_to_tc_map;
55706 	/* ETS priority 7 to TC map. */
55707 	uint8_t	pri7_to_tc_map;
55708 	/* ETS TC 0 to bandwidth map. */
55709 	uint8_t	tc0_to_bw_map;
55710 	/* ETS TC 1 to bandwidth map. */
55711 	uint8_t	tc1_to_bw_map;
55712 	/* ETS TC 2 to bandwidth map. */
55713 	uint8_t	tc2_to_bw_map;
55714 	/* ETS TC 3 to bandwidth map. */
55715 	uint8_t	tc3_to_bw_map;
55716 	/* ETS TC 4 to bandwidth map. */
55717 	uint8_t	tc4_to_bw_map;
55718 	/* ETS TC 5 to bandwidth map. */
55719 	uint8_t	tc5_to_bw_map;
55720 	/* ETS TC 6 to bandwidth map. */
55721 	uint8_t	tc6_to_bw_map;
55722 	/* ETS TC 7 to bandwidth map. */
55723 	uint8_t	tc7_to_bw_map;
55724 	/* ETS TC 0 to TSA map. */
55725 	uint8_t	tc0_to_tsa_map;
55726 	/* strict priority */
55727 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_SP		UINT32_C(0x0)
55728 	/* credit based shaper */
55729 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_CBS		UINT32_C(0x1)
55730 	/* ETS */
55731 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_ETS		UINT32_C(0x2)
55732 	/* vendor specific */
55733 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC UINT32_C(0xff)
55734 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_LAST			HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC
55735 	/* ETS TC 1 to TSA map. */
55736 	uint8_t	tc1_to_tsa_map;
55737 	/* ETS TC 2 to TSA map. */
55738 	uint8_t	tc2_to_tsa_map;
55739 	/* ETS TC 3 to TSA map. */
55740 	uint8_t	tc3_to_tsa_map;
55741 	/* ETS TC 4 to TSA map. */
55742 	uint8_t	tc4_to_tsa_map;
55743 	/* ETS TC 5 to TSA map. */
55744 	uint8_t	tc5_to_tsa_map;
55745 	/* ETS TC 6 to TSA map. */
55746 	uint8_t	tc6_to_tsa_map;
55747 	/* ETS TC 7 to TSA map. */
55748 	uint8_t	tc7_to_tsa_map;
55749 	uint8_t	unused_0[4];
55750 } hwrm_struct_data_dcbx_ets_t, *phwrm_struct_data_dcbx_ets_t;
55751 
55752 /* hwrm_struct_data_dcbx_pfc (size:64b/8B) */
55753 
55754 typedef struct hwrm_struct_data_dcbx_pfc {
55755 	/*
55756 	 * This field indicates PFC priority bit map. A value of '0' indicates PFC
55757 	 * 		is disabled. A value of '1' indicates PFC is enabled on that priority.
55758 	 */
55759 	uint8_t	pfc_priority_bitmap;
55760 	/*
55761 	 * This field indicates max PFC TCs supported. Each PFC TC will map to
55762 	 * a lossless CoS queue.
55763 	 */
55764 	uint8_t	max_pfc_tcs;
55765 	/*
55766 	 * This field indicates if MACSec bypass capability is enabled. A value
55767 	 * of '1' indicates MBC is enabled. A value of '0' indicates MBC is disabled.
55768 	 */
55769 	uint8_t	mbc;
55770 	uint8_t	unused_0[5];
55771 } hwrm_struct_data_dcbx_pfc_t, *phwrm_struct_data_dcbx_pfc_t;
55772 
55773 /* hwrm_struct_data_dcbx_app (size:64b/8B) */
55774 
55775 typedef struct hwrm_struct_data_dcbx_app {
55776 	/*
55777 	 * This field indicates the protocol identifier. This should be specified
55778 	 *		in big endian format.
55779 	 */
55780 	uint16_t	protocol_id;
55781 	/*
55782 	 * This field indicates the protocol selector. The valid values are
55783 	 *		mentioned below.
55784 	 */
55785 	uint8_t	protocol_selector;
55786 	/* ether type */
55787 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_ETHER_TYPE   UINT32_C(0x1)
55788 	/* TCP port */
55789 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_PORT	UINT32_C(0x2)
55790 	/* UDP port */
55791 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_UDP_PORT	UINT32_C(0x3)
55792 	/* TCP & UDP port */
55793 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT UINT32_C(0x4)
55794 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_LAST	HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT
55795 	/* This field indicates application priority. */
55796 	uint8_t	priority;
55797 	/* This field indicates this entry is valid. */
55798 	uint8_t	valid;
55799 	uint8_t	unused_0[3];
55800 } hwrm_struct_data_dcbx_app_t, *phwrm_struct_data_dcbx_app_t;
55801 
55802 /* hwrm_struct_data_dcbx_feature_state (size:64b/8B) */
55803 
55804 typedef struct hwrm_struct_data_dcbx_feature_state {
55805 	/* DCBX mode - IEEE or CEE. This is read only field. */
55806 	uint8_t	dcbx_mode;
55807 	/* DCBX disabled mode. */
55808 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_DISABLED UINT32_C(0x0)
55809 	/* DCBX IEEE mode. */
55810 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_IEEE	UINT32_C(0x1)
55811 	/* DCBX CEE mode. */
55812 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE	UINT32_C(0x2)
55813 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_LAST	HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE
55814 	/* ETS TLV state. */
55815 	uint8_t	ets_state;
55816 	/* PFC TLV state. */
55817 	uint8_t	pfc_state;
55818 	/* App TLV state. */
55819 	uint8_t	app_state;
55820 	/* Feature enable bit position. */
55821 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ENABLE_BIT_POS	UINT32_C(0x7)
55822 	/* Feature willing bit position. */
55823 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_WILLING_BIT_POS   UINT32_C(0x6)
55824 	/* Feature advertise bit position. */
55825 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS UINT32_C(0x5)
55826 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_LAST		HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS
55827 	/* unused. */
55828 	uint8_t	unused[3];
55829 	/* This field is used to reset the DCBX configuration to factory defaults. */
55830 	uint8_t	resets;
55831 	/* reset ETS configuration. */
55832 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_ETS   UINT32_C(0x1)
55833 	/* reset PFC configuration. */
55834 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_PFC   UINT32_C(0x2)
55835 	/* reset application configuration. */
55836 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_APP   UINT32_C(0x4)
55837 	/* reset DCBX state configuration. */
55838 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE UINT32_C(0x8)
55839 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_LAST	HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE
55840 } hwrm_struct_data_dcbx_feature_state_t, *phwrm_struct_data_dcbx_feature_state_t;
55841 
55842 /* hwrm_struct_data_lldp (size:64b/8B) */
55843 
55844 typedef struct hwrm_struct_data_lldp {
55845 	/* Port admin state */
55846 	uint8_t	admin_state;
55847 	/* Disable both Tx and Rx */
55848 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_DISABLE UINT32_C(0x0)
55849 	/* Enable Tx only */
55850 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_TX	UINT32_C(0x1)
55851 	/* Enable Rx only */
55852 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_RX	UINT32_C(0x2)
55853 	/* Enable both Tx and Rx */
55854 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE  UINT32_C(0x3)
55855 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_LAST   HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE
55856 	/* Port description TLV transmit state (enable(1)/disable(0)). */
55857 	uint8_t	port_description_state;
55858 	/* Disable */
55859 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_DISABLE UINT32_C(0x0)
55860 	/* Enable. */
55861 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE  UINT32_C(0x1)
55862 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_LAST   HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE
55863 	/* System name TLV transmit state (enable(1)/disable(0)). */
55864 	uint8_t	system_name_state;
55865 	/* Disable */
55866 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_DISABLE UINT32_C(0x0)
55867 	/* Enable. */
55868 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE  UINT32_C(0x1)
55869 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE
55870 	/* System description TLV transmit state (enable(1)/disable(0)). */
55871 	uint8_t	system_desc_state;
55872 	/* Disable */
55873 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_DISABLE UINT32_C(0x0)
55874 	/* Enable. */
55875 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE  UINT32_C(0x1)
55876 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE
55877 	/* System capabilities TLV transmit state (enable(1)/disable(0)). */
55878 	uint8_t	system_cap_state;
55879 	/* Disable */
55880 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_DISABLE UINT32_C(0x0)
55881 	/* Enable. */
55882 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE  UINT32_C(0x1)
55883 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE
55884 	/* Management address TLV transmit state (enable(1)/disable(0)). */
55885 	uint8_t	mgmt_addr_state;
55886 	/* Disable */
55887 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_DISABLE UINT32_C(0x0)
55888 	/* Enable. */
55889 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE  UINT32_C(0x1)
55890 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_LAST   HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE
55891 	/* Async event notification state (enable(1)/disable(0)). */
55892 	uint8_t	async_event_notification_state;
55893 	/* Disable */
55894 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_DISABLE UINT32_C(0x0)
55895 	/* Enable. */
55896 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE  UINT32_C(0x1)
55897 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_LAST   HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE
55898 	uint8_t	unused_0;
55899 } hwrm_struct_data_lldp_t, *phwrm_struct_data_lldp_t;
55900 
55901 /* hwrm_struct_data_lldp_generic (size:2112b/264B) */
55902 
55903 typedef struct hwrm_struct_data_lldp_generic {
55904 	/* TLV type. */
55905 	uint8_t	tlv_type;
55906 	/* Chassis ID TLV */
55907 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_CHASSIS		UINT32_C(0x1)
55908 	/* Port ID TLV */
55909 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT		UINT32_C(0x2)
55910 	/* System name TLV */
55911 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_NAME	UINT32_C(0x3)
55912 	/* System description TLV */
55913 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_DESCRIPTION UINT32_C(0x4)
55914 	/* Port name TLV */
55915 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_NAME	UINT32_C(0x5)
55916 	/* Port description TLV */
55917 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION   UINT32_C(0x6)
55918 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_LAST		HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION
55919 	/* TLV sub-type. */
55920 	uint8_t	subtype;
55921 	/* Length. */
55922 	uint8_t	length;
55923 	/* unused. */
55924 	uint8_t	unused1[5];
55925 	/* TLV value. */
55926 	uint32_t	tlv_value[64];
55927 } hwrm_struct_data_lldp_generic_t, *phwrm_struct_data_lldp_generic_t;
55928 
55929 /* hwrm_struct_data_lldp_device (size:1472b/184B) */
55930 
55931 typedef struct hwrm_struct_data_lldp_device {
55932 	/* Time to Live. */
55933 	uint16_t	ttl;
55934 	/* Management address length. */
55935 	uint8_t	mgmt_addr_len;
55936 	/* Management address type. */
55937 	uint8_t	mgmt_addr_type;
55938 	uint8_t	unused_3[4];
55939 	/* Management address. */
55940 	uint32_t	mgmt_addr[8];
55941 	/* System capabilities. */
55942 	uint32_t	system_caps;
55943 	/* Interface number type. */
55944 	uint8_t	intf_num_type;
55945 	/* Management address OID length. */
55946 	uint8_t	mgmt_addr_oid_length;
55947 	uint8_t	unused_4[2];
55948 	/* Interface number. */
55949 	uint32_t	intf_num;
55950 	uint8_t	unused_5[4];
55951 	/* Management address OID. */
55952 	uint32_t	mgmt_addr_oid[32];
55953 } hwrm_struct_data_lldp_device_t, *phwrm_struct_data_lldp_device_t;
55954 
55955 /* hwrm_struct_data_port_description (size:64b/8B) */
55956 
55957 typedef struct hwrm_struct_data_port_description {
55958 	/*
55959 	 * Port #.  Port number starts at 0 and anything greater than number of ports
55960 	 *		minus 1 is an error.
55961 	 */
55962 	uint8_t	port_id;
55963 	uint8_t	unused_0[7];
55964 } hwrm_struct_data_port_description_t, *phwrm_struct_data_port_description_t;
55965 
55966 /* hwrm_struct_data_rss_v2 (size:128b/16B) */
55967 
55968 typedef struct hwrm_struct_data_rss_v2 {
55969 	uint16_t	flags;
55970 	/* When this bit is '1', the hash type and hash key are included. */
55971 	#define HWRM_STRUCT_DATA_RSS_V2_FLAGS_HASH_VALID	UINT32_C(0x1)
55972 	/* RSS Context index. */
55973 	uint16_t	rss_ctx_id;
55974 	/* Number ring group IDs. */
55975 	uint16_t	num_ring_groups;
55976 	uint16_t	hash_type;
55977 	/*
55978 	 * When this bit is '1', the RSS hash shall be computed
55979 	 * over source and destination IPv4 addresses of IPv4
55980 	 * packets.
55981 	 */
55982 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV4	UINT32_C(0x1)
55983 	/*
55984 	 * When this bit is '1', the RSS hash shall be computed
55985 	 * over source/destination IPv4 addresses and
55986 	 * source/destination ports of TCP/IPv4 packets.
55987 	 */
55988 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
55989 	/*
55990 	 * When this bit is '1', the RSS hash shall be computed
55991 	 * over source/destination IPv4 addresses and
55992 	 * source/destination ports of UDP/IPv4 packets.
55993 	 */
55994 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
55995 	/*
55996 	 * When this bit is '1', the RSS hash shall be computed
55997 	 * over source and destination IPv4 addresses of IPv6
55998 	 * packets.
55999 	 */
56000 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV6	UINT32_C(0x8)
56001 	/*
56002 	 * When this bit is '1', the RSS hash shall be computed
56003 	 * over source/destination IPv6 addresses and
56004 	 * source/destination ports of TCP/IPv6 packets.
56005 	 */
56006 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
56007 	/*
56008 	 * When this bit is '1', the RSS hash shall be computed
56009 	 * over source/destination IPv6 addresses and
56010 	 * source/destination ports of UDP/IPv6 packets.
56011 	 */
56012 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
56013 	/* Hash key. This field is optional. */
56014 	uint64_t	hash_key_ring_group_ids;
56015 } hwrm_struct_data_rss_v2_t, *phwrm_struct_data_rss_v2_t;
56016 
56017 /* hwrm_struct_data_power_information (size:192b/24B) */
56018 
56019 typedef struct hwrm_struct_data_power_information {
56020 	/* Backup power information version */
56021 	uint32_t	bkup_power_info_ver;
56022 	/* Platform backup power count */
56023 	uint32_t	platform_bkup_power_count;
56024 	/* Load in milli Watt */
56025 	uint32_t	load_milli_watt;
56026 	/* Backup time in milli seconds */
56027 	uint32_t	bkup_time_milli_seconds;
56028 	/* Backup power status */
56029 	uint32_t	bkup_power_status;
56030 	/* Backup power charge time */
56031 	uint32_t	bkup_power_charge_time;
56032 } hwrm_struct_data_power_information_t, *phwrm_struct_data_power_information_t;
56033 
56034 /* hwrm_struct_data_msix_per_vf (size:320b/40B) */
56035 
56036 typedef struct hwrm_struct_data_msix_per_vf {
56037 	/* PF ID */
56038 	uint16_t	pf_id;
56039 	/* Number of rows in table. */
56040 	uint16_t	count;
56041 	uint32_t	unused_0;
56042 	/* Starting VF for row 0 */
56043 	uint16_t	start_vf_0;
56044 	/* MSI-X vectors per VF for row 0 */
56045 	uint16_t	msix_0;
56046 	/* Starting VF for row 1 */
56047 	uint16_t	start_vf_1;
56048 	/* MSI-X vectors per VF for row 1 */
56049 	uint16_t	msix_1;
56050 	/* Starting VF for row 2 */
56051 	uint16_t	start_vf_2;
56052 	/* MSI-X vectors per VF for row 2 */
56053 	uint16_t	msix_2;
56054 	/* Starting VF for row 3 */
56055 	uint16_t	start_vf_3;
56056 	/* MSI-X vectors per VF for row 3 */
56057 	uint16_t	msix_3;
56058 	/* Starting VF for row 4 */
56059 	uint16_t	start_vf_4;
56060 	/* MSI-X vectors per VF for row 4 */
56061 	uint16_t	msix_4;
56062 	/* Starting VF for row 5 */
56063 	uint16_t	start_vf_5;
56064 	/* MSI-X vectors per VF for row 5 */
56065 	uint16_t	msix_5;
56066 	/* Starting VF for row 6 */
56067 	uint16_t	start_vf_6;
56068 	/* MSI-X vectors per VF for row 6 */
56069 	uint16_t	msix_6;
56070 	/* Starting VF for row 7 */
56071 	uint16_t	start_vf_7;
56072 	/* MSI-X vectors per VF for row 7 */
56073 	uint16_t	msix_7;
56074 } hwrm_struct_data_msix_per_vf_t, *phwrm_struct_data_msix_per_vf_t;
56075 
56076 /*******************************
56077  * hwrm_fw_set_structured_data *
56078  *******************************/
56079 
56080 
56081 /* hwrm_fw_set_structured_data_input (size:256b/32B) */
56082 
56083 typedef struct hwrm_fw_set_structured_data_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 	/*
56113 	 * This is the host address where
56114 	 * structured data will be copied from
56115 	 */
56116 	uint64_t	src_data_addr;
56117 	/* size of data in bytes */
56118 	uint16_t	data_len;
56119 	/*
56120 	 * a count of the number of Structured Data Headers in the data
56121 	 * pointed by src_data_addr.
56122 	 */
56123 	uint8_t	hdr_cnt;
56124 	uint8_t	unused_0[5];
56125 } hwrm_fw_set_structured_data_input_t, *phwrm_fw_set_structured_data_input_t;
56126 
56127 /* hwrm_fw_set_structured_data_output (size:128b/16B) */
56128 
56129 typedef struct hwrm_fw_set_structured_data_output {
56130 	/* The specific error status for the command. */
56131 	uint16_t	error_code;
56132 	/* The HWRM command request type. */
56133 	uint16_t	req_type;
56134 	/* The sequence ID from the original command. */
56135 	uint16_t	seq_id;
56136 	/* The length of the response data in number of bytes. */
56137 	uint16_t	resp_len;
56138 	uint8_t	unused_0[7];
56139 	/*
56140 	 * This field is used in Output records to indicate that the output
56141 	 * is completely written to RAM.  This field should be read as '1'
56142 	 * to indicate that the output has been completely written.
56143 	 * When writing a command completion or response to an internal processor,
56144 	 * the order of writes has to be such that this field is written last.
56145 	 */
56146 	uint8_t	valid;
56147 } hwrm_fw_set_structured_data_output_t, *phwrm_fw_set_structured_data_output_t;
56148 
56149 /* hwrm_fw_set_structured_data_cmd_err (size:64b/8B) */
56150 
56151 typedef struct hwrm_fw_set_structured_data_cmd_err {
56152 	/*
56153 	 * command specific error codes that goes to
56154 	 * the cmd_err field in Common HWRM Error Response.
56155 	 */
56156 	uint8_t	code;
56157 	/* Unknown error */
56158 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
56159 	/* count_of_headers is incorrect */
56160 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_HDR_CNT UINT32_C(0x1)
56161 	/* data improperly formatted */
56162 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_FMT	UINT32_C(0x2)
56163 	/* unknown structure ID(s) */
56164 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID	UINT32_C(0x3)
56165 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_LAST	HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID
56166 	uint8_t	unused_0[7];
56167 } hwrm_fw_set_structured_data_cmd_err_t, *phwrm_fw_set_structured_data_cmd_err_t;
56168 
56169 /*******************************
56170  * hwrm_fw_get_structured_data *
56171  *******************************/
56172 
56173 
56174 /* hwrm_fw_get_structured_data_input (size:256b/32B) */
56175 
56176 typedef struct hwrm_fw_get_structured_data_input {
56177 	/* The HWRM command request type. */
56178 	uint16_t	req_type;
56179 	/*
56180 	 * The completion ring to send the completion event on. This should
56181 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56182 	 */
56183 	uint16_t	cmpl_ring;
56184 	/*
56185 	 * The sequence ID is used by the driver for tracking multiple
56186 	 * commands. This ID is treated as opaque data by the firmware and
56187 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56188 	 */
56189 	uint16_t	seq_id;
56190 	/*
56191 	 * The target ID of the command:
56192 	 * * 0x0-0xFFF8 - The function ID
56193 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56194 	 * * 0xFFFD - Reserved for user-space HWRM interface
56195 	 * * 0xFFFF - HWRM
56196 	 */
56197 	uint16_t	target_id;
56198 	/*
56199 	 * A physical address pointer pointing to a host buffer that the
56200 	 * command's response data will be written. This can be either a host
56201 	 * physical address (HPA) or a guest physical address (GPA) and must
56202 	 * point to a physically contiguous block of memory.
56203 	 */
56204 	uint64_t	resp_addr;
56205 	/*
56206 	 * This is the host address where
56207 	 * structured data will be copied to
56208 	 */
56209 	uint64_t	dest_data_addr;
56210 	/* size of data in bytes */
56211 	uint16_t	data_len;
56212 	/*
56213 	 * Structure_id is the id of the structure data requesting and count is a
56214 	 * requested number of instances of this data requested.  The actual number
56215 	 * will be returned in count_of_headers
56216 	 */
56217 	uint16_t	structure_id;
56218 	/*
56219 	 * Subtype is an optional field used to specify additional information of the data
56220 	 * being retrieved.  For example, if data can be categorized as "live" vs "saved"
56221 	 * then this field can be used to provide an indication of "saved" vs "live" data.
56222 	 * Not all structured data supports subtypes and if they are supported then the
56223 	 * structured data will specify the valid values.  If structured data is requested
56224 	 * that supports subtypes but no subtype is given then it is implementation specific
56225 	 * what will be returned.  Some structure data can support a subtype of "All" which
56226 	 * would cause a list of structures to be returned for all supported subtypes.  "All"
56227 	 * is only used on the hwrm_get_structured_data command.
56228 	 */
56229 	uint16_t	subtype;
56230 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_UNUSED		UINT32_C(0x0)
56231 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_ALL			UINT32_C(0xffff)
56232 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_ADMIN	UINT32_C(0x100)
56233 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_PEER	UINT32_C(0x101)
56234 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_OPERATIONAL UINT32_C(0x102)
56235 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_ADMIN	UINT32_C(0x200)
56236 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_PEER	UINT32_C(0x201)
56237 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_OPERATIONAL	UINT32_C(0x202)
56238 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_HOST_OPERATIONAL	UINT32_C(0x300)
56239 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_LAST		HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_HOST_OPERATIONAL
56240 	/* Number of elements.  This allows support of arrayed data */
56241 	uint8_t	count;
56242 	uint8_t	unused_0;
56243 } hwrm_fw_get_structured_data_input_t, *phwrm_fw_get_structured_data_input_t;
56244 
56245 /* hwrm_fw_get_structured_data_output (size:128b/16B) */
56246 
56247 typedef struct hwrm_fw_get_structured_data_output {
56248 	/* The specific error status for the command. */
56249 	uint16_t	error_code;
56250 	/* The HWRM command request type. */
56251 	uint16_t	req_type;
56252 	/* The sequence ID from the original command. */
56253 	uint16_t	seq_id;
56254 	/* The length of the response data in number of bytes. */
56255 	uint16_t	resp_len;
56256 	/*
56257 	 * a count of the number of Structured Data Headers in the data
56258 	 * pointed by dest_data_addr.
56259 	 */
56260 	uint8_t	hdr_cnt;
56261 	uint8_t	unused_0[6];
56262 	/*
56263 	 * This field is used in Output records to indicate that the output
56264 	 * is completely written to RAM.  This field should be read as '1'
56265 	 * to indicate that the output has been completely written.
56266 	 * When writing a command completion or response to an internal processor,
56267 	 * the order of writes has to be such that this field is written last.
56268 	 */
56269 	uint8_t	valid;
56270 } hwrm_fw_get_structured_data_output_t, *phwrm_fw_get_structured_data_output_t;
56271 
56272 /* hwrm_fw_get_structured_data_cmd_err (size:64b/8B) */
56273 
56274 typedef struct hwrm_fw_get_structured_data_cmd_err {
56275 	/*
56276 	 * command specific error codes that goes to
56277 	 * the cmd_err field in Common HWRM Error Response.
56278 	 */
56279 	uint8_t	code;
56280 	/* Unknown error */
56281 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
56282 	/* unknown structure ID(s) */
56283 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID  UINT32_C(0x3)
56284 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_LAST   HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID
56285 	uint8_t	unused_0[7];
56286 } hwrm_fw_get_structured_data_cmd_err_t, *phwrm_fw_get_structured_data_cmd_err_t;
56287 
56288 /*******************
56289  * hwrm_fw_ipc_msg *
56290  *******************/
56291 
56292 
56293 /* hwrm_fw_ipc_msg_input (size:320b/40B) */
56294 
56295 typedef struct hwrm_fw_ipc_msg_input {
56296 	/* The HWRM command request type. */
56297 	uint16_t	req_type;
56298 	/*
56299 	 * The completion ring to send the completion event on. This should
56300 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56301 	 */
56302 	uint16_t	cmpl_ring;
56303 	/*
56304 	 * The sequence ID is used by the driver for tracking multiple
56305 	 * commands. This ID is treated as opaque data by the firmware and
56306 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56307 	 */
56308 	uint16_t	seq_id;
56309 	/*
56310 	 * The target ID of the command:
56311 	 * * 0x0-0xFFF8 - The function ID
56312 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56313 	 * * 0xFFFD - Reserved for user-space HWRM interface
56314 	 * * 0xFFFF - HWRM
56315 	 */
56316 	uint16_t	target_id;
56317 	/*
56318 	 * A physical address pointer pointing to a host buffer that the
56319 	 * command's response data will be written. This can be either a host
56320 	 * physical address (HPA) or a guest physical address (GPA) and must
56321 	 * point to a physically contiguous block of memory.
56322 	 */
56323 	uint64_t	resp_addr;
56324 	uint32_t	enables;
56325 	/*
56326 	 * This bit must be '1' for the command_id field to be
56327 	 * configured.
56328 	 */
56329 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_COMMAND_ID	UINT32_C(0x1)
56330 	/*
56331 	 * This bit must be '1' for the src_processor field to be
56332 	 * configured.
56333 	 */
56334 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_SRC_PROCESSOR	UINT32_C(0x2)
56335 	/*
56336 	 * This bit must be '1' for the data_offset field to be
56337 	 * configured.
56338 	 */
56339 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_DATA_OFFSET	UINT32_C(0x4)
56340 	/*
56341 	 * This bit must be '1' for the length field to be
56342 	 * configured.
56343 	 */
56344 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_LENGTH		UINT32_C(0x8)
56345 	/* Command ID */
56346 	uint16_t	command_id;
56347 	/* RoCE LAG message */
56348 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_ROCE_LAG UINT32_C(0x1)
56349 	/* Query information on PF mapping for x86 and MAIA. */
56350 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_MHB_HOST UINT32_C(0x2)
56351 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_LAST	HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_MHB_HOST
56352 	/* Source processor for this command. */
56353 	uint8_t	src_processor;
56354 	/* Chimp processor */
56355 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_CFW  UINT32_C(0x1)
56356 	/* BONO processor */
56357 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_BONO UINT32_C(0x2)
56358 	/* APE processor */
56359 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_APE  UINT32_C(0x3)
56360 	/* KONG processor */
56361 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_KONG UINT32_C(0x4)
56362 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_LAST HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_KONG
56363 	uint8_t	unused_0;
56364 	/* Offset of the data in the source processor memory. */
56365 	uint32_t	data_offset;
56366 	/* Length of the data in source processor. */
56367 	uint16_t	length;
56368 	uint8_t	unused_1[2];
56369 	/* This is for storing FW opaque data. */
56370 	uint64_t	opaque;
56371 } hwrm_fw_ipc_msg_input_t, *phwrm_fw_ipc_msg_input_t;
56372 
56373 /* hwrm_fw_ipc_msg_output (size:256b/32B) */
56374 
56375 typedef struct hwrm_fw_ipc_msg_output {
56376 	/* The specific error status for the command. */
56377 	uint16_t	error_code;
56378 	/* The HWRM command request type. */
56379 	uint16_t	req_type;
56380 	/* The sequence ID from the original command. */
56381 	uint16_t	seq_id;
56382 	/* The length of the response data in number of bytes. */
56383 	uint16_t	resp_len;
56384 	uint32_t	msg_data_1;
56385 	uint32_t	msg_data_2;
56386 	uint64_t	reserved64;
56387 	uint8_t	reserved48[7];
56388 	/*
56389 	 * This field is used in Output records to indicate that the output
56390 	 * is completely written to RAM.  This field should be read as '1'
56391 	 * to indicate that the output has been completely written.
56392 	 * When writing a command completion or response to an internal processor,
56393 	 * the order of writes has to be such that this field is written last.
56394 	 */
56395 	uint8_t	valid;
56396 } hwrm_fw_ipc_msg_output_t, *phwrm_fw_ipc_msg_output_t;
56397 
56398 /***********************
56399  * hwrm_fw_ipc_mailbox *
56400  ***********************/
56401 
56402 
56403 /* hwrm_fw_ipc_mailbox_input (size:256b/32B) */
56404 
56405 typedef struct hwrm_fw_ipc_mailbox_input {
56406 	/* The HWRM command request type. */
56407 	uint16_t	req_type;
56408 	/*
56409 	 * The completion ring to send the completion event on. This should
56410 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56411 	 */
56412 	uint16_t	cmpl_ring;
56413 	/*
56414 	 * The sequence ID is used by the driver for tracking multiple
56415 	 * commands. This ID is treated as opaque data by the firmware and
56416 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56417 	 */
56418 	uint16_t	seq_id;
56419 	/*
56420 	 * The target ID of the command:
56421 	 * * 0x0-0xFFF8 - The function ID
56422 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56423 	 * * 0xFFFD - Reserved for user-space HWRM interface
56424 	 * * 0xFFFF - HWRM
56425 	 */
56426 	uint16_t	target_id;
56427 	/*
56428 	 * A physical address pointer pointing to a host buffer that the
56429 	 * command's response data will be written. This can be either a host
56430 	 * physical address (HPA) or a guest physical address (GPA) and must
56431 	 * point to a physically contiguous block of memory.
56432 	 */
56433 	uint64_t	resp_addr;
56434 	uint8_t	flags;
56435 	/* unused is 8 b */
56436 	uint8_t	unused;
56437 	/* asynchronous event to hosts. */
56438 	uint8_t	event_id;
56439 	/* PORT ID */
56440 	uint8_t	port_id;
56441 	/* event data1 of asynchronous event */
56442 	uint32_t	event_data1;
56443 	/* event data2 of asynchronous event */
56444 	uint32_t	event_data2;
56445 	uint8_t	unused_0[4];
56446 } hwrm_fw_ipc_mailbox_input_t, *phwrm_fw_ipc_mailbox_input_t;
56447 
56448 /* hwrm_fw_ipc_mailbox_output (size:128b/16B) */
56449 
56450 typedef struct hwrm_fw_ipc_mailbox_output {
56451 	/* The specific error status for the command. */
56452 	uint16_t	error_code;
56453 	/* The HWRM command request type. */
56454 	uint16_t	req_type;
56455 	/* The sequence ID from the original command. */
56456 	uint16_t	seq_id;
56457 	/* The length of the response data in number of bytes. */
56458 	uint16_t	resp_len;
56459 	uint8_t	unused_0[7];
56460 	/*
56461 	 * This field is used in Output records to indicate that the output
56462 	 * is completely written to RAM.  This field should be read as '1'
56463 	 * to indicate that the output has been completely written.
56464 	 * When writing a command completion or response to an internal processor,
56465 	 * the order of writes has to be such that this field is written last.
56466 	 */
56467 	uint8_t	valid;
56468 } hwrm_fw_ipc_mailbox_output_t, *phwrm_fw_ipc_mailbox_output_t;
56469 
56470 /* hwrm_fw_ipc_mailbox_cmd_err (size:64b/8B) */
56471 
56472 typedef struct hwrm_fw_ipc_mailbox_cmd_err {
56473 	/*
56474 	 * command specific error codes that goes to
56475 	 * the cmd_err field in Common HWRM Error Response.
56476 	 */
56477 	uint8_t	code;
56478 	/* Unknown error */
56479 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
56480 	/* invalid event */
56481 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_BAD_ID  UINT32_C(0x3)
56482 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_LAST   HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_BAD_ID
56483 	uint8_t	unused_0[7];
56484 } hwrm_fw_ipc_mailbox_cmd_err_t, *phwrm_fw_ipc_mailbox_cmd_err_t;
56485 
56486 /*******************
56487  * hwrm_fw_ecn_cfg *
56488  *******************/
56489 
56490 
56491 /* hwrm_fw_ecn_cfg_input (size:192b/24B) */
56492 
56493 typedef struct hwrm_fw_ecn_cfg_input {
56494 	/* The HWRM command request type. */
56495 	uint16_t	req_type;
56496 	/*
56497 	 * The completion ring to send the completion event on. This should
56498 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56499 	 */
56500 	uint16_t	cmpl_ring;
56501 	/*
56502 	 * The sequence ID is used by the driver for tracking multiple
56503 	 * commands. This ID is treated as opaque data by the firmware and
56504 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56505 	 */
56506 	uint16_t	seq_id;
56507 	/*
56508 	 * The target ID of the command:
56509 	 * * 0x0-0xFFF8 - The function ID
56510 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56511 	 * * 0xFFFD - Reserved for user-space HWRM interface
56512 	 * * 0xFFFF - HWRM
56513 	 */
56514 	uint16_t	target_id;
56515 	/*
56516 	 * A physical address pointer pointing to a host buffer that the
56517 	 * command's response data will be written. This can be either a host
56518 	 * physical address (HPA) or a guest physical address (GPA) and must
56519 	 * point to a physically contiguous block of memory.
56520 	 */
56521 	uint64_t	resp_addr;
56522 	uint16_t	flags;
56523 	/*
56524 	 * When this bit is '1', Explicit Congestion Notification (ECN) is
56525 	 * enabled device-wide. When ECN is enabled on a multi-host system,
56526 	 * it is enabled for all hosts. This setting takes effect
56527 	 * immediately. When ECN is enabled, the firmware activates
56528 	 * additional receive Class of Service (CoS) queues that are enabled
56529 	 * for ECN marking and steers ECN-capable packets to those queues.
56530 	 * This setting is not saved persistently. To enable ECN
56531 	 * persistently, set NVM option 173, ENABLE_ECN.
56532 	 * Setting this bit to '0' disables ECN immediately.
56533 	 */
56534 	#define HWRM_FW_ECN_CFG_INPUT_FLAGS_ENABLE_ECN	UINT32_C(0x1)
56535 	uint8_t	unused_0[6];
56536 } hwrm_fw_ecn_cfg_input_t, *phwrm_fw_ecn_cfg_input_t;
56537 
56538 /* hwrm_fw_ecn_cfg_output (size:128b/16B) */
56539 
56540 typedef struct hwrm_fw_ecn_cfg_output {
56541 	/* The specific error status for the command. */
56542 	uint16_t	error_code;
56543 	/* The HWRM command request type. */
56544 	uint16_t	req_type;
56545 	/* The sequence ID from the original command. */
56546 	uint16_t	seq_id;
56547 	/* The length of the response data in number of bytes. */
56548 	uint16_t	resp_len;
56549 	uint8_t	unused_0[7];
56550 	/*
56551 	 * This field is used in Output records to indicate that the output
56552 	 * is completely written to RAM.  This field should be read as '1'
56553 	 * to indicate that the output has been completely written.
56554 	 * When writing a command completion or response to an internal processor,
56555 	 * the order of writes has to be such that this field is written last.
56556 	 */
56557 	uint8_t	valid;
56558 } hwrm_fw_ecn_cfg_output_t, *phwrm_fw_ecn_cfg_output_t;
56559 
56560 /********************
56561  * hwrm_fw_ecn_qcfg *
56562  ********************/
56563 
56564 
56565 /* hwrm_fw_ecn_qcfg_input (size:128b/16B) */
56566 
56567 typedef struct hwrm_fw_ecn_qcfg_input {
56568 	/* The HWRM command request type. */
56569 	uint16_t	req_type;
56570 	/*
56571 	 * The completion ring to send the completion event on. This should
56572 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56573 	 */
56574 	uint16_t	cmpl_ring;
56575 	/*
56576 	 * The sequence ID is used by the driver for tracking multiple
56577 	 * commands. This ID is treated as opaque data by the firmware and
56578 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56579 	 */
56580 	uint16_t	seq_id;
56581 	/*
56582 	 * The target ID of the command:
56583 	 * * 0x0-0xFFF8 - The function ID
56584 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56585 	 * * 0xFFFD - Reserved for user-space HWRM interface
56586 	 * * 0xFFFF - HWRM
56587 	 */
56588 	uint16_t	target_id;
56589 	/*
56590 	 * A physical address pointer pointing to a host buffer that the
56591 	 * command's response data will be written. This can be either a host
56592 	 * physical address (HPA) or a guest physical address (GPA) and must
56593 	 * point to a physically contiguous block of memory.
56594 	 */
56595 	uint64_t	resp_addr;
56596 } hwrm_fw_ecn_qcfg_input_t, *phwrm_fw_ecn_qcfg_input_t;
56597 
56598 /* hwrm_fw_ecn_qcfg_output (size:128b/16B) */
56599 
56600 typedef struct hwrm_fw_ecn_qcfg_output {
56601 	/* The specific error status for the command. */
56602 	uint16_t	error_code;
56603 	/* The HWRM command request type. */
56604 	uint16_t	req_type;
56605 	/* The sequence ID from the original command. */
56606 	uint16_t	seq_id;
56607 	/* The length of the response data in number of bytes. */
56608 	uint16_t	resp_len;
56609 	uint16_t	flags;
56610 	/* When this bit is '1', ECN is enabled device-wide. */
56611 	#define HWRM_FW_ECN_QCFG_OUTPUT_FLAGS_ENABLE_ECN	UINT32_C(0x1)
56612 	uint8_t	unused_0[5];
56613 	/*
56614 	 * This field is used in Output records to indicate that the output
56615 	 * is completely written to RAM.  This field should be read as '1'
56616 	 * to indicate that the output has been completely written.
56617 	 * When writing a command completion or response to an internal processor,
56618 	 * the order of writes has to be such that this field is written last.
56619 	 */
56620 	uint8_t	valid;
56621 } hwrm_fw_ecn_qcfg_output_t, *phwrm_fw_ecn_qcfg_output_t;
56622 
56623 /************************
56624  * hwrm_fw_health_check *
56625  ************************/
56626 
56627 
56628 /* hwrm_fw_health_check_input (size:128b/16B) */
56629 
56630 typedef struct hwrm_fw_health_check_input {
56631 	/* The HWRM command request type. */
56632 	uint16_t	req_type;
56633 	/*
56634 	 * The completion ring to send the completion event on. This should
56635 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56636 	 */
56637 	uint16_t	cmpl_ring;
56638 	/*
56639 	 * The sequence ID is used by the driver for tracking multiple
56640 	 * commands. This ID is treated as opaque data by the firmware and
56641 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56642 	 */
56643 	uint16_t	seq_id;
56644 	/*
56645 	 * The target ID of the command:
56646 	 * * 0x0-0xFFF8 - The function ID
56647 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56648 	 * * 0xFFFD - Reserved for user-space HWRM interface
56649 	 * * 0xFFFF - HWRM
56650 	 */
56651 	uint16_t	target_id;
56652 	/*
56653 	 * A physical address pointer pointing to a host buffer that the
56654 	 * command's response data will be written. This can be either a host
56655 	 * physical address (HPA) or a guest physical address (GPA) and must
56656 	 * point to a physically contiguous block of memory.
56657 	 */
56658 	uint64_t	resp_addr;
56659 } hwrm_fw_health_check_input_t, *phwrm_fw_health_check_input_t;
56660 
56661 /* hwrm_fw_health_check_output (size:128b/16B) */
56662 
56663 typedef struct hwrm_fw_health_check_output {
56664 	/* The specific error status for the command. */
56665 	uint16_t	error_code;
56666 	/* The HWRM command request type. */
56667 	uint16_t	req_type;
56668 	/* The sequence ID from the original command. */
56669 	uint16_t	seq_id;
56670 	/* The length of the response data in number of bytes. */
56671 	uint16_t	resp_len;
56672 	uint32_t	fw_status;
56673 	/*
56674 	 * This bit is '0' if the primary SBI was used this boot,
56675 	 * or '1' if the secondary SBI was used.
56676 	 */
56677 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_BOOTED	UINT32_C(0x1)
56678 	/*
56679 	 * This bit is '0' if the primary and secondary SBI images
56680 	 * match, or '1' if they do not match.
56681 	 */
56682 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_MISMATCH	UINT32_C(0x2)
56683 	/*
56684 	 * This bit is '0' if the primary SRT was used this boot,
56685 	 * or '1' if the secondary SRT was used.
56686 	 */
56687 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_BOOTED	UINT32_C(0x4)
56688 	/*
56689 	 * This bit is '0' if the primary and secondary SRT images
56690 	 * match, or '1' if they do not match.
56691 	 */
56692 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_MISMATCH	UINT32_C(0x8)
56693 	/*
56694 	 * This bit is '0' if the primary CRT (or second stage SRT)
56695 	 * was used this boot, or '1' if the secondary CRT (or
56696 	 * second stage SRT) was used.
56697 	 */
56698 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_BOOTED	UINT32_C(0x10)
56699 	/*
56700 	 * This bit is '0' if the primary and secondary CRT images
56701 	 * (or second stage SRT images) match, or '1' if they do not
56702 	 * match.
56703 	 */
56704 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_MISMATCH	UINT32_C(0x20)
56705 	/*
56706 	 * This bit is '0' if the second stage RT image is a CRT,
56707 	 * or '1' if the second stage RT image is an SRT.
56708 	 */
56709 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SECOND_RT		UINT32_C(0x40)
56710 	/*
56711 	 * This bit is '0' if the image was loaded from flash,
56712 	 * or '1' if the image was fastbooted.
56713 	 */
56714 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_FASTBOOTED	UINT32_C(0x80)
56715 	/*
56716 	 * This bit is '0' if the primary dir_hdr was used to locate
56717 	 * the firmware, or '1' if the secondary dir_hdr was used.
56718 	 */
56719 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_BOOTED	UINT32_C(0x100)
56720 	/*
56721 	 * This bit is '0' if the primary and secondary dir_hdr match,
56722 	 * or '1' if they do not match.
56723 	 */
56724 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_MISMATCH	UINT32_C(0x200)
56725 	/*
56726 	 * This bit is '0' if the Master Boot Record is in good condition,
56727 	 * or '1' if it is corrupted.
56728 	 */
56729 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_MBR_CORRUPT	UINT32_C(0x400)
56730 	/*
56731 	 * This bit is '0' if the configuration is in good condition,
56732 	 * or '1' if it is corrupted.
56733 	 */
56734 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CFG_MISMATCH	UINT32_C(0x800)
56735 	/*
56736 	 * This bit is '0' if both FRU entries match,
56737 	 * or '1' if they do not match.
56738 	 */
56739 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_FRU_MISMATCH	UINT32_C(0x1000)
56740 	uint8_t	unused_0[3];
56741 	/*
56742 	 * This field is used in Output records to indicate that the output
56743 	 * is completely written to RAM.  This field should be read as '1'
56744 	 * to indicate that the output has been completely written.
56745 	 * When writing a command completion or response to an internal processor,
56746 	 * the order of writes has to be such that this field is written last.
56747 	 */
56748 	uint8_t	valid;
56749 } hwrm_fw_health_check_output_t, *phwrm_fw_health_check_output_t;
56750 
56751 /***************************
56752  * hwrm_fw_livepatch_query *
56753  ***************************/
56754 
56755 
56756 /* hwrm_fw_livepatch_query_input (size:192b/24B) */
56757 
56758 typedef struct hwrm_fw_livepatch_query_input {
56759 	/* The HWRM command request type. */
56760 	uint16_t	req_type;
56761 	/*
56762 	 * The completion ring to send the completion event on. This should
56763 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56764 	 */
56765 	uint16_t	cmpl_ring;
56766 	/*
56767 	 * The sequence ID is used by the driver for tracking multiple
56768 	 * commands. This ID is treated as opaque data by the firmware and
56769 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56770 	 */
56771 	uint16_t	seq_id;
56772 	/*
56773 	 * The target ID of the command:
56774 	 * * 0x0-0xFFF8 - The function ID
56775 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56776 	 * * 0xFFFD - Reserved for user-space HWRM interface
56777 	 * * 0xFFFF - HWRM
56778 	 */
56779 	uint16_t	target_id;
56780 	/*
56781 	 * A physical address pointer pointing to a host buffer that the
56782 	 * command's response data will be written. This can be either a host
56783 	 * physical address (HPA) or a guest physical address (GPA) and must
56784 	 * point to a physically contiguous block of memory.
56785 	 */
56786 	uint64_t	resp_addr;
56787 	/* Firmware target to which to apply the livepatch query */
56788 	uint8_t	fw_target;
56789 	/* Common firmware livepatch query. */
56790 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
56791 	/* Secure firmware livepatch query. */
56792 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
56793 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_LAST	HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW
56794 	uint8_t	unused_0[7];
56795 } hwrm_fw_livepatch_query_input_t, *phwrm_fw_livepatch_query_input_t;
56796 
56797 /* hwrm_fw_livepatch_query_output (size:640b/80B) */
56798 
56799 typedef struct hwrm_fw_livepatch_query_output {
56800 	/* The specific error status for the command. */
56801 	uint16_t	error_code;
56802 	/* The HWRM command request type. */
56803 	uint16_t	req_type;
56804 	/* The sequence ID from the original command. */
56805 	uint16_t	seq_id;
56806 	/* The length of the response data in number of bytes. */
56807 	uint16_t	resp_len;
56808 	/*
56809 	 * This field represents the patch version string of the NVM installed
56810 	 * livepatch.  (ASCII chars with NULL at the end).
56811 	 */
56812 	char	install_ver[32];
56813 	/*
56814 	 * This field represents the patch version string of the active
56815 	 * livepatch.  (ASCII chars with NULL at the end).
56816 	 */
56817 	char	active_ver[32];
56818 	uint16_t	status_flags;
56819 	/* This bit is '1' if a livepatch image is installed to NVM. */
56820 	#define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_INSTALL	UINT32_C(0x1)
56821 	/* This bit is '1' if firmware livepatch is active. */
56822 	#define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_ACTIVE	UINT32_C(0x2)
56823 	uint8_t	unused_0[5];
56824 	/*
56825 	 * This field is used in Output records to indicate that the output
56826 	 * is completely written to RAM.  This field should be read as '1'
56827 	 * to indicate that the output has been completely written.
56828 	 * When writing a command completion or response to an internal processor,
56829 	 * the order of writes has to be such that this field is written last.
56830 	 */
56831 	uint8_t	valid;
56832 } hwrm_fw_livepatch_query_output_t, *phwrm_fw_livepatch_query_output_t;
56833 
56834 /*********************
56835  * hwrm_fw_livepatch *
56836  *********************/
56837 
56838 
56839 /* hwrm_fw_livepatch_input (size:256b/32B) */
56840 
56841 typedef struct hwrm_fw_livepatch_input {
56842 	/* The HWRM command request type. */
56843 	uint16_t	req_type;
56844 	/*
56845 	 * The completion ring to send the completion event on. This should
56846 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56847 	 */
56848 	uint16_t	cmpl_ring;
56849 	/*
56850 	 * The sequence ID is used by the driver for tracking multiple
56851 	 * commands. This ID is treated as opaque data by the firmware and
56852 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56853 	 */
56854 	uint16_t	seq_id;
56855 	/*
56856 	 * The target ID of the command:
56857 	 * * 0x0-0xFFF8 - The function ID
56858 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56859 	 * * 0xFFFD - Reserved for user-space HWRM interface
56860 	 * * 0xFFFF - HWRM
56861 	 */
56862 	uint16_t	target_id;
56863 	/*
56864 	 * A physical address pointer pointing to a host buffer that the
56865 	 * command's response data will be written. This can be either a host
56866 	 * physical address (HPA) or a guest physical address (GPA) and must
56867 	 * point to a physically contiguous block of memory.
56868 	 */
56869 	uint64_t	resp_addr;
56870 	/* Livepatch operation */
56871 	uint8_t	opcode;
56872 	/*
56873 	 * Activate a livepatch that is NVM installed or via direct load
56874 	 * from host memory.   Activate will authenticate a signed patch,
56875 	 * verify the patch version for compatibility and apply the
56876 	 * livepatch to existing firmware at run-time.
56877 	 */
56878 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_ACTIVATE   UINT32_C(0x1)
56879 	/*
56880 	 * Deactivate a livepatch and restore to the original firmware
56881 	 * operation state.
56882 	 */
56883 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE UINT32_C(0x2)
56884 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_LAST	HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE
56885 	/* Firmware target to which to apply the livepatch operation. */
56886 	uint8_t	fw_target;
56887 	/* Common firmware livepatch. */
56888 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
56889 	/* Secure firmware livepatch. */
56890 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
56891 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_LAST	HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW
56892 	/* Load method for livepatch. */
56893 	uint8_t	loadtype;
56894 	/* Load a livepatch currently installed on NVM. */
56895 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_NVM_INSTALL   UINT32_C(0x1)
56896 	/*
56897 	 * Load a livepatch directly from host memory.  The livepatch image
56898 	 * is available at host_addr.
56899 	 */
56900 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT UINT32_C(0x2)
56901 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_LAST	HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT
56902 	/* Reserved for future use. */
56903 	uint8_t	flags;
56904 	/* Length of livepatch image for memory direct loading, in bytes. */
56905 	uint32_t	patch_len;
56906 	/* 64-bit Host address of livepatch image for memory direct loading. */
56907 	uint64_t	host_addr;
56908 } hwrm_fw_livepatch_input_t, *phwrm_fw_livepatch_input_t;
56909 
56910 /* hwrm_fw_livepatch_output (size:128b/16B) */
56911 
56912 typedef struct hwrm_fw_livepatch_output {
56913 	/* The specific error status for the command. */
56914 	uint16_t	error_code;
56915 	/* The HWRM command request type. */
56916 	uint16_t	req_type;
56917 	/* The sequence ID from the original command. */
56918 	uint16_t	seq_id;
56919 	/* The length of the response data in number of bytes. */
56920 	uint16_t	resp_len;
56921 	uint8_t	unused_0[7];
56922 	/*
56923 	 * This field is used in Output records to indicate that the output
56924 	 * is completely written to RAM.  This field should be read as '1'
56925 	 * to indicate that the output has been completely written.
56926 	 * When writing a command completion or response to an internal processor,
56927 	 * the order of writes has to be such that this field is written last.
56928 	 */
56929 	uint8_t	valid;
56930 } hwrm_fw_livepatch_output_t, *phwrm_fw_livepatch_output_t;
56931 
56932 /* hwrm_fw_livepatch_cmd_err (size:64b/8B) */
56933 
56934 typedef struct hwrm_fw_livepatch_cmd_err {
56935 	/*
56936 	 * command specific error codes that goes to
56937 	 * the cmd_err field in Common HWRM Error Response.
56938 	 */
56939 	uint8_t	code;
56940 	/* Unknown error. */
56941 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
56942 	/* Opcode invalid. */
56943 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_OPCODE  UINT32_C(0x1)
56944 	/* Firmware target invalid. */
56945 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_TARGET  UINT32_C(0x2)
56946 	/* Livepatch operation not supported. */
56947 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_SUPPORTED   UINT32_C(0x3)
56948 	/* Livepatch image is not installed in NVRAM. */
56949 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_INSTALLED   UINT32_C(0x4)
56950 	/* Deactivate failed.  Firmware is not currently patched. */
56951 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_PATCHED	UINT32_C(0x5)
56952 	/* Authentication of a signed livepatch failed. */
56953 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_AUTH_FAIL	UINT32_C(0x6)
56954 	/* Livepatch header check failed.  Patch incompatible. */
56955 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_HEADER  UINT32_C(0x7)
56956 	/* Livepatch size incompatible. */
56957 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_SIZE	UINT32_C(0x8)
56958 	/*
56959 	 * Activate failed.  Firmware has already been patched.  Deactivate
56960 	 * existing livepatch before proceeding.
56961 	 */
56962 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED UINT32_C(0x9)
56963 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_LAST	HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED
56964 	uint8_t	unused_0[7];
56965 } hwrm_fw_livepatch_cmd_err_t, *phwrm_fw_livepatch_cmd_err_t;
56966 
56967 /****************
56968  * hwrm_fw_sync *
56969  ****************/
56970 
56971 
56972 /* hwrm_fw_sync_input (size:192b/24B) */
56973 
56974 typedef struct hwrm_fw_sync_input {
56975 	/* The HWRM command request type. */
56976 	uint16_t	req_type;
56977 	/*
56978 	 * The completion ring to send the completion event on. This should
56979 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56980 	 */
56981 	uint16_t	cmpl_ring;
56982 	/*
56983 	 * The sequence ID is used by the driver for tracking multiple
56984 	 * commands. This ID is treated as opaque data by the firmware and
56985 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56986 	 */
56987 	uint16_t	seq_id;
56988 	/*
56989 	 * The target ID of the command:
56990 	 * * 0x0-0xFFF8 - The function ID
56991 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56992 	 * * 0xFFFD - Reserved for user-space HWRM interface
56993 	 * * 0xFFFF - HWRM
56994 	 */
56995 	uint16_t	target_id;
56996 	/*
56997 	 * A physical address pointer pointing to a host buffer that the
56998 	 * command's response data will be written. This can be either a host
56999 	 * physical address (HPA) or a guest physical address (GPA) and must
57000 	 * point to a physically contiguous block of memory.
57001 	 */
57002 	uint64_t	resp_addr;
57003 	uint32_t	sync_action;
57004 	/*
57005 	 * If action is '1' (sync) and this bit is set, the SBI
57006 	 * images will be synchronized, copying from the instance
57007 	 * used for boot to the other instance, if they currently
57008 	 * do not match.
57009 	 */
57010 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SBI	UINT32_C(0x1)
57011 	/*
57012 	 * If action is '1' (sync) and this bit is set, the SRT
57013 	 * images will be synchronized, copying from the instance
57014 	 * used for boot to the other instance, if they currently
57015 	 * do not match.
57016 	 */
57017 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SRT	UINT32_C(0x2)
57018 	/*
57019 	 * If action is '1' (sync) and this bit is set, the CRT
57020 	 * images will be synchronized (or second stage SRT if that
57021 	 * is used in place of CRT), copying from the instance
57022 	 * used for boot to the other instance, if they currently
57023 	 * do not match.
57024 	 */
57025 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CRT	UINT32_C(0x4)
57026 	/*
57027 	 * If action is '1' (sync) and this bit is set, the dir_hdr
57028 	 * partition will be synchronized, copying from the instance
57029 	 * used for boot to the other instance, if they currently
57030 	 * do not match.
57031 	 */
57032 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_DIR_HDR	UINT32_C(0x8)
57033 	/*
57034 	 * If action is '1' (sync) and this bit is set, the MBR
57035 	 * will be erased and reprogrammed with valid content.
57036 	 */
57037 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_WRITE_MBR	UINT32_C(0x10)
57038 	/*
57039 	 * If action is '1' (sync) and this bit is set, the
57040 	 * configuration will be resynced or repaired as needed.
57041 	 */
57042 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CFG	UINT32_C(0x20)
57043 	/*
57044 	 * If action is '1' (sync) and this bit is set, the
57045 	 * FRU in NVM file will be synchronized, copying the active
57046 	 * FRU to the backup FRU.
57047 	 */
57048 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_FRU	UINT32_C(0x40)
57049 	/*
57050 	 * A value of '1' instructs the firmware to perform an image
57051 	 * synchronization of the firmware types denoted by the
57052 	 * sync_sbi, sync_srt, sync_crt bits.  A value of '0' just
57053 	 * requests the status for the previously requested sync
57054 	 * operation.
57055 	 */
57056 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_ACTION	UINT32_C(0x80000000)
57057 	uint8_t	unused_0[4];
57058 } hwrm_fw_sync_input_t, *phwrm_fw_sync_input_t;
57059 
57060 /* hwrm_fw_sync_output (size:128b/16B) */
57061 
57062 typedef struct hwrm_fw_sync_output {
57063 	/* The specific error status for the command. */
57064 	uint16_t	error_code;
57065 	/* The HWRM command request type. */
57066 	uint16_t	req_type;
57067 	/* The sequence ID from the original command. */
57068 	uint16_t	seq_id;
57069 	/* The length of the response data in number of bytes. */
57070 	uint16_t	resp_len;
57071 	uint32_t	sync_status;
57072 	/* This bit field indicates the error if 'sync_err' bit is set. */
57073 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_MASK	UINT32_C(0xff)
57074 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SFT	0
57075 	/* Success, no error */
57076 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SUCCESS	UINT32_C(0x0)
57077 	/*
57078 	 * A previously requested synchronization command is still
57079 	 * in progress.
57080 	 */
57081 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_IN_PROGRESS  UINT32_C(0x1)
57082 	/* An NVRAM operation has timed out. */
57083 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_TIMEOUT	UINT32_C(0x2)
57084 	/* General NVRAM error code. */
57085 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL	UINT32_C(0x3)
57086 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_LAST	HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL
57087 	/*
57088 	 * This bit is '1' if the syncronization request has completed
57089 	 * with an error; the 'err_code' field can be used to obtain
57090 	 * information about error type.
57091 	 */
57092 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_ERR		UINT32_C(0x40000000)
57093 	/*
57094 	 * This bit is '0' if the previously requested synchronization
57095 	 * command is still in progress, or '1' if the previously
57096 	 * requested sync command has completed.  If '1', the 'sync_err'
57097 	 * field will indicate if it completed successfully or with
57098 	 * an error.
57099 	 */
57100 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_COMPLETE	UINT32_C(0x80000000)
57101 	uint8_t	unused_0[3];
57102 	/*
57103 	 * This field is used in Output records to indicate that the output
57104 	 * is completely written to RAM.  This field should be read as '1'
57105 	 * to indicate that the output has been completely written.
57106 	 * When writing a command completion or response to an internal processor,
57107 	 * the order of writes has to be such that this field is written last.
57108 	 */
57109 	uint8_t	valid;
57110 } hwrm_fw_sync_output_t, *phwrm_fw_sync_output_t;
57111 
57112 /***********************
57113  * hwrm_fw_state_qcaps *
57114  ***********************/
57115 
57116 
57117 /* hwrm_fw_state_qcaps_input (size:128b/16B) */
57118 
57119 typedef struct hwrm_fw_state_qcaps_input {
57120 	/* The HWRM command request type. */
57121 	uint16_t	req_type;
57122 	/*
57123 	 * The completion ring to send the completion event on. This should
57124 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57125 	 */
57126 	uint16_t	cmpl_ring;
57127 	/*
57128 	 * The sequence ID is used by the driver for tracking multiple
57129 	 * commands. This ID is treated as opaque data by the firmware and
57130 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57131 	 */
57132 	uint16_t	seq_id;
57133 	/*
57134 	 * The target ID of the command:
57135 	 * * 0x0-0xFFF8 - The function ID
57136 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57137 	 * * 0xFFFD - Reserved for user-space HWRM interface
57138 	 * * 0xFFFF - HWRM
57139 	 */
57140 	uint16_t	target_id;
57141 	/*
57142 	 * A physical address pointer pointing to a host buffer that the
57143 	 * command's response data will be written. This can be either a host
57144 	 * physical address (HPA) or a guest physical address (GPA) and must
57145 	 * point to a physically contiguous block of memory.
57146 	 */
57147 	uint64_t	resp_addr;
57148 } hwrm_fw_state_qcaps_input_t, *phwrm_fw_state_qcaps_input_t;
57149 
57150 /* hwrm_fw_state_qcaps_output (size:256b/32B) */
57151 
57152 typedef struct hwrm_fw_state_qcaps_output {
57153 	/* The specific error status for the command. */
57154 	uint16_t	error_code;
57155 	/* The HWRM command request type. */
57156 	uint16_t	req_type;
57157 	/* The sequence ID from the original command. */
57158 	uint16_t	seq_id;
57159 	/* The length of the response data in number of bytes. */
57160 	uint16_t	resp_len;
57161 	/*
57162 	 * This field indicates the size in bytes required by host backup
57163 	 * memory.  Host software should allocate memory according to this
57164 	 * size requirement and pass the allocated memory to the
57165 	 * HWRM_FW_STATE_BACKUP and HWRM_FW_STATE_RESTORE commands in the form
57166 	 * of PBL data as specified in those commands.
57167 	 */
57168 	uint32_t	backup_memory;
57169 	/*
57170 	 * This field indicates the max time in milliseconds that firmware
57171 	 * waits for quiesce to complete. Firmware indicates successful
57172 	 * quiesce completion if the quiesce operation completes within this
57173 	 * timeout. If firmware is still waiting for the quiesce operation
57174 	 * to complete when this timeout is reached, firmware stops waiting
57175 	 * (without canceling any quiesce action such as pausing or
57176 	 * clearing meter profiles) and indicates a timeout status result
57177 	 * via NQE completion notification. This timeout value may also be
57178 	 * used by the driver to know the max time to wait for any NQE
57179 	 * notification response to the HWRM_FW_STATE_QUIESCE command. After
57180 	 * a timeout, the driver may elect to invoke HWRM_FW_STATE_QUIESCE
57181 	 * again to keep trying or to invoke HWRM_FW_STATE_UNQUIESCE to
57182 	 * revert the operation. Since there is no identifier correlating
57183 	 * each HWRM_FW_STATE_QUIESCE command with its NQE response, it is
57184 	 * important for the driver to wait for the NQE response before
57185 	 * issuing a subsequent HWRM_FW_STATE_QUIESCE command.
57186 	 */
57187 	uint32_t	quiesce_timeout;
57188 	/*
57189 	 * This field indicates time in milliseconds that the driver should
57190 	 * wait after return from HWRM_FW_RESET to begin polling the device
57191 	 * for status 0x8000.
57192 	 */
57193 	uint32_t	fw_status_blackout;
57194 	/*
57195 	 * This field indicates a max time for firmware to poll for status
57196 	 * 0x8000 before assuming a reset failure occurred.  This time does
57197 	 * not include fw_status_blackout time which would immediately precede
57198 	 * this wait.
57199 	 */
57200 	uint32_t	fw_status_max_wait;
57201 	uint8_t	unused_0[4];
57202 	uint8_t	unused_1[3];
57203 	/*
57204 	 * This field is used in Output records to indicate that the output
57205 	 * is completely written to RAM.  This field should be read as '1'
57206 	 * to indicate that the output has been completely written.
57207 	 * When writing a command completion or response to an internal processor,
57208 	 * the order of writes has to be such that this field is written last.
57209 	 */
57210 	uint8_t	valid;
57211 } hwrm_fw_state_qcaps_output_t, *phwrm_fw_state_qcaps_output_t;
57212 
57213 /*************************
57214  * hwrm_fw_state_quiesce *
57215  *************************/
57216 
57217 
57218 /* hwrm_fw_state_quiesce_input (size:192b/24B) */
57219 
57220 typedef struct hwrm_fw_state_quiesce_input {
57221 	/* The HWRM command request type. */
57222 	uint16_t	req_type;
57223 	/*
57224 	 * The completion ring to send the completion event on. This should
57225 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57226 	 */
57227 	uint16_t	cmpl_ring;
57228 	/*
57229 	 * The sequence ID is used by the driver for tracking multiple
57230 	 * commands. This ID is treated as opaque data by the firmware and
57231 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57232 	 */
57233 	uint16_t	seq_id;
57234 	/*
57235 	 * The target ID of the command:
57236 	 * * 0x0-0xFFF8 - The function ID
57237 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57238 	 * * 0xFFFD - Reserved for user-space HWRM interface
57239 	 * * 0xFFFF - HWRM
57240 	 */
57241 	uint16_t	target_id;
57242 	/*
57243 	 * A physical address pointer pointing to a host buffer that the
57244 	 * command's response data will be written. This can be either a host
57245 	 * physical address (HPA) or a guest physical address (GPA) and must
57246 	 * point to a physically contiguous block of memory.
57247 	 */
57248 	uint64_t	resp_addr;
57249 	uint8_t	flags;
57250 	/*
57251 	 * Setting this bit to '1', indicates impactless firmware update
57252 	 * is in a recovery mode where hardware is in an error state and
57253 	 * where recovery is desired with reasonably minimal impact to
57254 	 * connected clients. The quiesce operation may require separate
57255 	 * steps to handle quiescing when hardware is in a hung or locked
57256 	 * state. For example, quiesce via draining may not be possible
57257 	 * depending on the type of error. This flag's state would be kept
57258 	 * in firmware if recovery-specific steps are also needed for the
57259 	 * HWRM_FW_STATE_BACKUP. Note this option is available only for
57260 	 * specific recovery scenarios and may not be operational across
57261 	 * all controllers.
57262 	 */
57263 	#define HWRM_FW_STATE_QUIESCE_INPUT_FLAGS_ERROR_RECOVERY	UINT32_C(0x1)
57264 	uint8_t	unused_0[7];
57265 } hwrm_fw_state_quiesce_input_t, *phwrm_fw_state_quiesce_input_t;
57266 
57267 /* hwrm_fw_state_quiesce_output (size:192b/24B) */
57268 
57269 typedef struct hwrm_fw_state_quiesce_output {
57270 	/* The specific error status for the command. */
57271 	uint16_t	error_code;
57272 	/* The HWRM command request type. */
57273 	uint16_t	req_type;
57274 	/* The sequence ID from the original command. */
57275 	uint16_t	seq_id;
57276 	/* The length of the response data in number of bytes. */
57277 	uint16_t	resp_len;
57278 	uint32_t	quiesce_status;
57279 	/*
57280 	 * This bit is '1' if the quiesce request has been successfully
57281 	 * initiated.
57282 	 */
57283 	#define HWRM_FW_STATE_QUIESCE_OUTPUT_QUIESCE_STATUS_INITIATED	UINT32_C(0x80000000)
57284 	uint8_t	unused_0[4];
57285 	uint8_t	unused_1[7];
57286 	/*
57287 	 * This field is used in Output records to indicate that the output
57288 	 * is completely written to RAM. This field should be read as '1' to
57289 	 * indicate that the output has been completely written. When
57290 	 * writing a command completion or response to an internal
57291 	 * processor, the order of writes has to be such that this field is
57292 	 * written last.
57293 	 */
57294 	uint8_t	valid;
57295 } hwrm_fw_state_quiesce_output_t, *phwrm_fw_state_quiesce_output_t;
57296 
57297 /***************************
57298  * hwrm_fw_state_unquiesce *
57299  ***************************/
57300 
57301 
57302 /* hwrm_fw_state_unquiesce_input (size:128b/16B) */
57303 
57304 typedef struct hwrm_fw_state_unquiesce_input {
57305 	/* The HWRM command request type. */
57306 	uint16_t	req_type;
57307 	/*
57308 	 * The completion ring to send the completion event on. This should
57309 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57310 	 */
57311 	uint16_t	cmpl_ring;
57312 	/*
57313 	 * The sequence ID is used by the driver for tracking multiple
57314 	 * commands. This ID is treated as opaque data by the firmware and
57315 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57316 	 */
57317 	uint16_t	seq_id;
57318 	/*
57319 	 * The target ID of the command:
57320 	 * * 0x0-0xFFF8 - The function ID
57321 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57322 	 * * 0xFFFD - Reserved for user-space HWRM interface
57323 	 * * 0xFFFF - HWRM
57324 	 */
57325 	uint16_t	target_id;
57326 	/*
57327 	 * A physical address pointer pointing to a host buffer that the
57328 	 * command's response data will be written. This can be either a host
57329 	 * physical address (HPA) or a guest physical address (GPA) and must
57330 	 * point to a physically contiguous block of memory.
57331 	 */
57332 	uint64_t	resp_addr;
57333 } hwrm_fw_state_unquiesce_input_t, *phwrm_fw_state_unquiesce_input_t;
57334 
57335 /* hwrm_fw_state_unquiesce_output (size:192b/24B) */
57336 
57337 typedef struct hwrm_fw_state_unquiesce_output {
57338 	/* The specific error status for the command. */
57339 	uint16_t	error_code;
57340 	/* The HWRM command request type. */
57341 	uint16_t	req_type;
57342 	/* The sequence ID from the original command. */
57343 	uint16_t	seq_id;
57344 	/* The length of the response data in number of bytes. */
57345 	uint16_t	resp_len;
57346 	uint32_t	unquiesce_status;
57347 	/* This bit is '1' if the unquiesce request has fully completed. */
57348 	#define HWRM_FW_STATE_UNQUIESCE_OUTPUT_UNQUIESCE_STATUS_COMPLETE	UINT32_C(0x80000000)
57349 	uint8_t	unused_0[4];
57350 	uint8_t	unused_1[7];
57351 	/*
57352 	 * This field is used in Output records to indicate that the output
57353 	 * is completely written to RAM.  This field should be read as '1'
57354 	 * to indicate that the output has been completely written.
57355 	 * When writing a command completion or response to an internal processor,
57356 	 * the order of writes has to be such that this field is written last.
57357 	 */
57358 	uint8_t	valid;
57359 } hwrm_fw_state_unquiesce_output_t, *phwrm_fw_state_unquiesce_output_t;
57360 
57361 /************************
57362  * hwrm_fw_state_backup *
57363  ************************/
57364 
57365 
57366 /* hwrm_fw_state_backup_input (size:256b/32B) */
57367 
57368 typedef struct hwrm_fw_state_backup_input {
57369 	/* The HWRM command request type. */
57370 	uint16_t	req_type;
57371 	/*
57372 	 * The completion ring to send the completion event on. This should
57373 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57374 	 */
57375 	uint16_t	cmpl_ring;
57376 	/*
57377 	 * The sequence ID is used by the driver for tracking multiple
57378 	 * commands. This ID is treated as opaque data by the firmware and
57379 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57380 	 */
57381 	uint16_t	seq_id;
57382 	/*
57383 	 * The target ID of the command:
57384 	 * * 0x0-0xFFF8 - The function ID
57385 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57386 	 * * 0xFFFD - Reserved for user-space HWRM interface
57387 	 * * 0xFFFF - HWRM
57388 	 */
57389 	uint16_t	target_id;
57390 	/*
57391 	 * A physical address pointer pointing to a host buffer that the
57392 	 * command's response data will be written. This can be either a host
57393 	 * physical address (HPA) or a guest physical address (GPA) and must
57394 	 * point to a physically contiguous block of memory.
57395 	 */
57396 	uint64_t	resp_addr;
57397 	/* State backup page size and level. */
57398 	uint8_t	backup_pg_size_backup_lvl;
57399 	/* State backup PBL indirect levels. */
57400 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_MASK	UINT32_C(0xf)
57401 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_SFT	0
57402 	/* PBL pointer is physical start address. */
57403 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_0	UINT32_C(0x0)
57404 	/* PBL pointer points to PTE table. */
57405 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_1	UINT32_C(0x1)
57406 	/*
57407 	 * PBL pointer points to PDE table with each entry pointing to PTE
57408 	 * tables.
57409 	 */
57410 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2	UINT32_C(0x2)
57411 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LAST	HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2
57412 	/* State backup page size. */
57413 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_MASK  UINT32_C(0xf0)
57414 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_SFT   4
57415 	/* 4KB. */
57416 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
57417 	/* 8KB. */
57418 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
57419 	/* 64KB. */
57420 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
57421 	/* 2MB. */
57422 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
57423 	/* 8MB. */
57424 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
57425 	/* 1GB. */
57426 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
57427 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_LAST   HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G
57428 	uint8_t	unused_0[7];
57429 	/* State backup page directory. */
57430 	uint64_t	backup_page_dir;
57431 } hwrm_fw_state_backup_input_t, *phwrm_fw_state_backup_input_t;
57432 
57433 /* hwrm_fw_state_backup_output (size:192b/24B) */
57434 
57435 typedef struct hwrm_fw_state_backup_output {
57436 	/* The specific error status for the command. */
57437 	uint16_t	error_code;
57438 	/* The HWRM command request type. */
57439 	uint16_t	req_type;
57440 	/* The sequence ID from the original command. */
57441 	uint16_t	seq_id;
57442 	/* The length of the response data in number of bytes. */
57443 	uint16_t	resp_len;
57444 	uint32_t	backup_status;
57445 	/*
57446 	 * This bit field provides additional information if the error if
57447 	 * error_code in the common HWRM header is set.
57448 	 */
57449 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_MASK	UINT32_C(0xff)
57450 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SFT	0
57451 	/* Success, no error */
57452 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SUCCESS	UINT32_C(0x0)
57453 	/* Data or control plane detected as non-quiesced */
57454 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_QUIESCE_ERROR  UINT32_C(0x1)
57455 	/* General backup error */
57456 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL	UINT32_C(0x3)
57457 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_LAST	HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL
57458 	/*
57459 	 * This bit is '0' if the backout was done in a way that firmware
57460 	 * may continue running normally after the backup, for example if
57461 	 * the host elects to skip the subsequent reset and restore for any
57462 	 * reason.  A value of '1' indicates the act of backing up has left
57463 	 * the firmware/device in a state where subsequent reset is
57464 	 * required, for example of probing state of a queue leaves changes
57465 	 * state in a way that is detectable by users.
57466 	 */
57467 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_RESET_REQUIRED	UINT32_C(0x40000000)
57468 	/* This bit is '1' if the backup request has fully completed. */
57469 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_COMPLETE		UINT32_C(0x80000000)
57470 	uint8_t	unused_0[4];
57471 	uint8_t	unused_1[7];
57472 	/*
57473 	 * This field is used in Output records to indicate that the output
57474 	 * is completely written to RAM.  This field should be read as '1'
57475 	 * to indicate that the output has been completely written.
57476 	 * When writing a command completion or response to an internal processor,
57477 	 * the order of writes has to be such that this field is written last.
57478 	 */
57479 	uint8_t	valid;
57480 } hwrm_fw_state_backup_output_t, *phwrm_fw_state_backup_output_t;
57481 
57482 /*************************
57483  * hwrm_fw_state_restore *
57484  *************************/
57485 
57486 
57487 /* hwrm_fw_state_restore_input (size:256b/32B) */
57488 
57489 typedef struct hwrm_fw_state_restore_input {
57490 	/* The HWRM command request type. */
57491 	uint16_t	req_type;
57492 	/*
57493 	 * The completion ring to send the completion event on. This should
57494 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57495 	 */
57496 	uint16_t	cmpl_ring;
57497 	/*
57498 	 * The sequence ID is used by the driver for tracking multiple
57499 	 * commands. This ID is treated as opaque data by the firmware and
57500 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57501 	 */
57502 	uint16_t	seq_id;
57503 	/*
57504 	 * The target ID of the command:
57505 	 * * 0x0-0xFFF8 - The function ID
57506 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57507 	 * * 0xFFFD - Reserved for user-space HWRM interface
57508 	 * * 0xFFFF - HWRM
57509 	 */
57510 	uint16_t	target_id;
57511 	/*
57512 	 * A physical address pointer pointing to a host buffer that the
57513 	 * command's response data will be written. This can be either a host
57514 	 * physical address (HPA) or a guest physical address (GPA) and must
57515 	 * point to a physically contiguous block of memory.
57516 	 */
57517 	uint64_t	resp_addr;
57518 	/* State restore page size and level. */
57519 	uint8_t	restore_pg_size_restore_lvl;
57520 	/* State restore PBL indirect levels. */
57521 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_MASK	UINT32_C(0xf)
57522 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_SFT	0
57523 	/* PBL pointer is physical start address. */
57524 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_0	UINT32_C(0x0)
57525 	/* PBL pointer points to PTE table. */
57526 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_1	UINT32_C(0x1)
57527 	/*
57528 	 * PBL pointer points to PDE table with each entry pointing to PTE
57529 	 * tables.
57530 	 */
57531 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2	UINT32_C(0x2)
57532 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LAST	HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2
57533 	/* State restore page size. */
57534 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_MASK  UINT32_C(0xf0)
57535 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_SFT   4
57536 	/* 4KB. */
57537 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
57538 	/* 8KB. */
57539 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
57540 	/* 64KB. */
57541 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
57542 	/* 2MB. */
57543 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
57544 	/* 8MB. */
57545 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
57546 	/* 1GB. */
57547 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
57548 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_LAST   HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G
57549 	uint8_t	unused_0[7];
57550 	/* State restore page directory. */
57551 	uint64_t	restore_page_dir;
57552 } hwrm_fw_state_restore_input_t, *phwrm_fw_state_restore_input_t;
57553 
57554 /* hwrm_fw_state_restore_output (size:128b/16B) */
57555 
57556 typedef struct hwrm_fw_state_restore_output {
57557 	/* The specific error status for the command. */
57558 	uint16_t	error_code;
57559 	/* The HWRM command request type. */
57560 	uint16_t	req_type;
57561 	/* The sequence ID from the original command. */
57562 	uint16_t	seq_id;
57563 	/* The length of the response data in number of bytes. */
57564 	uint16_t	resp_len;
57565 	uint32_t	restore_status;
57566 	/*
57567 	 * This bit field provides additional information if the error if
57568 	 * error_code in the common HWRM header is set.
57569 	 */
57570 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_MASK		UINT32_C(0xff)
57571 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SFT		0
57572 	/* Success, no error */
57573 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SUCCESS		UINT32_C(0x0)
57574 	/* General restore error */
57575 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_GENERAL		UINT32_C(0x1)
57576 	/* Format parse error */
57577 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_FORMAT_PARSE		UINT32_C(0x2)
57578 	/* Integrity check error */
57579 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK	UINT32_C(0x3)
57580 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_LAST		HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK
57581 	/*
57582 	 * If a failure occurs (complete is 0), restore attempts to
57583 	 * completely roll back any state applied so that the failure
57584 	 * results in no state change.  This flag indicates whether that
57585 	 * rollback completed successfully and thoroughly.
57586 	 */
57587 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_FAILURE_ROLLBACK_COMPLETED	UINT32_C(0x40000000)
57588 	/* This bit is '1' if the restore request has fully completed. */
57589 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_COMPLETE			UINT32_C(0x80000000)
57590 	uint8_t	unused_0[3];
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 processor,
57596 	 * the order of writes has to be such that this field is written last.
57597 	 */
57598 	uint8_t	valid;
57599 } hwrm_fw_state_restore_output_t, *phwrm_fw_state_restore_output_t;
57600 
57601 /**********************
57602  * hwrm_fw_secure_cfg *
57603  **********************/
57604 
57605 
57606 /* hwrm_fw_secure_cfg_input (size:256b/32B) */
57607 
57608 typedef struct hwrm_fw_secure_cfg_input {
57609 	/* The HWRM command request type. */
57610 	uint16_t	req_type;
57611 	/*
57612 	 * The completion ring to send the completion event on. This should
57613 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57614 	 */
57615 	uint16_t	cmpl_ring;
57616 	/*
57617 	 * The sequence ID is used by the driver for tracking multiple
57618 	 * commands. This ID is treated as opaque data by the firmware and
57619 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57620 	 */
57621 	uint16_t	seq_id;
57622 	/*
57623 	 * The target ID of the command:
57624 	 * * 0x0-0xFFF8 - The function ID
57625 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57626 	 * * 0xFFFD - Reserved for user-space HWRM interface
57627 	 * * 0xFFFF - HWRM
57628 	 */
57629 	uint16_t	target_id;
57630 	/*
57631 	 * A physical address pointer pointing to a host buffer that the
57632 	 * command's response data will be written. This can be either a host
57633 	 * physical address (HPA) or a guest physical address (GPA) and must
57634 	 * point to a physically contiguous block of memory.
57635 	 */
57636 	uint64_t	resp_addr;
57637 	/* Specify the type of security option. */
57638 	uint8_t	enable;
57639 	/* Fields for the nvm lock mode are valid. */
57640 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_NVRAM UINT32_C(0x1)
57641 	/* Fields for the grc access control are valid. */
57642 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_GRC   UINT32_C(0x2)
57643 	/* Fields for the uart access control are valid. */
57644 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_UART  UINT32_C(0x3)
57645 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_LAST HWRM_FW_SECURE_CFG_INPUT_ENABLE_UART
57646 	/*
57647 	 * This bit field indicates the type of the configuration to be
57648 	 * updated.
57649 	 */
57650 	uint8_t	config_mode;
57651 	/* When this bit is '1', persistent config would be updated. */
57652 	#define HWRM_FW_SECURE_CFG_INPUT_CONFIG_MODE_PERSISTENT	UINT32_C(0x1)
57653 	/* When this bit is '1', runtime config would be updated. */
57654 	#define HWRM_FW_SECURE_CFG_INPUT_CONFIG_MODE_RUNTIME	UINT32_C(0x2)
57655 	/* define lock mode for nvram. */
57656 	uint8_t	nvm_lock_mode;
57657 	/*
57658 	 * Contents of the entire NVRAM including FW and Config can be
57659 	 * altered by a HWRM client.
57660 	 */
57661 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_NONE	UINT32_C(0x0)
57662 	/*
57663 	 * Only partial sections of the NVM are to be locked. To specify
57664 	 * section to be locked the 'nvm_partial_lock_mask' should be used.
57665 	 */
57666 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_PARTIAL UINT32_C(0x1)
57667 	/*
57668 	 * Contents of the entire NVM including FW and Config are to be
57669 	 * locked against any alteration by any HWRM client.
57670 	 */
57671 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_FULL	UINT32_C(0x2)
57672 	/*
57673 	 * This is a HW lock of the NVM itself. Once locked firmware has no
57674 	 * control to unlock. Contents of the NVM cannot be altered.
57675 	 * Require a power cycle to unlock.
57676 	 */
57677 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_CHIP	UINT32_C(0x3)
57678 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_LAST   HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_CHIP
57679 	/*
57680 	 * bit field indicating the type of partial_lock.
57681 	 * This field is only applicable if the partial_lock is set.
57682 	 */
57683 	uint8_t	nvm_partial_lock_mask;
57684 	/* When this bit is '1', updating the FW images are locked. */
57685 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_PARTIAL_LOCK_MASK_EXE	UINT32_C(0x1)
57686 	/* When this bit is '1', updating the CFG are locked. */
57687 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_PARTIAL_LOCK_MASK_CFG	UINT32_C(0x2)
57688 	/* specify grc access control for specified HWRM clients. */
57689 	uint8_t	grc_ctrl;
57690 	/* Read Only */
57691 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RO UINT32_C(0x0)
57692 	/* Read-Write */
57693 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RW UINT32_C(0x1)
57694 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_LAST HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RW
57695 	/* specify debug access control via UART */
57696 	uint8_t	uart_ctrl;
57697 	/* disable UART access for debugging */
57698 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_DISABLE UINT32_C(0x0)
57699 	/* enable UART access for debugging */
57700 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_ENABLE  UINT32_C(0x1)
57701 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_LAST   HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_ENABLE
57702 	uint8_t	unused_0[2];
57703 	uint64_t	unused_1;
57704 } hwrm_fw_secure_cfg_input_t, *phwrm_fw_secure_cfg_input_t;
57705 
57706 /* hwrm_fw_secure_cfg_output (size:128b/16B) */
57707 
57708 typedef struct hwrm_fw_secure_cfg_output {
57709 	/* The specific error status for the command. */
57710 	uint16_t	error_code;
57711 	/* The HWRM command request type. */
57712 	uint16_t	req_type;
57713 	/* The sequence ID from the original command. */
57714 	uint16_t	seq_id;
57715 	/* The length of the response data in number of bytes. */
57716 	uint16_t	resp_len;
57717 	uint8_t	unused_0[7];
57718 	/*
57719 	 * This field is used in Output records to indicate that the output
57720 	 * is completely written to RAM.  This field should be read as '1'
57721 	 * to indicate that the output has been completely written.
57722 	 * When writing a command completion or response to an internal
57723 	 * processor, the order of writes has to be such that this field is
57724 	 * written last.
57725 	 */
57726 	uint8_t	valid;
57727 } hwrm_fw_secure_cfg_output_t, *phwrm_fw_secure_cfg_output_t;
57728 
57729 /**********************
57730  * hwrm_exec_fwd_resp *
57731  **********************/
57732 
57733 
57734 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
57735 
57736 typedef struct hwrm_exec_fwd_resp_input {
57737 	/* The HWRM command request type. */
57738 	uint16_t	req_type;
57739 	/*
57740 	 * The completion ring to send the completion event on. This should
57741 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57742 	 */
57743 	uint16_t	cmpl_ring;
57744 	/*
57745 	 * The sequence ID is used by the driver for tracking multiple
57746 	 * commands. This ID is treated as opaque data by the firmware and
57747 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57748 	 */
57749 	uint16_t	seq_id;
57750 	/*
57751 	 * The target ID of the command:
57752 	 * * 0x0-0xFFF8 - The function ID
57753 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57754 	 * * 0xFFFD - Reserved for user-space HWRM interface
57755 	 * * 0xFFFF - HWRM
57756 	 */
57757 	uint16_t	target_id;
57758 	/*
57759 	 * A physical address pointer pointing to a host buffer that the
57760 	 * command's response data will be written. This can be either a host
57761 	 * physical address (HPA) or a guest physical address (GPA) and must
57762 	 * point to a physically contiguous block of memory.
57763 	 */
57764 	uint64_t	resp_addr;
57765 	/*
57766 	 * This is an encapsulated request. This request should
57767 	 * be executed by the HWRM and the response should be
57768 	 * provided in the response buffer inside the encapsulated
57769 	 * request.
57770 	 */
57771 	uint32_t	encap_request[26];
57772 	/*
57773 	 * This value indicates the target id of the response to
57774 	 * the encapsulated request.
57775 	 * 0x0 - 0xFFF8 - Used for function ids
57776 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
57777 	 * 0xFFFF - HWRM
57778 	 */
57779 	uint16_t	encap_resp_target_id;
57780 	uint8_t	unused_0[6];
57781 } hwrm_exec_fwd_resp_input_t, *phwrm_exec_fwd_resp_input_t;
57782 
57783 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
57784 
57785 typedef struct hwrm_exec_fwd_resp_output {
57786 	/* The specific error status for the command. */
57787 	uint16_t	error_code;
57788 	/* The HWRM command request type. */
57789 	uint16_t	req_type;
57790 	/* The sequence ID from the original command. */
57791 	uint16_t	seq_id;
57792 	/* The length of the response data in number of bytes. */
57793 	uint16_t	resp_len;
57794 	uint8_t	unused_0[7];
57795 	/*
57796 	 * This field is used in Output records to indicate that the output
57797 	 * is completely written to RAM.  This field should be read as '1'
57798 	 * to indicate that the output has been completely written.
57799 	 * When writing a command completion or response to an internal processor,
57800 	 * the order of writes has to be such that this field is written last.
57801 	 */
57802 	uint8_t	valid;
57803 } hwrm_exec_fwd_resp_output_t, *phwrm_exec_fwd_resp_output_t;
57804 
57805 /************************
57806  * hwrm_reject_fwd_resp *
57807  ************************/
57808 
57809 
57810 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
57811 
57812 typedef struct hwrm_reject_fwd_resp_input {
57813 	/* The HWRM command request type. */
57814 	uint16_t	req_type;
57815 	/*
57816 	 * The completion ring to send the completion event on. This should
57817 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57818 	 */
57819 	uint16_t	cmpl_ring;
57820 	/*
57821 	 * The sequence ID is used by the driver for tracking multiple
57822 	 * commands. This ID is treated as opaque data by the firmware and
57823 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57824 	 */
57825 	uint16_t	seq_id;
57826 	/*
57827 	 * The target ID of the command:
57828 	 * * 0x0-0xFFF8 - The function ID
57829 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57830 	 * * 0xFFFD - Reserved for user-space HWRM interface
57831 	 * * 0xFFFF - HWRM
57832 	 */
57833 	uint16_t	target_id;
57834 	/*
57835 	 * A physical address pointer pointing to a host buffer that the
57836 	 * command's response data will be written. This can be either a host
57837 	 * physical address (HPA) or a guest physical address (GPA) and must
57838 	 * point to a physically contiguous block of memory.
57839 	 */
57840 	uint64_t	resp_addr;
57841 	/*
57842 	 * This is an encapsulated request. This request should
57843 	 * be rejected by the HWRM and the error response should be
57844 	 * provided in the response buffer inside the encapsulated
57845 	 * request.
57846 	 */
57847 	uint32_t	encap_request[26];
57848 	/*
57849 	 * This value indicates the target id of the response to
57850 	 * the encapsulated request.
57851 	 * 0x0 - 0xFFF8 - Used for function ids
57852 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
57853 	 * 0xFFFF - HWRM
57854 	 */
57855 	uint16_t	encap_resp_target_id;
57856 	uint8_t	unused_0[6];
57857 } hwrm_reject_fwd_resp_input_t, *phwrm_reject_fwd_resp_input_t;
57858 
57859 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
57860 
57861 typedef struct hwrm_reject_fwd_resp_output {
57862 	/* The specific error status for the command. */
57863 	uint16_t	error_code;
57864 	/* The HWRM command request type. */
57865 	uint16_t	req_type;
57866 	/* The sequence ID from the original command. */
57867 	uint16_t	seq_id;
57868 	/* The length of the response data in number of bytes. */
57869 	uint16_t	resp_len;
57870 	uint8_t	unused_0[7];
57871 	/*
57872 	 * This field is used in Output records to indicate that the output
57873 	 * is completely written to RAM.  This field should be read as '1'
57874 	 * to indicate that the output has been completely written.
57875 	 * When writing a command completion or response to an internal processor,
57876 	 * the order of writes has to be such that this field is written last.
57877 	 */
57878 	uint8_t	valid;
57879 } hwrm_reject_fwd_resp_output_t, *phwrm_reject_fwd_resp_output_t;
57880 
57881 /*****************
57882  * hwrm_fwd_resp *
57883  *****************/
57884 
57885 
57886 /* hwrm_fwd_resp_input (size:1024b/128B) */
57887 
57888 typedef struct hwrm_fwd_resp_input {
57889 	/* The HWRM command request type. */
57890 	uint16_t	req_type;
57891 	/*
57892 	 * The completion ring to send the completion event on. This should
57893 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57894 	 */
57895 	uint16_t	cmpl_ring;
57896 	/*
57897 	 * The sequence ID is used by the driver for tracking multiple
57898 	 * commands. This ID is treated as opaque data by the firmware and
57899 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57900 	 */
57901 	uint16_t	seq_id;
57902 	/*
57903 	 * The target ID of the command:
57904 	 * * 0x0-0xFFF8 - The function ID
57905 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57906 	 * * 0xFFFD - Reserved for user-space HWRM interface
57907 	 * * 0xFFFF - HWRM
57908 	 */
57909 	uint16_t	target_id;
57910 	/*
57911 	 * A physical address pointer pointing to a host buffer that the
57912 	 * command's response data will be written. This can be either a host
57913 	 * physical address (HPA) or a guest physical address (GPA) and must
57914 	 * point to a physically contiguous block of memory.
57915 	 */
57916 	uint64_t	resp_addr;
57917 	/*
57918 	 * This value indicates the target id of the encapsulated
57919 	 * response.
57920 	 * 0x0 - 0xFFF8 - Used for function ids
57921 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
57922 	 * 0xFFFF - HWRM
57923 	 */
57924 	uint16_t	encap_resp_target_id;
57925 	/*
57926 	 * This value indicates the completion ring the encapsulated
57927 	 * response will be optionally completed on.  If the value is
57928 	 * -1, then no CR completion shall be generated for the
57929 	 * encapsulated response. Any other value must be a
57930 	 * valid CR ring_id value. If a valid encap_resp_cmpl_ring
57931 	 * is provided, then a CR completion shall be generated for
57932 	 * the encapsulated response.
57933 	 */
57934 	uint16_t	encap_resp_cmpl_ring;
57935 	/* This field indicates the length of encapsulated response. */
57936 	uint16_t	encap_resp_len;
57937 	uint8_t	unused_0;
57938 	uint8_t	unused_1;
57939 	/*
57940 	 * This is the host address where the encapsulated response
57941 	 * will be written.
57942 	 * This area must be 16B aligned and must be cleared to zero
57943 	 * before the original request is made.
57944 	 */
57945 	uint64_t	encap_resp_addr;
57946 	/* This is an encapsulated response. */
57947 	uint32_t	encap_resp[24];
57948 } hwrm_fwd_resp_input_t, *phwrm_fwd_resp_input_t;
57949 
57950 /* hwrm_fwd_resp_output (size:128b/16B) */
57951 
57952 typedef struct hwrm_fwd_resp_output {
57953 	/* The specific error status for the command. */
57954 	uint16_t	error_code;
57955 	/* The HWRM command request type. */
57956 	uint16_t	req_type;
57957 	/* The sequence ID from the original command. */
57958 	uint16_t	seq_id;
57959 	/* The length of the response data in number of bytes. */
57960 	uint16_t	resp_len;
57961 	uint8_t	unused_0[7];
57962 	/*
57963 	 * This field is used in Output records to indicate that the output
57964 	 * is completely written to RAM.  This field should be read as '1'
57965 	 * to indicate that the output has been completely written.
57966 	 * When writing a command completion or response to an internal processor,
57967 	 * the order of writes has to be such that this field is written last.
57968 	 */
57969 	uint8_t	valid;
57970 } hwrm_fwd_resp_output_t, *phwrm_fwd_resp_output_t;
57971 
57972 /*****************************
57973  * hwrm_fwd_async_event_cmpl *
57974  *****************************/
57975 
57976 
57977 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
57978 
57979 typedef struct hwrm_fwd_async_event_cmpl_input {
57980 	/* The HWRM command request type. */
57981 	uint16_t	req_type;
57982 	/*
57983 	 * The completion ring to send the completion event on. This should
57984 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57985 	 */
57986 	uint16_t	cmpl_ring;
57987 	/*
57988 	 * The sequence ID is used by the driver for tracking multiple
57989 	 * commands. This ID is treated as opaque data by the firmware and
57990 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57991 	 */
57992 	uint16_t	seq_id;
57993 	/*
57994 	 * The target ID of the command:
57995 	 * * 0x0-0xFFF8 - The function ID
57996 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57997 	 * * 0xFFFD - Reserved for user-space HWRM interface
57998 	 * * 0xFFFF - HWRM
57999 	 */
58000 	uint16_t	target_id;
58001 	/*
58002 	 * A physical address pointer pointing to a host buffer that the
58003 	 * command's response data will be written. This can be either a host
58004 	 * physical address (HPA) or a guest physical address (GPA) and must
58005 	 * point to a physically contiguous block of memory.
58006 	 */
58007 	uint64_t	resp_addr;
58008 	/*
58009 	 * This value indicates the target id of the encapsulated
58010 	 * asynchronous event.
58011 	 * 0x0 - 0xFFF8 - Used for function ids
58012 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
58013 	 * 0xFFFF - Broadcast to all children VFs (only applicable when
58014 	 * a PF is the requester)
58015 	 */
58016 	uint16_t	encap_async_event_target_id;
58017 	uint8_t	unused_0[6];
58018 	/* This is an encapsulated asynchronous event completion. */
58019 	uint32_t	encap_async_event_cmpl[4];
58020 } hwrm_fwd_async_event_cmpl_input_t, *phwrm_fwd_async_event_cmpl_input_t;
58021 
58022 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
58023 
58024 typedef struct hwrm_fwd_async_event_cmpl_output {
58025 	/* The specific error status for the command. */
58026 	uint16_t	error_code;
58027 	/* The HWRM command request type. */
58028 	uint16_t	req_type;
58029 	/* The sequence ID from the original command. */
58030 	uint16_t	seq_id;
58031 	/* The length of the response data in number of bytes. */
58032 	uint16_t	resp_len;
58033 	uint8_t	unused_0[7];
58034 	/*
58035 	 * This field is used in Output records to indicate that the output
58036 	 * is completely written to RAM.  This field should be read as '1'
58037 	 * to indicate that the output has been completely written.
58038 	 * When writing a command completion or response to an internal processor,
58039 	 * the order of writes has to be such that this field is written last.
58040 	 */
58041 	uint8_t	valid;
58042 } hwrm_fwd_async_event_cmpl_output_t, *phwrm_fwd_async_event_cmpl_output_t;
58043 
58044 /***************************
58045  * hwrm_temp_monitor_query *
58046  ***************************/
58047 
58048 
58049 /* hwrm_temp_monitor_query_input (size:128b/16B) */
58050 
58051 typedef struct hwrm_temp_monitor_query_input {
58052 	/* The HWRM command request type. */
58053 	uint16_t	req_type;
58054 	/*
58055 	 * The completion ring to send the completion event on. This should
58056 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58057 	 */
58058 	uint16_t	cmpl_ring;
58059 	/*
58060 	 * The sequence ID is used by the driver for tracking multiple
58061 	 * commands. This ID is treated as opaque data by the firmware and
58062 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58063 	 */
58064 	uint16_t	seq_id;
58065 	/*
58066 	 * The target ID of the command:
58067 	 * * 0x0-0xFFF8 - The function ID
58068 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58069 	 * * 0xFFFD - Reserved for user-space HWRM interface
58070 	 * * 0xFFFF - HWRM
58071 	 */
58072 	uint16_t	target_id;
58073 	/*
58074 	 * A physical address pointer pointing to a host buffer that the
58075 	 * command's response data will be written. This can be either a host
58076 	 * physical address (HPA) or a guest physical address (GPA) and must
58077 	 * point to a physically contiguous block of memory.
58078 	 */
58079 	uint64_t	resp_addr;
58080 } hwrm_temp_monitor_query_input_t, *phwrm_temp_monitor_query_input_t;
58081 
58082 /* hwrm_temp_monitor_query_output (size:128b/16B) */
58083 
58084 typedef struct hwrm_temp_monitor_query_output {
58085 	/* The specific error status for the command. */
58086 	uint16_t	error_code;
58087 	/* The HWRM command request type. */
58088 	uint16_t	req_type;
58089 	/* The sequence ID from the original command. */
58090 	uint16_t	seq_id;
58091 	/* The length of the response data in number of bytes. */
58092 	uint16_t	resp_len;
58093 	/*
58094 	 * The HWRM shall provide the current temperature of
58095 	 * the device in Celsius. This is the max of PCIe_temp
58096 	 * and PM_temp
58097 	 */
58098 	uint8_t	temp;
58099 	/*
58100 	 * The HWRM shall provide the current temperature of
58101 	 * the phy in Celsius.
58102 	 */
58103 	uint8_t	phy_temp;
58104 	/*
58105 	 * The HWRM shall provide the current temperature of
58106 	 * the module_index in Celsius.
58107 	 */
58108 	uint8_t	om_temp;
58109 	/* Describe individual temperature sensor condition. */
58110 	uint8_t	flags;
58111 	/*
58112 	 * "1" in this bit indicates temperature read not
58113 	 * successful.
58114 	 */
58115 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_TEMP_NOT_AVAILABLE		UINT32_C(0x1)
58116 	/*
58117 	 * "1" in this bit indicates phy temperature read not
58118 	 * successful.
58119 	 */
58120 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_PHY_TEMP_NOT_AVAILABLE	UINT32_C(0x2)
58121 	/* "1" in this bit indicates optical module(s) not present. */
58122 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_NOT_PRESENT		UINT32_C(0x4)
58123 	/*
58124 	 * "1" in this bit indicates om temperature read not
58125 	 * successful.
58126 	 */
58127 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_TEMP_NOT_AVAILABLE	UINT32_C(0x8)
58128 	/*
58129 	 * "1" in this bit indicates the extended temperature fields are
58130 	 * available.
58131 	 */
58132 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_EXT_TEMP_FIELDS_AVAILABLE	UINT32_C(0x10)
58133 	/*
58134 	 * This field encodes the current device temperature in Celsius.
58135 	 * This field is unsigned and the value range of 0 to 255 is used to
58136 	 * indicate a temperature range from -64 to +191. The actual
58137 	 * temperature is derived by subtracting 64 from this field.
58138 	 * Example: A value of 0 represents a temperature of -64, a value of
58139 	 * 255 represents a temperature of 191.
58140 	 */
58141 	uint8_t	temp2;
58142 	/*
58143 	 * This field encodes the current phy temperature in Celsius. This
58144 	 * field is unsigned and the value range of 0 to 255 is used to
58145 	 * indicate a temperature range from -64 to +191. The actual
58146 	 * temperature is derived by subtracting 64 from this field.
58147 	 * Example: A value of 0 represents a temperature of -64, a value of
58148 	 * 255 represents a temperature of 191.
58149 	 */
58150 	uint8_t	phy_temp2;
58151 	/*
58152 	 * This field encodes the current module index temperature in Celsius.
58153 	 * This field is unsigned and the value range of 0 to 255 is used to
58154 	 * indicate a temperature range from -64 to +191. The actual
58155 	 * temperature is derived by subtracting 64 from this field.
58156 	 * Example: A value of 0 represents a temperature of -64, a value of
58157 	 * 255 represents a temperature of 191.
58158 	 */
58159 	uint8_t	om_temp2;
58160 	/*
58161 	 * This field is used in Output records to indicate that the output
58162 	 * is completely written to RAM.  This field should be read as '1'
58163 	 * to indicate that the output has been completely written.
58164 	 * When writing a command completion or response to an internal processor,
58165 	 * the order of writes has to be such that this field is written last.
58166 	 */
58167 	uint8_t	valid;
58168 } hwrm_temp_monitor_query_output_t, *phwrm_temp_monitor_query_output_t;
58169 
58170 /************************
58171  * hwrm_reg_power_query *
58172  ************************/
58173 
58174 
58175 /* hwrm_reg_power_query_input (size:128b/16B) */
58176 
58177 typedef struct hwrm_reg_power_query_input {
58178 	/* The HWRM command request type. */
58179 	uint16_t	req_type;
58180 	/*
58181 	 * The completion ring to send the completion event on. This should
58182 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58183 	 */
58184 	uint16_t	cmpl_ring;
58185 	/*
58186 	 * The sequence ID is used by the driver for tracking multiple
58187 	 * commands. This ID is treated as opaque data by the firmware and
58188 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58189 	 */
58190 	uint16_t	seq_id;
58191 	/*
58192 	 * The target ID of the command:
58193 	 * * 0x0-0xFFF8 - The function ID
58194 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58195 	 * * 0xFFFD - Reserved for user-space HWRM interface
58196 	 * * 0xFFFF - HWRM
58197 	 */
58198 	uint16_t	target_id;
58199 	/*
58200 	 * A physical address pointer pointing to a host buffer that the
58201 	 * command's response data will be written. This can be either a host
58202 	 * physical address (HPA) or a guest physical address (GPA) and must
58203 	 * point to a physically contiguous block of memory.
58204 	 */
58205 	uint64_t	resp_addr;
58206 } hwrm_reg_power_query_input_t, *phwrm_reg_power_query_input_t;
58207 
58208 /* hwrm_reg_power_query_output (size:192b/24B) */
58209 
58210 typedef struct hwrm_reg_power_query_output {
58211 	/* The specific error status for the command. */
58212 	uint16_t	error_code;
58213 	/* The HWRM command request type. */
58214 	uint16_t	req_type;
58215 	/* The sequence ID from the original command. */
58216 	uint16_t	seq_id;
58217 	/* The length of the response data in number of bytes. */
58218 	uint16_t	resp_len;
58219 	/* Describe availability of switching regulator power values. */
58220 	uint32_t	flags;
58221 	/* When this bit is set to '1', the input power is available. */
58222 	#define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_IN_POWER_AVAILABLE	UINT32_C(0x1)
58223 	/* When this bit is set to '1', the output power is available. */
58224 	#define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_OUT_POWER_AVAILABLE	UINT32_C(0x2)
58225 	/*
58226 	 * The HWRM shall provide the current switching regulator
58227 	 * input power in mW, if available.
58228 	 */
58229 	uint32_t	in_power_mw;
58230 	/*
58231 	 * The HWRM shall provide the current switching regulator
58232 	 * output power in mW, if available.
58233 	 */
58234 	uint32_t	out_power_mw;
58235 	uint8_t	unused_0[3];
58236 	/*
58237 	 * This field is used in Output records to indicate that the output
58238 	 * is completely written to RAM.  This field should be read as '1'
58239 	 * to indicate that the output has been completely written.
58240 	 * When writing a command completion or response to an internal processor,
58241 	 * the order of writes has to be such that this field is written last.
58242 	 */
58243 	uint8_t	valid;
58244 } hwrm_reg_power_query_output_t, *phwrm_reg_power_query_output_t;
58245 
58246 /*****************************
58247  * hwrm_core_frequency_query *
58248  *****************************/
58249 
58250 
58251 /* hwrm_core_frequency_query_input (size:128b/16B) */
58252 
58253 typedef struct hwrm_core_frequency_query_input {
58254 	/* The HWRM command request type. */
58255 	uint16_t	req_type;
58256 	/*
58257 	 * The completion ring to send the completion event on. This should
58258 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58259 	 */
58260 	uint16_t	cmpl_ring;
58261 	/*
58262 	 * The sequence ID is used by the driver for tracking multiple
58263 	 * commands. This ID is treated as opaque data by the firmware and
58264 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58265 	 */
58266 	uint16_t	seq_id;
58267 	/*
58268 	 * The target ID of the command:
58269 	 * * 0x0-0xFFF8 - The function ID
58270 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58271 	 * * 0xFFFD - Reserved for user-space HWRM interface
58272 	 * * 0xFFFF - HWRM
58273 	 */
58274 	uint16_t	target_id;
58275 	/*
58276 	 * A physical address pointer pointing to a host buffer that the
58277 	 * command's response data will be written. This can be either a host
58278 	 * physical address (HPA) or a guest physical address (GPA) and must
58279 	 * point to a physically contiguous block of memory.
58280 	 */
58281 	uint64_t	resp_addr;
58282 } hwrm_core_frequency_query_input_t, *phwrm_core_frequency_query_input_t;
58283 
58284 /* hwrm_core_frequency_query_output (size:128b/16B) */
58285 
58286 typedef struct hwrm_core_frequency_query_output {
58287 	/* The specific error status for the command. */
58288 	uint16_t	error_code;
58289 	/* The HWRM command request type. */
58290 	uint16_t	req_type;
58291 	/* The sequence ID from the original command. */
58292 	uint16_t	seq_id;
58293 	/* The length of the response data in number of bytes. */
58294 	uint16_t	resp_len;
58295 	/* The HWRM shall provide the core frequency in Hz. */
58296 	uint32_t	core_frequency_hz;
58297 	uint8_t	unused_0[3];
58298 	/*
58299 	 * This field is used in Output records to indicate that the output
58300 	 * is completely written to RAM.  This field should be read as '1'
58301 	 * to indicate that the output has been completely written.
58302 	 * When writing a command completion or response to an internal processor,
58303 	 * the order of writes has to be such that this field is written last.
58304 	 */
58305 	uint8_t	valid;
58306 } hwrm_core_frequency_query_output_t, *phwrm_core_frequency_query_output_t;
58307 
58308 /****************************
58309  * hwrm_reg_power_histogram *
58310  ****************************/
58311 
58312 
58313 /* hwrm_reg_power_histogram_input (size:192b/24B) */
58314 
58315 typedef struct hwrm_reg_power_histogram_input {
58316 	/* The HWRM command request type. */
58317 	uint16_t	req_type;
58318 	/*
58319 	 * The completion ring to send the completion event on. This should
58320 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58321 	 */
58322 	uint16_t	cmpl_ring;
58323 	/*
58324 	 * The sequence ID is used by the driver for tracking multiple
58325 	 * commands. This ID is treated as opaque data by the firmware and
58326 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58327 	 */
58328 	uint16_t	seq_id;
58329 	/*
58330 	 * The target ID of the command:
58331 	 * * 0x0-0xFFF8 - The function ID
58332 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58333 	 * * 0xFFFD - Reserved for user-space HWRM interface
58334 	 * * 0xFFFF - HWRM
58335 	 */
58336 	uint16_t	target_id;
58337 	/*
58338 	 * A physical address pointer pointing to a host buffer that the
58339 	 * command's response data will be written. This can be either a host
58340 	 * physical address (HPA) or a guest physical address (GPA) and must
58341 	 * point to a physically contiguous block of memory.
58342 	 */
58343 	uint64_t	resp_addr;
58344 	/* Describe operational mode of power histogram command. */
58345 	uint32_t	flags;
58346 	/*
58347 	 * When this bit is set to '1', histogram data for the respective
58348 	 * client (HWRM or BMC) is cleared after read.
58349 	 */
58350 	#define HWRM_REG_POWER_HISTOGRAM_INPUT_FLAGS_CLEAR_HISTOGRAM	UINT32_C(0x1)
58351 	uint32_t	unused_0;
58352 } hwrm_reg_power_histogram_input_t, *phwrm_reg_power_histogram_input_t;
58353 
58354 /* hwrm_reg_power_histogram_output (size:1088b/136B) */
58355 
58356 typedef struct hwrm_reg_power_histogram_output {
58357 	/* The specific error status for the command. */
58358 	uint16_t	error_code;
58359 	/* The HWRM command request type. */
58360 	uint16_t	req_type;
58361 	/* The sequence ID from the original command. */
58362 	uint16_t	seq_id;
58363 	/* The length of the response data in number of bytes. */
58364 	uint16_t	resp_len;
58365 	/* Describe output characteristics of power histogram command. */
58366 	uint16_t	flags;
58367 	/*
58368 	 * Indicates whether input or output power is used. Some switching
58369 	 * regulators provide both input and output voltage and current
58370 	 * measurements, and others provide only output measurements. When
58371 	 * both are available, input is used. This value is constant for a
58372 	 * given board.
58373 	 */
58374 	#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT	UINT32_C(0x1)
58375 	/*
58376 	 * The switching regulator's input power is used
58377 	 * data.
58378 	 */
58379 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_INPUT   UINT32_C(0x0)
58380 	/*
58381 	 * The switching regulator's output power is used
58382 	 * data.
58383 	 */
58384 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT  UINT32_C(0x1)
58385 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_LAST   HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT
58386 	uint8_t	unused_0[2];
58387 	/*
58388 	 * Time in microseconds between samples. This value is constant in
58389 	 * firmware. The initial design sets this constant at 10000 us (10
58390 	 * ms). Power values for voltage regulators calculate a power value
58391 	 * over a 300 us period, so a 10 ms sampling period covers 3% of
58392 	 * time ranges. Future firmware designs may opt for different
58393 	 * sampling periods, so this value is provided on output.
58394 	 */
58395 	uint32_t	sampling_period;
58396 	/*
58397 	 * Total samples taken since last clear. If no counter has
58398 	 * saturated, the sum of counts in each bucket equates to this
58399 	 * sample_count value. If a single counter has saturated, its value
58400 	 * can be calculated by subtracting the remaining bucket values from
58401 	 * this sample_count value.
58402 	 */
58403 	uint64_t	sample_count;
58404 	/*
58405 	 * The power usage expressed in histogram buckets. Bucket value
58406 	 * ranges and array indices are defined per the enumeration
58407 	 * power_histogram_bucket_enum. Values saturate at the max 32-bit
58408 	 * value, 0xFFFFFFFF, and do not roll over. Clients should use the
58409 	 * clear bit on input to clear the histogram array periodically or
58410 	 * when saturation is observed.
58411 	 */
58412 	uint32_t	power_hist[26];
58413 	uint8_t	unused_1[7];
58414 	/*
58415 	 * This field is used in Output records to indicate that the output
58416 	 * is completely written to RAM.  This field should be read as '1'
58417 	 * to indicate that the output has been completely written.
58418 	 * When writing a command completion or response to an internal processor,
58419 	 * the order of writes has to be such that this field is written last.
58420 	 */
58421 	uint8_t	valid;
58422 } hwrm_reg_power_histogram_output_t, *phwrm_reg_power_histogram_output_t;
58423 
58424 /*
58425  * Count of timer callback routines run with no data measured. This
58426  * may occur when data from the switching regulator is not available
58427  * to the firmware timer callback routine. One possible reason for
58428  * this is contention with other users of the i2c bus which is used
58429  * to communicate with the switching regulator, for example when a
58430  * call to hwrm_reg_power_query occurs while the timer routine is
58431  * running.
58432  */
58433 #define BUCKET_NO_DATA_FOR_SAMPLE UINT32_C(0x0)
58434 /* Count of samples measured at less than 8W */
58435 #define BUCKET_RANGE_8W_OR_LESS   UINT32_C(0x1)
58436 /* Count of samples measured >= 8 W and < 9 W */
58437 #define BUCKET_RANGE_8W_TO_9W	UINT32_C(0x2)
58438 /* Count of samples measured >= 9 W and < 10 W */
58439 #define BUCKET_RANGE_9W_TO_10W	UINT32_C(0x3)
58440 /* Count of samples measured >= 10 W and < 11 W */
58441 #define BUCKET_RANGE_10W_TO_11W   UINT32_C(0x4)
58442 /* Count of samples measured >= 11 W and < 12 W */
58443 #define BUCKET_RANGE_11W_TO_12W   UINT32_C(0x5)
58444 /* Count of samples measured >= 12 W and < 13 W */
58445 #define BUCKET_RANGE_12W_TO_13W   UINT32_C(0x6)
58446 /* Count of samples measured >= 13 W and < 14 W */
58447 #define BUCKET_RANGE_13W_TO_14W   UINT32_C(0x7)
58448 /* Count of samples measured >= 14 W and < 15 W */
58449 #define BUCKET_RANGE_14W_TO_15W   UINT32_C(0x8)
58450 /* Count of samples measured >= 15 W and < 16 W */
58451 #define BUCKET_RANGE_15W_TO_16W   UINT32_C(0x9)
58452 /* Count of samples measured >= 16 W and < 18 W */
58453 #define BUCKET_RANGE_16W_TO_18W   UINT32_C(0xa)
58454 /* Count of samples measured >= 18 W and < 20 W */
58455 #define BUCKET_RANGE_18W_TO_20W   UINT32_C(0xb)
58456 /* Count of samples measured >= 20 W and < 22 W */
58457 #define BUCKET_RANGE_20W_TO_22W   UINT32_C(0xc)
58458 /* Count of samples measured >= 22 W and < 24 W */
58459 #define BUCKET_RANGE_22W_TO_24W   UINT32_C(0xd)
58460 /* Count of samples measured >= 24 W and < 26 W */
58461 #define BUCKET_RANGE_24W_TO_26W   UINT32_C(0xe)
58462 /* Count of samples measured >= 26 W and < 28 W */
58463 #define BUCKET_RANGE_26W_TO_28W   UINT32_C(0xf)
58464 /* Count of samples measured >= 28 W and < 30 W */
58465 #define BUCKET_RANGE_28W_TO_30W   UINT32_C(0x10)
58466 /* Count of samples measured >= 30 W and < 32 W */
58467 #define BUCKET_RANGE_30W_TO_32W   UINT32_C(0x11)
58468 /* Count of samples measured >= 32 W and < 34 W */
58469 #define BUCKET_RANGE_32W_TO_34W   UINT32_C(0x12)
58470 /* Count of samples measured >= 34 W and < 36 W */
58471 #define BUCKET_RANGE_34W_TO_36W   UINT32_C(0x13)
58472 /* Count of samples measured >= 36 W and < 38 W */
58473 #define BUCKET_RANGE_36W_TO_38W   UINT32_C(0x14)
58474 /* Count of samples measured >= 38 W and < 40 W */
58475 #define BUCKET_RANGE_38W_TO_40W   UINT32_C(0x15)
58476 /* Count of samples measured >= 40 W and < 42 W */
58477 #define BUCKET_RANGE_40W_TO_42W   UINT32_C(0x16)
58478 /* Count of samples measured >= 42 W and < 44 W */
58479 #define BUCKET_RANGE_42W_TO_44W   UINT32_C(0x17)
58480 /* Count of samples measured >= 44 W and < 50 W */
58481 #define BUCKET_RANGE_44W_TO_50W   UINT32_C(0x18)
58482 /* Count of samples measured at 50 W or greater */
58483 #define BUCKET_RANGE_OVER_50W	UINT32_C(0x19)
58484 #define BUCKET_LAST		BUCKET_RANGE_OVER_50W
58485 
58486 
58487 /*************************
58488  * hwrm_wol_filter_alloc *
58489  *************************/
58490 
58491 
58492 /* hwrm_wol_filter_alloc_input (size:512b/64B) */
58493 
58494 typedef struct hwrm_wol_filter_alloc_input {
58495 	/* The HWRM command request type. */
58496 	uint16_t	req_type;
58497 	/*
58498 	 * The completion ring to send the completion event on. This should
58499 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58500 	 */
58501 	uint16_t	cmpl_ring;
58502 	/*
58503 	 * The sequence ID is used by the driver for tracking multiple
58504 	 * commands. This ID is treated as opaque data by the firmware and
58505 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58506 	 */
58507 	uint16_t	seq_id;
58508 	/*
58509 	 * The target ID of the command:
58510 	 * * 0x0-0xFFF8 - The function ID
58511 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58512 	 * * 0xFFFD - Reserved for user-space HWRM interface
58513 	 * * 0xFFFF - HWRM
58514 	 */
58515 	uint16_t	target_id;
58516 	/*
58517 	 * A physical address pointer pointing to a host buffer that the
58518 	 * command's response data will be written. This can be either a host
58519 	 * physical address (HPA) or a guest physical address (GPA) and must
58520 	 * point to a physically contiguous block of memory.
58521 	 */
58522 	uint64_t	resp_addr;
58523 	uint32_t	flags;
58524 	uint32_t	enables;
58525 	/*
58526 	 * This bit must be '1' for the mac_address field to be
58527 	 * configured.
58528 	 */
58529 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS	UINT32_C(0x1)
58530 	/*
58531 	 * This bit must be '1' for the pattern_offset field to be
58532 	 * configured.
58533 	 */
58534 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_OFFSET	UINT32_C(0x2)
58535 	/*
58536 	 * This bit must be '1' for the pattern_buf_size field to be
58537 	 * configured.
58538 	 */
58539 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_SIZE	UINT32_C(0x4)
58540 	/*
58541 	 * This bit must be '1' for the pattern_buf_addr field to be
58542 	 * configured.
58543 	 */
58544 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_ADDR	UINT32_C(0x8)
58545 	/*
58546 	 * This bit must be '1' for the pattern_mask_addr field to be
58547 	 * configured.
58548 	 */
58549 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_ADDR	UINT32_C(0x10)
58550 	/*
58551 	 * This bit must be '1' for the pattern_mask_size field to be
58552 	 * configured.
58553 	 */
58554 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_SIZE	UINT32_C(0x20)
58555 	/* Port ID of port on which WoL filter is configured. */
58556 	uint16_t	port_id;
58557 	/* This value represents a Wake-on-LAN type. */
58558 	uint8_t	wol_type;
58559 	/* Magic Packet */
58560 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
58561 	/* Bitmap */
58562 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_BMP	UINT32_C(0x1)
58563 	/* Invalid */
58564 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID  UINT32_C(0xff)
58565 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_LAST	HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID
58566 	uint8_t	unused_0[5];
58567 	/*
58568 	 * # If this field is enabled and magic packet WoL filter
58569 	 * type is specified in this command, the value set in this
58570 	 * field shall be used in setting the magic packet based
58571 	 * WoL filter.
58572 	 * # If this field is not enabled and magic packet WoL
58573 	 * filter type is specified and port id is specified to
58574 	 * 0xFF in this command, then the HWRM
58575 	 * shall use default MAC address configured on the
58576 	 * function associated with the HWRM client.
58577 	 * # If this field is not enabled and magic packet WoL
58578 	 * filter type is specified and port id is not specified to
58579 	 * 0xFF in this command, then the HWRM
58580 	 * shall use default MAC address configured on the port.
58581 	 */
58582 	uint8_t	mac_address[6];
58583 	/*
58584 	 * The offset from the beginning of MAC header where
58585 	 * pattern should be matched.
58586 	 * Applies to bitmap WoL.
58587 	 */
58588 	uint16_t	pattern_offset;
58589 	/*
58590 	 * The size of the pattern that is being matched.
58591 	 * Applies to bitmap WoL.
58592 	 */
58593 	uint16_t	pattern_buf_size;
58594 	/*
58595 	 * The size of the pattern mask.
58596 	 * Applies to bitmap WoL.
58597 	 */
58598 	uint16_t	pattern_mask_size;
58599 	uint8_t	unused_1[4];
58600 	/*
58601 	 * Physical address of the pattern buffer.
58602 	 * Applies to bitmap WoL.
58603 	 */
58604 	uint64_t	pattern_buf_addr;
58605 	/*
58606 	 * Physical address of the pattern mask.
58607 	 * Applies to bitmap WoL.
58608 	 */
58609 	uint64_t	pattern_mask_addr;
58610 } hwrm_wol_filter_alloc_input_t, *phwrm_wol_filter_alloc_input_t;
58611 
58612 /* hwrm_wol_filter_alloc_output (size:128b/16B) */
58613 
58614 typedef struct hwrm_wol_filter_alloc_output {
58615 	/* The specific error status for the command. */
58616 	uint16_t	error_code;
58617 	/* The HWRM command request type. */
58618 	uint16_t	req_type;
58619 	/* The sequence ID from the original command. */
58620 	uint16_t	seq_id;
58621 	/* The length of the response data in number of bytes. */
58622 	uint16_t	resp_len;
58623 	/* This value identifies a Wake-on-LAN (WoL) filter. */
58624 	uint8_t	wol_filter_id;
58625 	uint8_t	unused_0[6];
58626 	/*
58627 	 * This field is used in Output records to indicate that the output
58628 	 * is completely written to RAM.  This field should be read as '1'
58629 	 * to indicate that the output has been completely written.
58630 	 * When writing a command completion or response to an internal processor,
58631 	 * the order of writes has to be such that this field is written last.
58632 	 */
58633 	uint8_t	valid;
58634 } hwrm_wol_filter_alloc_output_t, *phwrm_wol_filter_alloc_output_t;
58635 
58636 /************************
58637  * hwrm_wol_filter_free *
58638  ************************/
58639 
58640 
58641 /* hwrm_wol_filter_free_input (size:256b/32B) */
58642 
58643 typedef struct hwrm_wol_filter_free_input {
58644 	/* The HWRM command request type. */
58645 	uint16_t	req_type;
58646 	/*
58647 	 * The completion ring to send the completion event on. This should
58648 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58649 	 */
58650 	uint16_t	cmpl_ring;
58651 	/*
58652 	 * The sequence ID is used by the driver for tracking multiple
58653 	 * commands. This ID is treated as opaque data by the firmware and
58654 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58655 	 */
58656 	uint16_t	seq_id;
58657 	/*
58658 	 * The target ID of the command:
58659 	 * * 0x0-0xFFF8 - The function ID
58660 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58661 	 * * 0xFFFD - Reserved for user-space HWRM interface
58662 	 * * 0xFFFF - HWRM
58663 	 */
58664 	uint16_t	target_id;
58665 	/*
58666 	 * A physical address pointer pointing to a host buffer that the
58667 	 * command's response data will be written. This can be either a host
58668 	 * physical address (HPA) or a guest physical address (GPA) and must
58669 	 * point to a physically contiguous block of memory.
58670 	 */
58671 	uint64_t	resp_addr;
58672 	uint32_t	flags;
58673 	/*
58674 	 * # When this bit is set to '1', then all active WoL
58675 	 * filters on the port are requested to be freed.
58676 	 * # If the a function driver sets this flag to '1', then
58677 	 * the HWRM shall free all active WoL filters that are not
58678 	 * set by other function drivers on that port.
58679 	 */
58680 	#define HWRM_WOL_FILTER_FREE_INPUT_FLAGS_FREE_ALL_WOL_FILTERS	UINT32_C(0x1)
58681 	uint32_t	enables;
58682 	/*
58683 	 * This bit must be '1' for the wol_filter_id field to be
58684 	 * configured.
58685 	 */
58686 	#define HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID	UINT32_C(0x1)
58687 	/* Port ID of the port on which WoL filter(s) is (are) being freed. */
58688 	uint16_t	port_id;
58689 	/*
58690 	 * The HWRM shall ignore this field if free_all_wol_filters
58691 	 * flag is set.
58692 	 */
58693 	uint8_t	wol_filter_id;
58694 	uint8_t	unused_0[5];
58695 } hwrm_wol_filter_free_input_t, *phwrm_wol_filter_free_input_t;
58696 
58697 /* hwrm_wol_filter_free_output (size:128b/16B) */
58698 
58699 typedef struct hwrm_wol_filter_free_output {
58700 	/* The specific error status for the command. */
58701 	uint16_t	error_code;
58702 	/* The HWRM command request type. */
58703 	uint16_t	req_type;
58704 	/* The sequence ID from the original command. */
58705 	uint16_t	seq_id;
58706 	/* The length of the response data in number of bytes. */
58707 	uint16_t	resp_len;
58708 	uint8_t	unused_0[7];
58709 	/*
58710 	 * This field is used in Output records to indicate that the output
58711 	 * is completely written to RAM.  This field should be read as '1'
58712 	 * to indicate that the output has been completely written.
58713 	 * When writing a command completion or response to an internal processor,
58714 	 * the order of writes has to be such that this field is written last.
58715 	 */
58716 	uint8_t	valid;
58717 } hwrm_wol_filter_free_output_t, *phwrm_wol_filter_free_output_t;
58718 
58719 /************************
58720  * hwrm_wol_filter_qcfg *
58721  ************************/
58722 
58723 
58724 /* hwrm_wol_filter_qcfg_input (size:448b/56B) */
58725 
58726 typedef struct hwrm_wol_filter_qcfg_input {
58727 	/* The HWRM command request type. */
58728 	uint16_t	req_type;
58729 	/*
58730 	 * The completion ring to send the completion event on. This should
58731 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58732 	 */
58733 	uint16_t	cmpl_ring;
58734 	/*
58735 	 * The sequence ID is used by the driver for tracking multiple
58736 	 * commands. This ID is treated as opaque data by the firmware and
58737 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58738 	 */
58739 	uint16_t	seq_id;
58740 	/*
58741 	 * The target ID of the command:
58742 	 * * 0x0-0xFFF8 - The function ID
58743 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58744 	 * * 0xFFFD - Reserved for user-space HWRM interface
58745 	 * * 0xFFFF - HWRM
58746 	 */
58747 	uint16_t	target_id;
58748 	/*
58749 	 * A physical address pointer pointing to a host buffer that the
58750 	 * command's response data will be written. This can be either a host
58751 	 * physical address (HPA) or a guest physical address (GPA) and must
58752 	 * point to a physically contiguous block of memory.
58753 	 */
58754 	uint64_t	resp_addr;
58755 	/* Port ID of port on which WoL filter that is being queried. */
58756 	uint16_t	port_id;
58757 	/*
58758 	 * This is an opaque handle used to access filters.
58759 	 * # The HWRM client shall set this field to 0x0000 to begin
58760 	 * the query.
58761 	 * # After the first query, the HWRM client shall retrieve
58762 	 * next filters (if they exist) using the HWRM provided handle
58763 	 * in the response.
58764 	 */
58765 	uint16_t	handle;
58766 	uint8_t	unused_0[4];
58767 	/*
58768 	 * Physical address of the pattern buffer.
58769 	 * Applies to bitmap WoL filter only.
58770 	 * # Value of 0 indicates an invalid buffer address.
58771 	 * If this field is set to 0, then HWRM shall ignore
58772 	 * pattern_buf_size.
58773 	 * # If the HWRM client provides an invalid buffer address
58774 	 * for the pattern, then the HWRM is not required to
58775 	 * provide pattern when the response contains a bitmap WoL
58776 	 * filter.
58777 	 */
58778 	uint64_t	pattern_buf_addr;
58779 	/*
58780 	 * The size of the pattern buffer.
58781 	 * Applies to bitmap WoL filter only.
58782 	 */
58783 	uint16_t	pattern_buf_size;
58784 	uint8_t	unused_1[6];
58785 	/*
58786 	 * Physical address of the pattern mask.
58787 	 * Applies to bitmap WoL filter only.
58788 	 * # Value of 0 indicates an invalid pattern mask address.
58789 	 * If this field is set to 0, then HWRM shall ignore
58790 	 * pattern_mask_size.
58791 	 * # If the HWRM client provides an invalid mask address
58792 	 * for the pattern, then the HWRM is not required to
58793 	 * provide mask when the response contains a bitmap WoL
58794 	 * filter.
58795 	 */
58796 	uint64_t	pattern_mask_addr;
58797 	/*
58798 	 * The size of the buffer for pattern mask.
58799 	 * Applies to bitmap WoL filter only.
58800 	 */
58801 	uint16_t	pattern_mask_size;
58802 	uint8_t	unused_2[6];
58803 } hwrm_wol_filter_qcfg_input_t, *phwrm_wol_filter_qcfg_input_t;
58804 
58805 /* hwrm_wol_filter_qcfg_output (size:256b/32B) */
58806 
58807 typedef struct hwrm_wol_filter_qcfg_output {
58808 	/* The specific error status for the command. */
58809 	uint16_t	error_code;
58810 	/* The HWRM command request type. */
58811 	uint16_t	req_type;
58812 	/* The sequence ID from the original command. */
58813 	uint16_t	seq_id;
58814 	/* The length of the response data in number of bytes. */
58815 	uint16_t	resp_len;
58816 	/*
58817 	 * This is the next handle that is used to access filters.
58818 	 * # If this field is set to 0x0000, then no WoL filters are
58819 	 * currently configured on this port and all other fields in
58820 	 * the output shall be ignored by the HWRM client.
58821 	 * # If this field is set to neither 0x0000 nor 0xFFFF, then the
58822 	 * wol_filter_id is valid and the parameters provided in the
58823 	 * response are based on the wol_type.
58824 	 * # If this field is set to 0xFFFF, then there are no remaining
58825 	 * configured WoL filters to be queried for the queried function
58826 	 * after this response, wol_filter_id is valid and the parameters
58827 	 * provided in the response are based on the wol_type.
58828 	 */
58829 	uint16_t	next_handle;
58830 	/*
58831 	 * This value identifies the filter returned in this
58832 	 * response.
58833 	 */
58834 	uint8_t	wol_filter_id;
58835 	/*
58836 	 * This value identifies the type of WoL filter returned
58837 	 * in this response.
58838 	 */
58839 	uint8_t	wol_type;
58840 	/* Magic Packet */
58841 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
58842 	/* Bitmap */
58843 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_BMP	UINT32_C(0x1)
58844 	/* Invalid */
58845 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID  UINT32_C(0xff)
58846 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_LAST	HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID
58847 	uint32_t	unused_0;
58848 	/*
58849 	 * The MAC address value used by the WoL filter.
58850 	 * Applies to magic packet based WoL.
58851 	 */
58852 	uint8_t	mac_address[6];
58853 	/*
58854 	 * The offset from the beginning of MAC header where
58855 	 * pattern should be matched.
58856 	 * Applies to bitmap WoL.
58857 	 */
58858 	uint16_t	pattern_offset;
58859 	/*
58860 	 * The actual size of the pattern that is being returned.
58861 	 * Applies to bitmap WoL.
58862 	 */
58863 	uint16_t	pattern_size;
58864 	/*
58865 	 * The actual size of the pattern mask that is being returned.
58866 	 * Applies to bitmap WoL.
58867 	 */
58868 	uint16_t	pattern_mask_size;
58869 	uint8_t	unused_1[3];
58870 	/*
58871 	 * This field is used in Output records to indicate that the output
58872 	 * is completely written to RAM.  This field should be read as '1'
58873 	 * to indicate that the output has been completely written.
58874 	 * When writing a command completion or response to an internal processor,
58875 	 * the order of writes has to be such that this field is written last.
58876 	 */
58877 	uint8_t	valid;
58878 } hwrm_wol_filter_qcfg_output_t, *phwrm_wol_filter_qcfg_output_t;
58879 
58880 /************************
58881  * hwrm_wol_reason_qcfg *
58882  ************************/
58883 
58884 
58885 /* hwrm_wol_reason_qcfg_input (size:320b/40B) */
58886 
58887 typedef struct hwrm_wol_reason_qcfg_input {
58888 	/* The HWRM command request type. */
58889 	uint16_t	req_type;
58890 	/*
58891 	 * The completion ring to send the completion event on. This should
58892 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58893 	 */
58894 	uint16_t	cmpl_ring;
58895 	/*
58896 	 * The sequence ID is used by the driver for tracking multiple
58897 	 * commands. This ID is treated as opaque data by the firmware and
58898 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58899 	 */
58900 	uint16_t	seq_id;
58901 	/*
58902 	 * The target ID of the command:
58903 	 * * 0x0-0xFFF8 - The function ID
58904 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58905 	 * * 0xFFFD - Reserved for user-space HWRM interface
58906 	 * * 0xFFFF - HWRM
58907 	 */
58908 	uint16_t	target_id;
58909 	/*
58910 	 * A physical address pointer pointing to a host buffer that the
58911 	 * command's response data will be written. This can be either a host
58912 	 * physical address (HPA) or a guest physical address (GPA) and must
58913 	 * point to a physically contiguous block of memory.
58914 	 */
58915 	uint64_t	resp_addr;
58916 	/* Port ID of port for which this query is for. */
58917 	uint16_t	port_id;
58918 	uint8_t	unused_0[6];
58919 	/*
58920 	 * Physical address of the packet buffer for querying
58921 	 * WoL packet.
58922 	 */
58923 	uint64_t	wol_pkt_buf_addr;
58924 	/* The size of the buffer for the WoL packet. */
58925 	uint16_t	wol_pkt_buf_size;
58926 	uint8_t	unused_1[6];
58927 } hwrm_wol_reason_qcfg_input_t, *phwrm_wol_reason_qcfg_input_t;
58928 
58929 /* hwrm_wol_reason_qcfg_output (size:128b/16B) */
58930 
58931 typedef struct hwrm_wol_reason_qcfg_output {
58932 	/* The specific error status for the command. */
58933 	uint16_t	error_code;
58934 	/* The HWRM command request type. */
58935 	uint16_t	req_type;
58936 	/* The sequence ID from the original command. */
58937 	uint16_t	seq_id;
58938 	/* The length of the response data in number of bytes. */
58939 	uint16_t	resp_len;
58940 	/*
58941 	 * This value identifies the filter that matched
58942 	 * the last WoL packet.
58943 	 * This id is only valid with valid WoL reason.
58944 	 */
58945 	uint8_t	wol_filter_id;
58946 	/*
58947 	 * This value identifies the type of WoL reason returned
58948 	 * in this response.
58949 	 * When the wol_type is set to invalid, then there is
58950 	 * no WoL event that happened during last system
58951 	 * wake-up.
58952 	 */
58953 	uint8_t	wol_reason;
58954 	/* Magic Packet */
58955 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_MAGICPKT UINT32_C(0x0)
58956 	/* Bitmap */
58957 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_BMP	UINT32_C(0x1)
58958 	/* Invalid */
58959 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID  UINT32_C(0xff)
58960 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_LAST	HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID
58961 	/* The value identifies the length of the WoL packet in bytes. */
58962 	uint8_t	wol_pkt_len;
58963 	uint8_t	unused_0[4];
58964 	/*
58965 	 * This field is used in Output records to indicate that the output
58966 	 * is completely written to RAM.  This field should be read as '1'
58967 	 * to indicate that the output has been completely written.
58968 	 * When writing a command completion or response to an internal processor,
58969 	 * the order of writes has to be such that this field is written last.
58970 	 */
58971 	uint8_t	valid;
58972 } hwrm_wol_reason_qcfg_output_t, *phwrm_wol_reason_qcfg_output_t;
58973 
58974 /************************
58975  * hwrm_dbg_read_direct *
58976  ************************/
58977 
58978 
58979 /* hwrm_dbg_read_direct_input (size:256b/32B) */
58980 
58981 typedef struct hwrm_dbg_read_direct_input {
58982 	/* The HWRM command request type. */
58983 	uint16_t	req_type;
58984 	/*
58985 	 * The completion ring to send the completion event on. This should
58986 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58987 	 */
58988 	uint16_t	cmpl_ring;
58989 	/*
58990 	 * The sequence ID is used by the driver for tracking multiple
58991 	 * commands. This ID is treated as opaque data by the firmware and
58992 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58993 	 */
58994 	uint16_t	seq_id;
58995 	/*
58996 	 * The target ID of the command:
58997 	 * * 0x0-0xFFF8 - The function ID
58998 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58999 	 * * 0xFFFD - Reserved for user-space HWRM interface
59000 	 * * 0xFFFF - HWRM
59001 	 */
59002 	uint16_t	target_id;
59003 	/*
59004 	 * A physical address pointer pointing to a host buffer that the
59005 	 * command's response data will be written. This can be either a host
59006 	 * physical address (HPA) or a guest physical address (GPA) and must
59007 	 * point to a physically contiguous block of memory.
59008 	 */
59009 	uint64_t	resp_addr;
59010 	/*
59011 	 * host address where the data content will be written
59012 	 * when the request is complete.  This area must be 16B aligned.
59013 	 */
59014 	uint64_t	host_dest_addr;
59015 	/* address(in ChiMP view) to start reading */
59016 	uint32_t	read_addr;
59017 	/* number of dwords to read */
59018 	uint32_t	read_len32;
59019 } hwrm_dbg_read_direct_input_t, *phwrm_dbg_read_direct_input_t;
59020 
59021 /* hwrm_dbg_read_direct_output (size:128b/16B) */
59022 
59023 typedef struct hwrm_dbg_read_direct_output {
59024 	/* The specific error status for the command. */
59025 	uint16_t	error_code;
59026 	/* The HWRM command request type. */
59027 	uint16_t	req_type;
59028 	/* The sequence ID from the original command. */
59029 	uint16_t	seq_id;
59030 	/* The length of the response data in number of bytes. */
59031 	uint16_t	resp_len;
59032 	/*
59033 	 * This field, if not zero, contains the IEEE 802.3 CRC-32 checksum of
59034 	 * the number of dwords read in this request using this polynomial:
59035 	 * 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
59036 	 */
59037 	uint32_t	crc32;
59038 	uint8_t	unused_0[3];
59039 	/*
59040 	 * This field is used in Output records to indicate that the output
59041 	 * is completely written to RAM.  This field should be read as '1'
59042 	 * to indicate that the output has been completely written.
59043 	 * When writing a command completion or response to an internal processor,
59044 	 * the order of writes has to be such that this field is written last.
59045 	 */
59046 	uint8_t	valid;
59047 } hwrm_dbg_read_direct_output_t, *phwrm_dbg_read_direct_output_t;
59048 
59049 /*************************
59050  * hwrm_dbg_write_direct *
59051  *************************/
59052 
59053 
59054 /* hwrm_dbg_write_direct_input (size:448b/56B) */
59055 
59056 typedef struct hwrm_dbg_write_direct_input {
59057 	/* The HWRM command request type. */
59058 	uint16_t	req_type;
59059 	/*
59060 	 * The completion ring to send the completion event on. This should
59061 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59062 	 */
59063 	uint16_t	cmpl_ring;
59064 	/*
59065 	 * The sequence ID is used by the driver for tracking multiple
59066 	 * commands. This ID is treated as opaque data by the firmware and
59067 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59068 	 */
59069 	uint16_t	seq_id;
59070 	/*
59071 	 * The target ID of the command:
59072 	 * * 0x0-0xFFF8 - The function ID
59073 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59074 	 * * 0xFFFD - Reserved for user-space HWRM interface
59075 	 * * 0xFFFF - HWRM
59076 	 */
59077 	uint16_t	target_id;
59078 	/*
59079 	 * A physical address pointer pointing to a host buffer that the
59080 	 * command's response data will be written. This can be either a host
59081 	 * physical address (HPA) or a guest physical address (GPA) and must
59082 	 * point to a physically contiguous block of memory.
59083 	 */
59084 	uint64_t	resp_addr;
59085 	/* address(in ChiMP view) to start writing */
59086 	uint32_t	write_addr;
59087 	/* number of dwords to write (up to 8 dwords) */
59088 	uint32_t	write_len32;
59089 	/* write data (up to 8 dwords) */
59090 	uint32_t	write_data[8];
59091 } hwrm_dbg_write_direct_input_t, *phwrm_dbg_write_direct_input_t;
59092 
59093 /* hwrm_dbg_write_direct_output (size:128b/16B) */
59094 
59095 typedef struct hwrm_dbg_write_direct_output {
59096 	/* The specific error status for the command. */
59097 	uint16_t	error_code;
59098 	/* The HWRM command request type. */
59099 	uint16_t	req_type;
59100 	/* The sequence ID from the original command. */
59101 	uint16_t	seq_id;
59102 	/* The length of the response data in number of bytes. */
59103 	uint16_t	resp_len;
59104 	uint8_t	unused_0[7];
59105 	/*
59106 	 * This field is used in Output records to indicate that the output
59107 	 * is completely written to RAM.  This field should be read as '1'
59108 	 * to indicate that the output has been completely written.
59109 	 * When writing a command completion or response to an internal processor,
59110 	 * the order of writes has to be such that this field is written last.
59111 	 */
59112 	uint8_t	valid;
59113 } hwrm_dbg_write_direct_output_t, *phwrm_dbg_write_direct_output_t;
59114 
59115 /**************************
59116  * hwrm_dbg_read_indirect *
59117  **************************/
59118 
59119 
59120 /* hwrm_dbg_read_indirect_input (size:640b/80B) */
59121 
59122 typedef struct hwrm_dbg_read_indirect_input {
59123 	/* The HWRM command request type. */
59124 	uint16_t	req_type;
59125 	/*
59126 	 * The completion ring to send the completion event on. This should
59127 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59128 	 */
59129 	uint16_t	cmpl_ring;
59130 	/*
59131 	 * The sequence ID is used by the driver for tracking multiple
59132 	 * commands. This ID is treated as opaque data by the firmware and
59133 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59134 	 */
59135 	uint16_t	seq_id;
59136 	/*
59137 	 * The target ID of the command:
59138 	 * * 0x0-0xFFF8 - The function ID
59139 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59140 	 * * 0xFFFD - Reserved for user-space HWRM interface
59141 	 * * 0xFFFF - HWRM
59142 	 */
59143 	uint16_t	target_id;
59144 	/*
59145 	 * A physical address pointer pointing to a host buffer that the
59146 	 * command's response data will be written. This can be either a host
59147 	 * physical address (HPA) or a guest physical address (GPA) and must
59148 	 * point to a physically contiguous block of memory.
59149 	 */
59150 	uint64_t	resp_addr;
59151 	/*
59152 	 * host address where the data content will be written
59153 	 * when the request is complete.  This area must be 16B aligned.
59154 	 */
59155 	uint64_t	host_dest_addr;
59156 	/* Length of host buffer used for transferring debug data. */
59157 	uint32_t	host_dest_addr_len;
59158 	/* Indirect access type to on-chip data structures. */
59159 	uint8_t	indirect_access_type;
59160 	/* L2 Mgmt filters in Transmit Engine (TE) */
59161 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L2	UINT32_C(0x0)
59162 	/* L3/L4 Mgmt filters in Transmit Engine (TE) */
59163 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L3L4	UINT32_C(0x1)
59164 	/* L2 Mgmt filters in Receive Engine (RE) */
59165 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L2	UINT32_C(0x2)
59166 	/* L3/L4 Mgmt filters in Receive Engine (RE) */
59167 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L3L4	UINT32_C(0x3)
59168 	/* Statistics contexts */
59169 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STAT_CTXS		UINT32_C(0x4)
59170 	/* TX L2 TCAM */
59171 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_L2_TCAM		UINT32_C(0x5)
59172 	/* RX L2 TCAM */
59173 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_L2_TCAM		UINT32_C(0x6)
59174 	/* TX IPv6 subnet TCAM */
59175 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_IPV6_SUBNET_TCAM	UINT32_C(0x7)
59176 	/* RX IPv6 subnet TCAM */
59177 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_IPV6_SUBNET_TCAM	UINT32_C(0x8)
59178 	/* TX source properties TCAM */
59179 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_SRC_PROPERTIES_TCAM UINT32_C(0x9)
59180 	/* RX source properties TCAM */
59181 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_SRC_PROPERTIES_TCAM UINT32_C(0xa)
59182 	/* VEB Lookup TCAM */
59183 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_VEB_LOOKUP_TCAM	UINT32_C(0xb)
59184 	/* TX Profile Lookup TCAM */
59185 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_PROFILE_LOOKUP_TCAM UINT32_C(0xc)
59186 	/* RX Profile Lookup TCAM */
59187 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_PROFILE_LOOKUP_TCAM UINT32_C(0xd)
59188 	/* TX Lookup TCAM */
59189 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_LOOKUP_TCAM	UINT32_C(0xe)
59190 	/* RX Lookup TCAM */
59191 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_LOOKUP_TCAM	UINT32_C(0xf)
59192 	/* MHB registers (valid for multi-host environment) */
59193 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MHB			UINT32_C(0x10)
59194 	/* PCIE global registers (valid for multi-host environment) */
59195 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_GBL		UINT32_C(0x11)
59196 	/* SOC registers (valid for multi-host environment) */
59197 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MULTI_HOST_SOC		UINT32_C(0x12)
59198 	/* PCIE private registers */
59199 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_PRIVATE		UINT32_C(0x13)
59200 	/* Host DMA read */
59201 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_HOST_DMA		UINT32_C(0x14)
59202 	/*
59203 	 * Elog (valid for only smartNIC only)
59204 	 * Three sub-types will be supported which will be specified
59205 	 * in the opaque[0] field.
59206 	 * 1) sub-type CHECK(0) if ELOG is available in media.
59207 	 * 2) sub-type READ(1) a portion of the elog.
59208 	 * 3) sub-type ERASE(2) a portion of the elog.
59209 	 *	> opaque[1] Erase offset.
59210 	 *	> opaque[2] Erase size.
59211 	 */
59212 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_SOC_ELOG		UINT32_C(0x15)
59213 	/* Context operation */
59214 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CTX			UINT32_C(0x16)
59215 	/* Port Stats */
59216 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS			UINT32_C(0x17)
59217 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_LAST			HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS
59218 	uint8_t	unused_0[3];
59219 	/* Entry number to start reading */
59220 	uint32_t	start_index;
59221 	/* Total number of entries to read */
59222 	uint32_t	num_of_entries;
59223 	/*
59224 	 * command dependent data (e.g. function id for host dma command or
59225 	 * sub-code, erase offset and erase size for soc_elog)
59226 	 */
59227 	uint32_t	opaque[10];
59228 } hwrm_dbg_read_indirect_input_t, *phwrm_dbg_read_indirect_input_t;
59229 
59230 /* hwrm_dbg_read_indirect_output (size:128b/16B) */
59231 
59232 typedef struct hwrm_dbg_read_indirect_output {
59233 	/* The specific error status for the command. */
59234 	uint16_t	error_code;
59235 	/* The HWRM command request type. */
59236 	uint16_t	req_type;
59237 	/* The sequence ID from the original command. */
59238 	uint16_t	seq_id;
59239 	/* The length of the response data in number of bytes. */
59240 	uint16_t	resp_len;
59241 	uint8_t	unused_0[7];
59242 	/*
59243 	 * This field is used in Output records to indicate that the output
59244 	 * is completely written to RAM.  This field should be read as '1'
59245 	 * to indicate that the output has been completely written.
59246 	 * When writing a command completion or response to an internal processor,
59247 	 * the order of writes has to be such that this field is written last.
59248 	 */
59249 	uint8_t	valid;
59250 } hwrm_dbg_read_indirect_output_t, *phwrm_dbg_read_indirect_output_t;
59251 
59252 /***************************
59253  * hwrm_dbg_write_indirect *
59254  ***************************/
59255 
59256 
59257 /* hwrm_dbg_write_indirect_input (size:832b/104B) */
59258 
59259 typedef struct hwrm_dbg_write_indirect_input {
59260 	/* The HWRM command request type. */
59261 	uint16_t	req_type;
59262 	/*
59263 	 * The completion ring to send the completion event on. This should
59264 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59265 	 */
59266 	uint16_t	cmpl_ring;
59267 	/*
59268 	 * The sequence ID is used by the driver for tracking multiple
59269 	 * commands. This ID is treated as opaque data by the firmware and
59270 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59271 	 */
59272 	uint16_t	seq_id;
59273 	/*
59274 	 * The target ID of the command:
59275 	 * * 0x0-0xFFF8 - The function ID
59276 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59277 	 * * 0xFFFD - Reserved for user-space HWRM interface
59278 	 * * 0xFFFF - HWRM
59279 	 */
59280 	uint16_t	target_id;
59281 	/*
59282 	 * A physical address pointer pointing to a host buffer that the
59283 	 * command's response data will be written. This can be either a host
59284 	 * physical address (HPA) or a guest physical address (GPA) and must
59285 	 * point to a physically contiguous block of memory.
59286 	 */
59287 	uint64_t	resp_addr;
59288 	/* Indirect access type to on-chip data structures. */
59289 	uint8_t	indirect_access_type;
59290 	/* L2 Mgmt filters in Transmit Engine (TE) */
59291 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L2	UINT32_C(0x0)
59292 	/* L3/L4 Mgmt filters in Transmit Engine (TE) */
59293 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L3L4	UINT32_C(0x1)
59294 	/* L2 Mgmt filters in Receive Engine (RE) */
59295 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L2	UINT32_C(0x2)
59296 	/* L3/L4 Mgmt filters in Receive Engine (RE) */
59297 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L3L4	UINT32_C(0x3)
59298 	/* Statistics contexts */
59299 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STAT_CTXS		UINT32_C(0x4)
59300 	/* TX L2 TCAM */
59301 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_L2_TCAM		UINT32_C(0x5)
59302 	/* RX L2 TCAM */
59303 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_L2_TCAM		UINT32_C(0x6)
59304 	/* TX IPv6 subnet TCAM */
59305 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_IPV6_SUBNET_TCAM	UINT32_C(0x7)
59306 	/* RX IPv6 subnet TCAM */
59307 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_IPV6_SUBNET_TCAM	UINT32_C(0x8)
59308 	/* TX source properties TCAM */
59309 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_SRC_PROPERTIES_TCAM UINT32_C(0x9)
59310 	/* RX source properties TCAM */
59311 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_SRC_PROPERTIES_TCAM UINT32_C(0xa)
59312 	/* VEB Lookup TCAM */
59313 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_VEB_LOOKUP_TCAM	UINT32_C(0xb)
59314 	/* TX Profile Lookup TCAM */
59315 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_PROFILE_LOOKUP_TCAM UINT32_C(0xc)
59316 	/* RX Profile Lookup TCAM */
59317 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_PROFILE_LOOKUP_TCAM UINT32_C(0xd)
59318 	/* TX Lookup TCAM */
59319 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_LOOKUP_TCAM	UINT32_C(0xe)
59320 	/* RX Lookup TCAM */
59321 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_LOOKUP_TCAM	UINT32_C(0xf)
59322 	/* MHB registers (valid for multi-host environment) */
59323 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MHB			UINT32_C(0x10)
59324 	/* PCIE global registers (valid for multi-host environment) */
59325 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_GBL		UINT32_C(0x11)
59326 	/* SOC registers (valid for multi-host environment) */
59327 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MULTI_HOST_SOC		UINT32_C(0x12)
59328 	/* PCIE private registers */
59329 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_PRIVATE		UINT32_C(0x13)
59330 	/* Host DMA write */
59331 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_HOST_DMA		UINT32_C(0x14)
59332 	/* Invalid */
59333 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_SOC_ELOG		UINT32_C(0x15)
59334 	/* Context operation */
59335 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CTX			UINT32_C(0x16)
59336 	/* Port Stats */
59337 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS			UINT32_C(0x17)
59338 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_LAST			HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS
59339 	uint8_t	unused_0[3];
59340 	/* Entry number to start reading */
59341 	uint32_t	start_index;
59342 	/* Total number of entries to read */
59343 	uint32_t	num_of_entries;
59344 	uint8_t	unused_1[4];
59345 	/* write data (up to 8 dwords) */
59346 	uint32_t	write_data[8];
59347 	/* command dependent data (e.g. function id for host dma command) */
59348 	uint32_t	opaque[10];
59349 } hwrm_dbg_write_indirect_input_t, *phwrm_dbg_write_indirect_input_t;
59350 
59351 /* hwrm_dbg_write_indirect_output (size:128b/16B) */
59352 
59353 typedef struct hwrm_dbg_write_indirect_output {
59354 	/* The specific error status for the command. */
59355 	uint16_t	error_code;
59356 	/* The HWRM command request type. */
59357 	uint16_t	req_type;
59358 	/* The sequence ID from the original command. */
59359 	uint16_t	seq_id;
59360 	/* The length of the response data in number of bytes. */
59361 	uint16_t	resp_len;
59362 	uint8_t	unused_0[7];
59363 	/*
59364 	 * This field is used in Output records to indicate that the output
59365 	 * is completely written to RAM.  This field should be read as '1'
59366 	 * to indicate that the output has been completely written.
59367 	 * When writing a command completion or response to an internal processor,
59368 	 * the order of writes has to be such that this field is written last.
59369 	 */
59370 	uint8_t	valid;
59371 } hwrm_dbg_write_indirect_output_t, *phwrm_dbg_write_indirect_output_t;
59372 
59373 /*****************
59374  * hwrm_dbg_dump *
59375  *****************/
59376 
59377 
59378 /* hwrm_dbg_dump_input (size:320b/40B) */
59379 
59380 typedef struct hwrm_dbg_dump_input {
59381 	/* The HWRM command request type. */
59382 	uint16_t	req_type;
59383 	/*
59384 	 * The completion ring to send the completion event on. This should
59385 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59386 	 */
59387 	uint16_t	cmpl_ring;
59388 	/*
59389 	 * The sequence ID is used by the driver for tracking multiple
59390 	 * commands. This ID is treated as opaque data by the firmware and
59391 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59392 	 */
59393 	uint16_t	seq_id;
59394 	/*
59395 	 * The target ID of the command:
59396 	 * * 0x0-0xFFF8 - The function ID
59397 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59398 	 * * 0xFFFD - Reserved for user-space HWRM interface
59399 	 * * 0xFFFF - HWRM
59400 	 */
59401 	uint16_t	target_id;
59402 	/*
59403 	 * A physical address pointer pointing to a host buffer that the
59404 	 * command's response data will be written. This can be either a host
59405 	 * physical address (HPA) or a guest physical address (GPA) and must
59406 	 * point to a physically contiguous block of memory.
59407 	 */
59408 	uint64_t	resp_addr;
59409 	/*
59410 	 * Handle used to dump debug data.
59411 	 * handle = 0 indicates the beginning of the dump.
59412 	 * handle != 0 indicates the request to dump the next part.
59413 	 */
59414 	uint32_t	handle;
59415 	uint8_t	unused_0[4];
59416 	/*
59417 	 * Address of the host buffer where the debug data is
59418 	 * requested to be dumped.
59419 	 */
59420 	uint64_t	host_dbg_dump_addr;
59421 	/* Length of host buffer used for transferring debug data. */
59422 	uint64_t	host_dbg_dump_addr_len;
59423 } hwrm_dbg_dump_input_t, *phwrm_dbg_dump_input_t;
59424 
59425 /* hwrm_dbg_dump_output (size:192b/24B) */
59426 
59427 typedef struct hwrm_dbg_dump_output {
59428 	/* The specific error status for the command. */
59429 	uint16_t	error_code;
59430 	/* The HWRM command request type. */
59431 	uint16_t	req_type;
59432 	/* The sequence ID from the original command. */
59433 	uint16_t	seq_id;
59434 	/* The length of the response data in number of bytes. */
59435 	uint16_t	resp_len;
59436 	/*
59437 	 * Handle used to indicate availability of additional
59438 	 * debug data.
59439 	 * nexthandle = 0 indicates that there is no more debug data
59440 	 * available.
59441 	 * nexthandle != 0 indicates the handle value that should be used
59442 	 * to request the next part of debug data.
59443 	 */
59444 	uint32_t	nexthandle;
59445 	/*
59446 	 * The number of bytes of debug data written to debug dump
59447 	 * buffer.
59448 	 */
59449 	uint32_t	dbg_data_len;
59450 	uint8_t	unused_0[7];
59451 	/*
59452 	 * This field is used in Output records to indicate that the output
59453 	 * is completely written to RAM.  This field should be read as '1'
59454 	 * to indicate that the output has been completely written.
59455 	 * When writing a command completion or response to an internal processor,
59456 	 * the order of writes has to be such that this field is written last.
59457 	 */
59458 	uint8_t	valid;
59459 } hwrm_dbg_dump_output_t, *phwrm_dbg_dump_output_t;
59460 
59461 /**********************
59462  * hwrm_dbg_erase_nvm *
59463  **********************/
59464 
59465 
59466 /* hwrm_dbg_erase_nvm_input (size:192b/24B) */
59467 
59468 typedef struct hwrm_dbg_erase_nvm_input {
59469 	/* The HWRM command request type. */
59470 	uint16_t	req_type;
59471 	/*
59472 	 * The completion ring to send the completion event on. This should
59473 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59474 	 */
59475 	uint16_t	cmpl_ring;
59476 	/*
59477 	 * The sequence ID is used by the driver for tracking multiple
59478 	 * commands. This ID is treated as opaque data by the firmware and
59479 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59480 	 */
59481 	uint16_t	seq_id;
59482 	/*
59483 	 * The target ID of the command:
59484 	 * * 0x0-0xFFF8 - The function ID
59485 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59486 	 * * 0xFFFD - Reserved for user-space HWRM interface
59487 	 * * 0xFFFF - HWRM
59488 	 */
59489 	uint16_t	target_id;
59490 	/*
59491 	 * A physical address pointer pointing to a host buffer that the
59492 	 * command's response data will be written. This can be either a host
59493 	 * physical address (HPA) or a guest physical address (GPA) and must
59494 	 * point to a physically contiguous block of memory.
59495 	 */
59496 	uint64_t	resp_addr;
59497 	uint16_t	flags;
59498 	/* If set to 1, then erase all locations in persistent storage. */
59499 	#define HWRM_DBG_ERASE_NVM_INPUT_FLAGS_ERASE_ALL	UINT32_C(0x1)
59500 	uint8_t	unused_0[6];
59501 } hwrm_dbg_erase_nvm_input_t, *phwrm_dbg_erase_nvm_input_t;
59502 
59503 /* hwrm_dbg_erase_nvm_output (size:128b/16B) */
59504 
59505 typedef struct hwrm_dbg_erase_nvm_output {
59506 	/* The specific error status for the command. */
59507 	uint16_t	error_code;
59508 	/* The HWRM command request type. */
59509 	uint16_t	req_type;
59510 	/* The sequence ID from the original command. */
59511 	uint16_t	seq_id;
59512 	/* The length of the response data in number of bytes. */
59513 	uint16_t	resp_len;
59514 	uint8_t	unused_0[7];
59515 	/*
59516 	 * This field is used in Output records to indicate that the output
59517 	 * is completely written to RAM.  This field should be read as '1'
59518 	 * to indicate that the output has been completely written.
59519 	 * When writing a command completion or response to an internal processor,
59520 	 * the order of writes has to be such that this field is written last.
59521 	 */
59522 	uint8_t	valid;
59523 } hwrm_dbg_erase_nvm_output_t, *phwrm_dbg_erase_nvm_output_t;
59524 
59525 /****************
59526  * hwrm_dbg_cfg *
59527  ****************/
59528 
59529 
59530 /* hwrm_dbg_cfg_input (size:192b/24B) */
59531 
59532 typedef struct hwrm_dbg_cfg_input {
59533 	/* The HWRM command request type. */
59534 	uint16_t	req_type;
59535 	/*
59536 	 * The completion ring to send the completion event on. This should
59537 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59538 	 */
59539 	uint16_t	cmpl_ring;
59540 	/*
59541 	 * The sequence ID is used by the driver for tracking multiple
59542 	 * commands. This ID is treated as opaque data by the firmware and
59543 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59544 	 */
59545 	uint16_t	seq_id;
59546 	/*
59547 	 * The target ID of the command:
59548 	 * * 0x0-0xFFF8 - The function ID
59549 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59550 	 * * 0xFFFD - Reserved for user-space HWRM interface
59551 	 * * 0xFFFF - HWRM
59552 	 */
59553 	uint16_t	target_id;
59554 	/*
59555 	 * A physical address pointer pointing to a host buffer that the
59556 	 * command's response data will be written. This can be either a host
59557 	 * physical address (HPA) or a guest physical address (GPA) and must
59558 	 * point to a physically contiguous block of memory.
59559 	 */
59560 	uint64_t	resp_addr;
59561 	uint32_t	flags;
59562 	/*
59563 	 * If set to 1, then UART logging will be enabled for the primary
59564 	 * firmware. Disabled otherwise.
59565 	 */
59566 	#define HWRM_DBG_CFG_INPUT_FLAGS_UART_LOG		UINT32_C(0x1)
59567 	/*
59568 	 * If set to 1, then UART logging will be enabled for the secondary
59569 	 * firmware. Disabled otherwise. If a single UART is available then
59570 	 * setting this bit will override the uart_log bit.
59571 	 */
59572 	#define HWRM_DBG_CFG_INPUT_FLAGS_UART_LOG_SECONDARY	UINT32_C(0x2)
59573 	/*
59574 	 * If set to 1, then completion ring logging will be enabled for the
59575 	 * primary firmware. Disabled otherwise.
59576 	 */
59577 	#define HWRM_DBG_CFG_INPUT_FLAGS_FW_TRACE		UINT32_C(0x4)
59578 	/*
59579 	 * If set to 1, then completion ring logging will be enabled for the
59580 	 * secondary firmware. Disabled otherwise.
59581 	 */
59582 	#define HWRM_DBG_CFG_INPUT_FLAGS_FW_TRACE_SECONDARY	UINT32_C(0x8)
59583 	/*
59584 	 * If set to 1, firmware will generate debug_notification async
59585 	 * events to the driver as applicable.
59586 	 */
59587 	#define HWRM_DBG_CFG_INPUT_FLAGS_DEBUG_NOTIFY	UINT32_C(0x10)
59588 	/*
59589 	 * If set to 1, firmware is allowed to be unresponsive to heartbeat
59590 	 * health checks, allowing for JTAG debugging scenarios where the
59591 	 * debugger has the firmware processes stopped indefinitely.  This
59592 	 * flag has effect only on debug builds of firmware.
59593 	 */
59594 	#define HWRM_DBG_CFG_INPUT_FLAGS_JTAG_DEBUG		UINT32_C(0x20)
59595 	/*
59596 	 * Notification queue (completion ring) used by the firmware to post
59597 	 * async debug notifications and fw trace logs. This field is valid
59598 	 * when fw_trace, fw_trace_secondary or debug_notify flags are set.
59599 	 */
59600 	uint16_t	async_cmpl_ring;
59601 	uint8_t	unused_0[2];
59602 } hwrm_dbg_cfg_input_t, *phwrm_dbg_cfg_input_t;
59603 
59604 /* hwrm_dbg_cfg_output (size:128b/16B) */
59605 
59606 typedef struct hwrm_dbg_cfg_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 	uint8_t	unused_0[7];
59616 	/*
59617 	 * This field is used in Output records to indicate that the output
59618 	 * is completely written to RAM.  This field should be read as '1'
59619 	 * to indicate that the output has been completely written.
59620 	 * When writing a command completion or response to an internal processor,
59621 	 * the order of writes has to be such that this field is written last.
59622 	 */
59623 	uint8_t	valid;
59624 } hwrm_dbg_cfg_output_t, *phwrm_dbg_cfg_output_t;
59625 
59626 /*****************************
59627  * hwrm_dbg_crashdump_header *
59628  *****************************/
59629 
59630 
59631 /* hwrm_dbg_crashdump_header_input (size:192b/24B) */
59632 
59633 typedef struct hwrm_dbg_crashdump_header_input {
59634 	/* The HWRM command request type. */
59635 	uint16_t	req_type;
59636 	/*
59637 	 * The completion ring to send the completion event on. This should
59638 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59639 	 */
59640 	uint16_t	cmpl_ring;
59641 	/*
59642 	 * The sequence ID is used by the driver for tracking multiple
59643 	 * commands. This ID is treated as opaque data by the firmware and
59644 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59645 	 */
59646 	uint16_t	seq_id;
59647 	/*
59648 	 * The target ID of the command:
59649 	 * * 0x0-0xFFF8 - The function ID
59650 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59651 	 * * 0xFFFD - Reserved for user-space HWRM interface
59652 	 * * 0xFFFF - HWRM
59653 	 */
59654 	uint16_t	target_id;
59655 	/*
59656 	 * A physical address pointer pointing to a host buffer that the
59657 	 * command's response data will be written. This can be either a host
59658 	 * physical address (HPA) or a guest physical address (GPA) and must
59659 	 * point to a physically contiguous block of memory.
59660 	 */
59661 	uint64_t	resp_addr;
59662 	uint64_t	unused_0;
59663 } hwrm_dbg_crashdump_header_input_t, *phwrm_dbg_crashdump_header_input_t;
59664 
59665 /* hwrm_dbg_crashdump_header_output (size:512b/64B) */
59666 
59667 typedef struct hwrm_dbg_crashdump_header_output {
59668 	/* The specific error status for the command. */
59669 	uint16_t	error_code;
59670 	/* The HWRM command request type. */
59671 	uint16_t	req_type;
59672 	/* The sequence ID from the original command. */
59673 	uint16_t	seq_id;
59674 	/* The length of the response data in number of bytes. */
59675 	uint16_t	resp_len;
59676 	/* Major version. */
59677 	uint8_t	version_hi;
59678 	/* Minor version. */
59679 	uint8_t	version_low;
59680 	/*
59681 	 * Header length in bytes. This includes all fields from version
59682 	 * to dev_uid (whose length is specified in dev_uid_length).
59683 	 */
59684 	uint16_t	header_len;
59685 	/* This is the crash dump size in bytes. */
59686 	uint32_t	dump_size;
59687 	/*
59688 	 * This is a "wall clock" timestamp value of when the crash occurred.
59689 	 * Format is of time_t type.
59690 	 */
59691 	uint32_t	crash_time;
59692 	/* This is the timezone information for the crash_time. */
59693 	int8_t	utc_offset;
59694 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_UTC				0
59695 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMSTERDAM			4
59696 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EGYPT			8
59697 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EUROPE_MOSCOW		12
59698 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_IRAN			14
59699 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_DUBAI			16
59700 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KABUL			18
59701 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MAWSON		20
59702 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_COLOMBO		22
59703 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KATHMANDU		23
59704 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_CHAGOS		24
59705 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_COCOS		26
59706 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_BANGKOK		28
59707 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_HONG_KONG		32
59708 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_PYONGYANG		34
59709 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_EUCLA		35
59710 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_TOKYO			36
59711 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_ADELAIDE		38
59712 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_BROKEN_HILL	38
59713 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_DARWIN		38
59714 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_SYDNEY		40
59715 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_LORD_HOWE		42
59716 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MACQUARIE	44
59717 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_SOUTH_POLE	48
59718 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_CHATHAM		51
59719 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_APIA		52
59720 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_KIRITIMATIS		56
59721 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_CAPE_VERDE		-4
59722 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_SOUTH_GEORGIA	-8
59723 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_ARGENTINA_BUENOS_AIRES -12
59724 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_SAO_PAULO		-12
59725 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_NEWFOUNDLAND	-14
59726 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_BARBADOS		-16
59727 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_CANCUN		-20
59728 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_COSTA_RICA		-24
59729 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_PHOENIX		-28
59730 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ARIZONA			-28
59731 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_PACIFIC			-32
59732 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ALASKA			-36
59733 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MARQUESAS		-38
59734 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_HAWAII		-40
59735 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY		-44
59736 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_LAST			HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY
59737 	/*
59738 	 * This field is a counter value of the crash dump available. This
59739 	 * value is incremented monotonically at each crash.
59740 	 */
59741 	uint8_t	crash_cntr;
59742 	/*
59743 	 * This specifies the length of the dev_uid in bytes. The maximum
59744 	 * value is 31.
59745 	 */
59746 	uint16_t	dev_uid_length;
59747 	/*
59748 	 * This is a unique device identifier (e.g. the first port MAC
59749 	 * address for a network controller or a serial number for an
59750 	 * en/decryption device) in ASCII format. It is used to identify
59751 	 * where the crash dump content is coming from. Unused bytes must
59752 	 * have '\0' character.
59753 	 */
59754 	uint8_t	dev_uid[32];
59755 	/*
59756 	 * This is a count value tracking the number of successful boots
59757 	 * before the crash occurred.
59758 	 */
59759 	uint32_t	power_on_count;
59760 	uint8_t	unused_2[3];
59761 	/*
59762 	 * This field is used in Output records to indicate that the output
59763 	 * is completely written to RAM.  This field should be read as '1'
59764 	 * to indicate that the output has been completely written.
59765 	 * When writing a command completion or response to an internal processor,
59766 	 * the order of writes has to be such that this field is written last.
59767 	 */
59768 	uint8_t	valid;
59769 } hwrm_dbg_crashdump_header_output_t, *phwrm_dbg_crashdump_header_output_t;
59770 
59771 /****************************
59772  * hwrm_dbg_crashdump_erase *
59773  ****************************/
59774 
59775 
59776 /* hwrm_dbg_crashdump_erase_input (size:192b/24B) */
59777 
59778 typedef struct hwrm_dbg_crashdump_erase_input {
59779 	/* The HWRM command request type. */
59780 	uint16_t	req_type;
59781 	/*
59782 	 * The completion ring to send the completion event on. This should
59783 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59784 	 */
59785 	uint16_t	cmpl_ring;
59786 	/*
59787 	 * The sequence ID is used by the driver for tracking multiple
59788 	 * commands. This ID is treated as opaque data by the firmware and
59789 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59790 	 */
59791 	uint16_t	seq_id;
59792 	/*
59793 	 * The target ID of the command:
59794 	 * * 0x0-0xFFF8 - The function ID
59795 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59796 	 * * 0xFFFD - Reserved for user-space HWRM interface
59797 	 * * 0xFFFF - HWRM
59798 	 */
59799 	uint16_t	target_id;
59800 	/*
59801 	 * A physical address pointer pointing to a host buffer that the
59802 	 * command's response data will be written. This can be either a host
59803 	 * physical address (HPA) or a guest physical address (GPA) and must
59804 	 * point to a physically contiguous block of memory.
59805 	 */
59806 	uint64_t	resp_addr;
59807 	/* The scope of the erase */
59808 	uint8_t	scope;
59809 	/*
59810 	 * Wipe all crashdump data blocks, making them available for
59811 	 * the next crash(es). This is the typical value to be used.
59812 	 */
59813 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_INVALIDATE UINT32_C(0x0)
59814 	/*
59815 	 * Experimental: Remove all data blocks from the directory
59816 	 * (without erasing any existing contents), re-allocate and
59817 	 * re-initialize new ones. In case where the crash dump feature
59818 	 * stops functioning, this can be used to restore it back to the
59819 	 * clean slate.
59820 	 */
59821 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT	UINT32_C(0x1)
59822 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_LAST	HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT
59823 	uint8_t	unused_0[3];
59824 	uint32_t	unused_1;
59825 } hwrm_dbg_crashdump_erase_input_t, *phwrm_dbg_crashdump_erase_input_t;
59826 
59827 /* hwrm_dbg_crashdump_erase_output (size:128b/16B) */
59828 
59829 typedef struct hwrm_dbg_crashdump_erase_output {
59830 	/* The specific error status for the command. */
59831 	uint16_t	error_code;
59832 	/* The HWRM command request type. */
59833 	uint16_t	req_type;
59834 	/* The sequence ID from the original command. */
59835 	uint16_t	seq_id;
59836 	/* The length of the response data in number of bytes. */
59837 	uint16_t	resp_len;
59838 	uint8_t	unused_1[7];
59839 	/*
59840 	 * This field is used in Output records to indicate that the output
59841 	 * is completely written to RAM.  This field should be read as '1'
59842 	 * to indicate that the output has been completely written.
59843 	 * When writing a command completion or response to an internal processor,
59844 	 * the order of writes has to be such that this field is written last.
59845 	 */
59846 	uint8_t	valid;
59847 } hwrm_dbg_crashdump_erase_output_t, *phwrm_dbg_crashdump_erase_output_t;
59848 
59849 /******************
59850  * hwrm_dbg_qcaps *
59851  ******************/
59852 
59853 
59854 /* hwrm_dbg_qcaps_input (size:192b/24B) */
59855 
59856 typedef struct hwrm_dbg_qcaps_input {
59857 	/* The HWRM command request type. */
59858 	uint16_t	req_type;
59859 	/*
59860 	 * The completion ring to send the completion event on. This should
59861 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59862 	 */
59863 	uint16_t	cmpl_ring;
59864 	/*
59865 	 * The sequence ID is used by the driver for tracking multiple
59866 	 * commands. This ID is treated as opaque data by the firmware and
59867 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59868 	 */
59869 	uint16_t	seq_id;
59870 	/*
59871 	 * The target ID of the command:
59872 	 * * 0x0-0xFFF8 - The function ID
59873 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59874 	 * * 0xFFFD - Reserved for user-space HWRM interface
59875 	 * * 0xFFFF - HWRM
59876 	 */
59877 	uint16_t	target_id;
59878 	/*
59879 	 * A physical address pointer pointing to a host buffer that the
59880 	 * command's response data will be written. This can be either a host
59881 	 * physical address (HPA) or a guest physical address (GPA) and must
59882 	 * point to a physically contiguous block of memory.
59883 	 */
59884 	uint64_t	resp_addr;
59885 	/*
59886 	 * Function ID of the function that is being queried.
59887 	 * 0xFF... (All Fs) if the query is for the requesting
59888 	 * function.
59889 	 */
59890 	uint16_t	fid;
59891 	uint8_t	unused_0[6];
59892 } hwrm_dbg_qcaps_input_t, *phwrm_dbg_qcaps_input_t;
59893 
59894 /* hwrm_dbg_qcaps_output (size:192b/24B) */
59895 
59896 typedef struct hwrm_dbg_qcaps_output {
59897 	/* The specific error status for the command. */
59898 	uint16_t	error_code;
59899 	/* The HWRM command request type. */
59900 	uint16_t	req_type;
59901 	/* The sequence ID from the original command. */
59902 	uint16_t	seq_id;
59903 	/* The length of the response data in number of bytes. */
59904 	uint16_t	resp_len;
59905 	/*
59906 	 * FID value.  This value is used to identify operations on the PCI
59907 	 * bus as belonging to a particular PCI function.
59908 	 */
59909 	uint16_t	fid;
59910 	uint8_t	unused_0[2];
59911 	/*
59912 	 * Bitwise field of components FW supports skipping during collection
59913 	 * of coredump as part of a crash collection.
59914 	 */
59915 	uint32_t	coredump_component_disable_caps;
59916 	/*
59917 	 * If 1, FW supports disabling the collection of NVM during a
59918 	 * coredump taken as part of crash collection.
59919 	 */
59920 	#define HWRM_DBG_QCAPS_OUTPUT_COREDUMP_COMPONENT_DISABLE_CAPS_NVRAM	UINT32_C(0x1)
59921 	uint32_t	flags;
59922 	/* If 1, FW supports writing a crashdump to NVM. */
59923 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_NVM	UINT32_C(0x1)
59924 	/* If 1, FW supports writing a crashdump to host ddr. */
59925 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_HOST_DDR	UINT32_C(0x2)
59926 	/* If 1, FW supports writing a crashdump to soc ddr. */
59927 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_SOC_DDR	UINT32_C(0x4)
59928 	/* If 1, FW supports USEQ operations */
59929 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_USEQ		UINT32_C(0x8)
59930 	uint8_t	unused_1[3];
59931 	/*
59932 	 * This field is used in Output records to indicate that the output
59933 	 * is completely written to RAM.  This field should be read as '1'
59934 	 * to indicate that the output has been completely written.
59935 	 * When writing a command completion or response to an internal processor,
59936 	 * the order of writes has to be such that this field is written last.
59937 	 */
59938 	uint8_t	valid;
59939 } hwrm_dbg_qcaps_output_t, *phwrm_dbg_qcaps_output_t;
59940 
59941 /*****************
59942  * hwrm_dbg_qcfg *
59943  *****************/
59944 
59945 
59946 /* hwrm_dbg_qcfg_input (size:192b/24B) */
59947 
59948 typedef struct hwrm_dbg_qcfg_input {
59949 	/* The HWRM command request type. */
59950 	uint16_t	req_type;
59951 	/*
59952 	 * The completion ring to send the completion event on. This should
59953 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59954 	 */
59955 	uint16_t	cmpl_ring;
59956 	/*
59957 	 * The sequence ID is used by the driver for tracking multiple
59958 	 * commands. This ID is treated as opaque data by the firmware and
59959 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59960 	 */
59961 	uint16_t	seq_id;
59962 	/*
59963 	 * The target ID of the command:
59964 	 * * 0x0-0xFFF8 - The function ID
59965 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59966 	 * * 0xFFFD - Reserved for user-space HWRM interface
59967 	 * * 0xFFFF - HWRM
59968 	 */
59969 	uint16_t	target_id;
59970 	/*
59971 	 * A physical address pointer pointing to a host buffer that the
59972 	 * command's response data will be written. This can be either a host
59973 	 * physical address (HPA) or a guest physical address (GPA) and must
59974 	 * point to a physically contiguous block of memory.
59975 	 */
59976 	uint64_t	resp_addr;
59977 	/*
59978 	 * Function ID of the function that is being queried.
59979 	 * 0xFF... (All Fs) if the query is for the requesting
59980 	 * function.
59981 	 */
59982 	uint16_t	fid;
59983 	uint16_t	flags;
59984 	/*
59985 	 * The crashdump size represents size of crashdump
59986 	 * written to the specified destination.
59987 	 */
59988 	#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_MASK	UINT32_C(0x3)
59989 	#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_SFT	0
59990 	/* crashdump size written to nvm */
59991 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_NVM	UINT32_C(0x0)
59992 	/* crashdump size written to host_ddr */
59993 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_HOST_DDR  UINT32_C(0x1)
59994 	/* crashdump size written to soc_ddr */
59995 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR   UINT32_C(0x2)
59996 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_LAST	HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR
59997 	/*
59998 	 * Bitwise field of components requested for FW to skip when
59999 	 * calculating the size of a coredump collection.
60000 	 */
60001 	uint32_t	coredump_component_disable_flags;
60002 	/*
60003 	 * If 1, NVM will not be collected during a coredump taken as part
60004 	 * of crash collection.
60005 	 */
60006 	#define HWRM_DBG_QCFG_INPUT_COREDUMP_COMPONENT_DISABLE_FLAGS_NVRAM	UINT32_C(0x1)
60007 } hwrm_dbg_qcfg_input_t, *phwrm_dbg_qcfg_input_t;
60008 
60009 /* hwrm_dbg_qcfg_output (size:256b/32B) */
60010 
60011 typedef struct hwrm_dbg_qcfg_output {
60012 	/* The specific error status for the command. */
60013 	uint16_t	error_code;
60014 	/* The HWRM command request type. */
60015 	uint16_t	req_type;
60016 	/* The sequence ID from the original command. */
60017 	uint16_t	seq_id;
60018 	/* The length of the response data in number of bytes. */
60019 	uint16_t	resp_len;
60020 	/*
60021 	 * FID value.  This value is used to identify operations on the PCI
60022 	 * bus as belonging to a particular PCI function.
60023 	 */
60024 	uint16_t	fid;
60025 	uint8_t	unused_0[2];
60026 	/*
60027 	 * Size in bytes of a coredump file created by the FW.  This takes into
60028 	 * consideration any components selected in the
60029 	 * coredump_component_disable_flags field from hwrm_dbg_qcfg_input.
60030 	 */
60031 	uint32_t	coredump_size;
60032 	uint32_t	flags;
60033 	/*
60034 	 * If set to 1, then UART logging is enabled for the primary
60035 	 * firmware. Disabled otherwise.
60036 	 */
60037 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG		UINT32_C(0x1)
60038 	/*
60039 	 * If set to 1, then UART logging is enabled for the secondary
60040 	 * firmware. Disabled otherwise.
60041 	 */
60042 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG_SECONDARY	UINT32_C(0x2)
60043 	/*
60044 	 * If set to 1, then completion ring logging is enabled for the
60045 	 * primary firmware. Disabled otherwise.
60046 	 */
60047 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE		UINT32_C(0x4)
60048 	/*
60049 	 * If set to 1, then completion ring logging  is enabled for the
60050 	 * secondary firmware. Disabled otherwise.
60051 	 */
60052 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE_SECONDARY	UINT32_C(0x8)
60053 	/*
60054 	 * If set to 1, firmware will generate debug_notification async
60055 	 * events to the driver as applicable.
60056 	 */
60057 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_DEBUG_NOTIFY	UINT32_C(0x10)
60058 	/*
60059 	 * If set to 1, firmware is allowed to be unresponsive to heartbeat
60060 	 * health checks, allowing for JTAG debugging scenarios where the
60061 	 * debugger has the firmware processes stopped indefinitely.  This
60062 	 * flag has effect only on debug builds of firmware.
60063 	 */
60064 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_JTAG_DEBUG		UINT32_C(0x20)
60065 	/*
60066 	 * Notification queue (completion ring) used by the firmware to post
60067 	 * async debug notifications and fw trace logs. This field is valid
60068 	 * when fw_trace, fw_trace_secondary or debug_notify flags are set.
60069 	 */
60070 	uint16_t	async_cmpl_ring;
60071 	uint8_t	unused_2[2];
60072 	/*
60073 	 * Size in bytes of a crashdump file created by the FW.  Uses input
60074 	 * flags to determine medium destination and corresponding size.
60075 	 */
60076 	uint32_t	crashdump_size;
60077 	uint8_t	unused_3[3];
60078 	/*
60079 	 * This field is used in Output records to indicate that the output
60080 	 * is completely written to RAM.  This field should be read as '1'
60081 	 * to indicate that the output has been completely written.
60082 	 * When writing a command completion or response to an internal processor,
60083 	 * the order of writes has to be such that this field is written last.
60084 	 */
60085 	uint8_t	valid;
60086 } hwrm_dbg_qcfg_output_t, *phwrm_dbg_qcfg_output_t;
60087 
60088 /*********************************
60089  * hwrm_dbg_crashdump_medium_cfg *
60090  *********************************/
60091 
60092 
60093 /* hwrm_dbg_crashdump_medium_cfg_input (size:320b/40B) */
60094 
60095 typedef struct hwrm_dbg_crashdump_medium_cfg_input {
60096 	/* The HWRM command request type. */
60097 	uint16_t	req_type;
60098 	/*
60099 	 * The completion ring to send the completion event on. This should
60100 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60101 	 */
60102 	uint16_t	cmpl_ring;
60103 	/*
60104 	 * The sequence ID is used by the driver for tracking multiple
60105 	 * commands. This ID is treated as opaque data by the firmware and
60106 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60107 	 */
60108 	uint16_t	seq_id;
60109 	/*
60110 	 * The target ID of the command:
60111 	 * * 0x0-0xFFF8 - The function ID
60112 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60113 	 * * 0xFFFD - Reserved for user-space HWRM interface
60114 	 * * 0xFFFF - HWRM
60115 	 */
60116 	uint16_t	target_id;
60117 	/*
60118 	 * A physical address pointer pointing to a host buffer that the
60119 	 * command's response data will be written. This can be either a host
60120 	 * physical address (HPA) or a guest physical address (GPA) and must
60121 	 * point to a physically contiguous block of memory.
60122 	 */
60123 	uint64_t	resp_addr;
60124 	uint16_t	output_dest_flags;
60125 	/* Destination is DDR ram. */
60126 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_TYPE_DDR	UINT32_C(0x1)
60127 	uint16_t	pg_size_lvl;
60128 	/* PBL indirect levels. */
60129 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_MASK	UINT32_C(0x3)
60130 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_SFT	0
60131 	/* PBL pointer is physical start address. */
60132 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_0	UINT32_C(0x0)
60133 	/* PBL pointer points to PTE table. */
60134 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_1	UINT32_C(0x1)
60135 	/*
60136 	 * PBL pointer points to PDE table with each entry pointing to
60137 	 * PTE tables.
60138 	 */
60139 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2	UINT32_C(0x2)
60140 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LAST	HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2
60141 	/* page size. */
60142 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_MASK  UINT32_C(0x1c)
60143 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_SFT   2
60144 	/* 4KB. */
60145 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
60146 	/* 8KB. */
60147 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
60148 	/* 64KB. */
60149 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
60150 	/* 2MB. */
60151 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
60152 	/* 8MB. */
60153 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
60154 	/* 1GB. */
60155 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
60156 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_LAST   HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G
60157 	/* unused11 is 11 b */
60158 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_MASK UINT32_C(0xffe0)
60159 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_SFT  5
60160 	/* Crashdump buffer size. */
60161 	uint32_t	size;
60162 	/*
60163 	 * Bitwise field of components that FW is requested to skip during
60164 	 * coredump as part of a crash collection.
60165 	 */
60166 	uint32_t	coredump_component_disable_flags;
60167 	/*
60168 	 * If 1, then NVM will not be collected during a coredump taken as
60169 	 * part of crash collection.
60170 	 */
60171 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_NVRAM	UINT32_C(0x1)
60172 	uint32_t	unused_0;
60173 	/* Crashdump buffer PBL physical address. */
60174 	uint64_t	pbl;
60175 } hwrm_dbg_crashdump_medium_cfg_input_t, *phwrm_dbg_crashdump_medium_cfg_input_t;
60176 
60177 /* hwrm_dbg_crashdump_medium_cfg_output (size:128b/16B) */
60178 
60179 typedef struct hwrm_dbg_crashdump_medium_cfg_output {
60180 	/* The specific error status for the command. */
60181 	uint16_t	error_code;
60182 	/* The HWRM command request type. */
60183 	uint16_t	req_type;
60184 	/* The sequence ID from the original command. */
60185 	uint16_t	seq_id;
60186 	/* The length of the response data in number of bytes. */
60187 	uint16_t	resp_len;
60188 	uint8_t	unused_1[7];
60189 	/*
60190 	 * This field is used in Output records to indicate that the output
60191 	 * is completely written to RAM.  This field should be read as '1'
60192 	 * to indicate that the output has been completely written.
60193 	 * When writing a command completion or response to an internal processor,
60194 	 * the order of writes has to be such that this field is written last.
60195 	 */
60196 	uint8_t	valid;
60197 } hwrm_dbg_crashdump_medium_cfg_output_t, *phwrm_dbg_crashdump_medium_cfg_output_t;
60198 
60199 /* coredump_segment_record (size:128b/16B) */
60200 
60201 typedef struct coredump_segment_record {
60202 	/* Component id of the returned component. */
60203 	uint16_t	component_id;
60204 	/* Segment id of the returned component. */
60205 	uint16_t	segment_id;
60206 	/* Not used. */
60207 	uint16_t	max_instances;
60208 	/* Major version. */
60209 	uint8_t	version_hi;
60210 	/* Minor version. */
60211 	uint8_t	version_low;
60212 	/*
60213 	 * bit 0: live data
60214 	 * bit 1: crashed data
60215 	 */
60216 	uint8_t	seg_flags;
60217 	/* This field is used to indicate the segment is compressed. */
60218 	uint8_t	compress_flags;
60219 	/*
60220 	 * SFLAG_COMPRESSED_ZLIB indicates that the segment data is
60221 	 * compressed.
60222 	 */
60223 	#define SFLAG_COMPRESSED_ZLIB	UINT32_C(0x1)
60224 	uint8_t	unused_0[2];
60225 	/*
60226 	 * This field is the length of the segment data. It will be zero if
60227 	 * the firmware does not support returning the segment data length.
60228 	 */
60229 	uint32_t	segment_len;
60230 } coredump_segment_record_t, *pcoredump_segment_record_t;
60231 
60232 /**************************
60233  * hwrm_dbg_coredump_list *
60234  **************************/
60235 
60236 
60237 /* hwrm_dbg_coredump_list_input (size:256b/32B) */
60238 
60239 typedef struct hwrm_dbg_coredump_list_input {
60240 	/* The HWRM command request type. */
60241 	uint16_t	req_type;
60242 	/*
60243 	 * The completion ring to send the completion event on. This should
60244 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60245 	 */
60246 	uint16_t	cmpl_ring;
60247 	/*
60248 	 * The sequence ID is used by the driver for tracking multiple
60249 	 * commands. This ID is treated as opaque data by the firmware and
60250 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60251 	 */
60252 	uint16_t	seq_id;
60253 	/*
60254 	 * The target ID of the command:
60255 	 * * 0x0-0xFFF8 - The function ID
60256 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60257 	 * * 0xFFFD - Reserved for user-space HWRM interface
60258 	 * * 0xFFFF - HWRM
60259 	 */
60260 	uint16_t	target_id;
60261 	/*
60262 	 * A physical address pointer pointing to a host buffer that the
60263 	 * command's response data will be written. This can be either a host
60264 	 * physical address (HPA) or a guest physical address (GPA) and must
60265 	 * point to a physically contiguous block of memory.
60266 	 */
60267 	uint64_t	resp_addr;
60268 	/*
60269 	 * host address where the data content will be written
60270 	 * when the request is complete.  This area must be 16B aligned.
60271 	 */
60272 	uint64_t	host_dest_addr;
60273 	/* Length of host buffer used for transferring debug data. */
60274 	uint32_t	host_buf_len;
60275 	/* Sequence number of the request. Starts at 0. */
60276 	uint16_t	seq_no;
60277 	/*  */
60278 	uint8_t	flags;
60279 	/*
60280 	 * If set to 1, crash dump is requested.
60281 	 * If set to 0, both live core and crash dump are requested.
60282 	 */
60283 	#define HWRM_DBG_COREDUMP_LIST_INPUT_FLAGS_CRASHDUMP	UINT32_C(0x1)
60284 	uint8_t	unused_0[1];
60285 } hwrm_dbg_coredump_list_input_t, *phwrm_dbg_coredump_list_input_t;
60286 
60287 /* hwrm_dbg_coredump_list_output (size:128b/16B) */
60288 
60289 typedef struct hwrm_dbg_coredump_list_output {
60290 	/* The specific error status for the command. */
60291 	uint16_t	error_code;
60292 	/* The HWRM command request type. */
60293 	uint16_t	req_type;
60294 	/* The sequence ID from the original command. */
60295 	uint16_t	seq_id;
60296 	/* The length of the response data in number of bytes. */
60297 	uint16_t	resp_len;
60298 	uint8_t	flags;
60299 	/*
60300 	 * Value of 1 means that there is more data available.
60301 	 * Issue the request again with the next sequence number.
60302 	 */
60303 	#define HWRM_DBG_COREDUMP_LIST_OUTPUT_FLAGS_MORE	UINT32_C(0x1)
60304 	uint8_t	unused_0;
60305 	/* Total number of segments to be returned. */
60306 	uint16_t	total_segments;
60307 	/* Actual length of data returned in bytes. */
60308 	uint16_t	data_len;
60309 	uint8_t	unused_1;
60310 	/*
60311 	 * This field is used in Output records to indicate that the output
60312 	 * is completely written to RAM.  This field should be read as '1'
60313 	 * to indicate that the output has been completely written.
60314 	 * When writing a command completion or response to an internal processor,
60315 	 * the order of writes has to be such that this field is written last.
60316 	 */
60317 	uint8_t	valid;
60318 } hwrm_dbg_coredump_list_output_t, *phwrm_dbg_coredump_list_output_t;
60319 
60320 /******************************
60321  * hwrm_dbg_coredump_initiate *
60322  ******************************/
60323 
60324 
60325 /* hwrm_dbg_coredump_initiate_input (size:256b/32B) */
60326 
60327 typedef struct hwrm_dbg_coredump_initiate_input {
60328 	/* The HWRM command request type. */
60329 	uint16_t	req_type;
60330 	/*
60331 	 * The completion ring to send the completion event on. This should
60332 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60333 	 */
60334 	uint16_t	cmpl_ring;
60335 	/*
60336 	 * The sequence ID is used by the driver for tracking multiple
60337 	 * commands. This ID is treated as opaque data by the firmware and
60338 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60339 	 */
60340 	uint16_t	seq_id;
60341 	/*
60342 	 * The target ID of the command:
60343 	 * * 0x0-0xFFF8 - The function ID
60344 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60345 	 * * 0xFFFD - Reserved for user-space HWRM interface
60346 	 * * 0xFFFF - HWRM
60347 	 */
60348 	uint16_t	target_id;
60349 	/*
60350 	 * A physical address pointer pointing to a host buffer that the
60351 	 * command's response data will be written. This can be either a host
60352 	 * physical address (HPA) or a guest physical address (GPA) and must
60353 	 * point to a physically contiguous block of memory.
60354 	 */
60355 	uint64_t	resp_addr;
60356 	/* Component id of the returned component. */
60357 	uint16_t	component_id;
60358 	/* Segment id of the returned component. */
60359 	uint16_t	segment_id;
60360 	/* Not used. */
60361 	uint16_t	instance;
60362 	/* Not used. */
60363 	uint16_t	unused_0;
60364 	/*
60365 	 * bit 0: live data
60366 	 * bit 1: crashed data
60367 	 */
60368 	uint8_t	seg_flags;
60369 	/* Not used. */
60370 	uint8_t	unused_1[7];
60371 } hwrm_dbg_coredump_initiate_input_t, *phwrm_dbg_coredump_initiate_input_t;
60372 
60373 /* hwrm_dbg_coredump_initiate_output (size:128b/16B) */
60374 
60375 typedef struct hwrm_dbg_coredump_initiate_output {
60376 	/* The specific error status for the command. */
60377 	uint16_t	error_code;
60378 	/* The HWRM command request type. */
60379 	uint16_t	req_type;
60380 	/* The sequence ID from the original command. */
60381 	uint16_t	seq_id;
60382 	/* The length of the response data in number of bytes. */
60383 	uint16_t	resp_len;
60384 	uint8_t	unused_0[7];
60385 	/*
60386 	 * This field is used in Output records to indicate that the output
60387 	 * is completely written to RAM.  This field should be read as '1'
60388 	 * to indicate that the output has been completely written.
60389 	 * When writing a command completion or response to an internal processor,
60390 	 * the order of writes has to be such that this field is written last.
60391 	 */
60392 	uint8_t	valid;
60393 } hwrm_dbg_coredump_initiate_output_t, *phwrm_dbg_coredump_initiate_output_t;
60394 
60395 /* coredump_data_hdr (size:128b/16B) */
60396 
60397 typedef struct coredump_data_hdr {
60398 	/* Starting address of the register range. */
60399 	uint32_t	address;
60400 	/*
60401 	 * length: 0 - 23 bits represents the actual data without the pad.
60402 	 * flags: 24 - 31 bits represents indirect register ranges.
60403 	 *   - bit 24: Set if registers in this segment are indirect accessed.
60404 	 */
60405 	uint32_t	flags_length;
60406 	/* These bits represents the actual length of the data segment */
60407 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_MASK	UINT32_C(0xffffff)
60408 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_SFT	0
60409 	/* Set if registers in this segment are indirect accessed. */
60410 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_INDIRECT_ACCESS	UINT32_C(0x1000000)
60411 	/* Value in the partner register for indirect or multi-field registers. */
60412 	uint32_t	instance;
60413 	/* Starting address of the next register after the current data range */
60414 	uint32_t	next_offset;
60415 } coredump_data_hdr_t, *pcoredump_data_hdr_t;
60416 
60417 /******************************
60418  * hwrm_dbg_coredump_retrieve *
60419  ******************************/
60420 
60421 
60422 /* hwrm_dbg_coredump_retrieve_input (size:448b/56B) */
60423 
60424 typedef struct hwrm_dbg_coredump_retrieve_input {
60425 	/* The HWRM command request type. */
60426 	uint16_t	req_type;
60427 	/*
60428 	 * The completion ring to send the completion event on. This should
60429 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60430 	 */
60431 	uint16_t	cmpl_ring;
60432 	/*
60433 	 * The sequence ID is used by the driver for tracking multiple
60434 	 * commands. This ID is treated as opaque data by the firmware and
60435 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60436 	 */
60437 	uint16_t	seq_id;
60438 	/*
60439 	 * The target ID of the command:
60440 	 * * 0x0-0xFFF8 - The function ID
60441 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60442 	 * * 0xFFFD - Reserved for user-space HWRM interface
60443 	 * * 0xFFFF - HWRM
60444 	 */
60445 	uint16_t	target_id;
60446 	/*
60447 	 * A physical address pointer pointing to a host buffer that the
60448 	 * command's response data will be written. This can be either a host
60449 	 * physical address (HPA) or a guest physical address (GPA) and must
60450 	 * point to a physically contiguous block of memory.
60451 	 */
60452 	uint64_t	resp_addr;
60453 	/*
60454 	 * host address where the data content will be written
60455 	 * when the request is complete.  This area must be 16B aligned.
60456 	 */
60457 	uint64_t	host_dest_addr;
60458 	/* Length of host buffer used for transferring debug data. */
60459 	uint32_t	host_buf_len;
60460 	/* Not used. */
60461 	uint32_t	unused_0;
60462 	/* Component id of the returned component. */
60463 	uint16_t	component_id;
60464 	/* Segment id of the returned component. */
60465 	uint16_t	segment_id;
60466 	/* Not used. */
60467 	uint16_t	instance;
60468 	/* Not used. */
60469 	uint16_t	unused_1;
60470 	/*
60471 	 * bit 0: live data
60472 	 * bit 1: crashed data
60473 	 */
60474 	uint8_t	seg_flags;
60475 	uint8_t	unused_2;
60476 	uint16_t	unused_3;
60477 	/* Not used. */
60478 	uint32_t	unused_4;
60479 	/* Sequence number is used per segment request. Starts at 0. */
60480 	uint32_t	seq_no;
60481 	uint32_t	unused_5;
60482 } hwrm_dbg_coredump_retrieve_input_t, *phwrm_dbg_coredump_retrieve_input_t;
60483 
60484 /* hwrm_dbg_coredump_retrieve_output (size:128b/16B) */
60485 
60486 typedef struct hwrm_dbg_coredump_retrieve_output {
60487 	/* The specific error status for the command. */
60488 	uint16_t	error_code;
60489 	/* The HWRM command request type. */
60490 	uint16_t	req_type;
60491 	/* The sequence ID from the original command. */
60492 	uint16_t	seq_id;
60493 	/* The length of the response data in number of bytes. */
60494 	uint16_t	resp_len;
60495 	uint8_t	flags;
60496 	/*
60497 	 * Value of 1 means that there is more data available.
60498 	 * Issue the request again with the next sequence number.
60499 	 */
60500 	#define HWRM_DBG_COREDUMP_RETRIEVE_OUTPUT_FLAGS_MORE	UINT32_C(0x1)
60501 	uint8_t	unused_0;
60502 	/* Actual length of data returned in bytes. */
60503 	uint16_t	data_len;
60504 	uint8_t	unused_1[3];
60505 	/*
60506 	 * This field is used in Output records to indicate that the output
60507 	 * is completely written to RAM.  This field should be read as '1'
60508 	 * to indicate that the output has been completely written.
60509 	 * When writing a command completion or response to an internal processor,
60510 	 * the order of writes has to be such that this field is written last.
60511 	 */
60512 	uint8_t	valid;
60513 } hwrm_dbg_coredump_retrieve_output_t, *phwrm_dbg_coredump_retrieve_output_t;
60514 
60515 /********************
60516  * hwrm_dbg_i2c_cmd *
60517  ********************/
60518 
60519 
60520 /* hwrm_dbg_i2c_cmd_input (size:320b/40B) */
60521 
60522 typedef struct hwrm_dbg_i2c_cmd_input {
60523 	/* The HWRM command request type. */
60524 	uint16_t	req_type;
60525 	/*
60526 	 * The completion ring to send the completion event on. This should
60527 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60528 	 */
60529 	uint16_t	cmpl_ring;
60530 	/*
60531 	 * The sequence ID is used by the driver for tracking multiple
60532 	 * commands. This ID is treated as opaque data by the firmware and
60533 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60534 	 */
60535 	uint16_t	seq_id;
60536 	/*
60537 	 * The target ID of the command:
60538 	 * * 0x0-0xFFF8 - The function ID
60539 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60540 	 * * 0xFFFD - Reserved for user-space HWRM interface
60541 	 * * 0xFFFF - HWRM
60542 	 */
60543 	uint16_t	target_id;
60544 	/*
60545 	 * A physical address pointer pointing to a host buffer that the
60546 	 * command's response data will be written. This can be either a host
60547 	 * physical address (HPA) or a guest physical address (GPA) and must
60548 	 * point to a physically contiguous block of memory.
60549 	 */
60550 	uint64_t	resp_addr;
60551 	/*
60552 	 * host address where the data content will be read or written.
60553 	 * For master write, data content will be read from host memory and write
60554 	 * to i2c slave. (size defined by write_size)
60555 	 * For master read, data content will be read from i2c slave and write to
60556 	 * the host memory. (size defined by read_size)
60557 	 * For master write/read,  data content will be first read from host memory
60558 	 * and write to i2c slave. (size defined by write_size) then data read from
60559 	 * i2c slave will be written back to the same host memory. (size defined by read_size)
60560 	 */
60561 	uint64_t	host_dest_addr;
60562 	/* read size in bytes, valid only for master read and write/read */
60563 	uint16_t	read_size;
60564 	/* write size in bytes, valid only for master write and write/read */
60565 	uint16_t	write_size;
60566 	/*
60567 	 * instance of i2c channel for this operation. Valid if multiple instances
60568 	 * of i2c channels are connected to external i2c devices.
60569 	 */
60570 	uint8_t	chnl_id;
60571 	uint8_t	options;
60572 	/*
60573 	 * This bit must be '1' for 10-bit i2c addressing,
60574 	 * 7-bit addressing otherwise.
60575 	 */
60576 	#define HWRM_DBG_I2C_CMD_INPUT_OPTIONS_10_BIT_ADDRESSING	UINT32_C(0x1)
60577 	/*
60578 	 * This bit must be '1' for 400 kbit/s, 100 kbit/s
60579 	 * otherwise.
60580 	 */
60581 	#define HWRM_DBG_I2C_CMD_INPUT_OPTIONS_FAST_MODE		UINT32_C(0x2)
60582 	/* I2C slave address. */
60583 	uint16_t	slave_addr;
60584 	/* I2C transfer mode. */
60585 	uint8_t	xfer_mode;
60586 	/* read data from slave device */
60587 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_READ	UINT32_C(0x0)
60588 	/* write data to slave device */
60589 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE	UINT32_C(0x1)
60590 	/* write follow by read data from slave device */
60591 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE_READ UINT32_C(0x2)
60592 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_LAST		HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE_READ
60593 	uint8_t	unused_1[7];
60594 } hwrm_dbg_i2c_cmd_input_t, *phwrm_dbg_i2c_cmd_input_t;
60595 
60596 /* hwrm_dbg_i2c_cmd_output (size:128b/16B) */
60597 
60598 typedef struct hwrm_dbg_i2c_cmd_output {
60599 	/* The specific error status for the command. */
60600 	uint16_t	error_code;
60601 	/* The HWRM command request type. */
60602 	uint16_t	req_type;
60603 	/* The sequence ID from the original command. */
60604 	uint16_t	seq_id;
60605 	/* The length of the response data in number of bytes. */
60606 	uint16_t	resp_len;
60607 	uint8_t	unused_0[7];
60608 	/*
60609 	 * This field is used in Output records to indicate that the output
60610 	 * is completely written to RAM.  This field should be read as '1'
60611 	 * to indicate that the output has been completely written.
60612 	 * When writing a command completion or response to an internal processor,
60613 	 * the order of writes has to be such that this field is written last.
60614 	 */
60615 	uint8_t	valid;
60616 } hwrm_dbg_i2c_cmd_output_t, *phwrm_dbg_i2c_cmd_output_t;
60617 
60618 /*******************
60619  * hwrm_dbg_fw_cli *
60620  *******************/
60621 
60622 
60623 /* hwrm_dbg_fw_cli_input (size:1024b/128B) */
60624 
60625 typedef struct hwrm_dbg_fw_cli_input {
60626 	/* The HWRM command request type. */
60627 	uint16_t	req_type;
60628 	/*
60629 	 * The completion ring to send the completion event on. This should
60630 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60631 	 */
60632 	uint16_t	cmpl_ring;
60633 	/*
60634 	 * The sequence ID is used by the driver for tracking multiple
60635 	 * commands. This ID is treated as opaque data by the firmware and
60636 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60637 	 */
60638 	uint16_t	seq_id;
60639 	/*
60640 	 * The target ID of the command:
60641 	 * * 0x0-0xFFF8 - The function ID
60642 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60643 	 * * 0xFFFD - Reserved for user-space HWRM interface
60644 	 * * 0xFFFF - HWRM
60645 	 */
60646 	uint16_t	target_id;
60647 	/*
60648 	 * A physical address pointer pointing to a host buffer that the
60649 	 * command's response data will be written. This can be either a host
60650 	 * physical address (HPA) or a guest physical address (GPA) and must
60651 	 * point to a physically contiguous block of memory.
60652 	 */
60653 	uint64_t	resp_addr;
60654 	/*
60655 	 * Address of the host buffer where debug CLI data
60656 	 * is requested to be dumped.
60657 	 */
60658 	uint64_t	host_dest_addr;
60659 	/* Length of host buffer used for transferring debug data. */
60660 	uint32_t	host_buf_len;
60661 	/* Length of CLI command. */
60662 	uint16_t	cli_cmd_len;
60663 	uint8_t	unused_0[2];
60664 	/* CLI command string, a single ASCII encoded null terminated string. */
60665 	uint8_t	cli_cmd[96];
60666 } hwrm_dbg_fw_cli_input_t, *phwrm_dbg_fw_cli_input_t;
60667 
60668 /* hwrm_dbg_fw_cli_output (size:128b/16B) */
60669 
60670 typedef struct hwrm_dbg_fw_cli_output {
60671 	/* The specific error status for the command. */
60672 	uint16_t	error_code;
60673 	/* The HWRM command request type. */
60674 	uint16_t	req_type;
60675 	/* The sequence ID from the original command. */
60676 	uint16_t	seq_id;
60677 	/* The length of the response data in number of bytes. */
60678 	uint16_t	resp_len;
60679 	/* Size of debug CLI data returned in bytes. */
60680 	uint32_t	cli_data_len;
60681 	uint8_t	unused_0[3];
60682 	/*
60683 	 * This field is used in Output records to indicate that the output
60684 	 * is completely written to RAM.  This field should be read as '1'
60685 	 * to indicate that the output has been completely written.
60686 	 * When writing a command completion or response to an internal processor,
60687 	 * the order of writes has to be such that this field is written last.
60688 	 */
60689 	uint8_t	valid;
60690 } hwrm_dbg_fw_cli_output_t, *phwrm_dbg_fw_cli_output_t;
60691 
60692 /**************************
60693  * hwrm_dbg_ring_info_get *
60694  **************************/
60695 
60696 
60697 /* hwrm_dbg_ring_info_get_input (size:192b/24B) */
60698 
60699 typedef struct hwrm_dbg_ring_info_get_input {
60700 	/* The HWRM command request type. */
60701 	uint16_t	req_type;
60702 	/*
60703 	 * The completion ring to send the completion event on. This should
60704 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60705 	 */
60706 	uint16_t	cmpl_ring;
60707 	/*
60708 	 * The sequence ID is used by the driver for tracking multiple
60709 	 * commands. This ID is treated as opaque data by the firmware and
60710 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60711 	 */
60712 	uint16_t	seq_id;
60713 	/*
60714 	 * The target ID of the command:
60715 	 * * 0x0-0xFFF8 - The function ID
60716 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60717 	 * * 0xFFFD - Reserved for user-space HWRM interface
60718 	 * * 0xFFFF - HWRM
60719 	 */
60720 	uint16_t	target_id;
60721 	/*
60722 	 * A physical address pointer pointing to a host buffer that the
60723 	 * command's response data will be written. This can be either a host
60724 	 * physical address (HPA) or a guest physical address (GPA) and must
60725 	 * point to a physically contiguous block of memory.
60726 	 */
60727 	uint64_t	resp_addr;
60728 	/* Ring Type. */
60729 	uint8_t	ring_type;
60730 	/* L2 Completion Ring (CR) */
60731 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
60732 	/* TX Ring (TR) */
60733 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_TX	UINT32_C(0x1)
60734 	/* RX Ring (RR) */
60735 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_RX	UINT32_C(0x2)
60736 	/* Notification Queue (NQ) */
60737 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ	UINT32_C(0x3)
60738 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_LAST   HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ
60739 	uint8_t	unused_0[3];
60740 	/* Firmware ring ID associated with ring being queried. */
60741 	uint32_t	fw_ring_id;
60742 } hwrm_dbg_ring_info_get_input_t, *phwrm_dbg_ring_info_get_input_t;
60743 
60744 /* hwrm_dbg_ring_info_get_output (size:192b/24B) */
60745 
60746 typedef struct hwrm_dbg_ring_info_get_output {
60747 	/* The specific error status for the command. */
60748 	uint16_t	error_code;
60749 	/* The HWRM command request type. */
60750 	uint16_t	req_type;
60751 	/* The sequence ID from the original command. */
60752 	uint16_t	seq_id;
60753 	/* The length of the response data in number of bytes. */
60754 	uint16_t	resp_len;
60755 	/* Producer index for the queried ring. */
60756 	uint32_t	producer_index;
60757 	/* Consumer index for the queried ring. */
60758 	uint32_t	consumer_index;
60759 	/*
60760 	 * CAG Vector Control for the queried NQ ring.
60761 	 * Not valid for other ring types.
60762 	 */
60763 	uint32_t	cag_vector_ctrl;
60764 	uint8_t	unused_0[3];
60765 	/*
60766 	 * This field is used in Output records to indicate that the output
60767 	 * is completely written to RAM.  This field should be read as '1'
60768 	 * to indicate that the output has been completely written.
60769 	 * When writing a command completion or response to an internal processor,
60770 	 * the order of writes has to be such that this field is written last.
60771 	 */
60772 	uint8_t	valid;
60773 } hwrm_dbg_ring_info_get_output_t, *phwrm_dbg_ring_info_get_output_t;
60774 
60775 /**********************
60776  * hwrm_dbg_drv_trace *
60777  **********************/
60778 
60779 
60780 /* hwrm_dbg_drv_trace_input (size:1024b/128B) */
60781 
60782 typedef struct hwrm_dbg_drv_trace_input {
60783 	/* The HWRM command request type. */
60784 	uint16_t	req_type;
60785 	/*
60786 	 * The completion ring to send the completion event on. This should
60787 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60788 	 */
60789 	uint16_t	cmpl_ring;
60790 	/*
60791 	 * The sequence ID is used by the driver for tracking multiple
60792 	 * commands. This ID is treated as opaque data by the firmware and
60793 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60794 	 */
60795 	uint16_t	seq_id;
60796 	/*
60797 	 * The target ID of the command:
60798 	 * * 0x0-0xFFF8 - The function ID
60799 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60800 	 * * 0xFFFD - Reserved for user-space HWRM interface
60801 	 * * 0xFFFF - HWRM
60802 	 */
60803 	uint16_t	target_id;
60804 	/*
60805 	 * A physical address pointer pointing to a host buffer that the
60806 	 * command's response data will be written. This can be either a host
60807 	 * physical address (HPA) or a guest physical address (GPA) and must
60808 	 * point to a physically contiguous block of memory.
60809 	 */
60810 	uint64_t	resp_addr;
60811 	/* Severity of the message. */
60812 	uint8_t	severity;
60813 	/* Fatal */
60814 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_FATAL   UINT32_C(0x0)
60815 	/* Error */
60816 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_ERROR   UINT32_C(0x1)
60817 	/* Warning */
60818 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_WARNING UINT32_C(0x2)
60819 	/* Info */
60820 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_INFO	UINT32_C(0x3)
60821 	/* Debug */
60822 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG   UINT32_C(0x4)
60823 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_LAST		HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG
60824 	/* Number of bytes to write including terminating 'NULL' if any. */
60825 	uint8_t	write_len;
60826 	uint8_t	unused_0[6];
60827 	/*
60828 	 * This field represents the debug data sent by driver
60829 	 * ASCII chars, 'NULL' termination not required.
60830 	 */
60831 	char	trace_data[104];
60832 } hwrm_dbg_drv_trace_input_t, *phwrm_dbg_drv_trace_input_t;
60833 
60834 /* hwrm_dbg_drv_trace_output (size:128b/16B) */
60835 
60836 typedef struct hwrm_dbg_drv_trace_output {
60837 	/* The specific error status for the command. */
60838 	uint16_t	error_code;
60839 	/* The HWRM command request type. */
60840 	uint16_t	req_type;
60841 	/* The sequence ID from the original command. */
60842 	uint16_t	seq_id;
60843 	/* The length of the response data in number of bytes. */
60844 	uint16_t	resp_len;
60845 	uint8_t	unused_0[7];
60846 	/*
60847 	 * This field is used in Output records to indicate that the output
60848 	 * is completely written to RAM.  This field should be read as '1'
60849 	 * to indicate that the output has been completely written.
60850 	 * When writing a command completion or response to an internal processor,
60851 	 * the order of writes has to be such that this field is written last.
60852 	 */
60853 	uint8_t	valid;
60854 } hwrm_dbg_drv_trace_output_t, *phwrm_dbg_drv_trace_output_t;
60855 
60856 /***********************
60857  * hwrm_dbg_useq_alloc *
60858  ***********************/
60859 
60860 
60861 /* hwrm_dbg_useq_alloc_input (size:192b/24B) */
60862 
60863 typedef struct hwrm_dbg_useq_alloc_input {
60864 	/* The HWRM command request type. */
60865 	uint16_t	req_type;
60866 	/*
60867 	 * The completion ring to send the completion event on. This should
60868 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60869 	 */
60870 	uint16_t	cmpl_ring;
60871 	/*
60872 	 * The sequence ID is used by the driver for tracking multiple
60873 	 * commands. This ID is treated as opaque data by the firmware and
60874 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60875 	 */
60876 	uint16_t	seq_id;
60877 	/*
60878 	 * The target ID of the command:
60879 	 * * 0x0-0xFFF8 - The function ID
60880 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60881 	 * * 0xFFFD - Reserved for user-space HWRM interface
60882 	 * * 0xFFFF - HWRM
60883 	 */
60884 	uint16_t	target_id;
60885 	/*
60886 	 * A physical address pointer pointing to a host buffer that the
60887 	 * command's response data will be written. This can be either a host
60888 	 * physical address (HPA) or a guest physical address (GPA) and must
60889 	 * point to a physically contiguous block of memory.
60890 	 */
60891 	uint64_t	resp_addr;
60892 	/* Number size of the allocation, in bytes, for the USEQ in the code words array */
60893 	uint32_t	size;
60894 	/* Number of bytes executing the USEQ will produce.  Must be a multiple of 4 */
60895 	uint16_t	output_bytes;
60896 	/* This field is reserved */
60897 	uint16_t	unused_0;
60898 } hwrm_dbg_useq_alloc_input_t, *phwrm_dbg_useq_alloc_input_t;
60899 
60900 /* hwrm_dbg_useq_alloc_output (size:256b/32B) */
60901 
60902 typedef struct hwrm_dbg_useq_alloc_output {
60903 	/* The specific error status for the command. */
60904 	uint16_t	error_code;
60905 	/* The HWRM command request type. */
60906 	uint16_t	req_type;
60907 	/* The sequence ID from the original command. */
60908 	uint16_t	seq_id;
60909 	/* The length of the response data in number of bytes. */
60910 	uint16_t	resp_len;
60911 	/* Non-zero firmware timestamp */
60912 	uint32_t	nz_fw_timestamp;
60913 	/* The last selected USID */
60914 	uint16_t	last_usid;
60915 	/* The number of USEQs currently allocated */
60916 	uint16_t	num_useq_allocd;
60917 	/* Flags indicating current USEQ engine state */
60918 	uint32_t	useq_resp_flags;
60919 	/* When set, there is at least some data available to be delivered */
60920 	#define HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
60921 	/* When set, all internal buffers are full */
60922 	#define HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
60923 	#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
60924 	/* Current count of the number of full buffers available for delivery */
60925 	uint8_t	full_cnt;
60926 	/* Reserved */
60927 	uint8_t	useq_resp_unused_0[3];
60928 	/* This is the allocated usid */
60929 	uint16_t	alloc_usid;
60930 	/* This field is reserved */
60931 	uint16_t	unused_0;
60932 	/*
60933 	 * This field is used in Output records to indicate that the output
60934 	 * is completely written to RAM.  This field should be read as '1'
60935 	 * to indicate that the output has been completely written.
60936 	 * When writing a command completion or response to an internal processor,
60937 	 * the order of writes has to be such that this field is written last.
60938 	 */
60939 	uint32_t	valid;
60940 } hwrm_dbg_useq_alloc_output_t, *phwrm_dbg_useq_alloc_output_t;
60941 
60942 /**********************
60943  * hwrm_dbg_useq_free *
60944  **********************/
60945 
60946 
60947 /* hwrm_dbg_useq_free_input (size:192b/24B) */
60948 
60949 typedef struct hwrm_dbg_useq_free_input {
60950 	/* The HWRM command request type. */
60951 	uint16_t	req_type;
60952 	/*
60953 	 * The completion ring to send the completion event on. This should
60954 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60955 	 */
60956 	uint16_t	cmpl_ring;
60957 	/*
60958 	 * The sequence ID is used by the driver for tracking multiple
60959 	 * commands. This ID is treated as opaque data by the firmware and
60960 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60961 	 */
60962 	uint16_t	seq_id;
60963 	/*
60964 	 * The target ID of the command:
60965 	 * * 0x0-0xFFF8 - The function ID
60966 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60967 	 * * 0xFFFD - Reserved for user-space HWRM interface
60968 	 * * 0xFFFF - HWRM
60969 	 */
60970 	uint16_t	target_id;
60971 	/*
60972 	 * A physical address pointer pointing to a host buffer that the
60973 	 * command's response data will be written. This can be either a host
60974 	 * physical address (HPA) or a guest physical address (GPA) and must
60975 	 * point to a physically contiguous block of memory.
60976 	 */
60977 	uint64_t	resp_addr;
60978 	/* The USID of the sequence to free */
60979 	uint16_t	usid;
60980 	/* This field is reserved */
60981 	uint8_t	unused_0[6];
60982 } hwrm_dbg_useq_free_input_t, *phwrm_dbg_useq_free_input_t;
60983 
60984 /* hwrm_dbg_useq_free_output (size:256b/32B) */
60985 
60986 typedef struct hwrm_dbg_useq_free_output {
60987 	/* The specific error status for the command. */
60988 	uint16_t	error_code;
60989 	/* The HWRM command request type. */
60990 	uint16_t	req_type;
60991 	/* The sequence ID from the original command. */
60992 	uint16_t	seq_id;
60993 	/* The length of the response data in number of bytes. */
60994 	uint16_t	resp_len;
60995 	/* Non-zero firmware timestamp */
60996 	uint32_t	nz_fw_timestamp;
60997 	/* The last selected USID */
60998 	uint16_t	last_usid;
60999 	/* The number of USEQs currently allocated */
61000 	uint16_t	num_useq_allocd;
61001 	/* Flags indicating current USEQ engine state */
61002 	uint32_t	useq_resp_flags;
61003 	/* When set, there is at least some data available to be delivered */
61004 	#define HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61005 	/* When set, all internal buffers are full */
61006 	#define HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61007 	#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
61008 	/* Current count of the number of full buffers available for delivery */
61009 	uint8_t	full_cnt;
61010 	/* Reserved */
61011 	uint8_t	useq_resp_unused_0[3];
61012 	/* This field is reserved */
61013 	uint32_t	unused_0;
61014 	/*
61015 	 * This field is used in Output records to indicate that the output
61016 	 * is completely written to RAM.  This field should be read as '1'
61017 	 * to indicate that the output has been completely written.
61018 	 * When writing a command completion or response to an internal processor,
61019 	 * the order of writes has to be such that this field is written last.
61020 	 */
61021 	uint32_t	valid;
61022 } hwrm_dbg_useq_free_output_t, *phwrm_dbg_useq_free_output_t;
61023 
61024 /***********************
61025  * hwrm_dbg_useq_flush *
61026  ***********************/
61027 
61028 
61029 /* hwrm_dbg_useq_flush_input (size:192b/24B) */
61030 
61031 typedef struct hwrm_dbg_useq_flush_input {
61032 	/* The HWRM command request type. */
61033 	uint16_t	req_type;
61034 	/*
61035 	 * The completion ring to send the completion event on. This should
61036 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61037 	 */
61038 	uint16_t	cmpl_ring;
61039 	/*
61040 	 * The sequence ID is used by the driver for tracking multiple
61041 	 * commands. This ID is treated as opaque data by the firmware and
61042 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61043 	 */
61044 	uint16_t	seq_id;
61045 	/*
61046 	 * The target ID of the command:
61047 	 * * 0x0-0xFFF8 - The function ID
61048 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61049 	 * * 0xFFFD - Reserved for user-space HWRM interface
61050 	 * * 0xFFFF - HWRM
61051 	 */
61052 	uint16_t	target_id;
61053 	/*
61054 	 * A physical address pointer pointing to a host buffer that the
61055 	 * command's response data will be written. This can be either a host
61056 	 * physical address (HPA) or a guest physical address (GPA) and must
61057 	 * point to a physically contiguous block of memory.
61058 	 */
61059 	uint64_t	resp_addr;
61060 	/* Bitwise flags described below */
61061 	uint16_t	flags;
61062 	/* Flush all USEQ code words, resetting all USIDs to invalid */
61063 	#define HWRM_DBG_USEQ_FLUSH_INPUT_USEQ_CODE_WORDS UINT32_C(0x1)
61064 	/* Initialize all buffers, clearing out any collected data */
61065 	#define HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS	UINT32_C(0x2)
61066 	#define HWRM_DBG_USEQ_FLUSH_INPUT_LAST	HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS
61067 	/* This field is reserved */
61068 	uint8_t	unused_0[6];
61069 } hwrm_dbg_useq_flush_input_t, *phwrm_dbg_useq_flush_input_t;
61070 
61071 /* hwrm_dbg_useq_flush_output (size:256b/32B) */
61072 
61073 typedef struct hwrm_dbg_useq_flush_output {
61074 	/* The specific error status for the command. */
61075 	uint16_t	error_code;
61076 	/* The HWRM command request type. */
61077 	uint16_t	req_type;
61078 	/* The sequence ID from the original command. */
61079 	uint16_t	seq_id;
61080 	/* The length of the response data in number of bytes. */
61081 	uint16_t	resp_len;
61082 	/* Non-zero firmware timestamp */
61083 	uint32_t	nz_fw_timestamp;
61084 	/* The last selected USID */
61085 	uint16_t	last_usid;
61086 	/* The number of USEQs currently allocated */
61087 	uint16_t	num_useq_allocd;
61088 	/* Flags indicating current USEQ engine state */
61089 	uint32_t	useq_resp_flags;
61090 	/* When set, there is at least some data available to be delivered */
61091 	#define HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61092 	/* When set, all internal buffers are full */
61093 	#define HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61094 	#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
61095 	/* Current count of the number of full buffers available for delivery */
61096 	uint8_t	full_cnt;
61097 	/* Reserved */
61098 	uint8_t	useq_resp_unused_0[3];
61099 	/* This field is reserved */
61100 	uint32_t	unused_0;
61101 	/*
61102 	 * This field is used in Output records to indicate that the output
61103 	 * is completely written to RAM.  This field should be read as '1'
61104 	 * to indicate that the output has been completely written.
61105 	 * When writing a command completion or response to an internal processor,
61106 	 * the order of writes has to be such that this field is written last.
61107 	 */
61108 	uint32_t	valid;
61109 } hwrm_dbg_useq_flush_output_t, *phwrm_dbg_useq_flush_output_t;
61110 
61111 /************************
61112  * hwrm_dbg_useq_cw_cfg *
61113  ************************/
61114 
61115 
61116 /* hwrm_dbg_useq_cw_cfg_input (size:960b/120B) */
61117 
61118 typedef struct hwrm_dbg_useq_cw_cfg_input {
61119 	/* The HWRM command request type. */
61120 	uint16_t	req_type;
61121 	/*
61122 	 * The completion ring to send the completion event on. This should
61123 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61124 	 */
61125 	uint16_t	cmpl_ring;
61126 	/*
61127 	 * The sequence ID is used by the driver for tracking multiple
61128 	 * commands. This ID is treated as opaque data by the firmware and
61129 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61130 	 */
61131 	uint16_t	seq_id;
61132 	/*
61133 	 * The target ID of the command:
61134 	 * * 0x0-0xFFF8 - The function ID
61135 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61136 	 * * 0xFFFD - Reserved for user-space HWRM interface
61137 	 * * 0xFFFF - HWRM
61138 	 */
61139 	uint16_t	target_id;
61140 	/*
61141 	 * A physical address pointer pointing to a host buffer that the
61142 	 * command's response data will be written. This can be either a host
61143 	 * physical address (HPA) or a guest physical address (GPA) and must
61144 	 * point to a physically contiguous block of memory.
61145 	 */
61146 	uint64_t	resp_addr;
61147 	/* The USID of the sequence being configured */
61148 	uint16_t	usid;
61149 	/*
61150 	 * The code words given in this message will be placed
61151 	 * at this offset from the starting code word for this
61152 	 * usid.  NOTE: when offset is zero, the first 6 32-bit
61153 	 * words may contain values for F0-F7 as well as the
61154 	 * main code word index.  This is determined by checking
61155 	 * the usid_ctrl_present flag.
61156 	 */
61157 	uint16_t	offset;
61158 	/*
61159 	 * When the use_dma flag is clear, this is the length in bytes
61160 	 * to be digested from the opaque data area.
61161 	 */
61162 	uint16_t	size;
61163 	/*
61164 	 * Flags associated with the current message
61165 	 * data area.
61166 	 */
61167 	uint16_t	flags;
61168 	/*
61169 	 * When set, the opaque data begins with a block of control
61170 	 * information to be associated with the usid.  This includes
61171 	 * F0-F7 code word indexes as well as the code word index for
61172 	 * main.
61173 	 */
61174 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_USID_CTRL_PRESENT UINT32_C(0x1)
61175 	/*
61176 	 * When set, opaque contains a 64b host address used to DMA
61177 	 * the entire code word sequence.  The offset within the
61178 	 * opaque data depends on the state of other flags.
61179 	 */
61180 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_USE_DMA	UINT32_C(0x2)
61181 	/*
61182 	 * When set, this message is the last configuration message
61183 	 * for the given usid.
61184 	 */
61185 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_END		UINT32_C(0x8000)
61186 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_LAST		HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_END
61187 	/* command dependent data (e.g. function id for host dma command) */
61188 	uint32_t	opaque[24];
61189 } hwrm_dbg_useq_cw_cfg_input_t, *phwrm_dbg_useq_cw_cfg_input_t;
61190 
61191 /* hwrm_dbg_useq_cw_cfg_output (size:192b/24B) */
61192 
61193 typedef struct hwrm_dbg_useq_cw_cfg_output {
61194 	/* The specific error status for the command. */
61195 	uint16_t	error_code;
61196 	/* The HWRM command request type. */
61197 	uint16_t	req_type;
61198 	/* The sequence ID from the original command. */
61199 	uint16_t	seq_id;
61200 	/* The length of the response data in number of bytes. */
61201 	uint16_t	resp_len;
61202 	/* Non-zero firmware timestamp */
61203 	uint32_t	nz_fw_timestamp;
61204 	/* The last selected USID */
61205 	uint16_t	last_usid;
61206 	/* The number of USEQs currently allocated */
61207 	uint16_t	num_useq_allocd;
61208 	/* Flags indicating current USEQ engine state */
61209 	uint32_t	useq_resp_flags;
61210 	/* When set, there is at least some data available to be delivered */
61211 	#define HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61212 	/* When set, all internal buffers are full */
61213 	#define HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61214 	#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
61215 	/* Current count of the number of full buffers available for delivery */
61216 	uint8_t	full_cnt;
61217 	/* Reserved */
61218 	uint8_t	useq_resp_unused_0[3];
61219 } hwrm_dbg_useq_cw_cfg_output_t, *phwrm_dbg_useq_cw_cfg_output_t;
61220 
61221 /***********************
61222  * hwrm_dbg_useq_qcaps *
61223  ***********************/
61224 
61225 
61226 /* hwrm_dbg_useq_qcaps_input (size:128b/16B) */
61227 
61228 typedef struct hwrm_dbg_useq_qcaps_input {
61229 	/* The HWRM command request type. */
61230 	uint16_t	req_type;
61231 	/*
61232 	 * The completion ring to send the completion event on. This should
61233 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61234 	 */
61235 	uint16_t	cmpl_ring;
61236 	/*
61237 	 * The sequence ID is used by the driver for tracking multiple
61238 	 * commands. This ID is treated as opaque data by the firmware and
61239 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61240 	 */
61241 	uint16_t	seq_id;
61242 	/*
61243 	 * The target ID of the command:
61244 	 * * 0x0-0xFFF8 - The function ID
61245 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61246 	 * * 0xFFFD - Reserved for user-space HWRM interface
61247 	 * * 0xFFFF - HWRM
61248 	 */
61249 	uint16_t	target_id;
61250 	/*
61251 	 * A physical address pointer pointing to a host buffer that the
61252 	 * command's response data will be written. This can be either a host
61253 	 * physical address (HPA) or a guest physical address (GPA) and must
61254 	 * point to a physically contiguous block of memory.
61255 	 */
61256 	uint64_t	resp_addr;
61257 } hwrm_dbg_useq_qcaps_input_t, *phwrm_dbg_useq_qcaps_input_t;
61258 
61259 /* hwrm_dbg_useq_qcaps_output (size:384b/48B) */
61260 
61261 typedef struct hwrm_dbg_useq_qcaps_output {
61262 	/* The specific error status for the command. */
61263 	uint16_t	error_code;
61264 	/* The HWRM command request type. */
61265 	uint16_t	req_type;
61266 	/* The sequence ID from the original command. */
61267 	uint16_t	seq_id;
61268 	/* The length of the response data in number of bytes. */
61269 	uint16_t	resp_len;
61270 	/* Non-zero firmware timestamp */
61271 	uint32_t	nz_fw_timestamp;
61272 	/* The last selected USID */
61273 	uint16_t	last_usid;
61274 	/* The number of USEQs currently allocated */
61275 	uint16_t	num_useq_allocd;
61276 	/* Flags indicating current USEQ engine state */
61277 	uint32_t	useq_resp_flags;
61278 	/* When set, there is at least some data available to be delivered */
61279 	#define HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61280 	/* When set, all internal buffers are full */
61281 	#define HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61282 	#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
61283 	/* Current count of the number of full buffers available for delivery */
61284 	uint8_t	full_cnt;
61285 	/* Reserved */
61286 	uint8_t	useq_resp_unused_0[3];
61287 	/* Maximum number of USEQ that can be tracked by firmware */
61288 	uint32_t	max_num_useq;
61289 	/* Maximum number of code word bytes for a single USEQ */
61290 	uint32_t	max_useq_size;
61291 	/* The maximum number of output bytes a single USEQ may generate */
61292 	uint32_t	max_useq_32b_output_size;
61293 	/* The number of internal USEQ output buffers, each of 4096 bytes */
61294 	uint32_t	num_buf;
61295 	/* This field is reserved */
61296 	uint32_t	unused_0;
61297 	/*
61298 	 * This field is used in Output records to indicate that the output
61299 	 * is completely written to RAM.  This field should be read as '1'
61300 	 * to indicate that the output has been completely written.
61301 	 * When writing a command completion or response to an internal processor,
61302 	 * the order of writes has to be such that this field is written last.
61303 	 */
61304 	uint32_t	valid;
61305 } hwrm_dbg_useq_qcaps_output_t, *phwrm_dbg_useq_qcaps_output_t;
61306 
61307 /***************************
61308  * hwrm_dbg_useq_sched_cfg *
61309  ***************************/
61310 
61311 
61312 /* hwrm_dbg_useq_sched_cfg_input (size:192b/24B) */
61313 
61314 typedef struct hwrm_dbg_useq_sched_cfg_input {
61315 	/* The HWRM command request type. */
61316 	uint16_t	req_type;
61317 	/*
61318 	 * The completion ring to send the completion event on. This should
61319 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61320 	 */
61321 	uint16_t	cmpl_ring;
61322 	/*
61323 	 * The sequence ID is used by the driver for tracking multiple
61324 	 * commands. This ID is treated as opaque data by the firmware and
61325 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61326 	 */
61327 	uint16_t	seq_id;
61328 	/*
61329 	 * The target ID of the command:
61330 	 * * 0x0-0xFFF8 - The function ID
61331 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61332 	 * * 0xFFFD - Reserved for user-space HWRM interface
61333 	 * * 0xFFFF - HWRM
61334 	 */
61335 	uint16_t	target_id;
61336 	/*
61337 	 * A physical address pointer pointing to a host buffer that the
61338 	 * command's response data will be written. This can be either a host
61339 	 * physical address (HPA) or a guest physical address (GPA) and must
61340 	 * point to a physically contiguous block of memory.
61341 	 */
61342 	uint64_t	resp_addr;
61343 	/* Enumeration values for enabling, disabling scheduler */
61344 	uint16_t	global_cfg;
61345 	/* This value will leave the global scheduler in its current state */
61346 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_NO_CHANGE UINT32_C(0x0)
61347 	/*
61348 	 * This value disables the global scheduler.  This mode must be used
61349 	 * when the RUN command is being used to run individual sequences.
61350 	 */
61351 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_DISABLE   UINT32_C(0x1)
61352 	/*
61353 	 * This value enables the global scheduler.  When enabled, USEQs will
61354 	 * be scheduled based on their polling intervals
61355 	 */
61356 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE	UINT32_C(0x2)
61357 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_LAST	HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE
61358 	/*
61359 	 * The given polling interval will be associated with this USID.  A value
61360 	 * of -1 indicates that the USID is invalid.  The invalid USID is used when
61361 	 * using this message only for global scheduler configuration.
61362 	 */
61363 	uint16_t	usid;
61364 	/* This value represents microseconds between runs of the USEQ */
61365 	uint32_t	polling_interval;
61366 } hwrm_dbg_useq_sched_cfg_input_t, *phwrm_dbg_useq_sched_cfg_input_t;
61367 
61368 /* hwrm_dbg_useq_sched_cfg_output (size:256b/32B) */
61369 
61370 typedef struct hwrm_dbg_useq_sched_cfg_output {
61371 	/* The specific error status for the command. */
61372 	uint16_t	error_code;
61373 	/* The HWRM command request type. */
61374 	uint16_t	req_type;
61375 	/* The sequence ID from the original command. */
61376 	uint16_t	seq_id;
61377 	/* The length of the response data in number of bytes. */
61378 	uint16_t	resp_len;
61379 	/* Non-zero firmware timestamp */
61380 	uint32_t	nz_fw_timestamp;
61381 	/* The last selected USID */
61382 	uint16_t	last_usid;
61383 	/* The number of USEQs currently allocated */
61384 	uint16_t	num_useq_allocd;
61385 	/* Flags indicating current USEQ engine state */
61386 	uint32_t	useq_resp_flags;
61387 	/* When set, there is at least some data available to be delivered */
61388 	#define HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61389 	/* When set, all internal buffers are full */
61390 	#define HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61391 	#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
61392 	/* Current count of the number of full buffers available for delivery */
61393 	uint8_t	full_cnt;
61394 	/* Reserved */
61395 	uint8_t	useq_resp_unused_0[3];
61396 	/* This field is reserved */
61397 	uint32_t	unused_0;
61398 	/*
61399 	 * This field is used in Output records to indicate that the output
61400 	 * is completely written to RAM.  This field should be read as '1'
61401 	 * to indicate that the output has been completely written.
61402 	 * When writing a command completion or response to an internal processor,
61403 	 * the order of writes has to be such that this field is written last.
61404 	 */
61405 	uint32_t	valid;
61406 } hwrm_dbg_useq_sched_cfg_output_t, *phwrm_dbg_useq_sched_cfg_output_t;
61407 
61408 /*********************
61409  * hwrm_dbg_useq_run *
61410  *********************/
61411 
61412 
61413 /* hwrm_dbg_useq_run_input (size:320b/40B) */
61414 
61415 typedef struct hwrm_dbg_useq_run_input {
61416 	/* The HWRM command request type. */
61417 	uint16_t	req_type;
61418 	/*
61419 	 * The completion ring to send the completion event on. This should
61420 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61421 	 */
61422 	uint16_t	cmpl_ring;
61423 	/*
61424 	 * The sequence ID is used by the driver for tracking multiple
61425 	 * commands. This ID is treated as opaque data by the firmware and
61426 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61427 	 */
61428 	uint16_t	seq_id;
61429 	/*
61430 	 * The target ID of the command:
61431 	 * * 0x0-0xFFF8 - The function ID
61432 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61433 	 * * 0xFFFD - Reserved for user-space HWRM interface
61434 	 * * 0xFFFF - HWRM
61435 	 */
61436 	uint16_t	target_id;
61437 	/*
61438 	 * A physical address pointer pointing to a host buffer that the
61439 	 * command's response data will be written. This can be either a host
61440 	 * physical address (HPA) or a guest physical address (GPA) and must
61441 	 * point to a physically contiguous block of memory.
61442 	 */
61443 	uint64_t	resp_addr;
61444 	/* The USID to be run */
61445 	uint16_t	usid;
61446 	/* Type of run to execute for the given USID */
61447 	uint8_t	run_type;
61448 	/* This run type will execute the requested USEQ only a single time */
61449 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_SINGLE   UINT32_C(0x0)
61450 	/*
61451 	 * This run type will execute the requested USEQ a number of times given
61452 	 * by run_cnt with a run interval given by the run_interval parameter.
61453 	 */
61454 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_CNT	UINT32_C(0x1)
61455 	/*
61456 	 * This run type will execute the requested USEQ as many times as it needs
61457 	 * to fill an entire buffer to return to the host.  The runs will occur
61458 	 * with a run interval given by the run_interval parameter.
61459 	 */
61460 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF UINT32_C(0x2)
61461 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_LAST	HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF
61462 	/*
61463 	 * If indicated by flags, this represents the number of times to run the USEQ.
61464 	 * Note that runs are stopped if the buffer fills prior regardless of the
61465 	 * number of runs.  For example, if a run_cnt of 10 is specified and 3 runs
61466 	 * results in the buffer being full then only 3 runs are executed.
61467 	 */
61468 	uint8_t	run_cnt;
61469 	/*
61470 	 * This value represents microseconds between runs of the USEQ when running
61471 	 * multiple times as indicated by flags.
61472 	 */
61473 	uint32_t	run_interval;
61474 	/* Address of the host buffer where collected USEQ output data will be placed */
61475 	uint64_t	host_dest_addr;
61476 	/*
61477 	 * Size, in bytes, of the memory associated with host_dest_addr.  It is expected
61478 	 * that this is >= 4096
61479 	 */
61480 	uint32_t	host_dest_len;
61481 	/* This field is reserved */
61482 	uint32_t	unused_0;
61483 } hwrm_dbg_useq_run_input_t, *phwrm_dbg_useq_run_input_t;
61484 
61485 /* hwrm_dbg_useq_run_output (size:256b/32B) */
61486 
61487 typedef struct hwrm_dbg_useq_run_output {
61488 	/* The specific error status for the command. */
61489 	uint16_t	error_code;
61490 	/* The HWRM command request type. */
61491 	uint16_t	req_type;
61492 	/* The sequence ID from the original command. */
61493 	uint16_t	seq_id;
61494 	/* The length of the response data in number of bytes. */
61495 	uint16_t	resp_len;
61496 	/* Non-zero firmware timestamp */
61497 	uint32_t	nz_fw_timestamp;
61498 	/* The last selected USID */
61499 	uint16_t	last_usid;
61500 	/* The number of USEQs currently allocated */
61501 	uint16_t	num_useq_allocd;
61502 	/* Flags indicating current USEQ engine state */
61503 	uint32_t	useq_resp_flags;
61504 	/* When set, there is at least some data available to be delivered */
61505 	#define HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61506 	/* When set, all internal buffers are full */
61507 	#define HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61508 	#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
61509 	/* Current count of the number of full buffers available for delivery */
61510 	uint8_t	full_cnt;
61511 	/* Reserved */
61512 	uint8_t	useq_resp_unused_0[3];
61513 	/*
61514 	 * The length, in bytes, of the amount of data placed in the corresponding
61515 	 * host_dest_addr given in the input message.  This will always be a multiple
61516 	 * of 4096
61517 	 */
61518 	uint32_t	host_dest_filled_len;
61519 	/*
61520 	 * This field is used in Output records to indicate that the output
61521 	 * is completely written to RAM.  This field should be read as '1'
61522 	 * to indicate that the output has been completely written.
61523 	 * When writing a command completion or response to an internal processor,
61524 	 * the order of writes has to be such that this field is written last.
61525 	 */
61526 	uint32_t	valid;
61527 } hwrm_dbg_useq_run_output_t, *phwrm_dbg_useq_run_output_t;
61528 
61529 /******************************
61530  * hwrm_dbg_useq_delivery_req *
61531  ******************************/
61532 
61533 
61534 /* hwrm_dbg_useq_delivery_req_input (size:896b/112B) */
61535 
61536 typedef struct hwrm_dbg_useq_delivery_req_input {
61537 	/* The HWRM command request type. */
61538 	uint16_t	req_type;
61539 	/*
61540 	 * The completion ring to send the completion event on. This should
61541 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61542 	 */
61543 	uint16_t	cmpl_ring;
61544 	/*
61545 	 * The sequence ID is used by the driver for tracking multiple
61546 	 * commands. This ID is treated as opaque data by the firmware and
61547 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61548 	 */
61549 	uint16_t	seq_id;
61550 	/*
61551 	 * The target ID of the command:
61552 	 * * 0x0-0xFFF8 - The function ID
61553 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61554 	 * * 0xFFFD - Reserved for user-space HWRM interface
61555 	 * * 0xFFFF - HWRM
61556 	 */
61557 	uint16_t	target_id;
61558 	/*
61559 	 * A physical address pointer pointing to a host buffer that the
61560 	 * command's response data will be written. This can be either a host
61561 	 * physical address (HPA) or a guest physical address (GPA) and must
61562 	 * point to a physically contiguous block of memory.
61563 	 */
61564 	uint64_t	resp_addr;
61565 	/*
61566 	 * Eight destination addresses provide host memory space for FW to deliver
61567 	 * USEQ output details.  A value of 0x0 for the address can be used to
61568 	 * inform FW that the buffer is not available.
61569 	 */
61570 	uint64_t	host_dest_addrs[8];
61571 	/*
61572 	 * The length, in bytes, of the corresponding host_dest_addrs array entry.  Each
61573 	 * valid hist_dest_addrs entry must have a len of at least 4096 bytes
61574 	 */
61575 	uint32_t	host_dest_len[8];
61576 } hwrm_dbg_useq_delivery_req_input_t, *phwrm_dbg_useq_delivery_req_input_t;
61577 
61578 /* hwrm_dbg_useq_delivery_req_output (size:512b/64B) */
61579 
61580 typedef struct hwrm_dbg_useq_delivery_req_output {
61581 	/* The specific error status for the command. */
61582 	uint16_t	error_code;
61583 	/* The HWRM command request type. */
61584 	uint16_t	req_type;
61585 	/* The sequence ID from the original command. */
61586 	uint16_t	seq_id;
61587 	/* The length of the response data in number of bytes. */
61588 	uint16_t	resp_len;
61589 	/* Non-zero firmware timestamp */
61590 	uint32_t	nz_fw_timestamp;
61591 	/* The last selected USID */
61592 	uint16_t	last_usid;
61593 	/* The number of USEQs currently allocated */
61594 	uint16_t	num_useq_allocd;
61595 	/* Flags indicating current USEQ engine state */
61596 	uint32_t	useq_resp_flags;
61597 	/* When set, there is at least some data available to be delivered */
61598 	#define HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
61599 	/* When set, all internal buffers are full */
61600 	#define HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
61601 	#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
61602 	/* Current count of the number of full buffers available for delivery */
61603 	uint8_t	full_cnt;
61604 	/* Reserved */
61605 	uint8_t	useq_resp_unused_0[3];
61606 	/*
61607 	 * The length, in bytes, of the amount of data placed in the corresponding
61608 	 * host_dest_addrs entry given in the input message.  This will always be a
61609 	 * multiple of 4096
61610 	 */
61611 	uint32_t	host_dest_filled_len[8];
61612 	/* This field is reserved */
61613 	uint32_t	unused_0;
61614 	/*
61615 	 * This field is used in Output records to indicate that the output
61616 	 * is completely written to RAM.  This field should be read as '1'
61617 	 * to indicate that the output has been completely written.
61618 	 * When writing a command completion or response to an internal processor,
61619 	 * the order of writes has to be such that this field is written last.
61620 	 */
61621 	uint32_t	valid;
61622 } hwrm_dbg_useq_delivery_req_output_t, *phwrm_dbg_useq_delivery_req_output_t;
61623 
61624 /**************************
61625  * hwrm_nvm_raw_write_blk *
61626  **************************/
61627 
61628 
61629 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
61630 
61631 typedef struct hwrm_nvm_raw_write_blk_input {
61632 	/* The HWRM command request type. */
61633 	uint16_t	req_type;
61634 	/*
61635 	 * The completion ring to send the completion event on. This should
61636 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61637 	 */
61638 	uint16_t	cmpl_ring;
61639 	/*
61640 	 * The sequence ID is used by the driver for tracking multiple
61641 	 * commands. This ID is treated as opaque data by the firmware and
61642 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61643 	 */
61644 	uint16_t	seq_id;
61645 	/*
61646 	 * The target ID of the command:
61647 	 * * 0x0-0xFFF8 - The function ID
61648 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61649 	 * * 0xFFFD - Reserved for user-space HWRM interface
61650 	 * * 0xFFFF - HWRM
61651 	 */
61652 	uint16_t	target_id;
61653 	/*
61654 	 * A physical address pointer pointing to a host buffer that the
61655 	 * command's response data will be written. This can be either a host
61656 	 * physical address (HPA) or a guest physical address (GPA) and must
61657 	 * point to a physically contiguous block of memory.
61658 	 */
61659 	uint64_t	resp_addr;
61660 	/*
61661 	 * 64-bit Host Source Address.
61662 	 * This is the location of the source data to be written.
61663 	 */
61664 	uint64_t	host_src_addr;
61665 	/*
61666 	 * 32-bit Destination Address.
61667 	 * This is the NVRAM byte-offset where the source data will be written to.
61668 	 */
61669 	uint32_t	dest_addr;
61670 	/* Length of data to be written, in bytes. */
61671 	uint32_t	len;
61672 } hwrm_nvm_raw_write_blk_input_t, *phwrm_nvm_raw_write_blk_input_t;
61673 
61674 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
61675 
61676 typedef struct hwrm_nvm_raw_write_blk_output {
61677 	/* The specific error status for the command. */
61678 	uint16_t	error_code;
61679 	/* The HWRM command request type. */
61680 	uint16_t	req_type;
61681 	/* The sequence ID from the original command. */
61682 	uint16_t	seq_id;
61683 	/* The length of the response data in number of bytes. */
61684 	uint16_t	resp_len;
61685 	uint8_t	unused_0[7];
61686 	/*
61687 	 * This field is used in Output records to indicate that the output
61688 	 * is completely written to RAM.  This field should be read as '1'
61689 	 * to indicate that the output has been completely written.
61690 	 * When writing a command completion or response to an internal processor,
61691 	 * the order of writes has to be such that this field is written last.
61692 	 */
61693 	uint8_t	valid;
61694 } hwrm_nvm_raw_write_blk_output_t, *phwrm_nvm_raw_write_blk_output_t;
61695 
61696 /*****************
61697  * hwrm_nvm_read *
61698  *****************/
61699 
61700 
61701 /* hwrm_nvm_read_input (size:320b/40B) */
61702 
61703 typedef struct hwrm_nvm_read_input {
61704 	/* The HWRM command request type. */
61705 	uint16_t	req_type;
61706 	/*
61707 	 * The completion ring to send the completion event on. This should
61708 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61709 	 */
61710 	uint16_t	cmpl_ring;
61711 	/*
61712 	 * The sequence ID is used by the driver for tracking multiple
61713 	 * commands. This ID is treated as opaque data by the firmware and
61714 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61715 	 */
61716 	uint16_t	seq_id;
61717 	/*
61718 	 * The target ID of the command:
61719 	 * * 0x0-0xFFF8 - The function ID
61720 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61721 	 * * 0xFFFD - Reserved for user-space HWRM interface
61722 	 * * 0xFFFF - HWRM
61723 	 */
61724 	uint16_t	target_id;
61725 	/*
61726 	 * A physical address pointer pointing to a host buffer that the
61727 	 * command's response data will be written. This can be either a host
61728 	 * physical address (HPA) or a guest physical address (GPA) and must
61729 	 * point to a physically contiguous block of memory.
61730 	 */
61731 	uint64_t	resp_addr;
61732 	/*
61733 	 * 64-bit Host Destination Address.
61734 	 * This is the host address where the data will be written to.
61735 	 */
61736 	uint64_t	host_dest_addr;
61737 	/* The 0-based index of the directory entry. */
61738 	uint16_t	dir_idx;
61739 	uint8_t	unused_0[2];
61740 	/* The NVRAM byte-offset to read from. */
61741 	uint32_t	offset;
61742 	/* The length of the data to be read, in bytes. */
61743 	uint32_t	len;
61744 	uint8_t	unused_1[4];
61745 } hwrm_nvm_read_input_t, *phwrm_nvm_read_input_t;
61746 
61747 /* hwrm_nvm_read_output (size:128b/16B) */
61748 
61749 typedef struct hwrm_nvm_read_output {
61750 	/* The specific error status for the command. */
61751 	uint16_t	error_code;
61752 	/* The HWRM command request type. */
61753 	uint16_t	req_type;
61754 	/* The sequence ID from the original command. */
61755 	uint16_t	seq_id;
61756 	/* The length of the response data in number of bytes. */
61757 	uint16_t	resp_len;
61758 	uint8_t	unused_0[7];
61759 	/*
61760 	 * This field is used in Output records to indicate that the output
61761 	 * is completely written to RAM.  This field should be read as '1'
61762 	 * to indicate that the output has been completely written.
61763 	 * When writing a command completion or response to an internal processor,
61764 	 * the order of writes has to be such that this field is written last.
61765 	 */
61766 	uint8_t	valid;
61767 } hwrm_nvm_read_output_t, *phwrm_nvm_read_output_t;
61768 
61769 /*********************
61770  * hwrm_nvm_raw_dump *
61771  *********************/
61772 
61773 
61774 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
61775 
61776 typedef struct hwrm_nvm_raw_dump_input {
61777 	/* The HWRM command request type. */
61778 	uint16_t	req_type;
61779 	/*
61780 	 * The completion ring to send the completion event on. This should
61781 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61782 	 */
61783 	uint16_t	cmpl_ring;
61784 	/*
61785 	 * The sequence ID is used by the driver for tracking multiple
61786 	 * commands. This ID is treated as opaque data by the firmware and
61787 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61788 	 */
61789 	uint16_t	seq_id;
61790 	/*
61791 	 * The target ID of the command:
61792 	 * * 0x0-0xFFF8 - The function ID
61793 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61794 	 * * 0xFFFD - Reserved for user-space HWRM interface
61795 	 * * 0xFFFF - HWRM
61796 	 */
61797 	uint16_t	target_id;
61798 	/*
61799 	 * A physical address pointer pointing to a host buffer that the
61800 	 * command's response data will be written. This can be either a host
61801 	 * physical address (HPA) or a guest physical address (GPA) and must
61802 	 * point to a physically contiguous block of memory.
61803 	 */
61804 	uint64_t	resp_addr;
61805 	/*
61806 	 * 64-bit Host Destination Address.
61807 	 * This is the host address where the data will be written to.
61808 	 */
61809 	uint64_t	host_dest_addr;
61810 	/* 32-bit NVRAM byte-offset to read from. */
61811 	uint32_t	offset;
61812 	/* Total length of NVRAM contents to be read, in bytes. */
61813 	uint32_t	len;
61814 } hwrm_nvm_raw_dump_input_t, *phwrm_nvm_raw_dump_input_t;
61815 
61816 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
61817 
61818 typedef struct hwrm_nvm_raw_dump_output {
61819 	/* The specific error status for the command. */
61820 	uint16_t	error_code;
61821 	/* The HWRM command request type. */
61822 	uint16_t	req_type;
61823 	/* The sequence ID from the original command. */
61824 	uint16_t	seq_id;
61825 	/* The length of the response data in number of bytes. */
61826 	uint16_t	resp_len;
61827 	uint8_t	unused_0[7];
61828 	/*
61829 	 * This field is used in Output records to indicate that the output
61830 	 * is completely written to RAM.  This field should be read as '1'
61831 	 * to indicate that the output has been completely written.
61832 	 * When writing a command completion or response to an internal processor,
61833 	 * the order of writes has to be such that this field is written last.
61834 	 */
61835 	uint8_t	valid;
61836 } hwrm_nvm_raw_dump_output_t, *phwrm_nvm_raw_dump_output_t;
61837 
61838 /****************************
61839  * hwrm_nvm_get_dir_entries *
61840  ****************************/
61841 
61842 
61843 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
61844 
61845 typedef struct hwrm_nvm_get_dir_entries_input {
61846 	/* The HWRM command request type. */
61847 	uint16_t	req_type;
61848 	/*
61849 	 * The completion ring to send the completion event on. This should
61850 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61851 	 */
61852 	uint16_t	cmpl_ring;
61853 	/*
61854 	 * The sequence ID is used by the driver for tracking multiple
61855 	 * commands. This ID is treated as opaque data by the firmware and
61856 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61857 	 */
61858 	uint16_t	seq_id;
61859 	/*
61860 	 * The target ID of the command:
61861 	 * * 0x0-0xFFF8 - The function ID
61862 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61863 	 * * 0xFFFD - Reserved for user-space HWRM interface
61864 	 * * 0xFFFF - HWRM
61865 	 */
61866 	uint16_t	target_id;
61867 	/*
61868 	 * A physical address pointer pointing to a host buffer that the
61869 	 * command's response data will be written. This can be either a host
61870 	 * physical address (HPA) or a guest physical address (GPA) and must
61871 	 * point to a physically contiguous block of memory.
61872 	 */
61873 	uint64_t	resp_addr;
61874 	/*
61875 	 * 64-bit Host Destination Address.
61876 	 * This is the host address where the directory will be written.
61877 	 */
61878 	uint64_t	host_dest_addr;
61879 } hwrm_nvm_get_dir_entries_input_t, *phwrm_nvm_get_dir_entries_input_t;
61880 
61881 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
61882 
61883 typedef struct hwrm_nvm_get_dir_entries_output {
61884 	/* The specific error status for the command. */
61885 	uint16_t	error_code;
61886 	/* The HWRM command request type. */
61887 	uint16_t	req_type;
61888 	/* The sequence ID from the original command. */
61889 	uint16_t	seq_id;
61890 	/* The length of the response data in number of bytes. */
61891 	uint16_t	resp_len;
61892 	uint8_t	unused_0[7];
61893 	/*
61894 	 * This field is used in Output records to indicate that the output
61895 	 * is completely written to RAM.  This field should be read as '1'
61896 	 * to indicate that the output has been completely written.
61897 	 * When writing a command completion or response to an internal processor,
61898 	 * the order of writes has to be such that this field is written last.
61899 	 */
61900 	uint8_t	valid;
61901 } hwrm_nvm_get_dir_entries_output_t, *phwrm_nvm_get_dir_entries_output_t;
61902 
61903 /*************************
61904  * hwrm_nvm_get_dir_info *
61905  *************************/
61906 
61907 
61908 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
61909 
61910 typedef struct hwrm_nvm_get_dir_info_input {
61911 	/* The HWRM command request type. */
61912 	uint16_t	req_type;
61913 	/*
61914 	 * The completion ring to send the completion event on. This should
61915 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61916 	 */
61917 	uint16_t	cmpl_ring;
61918 	/*
61919 	 * The sequence ID is used by the driver for tracking multiple
61920 	 * commands. This ID is treated as opaque data by the firmware and
61921 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61922 	 */
61923 	uint16_t	seq_id;
61924 	/*
61925 	 * The target ID of the command:
61926 	 * * 0x0-0xFFF8 - The function ID
61927 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61928 	 * * 0xFFFD - Reserved for user-space HWRM interface
61929 	 * * 0xFFFF - HWRM
61930 	 */
61931 	uint16_t	target_id;
61932 	/*
61933 	 * A physical address pointer pointing to a host buffer that the
61934 	 * command's response data will be written. This can be either a host
61935 	 * physical address (HPA) or a guest physical address (GPA) and must
61936 	 * point to a physically contiguous block of memory.
61937 	 */
61938 	uint64_t	resp_addr;
61939 } hwrm_nvm_get_dir_info_input_t, *phwrm_nvm_get_dir_info_input_t;
61940 
61941 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
61942 
61943 typedef struct hwrm_nvm_get_dir_info_output {
61944 	/* The specific error status for the command. */
61945 	uint16_t	error_code;
61946 	/* The HWRM command request type. */
61947 	uint16_t	req_type;
61948 	/* The sequence ID from the original command. */
61949 	uint16_t	seq_id;
61950 	/* The length of the response data in number of bytes. */
61951 	uint16_t	resp_len;
61952 	/* Number of directory entries in the directory. */
61953 	uint32_t	entries;
61954 	/* Size of each directory entry, in bytes. */
61955 	uint32_t	entry_length;
61956 	uint8_t	unused_0[7];
61957 	/*
61958 	 * This field is used in Output records to indicate that the output
61959 	 * is completely written to RAM.  This field should be read as '1'
61960 	 * to indicate that the output has been completely written.
61961 	 * When writing a command completion or response to an internal processor,
61962 	 * the order of writes has to be such that this field is written last.
61963 	 */
61964 	uint8_t	valid;
61965 } hwrm_nvm_get_dir_info_output_t, *phwrm_nvm_get_dir_info_output_t;
61966 
61967 /******************
61968  * hwrm_nvm_write *
61969  ******************/
61970 
61971 
61972 /* hwrm_nvm_write_input (size:448b/56B) */
61973 
61974 typedef struct hwrm_nvm_write_input {
61975 	/* The HWRM command request type. */
61976 	uint16_t	req_type;
61977 	/*
61978 	 * The completion ring to send the completion event on. This should
61979 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61980 	 */
61981 	uint16_t	cmpl_ring;
61982 	/*
61983 	 * The sequence ID is used by the driver for tracking multiple
61984 	 * commands. This ID is treated as opaque data by the firmware and
61985 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61986 	 */
61987 	uint16_t	seq_id;
61988 	/*
61989 	 * The target ID of the command:
61990 	 * * 0x0-0xFFF8 - The function ID
61991 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61992 	 * * 0xFFFD - Reserved for user-space HWRM interface
61993 	 * * 0xFFFF - HWRM
61994 	 */
61995 	uint16_t	target_id;
61996 	/*
61997 	 * A physical address pointer pointing to a host buffer that the
61998 	 * command's response data will be written. This can be either a host
61999 	 * physical address (HPA) or a guest physical address (GPA) and must
62000 	 * point to a physically contiguous block of memory.
62001 	 */
62002 	uint64_t	resp_addr;
62003 	/*
62004 	 * 64-bit Host Source Address.
62005 	 * This is where the source data is.
62006 	 */
62007 	uint64_t	host_src_addr;
62008 	/*
62009 	 * The Directory Entry Type (valid values are defined in the
62010 	 * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
62011 	 */
62012 	uint16_t	dir_type;
62013 	/*
62014 	 * Directory ordinal.
62015 	 * The 0-based instance of the combined Directory Entry Type and Extension.
62016 	 */
62017 	uint16_t	dir_ordinal;
62018 	/*
62019 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file
62020 	 * bnxnvm_defs.h).
62021 	 */
62022 	uint16_t	dir_ext;
62023 	/*
62024 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file
62025 	 * bnxnvm_defs.h).
62026 	 */
62027 	uint16_t	dir_attr;
62028 	/*
62029 	 * Length of data to write, in bytes. May be less than or equal to the
62030 	 * allocated size for the directory entry.
62031 	 * The data length stored in the directory entry will be updated to
62032 	 * reflect this value once the write is complete.
62033 	 */
62034 	uint32_t	dir_data_length;
62035 	/* Option. */
62036 	uint16_t	option;
62037 	uint16_t	flags;
62038 	/*
62039 	 * When this bit is '1', the original active image
62040 	 * will not be removed. TBD: what purpose is this?
62041 	 */
62042 	#define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG	UINT32_C(0x1)
62043 	/*
62044 	 * This flag indicates the sender wants to modify a continuous
62045 	 * NVRAM area using a batch of this HWRM requests. The
62046 	 * offset of a request must be continuous to the end of previous
62047 	 * request's. Firmware does not update the directory entry until
62048 	 * receiving the last request, which is indicated by the batch_last
62049 	 * flag. This flag is set usually when a sender does not have a
62050 	 * block of memory that is big enough to hold the entire NVRAM
62051 	 * data for send at one time.
62052 	 */
62053 	#define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_MODE		UINT32_C(0x2)
62054 	/*
62055 	 * This flag can be used only when the batch_mode flag is set. It
62056 	 * indicates this request is the last of batch requests.
62057 	 */
62058 	#define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_LAST		UINT32_C(0x4)
62059 	/*
62060 	 * The requested length of the allocated NVM for the item, in bytes.
62061 	 * This value may be greater than or equal to the specified data
62062 	 * length (dir_data_length).
62063 	 * If this value is less than the specified data length, it will be ignored.
62064 	 * The response will contain the actual allocated item length,
62065 	 * which may be greater than the requested item length.
62066 	 * The purpose for allocating more than the required number of bytes
62067 	 * for an item's data is to pre-allocate extra storage (padding) to
62068 	 * accommodate the potential future growth of an item (e.g. upgraded
62069 	 * firmware with a size increase, log growth, expanded configuration data).
62070 	 */
62071 	uint32_t	dir_item_length;
62072 	/*
62073 	 * 32-bit offset of data blob from where data is being written.
62074 	 * Only valid for batch mode. For non-batch writes 'dont care'.
62075 	 */
62076 	uint32_t	offset;
62077 	/*
62078 	 * Length of data to be written.Should be non-zero.
62079 	 * Only valid for batch mode. For non-batch writes 'dont care'.
62080 	 */
62081 	uint32_t	len;
62082 	uint32_t	unused_0;
62083 } hwrm_nvm_write_input_t, *phwrm_nvm_write_input_t;
62084 
62085 /* hwrm_nvm_write_output (size:128b/16B) */
62086 
62087 typedef struct hwrm_nvm_write_output {
62088 	/* The specific error status for the command. */
62089 	uint16_t	error_code;
62090 	/* The HWRM command request type. */
62091 	uint16_t	req_type;
62092 	/* The sequence ID from the original command. */
62093 	uint16_t	seq_id;
62094 	/* The length of the response data in number of bytes. */
62095 	uint16_t	resp_len;
62096 	/*
62097 	 * Length of the allocated NVM for the item, in bytes. The value may be
62098 	 * greater than or equal to the specified data length or the requested
62099 	 * item length.
62100 	 * The actual item length used when creating a new directory entry will
62101 	 * be a multiple of an NVM block size.
62102 	 */
62103 	uint32_t	dir_item_length;
62104 	/* The directory index of the created or modified item. */
62105 	uint16_t	dir_idx;
62106 	uint8_t	unused_0;
62107 	/*
62108 	 * This field is used in Output records to indicate that the output
62109 	 * is completely written to RAM.  This field should be read as '1'
62110 	 * to indicate that the output has been completely written.
62111 	 * When writing a command completion or response to an internal processor,
62112 	 * the order of writes has to be such that this field is written last.
62113 	 */
62114 	uint8_t	valid;
62115 } hwrm_nvm_write_output_t, *phwrm_nvm_write_output_t;
62116 
62117 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
62118 
62119 typedef struct hwrm_nvm_write_cmd_err {
62120 	/*
62121 	 * command specific error codes that goes to
62122 	 * the cmd_err field in Common HWRM Error Response.
62123 	 */
62124 	uint8_t	code;
62125 	/* Unknown error */
62126 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
62127 	/* Unable to complete operation due to fragmentation */
62128 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
62129 	/* nvm is completely full. */
62130 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
62131 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST	HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
62132 	uint8_t	unused_0[7];
62133 } hwrm_nvm_write_cmd_err_t, *phwrm_nvm_write_cmd_err_t;
62134 
62135 /*******************
62136  * hwrm_nvm_modify *
62137  *******************/
62138 
62139 
62140 /* hwrm_nvm_modify_input (size:320b/40B) */
62141 
62142 typedef struct hwrm_nvm_modify_input {
62143 	/* The HWRM command request type. */
62144 	uint16_t	req_type;
62145 	/*
62146 	 * The completion ring to send the completion event on. This should
62147 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62148 	 */
62149 	uint16_t	cmpl_ring;
62150 	/*
62151 	 * The sequence ID is used by the driver for tracking multiple
62152 	 * commands. This ID is treated as opaque data by the firmware and
62153 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62154 	 */
62155 	uint16_t	seq_id;
62156 	/*
62157 	 * The target ID of the command:
62158 	 * * 0x0-0xFFF8 - The function ID
62159 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62160 	 * * 0xFFFD - Reserved for user-space HWRM interface
62161 	 * * 0xFFFF - HWRM
62162 	 */
62163 	uint16_t	target_id;
62164 	/*
62165 	 * A physical address pointer pointing to a host buffer that the
62166 	 * command's response data will be written. This can be either a host
62167 	 * physical address (HPA) or a guest physical address (GPA) and must
62168 	 * point to a physically contiguous block of memory.
62169 	 */
62170 	uint64_t	resp_addr;
62171 	/*
62172 	 * 64-bit Host Source Address.
62173 	 * This is where the modified data is.
62174 	 */
62175 	uint64_t	host_src_addr;
62176 	/* 16-bit directory entry index. */
62177 	uint16_t	dir_idx;
62178 	uint16_t	flags;
62179 	/*
62180 	 * This flag indicates the sender wants to modify a continuous NVRAM
62181 	 * area using a batch of this HWRM requests. The offset of a request
62182 	 * must be continuous to the end of previous request's. Firmware does
62183 	 * not update the directory entry until receiving the last request,
62184 	 * which is indicated by the batch_last flag.
62185 	 * This flag is set usually when a sender does not have a block of
62186 	 * memory that is big enough to hold the entire NVRAM data for send
62187 	 * at one time.
62188 	 */
62189 	#define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE	UINT32_C(0x1)
62190 	/*
62191 	 * This flag can be used only when the batch_mode flag is set.
62192 	 * It indicates this request is the last of batch requests.
62193 	 */
62194 	#define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST	UINT32_C(0x2)
62195 	/* 32-bit NVRAM byte-offset to modify content from. */
62196 	uint32_t	offset;
62197 	/*
62198 	 * Length of data to be modified, in bytes. The length shall
62199 	 * be non-zero.
62200 	 */
62201 	uint32_t	len;
62202 	uint8_t	unused_1[4];
62203 } hwrm_nvm_modify_input_t, *phwrm_nvm_modify_input_t;
62204 
62205 /* hwrm_nvm_modify_output (size:128b/16B) */
62206 
62207 typedef struct hwrm_nvm_modify_output {
62208 	/* The specific error status for the command. */
62209 	uint16_t	error_code;
62210 	/* The HWRM command request type. */
62211 	uint16_t	req_type;
62212 	/* The sequence ID from the original command. */
62213 	uint16_t	seq_id;
62214 	/* The length of the response data in number of bytes. */
62215 	uint16_t	resp_len;
62216 	uint8_t	unused_0[7];
62217 	/*
62218 	 * This field is used in Output records to indicate that the output
62219 	 * is completely written to RAM.  This field should be read as '1'
62220 	 * to indicate that the output has been completely written.
62221 	 * When writing a command completion or response to an internal processor,
62222 	 * the order of writes has to be such that this field is written last.
62223 	 */
62224 	uint8_t	valid;
62225 } hwrm_nvm_modify_output_t, *phwrm_nvm_modify_output_t;
62226 
62227 /***************************
62228  * hwrm_nvm_find_dir_entry *
62229  ***************************/
62230 
62231 
62232 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
62233 
62234 typedef struct hwrm_nvm_find_dir_entry_input {
62235 	/* The HWRM command request type. */
62236 	uint16_t	req_type;
62237 	/*
62238 	 * The completion ring to send the completion event on. This should
62239 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62240 	 */
62241 	uint16_t	cmpl_ring;
62242 	/*
62243 	 * The sequence ID is used by the driver for tracking multiple
62244 	 * commands. This ID is treated as opaque data by the firmware and
62245 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62246 	 */
62247 	uint16_t	seq_id;
62248 	/*
62249 	 * The target ID of the command:
62250 	 * * 0x0-0xFFF8 - The function ID
62251 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62252 	 * * 0xFFFD - Reserved for user-space HWRM interface
62253 	 * * 0xFFFF - HWRM
62254 	 */
62255 	uint16_t	target_id;
62256 	/*
62257 	 * A physical address pointer pointing to a host buffer that the
62258 	 * command's response data will be written. This can be either a host
62259 	 * physical address (HPA) or a guest physical address (GPA) and must
62260 	 * point to a physically contiguous block of memory.
62261 	 */
62262 	uint64_t	resp_addr;
62263 	uint32_t	enables;
62264 	/*
62265 	 * This bit must be '1' for the dir_idx_valid field to be
62266 	 * configured.
62267 	 */
62268 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID	UINT32_C(0x1)
62269 	/* Directory Entry Index */
62270 	uint16_t	dir_idx;
62271 	/* Directory Entry (Image) Type */
62272 	uint16_t	dir_type;
62273 	/*
62274 	 * Directory ordinal.
62275 	 * The instance of this Directory Type
62276 	 */
62277 	uint16_t	dir_ordinal;
62278 	/* The Directory Entry Extension flags. */
62279 	uint16_t	dir_ext;
62280 	/* This value indicates the search option using dir_ordinal. */
62281 	uint8_t	opt_ordinal;
62282 	/* This value indicates the search option using dir_ordinal. */
62283 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
62284 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
62285 	/* Equal to specified ordinal value. */
62286 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ	UINT32_C(0x0)
62287 	/* Greater than or equal to specified ordinal value */
62288 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE	UINT32_C(0x1)
62289 	/* Greater than specified ordinal value */
62290 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT	UINT32_C(0x2)
62291 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
62292 	uint8_t	unused_0[3];
62293 } hwrm_nvm_find_dir_entry_input_t, *phwrm_nvm_find_dir_entry_input_t;
62294 
62295 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
62296 
62297 typedef struct hwrm_nvm_find_dir_entry_output {
62298 	/* The specific error status for the command. */
62299 	uint16_t	error_code;
62300 	/* The HWRM command request type. */
62301 	uint16_t	req_type;
62302 	/* The sequence ID from the original command. */
62303 	uint16_t	seq_id;
62304 	/* The length of the response data in number of bytes. */
62305 	uint16_t	resp_len;
62306 	/* Allocated NVRAM for this directory entry, in bytes. */
62307 	uint32_t	dir_item_length;
62308 	/* Size of the stored data for this directory entry, in bytes. */
62309 	uint32_t	dir_data_length;
62310 	/*
62311 	 * Firmware version.
62312 	 * Only valid if the directory entry is for embedded firmware stored
62313 	 * in APE_BIN Format.
62314 	 */
62315 	uint32_t	fw_ver;
62316 	/* Directory ordinal. */
62317 	uint16_t	dir_ordinal;
62318 	/* Directory Entry Index */
62319 	uint16_t	dir_idx;
62320 	uint8_t	unused_0[7];
62321 	/*
62322 	 * This field is used in Output records to indicate that the output
62323 	 * is completely written to RAM.  This field should be read as '1'
62324 	 * to indicate that the output has been completely written.
62325 	 * When writing a command completion or response to an internal processor,
62326 	 * the order of writes has to be such that this field is written last.
62327 	 */
62328 	uint8_t	valid;
62329 } hwrm_nvm_find_dir_entry_output_t, *phwrm_nvm_find_dir_entry_output_t;
62330 
62331 /****************************
62332  * hwrm_nvm_erase_dir_entry *
62333  ****************************/
62334 
62335 
62336 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
62337 
62338 typedef struct hwrm_nvm_erase_dir_entry_input {
62339 	/* The HWRM command request type. */
62340 	uint16_t	req_type;
62341 	/*
62342 	 * The completion ring to send the completion event on. This should
62343 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62344 	 */
62345 	uint16_t	cmpl_ring;
62346 	/*
62347 	 * The sequence ID is used by the driver for tracking multiple
62348 	 * commands. This ID is treated as opaque data by the firmware and
62349 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62350 	 */
62351 	uint16_t	seq_id;
62352 	/*
62353 	 * The target ID of the command:
62354 	 * * 0x0-0xFFF8 - The function ID
62355 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62356 	 * * 0xFFFD - Reserved for user-space HWRM interface
62357 	 * * 0xFFFF - HWRM
62358 	 */
62359 	uint16_t	target_id;
62360 	/*
62361 	 * A physical address pointer pointing to a host buffer that the
62362 	 * command's response data will be written. This can be either a host
62363 	 * physical address (HPA) or a guest physical address (GPA) and must
62364 	 * point to a physically contiguous block of memory.
62365 	 */
62366 	uint64_t	resp_addr;
62367 	/* Directory Entry Index */
62368 	uint16_t	dir_idx;
62369 	uint8_t	unused_0[6];
62370 } hwrm_nvm_erase_dir_entry_input_t, *phwrm_nvm_erase_dir_entry_input_t;
62371 
62372 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
62373 
62374 typedef struct hwrm_nvm_erase_dir_entry_output {
62375 	/* The specific error status for the command. */
62376 	uint16_t	error_code;
62377 	/* The HWRM command request type. */
62378 	uint16_t	req_type;
62379 	/* The sequence ID from the original command. */
62380 	uint16_t	seq_id;
62381 	/* The length of the response data in number of bytes. */
62382 	uint16_t	resp_len;
62383 	uint8_t	unused_0[7];
62384 	/*
62385 	 * This field is used in Output records to indicate that the output
62386 	 * is completely written to RAM.  This field should be read as '1'
62387 	 * to indicate that the output has been completely written.
62388 	 * When writing a command completion or response to an internal processor,
62389 	 * the order of writes has to be such that this field is written last.
62390 	 */
62391 	uint8_t	valid;
62392 } hwrm_nvm_erase_dir_entry_output_t, *phwrm_nvm_erase_dir_entry_output_t;
62393 
62394 /*************************
62395  * hwrm_nvm_get_dev_info *
62396  *************************/
62397 
62398 
62399 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
62400 
62401 typedef struct hwrm_nvm_get_dev_info_input {
62402 	/* The HWRM command request type. */
62403 	uint16_t	req_type;
62404 	/*
62405 	 * The completion ring to send the completion event on. This should
62406 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62407 	 */
62408 	uint16_t	cmpl_ring;
62409 	/*
62410 	 * The sequence ID is used by the driver for tracking multiple
62411 	 * commands. This ID is treated as opaque data by the firmware and
62412 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62413 	 */
62414 	uint16_t	seq_id;
62415 	/*
62416 	 * The target ID of the command:
62417 	 * * 0x0-0xFFF8 - The function ID
62418 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62419 	 * * 0xFFFD - Reserved for user-space HWRM interface
62420 	 * * 0xFFFF - HWRM
62421 	 */
62422 	uint16_t	target_id;
62423 	/*
62424 	 * A physical address pointer pointing to a host buffer that the
62425 	 * command's response data will be written. This can be either a host
62426 	 * physical address (HPA) or a guest physical address (GPA) and must
62427 	 * point to a physically contiguous block of memory.
62428 	 */
62429 	uint64_t	resp_addr;
62430 } hwrm_nvm_get_dev_info_input_t, *phwrm_nvm_get_dev_info_input_t;
62431 
62432 /* hwrm_nvm_get_dev_info_output (size:640b/80B) */
62433 
62434 typedef struct hwrm_nvm_get_dev_info_output {
62435 	/* The specific error status for the command. */
62436 	uint16_t	error_code;
62437 	/* The HWRM command request type. */
62438 	uint16_t	req_type;
62439 	/* The sequence ID from the original command. */
62440 	uint16_t	seq_id;
62441 	/* The length of the response data in number of bytes. */
62442 	uint16_t	resp_len;
62443 	/* Manufacturer ID. */
62444 	uint16_t	manufacturer_id;
62445 	/* Device ID. */
62446 	uint16_t	device_id;
62447 	/* Sector size of the NVRAM device. */
62448 	uint32_t	sector_size;
62449 	/* Total size, in bytes of the NVRAM device. */
62450 	uint32_t	nvram_size;
62451 	uint32_t	reserved_size;
62452 	/*
62453 	 * Available size that can be used, in bytes.  Available size is the
62454 	 * NVRAM size take away the used size and reserved size.
62455 	 */
62456 	uint32_t	available_size;
62457 	/* This field represents the major version of NVM cfg */
62458 	uint8_t	nvm_cfg_ver_maj;
62459 	/* This field represents the minor version of NVM cfg */
62460 	uint8_t	nvm_cfg_ver_min;
62461 	/* This field represents the update version of NVM cfg */
62462 	uint8_t	nvm_cfg_ver_upd;
62463 	uint8_t	flags;
62464 	/*
62465 	 * If set to 1, firmware will provide various firmware version
62466 	 * information stored in the flash.
62467 	 */
62468 	#define HWRM_NVM_GET_DEV_INFO_OUTPUT_FLAGS_FW_VER_VALID	UINT32_C(0x1)
62469 	/*
62470 	 * This field represents the board package name stored in the flash.
62471 	 * (ASCII chars with NULL at the end).
62472 	 */
62473 	char	pkg_name[16];
62474 	/*
62475 	 * This field represents the major version of HWRM firmware, stored in
62476 	 * the flash.
62477 	 */
62478 	uint16_t	hwrm_fw_major;
62479 	/*
62480 	 * This field represents the minor version of HWRM firmware, stored in
62481 	 * the flash.
62482 	 */
62483 	uint16_t	hwrm_fw_minor;
62484 	/*
62485 	 * This field represents the build version of HWRM firmware, stored in
62486 	 * the flash.
62487 	 */
62488 	uint16_t	hwrm_fw_build;
62489 	/*
62490 	 * This field can be used to represent firmware branches or customer
62491 	 * specific releases tied to a specific (major, minor, build) version
62492 	 * of the HWRM firmware.
62493 	 */
62494 	uint16_t	hwrm_fw_patch;
62495 	/*
62496 	 * This field represents the major version of mgmt firmware, stored in
62497 	 * the flash.
62498 	 */
62499 	uint16_t	mgmt_fw_major;
62500 	/*
62501 	 * This field represents the minor version of mgmt firmware, stored in
62502 	 * the flash.
62503 	 */
62504 	uint16_t	mgmt_fw_minor;
62505 	/*
62506 	 * This field represents the build version of mgmt firmware, stored in
62507 	 * the flash.
62508 	 */
62509 	uint16_t	mgmt_fw_build;
62510 	/*
62511 	 * This field can be used to represent firmware branches or customer
62512 	 * specific releases tied to a specific (major, minor, build) version
62513 	 * of the mgmt firmware.
62514 	 */
62515 	uint16_t	mgmt_fw_patch;
62516 	/*
62517 	 * This field represents the major version of roce firmware, stored in
62518 	 * the flash.
62519 	 */
62520 	uint16_t	roce_fw_major;
62521 	/*
62522 	 * This field represents the minor version of roce firmware, stored in
62523 	 * the flash.
62524 	 */
62525 	uint16_t	roce_fw_minor;
62526 	/*
62527 	 * This field represents the build version of roce firmware, stored in
62528 	 * the flash.
62529 	 */
62530 	uint16_t	roce_fw_build;
62531 	/*
62532 	 * This field can be used to represent firmware branches or customer
62533 	 * specific releases tied to a specific (major, minor, build) version
62534 	 * of the roce firmware.
62535 	 */
62536 	uint16_t	roce_fw_patch;
62537 	uint8_t	unused_0[7];
62538 	/*
62539 	 * This field is used in Output records to indicate that the output
62540 	 * is completely written to RAM.  This field should be read as '1'
62541 	 * to indicate that the output has been completely written.
62542 	 * When writing a command completion or response to an internal processor,
62543 	 * the order of writes has to be such that this field is written last.
62544 	 */
62545 	uint8_t	valid;
62546 } hwrm_nvm_get_dev_info_output_t, *phwrm_nvm_get_dev_info_output_t;
62547 
62548 /**************************
62549  * hwrm_nvm_mod_dir_entry *
62550  **************************/
62551 
62552 
62553 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
62554 
62555 typedef struct hwrm_nvm_mod_dir_entry_input {
62556 	/* The HWRM command request type. */
62557 	uint16_t	req_type;
62558 	/*
62559 	 * The completion ring to send the completion event on. This should
62560 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62561 	 */
62562 	uint16_t	cmpl_ring;
62563 	/*
62564 	 * The sequence ID is used by the driver for tracking multiple
62565 	 * commands. This ID is treated as opaque data by the firmware and
62566 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62567 	 */
62568 	uint16_t	seq_id;
62569 	/*
62570 	 * The target ID of the command:
62571 	 * * 0x0-0xFFF8 - The function ID
62572 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62573 	 * * 0xFFFD - Reserved for user-space HWRM interface
62574 	 * * 0xFFFF - HWRM
62575 	 */
62576 	uint16_t	target_id;
62577 	/*
62578 	 * A physical address pointer pointing to a host buffer that the
62579 	 * command's response data will be written. This can be either a host
62580 	 * physical address (HPA) or a guest physical address (GPA) and must
62581 	 * point to a physically contiguous block of memory.
62582 	 */
62583 	uint64_t	resp_addr;
62584 	uint32_t	enables;
62585 	/*
62586 	 * This bit must be '1' for the checksum field to be
62587 	 * configured.
62588 	 */
62589 	#define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM	UINT32_C(0x1)
62590 	/* Directory Entry Index */
62591 	uint16_t	dir_idx;
62592 	/*
62593 	 * Directory ordinal.
62594 	 * The (0-based) instance of this Directory Type.
62595 	 */
62596 	uint16_t	dir_ordinal;
62597 	/*
62598 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* for
62599 	 * extension flag definitions).
62600 	 */
62601 	uint16_t	dir_ext;
62602 	/*
62603 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute
62604 	 * flag definitions).
62605 	 */
62606 	uint16_t	dir_attr;
62607 	/*
62608 	 * If valid, then this field updates the checksum
62609 	 * value of the content in the directory entry.
62610 	 */
62611 	uint32_t	checksum;
62612 } hwrm_nvm_mod_dir_entry_input_t, *phwrm_nvm_mod_dir_entry_input_t;
62613 
62614 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
62615 
62616 typedef struct hwrm_nvm_mod_dir_entry_output {
62617 	/* The specific error status for the command. */
62618 	uint16_t	error_code;
62619 	/* The HWRM command request type. */
62620 	uint16_t	req_type;
62621 	/* The sequence ID from the original command. */
62622 	uint16_t	seq_id;
62623 	/* The length of the response data in number of bytes. */
62624 	uint16_t	resp_len;
62625 	uint8_t	unused_0[7];
62626 	/*
62627 	 * This field is used in Output records to indicate that the output
62628 	 * is completely written to RAM.  This field should be read as '1'
62629 	 * to indicate that the output has been completely written.
62630 	 * When writing a command completion or response to an internal processor,
62631 	 * the order of writes has to be such that this field is written last.
62632 	 */
62633 	uint8_t	valid;
62634 } hwrm_nvm_mod_dir_entry_output_t, *phwrm_nvm_mod_dir_entry_output_t;
62635 
62636 /**************************
62637  * hwrm_nvm_verify_update *
62638  **************************/
62639 
62640 
62641 /* hwrm_nvm_verify_update_input (size:192b/24B) */
62642 
62643 typedef struct hwrm_nvm_verify_update_input {
62644 	/* The HWRM command request type. */
62645 	uint16_t	req_type;
62646 	/*
62647 	 * The completion ring to send the completion event on. This should
62648 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62649 	 */
62650 	uint16_t	cmpl_ring;
62651 	/*
62652 	 * The sequence ID is used by the driver for tracking multiple
62653 	 * commands. This ID is treated as opaque data by the firmware and
62654 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62655 	 */
62656 	uint16_t	seq_id;
62657 	/*
62658 	 * The target ID of the command:
62659 	 * * 0x0-0xFFF8 - The function ID
62660 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62661 	 * * 0xFFFD - Reserved for user-space HWRM interface
62662 	 * * 0xFFFF - HWRM
62663 	 */
62664 	uint16_t	target_id;
62665 	/*
62666 	 * A physical address pointer pointing to a host buffer that the
62667 	 * command's response data will be written. This can be either a host
62668 	 * physical address (HPA) or a guest physical address (GPA) and must
62669 	 * point to a physically contiguous block of memory.
62670 	 */
62671 	uint64_t	resp_addr;
62672 	/* Directory Entry Type, to be verified. */
62673 	uint16_t	dir_type;
62674 	/*
62675 	 * Directory ordinal.
62676 	 * The instance of the Directory Type to be verified.
62677 	 */
62678 	uint16_t	dir_ordinal;
62679 	/*
62680 	 * The Directory Entry Extension flags.
62681 	 * The "UPDATE" extension flag must be set in this value.
62682 	 * A corresponding directory entry with the same type and ordinal
62683 	 * values but *without*
62684 	 * the "UPDATE" extension flag must also exist. The other flags of
62685 	 * the extension must
62686 	 * be identical between the active and update entries.
62687 	 */
62688 	uint16_t	dir_ext;
62689 	uint8_t	unused_0[2];
62690 } hwrm_nvm_verify_update_input_t, *phwrm_nvm_verify_update_input_t;
62691 
62692 /* hwrm_nvm_verify_update_output (size:128b/16B) */
62693 
62694 typedef struct hwrm_nvm_verify_update_output {
62695 	/* The specific error status for the command. */
62696 	uint16_t	error_code;
62697 	/* The HWRM command request type. */
62698 	uint16_t	req_type;
62699 	/* The sequence ID from the original command. */
62700 	uint16_t	seq_id;
62701 	/* The length of the response data in number of bytes. */
62702 	uint16_t	resp_len;
62703 	uint8_t	unused_0[7];
62704 	/*
62705 	 * This field is used in Output records to indicate that the output
62706 	 * is completely written to RAM.  This field should be read as '1'
62707 	 * to indicate that the output has been completely written.
62708 	 * When writing a command completion or response to an internal processor,
62709 	 * the order of writes has to be such that this field is written last.
62710 	 */
62711 	uint8_t	valid;
62712 } hwrm_nvm_verify_update_output_t, *phwrm_nvm_verify_update_output_t;
62713 
62714 /***************************
62715  * hwrm_nvm_install_update *
62716  ***************************/
62717 
62718 
62719 /* hwrm_nvm_install_update_input (size:192b/24B) */
62720 
62721 typedef struct hwrm_nvm_install_update_input {
62722 	/* The HWRM command request type. */
62723 	uint16_t	req_type;
62724 	/*
62725 	 * The completion ring to send the completion event on. This should
62726 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62727 	 */
62728 	uint16_t	cmpl_ring;
62729 	/*
62730 	 * The sequence ID is used by the driver for tracking multiple
62731 	 * commands. This ID is treated as opaque data by the firmware and
62732 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62733 	 */
62734 	uint16_t	seq_id;
62735 	/*
62736 	 * The target ID of the command:
62737 	 * * 0x0-0xFFF8 - The function ID
62738 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62739 	 * * 0xFFFD - Reserved for user-space HWRM interface
62740 	 * * 0xFFFF - HWRM
62741 	 */
62742 	uint16_t	target_id;
62743 	/*
62744 	 * A physical address pointer pointing to a host buffer that the
62745 	 * command's response data will be written. This can be either a host
62746 	 * physical address (HPA) or a guest physical address (GPA) and must
62747 	 * point to a physically contiguous block of memory.
62748 	 */
62749 	uint64_t	resp_addr;
62750 	/*
62751 	 * Installation type. If the value 3 through 0xffff is used,
62752 	 * only packaged items with that type value will be installed and
62753 	 * conditional installation directives for those packaged items
62754 	 * will be over-ridden (i.e. 'create' or 'replace' will be treated
62755 	 * as 'install').
62756 	 */
62757 	uint32_t	install_type;
62758 	/*
62759 	 * Perform a normal package installation. Conditional installation
62760 	 * directives (e.g. 'create' and 'replace') of packaged items
62761 	 * will be followed.
62762 	 */
62763 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
62764 	/*
62765 	 * Install all packaged items regardless of installation directive
62766 	 * (i.e. treat all packaged items as though they have an installation
62767 	 * directive of 'install').
62768 	 */
62769 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL	UINT32_C(0xffffffff)
62770 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST  HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
62771 	uint16_t	flags;
62772 	/*
62773 	 * If set to 1, then securely erase all unused locations in
62774 	 * persistent storage.
62775 	 */
62776 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE	UINT32_C(0x1)
62777 	/*
62778 	 * If set to 1, then unspecified images, images not in the package
62779 	 * file, will be safely deleted.
62780 	 * When combined with erase_unused_space then unspecified images will
62781 	 * be securely erased.
62782 	 */
62783 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG	UINT32_C(0x2)
62784 	/*
62785 	 * If set to 1, FW will defragment the NVM if defragmentation is
62786 	 * required for the update.
62787 	 * Allow additional time for this command to complete if this bit is
62788 	 * set to 1.
62789 	 */
62790 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG	UINT32_C(0x4)
62791 	/*
62792 	 * If set to 1, FW will verify the package in the "UPDATE" NVM item
62793 	 * without installing it. This flag is for FW internal use only.
62794 	 * Users should not set this flag. The request will otherwise fail.
62795 	 */
62796 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY		UINT32_C(0x8)
62797 	uint8_t	unused_0[2];
62798 } hwrm_nvm_install_update_input_t, *phwrm_nvm_install_update_input_t;
62799 
62800 /* hwrm_nvm_install_update_output (size:192b/24B) */
62801 
62802 typedef struct hwrm_nvm_install_update_output {
62803 	/* The specific error status for the command. */
62804 	uint16_t	error_code;
62805 	/* The HWRM command request type. */
62806 	uint16_t	req_type;
62807 	/* The sequence ID from the original command. */
62808 	uint16_t	seq_id;
62809 	/* The length of the response data in number of bytes. */
62810 	uint16_t	resp_len;
62811 	/*
62812 	 * Bit-mask of successfully installed items.
62813 	 * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
62814 	 * A value of 0 indicates that no items were successfully installed.
62815 	 */
62816 	uint64_t	installed_items;
62817 	/* result is 8 b corresponding to BCMRETVAL error codes */
62818 	uint8_t	result;
62819 	/* There was no problem with the package installation. */
62820 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS			UINT32_C(0x0)
62821 	/* Generic failure */
62822 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_FAILURE			UINT32_C(0xff)
62823 	/* Allocation error malloc failure */
62824 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_MALLOC_FAILURE		UINT32_C(0xfd)
62825 	/* NVM install error due to invalid index */
62826 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_INDEX_PARAMETER	UINT32_C(0xfb)
62827 	/* NVM install error due to invalid type */
62828 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TYPE_PARAMETER	UINT32_C(0xf3)
62829 	/* Invalid package due to invalid prerequisite */
62830 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PREREQUISITE	UINT32_C(0xf2)
62831 	/* Invalid package due to invalid file header */
62832 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_FILE_HEADER	UINT32_C(0xec)
62833 	/* Invalid package due to invalid format */
62834 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_SIGNATURE		UINT32_C(0xeb)
62835 	/* Invalid package due to invalid property stream */
62836 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_STREAM	UINT32_C(0xea)
62837 	/* Invalid package due to invalid property length */
62838 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_LENGTH	UINT32_C(0xe9)
62839 	/* Invalid package due to invalid manifest */
62840 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_MANIFEST		UINT32_C(0xe8)
62841 	/* Invalid package due to invalid trailer */
62842 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TRAILER		UINT32_C(0xe7)
62843 	/* Invalid package due to invalid checksum */
62844 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_CHECKSUM		UINT32_C(0xe6)
62845 	/* Invalid package due to invalid item checksum */
62846 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_ITEM_CHECKSUM	UINT32_C(0xe5)
62847 	/* Invalid package due to invalid length */
62848 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DATA_LENGTH	UINT32_C(0xe4)
62849 	/* Invalid package due to invalid directive */
62850 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DIRECTIVE		UINT32_C(0xe1)
62851 	/* Invalid device due to unsupported chip revision */
62852 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_CHIP_REV	UINT32_C(0xce)
62853 	/* Invalid device due to unsupported device ID */
62854 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_DEVICE_ID	UINT32_C(0xcd)
62855 	/* Invalid device due to unsupported subsystem vendor */
62856 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_VENDOR	UINT32_C(0xcc)
62857 	/* Invalid device due to unsupported subsystem ID */
62858 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_ID	UINT32_C(0xcb)
62859 	/* Invalid device due to unsupported product ID or customer ID */
62860 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_PLATFORM	UINT32_C(0xc5)
62861 	/* Invalid package due to duplicate item */
62862 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_DUPLICATE_ITEM		UINT32_C(0xc4)
62863 	/* Invalid package due to zero length item */
62864 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ZERO_LENGTH_ITEM		UINT32_C(0xc3)
62865 	/* NVM integrity error checksum */
62866 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_CHECKSUM_ERROR	UINT32_C(0xb9)
62867 	/* NVM integrity error */
62868 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_DATA_ERROR	UINT32_C(0xb8)
62869 	/* Authentication error */
62870 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_AUTHENTICATION_ERROR UINT32_C(0xb7)
62871 	/* NVM install error item not found */
62872 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_NOT_FOUND		UINT32_C(0xb0)
62873 	/* NVM install error item locked */
62874 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED		UINT32_C(0xa7)
62875 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST			HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED
62876 	/* problem_item is 8 b */
62877 	uint8_t	problem_item;
62878 	/* There was no problem with any packaged items. */
62879 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE	UINT32_C(0x0)
62880 	/* There was a problem with the NVM package itself. */
62881 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE UINT32_C(0xff)
62882 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST   HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
62883 	/* reset_required is 8 b */
62884 	uint8_t	reset_required;
62885 	/*
62886 	 * No reset is required for installed/updated firmware or
62887 	 * microcode to take effect.
62888 	 */
62889 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE  UINT32_C(0x0)
62890 	/*
62891 	 * A PCIe reset (e.g. system reboot) is
62892 	 * required for newly installed/updated firmware or
62893 	 * microcode to take effect.
62894 	 */
62895 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI   UINT32_C(0x1)
62896 	/*
62897 	 * A controller power reset (e.g. system power-cycle) is
62898 	 * required for newly installed/updated firmware or
62899 	 * microcode to take effect. Some newly installed/updated
62900 	 * firmware or microcode may still take effect upon the
62901 	 * next PCIe reset.
62902 	 */
62903 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER UINT32_C(0x2)
62904 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
62905 	uint8_t	unused_0[4];
62906 	/*
62907 	 * This field is used in Output records to indicate that the output
62908 	 * is completely written to RAM.  This field should be read as '1'
62909 	 * to indicate that the output has been completely written.
62910 	 * When writing a command completion or response to an internal processor,
62911 	 * the order of writes has to be such that this field is written last.
62912 	 */
62913 	uint8_t	valid;
62914 } hwrm_nvm_install_update_output_t, *phwrm_nvm_install_update_output_t;
62915 
62916 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
62917 
62918 typedef struct hwrm_nvm_install_update_cmd_err {
62919 	/*
62920 	 * command specific error codes that goes to
62921 	 * the cmd_err field in Common HWRM Error Response.
62922 	 */
62923 	uint8_t	code;
62924 	/* Unknown error */
62925 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
62926 	/* Unable to complete operation due to fragmentation */
62927 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR	UINT32_C(0x1)
62928 	/* nvm is completely full. */
62929 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE	UINT32_C(0x2)
62930 	/* Firmware update failed due to Anti-rollback. */
62931 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK	UINT32_C(0x3)
62932 	/* Firmware update does not support voltage regulators on the device. */
62933 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_VOLTREG_SUPPORT UINT32_C(0x4)
62934 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST		HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_VOLTREG_SUPPORT
62935 	uint8_t	unused_0[7];
62936 } hwrm_nvm_install_update_cmd_err_t, *phwrm_nvm_install_update_cmd_err_t;
62937 
62938 /******************
62939  * hwrm_nvm_flush *
62940  ******************/
62941 
62942 
62943 /* hwrm_nvm_flush_input (size:128b/16B) */
62944 
62945 typedef struct hwrm_nvm_flush_input {
62946 	/* The HWRM command request type. */
62947 	uint16_t	req_type;
62948 	/*
62949 	 * The completion ring to send the completion event on. This should
62950 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62951 	 */
62952 	uint16_t	cmpl_ring;
62953 	/*
62954 	 * The sequence ID is used by the driver for tracking multiple
62955 	 * commands. This ID is treated as opaque data by the firmware and
62956 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62957 	 */
62958 	uint16_t	seq_id;
62959 	/*
62960 	 * The target ID of the command:
62961 	 * * 0x0-0xFFF8 - The function ID
62962 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62963 	 * * 0xFFFD - Reserved for user-space HWRM interface
62964 	 * * 0xFFFF - HWRM
62965 	 */
62966 	uint16_t	target_id;
62967 	/*
62968 	 * A physical address pointer pointing to a host buffer that the
62969 	 * command's response data will be written. This can be either a host
62970 	 * physical address (HPA) or a guest physical address (GPA) and must
62971 	 * point to a physically contiguous block of memory.
62972 	 */
62973 	uint64_t	resp_addr;
62974 } hwrm_nvm_flush_input_t, *phwrm_nvm_flush_input_t;
62975 
62976 /* hwrm_nvm_flush_output (size:128b/16B) */
62977 
62978 typedef struct hwrm_nvm_flush_output {
62979 	/* The specific error status for the command. */
62980 	uint16_t	error_code;
62981 	/* The HWRM command request type. */
62982 	uint16_t	req_type;
62983 	/* The sequence ID from the original command. */
62984 	uint16_t	seq_id;
62985 	/* The length of the response data in number of bytes. */
62986 	uint16_t	resp_len;
62987 	uint8_t	unused_0[7];
62988 	/*
62989 	 * This field is used in Output records to indicate that the output
62990 	 * is completely written to RAM.  This field should be read as '1'
62991 	 * to indicate that the output has been completely written.
62992 	 * When writing a command completion or response to an internal processor,
62993 	 * the order of writes has to be such that this field is written last.
62994 	 */
62995 	uint8_t	valid;
62996 } hwrm_nvm_flush_output_t, *phwrm_nvm_flush_output_t;
62997 
62998 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
62999 
63000 typedef struct hwrm_nvm_flush_cmd_err {
63001 	/*
63002 	 * command specific error codes that goes to
63003 	 * the cmd_err field in Common HWRM Error Response.
63004 	 */
63005 	uint8_t	code;
63006 	/* Unknown error */
63007 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
63008 	/* flush could not be performed */
63009 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL	UINT32_C(0x1)
63010 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST   HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
63011 	uint8_t	unused_0[7];
63012 } hwrm_nvm_flush_cmd_err_t, *phwrm_nvm_flush_cmd_err_t;
63013 
63014 /*************************
63015  * hwrm_nvm_get_variable *
63016  *************************/
63017 
63018 
63019 /* hwrm_nvm_get_variable_input (size:320b/40B) */
63020 
63021 typedef struct hwrm_nvm_get_variable_input {
63022 	/* The HWRM command request type. */
63023 	uint16_t	req_type;
63024 	/*
63025 	 * The completion ring to send the completion event on. This should
63026 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63027 	 */
63028 	uint16_t	cmpl_ring;
63029 	/*
63030 	 * The sequence ID is used by the driver for tracking multiple
63031 	 * commands. This ID is treated as opaque data by the firmware and
63032 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63033 	 */
63034 	uint16_t	seq_id;
63035 	/*
63036 	 * The target ID of the command:
63037 	 * * 0x0-0xFFF8 - The function ID
63038 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63039 	 * * 0xFFFD - Reserved for user-space HWRM interface
63040 	 * * 0xFFFF - HWRM
63041 	 */
63042 	uint16_t	target_id;
63043 	/*
63044 	 * A physical address pointer pointing to a host buffer that the
63045 	 * command's response data will be written. This can be either a host
63046 	 * physical address (HPA) or a guest physical address (GPA) and must
63047 	 * point to a physically contiguous block of memory.
63048 	 */
63049 	uint64_t	resp_addr;
63050 	/*
63051 	 * This is the host address where
63052 	 * nvm variable will be stored
63053 	 */
63054 	uint64_t	dest_data_addr;
63055 	/* size of data in bits */
63056 	uint16_t	data_len;
63057 	/* nvm cfg option number */
63058 	uint16_t	option_num;
63059 	/* reserved. */
63060 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
63061 	/* reserved. */
63062 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
63063 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST	HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
63064 	/*
63065 	 * Number of dimensions for this nvm configuration variable.
63066 	 * This value indicates how many of the indexN values to use.
63067 	 * A value of 0 means that none of the indexN values are valid.
63068 	 * A value of 1 requires at index0 is valued, a value of 2
63069 	 * requires that index0 and index1 are valid, and so forth
63070 	 */
63071 	uint16_t	dimensions;
63072 	/* index for the 1st dimensions */
63073 	uint16_t	index_0;
63074 	/* index for the 2nd dimensions */
63075 	uint16_t	index_1;
63076 	/* index for the 3rd dimensions */
63077 	uint16_t	index_2;
63078 	/* index for the 4th dimensions */
63079 	uint16_t	index_3;
63080 	uint8_t	flags;
63081 	/*
63082 	 * When this bit is set to 1, the factory default value will be returned,
63083 	 * 0 returns the operational value.
63084 	 */
63085 	#define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT	UINT32_C(0x1)
63086 	uint8_t	unused_0;
63087 } hwrm_nvm_get_variable_input_t, *phwrm_nvm_get_variable_input_t;
63088 
63089 /* hwrm_nvm_get_variable_output (size:128b/16B) */
63090 
63091 typedef struct hwrm_nvm_get_variable_output {
63092 	/* The specific error status for the command. */
63093 	uint16_t	error_code;
63094 	/* The HWRM command request type. */
63095 	uint16_t	req_type;
63096 	/* The sequence ID from the original command. */
63097 	uint16_t	seq_id;
63098 	/* The length of the response data in number of bytes. */
63099 	uint16_t	resp_len;
63100 	/* size of data of the actual variable retrieved in bits */
63101 	uint16_t	data_len;
63102 	/*
63103 	 * option_num is the option number for the data retrieved. It is
63104 	 * possible in the future that the option number returned would be
63105 	 * different than requested. This condition could occur if an option is
63106 	 * deprecated and a new option id is defined with similar
63107 	 * characteristics, but has a slightly different definition. This
63108 	 * also makes it convenient for the caller to identify the variable
63109 	 * result with the option id from the response.
63110 	 */
63111 	uint16_t	option_num;
63112 	/* reserved. */
63113 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
63114 	/* reserved. */
63115 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
63116 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST	HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
63117 	uint8_t	unused_0[3];
63118 	/*
63119 	 * This field is used in Output records to indicate that the output
63120 	 * is completely written to RAM.  This field should be read as '1'
63121 	 * to indicate that the output has been completely written.
63122 	 * When writing a command completion or response to an internal processor,
63123 	 * the order of writes has to be such that this field is written last.
63124 	 */
63125 	uint8_t	valid;
63126 } hwrm_nvm_get_variable_output_t, *phwrm_nvm_get_variable_output_t;
63127 
63128 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
63129 
63130 typedef struct hwrm_nvm_get_variable_cmd_err {
63131 	/*
63132 	 * command specific error codes that goes to
63133 	 * the cmd_err field in Common HWRM Error Response.
63134 	 */
63135 	uint8_t	code;
63136 	/* Unknown error */
63137 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
63138 	/* variable does not exist */
63139 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
63140 	/* configuration is corrupted and the variable cannot be saved */
63141 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
63142 	/* length specified is too small */
63143 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
63144 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST	HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
63145 	uint8_t	unused_0[7];
63146 } hwrm_nvm_get_variable_cmd_err_t, *phwrm_nvm_get_variable_cmd_err_t;
63147 
63148 /*************************
63149  * hwrm_nvm_set_variable *
63150  *************************/
63151 
63152 
63153 /* hwrm_nvm_set_variable_input (size:320b/40B) */
63154 
63155 typedef struct hwrm_nvm_set_variable_input {
63156 	/* The HWRM command request type. */
63157 	uint16_t	req_type;
63158 	/*
63159 	 * The completion ring to send the completion event on. This should
63160 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63161 	 */
63162 	uint16_t	cmpl_ring;
63163 	/*
63164 	 * The sequence ID is used by the driver for tracking multiple
63165 	 * commands. This ID is treated as opaque data by the firmware and
63166 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63167 	 */
63168 	uint16_t	seq_id;
63169 	/*
63170 	 * The target ID of the command:
63171 	 * * 0x0-0xFFF8 - The function ID
63172 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63173 	 * * 0xFFFD - Reserved for user-space HWRM interface
63174 	 * * 0xFFFF - HWRM
63175 	 */
63176 	uint16_t	target_id;
63177 	/*
63178 	 * A physical address pointer pointing to a host buffer that the
63179 	 * command's response data will be written. This can be either a host
63180 	 * physical address (HPA) or a guest physical address (GPA) and must
63181 	 * point to a physically contiguous block of memory.
63182 	 */
63183 	uint64_t	resp_addr;
63184 	/*
63185 	 * This is the host address where
63186 	 * nvm variable will be copied from
63187 	 */
63188 	uint64_t	src_data_addr;
63189 	/* size of data in bits */
63190 	uint16_t	data_len;
63191 	/* nvm cfg option number */
63192 	uint16_t	option_num;
63193 	/* reserved. */
63194 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
63195 	/* reserved. */
63196 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
63197 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST	HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
63198 	/*
63199 	 * Number of dimensions for this nvm configuration variable.
63200 	 * This value indicates how many of the indexN values to use.
63201 	 * A value of 0 means that none of the indexN values are valid.
63202 	 * A value of 1 requires at index0 is valued, a value of 2
63203 	 * requires that index0 and index1 are valid, and so forth
63204 	 */
63205 	uint16_t	dimensions;
63206 	/* index for the 1st dimensions */
63207 	uint16_t	index_0;
63208 	/* index for the 2nd dimensions */
63209 	uint16_t	index_1;
63210 	/* index for the 3rd dimensions */
63211 	uint16_t	index_2;
63212 	/* index for the 4th dimensions */
63213 	uint16_t	index_3;
63214 	uint8_t	flags;
63215 	/*
63216 	 * When this bit is 1, flush internal cache after this write
63217 	 * operation (see hwrm_nvm_flush command.)
63218 	 */
63219 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH		UINT32_C(0x1)
63220 	/* encryption method */
63221 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK	UINT32_C(0xe)
63222 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT	1
63223 	/* No encryption. */
63224 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE		(UINT32_C(0x0) << 1)
63225 	/* one-way encryption. */
63226 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1	(UINT32_C(0x1) << 1)
63227 	/* symmetric AES256 encryption. */
63228 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256	(UINT32_C(0x2) << 1)
63229 	/* SHA1 digest appended to plaintext contents, for authentication */
63230 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH  (UINT32_C(0x3) << 1)
63231 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST	HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
63232 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK	UINT32_C(0x70)
63233 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT	4
63234 	/* When this bit is 1, update the factory default region */
63235 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT		UINT32_C(0x80)
63236 	uint8_t	unused_0;
63237 } hwrm_nvm_set_variable_input_t, *phwrm_nvm_set_variable_input_t;
63238 
63239 /* hwrm_nvm_set_variable_output (size:128b/16B) */
63240 
63241 typedef struct hwrm_nvm_set_variable_output {
63242 	/* The specific error status for the command. */
63243 	uint16_t	error_code;
63244 	/* The HWRM command request type. */
63245 	uint16_t	req_type;
63246 	/* The sequence ID from the original command. */
63247 	uint16_t	seq_id;
63248 	/* The length of the response data in number of bytes. */
63249 	uint16_t	resp_len;
63250 	uint8_t	unused_0[7];
63251 	/*
63252 	 * This field is used in Output records to indicate that the output
63253 	 * is completely written to RAM.  This field should be read as '1'
63254 	 * to indicate that the output has been completely written.
63255 	 * When writing a command completion or response to an internal processor,
63256 	 * the order of writes has to be such that this field is written last.
63257 	 */
63258 	uint8_t	valid;
63259 } hwrm_nvm_set_variable_output_t, *phwrm_nvm_set_variable_output_t;
63260 
63261 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
63262 
63263 typedef struct hwrm_nvm_set_variable_cmd_err {
63264 	/*
63265 	 * command specific error codes that goes to
63266 	 * the cmd_err field in Common HWRM Error Response.
63267 	 */
63268 	uint8_t	code;
63269 	/* Unknown error */
63270 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
63271 	/* variable does not exist */
63272 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
63273 	/* configuration is corrupted and the variable cannot be saved */
63274 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
63275 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST	HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
63276 	uint8_t	unused_0[7];
63277 } hwrm_nvm_set_variable_cmd_err_t, *phwrm_nvm_set_variable_cmd_err_t;
63278 
63279 /****************************
63280  * hwrm_nvm_validate_option *
63281  ****************************/
63282 
63283 
63284 /* hwrm_nvm_validate_option_input (size:320b/40B) */
63285 
63286 typedef struct hwrm_nvm_validate_option_input {
63287 	/* The HWRM command request type. */
63288 	uint16_t	req_type;
63289 	/*
63290 	 * The completion ring to send the completion event on. This should
63291 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63292 	 */
63293 	uint16_t	cmpl_ring;
63294 	/*
63295 	 * The sequence ID is used by the driver for tracking multiple
63296 	 * commands. This ID is treated as opaque data by the firmware and
63297 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63298 	 */
63299 	uint16_t	seq_id;
63300 	/*
63301 	 * The target ID of the command:
63302 	 * * 0x0-0xFFF8 - The function ID
63303 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63304 	 * * 0xFFFD - Reserved for user-space HWRM interface
63305 	 * * 0xFFFF - HWRM
63306 	 */
63307 	uint16_t	target_id;
63308 	/*
63309 	 * A physical address pointer pointing to a host buffer that the
63310 	 * command's response data will be written. This can be either a host
63311 	 * physical address (HPA) or a guest physical address (GPA) and must
63312 	 * point to a physically contiguous block of memory.
63313 	 */
63314 	uint64_t	resp_addr;
63315 	/*
63316 	 * This is the host address where
63317 	 * nvm variable will be copied from
63318 	 */
63319 	uint64_t	src_data_addr;
63320 	/* size of data in bits */
63321 	uint16_t	data_len;
63322 	/* nvm cfg option number */
63323 	uint16_t	option_num;
63324 	/* reserved. */
63325 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
63326 	/* reserved. */
63327 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
63328 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST	HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
63329 	/*
63330 	 * Number of dimensions for this nvm configuration variable.
63331 	 * This value indicates how many of the indexN values to use.
63332 	 * A value of 0 means that none of the indexN values are valid.
63333 	 * A value of 1 requires at index0 is valued, a value of 2
63334 	 * requires that index0 and index1 are valid, and so forth
63335 	 */
63336 	uint16_t	dimensions;
63337 	/* index for the 1st dimensions */
63338 	uint16_t	index_0;
63339 	/* index for the 2nd dimensions */
63340 	uint16_t	index_1;
63341 	/* index for the 3rd dimensions */
63342 	uint16_t	index_2;
63343 	/* index for the 4th dimensions */
63344 	uint16_t	index_3;
63345 	uint8_t	unused_0[2];
63346 } hwrm_nvm_validate_option_input_t, *phwrm_nvm_validate_option_input_t;
63347 
63348 /* hwrm_nvm_validate_option_output (size:128b/16B) */
63349 
63350 typedef struct hwrm_nvm_validate_option_output {
63351 	/* The specific error status for the command. */
63352 	uint16_t	error_code;
63353 	/* The HWRM command request type. */
63354 	uint16_t	req_type;
63355 	/* The sequence ID from the original command. */
63356 	uint16_t	seq_id;
63357 	/* The length of the response data in number of bytes. */
63358 	uint16_t	resp_len;
63359 	uint8_t	result;
63360 	/*
63361 	 * indicates that the value provided for the option is not matching
63362 	 * with the saved data.
63363 	 */
63364 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
63365 	/*
63366 	 * indicates that the value provided for the option is matching the
63367 	 * saved data.
63368 	 */
63369 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH	UINT32_C(0x1)
63370 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST	HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
63371 	uint8_t	unused_0[6];
63372 	/*
63373 	 * This field is used in Output records to indicate that the output
63374 	 * is completely written to RAM.  This field should be read as '1'
63375 	 * to indicate that the output has been completely written.
63376 	 * When writing a command completion or response to an internal processor,
63377 	 * the order of writes has to be such that this field is written last.
63378 	 */
63379 	uint8_t	valid;
63380 } hwrm_nvm_validate_option_output_t, *phwrm_nvm_validate_option_output_t;
63381 
63382 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
63383 
63384 typedef struct hwrm_nvm_validate_option_cmd_err {
63385 	/*
63386 	 * command specific error codes that goes to
63387 	 * the cmd_err field in Common HWRM Error Response.
63388 	 */
63389 	uint8_t	code;
63390 	/* Unknown error */
63391 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
63392 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST   HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
63393 	uint8_t	unused_0[7];
63394 } hwrm_nvm_validate_option_cmd_err_t, *phwrm_nvm_validate_option_cmd_err_t;
63395 
63396 /*****************************
63397  * hwrm_nvm_factory_defaults *
63398  *****************************/
63399 
63400 
63401 /* hwrm_nvm_factory_defaults_input (size:192b/24B) */
63402 
63403 typedef struct hwrm_nvm_factory_defaults_input {
63404 	/* The HWRM command request type. */
63405 	uint16_t	req_type;
63406 	/*
63407 	 * The completion ring to send the completion event on. This should
63408 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63409 	 */
63410 	uint16_t	cmpl_ring;
63411 	/*
63412 	 * The sequence ID is used by the driver for tracking multiple
63413 	 * commands. This ID is treated as opaque data by the firmware and
63414 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63415 	 */
63416 	uint16_t	seq_id;
63417 	/*
63418 	 * The target ID of the command:
63419 	 * * 0x0-0xFFF8 - The function ID
63420 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63421 	 * * 0xFFFD - Reserved for user-space HWRM interface
63422 	 * * 0xFFFF - HWRM
63423 	 */
63424 	uint16_t	target_id;
63425 	/*
63426 	 * A physical address pointer pointing to a host buffer that the
63427 	 * command's response data will be written. This can be either a host
63428 	 * physical address (HPA) or a guest physical address (GPA) and must
63429 	 * point to a physically contiguous block of memory.
63430 	 */
63431 	uint64_t	resp_addr;
63432 	/* mode is 8 b */
63433 	uint8_t	mode;
63434 	/*
63435 	 * If set to 1, it triggers restoration of factory default data.
63436 	 * If the selection field is zero, all data are restored to default.
63437 	 * If the selection field is non-zero, only the selected data are
63438 	 * restored.
63439 	 */
63440 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_RESTORE UINT32_C(0x0)
63441 	/*
63442 	 * If set to 1, it triggers creation of factory default data.
63443 	 * If the selection field is zero, all default data are created.
63444 	 * If the selection field is non-zero, only the selected data are
63445 	 * created.
63446 	 */
63447 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_CREATE  UINT32_C(0x1)
63448 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_LAST   HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_CREATE
63449 	uint8_t	unused_0[1];
63450 	/*
63451 	 * This field selects which data the factory default operation applies.
63452 	 * If it is '0', the operation applies to all data. If it is not '0',
63453 	 * the operation only applies to the data selected by this field.
63454 	 */
63455 	uint16_t	selection;
63456 	/* When this bit is '1', config option is selected. */
63457 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_SELECTION_CFG_OPTION	UINT32_C(0x1)
63458 	/* When this bit is '1', crashdump is selected. */
63459 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_SELECTION_CRASHDUMP	UINT32_C(0x2)
63460 	uint8_t	unused_1[4];
63461 } hwrm_nvm_factory_defaults_input_t, *phwrm_nvm_factory_defaults_input_t;
63462 
63463 /* hwrm_nvm_factory_defaults_output (size:128b/16B) */
63464 
63465 typedef struct hwrm_nvm_factory_defaults_output {
63466 	/* The specific error status for the command. */
63467 	uint16_t	error_code;
63468 	/* The HWRM command request type. */
63469 	uint16_t	req_type;
63470 	/* The sequence ID from the original command. */
63471 	uint16_t	seq_id;
63472 	/* The length of the response data in number of bytes. */
63473 	uint16_t	resp_len;
63474 	uint8_t	result;
63475 	/* factory defaults created successfully. */
63476 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_OK	UINT32_C(0x0)
63477 	/* factory defaults restored successfully. */
63478 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_RESTORE_OK	UINT32_C(0x1)
63479 	/* factory defaults already created. */
63480 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_ALREADY UINT32_C(0x2)
63481 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_LAST	HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_ALREADY
63482 	uint8_t	unused_0[6];
63483 	/*
63484 	 * This field is used in Output records to indicate that the output
63485 	 * is completely written to RAM.  This field should be read as '1'
63486 	 * to indicate that the output has been completely written.
63487 	 * When writing a command completion or response to an internal processor,
63488 	 * the order of writes has to be such that this field is written last.
63489 	 */
63490 	uint8_t	valid;
63491 } hwrm_nvm_factory_defaults_output_t, *phwrm_nvm_factory_defaults_output_t;
63492 
63493 /* hwrm_nvm_factory_defaults_cmd_err (size:64b/8B) */
63494 
63495 typedef struct hwrm_nvm_factory_defaults_cmd_err {
63496 	/*
63497 	 * command specific error codes that goes to
63498 	 * the cmd_err field in Common HWRM Error Response.
63499 	 */
63500 	uint8_t	code;
63501 	/* Unknown error */
63502 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
63503 	/* valid configuration not present to create defaults */
63504 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_VALID_CFG UINT32_C(0x1)
63505 	/* No saved configuration present to restore, restore failed */
63506 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_SAVED_CFG UINT32_C(0x2)
63507 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_LAST	HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_SAVED_CFG
63508 	uint8_t	unused_0[7];
63509 } hwrm_nvm_factory_defaults_cmd_err_t, *phwrm_nvm_factory_defaults_cmd_err_t;
63510 
63511 /****************************
63512  * hwrm_nvm_req_arbitration *
63513  ****************************/
63514 
63515 
63516 /* hwrm_nvm_req_arbitration_input (size:192b/24B) */
63517 
63518 typedef struct hwrm_nvm_req_arbitration_input {
63519 	/* The HWRM command request type. */
63520 	uint16_t	req_type;
63521 	/*
63522 	 * The completion ring to send the completion event on. This should
63523 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63524 	 */
63525 	uint16_t	cmpl_ring;
63526 	/*
63527 	 * The sequence ID is used by the driver for tracking multiple
63528 	 * commands. This ID is treated as opaque data by the firmware and
63529 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63530 	 */
63531 	uint16_t	seq_id;
63532 	/*
63533 	 * The target ID of the command:
63534 	 * * 0x0-0xFFF8 - The function ID
63535 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63536 	 * * 0xFFFD - Reserved for user-space HWRM interface
63537 	 * * 0xFFFF - HWRM
63538 	 */
63539 	uint16_t	target_id;
63540 	/*
63541 	 * A physical address pointer pointing to a host buffer that the
63542 	 * command's response data will be written. This can be either a host
63543 	 * physical address (HPA) or a guest physical address (GPA) and must
63544 	 * point to a physically contiguous block of memory.
63545 	 */
63546 	uint64_t	resp_addr;
63547 	/* Type of NVRAM arbitration request */
63548 	uint8_t	type;
63549 	/* Query if NVRAM arbitration semaphore is acquired outside of Nitro */
63550 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_STATUS  UINT32_C(0x0)
63551 	/* Acquire NVRAM arbitration semaphore */
63552 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_ACQUIRE UINT32_C(0x1)
63553 	/* Release NVRAM arbitration semaphore */
63554 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_RELEASE UINT32_C(0x2)
63555 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_LAST   HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_RELEASE
63556 	uint8_t	unused_0[7];
63557 } hwrm_nvm_req_arbitration_input_t, *phwrm_nvm_req_arbitration_input_t;
63558 
63559 /* hwrm_nvm_req_arbitration_output (size:128b/16B) */
63560 
63561 typedef struct hwrm_nvm_req_arbitration_output {
63562 	/* The specific error status for the command. */
63563 	uint16_t	error_code;
63564 	/* The HWRM command request type. */
63565 	uint16_t	req_type;
63566 	/* The sequence ID from the original command. */
63567 	uint16_t	seq_id;
63568 	/* The length of the response data in number of bytes. */
63569 	uint16_t	resp_len;
63570 	/* NVRAM arbitration semaphore is acquired if value is 1 */
63571 	uint8_t	acquired;
63572 	uint8_t	unused_0[6];
63573 	/*
63574 	 * This field is used in Output records to indicate that the output
63575 	 * is completely written to RAM.  This field should be read as '1'
63576 	 * to indicate that the output has been completely written.
63577 	 * When writing a command completion or response to an internal processor,
63578 	 * the order of writes has to be such that this field is written last.
63579 	 */
63580 	uint8_t	valid;
63581 } hwrm_nvm_req_arbitration_output_t, *phwrm_nvm_req_arbitration_output_t;
63582 
63583 /*******************
63584  * hwrm_nvm_defrag *
63585  *******************/
63586 
63587 
63588 /* hwrm_nvm_defrag_input (size:192b/24B) */
63589 
63590 typedef struct hwrm_nvm_defrag_input {
63591 	/* The HWRM command request type. */
63592 	uint16_t	req_type;
63593 	/*
63594 	 * The completion ring to send the completion event on. This should
63595 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63596 	 */
63597 	uint16_t	cmpl_ring;
63598 	/*
63599 	 * The sequence ID is used by the driver for tracking multiple
63600 	 * commands. This ID is treated as opaque data by the firmware and
63601 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63602 	 */
63603 	uint16_t	seq_id;
63604 	/*
63605 	 * The target ID of the command:
63606 	 * * 0x0-0xFFF8 - The function ID
63607 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63608 	 * * 0xFFFD - Reserved for user-space HWRM interface
63609 	 * * 0xFFFF - HWRM
63610 	 */
63611 	uint16_t	target_id;
63612 	/*
63613 	 * A physical address pointer pointing to a host buffer that the
63614 	 * command's response data will be written. This can be either a host
63615 	 * physical address (HPA) or a guest physical address (GPA) and must
63616 	 * point to a physically contiguous block of memory.
63617 	 */
63618 	uint64_t	resp_addr;
63619 	uint32_t	flags;
63620 	/* This bit must be '1' to perform NVM defragmentation. */
63621 	#define HWRM_NVM_DEFRAG_INPUT_FLAGS_DEFRAG	UINT32_C(0x1)
63622 	uint8_t	unused_0[4];
63623 } hwrm_nvm_defrag_input_t, *phwrm_nvm_defrag_input_t;
63624 
63625 /* hwrm_nvm_defrag_output (size:128b/16B) */
63626 
63627 typedef struct hwrm_nvm_defrag_output {
63628 	/* The specific error status for the command. */
63629 	uint16_t	error_code;
63630 	/* The HWRM command request type. */
63631 	uint16_t	req_type;
63632 	/* The sequence ID from the original command. */
63633 	uint16_t	seq_id;
63634 	/* The length of the response data in number of bytes. */
63635 	uint16_t	resp_len;
63636 	uint8_t	unused_0[7];
63637 	/*
63638 	 * This field is used in Output records to indicate that the output
63639 	 * is completely written to RAM.  This field should be read as '1'
63640 	 * to indicate that the output has been completely written.
63641 	 * When writing a command completion or response to an internal processor,
63642 	 * the order of writes has to be such that this field is written last.
63643 	 */
63644 	uint8_t	valid;
63645 } hwrm_nvm_defrag_output_t, *phwrm_nvm_defrag_output_t;
63646 
63647 /* hwrm_nvm_defrag_cmd_err (size:64b/8B) */
63648 
63649 typedef struct hwrm_nvm_defrag_cmd_err {
63650 	/*
63651 	 * command specific error codes that goes to
63652 	 * the cmd_err field in Common HWRM Error Response.
63653 	 */
63654 	uint8_t	code;
63655 	/* Unknown error */
63656 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
63657 	/* NVM defragmentation could not be performed */
63658 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL	UINT32_C(0x1)
63659 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_LAST   HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL
63660 	uint8_t	unused_0[7];
63661 } hwrm_nvm_defrag_cmd_err_t, *phwrm_nvm_defrag_cmd_err_t;
63662 
63663 #define ROCE_SP_HSI_VERSION_MAJOR 1
63664 #define ROCE_SP_HSI_VERSION_MINOR 8
63665 #define ROCE_SP_HSI_VERSION_UPDATE 4
63666 #define ROCE_SP_HSI_VERSION_STR "1.8.4"
63667 /*
63668  * Following is the signature for ROCE_SP_HSI message field that indicates not
63669  * applicable (All F's). Need to cast it the size of the field if needed.
63670  */
63671 #define ROCE_SP_HSI_NA_SIGNATURE ((uint32_t)(-1))
63672 
63673 /* cmdq_init (size:128b/16B) */
63674 
63675 typedef struct cmdq_init {
63676 	/* CMDQ PBL physical address. */
63677 	uint64_t	cmdq_pbl;
63678 	uint16_t	cmdq_size_cmdq_lvl;
63679 	/* CMDQ PBL indirection levels. */
63680 	#define CMDQ_INIT_CMDQ_LVL_MASK UINT32_C(0x3)
63681 	#define CMDQ_INIT_CMDQ_LVL_SFT  0
63682 	/* CMDQ size. */
63683 	#define CMDQ_INIT_CMDQ_SIZE_MASK UINT32_C(0xfffc)
63684 	#define CMDQ_INIT_CMDQ_SIZE_SFT 2
63685 	/* CREQ completion ring id. */
63686 	uint16_t	creq_ring_id;
63687 	/* Mailbox producer index. MSB must also be set. */
63688 	uint32_t	prod_idx;
63689 } cmdq_init_t, *pcmdq_init_t;
63690 
63691 /* cmdq_update (size:128b/16B) */
63692 
63693 typedef struct cmdq_update {
63694 	/* reserved64 is 64 b */
63695 	uint64_t	reserved64;
63696 	/* reserved32 is 32 b */
63697 	uint32_t	reserved32;
63698 	/* Mailbox producer index. */
63699 	uint32_t	prod_idx;
63700 } cmdq_update_t, *pcmdq_update_t;
63701 
63702 /* cmdq_base (size:128b/16B) */
63703 
63704 typedef struct cmdq_base {
63705 	/* Command opcode. */
63706 	uint8_t	opcode;
63707 	/*
63708 	 * Create QP command allocates QP context with the specified
63709 	 * SQ, RQ/SRQ, CQ and other parameters.
63710 	 */
63711 	#define CMDQ_BASE_OPCODE_CREATE_QP		UINT32_C(0x1)
63712 	/*
63713 	 * Destroy QP command deletes the QP context and ceases
63714 	 * any further reference.
63715 	 */
63716 	#define CMDQ_BASE_OPCODE_DESTROY_QP		UINT32_C(0x2)
63717 	/*
63718 	 * Modify QP command changes QP states and other QP specific
63719 	 * parameters.
63720 	 */
63721 	#define CMDQ_BASE_OPCODE_MODIFY_QP		UINT32_C(0x3)
63722 	/* Query QP command retrieves info about the specified QP. */
63723 	#define CMDQ_BASE_OPCODE_QUERY_QP		UINT32_C(0x4)
63724 	/* Create SRQ command allocates a SRQ with the specified parameters. */
63725 	#define CMDQ_BASE_OPCODE_CREATE_SRQ		UINT32_C(0x5)
63726 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
63727 	#define CMDQ_BASE_OPCODE_DESTROY_SRQ		UINT32_C(0x6)
63728 	/* Query SRP command retrieves info about the specified SRQ. */
63729 	#define CMDQ_BASE_OPCODE_QUERY_SRQ		UINT32_C(0x8)
63730 	/* Create CQ command allocates a CQ with the specified parameters. */
63731 	#define CMDQ_BASE_OPCODE_CREATE_CQ		UINT32_C(0x9)
63732 	/* Destroy CQ command deletes and flushes the specified CQ. */
63733 	#define CMDQ_BASE_OPCODE_DESTROY_CQ		UINT32_C(0xa)
63734 	/* Resize CQ command resizes the specified CQ. */
63735 	#define CMDQ_BASE_OPCODE_RESIZE_CQ		UINT32_C(0xc)
63736 	/*
63737 	 * Allocate MRW command allocates a MR/MW with the specified parameters
63738 	 * and returns the region's L_KEY/R_KEY
63739 	 */
63740 	#define CMDQ_BASE_OPCODE_ALLOCATE_MRW	UINT32_C(0xd)
63741 	/* De-allocate key command frees a MR/MW entry associated with the specified key. */
63742 	#define CMDQ_BASE_OPCODE_DEALLOCATE_KEY	UINT32_C(0xe)
63743 	/* Register MR command registers memory to the specified MR. */
63744 	#define CMDQ_BASE_OPCODE_REGISTER_MR		UINT32_C(0xf)
63745 	/* Deregister MR command de-registers memory from the specified MR. */
63746 	#define CMDQ_BASE_OPCODE_DEREGISTER_MR	UINT32_C(0x10)
63747 	/* Add GID command adds a GID to the local address table. */
63748 	#define CMDQ_BASE_OPCODE_ADD_GID		UINT32_C(0x11)
63749 	/* Delete GID command deletes a GID from the local address table. */
63750 	#define CMDQ_BASE_OPCODE_DELETE_GID		UINT32_C(0x12)
63751 	/* Modify GID command modifies a GID in the local address table. */
63752 	#define CMDQ_BASE_OPCODE_MODIFY_GID		UINT32_C(0x17)
63753 	/* Query GID command queries a GID in the local address table. */
63754 	#define CMDQ_BASE_OPCODE_QUERY_GID		UINT32_C(0x18)
63755 	/* Create QP1 command allocates a QP1 only. */
63756 	#define CMDQ_BASE_OPCODE_CREATE_QP1		UINT32_C(0x13)
63757 	/* Destroy QP1 command deletes and flushes the specified QP1. */
63758 	#define CMDQ_BASE_OPCODE_DESTROY_QP1		UINT32_C(0x14)
63759 	/* Create AH command allocates an AH with the specified parameters. */
63760 	#define CMDQ_BASE_OPCODE_CREATE_AH		UINT32_C(0x15)
63761 	/* Destroy AH command deletes the specified AH. */
63762 	#define CMDQ_BASE_OPCODE_DESTROY_AH		UINT32_C(0x16)
63763 	/*
63764 	 * Initialize firmware command initializes the firmware with
63765 	 * the specified parameters.
63766 	 */
63767 	#define CMDQ_BASE_OPCODE_INITIALIZE_FW	UINT32_C(0x80)
63768 	/* De-initialize firmware command deinitializes the firmware. */
63769 	#define CMDQ_BASE_OPCODE_DEINITIALIZE_FW	UINT32_C(0x81)
63770 	/* Stop the function */
63771 	#define CMDQ_BASE_OPCODE_STOP_FUNC		UINT32_C(0x82)
63772 	/* Query the HW capabilities for the function. */
63773 	#define CMDQ_BASE_OPCODE_QUERY_FUNC		UINT32_C(0x83)
63774 	/*
63775 	 * Set the following resources for the function:
63776 	 * - Max QP, CQ, MR+MW, SRQ per PF
63777 	 * - Max QP, CQ, MR+MW, SRQ per VF
63778 	 */
63779 	#define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES	UINT32_C(0x84)
63780 	/* Read the current state of any internal resource context. Can only be issued from a PF. */
63781 	#define CMDQ_BASE_OPCODE_READ_CONTEXT	UINT32_C(0x85)
63782 	/* Send a request from VF to pass a command to the PF. VF HSI is suspended until the PF returns the response */
63783 	#define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
63784 	/* Read VF memory (primarily to get the backchannel request blob). Can only be issued from a PF. */
63785 	#define CMDQ_BASE_OPCODE_READ_VF_MEMORY	UINT32_C(0x87)
63786 	/* Write VF memory (primarily to put the backchannel response blob), and reenable VF HSI (post a CAG completion to it). Can only be issued from a PF. */
63787 	#define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST	UINT32_C(0x88)
63788 	/* Extend resource (QPC, MRW, CQ, SRQ) array, after the host allocates more. Can only be issued from a PF. */
63789 	#define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY  UINT32_C(0x89)
63790 	/* Map TC to COS. Can only be issued from a PF. */
63791 	#define CMDQ_BASE_OPCODE_MAP_TC_TO_COS	UINT32_C(0x8a)
63792 	/* Query version. */
63793 	#define CMDQ_BASE_OPCODE_QUERY_VERSION	UINT32_C(0x8b)
63794 	/* Modify congestion control. Can only be issued from a PF. */
63795 	#define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC	UINT32_C(0x8c)
63796 	/* Query congestion control. */
63797 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_CC	UINT32_C(0x8d)
63798 	/* Query RoCE statistics. */
63799 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS	UINT32_C(0x8e)
63800 	/* Set LAG mode. */
63801 	#define CMDQ_BASE_OPCODE_SET_LINK_AGGR_MODE	UINT32_C(0x8f)
63802 	/* Modify CQ */
63803 	#define CMDQ_BASE_OPCODE_MODIFY_CQ		UINT32_C(0x90)
63804 	/*
63805 	 * Query QP for a PF other than the requesting PF. Also can query for more
63806 	 * than one QP.
63807 	 */
63808 	#define CMDQ_BASE_OPCODE_QUERY_QP_EXTEND	UINT32_C(0x91)
63809 	/* Query extended RoCE statistics. */
63810 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT   UINT32_C(0x92)
63811 	#define CMDQ_BASE_OPCODE_LAST		CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT
63812 	/* Size of the command in 16-byte units. */
63813 	uint8_t	cmd_size;
63814 	/* Flags and attribs of the command. */
63815 	uint16_t	flags;
63816 	/* Driver supplied handle to associate the command and the response. */
63817 	uint16_t	cookie;
63818 	/* Size of the response buffer in 16-byte units. */
63819 	uint8_t	resp_size;
63820 	uint8_t	reserved8;
63821 	/* Host address of the response. */
63822 	uint64_t	resp_addr;
63823 } cmdq_base_t, *pcmdq_base_t;
63824 
63825 /* creq_base (size:128b/16B) */
63826 
63827 typedef struct creq_base {
63828 	uint8_t	type;
63829 	/*
63830 	 * This field indicates the exact type of the completion.
63831 	 * By convention, the LSB identifies the length of the
63832 	 * record in 16B units. Even values indicate 16B
63833 	 * records. Odd values indicate 32B
63834 	 * records.
63835 	 */
63836 	#define CREQ_BASE_TYPE_MASK	UINT32_C(0x3f)
63837 	#define CREQ_BASE_TYPE_SFT	0
63838 	/* QP Async Notification */
63839 		#define CREQ_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
63840 	/* Function Async Notification */
63841 		#define CREQ_BASE_TYPE_FUNC_EVENT  UINT32_C(0x3a)
63842 		#define CREQ_BASE_TYPE_LAST	CREQ_BASE_TYPE_FUNC_EVENT
63843 	uint8_t	reserved56[7];
63844 	uint8_t	v;
63845 	/*
63846 	 * This value is written by the NIC such that it will be different
63847 	 * for each pass through the completion queue. The even passes
63848 	 * will write 1. The odd passes will write 0.
63849 	 */
63850 	#define CREQ_BASE_V	UINT32_C(0x1)
63851 	/* This is the modifier on to the type field. */
63852 	uint8_t	event;
63853 	uint8_t	reserved48[6];
63854 } creq_base_t, *pcreq_base_t;
63855 
63856 /*****************
63857  * query_version *
63858  *****************/
63859 
63860 
63861 /* cmdq_query_version (size:128b/16B) */
63862 
63863 typedef struct cmdq_query_version {
63864 	/* Command opcode. */
63865 	uint8_t	opcode;
63866 	/* Query version. */
63867 	#define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION UINT32_C(0x8b)
63868 	#define CMDQ_QUERY_VERSION_OPCODE_LAST	CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION
63869 	/* Size of the command in 16-byte units. */
63870 	uint8_t	cmd_size;
63871 	/* Flags and attribs of the command. */
63872 	uint16_t	flags;
63873 	/* Driver supplied handle to associate the command and the response. */
63874 	uint16_t	cookie;
63875 	/* Size of the response buffer in 16-byte units. */
63876 	uint8_t	resp_size;
63877 	uint8_t	reserved8;
63878 	/* Host address of the response. */
63879 	uint64_t	resp_addr;
63880 } cmdq_query_version_t, *pcmdq_query_version_t;
63881 
63882 /* creq_query_version_resp (size:128b/16B) */
63883 
63884 typedef struct creq_query_version_resp {
63885 	uint8_t	type;
63886 	/*
63887 	 * This field indicates the exact type of the completion.
63888 	 * By convention, the LSB identifies the length of the
63889 	 * record in 16B units. Even values indicate 16B
63890 	 * records. Odd values indicate 32B
63891 	 * records.
63892 	 */
63893 	#define CREQ_QUERY_VERSION_RESP_TYPE_MASK	UINT32_C(0x3f)
63894 	#define CREQ_QUERY_VERSION_RESP_TYPE_SFT	0
63895 	/* QP Async Notification */
63896 		#define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
63897 		#define CREQ_QUERY_VERSION_RESP_TYPE_LAST	CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT
63898 	/* Status of the response. */
63899 	uint8_t	status;
63900 	/* Driver supplied handle to associate the command and the response. */
63901 	uint16_t	cookie;
63902 	/* firmware major version */
63903 	uint8_t	fw_maj;
63904 	/* firmware minor version */
63905 	uint8_t	fw_minor;
63906 	/* firmware build version */
63907 	uint8_t	fw_bld;
63908 	/* firmware reserved version */
63909 	uint8_t	fw_rsvd;
63910 	uint8_t	v;
63911 	/*
63912 	 * This value is written by the NIC such that it will be different
63913 	 * for each pass through the completion queue. The even passes
63914 	 * will write 1. The odd passes will write 0.
63915 	 */
63916 	#define CREQ_QUERY_VERSION_RESP_V	UINT32_C(0x1)
63917 	/* Event or command opcode. */
63918 	uint8_t	event;
63919 	/* Query firmware and interface version response. */
63920 	#define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION UINT32_C(0x8b)
63921 	#define CREQ_QUERY_VERSION_RESP_EVENT_LAST	CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION
63922 	uint16_t	reserved16;
63923 	/* interface major version */
63924 	uint8_t	intf_maj;
63925 	/* interface minor version */
63926 	uint8_t	intf_minor;
63927 	/* interface build version */
63928 	uint8_t	intf_bld;
63929 	/* interface reserved version */
63930 	uint8_t	intf_rsvd;
63931 } creq_query_version_resp_t, *pcreq_query_version_resp_t;
63932 
63933 /*****************
63934  * initialize_fw *
63935  *****************/
63936 
63937 
63938 /* cmdq_initialize_fw (size:896b/112B) */
63939 
63940 typedef struct cmdq_initialize_fw {
63941 	/* Command opcode. */
63942 	uint8_t	opcode;
63943 	/*
63944 	 * Initialize firmware command initializes the firmware with
63945 	 * the specified parameters.
63946 	 */
63947 	#define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW UINT32_C(0x80)
63948 	#define CMDQ_INITIALIZE_FW_OPCODE_LAST	CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW
63949 	/* Size of the command in 16-byte units. */
63950 	uint8_t	cmd_size;
63951 	/* Flags and attribs of the command. */
63952 	uint16_t	flags;
63953 	/*
63954 	 * When set, the 32b `max_mrw_per_vf` field is logically divided
63955 	 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
63956 	 */
63957 	#define CMDQ_INITIALIZE_FW_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x1)
63958 	/*
63959 	 * When set, the hardware based requester retransmission
63960 	 * feature is supported.
63961 	 */
63962 	#define CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED	UINT32_C(0x2)
63963 	/* Driver supplied handle to associate the command and the response. */
63964 	uint16_t	cookie;
63965 	/* Size of the response buffer in 16-byte units. */
63966 	uint8_t	resp_size;
63967 	uint8_t	reserved8;
63968 	/* Host address of the response. */
63969 	uint64_t	resp_addr;
63970 	uint8_t	qpc_pg_size_qpc_lvl;
63971 	/* QPC PBL indirect levels. */
63972 	#define CMDQ_INITIALIZE_FW_QPC_LVL_MASK	UINT32_C(0xf)
63973 	#define CMDQ_INITIALIZE_FW_QPC_LVL_SFT	0
63974 	/* PBL pointer is physical start address. */
63975 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0	UINT32_C(0x0)
63976 	/* PBL pointer points to PTE table. */
63977 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1	UINT32_C(0x1)
63978 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
63979 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2	UINT32_C(0x2)
63980 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LAST	CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2
63981 	/* QPC page size. */
63982 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
63983 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT   4
63984 	/* 4KB. */
63985 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
63986 	/* 8KB. */
63987 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
63988 	/* 64KB. */
63989 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
63990 	/* 2MB. */
63991 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
63992 	/* 8MB. */
63993 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
63994 	/* 1GB. */
63995 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
63996 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G
63997 	uint8_t	mrw_pg_size_mrw_lvl;
63998 	/* MRW PBL indirect levels. */
63999 	#define CMDQ_INITIALIZE_FW_MRW_LVL_MASK	UINT32_C(0xf)
64000 	#define CMDQ_INITIALIZE_FW_MRW_LVL_SFT	0
64001 	/* PBL pointer is physical start address. */
64002 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0	UINT32_C(0x0)
64003 	/* PBL pointer points to PTE table. */
64004 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1	UINT32_C(0x1)
64005 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64006 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2	UINT32_C(0x2)
64007 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LAST	CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2
64008 	/* MRW page size. */
64009 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK  UINT32_C(0xf0)
64010 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT   4
64011 	/* 4KB. */
64012 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64013 	/* 8KB. */
64014 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64015 	/* 64KB. */
64016 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64017 	/* 2MB. */
64018 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64019 	/* 8MB. */
64020 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64021 	/* 1GB. */
64022 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64023 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G
64024 	uint8_t	srq_pg_size_srq_lvl;
64025 	/* SRQ PBL indirect levels. */
64026 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK	UINT32_C(0xf)
64027 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT	0
64028 	/* PBL pointer is physical start address. */
64029 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0	UINT32_C(0x0)
64030 	/* PBL pointer points to PTE table. */
64031 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1	UINT32_C(0x1)
64032 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64033 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2	UINT32_C(0x2)
64034 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LAST	CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2
64035 	/* SRQ page size. */
64036 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
64037 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT   4
64038 	/* 4KB. */
64039 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64040 	/* 8KB. */
64041 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64042 	/* 64KB. */
64043 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64044 	/* 2MB. */
64045 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64046 	/* 8MB. */
64047 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64048 	/* 1GB. */
64049 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64050 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G
64051 	uint8_t	cq_pg_size_cq_lvl;
64052 	/* CQ PBL indirect levels. */
64053 	#define CMDQ_INITIALIZE_FW_CQ_LVL_MASK	UINT32_C(0xf)
64054 	#define CMDQ_INITIALIZE_FW_CQ_LVL_SFT	0
64055 	/* PBL pointer is physical start address. */
64056 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0	UINT32_C(0x0)
64057 	/* PBL pointer points to PTE table. */
64058 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1	UINT32_C(0x1)
64059 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64060 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2	UINT32_C(0x2)
64061 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LAST	CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2
64062 	/* CQ page size. */
64063 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
64064 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT   4
64065 	/* 4KB. */
64066 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64067 	/* 8KB. */
64068 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64069 	/* 64KB. */
64070 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64071 	/* 2MB. */
64072 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64073 	/* 8MB. */
64074 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64075 	/* 1GB. */
64076 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64077 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G
64078 	uint8_t	tqm_pg_size_tqm_lvl;
64079 	/* TQM PBL indirect levels. */
64080 	#define CMDQ_INITIALIZE_FW_TQM_LVL_MASK	UINT32_C(0xf)
64081 	#define CMDQ_INITIALIZE_FW_TQM_LVL_SFT	0
64082 	/* PBL pointer is physical start address. */
64083 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0	UINT32_C(0x0)
64084 	/* PBL pointer points to PTE table. */
64085 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1	UINT32_C(0x1)
64086 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64087 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2	UINT32_C(0x2)
64088 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LAST	CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2
64089 	/* TQM page size. */
64090 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK  UINT32_C(0xf0)
64091 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT   4
64092 	/* 4KB. */
64093 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64094 	/* 8KB. */
64095 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64096 	/* 64KB. */
64097 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64098 	/* 2MB. */
64099 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64100 	/* 8MB. */
64101 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64102 	/* 1GB. */
64103 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64104 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G
64105 	uint8_t	tim_pg_size_tim_lvl;
64106 	/* TIM PBL indirect levels. */
64107 	#define CMDQ_INITIALIZE_FW_TIM_LVL_MASK	UINT32_C(0xf)
64108 	#define CMDQ_INITIALIZE_FW_TIM_LVL_SFT	0
64109 	/* PBL pointer is physical start address. */
64110 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0	UINT32_C(0x0)
64111 	/* PBL pointer points to PTE table. */
64112 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1	UINT32_C(0x1)
64113 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64114 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2	UINT32_C(0x2)
64115 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LAST	CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2
64116 	/* TIM page size. */
64117 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
64118 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT   4
64119 	/* 4KB. */
64120 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64121 	/* 8KB. */
64122 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64123 	/* 64KB. */
64124 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64125 	/* 2MB. */
64126 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64127 	/* 8MB. */
64128 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64129 	/* 1GB. */
64130 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64131 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G
64132 	uint16_t	log2_dbr_pg_size;
64133 	/* Log base 2 of DBR page size - 12. 0 for 4KB. HW supported values are enumerated below. */
64134 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK   UINT32_C(0xf)
64135 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT	0
64136 	/* 4KB. */
64137 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K	UINT32_C(0x0)
64138 	/* 8KB. */
64139 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K	UINT32_C(0x1)
64140 	/* 16KB. */
64141 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K   UINT32_C(0x2)
64142 	/* 32KB. */
64143 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K   UINT32_C(0x3)
64144 	/* 64KB. */
64145 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K   UINT32_C(0x4)
64146 	/* 128KB. */
64147 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K  UINT32_C(0x5)
64148 	/* 256KB. */
64149 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K  UINT32_C(0x6)
64150 	/* 512KB. */
64151 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K  UINT32_C(0x7)
64152 	/* 1MB. */
64153 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M	UINT32_C(0x8)
64154 	/* 2MB. */
64155 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M	UINT32_C(0x9)
64156 	/* 4MB. */
64157 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M	UINT32_C(0xa)
64158 	/* 8MB. */
64159 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M	UINT32_C(0xb)
64160 	/* 16MB. */
64161 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M   UINT32_C(0xc)
64162 	/* 32MB. */
64163 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M   UINT32_C(0xd)
64164 	/* 64MB. */
64165 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M   UINT32_C(0xe)
64166 	/* 128MB. */
64167 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M  UINT32_C(0xf)
64168 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST	CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
64169 	/* rsvd is 12 b */
64170 	#define CMDQ_INITIALIZE_FW_RSVD_MASK		UINT32_C(0xfff0)
64171 	#define CMDQ_INITIALIZE_FW_RSVD_SFT		4
64172 	/* Kernel notification queue page directory. */
64173 	uint64_t	qpc_page_dir;
64174 	/* MRW page directory. */
64175 	uint64_t	mrw_page_dir;
64176 	/* SRQ page directory. */
64177 	uint64_t	srq_page_dir;
64178 	/* CQ page directory. */
64179 	uint64_t	cq_page_dir;
64180 	/* TQM page directory. */
64181 	uint64_t	tqm_page_dir;
64182 	/* TIM page directory. */
64183 	uint64_t	tim_page_dir;
64184 	/* Number of QPs. */
64185 	uint32_t	number_of_qp;
64186 	/* Number of MRWs. */
64187 	uint32_t	number_of_mrw;
64188 	/* Number of SRQs. */
64189 	uint32_t	number_of_srq;
64190 	/* Number of CQs. */
64191 	uint32_t	number_of_cq;
64192 	/* Number of QPs per VF. */
64193 	uint32_t	max_qp_per_vf;
64194 	/*
64195 	 * If the MR/AV split reservation flag is not set, then this field
64196 	 * represents the total number of MR plus AV entries allowed per
64197 	 * VF. For versions of firmware that support the split reservation,
64198 	 * when it is not specified half of the entries will be reserved
64199 	 * for MRs and the other half for AVs.
64200 	 *
64201 	 * If the MR/AV split reservation flag is set, then this
64202 	 * field is logically divided into two 16b fields. Bits `[31:16]`
64203 	 * represents the `max_mr_per_vf` and bits `[15:0]` represents
64204 	 * `max_av_per_vf`. The granularity of these values is defined by
64205 	 * the `mrav_num_entries_unit` field returned by the
64206 	 * `backing_store_qcaps` command.
64207 	 */
64208 	uint32_t	max_mrw_per_vf;
64209 	/* Number of SRQs per VF. */
64210 	uint32_t	max_srq_per_vf;
64211 	/* Number of CQs per VF. */
64212 	uint32_t	max_cq_per_vf;
64213 	/* Number of GIDs per VF. */
64214 	uint32_t	max_gid_per_vf;
64215 	/* Statistics context index for this function. */
64216 	uint32_t	stat_ctx_id;
64217 } cmdq_initialize_fw_t, *pcmdq_initialize_fw_t;
64218 
64219 /* creq_initialize_fw_resp (size:128b/16B) */
64220 
64221 typedef struct creq_initialize_fw_resp {
64222 	uint8_t	type;
64223 	/*
64224 	 * This field indicates the exact type of the completion.
64225 	 * By convention, the LSB identifies the length of the
64226 	 * record in 16B units. Even values indicate 16B
64227 	 * records. Odd values indicate 32B
64228 	 * records.
64229 	 */
64230 	#define CREQ_INITIALIZE_FW_RESP_TYPE_MASK	UINT32_C(0x3f)
64231 	#define CREQ_INITIALIZE_FW_RESP_TYPE_SFT	0
64232 	/* QP Async Notification */
64233 		#define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64234 		#define CREQ_INITIALIZE_FW_RESP_TYPE_LAST	CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT
64235 	/* Status of the response. */
64236 	uint8_t	status;
64237 	/* Driver supplied handle to associate the command and the response. */
64238 	uint16_t	cookie;
64239 	uint32_t	reserved32;
64240 	uint8_t	v;
64241 	/*
64242 	 * This value is written by the NIC such that it will be different
64243 	 * for each pass through the completion queue. The even passes
64244 	 * will write 1. The odd passes will write 0.
64245 	 */
64246 	#define CREQ_INITIALIZE_FW_RESP_V	UINT32_C(0x1)
64247 	/* Event or command opcode. */
64248 	uint8_t	event;
64249 	/* Initialize firmware command response. */
64250 	#define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW UINT32_C(0x80)
64251 	#define CREQ_INITIALIZE_FW_RESP_EVENT_LAST	CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW
64252 	uint8_t	reserved48[6];
64253 } creq_initialize_fw_resp_t, *pcreq_initialize_fw_resp_t;
64254 
64255 /*******************
64256  * deinitialize_fw *
64257  *******************/
64258 
64259 
64260 /* cmdq_deinitialize_fw (size:128b/16B) */
64261 
64262 typedef struct cmdq_deinitialize_fw {
64263 	/* Command opcode. */
64264 	uint8_t	opcode;
64265 	/* De-initialize firmware command deinitializes the firmware. */
64266 	#define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW UINT32_C(0x81)
64267 	#define CMDQ_DEINITIALIZE_FW_OPCODE_LAST	CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW
64268 	/* Size of the command in 16-byte units. */
64269 	uint8_t	cmd_size;
64270 	/* Flags and attribs of the command. */
64271 	uint16_t	flags;
64272 	/* Driver supplied handle to associate the command and the response. */
64273 	uint16_t	cookie;
64274 	/* Size of the response buffer in 16-byte units. */
64275 	uint8_t	resp_size;
64276 	uint8_t	reserved8;
64277 	/* Host address of the response. */
64278 	uint64_t	resp_addr;
64279 } cmdq_deinitialize_fw_t, *pcmdq_deinitialize_fw_t;
64280 
64281 /* creq_deinitialize_fw_resp (size:128b/16B) */
64282 
64283 typedef struct creq_deinitialize_fw_resp {
64284 	uint8_t	type;
64285 	/*
64286 	 * This field indicates the exact type of the completion.
64287 	 * By convention, the LSB identifies the length of the
64288 	 * record in 16B units. Even values indicate 16B
64289 	 * records. Odd values indicate 32B
64290 	 * records.
64291 	 */
64292 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK	UINT32_C(0x3f)
64293 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT	0
64294 	/* QP Async Notification */
64295 		#define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64296 		#define CREQ_DEINITIALIZE_FW_RESP_TYPE_LAST	CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT
64297 	/* Status of the response. */
64298 	uint8_t	status;
64299 	/* Driver supplied handle to associate the command and the response. */
64300 	uint16_t	cookie;
64301 	uint32_t	reserved32;
64302 	uint8_t	v;
64303 	/*
64304 	 * This value is written by the NIC such that it will be different
64305 	 * for each pass through the completion queue. The even passes
64306 	 * will write 1. The odd passes will write 0.
64307 	 */
64308 	#define CREQ_DEINITIALIZE_FW_RESP_V	UINT32_C(0x1)
64309 	/* Event or command opcode. */
64310 	uint8_t	event;
64311 	/* De-initialize firmware command response. */
64312 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW UINT32_C(0x81)
64313 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_LAST	CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW
64314 	uint8_t	reserved48[6];
64315 } creq_deinitialize_fw_resp_t, *pcreq_deinitialize_fw_resp_t;
64316 
64317 /*************
64318  * create_qp *
64319  *************/
64320 
64321 
64322 /* cmdq_create_qp (size:768b/96B) */
64323 
64324 typedef struct cmdq_create_qp {
64325 	/* Command opcode. */
64326 	uint8_t	opcode;
64327 	/*
64328 	 * Create QP command allocates QP context with the specified
64329 	 * SQ, RQ/SRQ, CQ and other parameters.
64330 	 */
64331 	#define CMDQ_CREATE_QP_OPCODE_CREATE_QP UINT32_C(0x1)
64332 	#define CMDQ_CREATE_QP_OPCODE_LAST	CMDQ_CREATE_QP_OPCODE_CREATE_QP
64333 	/* Size of the command in 16-byte units. */
64334 	uint8_t	cmd_size;
64335 	/* Flags and attribs of the command. */
64336 	uint16_t	flags;
64337 	/* Driver supplied handle to associate the command and the response. */
64338 	uint16_t	cookie;
64339 	/* Size of the response buffer in 16-byte units. */
64340 	uint8_t	resp_size;
64341 	uint8_t	reserved8;
64342 	/* Host address of the response. */
64343 	uint64_t	resp_addr;
64344 	/* QP handle. */
64345 	uint64_t	qp_handle;
64346 	/* Create QP flags. */
64347 	uint32_t	qp_flags;
64348 	/* SRQ is used. */
64349 	#define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
64350 	/* post CQE for all SQ WQEs. */
64351 	#define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
64352 	/* This QP can use reserved L_Key */
64353 	#define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE	UINT32_C(0x4)
64354 	/* This QP can fast register physical memory */
64355 	#define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED		UINT32_C(0x8)
64356 	/* This QP can send variable sized WQEs. */
64357 	#define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED UINT32_C(0x10)
64358 	/*
64359 	 * WQEs with inline data sent on this QP are able to flow
64360 	 * through an optimized transmit path to lower latency. This
64361 	 * transmit path is opportunistic and not guaranteed to always
64362 	 * occur.
64363 	 */
64364 	#define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED UINT32_C(0x20)
64365 	/*
64366 	 * For UD QPs the default responder CQE format is `cq_res_ud`.
64367 	 * This flag specifies the `cq_res_ud_cfa` format to be used
64368 	 * instead.
64369 	 */
64370 	#define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA  UINT32_C(0x40)
64371 	/*
64372 	 * This QP must be included in the extended RoCE statistics
64373 	 * that can be queried via `query_roce_stats_ext`.
64374 	 */
64375 	#define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED	UINT32_C(0x80)
64376 	#define CMDQ_CREATE_QP_QP_FLAGS_LAST			CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED
64377 	/* Supported QP types. */
64378 	uint8_t	type;
64379 	/* Reliable Connection. */
64380 	#define CMDQ_CREATE_QP_TYPE_RC		UINT32_C(0x2)
64381 	/* Unreliable Datagram. */
64382 	#define CMDQ_CREATE_QP_TYPE_UD		UINT32_C(0x4)
64383 	/* Raw Ethertype. */
64384 	#define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE UINT32_C(0x6)
64385 	/* General Services Interface on QP1 over UD. */
64386 	#define CMDQ_CREATE_QP_TYPE_GSI	UINT32_C(0x7)
64387 	#define CMDQ_CREATE_QP_TYPE_LAST	CMDQ_CREATE_QP_TYPE_GSI
64388 	uint8_t	sq_pg_size_sq_lvl;
64389 	/* SQ PBL indirect levels. */
64390 	#define CMDQ_CREATE_QP_SQ_LVL_MASK	UINT32_C(0xf)
64391 	#define CMDQ_CREATE_QP_SQ_LVL_SFT	0
64392 	/* PBL pointer is physical start address. */
64393 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_0	UINT32_C(0x0)
64394 	/* PBL pointer points to PTE table. */
64395 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_1	UINT32_C(0x1)
64396 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64397 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_2	UINT32_C(0x2)
64398 		#define CMDQ_CREATE_QP_SQ_LVL_LAST	CMDQ_CREATE_QP_SQ_LVL_LVL_2
64399 	/* SQ page size. */
64400 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK  UINT32_C(0xf0)
64401 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT   4
64402 	/* 4KB. */
64403 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64404 	/* 8KB. */
64405 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64406 	/* 64KB. */
64407 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64408 	/* 2MB. */
64409 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64410 	/* 8MB. */
64411 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64412 	/* 1GB. */
64413 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64414 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G
64415 	uint8_t	rq_pg_size_rq_lvl;
64416 	/* RQ PBL indirect levels. */
64417 	#define CMDQ_CREATE_QP_RQ_LVL_MASK	UINT32_C(0xf)
64418 	#define CMDQ_CREATE_QP_RQ_LVL_SFT	0
64419 	/* PBL pointer is physical start address. */
64420 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_0	UINT32_C(0x0)
64421 	/* PBL pointer points to PTE table. */
64422 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_1	UINT32_C(0x1)
64423 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
64424 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_2	UINT32_C(0x2)
64425 		#define CMDQ_CREATE_QP_RQ_LVL_LAST	CMDQ_CREATE_QP_RQ_LVL_LVL_2
64426 	/* RQ page size. */
64427 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK  UINT32_C(0xf0)
64428 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT   4
64429 	/* 4KB. */
64430 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
64431 	/* 8KB. */
64432 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
64433 	/* 64KB. */
64434 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
64435 	/* 2MB. */
64436 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
64437 	/* 8MB. */
64438 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
64439 	/* 1GB. */
64440 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
64441 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G
64442 	uint8_t	unused_0;
64443 	/* Doorbell page index. */
64444 	uint32_t	dpi;
64445 	/* Max number of SQ wqes. */
64446 	uint32_t	sq_size;
64447 	/* Max number of RQ wqes. */
64448 	uint32_t	rq_size;
64449 	uint16_t	sq_fwo_sq_sge;
64450 	/* Max send SGEs per SWQE. */
64451 	#define CMDQ_CREATE_QP_SQ_SGE_MASK UINT32_C(0xf)
64452 	#define CMDQ_CREATE_QP_SQ_SGE_SFT 0
64453 	/* Offset of First WQE in the first SQ page, in 128 byte units */
64454 	#define CMDQ_CREATE_QP_SQ_FWO_MASK UINT32_C(0xfff0)
64455 	#define CMDQ_CREATE_QP_SQ_FWO_SFT 4
64456 	uint16_t	rq_fwo_rq_sge;
64457 	/*
64458 	 * Max recv SGEs per RWQE.
64459 	 * On chips with variable-size WQE support, a value of zero implies 30 SGEs.
64460 	 */
64461 	#define CMDQ_CREATE_QP_RQ_SGE_MASK UINT32_C(0xf)
64462 	#define CMDQ_CREATE_QP_RQ_SGE_SFT 0
64463 	/* Offset of First WQE in the first RQ page, in 128 byte units */
64464 	#define CMDQ_CREATE_QP_RQ_FWO_MASK UINT32_C(0xfff0)
64465 	#define CMDQ_CREATE_QP_RQ_FWO_SFT 4
64466 	/* Send CQ context id. */
64467 	uint32_t	scq_cid;
64468 	/* Receive CQ context id. */
64469 	uint32_t	rcq_cid;
64470 	/* SRQ context id. */
64471 	uint32_t	srq_cid;
64472 	/* Protection domain id. */
64473 	uint32_t	pd_id;
64474 	/* SQ PBL physical address. */
64475 	uint64_t	sq_pbl;
64476 	/* RQ PBL physical address. */
64477 	uint64_t	rq_pbl;
64478 	/* IRRQ address. */
64479 	uint64_t	irrq_addr;
64480 	/* ORRQ address. */
64481 	uint64_t	orrq_addr;
64482 } cmdq_create_qp_t, *pcmdq_create_qp_t;
64483 
64484 /* creq_create_qp_resp (size:128b/16B) */
64485 
64486 typedef struct creq_create_qp_resp {
64487 	uint8_t	type;
64488 	/*
64489 	 * This field indicates the exact type of the completion.
64490 	 * By convention, the LSB identifies the length of the
64491 	 * record in 16B units. Even values indicate 16B
64492 	 * records. Odd values indicate 32B
64493 	 * records.
64494 	 */
64495 	#define CREQ_CREATE_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
64496 	#define CREQ_CREATE_QP_RESP_TYPE_SFT	0
64497 	/* QP Async Notification */
64498 		#define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64499 		#define CREQ_CREATE_QP_RESP_TYPE_LAST	CREQ_CREATE_QP_RESP_TYPE_QP_EVENT
64500 	/* Status of the response. */
64501 	uint8_t	status;
64502 	/* Driver supplied handle to associate the command and the response. */
64503 	uint16_t	cookie;
64504 	/* QP context id */
64505 	uint32_t	xid;
64506 	uint8_t	v;
64507 	/*
64508 	 * This value is written by the NIC such that it will be different
64509 	 * for each pass through the completion queue. The even passes
64510 	 * will write 1. The odd passes will write 0.
64511 	 */
64512 	#define CREQ_CREATE_QP_RESP_V	UINT32_C(0x1)
64513 	/* Event or command opcode. */
64514 	uint8_t	event;
64515 	/* Create QP command response. */
64516 	#define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP UINT32_C(0x1)
64517 	#define CREQ_CREATE_QP_RESP_EVENT_LAST	CREQ_CREATE_QP_RESP_EVENT_CREATE_QP
64518 	/*
64519 	 * Support for optimized transmit path to lower latency
64520 	 * for WQEs with inline data has been enabled for this QP.
64521 	 */
64522 	uint8_t	optimized_transmit_enabled;
64523 	uint8_t	reserved48[5];
64524 } creq_create_qp_resp_t, *pcreq_create_qp_resp_t;
64525 
64526 /**************
64527  * destroy_qp *
64528  **************/
64529 
64530 
64531 /* cmdq_destroy_qp (size:192b/24B) */
64532 
64533 typedef struct cmdq_destroy_qp {
64534 	/* Command opcode. */
64535 	uint8_t	opcode;
64536 	/*
64537 	 * Destroy QP command deletes the QP context and ceases
64538 	 * any further reference.
64539 	 */
64540 	#define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP UINT32_C(0x2)
64541 	#define CMDQ_DESTROY_QP_OPCODE_LAST	CMDQ_DESTROY_QP_OPCODE_DESTROY_QP
64542 	/* Size of the command in 16-byte units. */
64543 	uint8_t	cmd_size;
64544 	/* Flags and attribs of the command. */
64545 	uint16_t	flags;
64546 	/* Driver supplied handle to associate the command and the response. */
64547 	uint16_t	cookie;
64548 	/* Size of the response buffer in 16-byte units. */
64549 	uint8_t	resp_size;
64550 	uint8_t	reserved8;
64551 	/* Host address of the response. */
64552 	uint64_t	resp_addr;
64553 	/* QP context id */
64554 	uint32_t	qp_cid;
64555 	uint32_t	unused_0;
64556 } cmdq_destroy_qp_t, *pcmdq_destroy_qp_t;
64557 
64558 /* creq_destroy_qp_resp (size:128b/16B) */
64559 
64560 typedef struct creq_destroy_qp_resp {
64561 	uint8_t	type;
64562 	/*
64563 	 * This field indicates the exact type of the completion.
64564 	 * By convention, the LSB identifies the length of the
64565 	 * record in 16B units. Even values indicate 16B
64566 	 * records. Odd values indicate 32B
64567 	 * records.
64568 	 */
64569 	#define CREQ_DESTROY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
64570 	#define CREQ_DESTROY_QP_RESP_TYPE_SFT	0
64571 	/* QP Async Notification */
64572 		#define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64573 		#define CREQ_DESTROY_QP_RESP_TYPE_LAST	CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT
64574 	/* Status of the response. */
64575 	uint8_t	status;
64576 	/* Driver supplied handle to associate the command and the response. */
64577 	uint16_t	cookie;
64578 	/* QP context id */
64579 	uint32_t	xid;
64580 	uint8_t	v;
64581 	/*
64582 	 * This value is written by the NIC such that it will be different
64583 	 * for each pass through the completion queue. The even passes
64584 	 * will write 1. The odd passes will write 0.
64585 	 */
64586 	#define CREQ_DESTROY_QP_RESP_V	UINT32_C(0x1)
64587 	/* Event or command opcode. */
64588 	uint8_t	event;
64589 	/* Destroy QP command response. */
64590 	#define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP UINT32_C(0x2)
64591 	#define CREQ_DESTROY_QP_RESP_EVENT_LAST	CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP
64592 	uint8_t	reserved48[6];
64593 } creq_destroy_qp_resp_t, *pcreq_destroy_qp_resp_t;
64594 
64595 /*************
64596  * modify_qp *
64597  *************/
64598 
64599 
64600 /* cmdq_modify_qp (size:1024b/128B) */
64601 
64602 typedef struct cmdq_modify_qp {
64603 	/* Command opcode. */
64604 	uint8_t	opcode;
64605 	/*
64606 	 * Modify QP command changes QP states and other QP specific
64607 	 * parameters.
64608 	 */
64609 	#define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP UINT32_C(0x3)
64610 	#define CMDQ_MODIFY_QP_OPCODE_LAST	CMDQ_MODIFY_QP_OPCODE_MODIFY_QP
64611 	/* Size of the command in 16-byte units. */
64612 	uint8_t	cmd_size;
64613 	/* Flags and attribs of the command. */
64614 	uint16_t	flags;
64615 	/* Driver supplied handle to associate the command and the response. */
64616 	uint16_t	cookie;
64617 	/* Size of the response buffer in 16-byte units. */
64618 	uint8_t	resp_size;
64619 	uint8_t	reserved8;
64620 	/* Host address of the response. */
64621 	uint64_t	resp_addr;
64622 	/* Modify mask signifies the field that is requesting the change. */
64623 	uint32_t	modify_mask;
64624 	/* QP state change. */
64625 	#define CMDQ_MODIFY_QP_MODIFY_MASK_STATE		UINT32_C(0x1)
64626 	/* Enable SQ drain asynchronous notification change. */
64627 	#define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x2)
64628 	/* Access change. */
64629 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS		UINT32_C(0x4)
64630 	/* P_KEY change. */
64631 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY			UINT32_C(0x8)
64632 	/* Q_KEY index change. */
64633 	#define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY			UINT32_C(0x10)
64634 	/* Destination GID change. */
64635 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DGID			UINT32_C(0x20)
64636 	/* Flow label change. */
64637 	#define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL		UINT32_C(0x40)
64638 	/* SGID change. */
64639 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX		UINT32_C(0x80)
64640 	/* Hop limit change. */
64641 	#define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT		UINT32_C(0x100)
64642 	/* Traffic class change. */
64643 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS	UINT32_C(0x200)
64644 	/* destination MAC change. */
64645 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC		UINT32_C(0x400)
64646 	/* Ping pong push mode change. */
64647 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PINGPONG_PUSH_MODE	UINT32_C(0x800)
64648 	/* Path MTU change. */
64649 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU		UINT32_C(0x1000)
64650 	/* Timeout change. */
64651 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT		UINT32_C(0x2000)
64652 	/* Retry count change. */
64653 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT		UINT32_C(0x4000)
64654 	/* RNR Retry change. */
64655 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY		UINT32_C(0x8000)
64656 	/* RQ start packet sequence number change. */
64657 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN		UINT32_C(0x10000)
64658 	/* Max outstanding RDMA read atomic change. */
64659 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC	UINT32_C(0x20000)
64660 	/* RNR minimum timer change. */
64661 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER	UINT32_C(0x40000)
64662 	/* SQ start packet sequence number change. */
64663 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN		UINT32_C(0x80000)
64664 	/* Max destination outstanding RDMA read atomic change. */
64665 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC	UINT32_C(0x100000)
64666 	/* Max send WQE change. */
64667 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE		UINT32_C(0x200000)
64668 	/* Max recv WQE change. */
64669 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE		UINT32_C(0x400000)
64670 	/* Max recv SGEs per SWQE change. */
64671 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE		UINT32_C(0x800000)
64672 	/* Max send SGEs per RWQE change. */
64673 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE		UINT32_C(0x1000000)
64674 	/* Max inline data length change. */
64675 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA	UINT32_C(0x2000000)
64676 	/* Destination QP id change. */
64677 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID		UINT32_C(0x4000000)
64678 	/* Source MAC change. */
64679 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC		UINT32_C(0x8000000)
64680 	/* Source VLAN id change. */
64681 	#define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID		UINT32_C(0x10000000)
64682 	/* Congestion control RoCE v2 change. */
64683 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC		UINT32_C(0x20000000)
64684 	/* IP TOS ECN change */
64685 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN		UINT32_C(0x40000000)
64686 	/* IP TOS DSCP change */
64687 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP		UINT32_C(0x80000000)
64688 	/* QP context id */
64689 	uint32_t	qp_cid;
64690 	uint8_t	network_type_en_sqd_async_notify_new_state;
64691 	/* New QP state. */
64692 	#define CMDQ_MODIFY_QP_NEW_STATE_MASK	UINT32_C(0xf)
64693 	#define CMDQ_MODIFY_QP_NEW_STATE_SFT	0
64694 	/* Reset. */
64695 		#define CMDQ_MODIFY_QP_NEW_STATE_RESET	UINT32_C(0x0)
64696 	/* Init. */
64697 		#define CMDQ_MODIFY_QP_NEW_STATE_INIT		UINT32_C(0x1)
64698 	/* Ready To Receive. */
64699 		#define CMDQ_MODIFY_QP_NEW_STATE_RTR		UINT32_C(0x2)
64700 	/* Ready To Send. */
64701 		#define CMDQ_MODIFY_QP_NEW_STATE_RTS		UINT32_C(0x3)
64702 	/* SQ Drain. */
64703 		#define CMDQ_MODIFY_QP_NEW_STATE_SQD		UINT32_C(0x4)
64704 	/* SQ Error. */
64705 		#define CMDQ_MODIFY_QP_NEW_STATE_SQE		UINT32_C(0x5)
64706 	/* Error. */
64707 		#define CMDQ_MODIFY_QP_NEW_STATE_ERR		UINT32_C(0x6)
64708 		#define CMDQ_MODIFY_QP_NEW_STATE_LAST	CMDQ_MODIFY_QP_NEW_STATE_ERR
64709 	/* Enable SQ drain asynchronous notification. */
64710 	#define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x10)
64711 	/* unused1 is 1 b */
64712 	#define CMDQ_MODIFY_QP_UNUSED1		UINT32_C(0x20)
64713 	/* network type. */
64714 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK	UINT32_C(0xc0)
64715 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT	6
64716 	/* RoCEv1. */
64717 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1	(UINT32_C(0x0) << 6)
64718 	/* RoCEv2 IPv4. */
64719 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4  (UINT32_C(0x2) << 6)
64720 	/* RoCEv2 IPv6. */
64721 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6  (UINT32_C(0x3) << 6)
64722 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST	CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6
64723 	/* Access flags. */
64724 	uint8_t	access;
64725 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK		UINT32_C(0xff)
64726 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT		0
64727 	/* Local write access. */
64728 	#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE							UINT32_C(0x1)
64729 	/* Remote write access. */
64730 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE							UINT32_C(0x2)
64731 	/* Remote read access. */
64732 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ							UINT32_C(0x4)
64733 	/* Remote atomic access. */
64734 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC							UINT32_C(0x8)
64735 	/* P_KEY. */
64736 	uint16_t	pkey;
64737 	/* Q_KEY. */
64738 	uint32_t	qkey;
64739 	/* Destination GID. */
64740 	uint32_t	dgid[4];
64741 	/* Flow label. */
64742 	uint32_t	flow_label;
64743 	/* Source GID index. */
64744 	uint16_t	sgid_index;
64745 	/* Hop limit. */
64746 	uint8_t	hop_limit;
64747 	/* Traffic class. */
64748 	uint8_t	traffic_class;
64749 	/* Destination MAC address. */
64750 	uint16_t	dest_mac[3];
64751 	uint8_t	tos_dscp_tos_ecn;
64752 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
64753 	#define CMDQ_MODIFY_QP_TOS_ECN_MASK UINT32_C(0x3)
64754 	#define CMDQ_MODIFY_QP_TOS_ECN_SFT  0
64755 	/* IP TOS DSCP. */
64756 	#define CMDQ_MODIFY_QP_TOS_DSCP_MASK UINT32_C(0xfc)
64757 	#define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
64758 	uint8_t	path_mtu_pingpong_push_enable;
64759 	/*
64760 	 * Driver requests for ping pong push mode to be enabled for this
64761 	 * QP. This request can be done only during modify from RST to INIT
64762 	 * state.
64763 	 */
64764 	#define CMDQ_MODIFY_QP_PINGPONG_PUSH_ENABLE	UINT32_C(0x1)
64765 	/* unused3 is 3 b */
64766 	#define CMDQ_MODIFY_QP_UNUSED3_MASK		UINT32_C(0xe)
64767 	#define CMDQ_MODIFY_QP_UNUSED3_SFT		1
64768 	/* Path MTU. */
64769 	#define CMDQ_MODIFY_QP_PATH_MTU_MASK		UINT32_C(0xf0)
64770 	#define CMDQ_MODIFY_QP_PATH_MTU_SFT		4
64771 	/* 256. */
64772 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_256	(UINT32_C(0x0) << 4)
64773 	/* 512. */
64774 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_512	(UINT32_C(0x1) << 4)
64775 	/* 1024. */
64776 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024	(UINT32_C(0x2) << 4)
64777 	/* 2048. */
64778 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048	(UINT32_C(0x3) << 4)
64779 	/* 4096. */
64780 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096	(UINT32_C(0x4) << 4)
64781 	/* 8192. */
64782 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192	(UINT32_C(0x5) << 4)
64783 		#define CMDQ_MODIFY_QP_PATH_MTU_LAST		CMDQ_MODIFY_QP_PATH_MTU_MTU_8192
64784 	/* Timeout value for SWQEs. */
64785 	uint8_t	timeout;
64786 	/* Max retry count for WQEs. */
64787 	uint8_t	retry_cnt;
64788 	/* Max RNR retry count for WQEs. */
64789 	uint8_t	rnr_retry;
64790 	/* Min RNR timer that the QP will report to the remote. */
64791 	uint8_t	min_rnr_timer;
64792 	/* RQ start packet sequence number. */
64793 	uint32_t	rq_psn;
64794 	/* SQ start packet sequence number. */
64795 	uint32_t	sq_psn;
64796 	/* Max outstanding RDMA read atomic. */
64797 	uint8_t	max_rd_atomic;
64798 	/* Max destination outstanding RDMA read atomic. */
64799 	uint8_t	max_dest_rd_atomic;
64800 	uint16_t	enable_cc;
64801 	/* Enable congestion control. */
64802 	#define CMDQ_MODIFY_QP_ENABLE_CC	UINT32_C(0x1)
64803 	/* unused15 is 15 b */
64804 	#define CMDQ_MODIFY_QP_UNUSED15_MASK UINT32_C(0xfffe)
64805 	#define CMDQ_MODIFY_QP_UNUSED15_SFT  1
64806 	/* Max send WQE. */
64807 	uint32_t	sq_size;
64808 	/* Max recv WQE. */
64809 	uint32_t	rq_size;
64810 	/* Max send SGEs per SWQE. */
64811 	uint16_t	sq_sge;
64812 	/* Max recv SGEs per RWQE. */
64813 	uint16_t	rq_sge;
64814 	/* Max inline data length (upto 120 bytes). */
64815 	uint32_t	max_inline_data;
64816 	/* Destination QP id. */
64817 	uint32_t	dest_qp_id;
64818 	/* This is the DPI RoCE driver allocated for ping pong push. */
64819 	uint32_t	pingpong_push_dpi;
64820 	/* Source MAC. (Unused. Comes from Source GID index) */
64821 	uint16_t	src_mac[3];
64822 	uint16_t	vlan_pcp_vlan_dei_vlan_id;
64823 	/* VLAN id. (Unused. Comes from Source GID index) */
64824 	#define CMDQ_MODIFY_QP_VLAN_ID_MASK UINT32_C(0xfff)
64825 	#define CMDQ_MODIFY_QP_VLAN_ID_SFT  0
64826 	/* VLAN DEI field - Drop Eligibility Indicator. */
64827 	#define CMDQ_MODIFY_QP_VLAN_DEI	UINT32_C(0x1000)
64828 	/* VLAN PCP field - Priority Code Point. */
64829 	#define CMDQ_MODIFY_QP_VLAN_PCP_MASK UINT32_C(0xe000)
64830 	#define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
64831 	/* IRRQ address. */
64832 	uint64_t	irrq_addr;
64833 	/* ORRQ address. */
64834 	uint64_t	orrq_addr;
64835 } cmdq_modify_qp_t, *pcmdq_modify_qp_t;
64836 
64837 /* creq_modify_qp_resp (size:128b/16B) */
64838 
64839 typedef struct creq_modify_qp_resp {
64840 	uint8_t	type;
64841 	/*
64842 	 * This field indicates the exact type of the completion.
64843 	 * By convention, the LSB identifies the length of the
64844 	 * record in 16B units. Even values indicate 16B
64845 	 * records. Odd values indicate 32B
64846 	 * records.
64847 	 */
64848 	#define CREQ_MODIFY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
64849 	#define CREQ_MODIFY_QP_RESP_TYPE_SFT	0
64850 	/* QP Async Notification */
64851 		#define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64852 		#define CREQ_MODIFY_QP_RESP_TYPE_LAST	CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT
64853 	/* Status of the response. */
64854 	uint8_t	status;
64855 	/* Driver supplied handle to associate the command and the response. */
64856 	uint16_t	cookie;
64857 	/* QP context id */
64858 	uint32_t	xid;
64859 	uint8_t	v;
64860 	/*
64861 	 * This value is written by the NIC such that it will be different
64862 	 * for each pass through the completion queue. The even passes
64863 	 * will write 1. The odd passes will write 0.
64864 	 */
64865 	#define CREQ_MODIFY_QP_RESP_V	UINT32_C(0x1)
64866 	/* Event or command opcode. */
64867 	uint8_t	event;
64868 	/* Modify QP command response. */
64869 	#define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP UINT32_C(0x3)
64870 	#define CREQ_MODIFY_QP_RESP_EVENT_LAST	CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP
64871 	uint8_t	pingpong_push_state_index_enabled;
64872 	/*
64873 	 * When set it indicates that FW was able to successfully enable
64874 	 * ping pong push mode for this QP.
64875 	 */
64876 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_ENABLED	UINT32_C(0x1)
64877 	/*
64878 	 * When ping pong push mode is enabled this field will give the
64879 	 * index into the push page where the QP has been mapped.
64880 	 */
64881 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_MASK  UINT32_C(0xe)
64882 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_SFT   1
64883 	/*
64884 	 * This bit will tell whether to use ping or pong buffer
64885 	 * for first push operation. 0 - ping buffer, 1 - pong buffer.
64886 	 */
64887 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_STATE	UINT32_C(0x10)
64888 	uint8_t	reserved8;
64889 	/* Scrambled src mac needed to calculate UDP source port. */
64890 	uint32_t	lag_src_mac;
64891 } creq_modify_qp_resp_t, *pcreq_modify_qp_resp_t;
64892 
64893 /************
64894  * query_qp *
64895  ************/
64896 
64897 
64898 /* cmdq_query_qp (size:192b/24B) */
64899 
64900 typedef struct cmdq_query_qp {
64901 	/* Command opcode. */
64902 	uint8_t	opcode;
64903 	/* Query QP command retrieves info about the specified QP. */
64904 	#define CMDQ_QUERY_QP_OPCODE_QUERY_QP UINT32_C(0x4)
64905 	#define CMDQ_QUERY_QP_OPCODE_LAST	CMDQ_QUERY_QP_OPCODE_QUERY_QP
64906 	/* Size of the command in 16-byte units. */
64907 	uint8_t	cmd_size;
64908 	/* Flags and attribs of the command. */
64909 	uint16_t	flags;
64910 	/* Driver supplied handle to associate the command and the response. */
64911 	uint16_t	cookie;
64912 	/* Size of the response buffer in 16-byte units. */
64913 	uint8_t	resp_size;
64914 	uint8_t	reserved8;
64915 	/* Host address of the response. */
64916 	uint64_t	resp_addr;
64917 	/* QP context id */
64918 	uint32_t	qp_cid;
64919 	uint32_t	unused_0;
64920 } cmdq_query_qp_t, *pcmdq_query_qp_t;
64921 
64922 /* creq_query_qp_resp (size:128b/16B) */
64923 
64924 typedef struct creq_query_qp_resp {
64925 	uint8_t	type;
64926 	/*
64927 	 * This field indicates the exact type of the completion.
64928 	 * By convention, the LSB identifies the length of the
64929 	 * record in 16B units. Even values indicate 16B
64930 	 * records. Odd values indicate 32B
64931 	 * records.
64932 	 */
64933 	#define CREQ_QUERY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
64934 	#define CREQ_QUERY_QP_RESP_TYPE_SFT	0
64935 	/* QP Async Notification */
64936 		#define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
64937 		#define CREQ_QUERY_QP_RESP_TYPE_LAST	CREQ_QUERY_QP_RESP_TYPE_QP_EVENT
64938 	/* Status of the response. */
64939 	uint8_t	status;
64940 	/* Driver supplied handle to associate the command and the response. */
64941 	uint16_t	cookie;
64942 	/* Side buffer size in 16-byte units */
64943 	uint32_t	size;
64944 	uint8_t	v;
64945 	/*
64946 	 * This value is written by the NIC such that it will be different
64947 	 * for each pass through the completion queue. The even passes
64948 	 * will write 1. The odd passes will write 0.
64949 	 */
64950 	#define CREQ_QUERY_QP_RESP_V	UINT32_C(0x1)
64951 	/* Event or command opcode. */
64952 	uint8_t	event;
64953 	/* Query QP command response. */
64954 	#define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP UINT32_C(0x4)
64955 	#define CREQ_QUERY_QP_RESP_EVENT_LAST	CREQ_QUERY_QP_RESP_EVENT_QUERY_QP
64956 	uint8_t	reserved48[6];
64957 } creq_query_qp_resp_t, *pcreq_query_qp_resp_t;
64958 
64959 /* Query QP command response side buffer structure. */
64960 /* creq_query_qp_resp_sb (size:832b/104B) */
64961 
64962 typedef struct creq_query_qp_resp_sb {
64963 	/* Command opcode. */
64964 	uint8_t	opcode;
64965 	/* Query QP command response. */
64966 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP UINT32_C(0x4)
64967 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_LAST	CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP
64968 	/* Status of the response. */
64969 	uint8_t	status;
64970 	/* Driver supplied handle to associate the command and the response. */
64971 	uint16_t	cookie;
64972 	/* Flags and attribs of the command. */
64973 	uint16_t	flags;
64974 	/* Size of the response buffer in 16-byte units. */
64975 	uint8_t	resp_size;
64976 	uint8_t	reserved8;
64977 	/* QP context id */
64978 	uint32_t	xid;
64979 	uint8_t	en_sqd_async_notify_state;
64980 	/* QP state */
64981 	#define CREQ_QUERY_QP_RESP_SB_STATE_MASK		UINT32_C(0xf)
64982 	#define CREQ_QUERY_QP_RESP_SB_STATE_SFT		0
64983 	/* Reset. */
64984 		#define CREQ_QUERY_QP_RESP_SB_STATE_RESET		UINT32_C(0x0)
64985 	/* Init. */
64986 		#define CREQ_QUERY_QP_RESP_SB_STATE_INIT		UINT32_C(0x1)
64987 	/* Ready To Receive. */
64988 		#define CREQ_QUERY_QP_RESP_SB_STATE_RTR		UINT32_C(0x2)
64989 	/* Ready To Send. */
64990 		#define CREQ_QUERY_QP_RESP_SB_STATE_RTS		UINT32_C(0x3)
64991 	/* SQ Drain. */
64992 		#define CREQ_QUERY_QP_RESP_SB_STATE_SQD		UINT32_C(0x4)
64993 	/* SQ Error. */
64994 		#define CREQ_QUERY_QP_RESP_SB_STATE_SQE		UINT32_C(0x5)
64995 	/* Error. */
64996 		#define CREQ_QUERY_QP_RESP_SB_STATE_ERR		UINT32_C(0x6)
64997 		#define CREQ_QUERY_QP_RESP_SB_STATE_LAST		CREQ_QUERY_QP_RESP_SB_STATE_ERR
64998 	/* SQ drain asynchronous notification. */
64999 	#define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x10)
65000 	/* Enable congestion control. */
65001 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_MASK		UINT32_C(0xe0)
65002 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_SFT		5
65003 	/* Access flags. */
65004 	uint8_t	access;
65005 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK		UINT32_C(0xff)
65006 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT		0
65007 	/* Local write access. */
65008 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE							UINT32_C(0x1)
65009 	/* Remote write access. */
65010 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE							UINT32_C(0x2)
65011 	/* Remote read access. */
65012 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ							UINT32_C(0x4)
65013 	/* Remote atomic access. */
65014 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC							UINT32_C(0x8)
65015 	/* P_KEY index. */
65016 	uint16_t	pkey;
65017 	/* Q_KEY. */
65018 	uint32_t	qkey;
65019 	uint32_t	reserved32;
65020 	/* Destination GID. */
65021 	uint32_t	dgid[4];
65022 	/* Flow label. */
65023 	uint32_t	flow_label;
65024 	/* Source GID index. */
65025 	uint16_t	sgid_index;
65026 	/* Hop limit. */
65027 	uint8_t	hop_limit;
65028 	/* Traffic class. */
65029 	uint8_t	traffic_class;
65030 	/* Destination MAC address. */
65031 	uint16_t	dest_mac[3];
65032 	uint16_t	path_mtu_dest_vlan_id;
65033 	/* Destination VLAN ID. */
65034 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK UINT32_C(0xfff)
65035 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
65036 	/* Path MTU. */
65037 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK	UINT32_C(0xf000)
65038 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT	12
65039 	/* 256. */
65040 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256   (UINT32_C(0x0) << 12)
65041 	/* 512. */
65042 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512   (UINT32_C(0x1) << 12)
65043 	/* 1024. */
65044 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024  (UINT32_C(0x2) << 12)
65045 	/* 2048. */
65046 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048  (UINT32_C(0x3) << 12)
65047 	/* 4096. */
65048 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096  (UINT32_C(0x4) << 12)
65049 	/* 8192. */
65050 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192  (UINT32_C(0x5) << 12)
65051 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_LAST	CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192
65052 	/* Timeout value for SWQEs. */
65053 	uint8_t	timeout;
65054 	/* Max retry count for WQEs. */
65055 	uint8_t	retry_cnt;
65056 	/* Max RNR retry count for WQEs. */
65057 	uint8_t	rnr_retry;
65058 	/* Min RNR timer that the QP will report to the remote. */
65059 	uint8_t	min_rnr_timer;
65060 	/* RQ start packet sequence number. */
65061 	uint32_t	rq_psn;
65062 	/* SQ start packet sequence number. */
65063 	uint32_t	sq_psn;
65064 	/* Max outstanding RDMA read atomic. */
65065 	uint8_t	max_rd_atomic;
65066 	/* Max destination outstanding RDMA read atomic. */
65067 	uint8_t	max_dest_rd_atomic;
65068 	uint8_t	tos_dscp_tos_ecn;
65069 	/* IP TOS ECN. */
65070 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
65071 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT  0
65072 	/* IP TOS DSCP. */
65073 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
65074 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
65075 	uint8_t	enable_cc;
65076 	/* enable_cc is 1 b */
65077 	#define CREQ_QUERY_QP_RESP_SB_ENABLE_CC	UINT32_C(0x1)
65078 	/* Max send WQE. */
65079 	uint32_t	sq_size;
65080 	/* Max recv WQE. */
65081 	uint32_t	rq_size;
65082 	/* Max send SGEs per SWQE. */
65083 	uint16_t	sq_sge;
65084 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
65085 	uint16_t	rq_sge;
65086 	/* Max inline data length (upto 120 bytes). */
65087 	uint32_t	max_inline_data;
65088 	/* Destination QP id. */
65089 	uint32_t	dest_qp_id;
65090 	/* Port ID associated with the QP. */
65091 	uint16_t	port_id;
65092 	uint8_t	unused_0;
65093 	/* Statistic collection ID allocated for this QP. */
65094 	uint8_t	stat_collection_id;
65095 	/* Source MAC. */
65096 	uint16_t	src_mac[3];
65097 	uint16_t	vlan_pcp_vlan_dei_vlan_id;
65098 	/* Source VLAN id. */
65099 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK UINT32_C(0xfff)
65100 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT  0
65101 	/* VLAN DEI field - Drop Eligibility Indicator. */
65102 	#define CREQ_QUERY_QP_RESP_SB_VLAN_DEI	UINT32_C(0x1000)
65103 	/* VLAN PCP field - Priority Code Point. */
65104 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK UINT32_C(0xe000)
65105 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
65106 } creq_query_qp_resp_sb_t, *pcreq_query_qp_resp_sb_t;
65107 
65108 /*******************
65109  * query_qp_extend *
65110  *******************/
65111 
65112 
65113 /* cmdq_query_qp_extend (size:192b/24B) */
65114 
65115 typedef struct cmdq_query_qp_extend {
65116 	/* Command opcode. */
65117 	uint8_t	opcode;
65118 	/*
65119 	 * Query QP extend command retrieves info about multiple QPs associated
65120 	 * with a specific PF.
65121 	 */
65122 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
65123 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_LAST	CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND
65124 	/* Size of the command in 16-byte units. */
65125 	uint8_t	cmd_size;
65126 	/* Flags and attribs of the command. */
65127 	uint16_t	flags;
65128 	/* Driver supplied handle to associate the command and the response. */
65129 	uint16_t	cookie;
65130 	/* Size of the response buffer in 16-byte units. */
65131 	uint8_t	resp_size;
65132 	/* Number of QPs for which FW needs to query and provide info back to host. */
65133 	uint8_t	num_qps;
65134 	/* Host address of the response. */
65135 	uint64_t	resp_addr;
65136 	/* Unique identified for a function */
65137 	uint32_t	function_id;
65138 	/* PF number */
65139 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_MASK  UINT32_C(0xff)
65140 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_SFT   0
65141 	/* VF number */
65142 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_MASK  UINT32_C(0xffff00)
65143 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_SFT   8
65144 	/* When set the vf_num is valid. */
65145 	#define CMDQ_QUERY_QP_EXTEND_VF_VALID	UINT32_C(0x1000000)
65146 	/*
65147 	 * This is the current index where firmware left off for query qp. Driver
65148 	 * will pass this back in the next query_qp_extend command.
65149 	 */
65150 	uint32_t	current_index;
65151 } cmdq_query_qp_extend_t, *pcmdq_query_qp_extend_t;
65152 
65153 /* creq_query_qp_extend_resp (size:128b/16B) */
65154 
65155 typedef struct creq_query_qp_extend_resp {
65156 	uint8_t	type;
65157 	/*
65158 	 * This field indicates the exact type of the completion.
65159 	 * By convention, the LSB identifies the length of the
65160 	 * record in 16B units. Even values indicate 16B
65161 	 * records. Odd values indicate 32B
65162 	 * records.
65163 	 */
65164 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_MASK	UINT32_C(0x3f)
65165 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_SFT	0
65166 	/* QP Async Notification */
65167 		#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65168 		#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT
65169 	/* Status of the response. */
65170 	uint8_t	status;
65171 	/* Driver supplied handle to associate the command and the response. */
65172 	uint16_t	cookie;
65173 	/* Side buffer size in 16-byte units */
65174 	uint32_t	size;
65175 	uint8_t	v;
65176 	/*
65177 	 * This value is written by the NIC such that it will be different
65178 	 * for each pass through the completion queue. The even passes
65179 	 * will write 1. The odd passes will write 0.
65180 	 */
65181 	#define CREQ_QUERY_QP_EXTEND_RESP_V	UINT32_C(0x1)
65182 	/* Event or command opcode. */
65183 	uint8_t	event;
65184 	/* Query QP extend command response. */
65185 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND UINT32_C(0x91)
65186 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_LAST	CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND
65187 	uint16_t	reserved16;
65188 	/*
65189 	 * This is the current index where firmware left off for query qp. Driver
65190 	 * will pass this back in the next query_qp_extend command.
65191 	 */
65192 	uint32_t	current_index;
65193 } creq_query_qp_extend_resp_t, *pcreq_query_qp_extend_resp_t;
65194 
65195 /* Query QP extend command response side buffer structure. */
65196 /* creq_query_qp_extend_resp_sb (size:384b/48B) */
65197 
65198 typedef struct creq_query_qp_extend_resp_sb {
65199 	/* Command opcode. */
65200 	uint8_t	opcode;
65201 	/* Query QP command extend response. */
65202 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
65203 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND
65204 	/* Status of the response. */
65205 	uint8_t	status;
65206 	/* Driver supplied handle to associate the command and the response. */
65207 	uint16_t	cookie;
65208 	/* Flags and attribs of the command. */
65209 	uint16_t	flags;
65210 	/* Size of the response buffer in 16-byte units. */
65211 	uint8_t	resp_size;
65212 	uint8_t	reserved8;
65213 	/* QP context id */
65214 	uint32_t	xid;
65215 	uint8_t	state;
65216 	/* QP state */
65217 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_MASK  UINT32_C(0xf)
65218 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SFT   0
65219 	/* Reset. */
65220 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RESET   UINT32_C(0x0)
65221 	/* Init. */
65222 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_INIT	UINT32_C(0x1)
65223 	/* Ready To Receive. */
65224 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTR	UINT32_C(0x2)
65225 	/* Ready To Send. */
65226 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTS	UINT32_C(0x3)
65227 	/* SQ Drain. */
65228 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQD	UINT32_C(0x4)
65229 	/* SQ Error. */
65230 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQE	UINT32_C(0x5)
65231 	/* Error. */
65232 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR	UINT32_C(0x6)
65233 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_LAST   CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR
65234 	/*  */
65235 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_MASK UINT32_C(0xf0)
65236 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_SFT 4
65237 	uint8_t	reserved_8;
65238 	/* Port ID associated with the QP. */
65239 	uint16_t	port_id;
65240 	/* Q_KEY. */
65241 	uint32_t	qkey;
65242 	/* Source GID index. */
65243 	uint16_t	sgid_index;
65244 	/* Network type. */
65245 	uint8_t	network_type;
65246 	/* RoCEv1. */
65247 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV1	UINT32_C(0x0)
65248 	/* RoCEv2 IPv4. */
65249 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
65250 	/* RoCEv2 IPv6. */
65251 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
65252 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6
65253 	uint8_t	unused_0;
65254 	/* Destination GID. */
65255 	uint32_t	dgid[4];
65256 	/* Destination QP id. */
65257 	uint32_t	dest_qp_id;
65258 	/* Statistic collection ID allocated for this QP. */
65259 	uint8_t	stat_collection_id;
65260 	uint8_t	reservred_8;
65261 	uint16_t	reserved_16;
65262 } creq_query_qp_extend_resp_sb_t, *pcreq_query_qp_extend_resp_sb_t;
65263 
65264 /*
65265  * TLV encapsulated Query QP extend control command response
65266  * side buffer.
65267  */
65268 /* creq_query_qp_extend_resp_sb_tlv (size:512b/64B) */
65269 
65270 typedef struct creq_query_qp_extend_resp_sb_tlv {
65271 	/*
65272 	 * The command discriminator is used to differentiate between various
65273 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
65274 	 * command messages as well as newer TLV encapsulated HWRM commands.
65275 	 *
65276 	 * For TLV encapsulated messages this field must be 0x8000.
65277 	 */
65278 	uint16_t	cmd_discr;
65279 	uint8_t	reserved_8b;
65280 	uint8_t	tlv_flags;
65281 	/*
65282 	 * Indicates the presence of additional TLV encapsulated data
65283 	 * follows this TLV.
65284 	 */
65285 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
65286 	/* Last TLV in a sequence of TLVs. */
65287 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
65288 	/* More TLVs follow this TLV. */
65289 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
65290 	/*
65291 	 * When an HWRM receiver detects a TLV type that it does not
65292 	 * support with the TLV required flag set, the receiver must
65293 	 * reject the HWRM message with an error code indicating an
65294 	 * unsupported TLV type.
65295 	 */
65296 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
65297 	/* No */
65298 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
65299 	/* Yes */
65300 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
65301 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
65302 	/*
65303 	 * This field defines the TLV type value which is divided into
65304 	 * two ranges to differentiate between global and local TLV types.
65305 	 * Global TLV types must be unique across all defined TLV types.
65306 	 * Local TLV types are valid only for extensions to a given
65307 	 * HWRM message and may be repeated across different HWRM message
65308 	 * types. There is a direct correlation of each HWRM message type
65309 	 * to a single global TLV type value.
65310 	 *
65311 	 * Global TLV range: `0 - (63k-1)`
65312 	 *
65313 	 * Local TLV range: `63k - (64k-1)`
65314 	 */
65315 	uint16_t	tlv_type;
65316 	/*
65317 	 * Length of the message data encapsulated by this TLV in bytes.
65318 	 * This length does not include the size of the TLV header itself
65319 	 * and it must be an integer multiple of 8B.
65320 	 */
65321 	uint16_t	length;
65322 	/*
65323 	 * Size of the tlv encapsulated response,
65324 	 * including all tlvs and extension data in 16-byte units.
65325 	 */
65326 	uint8_t	total_size;
65327 	uint8_t	reserved56[7];
65328 	/* Command opcode. */
65329 	uint8_t	opcode;
65330 	/* Query QP command extend response. */
65331 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
65332 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND
65333 	/* Status of the response. */
65334 	uint8_t	status;
65335 	/* Driver supplied handle to associate the command and the response. */
65336 	uint16_t	cookie;
65337 	/* Flags and attribs of the command. */
65338 	uint16_t	flags;
65339 	/* Size of the response buffer in 16-byte units. */
65340 	uint8_t	resp_size;
65341 	uint8_t	reserved8;
65342 	/* QP context id */
65343 	uint32_t	xid;
65344 	uint8_t	state;
65345 	/* QP state */
65346 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_MASK  UINT32_C(0xf)
65347 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SFT   0
65348 	/* Reset. */
65349 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RESET   UINT32_C(0x0)
65350 	/* Init. */
65351 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_INIT	UINT32_C(0x1)
65352 	/* Ready To Receive. */
65353 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTR	UINT32_C(0x2)
65354 	/* Ready To Send. */
65355 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTS	UINT32_C(0x3)
65356 	/* SQ Drain. */
65357 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQD	UINT32_C(0x4)
65358 	/* SQ Error. */
65359 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQE	UINT32_C(0x5)
65360 	/* Error. */
65361 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR	UINT32_C(0x6)
65362 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_LAST   CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR
65363 	/*  */
65364 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_MASK UINT32_C(0xf0)
65365 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_SFT 4
65366 	uint8_t	reserved_8;
65367 	/* Port ID associated with the QP. */
65368 	uint16_t	port_id;
65369 	/* Q_KEY. */
65370 	uint32_t	qkey;
65371 	/* Source GID index. */
65372 	uint16_t	sgid_index;
65373 	/* Network type. */
65374 	uint8_t	network_type;
65375 	/* RoCEv1. */
65376 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV1	UINT32_C(0x0)
65377 	/* RoCEv2 IPv4. */
65378 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
65379 	/* RoCEv2 IPv6. */
65380 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
65381 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6
65382 	uint8_t	unused_0;
65383 	/* Destination GID. */
65384 	uint32_t	dgid[4];
65385 	/* Destination QP id. */
65386 	uint32_t	dest_qp_id;
65387 	/* Statistic collection ID allocated for this QP. */
65388 	uint8_t	stat_collection_id;
65389 	uint8_t	reservred_8;
65390 	uint16_t	reserved_16;
65391 } creq_query_qp_extend_resp_sb_tlv_t, *pcreq_query_qp_extend_resp_sb_tlv_t;
65392 
65393 /**************
65394  * create_srq *
65395  **************/
65396 
65397 
65398 /* cmdq_create_srq (size:384b/48B) */
65399 
65400 typedef struct cmdq_create_srq {
65401 	/* Command opcode. */
65402 	uint8_t	opcode;
65403 	/* Create SRQ command allocates a SRQ with the specified parameters. */
65404 	#define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ UINT32_C(0x5)
65405 	#define CMDQ_CREATE_SRQ_OPCODE_LAST	CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ
65406 	/* Size of the command in 16-byte units. */
65407 	uint8_t	cmd_size;
65408 	/* Flags and attribs of the command. */
65409 	uint16_t	flags;
65410 	/* Driver supplied handle to associate the command and the response. */
65411 	uint16_t	cookie;
65412 	/* Size of the response buffer in 16-byte units. */
65413 	uint8_t	resp_size;
65414 	uint8_t	reserved8;
65415 	/* Host address of the response. */
65416 	uint64_t	resp_addr;
65417 	/* SRQ handle. */
65418 	uint64_t	srq_handle;
65419 	uint16_t	pg_size_lvl;
65420 	/* SRQ PBL indirect levels. */
65421 	#define CMDQ_CREATE_SRQ_LVL_MASK	UINT32_C(0x3)
65422 	#define CMDQ_CREATE_SRQ_LVL_SFT	0
65423 	/* PBL pointer is physical start address. */
65424 		#define CMDQ_CREATE_SRQ_LVL_LVL_0	UINT32_C(0x0)
65425 	/* PBL pointer points to PTE table. */
65426 		#define CMDQ_CREATE_SRQ_LVL_LVL_1	UINT32_C(0x1)
65427 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
65428 		#define CMDQ_CREATE_SRQ_LVL_LVL_2	UINT32_C(0x2)
65429 		#define CMDQ_CREATE_SRQ_LVL_LAST	CMDQ_CREATE_SRQ_LVL_LVL_2
65430 	/* page size. */
65431 	#define CMDQ_CREATE_SRQ_PG_SIZE_MASK  UINT32_C(0x1c)
65432 	#define CMDQ_CREATE_SRQ_PG_SIZE_SFT   2
65433 	/* 4KB. */
65434 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
65435 	/* 8KB. */
65436 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
65437 	/* 64KB. */
65438 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
65439 	/* 2MB. */
65440 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
65441 	/* 8MB. */
65442 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
65443 	/* 1GB. */
65444 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
65445 		#define CMDQ_CREATE_SRQ_PG_SIZE_LAST   CMDQ_CREATE_SRQ_PG_SIZE_PG_1G
65446 	/* unused11 is 11 b */
65447 	#define CMDQ_CREATE_SRQ_UNUSED11_MASK UINT32_C(0xffe0)
65448 	#define CMDQ_CREATE_SRQ_UNUSED11_SFT  5
65449 	uint16_t	eventq_id;
65450 	/* eventq_id is 12 b */
65451 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK UINT32_C(0xfff)
65452 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
65453 	/* unused4 is 4 b */
65454 	#define CMDQ_CREATE_SRQ_UNUSED4_MASK  UINT32_C(0xf000)
65455 	#define CMDQ_CREATE_SRQ_UNUSED4_SFT   12
65456 	/* Max number of SRQ wqes. */
65457 	uint16_t	srq_size;
65458 	/* Offset of first WQE in the first page of SRQ, in 128 byte units */
65459 	uint16_t	srq_fwo;
65460 	/* Doorbell page index. */
65461 	uint32_t	dpi;
65462 	/* Protection domain id. */
65463 	uint32_t	pd_id;
65464 	/* RQ PBL physical address. */
65465 	uint64_t	pbl;
65466 } cmdq_create_srq_t, *pcmdq_create_srq_t;
65467 
65468 /* creq_create_srq_resp (size:128b/16B) */
65469 
65470 typedef struct creq_create_srq_resp {
65471 	uint8_t	type;
65472 	/*
65473 	 * This field indicates the exact type of the completion.
65474 	 * By convention, the LSB identifies the length of the
65475 	 * record in 16B units. Even values indicate 16B
65476 	 * records. Odd values indicate 32B
65477 	 * records.
65478 	 */
65479 	#define CREQ_CREATE_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65480 	#define CREQ_CREATE_SRQ_RESP_TYPE_SFT	0
65481 	/* QP Async Notification */
65482 		#define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65483 		#define CREQ_CREATE_SRQ_RESP_TYPE_LAST	CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT
65484 	/* Status of the response. */
65485 	uint8_t	status;
65486 	/* Driver supplied handle to associate the command and the response. */
65487 	uint16_t	cookie;
65488 	/* SRQ context id */
65489 	uint32_t	xid;
65490 	uint8_t	v;
65491 	/*
65492 	 * This value is written by the NIC such that it will be different
65493 	 * for each pass through the completion queue. The even passes
65494 	 * will write 1. The odd passes will write 0.
65495 	 */
65496 	#define CREQ_CREATE_SRQ_RESP_V	UINT32_C(0x1)
65497 	/* Event or command opcode. */
65498 	uint8_t	event;
65499 	/* Create SRQ command response. */
65500 	#define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ UINT32_C(0x5)
65501 	#define CREQ_CREATE_SRQ_RESP_EVENT_LAST	CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ
65502 	uint8_t	reserved48[6];
65503 } creq_create_srq_resp_t, *pcreq_create_srq_resp_t;
65504 
65505 /***************
65506  * destroy_srq *
65507  ***************/
65508 
65509 
65510 /* cmdq_destroy_srq (size:192b/24B) */
65511 
65512 typedef struct cmdq_destroy_srq {
65513 	/* Command opcode. */
65514 	uint8_t	opcode;
65515 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
65516 	#define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ UINT32_C(0x6)
65517 	#define CMDQ_DESTROY_SRQ_OPCODE_LAST	CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ
65518 	/* Size of the command in 16-byte units. */
65519 	uint8_t	cmd_size;
65520 	/* Flags and attribs of the command. */
65521 	uint16_t	flags;
65522 	/* Driver supplied handle to associate the command and the response. */
65523 	uint16_t	cookie;
65524 	/* Size of the response buffer in 16-byte units. */
65525 	uint8_t	resp_size;
65526 	uint8_t	reserved8;
65527 	/* Host address of the response. */
65528 	uint64_t	resp_addr;
65529 	/* SRQ context id */
65530 	uint32_t	srq_cid;
65531 	uint32_t	unused_0;
65532 } cmdq_destroy_srq_t, *pcmdq_destroy_srq_t;
65533 
65534 /* creq_destroy_srq_resp (size:128b/16B) */
65535 
65536 typedef struct creq_destroy_srq_resp {
65537 	uint8_t	type;
65538 	/*
65539 	 * This field indicates the exact type of the completion.
65540 	 * By convention, the LSB identifies the length of the
65541 	 * record in 16B units. Even values indicate 16B
65542 	 * records. Odd values indicate 32B
65543 	 * records.
65544 	 */
65545 	#define CREQ_DESTROY_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65546 	#define CREQ_DESTROY_SRQ_RESP_TYPE_SFT	0
65547 	/* QP Async Notification */
65548 		#define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65549 		#define CREQ_DESTROY_SRQ_RESP_TYPE_LAST	CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT
65550 	/* Status of the response. */
65551 	uint8_t	status;
65552 	/* Driver supplied handle to associate the command and the response. */
65553 	uint16_t	cookie;
65554 	/* SRQ context id */
65555 	uint32_t	xid;
65556 	uint8_t	v;
65557 	/*
65558 	 * This value is written by the NIC such that it will be different
65559 	 * for each pass through the completion queue. The even passes
65560 	 * will write 1. The odd passes will write 0.
65561 	 */
65562 	#define CREQ_DESTROY_SRQ_RESP_V	UINT32_C(0x1)
65563 	/* Event or command opcode. */
65564 	uint8_t	event;
65565 	/* Destroy SRQ command response. */
65566 	#define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ UINT32_C(0x6)
65567 	#define CREQ_DESTROY_SRQ_RESP_EVENT_LAST	CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ
65568 	uint16_t	enable_for_arm[3];
65569 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_MASK	UINT32_C(0xffff)
65570 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_SFT	0
65571 	/* Set to 1 if this SRQ is allowed to be armed for threshold async event */
65572 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK UINT32_C(0x30000)
65573 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
65574 } creq_destroy_srq_resp_t, *pcreq_destroy_srq_resp_t;
65575 
65576 /*************
65577  * query_srq *
65578  *************/
65579 
65580 
65581 /* cmdq_query_srq (size:192b/24B) */
65582 
65583 typedef struct cmdq_query_srq {
65584 	/* Command opcode. */
65585 	uint8_t	opcode;
65586 	/* Query SRP command retrieves info about the specified SRQ. */
65587 	#define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ UINT32_C(0x8)
65588 	#define CMDQ_QUERY_SRQ_OPCODE_LAST	CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ
65589 	/* Size of the command in 16-byte units. */
65590 	uint8_t	cmd_size;
65591 	/* Flags and attribs of the command. */
65592 	uint16_t	flags;
65593 	/* Driver supplied handle to associate the command and the response. */
65594 	uint16_t	cookie;
65595 	/* Size of the response buffer in 16-byte units. */
65596 	uint8_t	resp_size;
65597 	uint8_t	reserved8;
65598 	/* Host address of the response. */
65599 	uint64_t	resp_addr;
65600 	/* SRQ context id */
65601 	uint32_t	srq_cid;
65602 	uint32_t	unused_0;
65603 } cmdq_query_srq_t, *pcmdq_query_srq_t;
65604 
65605 /* creq_query_srq_resp (size:128b/16B) */
65606 
65607 typedef struct creq_query_srq_resp {
65608 	uint8_t	type;
65609 	/*
65610 	 * This field indicates the exact type of the completion.
65611 	 * By convention, the LSB identifies the length of the
65612 	 * record in 16B units. Even values indicate 16B
65613 	 * records. Odd values indicate 32B
65614 	 * records.
65615 	 */
65616 	#define CREQ_QUERY_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65617 	#define CREQ_QUERY_SRQ_RESP_TYPE_SFT	0
65618 	/* QP Async Notification */
65619 		#define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65620 		#define CREQ_QUERY_SRQ_RESP_TYPE_LAST	CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT
65621 	/* Status of the response. */
65622 	uint8_t	status;
65623 	/* Driver supplied handle to associate the command and the response. */
65624 	uint16_t	cookie;
65625 	/* Side buffer size in 16-byte units */
65626 	uint32_t	size;
65627 	uint8_t	v;
65628 	/*
65629 	 * This value is written by the NIC such that it will be different
65630 	 * for each pass through the completion queue. The even passes
65631 	 * will write 1. The odd passes will write 0.
65632 	 */
65633 	#define CREQ_QUERY_SRQ_RESP_V	UINT32_C(0x1)
65634 	/* Event or command opcode. */
65635 	uint8_t	event;
65636 	/* Query SRQ command response. */
65637 	#define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ UINT32_C(0x8)
65638 	#define CREQ_QUERY_SRQ_RESP_EVENT_LAST	CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ
65639 	uint8_t	reserved48[6];
65640 } creq_query_srq_resp_t, *pcreq_query_srq_resp_t;
65641 
65642 /* Query SRQ command response side buffer structure. */
65643 /* creq_query_srq_resp_sb (size:256b/32B) */
65644 
65645 typedef struct creq_query_srq_resp_sb {
65646 	/* Command opcode. */
65647 	uint8_t	opcode;
65648 	/* Query SRQ command response. */
65649 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ UINT32_C(0x8)
65650 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_LAST	CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ
65651 	/* Status of the response. */
65652 	uint8_t	status;
65653 	/* Driver supplied handle to associate the command and the response. */
65654 	uint16_t	cookie;
65655 	/* Flags and attribs of the command. */
65656 	uint16_t	flags;
65657 	/* Size of the response buffer in 16-byte units. */
65658 	uint8_t	resp_size;
65659 	uint8_t	reserved8;
65660 	/* SRQ context id */
65661 	uint32_t	xid;
65662 	/* Watermark value to generate a SRQ limit event. */
65663 	uint16_t	srq_limit;
65664 	uint16_t	reserved16;
65665 	/* data is 128 b */
65666 	uint32_t	data[4];
65667 } creq_query_srq_resp_sb_t, *pcreq_query_srq_resp_sb_t;
65668 
65669 /*************
65670  * create_cq *
65671  *************/
65672 
65673 
65674 /* cmdq_create_cq (size:384b/48B) */
65675 
65676 typedef struct cmdq_create_cq {
65677 	/* Command opcode. */
65678 	uint8_t	opcode;
65679 	/* Create CQ command allocates a CQ with the specified parameters. */
65680 	#define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ UINT32_C(0x9)
65681 	#define CMDQ_CREATE_CQ_OPCODE_LAST	CMDQ_CREATE_CQ_OPCODE_CREATE_CQ
65682 	/* Size of the command in 16-byte units. */
65683 	uint8_t	cmd_size;
65684 	/* Flags and attribs of the command. */
65685 	uint16_t	flags;
65686 	/*
65687 	 * When the HW Doorbell Drop Recovery feature is enabled,
65688 	 * HW can flag false CQ overflow when CQ consumer index
65689 	 * doorbells are dropped when there really wasn't any overflow.
65690 	 * The CQE values could have already been processed by the driver,
65691 	 * but HW doesn't know about this because of the doorbell drop.
65692 	 * To avoid false detection of CQ overflow events,
65693 	 * it is recommended that CQ overflow detection is disabled
65694 	 * by the driver when HW based doorbell recovery is enabled.
65695 	 */
65696 	#define CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x1)
65697 	/* Driver supplied handle to associate the command and the response. */
65698 	uint16_t	cookie;
65699 	/* Size of the response buffer in 16-byte units. */
65700 	uint8_t	resp_size;
65701 	uint8_t	reserved8;
65702 	/* Host address of the response. */
65703 	uint64_t	resp_addr;
65704 	/* CQ handle. */
65705 	uint64_t	cq_handle;
65706 	uint32_t	pg_size_lvl;
65707 	/* PBL indirect levels. */
65708 	#define CMDQ_CREATE_CQ_LVL_MASK	UINT32_C(0x3)
65709 	#define CMDQ_CREATE_CQ_LVL_SFT	0
65710 	/* PBL pointer is physical start address. */
65711 		#define CMDQ_CREATE_CQ_LVL_LVL_0	UINT32_C(0x0)
65712 	/* PBL pointer points to PTE table. */
65713 		#define CMDQ_CREATE_CQ_LVL_LVL_1	UINT32_C(0x1)
65714 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
65715 		#define CMDQ_CREATE_CQ_LVL_LVL_2	UINT32_C(0x2)
65716 		#define CMDQ_CREATE_CQ_LVL_LAST	CMDQ_CREATE_CQ_LVL_LVL_2
65717 	/* page size. */
65718 	#define CMDQ_CREATE_CQ_PG_SIZE_MASK  UINT32_C(0x1c)
65719 	#define CMDQ_CREATE_CQ_PG_SIZE_SFT   2
65720 	/* 4KB. */
65721 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
65722 	/* 8KB. */
65723 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
65724 	/* 64KB. */
65725 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
65726 	/* 2MB. */
65727 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
65728 	/* 8MB. */
65729 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
65730 	/* 1GB. */
65731 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
65732 		#define CMDQ_CREATE_CQ_PG_SIZE_LAST   CMDQ_CREATE_CQ_PG_SIZE_PG_1G
65733 	/* unused27 is 27 b */
65734 	#define CMDQ_CREATE_CQ_UNUSED27_MASK UINT32_C(0xffffffe0)
65735 	#define CMDQ_CREATE_CQ_UNUSED27_SFT  5
65736 	uint32_t	cq_fco_cnq_id;
65737 	/* cnq_id is 12 b */
65738 	#define CMDQ_CREATE_CQ_CNQ_ID_MASK UINT32_C(0xfff)
65739 	#define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
65740 	/* Offset of first CQE in the first Page, in 32 byte units */
65741 	#define CMDQ_CREATE_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
65742 	#define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
65743 	/* Doorbell page index. */
65744 	uint32_t	dpi;
65745 	/* Max number of CQ wqes. */
65746 	uint32_t	cq_size;
65747 	/* CQ PBL physical address. */
65748 	uint64_t	pbl;
65749 } cmdq_create_cq_t, *pcmdq_create_cq_t;
65750 
65751 /* creq_create_cq_resp (size:128b/16B) */
65752 
65753 typedef struct creq_create_cq_resp {
65754 	uint8_t	type;
65755 	/*
65756 	 * This field indicates the exact type of the completion.
65757 	 * By convention, the LSB identifies the length of the
65758 	 * record in 16B units. Even values indicate 16B
65759 	 * records. Odd values indicate 32B
65760 	 * records.
65761 	 */
65762 	#define CREQ_CREATE_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65763 	#define CREQ_CREATE_CQ_RESP_TYPE_SFT	0
65764 	/* QP Async Notification */
65765 		#define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65766 		#define CREQ_CREATE_CQ_RESP_TYPE_LAST	CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT
65767 	/* Status of the response. */
65768 	uint8_t	status;
65769 	/* Driver supplied handle to associate the command and the response. */
65770 	uint16_t	cookie;
65771 	/* CQ context id */
65772 	uint32_t	xid;
65773 	uint8_t	v;
65774 	/*
65775 	 * This value is written by the NIC such that it will be different
65776 	 * for each pass through the completion queue. The even passes
65777 	 * will write 1. The odd passes will write 0.
65778 	 */
65779 	#define CREQ_CREATE_CQ_RESP_V	UINT32_C(0x1)
65780 	/* Event or command opcode. */
65781 	uint8_t	event;
65782 	/* Create CQ command response. */
65783 	#define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ UINT32_C(0x9)
65784 	#define CREQ_CREATE_CQ_RESP_EVENT_LAST	CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ
65785 	uint8_t	reserved48[6];
65786 } creq_create_cq_resp_t, *pcreq_create_cq_resp_t;
65787 
65788 /**************
65789  * destroy_cq *
65790  **************/
65791 
65792 
65793 /* cmdq_destroy_cq (size:192b/24B) */
65794 
65795 typedef struct cmdq_destroy_cq {
65796 	/* Command opcode. */
65797 	uint8_t	opcode;
65798 	/* Destroy CQ command deletes and flushes the specified CQ. */
65799 	#define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ UINT32_C(0xa)
65800 	#define CMDQ_DESTROY_CQ_OPCODE_LAST	CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ
65801 	/* Size of the command in 16-byte units. */
65802 	uint8_t	cmd_size;
65803 	/* Flags and attribs of the command. */
65804 	uint16_t	flags;
65805 	/* Driver supplied handle to associate the command and the response. */
65806 	uint16_t	cookie;
65807 	/* Size of the response buffer in 16-byte units. */
65808 	uint8_t	resp_size;
65809 	uint8_t	reserved8;
65810 	/* Host address of the response. */
65811 	uint64_t	resp_addr;
65812 	/* CQ context id */
65813 	uint32_t	cq_cid;
65814 	uint32_t	unused_0;
65815 } cmdq_destroy_cq_t, *pcmdq_destroy_cq_t;
65816 
65817 /* creq_destroy_cq_resp (size:128b/16B) */
65818 
65819 typedef struct creq_destroy_cq_resp {
65820 	uint8_t	type;
65821 	/*
65822 	 * This field indicates the exact type of the completion.
65823 	 * By convention, the LSB identifies the length of the
65824 	 * record in 16B units. Even values indicate 16B
65825 	 * records. Odd values indicate 32B
65826 	 * records.
65827 	 */
65828 	#define CREQ_DESTROY_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65829 	#define CREQ_DESTROY_CQ_RESP_TYPE_SFT	0
65830 	/* QP Async Notification */
65831 		#define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65832 		#define CREQ_DESTROY_CQ_RESP_TYPE_LAST	CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT
65833 	/* Status of the response. */
65834 	uint8_t	status;
65835 	/* Driver supplied handle to associate the command and the response. */
65836 	uint16_t	cookie;
65837 	/* CQ context id */
65838 	uint32_t	xid;
65839 	uint8_t	v;
65840 	/*
65841 	 * This value is written by the NIC such that it will be different
65842 	 * for each pass through the completion queue. The even passes
65843 	 * will write 1. The odd passes will write 0.
65844 	 */
65845 	#define CREQ_DESTROY_CQ_RESP_V	UINT32_C(0x1)
65846 	/* Event or command opcode. */
65847 	uint8_t	event;
65848 	/* Destroy CQ command response. */
65849 	#define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ UINT32_C(0xa)
65850 	#define CREQ_DESTROY_CQ_RESP_EVENT_LAST	CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ
65851 	uint16_t	cq_arm_lvl;
65852 	/*
65853 	 * CQ ARM Level:
65854 	 * 0 ? Not Armed
65855 	 * 1 ? Arm SE Only, Generate CNQE only for incoming Solicited Events
65856 	 * 2 ? Arm all, Generate CNQE for Rx and Tx
65857 	 */
65858 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK UINT32_C(0x3)
65859 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
65860 	/*
65861 	 * The total number of CNQ events for the CQ, incremented on each CNQ event for the CQ
65862 	 *	(including firmware-generated CQ error notification).
65863 	 */
65864 	uint16_t	total_cnq_events;
65865 	uint16_t	reserved16;
65866 } creq_destroy_cq_resp_t, *pcreq_destroy_cq_resp_t;
65867 
65868 /*************
65869  * resize_cq *
65870  *************/
65871 
65872 
65873 /* cmdq_resize_cq (size:320b/40B) */
65874 
65875 typedef struct cmdq_resize_cq {
65876 	/* Command opcode. */
65877 	uint8_t	opcode;
65878 	/* Resize CQ command resizes the specified CQ. */
65879 	#define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ UINT32_C(0xc)
65880 	#define CMDQ_RESIZE_CQ_OPCODE_LAST	CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ
65881 	/* Size of the command in 16-byte units. */
65882 	uint8_t	cmd_size;
65883 	/* Flags and attribs of the command. */
65884 	uint16_t	flags;
65885 	/* Driver supplied handle to associate the command and the response. */
65886 	uint16_t	cookie;
65887 	/* Size of the response buffer in 16-byte units. */
65888 	uint8_t	resp_size;
65889 	uint8_t	reserved8;
65890 	/* Host address of the response. */
65891 	uint64_t	resp_addr;
65892 	/* CQ context id */
65893 	uint32_t	cq_cid;
65894 	uint32_t	new_cq_size_pg_size_lvl;
65895 	/* PBL indirect levels. */
65896 	#define CMDQ_RESIZE_CQ_LVL_MASK	UINT32_C(0x3)
65897 	#define CMDQ_RESIZE_CQ_LVL_SFT	0
65898 	/* PBL pointer is physical start address. */
65899 		#define CMDQ_RESIZE_CQ_LVL_LVL_0	UINT32_C(0x0)
65900 	/* PBL pointer points to PTE table. */
65901 		#define CMDQ_RESIZE_CQ_LVL_LVL_1	UINT32_C(0x1)
65902 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
65903 		#define CMDQ_RESIZE_CQ_LVL_LVL_2	UINT32_C(0x2)
65904 		#define CMDQ_RESIZE_CQ_LVL_LAST	CMDQ_RESIZE_CQ_LVL_LVL_2
65905 	/* page size. */
65906 	#define CMDQ_RESIZE_CQ_PG_SIZE_MASK	UINT32_C(0x1c)
65907 	#define CMDQ_RESIZE_CQ_PG_SIZE_SFT	2
65908 	/* 4KB. */
65909 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K	(UINT32_C(0x0) << 2)
65910 	/* 8KB. */
65911 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K	(UINT32_C(0x1) << 2)
65912 	/* 64KB. */
65913 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K	(UINT32_C(0x2) << 2)
65914 	/* 2MB. */
65915 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M	(UINT32_C(0x3) << 2)
65916 	/* 8MB. */
65917 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M	(UINT32_C(0x4) << 2)
65918 	/* 1GB. */
65919 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G	(UINT32_C(0x5) << 2)
65920 		#define CMDQ_RESIZE_CQ_PG_SIZE_LAST	CMDQ_RESIZE_CQ_PG_SIZE_PG_1G
65921 	/* New max number of CQ wqes. */
65922 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK UINT32_C(0x1fffffe0)
65923 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
65924 	/* CQ PBL physical address. */
65925 	uint64_t	new_pbl;
65926 	/* Offset of first CQE in the first Page, in 32 byte units */
65927 	uint32_t	new_cq_fco;
65928 	uint32_t	unused_0;
65929 } cmdq_resize_cq_t, *pcmdq_resize_cq_t;
65930 
65931 /* creq_resize_cq_resp (size:128b/16B) */
65932 
65933 typedef struct creq_resize_cq_resp {
65934 	uint8_t	type;
65935 	/*
65936 	 * This field indicates the exact type of the completion.
65937 	 * By convention, the LSB identifies the length of the
65938 	 * record in 16B units. Even values indicate 16B
65939 	 * records. Odd values indicate 32B
65940 	 * records.
65941 	 */
65942 	#define CREQ_RESIZE_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
65943 	#define CREQ_RESIZE_CQ_RESP_TYPE_SFT	0
65944 	/* QP Async Notification */
65945 		#define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
65946 		#define CREQ_RESIZE_CQ_RESP_TYPE_LAST	CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT
65947 	/* Status of the response. */
65948 	uint8_t	status;
65949 	/* Driver supplied handle to associate the command and the response. */
65950 	uint16_t	cookie;
65951 	/* CQ context id */
65952 	uint32_t	xid;
65953 	uint8_t	v;
65954 	/*
65955 	 * This value is written by the NIC such that it will be different
65956 	 * for each pass through the completion queue. The even passes
65957 	 * will write 1. The odd passes will write 0.
65958 	 */
65959 	#define CREQ_RESIZE_CQ_RESP_V	UINT32_C(0x1)
65960 	/* Event or command opcode. */
65961 	uint8_t	event;
65962 	/* Resize CQ command response. */
65963 	#define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ UINT32_C(0xc)
65964 	#define CREQ_RESIZE_CQ_RESP_EVENT_LAST	CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ
65965 	uint8_t	reserved48[6];
65966 } creq_resize_cq_resp_t, *pcreq_resize_cq_resp_t;
65967 
65968 /*************
65969  * modify_cq *
65970  *************/
65971 
65972 
65973 /* cmdq_modify_cq (size:512b/64B) */
65974 
65975 typedef struct cmdq_modify_cq {
65976 	/* Command opcode. */
65977 	uint8_t	opcode;
65978 	/* Modify CQ updates specific params in the CQ context. */
65979 	#define CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ UINT32_C(0x90)
65980 	#define CMDQ_MODIFY_CQ_OPCODE_LAST	CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ
65981 	/* Size of the command in 16-byte units. */
65982 	uint8_t	cmd_size;
65983 	/* Flags and attribs of the command. */
65984 	uint16_t	flags;
65985 	/*
65986 	 * When the HW Doorbell Drop Recovery feature is enabled,
65987 	 * HW can flag false CQ overflow when CQ consumer index
65988 	 * doorbells are dropped when there really wasn't any overflow.
65989 	 * The CQE values could have already been processed by the driver,
65990 	 * but HW doesn't know about this because of the doorbell drop.
65991 	 * To avoid false detection of CQ overflow events,
65992 	 * it is recommended that CQ overflow detection is disabled
65993 	 * by the driver when HW based doorbell recovery is enabled.
65994 	 */
65995 	#define CMDQ_MODIFY_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x1)
65996 	/* Driver supplied handle to associate the command and the response. */
65997 	uint16_t	cookie;
65998 	/* Size of the response buffer in 16-byte units. */
65999 	uint8_t	resp_size;
66000 	uint8_t	reserved8;
66001 	/* Host address of the response. */
66002 	uint64_t	resp_addr;
66003 	/* Modify mask signifies the field that is requesting the change. */
66004 	uint32_t	modify_mask;
66005 	/* Enable change. */
66006 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_HANDLE	UINT32_C(0x1)
66007 	/* CNQ ID */
66008 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CNQ_ID	UINT32_C(0x2)
66009 	/* Offset of first CQE in the first page, in 32 byte units */
66010 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_FCO	UINT32_C(0x4)
66011 	/* Doorbell page index */
66012 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_DPI	UINT32_C(0x8)
66013 	/* Max number of CQ Wqes */
66014 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_SIZE	UINT32_C(0x10)
66015 	/* CQ PBL physical address */
66016 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_PBL	UINT32_C(0x20)
66017 	/* reserved32 is 32 b */
66018 	uint32_t	reserved32;
66019 	/* CQ handle. */
66020 	uint64_t	cq_handle;
66021 	uint32_t	cq_fco_cnq_id;
66022 	/* cnq_id is 12 b */
66023 	#define CMDQ_MODIFY_CQ_CNQ_ID_MASK UINT32_C(0xfff)
66024 	#define CMDQ_MODIFY_CQ_CNQ_ID_SFT 0
66025 	/* Offset of first CQE in the first Page, in 32 byte units */
66026 	#define CMDQ_MODIFY_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
66027 	#define CMDQ_MODIFY_CQ_CQ_FCO_SFT 12
66028 	/* Doorbell page index. */
66029 	uint32_t	dpi;
66030 	/* Max number of CQ wqes. */
66031 	uint32_t	cq_size;
66032 	/* reserved32_1 is 32 b */
66033 	uint32_t	reserved32_1;
66034 	/* CQ PBL physical address. */
66035 	uint64_t	pbl;
66036 	/* reserved64 is 64 b */
66037 	uint64_t	reserved64;
66038 } cmdq_modify_cq_t, *pcmdq_modify_cq_t;
66039 
66040 /* creq_modify_cq_resp (size:128b/16B) */
66041 
66042 typedef struct creq_modify_cq_resp {
66043 	uint8_t	type;
66044 	/*
66045 	 * This field indicates the exact type of the completion.
66046 	 * By convention, the LSB identifies the length of the
66047 	 * record in 16B units. Even values indicate 16B
66048 	 * records. Odd values indicate 32B
66049 	 * records.
66050 	 */
66051 	#define CREQ_MODIFY_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
66052 	#define CREQ_MODIFY_CQ_RESP_TYPE_SFT	0
66053 	/* QP Async Notification */
66054 		#define CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66055 		#define CREQ_MODIFY_CQ_RESP_TYPE_LAST	CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT
66056 	/* Status of the response. */
66057 	uint8_t	status;
66058 	/* Driver supplied handle to associate the command and the response. */
66059 	uint16_t	cookie;
66060 	/* CQ context id */
66061 	uint32_t	xid;
66062 	uint8_t	v;
66063 	/*
66064 	 * This value is written by the NIC such that it will be different
66065 	 * for each pass through the completion queue. The even passes
66066 	 * will write 1. The odd passes will write 0.
66067 	 */
66068 	#define CREQ_MODIFY_CQ_RESP_V	UINT32_C(0x1)
66069 	/* Event or command opcode. */
66070 	uint8_t	event;
66071 	/* Modify CQ command response. */
66072 	#define CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ UINT32_C(0x9)
66073 	#define CREQ_MODIFY_CQ_RESP_EVENT_LAST	CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ
66074 	uint8_t	reserved48[6];
66075 } creq_modify_cq_resp_t, *pcreq_modify_cq_resp_t;
66076 
66077 /****************
66078  * allocate_mrw *
66079  ****************/
66080 
66081 
66082 /* cmdq_allocate_mrw (size:256b/32B) */
66083 
66084 typedef struct cmdq_allocate_mrw {
66085 	/* Command opcode. */
66086 	uint8_t	opcode;
66087 	/*
66088 	 * Allocate MRW command allocates a MR/MW with the specified parameters
66089 	 * and returns the region's L_KEY/R_KEY
66090 	 */
66091 	#define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW UINT32_C(0xd)
66092 	#define CMDQ_ALLOCATE_MRW_OPCODE_LAST	CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW
66093 	/* Size of the command in 16-byte units. */
66094 	uint8_t	cmd_size;
66095 	/* Flags and attribs of the command. */
66096 	uint16_t	flags;
66097 	/* Driver supplied handle to associate the command and the response. */
66098 	uint16_t	cookie;
66099 	/* Size of the response buffer in 16-byte units. */
66100 	uint8_t	resp_size;
66101 	uint8_t	reserved8;
66102 	/* Host address of the response. */
66103 	uint64_t	resp_addr;
66104 	/* MRW handle. */
66105 	uint64_t	mrw_handle;
66106 	uint8_t	mrw_flags;
66107 	/* Allocate MRW flags. */
66108 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK	UINT32_C(0xf)
66109 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT	0
66110 	/* Allocate Memory Region */
66111 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR	UINT32_C(0x0)
66112 	/* Allocate Physical Memory Region */
66113 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR	UINT32_C(0x1)
66114 	/* Allocate Memory Window (type 1) */
66115 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1   UINT32_C(0x2)
66116 	/* Allocate Memory Window (type 2A) */
66117 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A  UINT32_C(0x3)
66118 	/* Allocate Memory Window (type 2B) */
66119 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B  UINT32_C(0x4)
66120 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST	CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
66121 	/* unused4 is 4 b */
66122 	#define CMDQ_ALLOCATE_MRW_UNUSED4_MASK	UINT32_C(0xf0)
66123 	#define CMDQ_ALLOCATE_MRW_UNUSED4_SFT	4
66124 	/* Access flags. */
66125 	uint8_t	access;
66126 	/* Consumer owns the key */
66127 	#define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY	UINT32_C(0x20)
66128 	/* unused16 is 16 b */
66129 	uint16_t	unused16;
66130 	/* Protection domain id. */
66131 	uint32_t	pd_id;
66132 } cmdq_allocate_mrw_t, *pcmdq_allocate_mrw_t;
66133 
66134 /* creq_allocate_mrw_resp (size:128b/16B) */
66135 
66136 typedef struct creq_allocate_mrw_resp {
66137 	uint8_t	type;
66138 	/*
66139 	 * This field indicates the exact type of the completion.
66140 	 * By convention, the LSB identifies the length of the
66141 	 * record in 16B units. Even values indicate 16B
66142 	 * records. Odd values indicate 32B
66143 	 * records.
66144 	 */
66145 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK	UINT32_C(0x3f)
66146 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT	0
66147 	/* QP Async Notification */
66148 		#define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66149 		#define CREQ_ALLOCATE_MRW_RESP_TYPE_LAST	CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT
66150 	/* Status of the response. */
66151 	uint8_t	status;
66152 	/* Driver supplied handle to associate the command and the response. */
66153 	uint16_t	cookie;
66154 	/* L_KEY for MR, R_KEY for MW */
66155 	uint32_t	xid;
66156 	uint8_t	v;
66157 	/*
66158 	 * This value is written by the NIC such that it will be different
66159 	 * for each pass through the completion queue. The even passes
66160 	 * will write 1. The odd passes will write 0.
66161 	 */
66162 	#define CREQ_ALLOCATE_MRW_RESP_V	UINT32_C(0x1)
66163 	/* Event or command opcode. */
66164 	uint8_t	event;
66165 	/* Allocate MRW command response. */
66166 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW UINT32_C(0xd)
66167 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_LAST	CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW
66168 	uint8_t	reserved48[6];
66169 } creq_allocate_mrw_resp_t, *pcreq_allocate_mrw_resp_t;
66170 
66171 /******************
66172  * deallocate_key *
66173  ******************/
66174 
66175 
66176 /* cmdq_deallocate_key (size:192b/24B) */
66177 
66178 typedef struct cmdq_deallocate_key {
66179 	/* Command opcode. */
66180 	uint8_t	opcode;
66181 	/* De-allocate key command frees a MR/MW entry associated with the specified key. */
66182 	#define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY UINT32_C(0xe)
66183 	#define CMDQ_DEALLOCATE_KEY_OPCODE_LAST	CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY
66184 	/* Size of the command in 16-byte units. */
66185 	uint8_t	cmd_size;
66186 	/* Flags and attribs of the command. */
66187 	uint16_t	flags;
66188 	/* Driver supplied handle to associate the command and the response. */
66189 	uint16_t	cookie;
66190 	/* Size of the response buffer in 16-byte units. */
66191 	uint8_t	resp_size;
66192 	uint8_t	reserved8;
66193 	/* Host address of the response. */
66194 	uint64_t	resp_addr;
66195 	uint8_t	mrw_flags;
66196 	/* Deallocate MRW flags. */
66197 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK	UINT32_C(0xf)
66198 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT	0
66199 	/* Deallocate Memory Region */
66200 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR	UINT32_C(0x0)
66201 	/* Deallocate Physical Memory Region */
66202 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR	UINT32_C(0x1)
66203 	/* Deallocate Memory Window (type 1) */
66204 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1   UINT32_C(0x2)
66205 	/* Deallocate Memory Window (type 2A) */
66206 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A  UINT32_C(0x3)
66207 	/* Deallocate Memory Window (type 2B) */
66208 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B  UINT32_C(0x4)
66209 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_LAST	CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B
66210 	/* unused4 is 4 b */
66211 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_MASK	UINT32_C(0xf0)
66212 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_SFT	4
66213 	/* unused24 is 24 b */
66214 	uint8_t	unused24[3];
66215 	/* key is 32 b */
66216 	uint32_t	key;
66217 } cmdq_deallocate_key_t, *pcmdq_deallocate_key_t;
66218 
66219 /* creq_deallocate_key_resp (size:128b/16B) */
66220 
66221 typedef struct creq_deallocate_key_resp {
66222 	uint8_t	type;
66223 	/*
66224 	 * This field indicates the exact type of the completion.
66225 	 * By convention, the LSB identifies the length of the
66226 	 * record in 16B units. Even values indicate 16B
66227 	 * records. Odd values indicate 32B
66228 	 * records.
66229 	 */
66230 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK	UINT32_C(0x3f)
66231 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT	0
66232 	/* QP Async Notification */
66233 		#define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66234 		#define CREQ_DEALLOCATE_KEY_RESP_TYPE_LAST	CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT
66235 	/* Status of the response. */
66236 	uint8_t	status;
66237 	/* Driver supplied handle to associate the command and the response. */
66238 	uint16_t	cookie;
66239 	/* L_KEY for MR, R_KEY for MW */
66240 	uint32_t	xid;
66241 	uint8_t	v;
66242 	/*
66243 	 * This value is written by the NIC such that it will be different
66244 	 * for each pass through the completion queue. The even passes
66245 	 * will write 1. The odd passes will write 0.
66246 	 */
66247 	#define CREQ_DEALLOCATE_KEY_RESP_V	UINT32_C(0x1)
66248 	/* Event or command opcode. */
66249 	uint8_t	event;
66250 	/* De-allocate key command response. */
66251 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY UINT32_C(0xe)
66252 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_LAST	CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY
66253 	uint16_t	reserved16;
66254 	/*
66255 	 * This is advisory data to facilitate eventual destruction of lingering memory regions in Windows.
66256 	 * For memory window, it contains non-zero HWID of a region this window was bound to (without the 8-bit key portion).
66257 	 * The host may check if the region is lingering in destroyed state and try to destroy it now.
66258 	 * For memory region, if deallocation fails because there are windows bound to this region, this field will contain
66259 	 * approximate number of those windows. This number is read from the context right before the
66260 	 * deregistration is attempted and can potentially be slightly different from the current number.
66261 	 */
66262 	uint32_t	bound_window_info;
66263 } creq_deallocate_key_resp_t, *pcreq_deallocate_key_resp_t;
66264 
66265 /***************
66266  * register_mr *
66267  ***************/
66268 
66269 
66270 /* cmdq_register_mr (size:384b/48B) */
66271 
66272 typedef struct cmdq_register_mr {
66273 	/* Command opcode. */
66274 	uint8_t	opcode;
66275 	/* Register MR command registers memory to the specified MR. */
66276 	#define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR UINT32_C(0xf)
66277 	#define CMDQ_REGISTER_MR_OPCODE_LAST	CMDQ_REGISTER_MR_OPCODE_REGISTER_MR
66278 	/* Size of the command in 16-byte units. */
66279 	uint8_t	cmd_size;
66280 	/* Flags and attribs of the command. */
66281 	uint16_t	flags;
66282 	/*
66283 	 * When set, a new MR will be allocated first and then registered
66284 	 * using the fields in this command. Note that for MR allocation
66285 	 * the `key` field doesn't hold a valid L_KEY and is instead
66286 	 * overloaded to hold the Protection Domain ID `pd_id`.
66287 	 */
66288 	#define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR	UINT32_C(0x1)
66289 	/* Driver supplied handle to associate the command and the response. */
66290 	uint16_t	cookie;
66291 	/* Size of the response buffer in 16-byte units. */
66292 	uint8_t	resp_size;
66293 	uint8_t	reserved8;
66294 	/* Host address of the response. */
66295 	uint64_t	resp_addr;
66296 	uint8_t	log2_pg_size_lvl;
66297 	/* PBL indirect levels. */
66298 	#define CMDQ_REGISTER_MR_LVL_MASK		UINT32_C(0x3)
66299 	#define CMDQ_REGISTER_MR_LVL_SFT		0
66300 	/* PBL pointer is physical start address. */
66301 		#define CMDQ_REGISTER_MR_LVL_LVL_0		UINT32_C(0x0)
66302 	/* PBL pointer points to PTE table. */
66303 		#define CMDQ_REGISTER_MR_LVL_LVL_1		UINT32_C(0x1)
66304 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
66305 		#define CMDQ_REGISTER_MR_LVL_LVL_2		UINT32_C(0x2)
66306 		#define CMDQ_REGISTER_MR_LVL_LAST		CMDQ_REGISTER_MR_LVL_LVL_2
66307 	/* Log base 2 of page size; 12 is the minimum for 4KB. HW supported values are enumerated below. */
66308 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK   UINT32_C(0x7c)
66309 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT	2
66310 	/* 4KB. */
66311 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K	(UINT32_C(0xc) << 2)
66312 	/* 8KB. */
66313 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K	(UINT32_C(0xd) << 2)
66314 	/* 64KB. */
66315 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K   (UINT32_C(0x10) << 2)
66316 	/* 256KB. */
66317 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K  (UINT32_C(0x12) << 2)
66318 	/* 1MB. */
66319 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M	(UINT32_C(0x14) << 2)
66320 	/* 2MB. */
66321 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M	(UINT32_C(0x15) << 2)
66322 	/* 4MB. */
66323 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M	(UINT32_C(0x16) << 2)
66324 	/* 1GB. */
66325 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G	(UINT32_C(0x1e) << 2)
66326 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST	CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
66327 	/* unused1 is 1 b */
66328 	#define CMDQ_REGISTER_MR_UNUSED1		UINT32_C(0x80)
66329 	/* Access flags. */
66330 	uint8_t	access;
66331 	/* Local write access. */
66332 	#define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE	UINT32_C(0x1)
66333 	/* Remote read access. */
66334 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ	UINT32_C(0x2)
66335 	/* Remote write access. */
66336 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE	UINT32_C(0x4)
66337 	/* Remote atomic access. */
66338 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC	UINT32_C(0x8)
66339 	/* Bind access allowed. */
66340 	#define CMDQ_REGISTER_MR_ACCESS_MW_BIND	UINT32_C(0x10)
66341 	/* Indicate Zero Based Virtual Address (ZBVA). */
66342 	#define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED	UINT32_C(0x20)
66343 	uint16_t	log2_pbl_pg_size;
66344 	/* Log base 2 of PBL page size; 12 is the minimum for 4KB. HW supported values are enumerated below */
66345 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK   UINT32_C(0x1f)
66346 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT	0
66347 	/* 4KB. */
66348 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K	UINT32_C(0xc)
66349 	/* 8KB. */
66350 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K	UINT32_C(0xd)
66351 	/* 64KB. */
66352 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K   UINT32_C(0x10)
66353 	/* 256KB. */
66354 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K  UINT32_C(0x12)
66355 	/* 1MB. */
66356 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M	UINT32_C(0x14)
66357 	/* 2MB. */
66358 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M	UINT32_C(0x15)
66359 	/* 4MB. */
66360 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M	UINT32_C(0x16)
66361 	/* 1GB. */
66362 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G	UINT32_C(0x1e)
66363 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST	CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
66364 	/* unused11 is 11 b */
66365 	#define CMDQ_REGISTER_MR_UNUSED11_MASK	UINT32_C(0xffe0)
66366 	#define CMDQ_REGISTER_MR_UNUSED11_SFT		5
66367 	/*
66368 	 * L_KEY of the previously allocated MR.
66369 	 *
66370 	 * If the `ALLOC_MR` flag is set then this field does not hold an
66371 	 * L_KEY and instead contains the Protection Domain ID `pd_id`.
66372 	 */
66373 	uint32_t	key;
66374 	/* Page table of the MR memory. */
66375 	uint64_t	pbl;
66376 	/* Virtual address of the MR. */
66377 	uint64_t	va;
66378 	/* Size of the MR. */
66379 	uint64_t	mr_size;
66380 } cmdq_register_mr_t, *pcmdq_register_mr_t;
66381 
66382 /* creq_register_mr_resp (size:128b/16B) */
66383 
66384 typedef struct creq_register_mr_resp {
66385 	uint8_t	type;
66386 	/*
66387 	 * This field indicates the exact type of the completion.
66388 	 * By convention, the LSB identifies the length of the
66389 	 * record in 16B units. Even values indicate 16B
66390 	 * records. Odd values indicate 32B
66391 	 * records.
66392 	 */
66393 	#define CREQ_REGISTER_MR_RESP_TYPE_MASK	UINT32_C(0x3f)
66394 	#define CREQ_REGISTER_MR_RESP_TYPE_SFT	0
66395 	/* QP Async Notification */
66396 		#define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66397 		#define CREQ_REGISTER_MR_RESP_TYPE_LAST	CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT
66398 	/* Status of the response. */
66399 	uint8_t	status;
66400 	/* Driver supplied handle to associate the command and the response. */
66401 	uint16_t	cookie;
66402 	/* L_KEY */
66403 	uint32_t	xid;
66404 	uint8_t	v;
66405 	/*
66406 	 * This value is written by the NIC such that it will be different
66407 	 * for each pass through the completion queue. The even passes
66408 	 * will write 1. The odd passes will write 0.
66409 	 */
66410 	#define CREQ_REGISTER_MR_RESP_V	UINT32_C(0x1)
66411 	/* Event or command opcode. */
66412 	uint8_t	event;
66413 	/* Register MR command response. */
66414 	#define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR UINT32_C(0xf)
66415 	#define CREQ_REGISTER_MR_RESP_EVENT_LAST	CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR
66416 	uint8_t	reserved48[6];
66417 } creq_register_mr_resp_t, *pcreq_register_mr_resp_t;
66418 
66419 /*****************
66420  * deregister_mr *
66421  *****************/
66422 
66423 
66424 /* cmdq_deregister_mr (size:192b/24B) */
66425 
66426 typedef struct cmdq_deregister_mr {
66427 	/* Command opcode. */
66428 	uint8_t	opcode;
66429 	/* Deregister MR command de-registers memory from the specified MR. */
66430 	#define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR UINT32_C(0x10)
66431 	#define CMDQ_DEREGISTER_MR_OPCODE_LAST	CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR
66432 	/* Size of the command in 16-byte units. */
66433 	uint8_t	cmd_size;
66434 	/* Flags and attribs of the command. */
66435 	uint16_t	flags;
66436 	/* Driver supplied handle to associate the command and the response. */
66437 	uint16_t	cookie;
66438 	/* Size of the response buffer in 16-byte units. */
66439 	uint8_t	resp_size;
66440 	uint8_t	reserved8;
66441 	/* Host address of the response. */
66442 	uint64_t	resp_addr;
66443 	/* L_KEY of the MR. */
66444 	uint32_t	lkey;
66445 	uint32_t	unused_0;
66446 } cmdq_deregister_mr_t, *pcmdq_deregister_mr_t;
66447 
66448 /* creq_deregister_mr_resp (size:128b/16B) */
66449 
66450 typedef struct creq_deregister_mr_resp {
66451 	uint8_t	type;
66452 	/*
66453 	 * This field indicates the exact type of the completion.
66454 	 * By convention, the LSB identifies the length of the
66455 	 * record in 16B units. Even values indicate 16B
66456 	 * records. Odd values indicate 32B
66457 	 * records.
66458 	 */
66459 	#define CREQ_DEREGISTER_MR_RESP_TYPE_MASK	UINT32_C(0x3f)
66460 	#define CREQ_DEREGISTER_MR_RESP_TYPE_SFT	0
66461 	/* QP Async Notification */
66462 		#define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66463 		#define CREQ_DEREGISTER_MR_RESP_TYPE_LAST	CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT
66464 	/* Status of the response. */
66465 	uint8_t	status;
66466 	/* Driver supplied handle to associate the command and the response. */
66467 	uint16_t	cookie;
66468 	/* L_KEY */
66469 	uint32_t	xid;
66470 	uint8_t	v;
66471 	/*
66472 	 * This value is written by the NIC such that it will be different
66473 	 * for each pass through the completion queue. The even passes
66474 	 * will write 1. The odd passes will write 0.
66475 	 */
66476 	#define CREQ_DEREGISTER_MR_RESP_V	UINT32_C(0x1)
66477 	/* Event or command opcode. */
66478 	uint8_t	event;
66479 	/* Deregister MR command response. */
66480 	#define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR UINT32_C(0x10)
66481 	#define CREQ_DEREGISTER_MR_RESP_EVENT_LAST	CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR
66482 	uint16_t	reserved16;
66483 	/*
66484 	 * If deregister fails because there are windows bound to this region, this field will contain
66485 	 * approximate number of those windows. This number is read from the context right before the
66486 	 * deregistration is attempted and can potentially be slightly different from the current number.
66487 	 */
66488 	uint32_t	bound_windows;
66489 } creq_deregister_mr_resp_t, *pcreq_deregister_mr_resp_t;
66490 
66491 /***********
66492  * add_gid *
66493  ***********/
66494 
66495 
66496 /* cmdq_add_gid (size:384b/48B) */
66497 
66498 typedef struct cmdq_add_gid {
66499 	/* Command opcode. */
66500 	uint8_t	opcode;
66501 	/* Add GID command adds a GID to the local address table. */
66502 	#define CMDQ_ADD_GID_OPCODE_ADD_GID UINT32_C(0x11)
66503 	#define CMDQ_ADD_GID_OPCODE_LAST   CMDQ_ADD_GID_OPCODE_ADD_GID
66504 	/* Size of the command in 16-byte units. */
66505 	uint8_t	cmd_size;
66506 	/* Flags and attribs of the command. */
66507 	uint16_t	flags;
66508 	/* Driver supplied handle to associate the command and the response. */
66509 	uint16_t	cookie;
66510 	/* Size of the response buffer in 16-byte units. */
66511 	uint8_t	resp_size;
66512 	uint8_t	reserved8;
66513 	/* Host address of the response. */
66514 	uint64_t	resp_addr;
66515 	/* GID, specified in LE format. */
66516 	uint32_t	gid[4];
66517 	/* Source MAC. */
66518 	uint16_t	src_mac[3];
66519 	/* flags. */
66520 	uint16_t	vlan;
66521 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_MASK	UINT32_C(0xffff)
66522 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_SFT	0
66523 	/* Source VLAN id. */
66524 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK			UINT32_C(0xfff)
66525 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT			0
66526 	/* This set of bits select the TPID of the VLAN Tag. */
66527 	#define CMDQ_ADD_GID_VLAN_TPID_MASK			UINT32_C(0x7000)
66528 	#define CMDQ_ADD_GID_VLAN_TPID_SFT			12
66529 	/* TPID = 0x88A8. */
66530 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8			(UINT32_C(0x0) << 12)
66531 	/* TPID = 0x8100. */
66532 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_8100			(UINT32_C(0x1) << 12)
66533 	/* TPID = 0x9100. */
66534 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9100			(UINT32_C(0x2) << 12)
66535 	/* TPID = 0x9200. */
66536 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9200			(UINT32_C(0x3) << 12)
66537 	/* TPID = 0x9300. */
66538 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9300			(UINT32_C(0x4) << 12)
66539 	/* TPID = Configurable 1. */
66540 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1			(UINT32_C(0x5) << 12)
66541 	/* TPID = Configurable 2. */
66542 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2			(UINT32_C(0x6) << 12)
66543 	/* TPID = Configurable 3. */
66544 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3			(UINT32_C(0x7) << 12)
66545 		#define CMDQ_ADD_GID_VLAN_TPID_LAST			CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
66546 	/* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
66547 	#define CMDQ_ADD_GID_VLAN_VLAN_EN				UINT32_C(0x8000)
66548 	/* Identifier field in the IP header. */
66549 	uint16_t	ipid;
66550 	/* Stats context ID to use with this SGID */
66551 	uint16_t	stats_ctx;
66552 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_MASK		UINT32_C(0xffff)
66553 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_SFT		0
66554 	/* stats_ctx_id is 15 b */
66555 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK				UINT32_C(0x7fff)
66556 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT				0
66557 	/* Setting this bit to 1 enables use of own stats context ID instead of per-function */
66558 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID				UINT32_C(0x8000)
66559 	uint32_t	unused_0;
66560 } cmdq_add_gid_t, *pcmdq_add_gid_t;
66561 
66562 /* creq_add_gid_resp (size:128b/16B) */
66563 
66564 typedef struct creq_add_gid_resp {
66565 	uint8_t	type;
66566 	/*
66567 	 * This field indicates the exact type of the completion.
66568 	 * By convention, the LSB identifies the length of the
66569 	 * record in 16B units. Even values indicate 16B
66570 	 * records. Odd values indicate 32B
66571 	 * records.
66572 	 */
66573 	#define CREQ_ADD_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
66574 	#define CREQ_ADD_GID_RESP_TYPE_SFT	0
66575 	/* QP Async Notification */
66576 		#define CREQ_ADD_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66577 		#define CREQ_ADD_GID_RESP_TYPE_LAST	CREQ_ADD_GID_RESP_TYPE_QP_EVENT
66578 	/* Status of the response. */
66579 	uint8_t	status;
66580 	/* Driver supplied handle to associate the command and the response. */
66581 	uint16_t	cookie;
66582 	/* GID index */
66583 	uint32_t	xid;
66584 	uint8_t	v;
66585 	/*
66586 	 * This value is written by the NIC such that it will be different
66587 	 * for each pass through the completion queue. The even passes
66588 	 * will write 1. The odd passes will write 0.
66589 	 */
66590 	#define CREQ_ADD_GID_RESP_V	UINT32_C(0x1)
66591 	/* Event or command opcode. */
66592 	uint8_t	event;
66593 	/* Add GID command response. */
66594 	#define CREQ_ADD_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
66595 	#define CREQ_ADD_GID_RESP_EVENT_LAST   CREQ_ADD_GID_RESP_EVENT_ADD_GID
66596 	uint8_t	reserved48[6];
66597 } creq_add_gid_resp_t, *pcreq_add_gid_resp_t;
66598 
66599 /**************
66600  * delete_gid *
66601  **************/
66602 
66603 
66604 /* cmdq_delete_gid (size:192b/24B) */
66605 
66606 typedef struct cmdq_delete_gid {
66607 	/* Command opcode. */
66608 	uint8_t	opcode;
66609 	/* Delete GID command deletes a GID from the local address table. */
66610 	#define CMDQ_DELETE_GID_OPCODE_DELETE_GID UINT32_C(0x12)
66611 	#define CMDQ_DELETE_GID_OPCODE_LAST	CMDQ_DELETE_GID_OPCODE_DELETE_GID
66612 	/* Size of the command in 16-byte units. */
66613 	uint8_t	cmd_size;
66614 	/* Flags and attribs of the command. */
66615 	uint16_t	flags;
66616 	/* Driver supplied handle to associate the command and the response. */
66617 	uint16_t	cookie;
66618 	/* Size of the response buffer in 16-byte units. */
66619 	uint8_t	resp_size;
66620 	uint8_t	reserved8;
66621 	/* Host address of the response. */
66622 	uint64_t	resp_addr;
66623 	/* GID index */
66624 	uint16_t	gid_index;
66625 	uint8_t	unused_0[6];
66626 } cmdq_delete_gid_t, *pcmdq_delete_gid_t;
66627 
66628 /* creq_delete_gid_resp (size:128b/16B) */
66629 
66630 typedef struct creq_delete_gid_resp {
66631 	uint8_t	type;
66632 	/*
66633 	 * This field indicates the exact type of the completion.
66634 	 * By convention, the LSB identifies the length of the
66635 	 * record in 16B units. Even values indicate 16B
66636 	 * records. Odd values indicate 32B
66637 	 * records.
66638 	 */
66639 	#define CREQ_DELETE_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
66640 	#define CREQ_DELETE_GID_RESP_TYPE_SFT	0
66641 	/* QP Async Notification */
66642 		#define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66643 		#define CREQ_DELETE_GID_RESP_TYPE_LAST	CREQ_DELETE_GID_RESP_TYPE_QP_EVENT
66644 	/* Status of the response. */
66645 	uint8_t	status;
66646 	/* Driver supplied handle to associate the command and the response. */
66647 	uint16_t	cookie;
66648 	/* GID index */
66649 	uint32_t	xid;
66650 	uint8_t	v;
66651 	/*
66652 	 * This value is written by the NIC such that it will be different
66653 	 * for each pass through the completion queue. The even passes
66654 	 * will write 1. The odd passes will write 0.
66655 	 */
66656 	#define CREQ_DELETE_GID_RESP_V	UINT32_C(0x1)
66657 	/* Event or command opcode. */
66658 	uint8_t	event;
66659 	/* Delete GID command response. */
66660 	#define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID UINT32_C(0x12)
66661 	#define CREQ_DELETE_GID_RESP_EVENT_LAST	CREQ_DELETE_GID_RESP_EVENT_DELETE_GID
66662 	uint8_t	reserved48[6];
66663 } creq_delete_gid_resp_t, *pcreq_delete_gid_resp_t;
66664 
66665 /**************
66666  * modify_gid *
66667  **************/
66668 
66669 
66670 /* cmdq_modify_gid (size:384b/48B) */
66671 
66672 typedef struct cmdq_modify_gid {
66673 	/* Command opcode. */
66674 	uint8_t	opcode;
66675 	/* Modify GID command modifies a GID in the local address table. */
66676 	#define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID UINT32_C(0x17)
66677 	#define CMDQ_MODIFY_GID_OPCODE_LAST	CMDQ_MODIFY_GID_OPCODE_MODIFY_GID
66678 	/* Size of the command in 16-byte units. */
66679 	uint8_t	cmd_size;
66680 	/* Flags and attribs of the command. */
66681 	uint16_t	flags;
66682 	/* Driver supplied handle to associate the command and the response. */
66683 	uint16_t	cookie;
66684 	/* Size of the response buffer in 16-byte units. */
66685 	uint8_t	resp_size;
66686 	uint8_t	reserved8;
66687 	/* Host address of the response. */
66688 	uint64_t	resp_addr;
66689 	/* GID */
66690 	uint32_t	gid[4];
66691 	/* Source MAC. */
66692 	uint16_t	src_mac[3];
66693 	/* flags. */
66694 	uint16_t	vlan;
66695 	/* Source VLAN id. */
66696 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK  UINT32_C(0xfff)
66697 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT   0
66698 	/* This set of bits select the TPID of the VLAN Tag. */
66699 	#define CMDQ_MODIFY_GID_VLAN_TPID_MASK	UINT32_C(0x7000)
66700 	#define CMDQ_MODIFY_GID_VLAN_TPID_SFT	12
66701 	/* TPID = 0x88A8. */
66702 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8  (UINT32_C(0x0) << 12)
66703 	/* TPID = 0x8100. */
66704 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100  (UINT32_C(0x1) << 12)
66705 	/* TPID = 0x9100. */
66706 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100  (UINT32_C(0x2) << 12)
66707 	/* TPID = 0x9200. */
66708 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200  (UINT32_C(0x3) << 12)
66709 	/* TPID = 0x9300. */
66710 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300  (UINT32_C(0x4) << 12)
66711 	/* TPID = Configurable 1. */
66712 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1  (UINT32_C(0x5) << 12)
66713 	/* TPID = Configurable 2. */
66714 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2  (UINT32_C(0x6) << 12)
66715 	/* TPID = Configurable 3. */
66716 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3  (UINT32_C(0x7) << 12)
66717 		#define CMDQ_MODIFY_GID_VLAN_TPID_LAST	CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
66718 	/* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
66719 	#define CMDQ_MODIFY_GID_VLAN_VLAN_EN	UINT32_C(0x8000)
66720 	/* Identifier field in the IP header. */
66721 	uint16_t	ipid;
66722 	/* GID index */
66723 	uint16_t	gid_index;
66724 	/* Stats context ID to use with this SGID */
66725 	uint16_t	stats_ctx;
66726 	/* stats_ctx_id is 15 b */
66727 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK   UINT32_C(0x7fff)
66728 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT	0
66729 	/* Setting this bit to 1 enables use of own stats context ID instead of per-function */
66730 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID	UINT32_C(0x8000)
66731 	uint16_t	unused_0;
66732 } cmdq_modify_gid_t, *pcmdq_modify_gid_t;
66733 
66734 /* creq_modify_gid_resp (size:128b/16B) */
66735 
66736 typedef struct creq_modify_gid_resp {
66737 	uint8_t	type;
66738 	/*
66739 	 * This field indicates the exact type of the completion.
66740 	 * By convention, the LSB identifies the length of the
66741 	 * record in 16B units. Even values indicate 16B
66742 	 * records. Odd values indicate 32B
66743 	 * records.
66744 	 */
66745 	#define CREQ_MODIFY_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
66746 	#define CREQ_MODIFY_GID_RESP_TYPE_SFT	0
66747 	/* QP Async Notification */
66748 		#define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66749 		#define CREQ_MODIFY_GID_RESP_TYPE_LAST	CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT
66750 	/* Status of the response. */
66751 	uint8_t	status;
66752 	/* Driver supplied handle to associate the command and the response. */
66753 	uint16_t	cookie;
66754 	/* GID index */
66755 	uint32_t	xid;
66756 	uint8_t	v;
66757 	/*
66758 	 * This value is written by the NIC such that it will be different
66759 	 * for each pass through the completion queue. The even passes
66760 	 * will write 1. The odd passes will write 0.
66761 	 */
66762 	#define CREQ_MODIFY_GID_RESP_V	UINT32_C(0x1)
66763 	/* Event or command opcode. */
66764 	uint8_t	event;
66765 	/* Add GID command response. */
66766 	#define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
66767 	#define CREQ_MODIFY_GID_RESP_EVENT_LAST   CREQ_MODIFY_GID_RESP_EVENT_ADD_GID
66768 	uint8_t	reserved48[6];
66769 } creq_modify_gid_resp_t, *pcreq_modify_gid_resp_t;
66770 
66771 /*************
66772  * query_gid *
66773  *************/
66774 
66775 
66776 /* cmdq_query_gid (size:192b/24B) */
66777 
66778 typedef struct cmdq_query_gid {
66779 	/* Command opcode. */
66780 	uint8_t	opcode;
66781 	/* Query GID command queries a GID in the local address table. */
66782 	#define CMDQ_QUERY_GID_OPCODE_QUERY_GID UINT32_C(0x18)
66783 	#define CMDQ_QUERY_GID_OPCODE_LAST	CMDQ_QUERY_GID_OPCODE_QUERY_GID
66784 	/* Size of the command in 16-byte units. */
66785 	uint8_t	cmd_size;
66786 	/* Flags and attribs of the command. */
66787 	uint16_t	flags;
66788 	/* Driver supplied handle to associate the command and the response. */
66789 	uint16_t	cookie;
66790 	/* Size of the response buffer in 16-byte units. */
66791 	uint8_t	resp_size;
66792 	uint8_t	reserved8;
66793 	/* Host address of the response. */
66794 	uint64_t	resp_addr;
66795 	/* GID index */
66796 	uint16_t	gid_index;
66797 	/* unused16 is 16 b */
66798 	uint8_t	unused16[6];
66799 } cmdq_query_gid_t, *pcmdq_query_gid_t;
66800 
66801 /* creq_query_gid_resp (size:128b/16B) */
66802 
66803 typedef struct creq_query_gid_resp {
66804 	uint8_t	type;
66805 	/*
66806 	 * This field indicates the exact type of the completion.
66807 	 * By convention, the LSB identifies the length of the
66808 	 * record in 16B units. Even values indicate 16B
66809 	 * records. Odd values indicate 32B
66810 	 * records.
66811 	 */
66812 	#define CREQ_QUERY_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
66813 	#define CREQ_QUERY_GID_RESP_TYPE_SFT	0
66814 	/* QP Async Notification */
66815 		#define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
66816 		#define CREQ_QUERY_GID_RESP_TYPE_LAST	CREQ_QUERY_GID_RESP_TYPE_QP_EVENT
66817 	/* Status of the response. */
66818 	uint8_t	status;
66819 	/* Driver supplied handle to associate the command and the response. */
66820 	uint16_t	cookie;
66821 	/* Side buffer size in 16-byte units */
66822 	uint32_t	size;
66823 	uint8_t	v;
66824 	/*
66825 	 * This value is written by the NIC such that it will be different
66826 	 * for each pass through the completion queue. The even passes
66827 	 * will write 1. The odd passes will write 0.
66828 	 */
66829 	#define CREQ_QUERY_GID_RESP_V	UINT32_C(0x1)
66830 	/* Event or command opcode. */
66831 	uint8_t	event;
66832 	/* Query GID command response. */
66833 	#define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID UINT32_C(0x18)
66834 	#define CREQ_QUERY_GID_RESP_EVENT_LAST	CREQ_QUERY_GID_RESP_EVENT_QUERY_GID
66835 	uint8_t	reserved48[6];
66836 } creq_query_gid_resp_t, *pcreq_query_gid_resp_t;
66837 
66838 /* Query GID command response side buffer structure */
66839 /* creq_query_gid_resp_sb (size:320b/40B) */
66840 
66841 typedef struct creq_query_gid_resp_sb {
66842 	/* Command opcode. */
66843 	uint8_t	opcode;
66844 	/* Query GID command response. */
66845 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID UINT32_C(0x18)
66846 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_LAST	CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID
66847 	/* Status of the response. */
66848 	uint8_t	status;
66849 	/* Driver supplied handle to associate the command and the response. */
66850 	uint16_t	cookie;
66851 	/* Flags and attribs of the command. */
66852 	uint16_t	flags;
66853 	/* Size of the response buffer in 16-byte units. */
66854 	uint8_t	resp_size;
66855 	uint8_t	reserved8;
66856 	/* GID */
66857 	uint32_t	gid[4];
66858 	/* Source MAC. */
66859 	uint16_t	src_mac[3];
66860 	/* flags. */
66861 	uint16_t	vlan;
66862 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_MASK	UINT32_C(0xffff)
66863 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_SFT	0
66864 	/* Source VLAN id. */
66865 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK			UINT32_C(0xfff)
66866 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT			0
66867 	/* This set of bits select the TPID of the VLAN Tag. */
66868 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK			UINT32_C(0x7000)
66869 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT			12
66870 	/* TPID = 0x88A8. */
66871 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8			(UINT32_C(0x0) << 12)
66872 	/* TPID = 0x8100. */
66873 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100			(UINT32_C(0x1) << 12)
66874 	/* TPID = 0x9100. */
66875 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100			(UINT32_C(0x2) << 12)
66876 	/* TPID = 0x9200. */
66877 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200			(UINT32_C(0x3) << 12)
66878 	/* TPID = 0x9300. */
66879 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300			(UINT32_C(0x4) << 12)
66880 	/* TPID = Configurable 1. */
66881 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1			(UINT32_C(0x5) << 12)
66882 	/* TPID = Configurable 2. */
66883 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2			(UINT32_C(0x6) << 12)
66884 	/* TPID = Configurable 3. */
66885 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3			(UINT32_C(0x7) << 12)
66886 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST			CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
66887 	/* Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE header. */
66888 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN				UINT32_C(0x8000)
66889 	/* Identifier field in the IP header. */
66890 	uint16_t	ipid;
66891 	/* GID index */
66892 	uint16_t	gid_index;
66893 	uint32_t	unused_0;
66894 } creq_query_gid_resp_sb_t, *pcreq_query_gid_resp_sb_t;
66895 
66896 /**************
66897  * create_qp1 *
66898  **************/
66899 
66900 
66901 /* cmdq_create_qp1 (size:640b/80B) */
66902 
66903 typedef struct cmdq_create_qp1 {
66904 	/* Command opcode. */
66905 	uint8_t	opcode;
66906 	/* Create QP1 command allocates a QP1 only. */
66907 	#define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 UINT32_C(0x13)
66908 	#define CMDQ_CREATE_QP1_OPCODE_LAST	CMDQ_CREATE_QP1_OPCODE_CREATE_QP1
66909 	/* Size of the command in 16-byte units. */
66910 	uint8_t	cmd_size;
66911 	/* Flags and attribs of the command. */
66912 	uint16_t	flags;
66913 	/* Driver supplied handle to associate the command and the response. */
66914 	uint16_t	cookie;
66915 	/* Size of the response buffer in 16-byte units. */
66916 	uint8_t	resp_size;
66917 	uint8_t	reserved8;
66918 	/* Host address of the response. */
66919 	uint64_t	resp_addr;
66920 	/* QP1 handle. */
66921 	uint64_t	qp_handle;
66922 	/* Create QP1 flags. */
66923 	uint32_t	qp_flags;
66924 	/* SRQ is used. */
66925 	#define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
66926 	/* post CQE for all SQ WQEs. */
66927 	#define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
66928 	/* This QP can use reserved L_Key */
66929 	#define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE UINT32_C(0x4)
66930 	#define CMDQ_CREATE_QP1_QP_FLAGS_LAST		CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE
66931 	/* Supported QP1 types. */
66932 	uint8_t	type;
66933 	/* General Services Interface on QP 1. */
66934 	#define CMDQ_CREATE_QP1_TYPE_GSI UINT32_C(0x1)
66935 	#define CMDQ_CREATE_QP1_TYPE_LAST CMDQ_CREATE_QP1_TYPE_GSI
66936 	uint8_t	sq_pg_size_sq_lvl;
66937 	/* SQ PBL indirect levels. */
66938 	#define CMDQ_CREATE_QP1_SQ_LVL_MASK	UINT32_C(0xf)
66939 	#define CMDQ_CREATE_QP1_SQ_LVL_SFT	0
66940 	/* PBL pointer is physical start address. */
66941 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_0	UINT32_C(0x0)
66942 	/* PBL pointer points to PTE table. */
66943 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_1	UINT32_C(0x1)
66944 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
66945 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_2	UINT32_C(0x2)
66946 		#define CMDQ_CREATE_QP1_SQ_LVL_LAST	CMDQ_CREATE_QP1_SQ_LVL_LVL_2
66947 	/* SQ page size. */
66948 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK  UINT32_C(0xf0)
66949 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT   4
66950 	/* 4KB. */
66951 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
66952 	/* 8KB. */
66953 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
66954 	/* 64KB. */
66955 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
66956 	/* 2MB. */
66957 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
66958 	/* 8MB. */
66959 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
66960 	/* 1GB. */
66961 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
66962 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G
66963 	uint8_t	rq_pg_size_rq_lvl;
66964 	/* RQ PBL indirect levels. */
66965 	#define CMDQ_CREATE_QP1_RQ_LVL_MASK	UINT32_C(0xf)
66966 	#define CMDQ_CREATE_QP1_RQ_LVL_SFT	0
66967 	/* PBL pointer is physical start address. */
66968 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_0	UINT32_C(0x0)
66969 	/* PBL pointer points to PTE table. */
66970 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_1	UINT32_C(0x1)
66971 	/* PBL pointer points to PDE table with each entry pointing to PTE tables. */
66972 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_2	UINT32_C(0x2)
66973 		#define CMDQ_CREATE_QP1_RQ_LVL_LAST	CMDQ_CREATE_QP1_RQ_LVL_LVL_2
66974 	/* RQ page size. */
66975 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK  UINT32_C(0xf0)
66976 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT   4
66977 	/* 4KB. */
66978 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
66979 	/* 8KB. */
66980 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
66981 	/* 64KB. */
66982 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
66983 	/* 2MB. */
66984 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
66985 	/* 8MB. */
66986 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
66987 	/* 1GB. */
66988 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
66989 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G
66990 	uint8_t	unused_0;
66991 	/* Doorbell page index. */
66992 	uint32_t	dpi;
66993 	/* Max number of SQ wqes. */
66994 	uint32_t	sq_size;
66995 	/* Max number of RQ wqes. */
66996 	uint32_t	rq_size;
66997 	uint16_t	sq_fwo_sq_sge;
66998 	/* Max send SGEs per SWQE. */
66999 	#define CMDQ_CREATE_QP1_SQ_SGE_MASK UINT32_C(0xf)
67000 	#define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
67001 	/* Offset of First WQE in the first SQ page, in 128 byte units */
67002 	#define CMDQ_CREATE_QP1_SQ_FWO_MASK UINT32_C(0xfff0)
67003 	#define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
67004 	uint16_t	rq_fwo_rq_sge;
67005 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
67006 	#define CMDQ_CREATE_QP1_RQ_SGE_MASK UINT32_C(0xf)
67007 	#define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
67008 	/* Offset of First WQE in the first RQ page, in 128 byte units */
67009 	#define CMDQ_CREATE_QP1_RQ_FWO_MASK UINT32_C(0xfff0)
67010 	#define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
67011 	/* Send CQ context id. */
67012 	uint32_t	scq_cid;
67013 	/* Receive CQ context id. */
67014 	uint32_t	rcq_cid;
67015 	/* SRQ CQ context id. */
67016 	uint32_t	srq_cid;
67017 	/* Protection domain id. */
67018 	uint32_t	pd_id;
67019 	/* SQ PBL physical address. */
67020 	uint64_t	sq_pbl;
67021 	/* RQ PBL physical address. */
67022 	uint64_t	rq_pbl;
67023 } cmdq_create_qp1_t, *pcmdq_create_qp1_t;
67024 
67025 /* creq_create_qp1_resp (size:128b/16B) */
67026 
67027 typedef struct creq_create_qp1_resp {
67028 	uint8_t	type;
67029 	/*
67030 	 * This field indicates the exact type of the completion.
67031 	 * By convention, the LSB identifies the length of the
67032 	 * record in 16B units. Even values indicate 16B
67033 	 * records. Odd values indicate 32B
67034 	 * records.
67035 	 */
67036 	#define CREQ_CREATE_QP1_RESP_TYPE_MASK	UINT32_C(0x3f)
67037 	#define CREQ_CREATE_QP1_RESP_TYPE_SFT	0
67038 	/* QP Async Notification */
67039 		#define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67040 		#define CREQ_CREATE_QP1_RESP_TYPE_LAST	CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT
67041 	/* Status of the response. */
67042 	uint8_t	status;
67043 	/* Driver supplied handle to associate the command and the response. */
67044 	uint16_t	cookie;
67045 	/* QP1 context id */
67046 	uint32_t	xid;
67047 	uint8_t	v;
67048 	/*
67049 	 * This value is written by the NIC such that it will be different
67050 	 * for each pass through the completion queue. The even passes
67051 	 * will write 1. The odd passes will write 0.
67052 	 */
67053 	#define CREQ_CREATE_QP1_RESP_V	UINT32_C(0x1)
67054 	/* Event or command opcode. */
67055 	uint8_t	event;
67056 	/* Create QP1 command response. */
67057 	#define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 UINT32_C(0x13)
67058 	#define CREQ_CREATE_QP1_RESP_EVENT_LAST	CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1
67059 	uint8_t	reserved48[6];
67060 } creq_create_qp1_resp_t, *pcreq_create_qp1_resp_t;
67061 
67062 /***************
67063  * destroy_qp1 *
67064  ***************/
67065 
67066 
67067 /* cmdq_destroy_qp1 (size:192b/24B) */
67068 
67069 typedef struct cmdq_destroy_qp1 {
67070 	/* Command opcode. */
67071 	uint8_t	opcode;
67072 	/* Destroy QP1 command deletes and flushes the specified QP1. */
67073 	#define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 UINT32_C(0x14)
67074 	#define CMDQ_DESTROY_QP1_OPCODE_LAST	CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1
67075 	/* Size of the command in 16-byte units. */
67076 	uint8_t	cmd_size;
67077 	/* Flags and attribs of the command. */
67078 	uint16_t	flags;
67079 	/* Driver supplied handle to associate the command and the response. */
67080 	uint16_t	cookie;
67081 	/* Size of the response buffer in 16-byte units. */
67082 	uint8_t	resp_size;
67083 	uint8_t	reserved8;
67084 	/* Host address of the response. */
67085 	uint64_t	resp_addr;
67086 	/* QP1 context id */
67087 	uint32_t	qp1_cid;
67088 	uint32_t	unused_0;
67089 } cmdq_destroy_qp1_t, *pcmdq_destroy_qp1_t;
67090 
67091 /* creq_destroy_qp1_resp (size:128b/16B) */
67092 
67093 typedef struct creq_destroy_qp1_resp {
67094 	uint8_t	type;
67095 	/*
67096 	 * This field indicates the exact type of the completion.
67097 	 * By convention, the LSB identifies the length of the
67098 	 * record in 16B units. Even values indicate 16B
67099 	 * records. Odd values indicate 32B
67100 	 * records.
67101 	 */
67102 	#define CREQ_DESTROY_QP1_RESP_TYPE_MASK	UINT32_C(0x3f)
67103 	#define CREQ_DESTROY_QP1_RESP_TYPE_SFT	0
67104 	/* QP Async Notification */
67105 		#define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67106 		#define CREQ_DESTROY_QP1_RESP_TYPE_LAST	CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT
67107 	/* Status of the response. */
67108 	uint8_t	status;
67109 	/* Driver supplied handle to associate the command and the response. */
67110 	uint16_t	cookie;
67111 	/* QP1 context id */
67112 	uint32_t	xid;
67113 	uint8_t	v;
67114 	/*
67115 	 * This value is written by the NIC such that it will be different
67116 	 * for each pass through the completion queue. The even passes
67117 	 * will write 1. The odd passes will write 0.
67118 	 */
67119 	#define CREQ_DESTROY_QP1_RESP_V	UINT32_C(0x1)
67120 	/* Event or command opcode. */
67121 	uint8_t	event;
67122 	/* Destroy QP1 command response. */
67123 	#define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 UINT32_C(0x14)
67124 	#define CREQ_DESTROY_QP1_RESP_EVENT_LAST	CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1
67125 	uint8_t	reserved48[6];
67126 } creq_destroy_qp1_resp_t, *pcreq_destroy_qp1_resp_t;
67127 
67128 /*************
67129  * create_ah *
67130  *************/
67131 
67132 
67133 /* cmdq_create_ah (size:512b/64B) */
67134 
67135 typedef struct cmdq_create_ah {
67136 	/* Command opcode. */
67137 	uint8_t	opcode;
67138 	/* Create AH command allocates an AH with the specified parameters. */
67139 	#define CMDQ_CREATE_AH_OPCODE_CREATE_AH UINT32_C(0x15)
67140 	#define CMDQ_CREATE_AH_OPCODE_LAST	CMDQ_CREATE_AH_OPCODE_CREATE_AH
67141 	/* Size of the command in 16-byte units. */
67142 	uint8_t	cmd_size;
67143 	/* Flags and attribs of the command. */
67144 	uint16_t	flags;
67145 	/* Driver supplied handle to associate the command and the response. */
67146 	uint16_t	cookie;
67147 	/* Size of the response buffer in 16-byte units. */
67148 	uint8_t	resp_size;
67149 	uint8_t	reserved8;
67150 	/* Host address of the response. */
67151 	uint64_t	resp_addr;
67152 	/* AH handle. */
67153 	uint64_t	ah_handle;
67154 	/* Destination GID, specified in BE format. */
67155 	uint32_t	dgid[4];
67156 	/* V1, V2IPv4 or V2IPv6. */
67157 	uint8_t	type;
67158 	/* V2IPv4. */
67159 	#define CMDQ_CREATE_AH_TYPE_V1	UINT32_C(0x0)
67160 	/* V2IPv4. */
67161 	#define CMDQ_CREATE_AH_TYPE_V2IPV4 UINT32_C(0x2)
67162 	/* V2IPv6. */
67163 	#define CMDQ_CREATE_AH_TYPE_V2IPV6 UINT32_C(0x3)
67164 	#define CMDQ_CREATE_AH_TYPE_LAST  CMDQ_CREATE_AH_TYPE_V2IPV6
67165 	/* IPv6 Hop limit. */
67166 	uint8_t	hop_limit;
67167 	/* SGID index. */
67168 	uint16_t	sgid_index;
67169 	uint32_t	dest_vlan_id_flow_label;
67170 	/* Flow label. */
67171 	#define CMDQ_CREATE_AH_FLOW_LABEL_MASK  UINT32_C(0xfffff)
67172 	#define CMDQ_CREATE_AH_FLOW_LABEL_SFT   0
67173 	/* Destination VLAN ID. */
67174 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK UINT32_C(0xfff00000)
67175 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
67176 	/* Protection domain id. */
67177 	uint32_t	pd_id;
67178 	uint32_t	unused_0;
67179 	/* Destination MAC address. */
67180 	uint16_t	dest_mac[3];
67181 	/* Traffic class. */
67182 	uint8_t	traffic_class;
67183 	uint8_t	enable_cc;
67184 	/* Enable congestion control. */
67185 	#define CMDQ_CREATE_AH_ENABLE_CC	UINT32_C(0x1)
67186 } cmdq_create_ah_t, *pcmdq_create_ah_t;
67187 
67188 /* creq_create_ah_resp (size:128b/16B) */
67189 
67190 typedef struct creq_create_ah_resp {
67191 	uint8_t	type;
67192 	/*
67193 	 * This field indicates the exact type of the completion.
67194 	 * By convention, the LSB identifies the length of the
67195 	 * record in 16B units. Even values indicate 16B
67196 	 * records. Odd values indicate 32B
67197 	 * records.
67198 	 */
67199 	#define CREQ_CREATE_AH_RESP_TYPE_MASK	UINT32_C(0x3f)
67200 	#define CREQ_CREATE_AH_RESP_TYPE_SFT	0
67201 	/* QP Async Notification */
67202 		#define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67203 		#define CREQ_CREATE_AH_RESP_TYPE_LAST	CREQ_CREATE_AH_RESP_TYPE_QP_EVENT
67204 	/* Status of the response. */
67205 	uint8_t	status;
67206 	/* Driver supplied handle to associate the command and the response. */
67207 	uint16_t	cookie;
67208 	/* AH context id */
67209 	uint32_t	xid;
67210 	uint8_t	v;
67211 	/*
67212 	 * This value is written by the NIC such that it will be different
67213 	 * for each pass through the completion queue. The even passes
67214 	 * will write 1. The odd passes will write 0.
67215 	 */
67216 	#define CREQ_CREATE_AH_RESP_V	UINT32_C(0x1)
67217 	/* Event or command opcode. */
67218 	uint8_t	event;
67219 	/* Create AH command response. */
67220 	#define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH UINT32_C(0x15)
67221 	#define CREQ_CREATE_AH_RESP_EVENT_LAST	CREQ_CREATE_AH_RESP_EVENT_CREATE_AH
67222 	uint8_t	reserved48[6];
67223 } creq_create_ah_resp_t, *pcreq_create_ah_resp_t;
67224 
67225 /**************
67226  * destroy_ah *
67227  **************/
67228 
67229 
67230 /* cmdq_destroy_ah (size:192b/24B) */
67231 
67232 typedef struct cmdq_destroy_ah {
67233 	/* Command opcode. */
67234 	uint8_t	opcode;
67235 	/* Destroy AH command deletes the specified AH. */
67236 	#define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH UINT32_C(0x16)
67237 	#define CMDQ_DESTROY_AH_OPCODE_LAST	CMDQ_DESTROY_AH_OPCODE_DESTROY_AH
67238 	/* Size of the command in 16-byte units. */
67239 	uint8_t	cmd_size;
67240 	/* Flags and attribs of the command. */
67241 	uint16_t	flags;
67242 	/* Driver supplied handle to associate the command and the response. */
67243 	uint16_t	cookie;
67244 	/* Size of the response buffer in 16-byte units. */
67245 	uint8_t	resp_size;
67246 	uint8_t	reserved8;
67247 	/* Host address of the response. */
67248 	uint64_t	resp_addr;
67249 	/* AH context id */
67250 	uint32_t	ah_cid;
67251 	uint32_t	unused_0;
67252 } cmdq_destroy_ah_t, *pcmdq_destroy_ah_t;
67253 
67254 /* creq_destroy_ah_resp (size:128b/16B) */
67255 
67256 typedef struct creq_destroy_ah_resp {
67257 	uint8_t	type;
67258 	/*
67259 	 * This field indicates the exact type of the completion.
67260 	 * By convention, the LSB identifies the length of the
67261 	 * record in 16B units. Even values indicate 16B
67262 	 * records. Odd values indicate 32B
67263 	 * records.
67264 	 */
67265 	#define CREQ_DESTROY_AH_RESP_TYPE_MASK	UINT32_C(0x3f)
67266 	#define CREQ_DESTROY_AH_RESP_TYPE_SFT	0
67267 	/* QP Async Notification */
67268 		#define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67269 		#define CREQ_DESTROY_AH_RESP_TYPE_LAST	CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT
67270 	/* Status of the response. */
67271 	uint8_t	status;
67272 	/* Driver supplied handle to associate the command and the response. */
67273 	uint16_t	cookie;
67274 	/* AH context id */
67275 	uint32_t	xid;
67276 	uint8_t	v;
67277 	/*
67278 	 * This value is written by the NIC such that it will be different
67279 	 * for each pass through the completion queue. The even passes
67280 	 * will write 1. The odd passes will write 0.
67281 	 */
67282 	#define CREQ_DESTROY_AH_RESP_V	UINT32_C(0x1)
67283 	/* Event or command opcode. */
67284 	uint8_t	event;
67285 	/* Destroy AH command response. */
67286 	#define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH UINT32_C(0x16)
67287 	#define CREQ_DESTROY_AH_RESP_EVENT_LAST	CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH
67288 	uint8_t	reserved48[6];
67289 } creq_destroy_ah_resp_t, *pcreq_destroy_ah_resp_t;
67290 
67291 /********************
67292  * query_roce_stats *
67293  ********************/
67294 
67295 
67296 /* cmdq_query_roce_stats (size:192b/24B) */
67297 
67298 typedef struct cmdq_query_roce_stats {
67299 	/* Command opcode. */
67300 	uint8_t	opcode;
67301 	/* Query RoCE statistics. */
67302 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
67303 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST		CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
67304 	/* Size of the command in 16-byte units. */
67305 	uint8_t	cmd_size;
67306 	/* Flags and attribs of the command. */
67307 	uint16_t	flags;
67308 	/*
67309 	 * When this bit is set FW will use the collection_id to extract RoCE statistics.
67310 	 * If function_id is also specified the FW will return stats corresponding to the
67311 	 * collection for the function_id specified.
67312 	 */
67313 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_COLLECTION_ID	UINT32_C(0x1)
67314 	/*
67315 	 * When this bit is set FW will use the function_id to extract RoCE statistics.
67316 	 * When collection is specified then FW will return the specific collection
67317 	 * stats and if the collection is not specified then FW will return the default
67318 	 * stats which will be for all QPs.
67319 	 */
67320 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_FUNCTION_ID	UINT32_C(0x2)
67321 	/* Driver supplied handle to associate the command and the response. */
67322 	uint16_t	cookie;
67323 	/* Size of the response buffer in 16-byte units. */
67324 	uint8_t	resp_size;
67325 	/* The specific statistics group being queried. */
67326 	uint8_t	collection_id;
67327 	/* Host address of the response. */
67328 	uint64_t	resp_addr;
67329 	/* Unique identifier for a function */
67330 	uint32_t	function_id;
67331 	/* PF number */
67332 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_MASK  UINT32_C(0xff)
67333 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_SFT   0
67334 	/* VF number */
67335 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_MASK  UINT32_C(0xffff00)
67336 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_SFT   8
67337 	/* When set the vf_num is valid. */
67338 	#define CMDQ_QUERY_ROCE_STATS_VF_VALID	UINT32_C(0x1000000)
67339 	uint32_t	reserved32;
67340 } cmdq_query_roce_stats_t, *pcmdq_query_roce_stats_t;
67341 
67342 /* creq_query_roce_stats_resp (size:128b/16B) */
67343 
67344 typedef struct creq_query_roce_stats_resp {
67345 	uint8_t	type;
67346 	/*
67347 	 * This field indicates the exact type of the completion.
67348 	 * By convention, the LSB identifies the length of the
67349 	 * record in 16B units. Even values indicate 16B
67350 	 * records. Odd values indicate 32B
67351 	 * records.
67352 	 */
67353 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK	UINT32_C(0x3f)
67354 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT	0
67355 	/* QP Async Notification */
67356 		#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67357 		#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST	CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
67358 	/* Status of the response. */
67359 	uint8_t	status;
67360 	/* Driver supplied handle to associate the command and the response. */
67361 	uint16_t	cookie;
67362 	/* Side buffer size in 16-byte units */
67363 	uint32_t	size;
67364 	uint8_t	v;
67365 	/*
67366 	 * This value is written by the NIC such that it will be different
67367 	 * for each pass through the completion queue. The even passes
67368 	 * will write 1. The odd passes will write 0.
67369 	 */
67370 	#define CREQ_QUERY_ROCE_STATS_RESP_V	UINT32_C(0x1)
67371 	/* Event or command opcode. */
67372 	uint8_t	event;
67373 	/* Query RoCE statistics. */
67374 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS UINT32_C(0x8e)
67375 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST		CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
67376 	uint8_t	reserved48[6];
67377 } creq_query_roce_stats_resp_t, *pcreq_query_roce_stats_resp_t;
67378 
67379 /* Query RoCE Stats command response side buffer structure. */
67380 /* creq_query_roce_stats_resp_sb (size:2944b/368B) */
67381 
67382 typedef struct creq_query_roce_stats_resp_sb {
67383 	/* Command opcode. */
67384 	uint8_t	opcode;
67385 	/* Query RoCE statistics. */
67386 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
67387 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST		CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
67388 	/* Status of the response. */
67389 	uint8_t	status;
67390 	/* Driver supplied handle to associate the command and the response. */
67391 	uint16_t	cookie;
67392 	/* Flags and attribs of the command. */
67393 	uint16_t	flags;
67394 	/* Size of the response buffer in 16-byte units. */
67395 	uint8_t	resp_size;
67396 	uint8_t	rsvd;
67397 	uint32_t	num_counters;
67398 	uint32_t	rsvd1;
67399 	uint64_t	to_retransmits;
67400 	/* seq_err_naks_rcvd is 64 b */
67401 	uint64_t	seq_err_naks_rcvd;
67402 	/* max_retry_exceeded is 64 b */
67403 	uint64_t	max_retry_exceeded;
67404 	/* rnr_naks_rcvd is 64 b */
67405 	uint64_t	rnr_naks_rcvd;
67406 	uint64_t	missing_resp;
67407 	/* unrecoverable_err is 64 b */
67408 	uint64_t	unrecoverable_err;
67409 	/* bad_resp_err is 64 b */
67410 	uint64_t	bad_resp_err;
67411 	/* local_qp_op_err is 64 b */
67412 	uint64_t	local_qp_op_err;
67413 	/* local_protection_err is 64 b */
67414 	uint64_t	local_protection_err;
67415 	/* mem_mgmt_op_err is 64 b */
67416 	uint64_t	mem_mgmt_op_err;
67417 	/* remote_invalid_req_err is 64 b */
67418 	uint64_t	remote_invalid_req_err;
67419 	/* remote_access_err is 64 b */
67420 	uint64_t	remote_access_err;
67421 	/* remote_op_err is 64 b */
67422 	uint64_t	remote_op_err;
67423 	/* dup_req is 64 b */
67424 	uint64_t	dup_req;
67425 	/* res_exceed_max is 64 b */
67426 	uint64_t	res_exceed_max;
67427 	/* res_length_mismatch is 64 b */
67428 	uint64_t	res_length_mismatch;
67429 	/* res_exceeds_wqe is 64 b */
67430 	uint64_t	res_exceeds_wqe;
67431 	/* res_opcode_err is 64 b */
67432 	uint64_t	res_opcode_err;
67433 	/* res_rx_invalid_rkey is 64 b */
67434 	uint64_t	res_rx_invalid_rkey;
67435 	/* res_rx_domain_err is 64 b */
67436 	uint64_t	res_rx_domain_err;
67437 	/* res_rx_no_perm is 64 b */
67438 	uint64_t	res_rx_no_perm;
67439 	/* res_rx_range_err is 64 b */
67440 	uint64_t	res_rx_range_err;
67441 	/* res_tx_invalid_rkey is 64 b */
67442 	uint64_t	res_tx_invalid_rkey;
67443 	/* res_tx_domain_err is 64 b */
67444 	uint64_t	res_tx_domain_err;
67445 	/* res_tx_no_perm is 64 b */
67446 	uint64_t	res_tx_no_perm;
67447 	/* res_tx_range_err is 64 b */
67448 	uint64_t	res_tx_range_err;
67449 	/* res_irrq_oflow is 64 b */
67450 	uint64_t	res_irrq_oflow;
67451 	/* res_unsup_opcode is 64 b */
67452 	uint64_t	res_unsup_opcode;
67453 	/* res_unaligned_atomic is 64 b */
67454 	uint64_t	res_unaligned_atomic;
67455 	/* res_rem_inv_err is 64 b */
67456 	uint64_t	res_rem_inv_err;
67457 	/* res_mem_error is 64 b */
67458 	uint64_t	res_mem_error;
67459 	/* res_srq_err is 64 b */
67460 	uint64_t	res_srq_err;
67461 	/* res_cmp_err is 64 b */
67462 	uint64_t	res_cmp_err;
67463 	/* res_invalid_dup_rkey is 64 b */
67464 	uint64_t	res_invalid_dup_rkey;
67465 	/* res_wqe_format_err is 64 b */
67466 	uint64_t	res_wqe_format_err;
67467 	/* res_cq_load_err is 64 b */
67468 	uint64_t	res_cq_load_err;
67469 	/* res_srq_load_err is 64 b */
67470 	uint64_t	res_srq_load_err;
67471 	/* res_tx_pci_err is 64 b */
67472 	uint64_t	res_tx_pci_err;
67473 	/* res_rx_pci_err is 64 b */
67474 	uint64_t	res_rx_pci_err;
67475 	/* res_oos_drop_count is 64 b */
67476 	uint64_t	res_oos_drop_count;
67477 	/* active_qp_count_p0 is 64 b */
67478 	uint64_t	active_qp_count_p0;
67479 	/* active_qp_count_p1 is 64 b */
67480 	uint64_t	active_qp_count_p1;
67481 	/* active_qp_count_p2 is 64 b */
67482 	uint64_t	active_qp_count_p2;
67483 	/* active_qp_count_p3 is 64 b */
67484 	uint64_t	active_qp_count_p3;
67485 } creq_query_roce_stats_resp_sb_t, *pcreq_query_roce_stats_resp_sb_t;
67486 
67487 /************************
67488  * query_roce_stats_ext *
67489  ************************/
67490 
67491 
67492 /* cmdq_query_roce_stats_ext (size:192b/24B) */
67493 
67494 typedef struct cmdq_query_roce_stats_ext {
67495 	/* Command opcode. */
67496 	uint8_t	opcode;
67497 	/* Query extended RoCE statistics. */
67498 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS UINT32_C(0x92)
67499 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_LAST		CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS
67500 	/* Size of the command in 16-byte units. */
67501 	uint8_t	cmd_size;
67502 	/* Flags and attribs of the command. */
67503 	uint16_t	flags;
67504 	/*
67505 	 * When this bit is set FW will use the collection_id to extract RoCE statistics.
67506 	 * If function_id is also specified the FW will return stats corresponding to the
67507 	 * collection for the function_id specified.
67508 	 */
67509 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_COLLECTION_ID	UINT32_C(0x1)
67510 	/*
67511 	 * When this bit is set FW will use the function_id to extract RoCE statistics.
67512 	 * When collection is specified then FW will return the specific collection
67513 	 * stats and if the collection is not specified then FW will return the default
67514 	 * stats which will be for all QPs.
67515 	 */
67516 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID	UINT32_C(0x2)
67517 	/* Driver supplied handle to associate the command and the response. */
67518 	uint16_t	cookie;
67519 	/* Size of the response buffer in 16-byte units. */
67520 	uint8_t	resp_size;
67521 	/* The specific statistics group being queried. */
67522 	uint8_t	collection_id;
67523 	/* Host address of the response. */
67524 	uint64_t	resp_addr;
67525 	/* Unique identifier for a function */
67526 	uint32_t	function_id;
67527 	/* PF number */
67528 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_MASK  UINT32_C(0xff)
67529 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_SFT   0
67530 	/* VF number */
67531 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_MASK  UINT32_C(0xffff00)
67532 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_SFT   8
67533 	/* When set the vf_num is valid. */
67534 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_VALID	UINT32_C(0x1000000)
67535 	uint32_t	reserved32;
67536 } cmdq_query_roce_stats_ext_t, *pcmdq_query_roce_stats_ext_t;
67537 
67538 /* creq_query_roce_stats_ext_resp (size:128b/16B) */
67539 
67540 typedef struct creq_query_roce_stats_ext_resp {
67541 	uint8_t	type;
67542 	/*
67543 	 * This field indicates the exact type of the completion.
67544 	 * By convention, the LSB identifies the length of the
67545 	 * record in 16B units. Even values indicate 16B
67546 	 * records. Odd values indicate 32B
67547 	 * records.
67548 	 */
67549 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_MASK	UINT32_C(0x3f)
67550 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_SFT	0
67551 	/* QP Async Notification */
67552 		#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67553 		#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_LAST	CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT
67554 	/* Status of the response. */
67555 	uint8_t	status;
67556 	/* Driver supplied handle to associate the command and the response. */
67557 	uint16_t	cookie;
67558 	/* Side buffer size in 16-byte units */
67559 	uint32_t	size;
67560 	uint8_t	v;
67561 	/*
67562 	 * This value is written by the NIC such that it will be different
67563 	 * for each pass through the completion queue. The even passes
67564 	 * will write 1. The odd passes will write 0.
67565 	 */
67566 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_V	UINT32_C(0x1)
67567 	/* Event or command opcode. */
67568 	uint8_t	event;
67569 	/* Query extended RoCE statistics. */
67570 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
67571 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_LAST		CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT
67572 	uint8_t	reserved48[6];
67573 } creq_query_roce_stats_ext_resp_t, *pcreq_query_roce_stats_ext_resp_t;
67574 
67575 /* Query extended RoCE Stats command response side buffer structure. */
67576 /* creq_query_roce_stats_ext_resp_sb (size:1984b/248B) */
67577 
67578 typedef struct creq_query_roce_stats_ext_resp_sb {
67579 	/* Command opcode. */
67580 	uint8_t	opcode;
67581 	/* Query extended RoCE statistics. */
67582 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
67583 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_LAST		CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT
67584 	/* Status of the response. */
67585 	uint8_t	status;
67586 	/* Driver supplied handle to associate the command and the response. */
67587 	uint16_t	cookie;
67588 	/* Flags and attribs of the command. */
67589 	uint16_t	flags;
67590 	/* Size of the response buffer in 16-byte units. */
67591 	uint8_t	resp_size;
67592 	uint8_t	rsvd;
67593 	/* Number of transmitted Atomic request packets. */
67594 	uint64_t	tx_atomic_req_pkts;
67595 	/* Number of transmitted Read request packets. */
67596 	uint64_t	tx_read_req_pkts;
67597 	/* Number of transmitted Read response packets. */
67598 	uint64_t	tx_read_res_pkts;
67599 	/* Number of transmitted Write request packets. */
67600 	uint64_t	tx_write_req_pkts;
67601 	/*
67602 	 * Number of transmitted Send request packets.
67603 	 * This is for RC QPs only.
67604 	 */
67605 	uint64_t	tx_send_req_pkts;
67606 	/*
67607 	 * Number of transmitted RoCE packets.
67608 	 * This includes RC, UD, RawEth, and QP1 packets
67609 	 */
67610 	uint64_t	tx_roce_pkts;
67611 	/*
67612 	 * Number of transmitted RoCE header and payload bytes.
67613 	 * This includes RC, UD, RawEth, and QP1 packets.
67614 	 */
67615 	uint64_t	tx_roce_bytes;
67616 	/* Number of received Atomic request packets. */
67617 	uint64_t	rx_atomic_req_pkts;
67618 	/* Number of received Read request packets. */
67619 	uint64_t	rx_read_req_pkts;
67620 	/* Number of received Read response packets. */
67621 	uint64_t	rx_read_res_pkts;
67622 	/* Number of received Write request packets. */
67623 	uint64_t	rx_write_req_pkts;
67624 	/*
67625 	 * Number of received Send request packets.
67626 	 * This is for RC QPs only.
67627 	 */
67628 	uint64_t	rx_send_req_pkts;
67629 	/*
67630 	 * Number of received RoCE packets including RoCE packets with errors.
67631 	 * This includes RC, UD, RawEth, and QP1 packets
67632 	 */
67633 	uint64_t	rx_roce_pkts;
67634 	/*
67635 	 * Number of received RoCE header and payload bytes including RoCE
67636 	 * packets with errors.
67637 	 * This includes RC, UD, RawEth, and QP1 packets.
67638 	 */
67639 	uint64_t	rx_roce_bytes;
67640 	/*
67641 	 * Number of received RoCE packets.
67642 	 * This includes RC, UD, RawEth, and QP1 packets
67643 	 */
67644 	uint64_t	rx_roce_good_pkts;
67645 	/*
67646 	 * Number of received RoCE header and payload bytes.
67647 	 * This includes RC, UD, RawEth, and QP1 packets.
67648 	 */
67649 	uint64_t	rx_roce_good_bytes;
67650 	/*
67651 	 * Number of drops that occurred to lack of buffers.
67652 	 * This is for RC QPs only.
67653 	 */
67654 	uint64_t	rx_out_of_buffer_pkts;
67655 	/* Number of packets that were received out of sequence. */
67656 	uint64_t	rx_out_of_sequence_pkts;
67657 	/* Number of transmitted CNP packets. The counter is per port. */
67658 	uint64_t	tx_cnp_pkts;
67659 	/* Number of received CNP packets. The counter is per port. */
67660 	uint64_t	rx_cnp_pkts;
67661 	/* Number of received ECN-marked RoCE packets. The counter is per port. */
67662 	uint64_t	rx_ecn_marked_pkts;
67663 	/* Number of transmitted CNP bytes. */
67664 	uint64_t	tx_cnp_bytes;
67665 	/* Number of received CNP bytes. */
67666 	uint64_t	rx_cnp_bytes;
67667 	/*
67668 	 * Number of sequence error NAKs received.
67669 	 * This counter is only applicable for devices that support
67670 	 * hardware based retransmission.
67671 	 */
67672 	uint64_t	seq_err_naks_rcvd;
67673 	/*
67674 	 * Number of RNR NAKs received.
67675 	 * This counter is only applicable for devices that support
67676 	 * hardware based retransmission.
67677 	 */
67678 	uint64_t	rnr_naks_rcvd;
67679 	/*
67680 	 * Number of missing response resulting in HW retransmission.
67681 	 * This counter is only applicable for devices that support
67682 	 * hardware based retransmission.
67683 	 */
67684 	uint64_t	missing_resp;
67685 	/*
67686 	 * Number of timeouts resulting in HW retransmission.
67687 	 * This counter is only applicable for devices that support
67688 	 * hardware based retransmission.
67689 	 */
67690 	uint64_t	to_retransmit;
67691 	/*
67692 	 * Number of duplicate read requests resulting in HW retransmission.
67693 	 * This counter is only applicable for devices that support
67694 	 * hardware based retransmission.
67695 	 */
67696 	uint64_t	dup_req;
67697 	/*
67698 	 * Number of received DCN payload cut packets.
67699 	 * This counter is only applicable for devices that support
67700 	 * the DCN Payload Cut feature.
67701 	 */
67702 	uint64_t	rx_dcn_payload_cut;
67703 	/* Number of transmitted packets that bypassed the transmit engine. */
67704 	uint64_t	te_bypassed;
67705 } creq_query_roce_stats_ext_resp_sb_t, *pcreq_query_roce_stats_ext_resp_sb_t;
67706 
67707 /**************
67708  * query_func *
67709  **************/
67710 
67711 
67712 /* cmdq_query_func (size:128b/16B) */
67713 
67714 typedef struct cmdq_query_func {
67715 	/* Command opcode. */
67716 	uint8_t	opcode;
67717 	/* Query the HW capabilities for the function. */
67718 	#define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC UINT32_C(0x83)
67719 	#define CMDQ_QUERY_FUNC_OPCODE_LAST	CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC
67720 	/* Size of the command in 16-byte units. */
67721 	uint8_t	cmd_size;
67722 	/* Flags and attribs of the command. */
67723 	uint16_t	flags;
67724 	/* Driver supplied handle to associate the command and the response. */
67725 	uint16_t	cookie;
67726 	/* Size of the response buffer in 16-byte units. */
67727 	uint8_t	resp_size;
67728 	uint8_t	reserved8;
67729 	/* Host address of the response. */
67730 	uint64_t	resp_addr;
67731 } cmdq_query_func_t, *pcmdq_query_func_t;
67732 
67733 /* creq_query_func_resp (size:128b/16B) */
67734 
67735 typedef struct creq_query_func_resp {
67736 	uint8_t	type;
67737 	/*
67738 	 * This field indicates the exact type of the completion.
67739 	 * By convention, the LSB identifies the length of the
67740 	 * record in 16B units. Even values indicate 16B
67741 	 * records. Odd values indicate 32B
67742 	 * records.
67743 	 */
67744 	#define CREQ_QUERY_FUNC_RESP_TYPE_MASK	UINT32_C(0x3f)
67745 	#define CREQ_QUERY_FUNC_RESP_TYPE_SFT	0
67746 	/* QP Async Notification */
67747 		#define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67748 		#define CREQ_QUERY_FUNC_RESP_TYPE_LAST	CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT
67749 	/* Status of the response. */
67750 	uint8_t	status;
67751 	/* Driver supplied handle to associate the command and the response. */
67752 	uint16_t	cookie;
67753 	/* Side buffer size in 16-byte units */
67754 	uint32_t	size;
67755 	uint8_t	v;
67756 	/*
67757 	 * This value is written by the NIC such that it will be different
67758 	 * for each pass through the completion queue. The even passes
67759 	 * will write 1. The odd passes will write 0.
67760 	 */
67761 	#define CREQ_QUERY_FUNC_RESP_V	UINT32_C(0x1)
67762 	/* Event or command opcode. */
67763 	uint8_t	event;
67764 	/* Query info PF command response. */
67765 	#define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC UINT32_C(0x83)
67766 	#define CREQ_QUERY_FUNC_RESP_EVENT_LAST	CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC
67767 	uint8_t	reserved48[6];
67768 } creq_query_func_resp_t, *pcreq_query_func_resp_t;
67769 
67770 /* Query function command response side buffer structure. */
67771 /* creq_query_func_resp_sb (size:1088b/136B) */
67772 
67773 typedef struct creq_query_func_resp_sb {
67774 	/* Command opcode. */
67775 	uint8_t	opcode;
67776 	/* Query info PF command response. */
67777 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC UINT32_C(0x83)
67778 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_LAST	CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC
67779 	/* Status of the response. */
67780 	uint8_t	status;
67781 	/* Driver supplied handle to associate the command and the response. */
67782 	uint16_t	cookie;
67783 	/* Flags and attribs of the command. */
67784 	uint16_t	flags;
67785 	/* Size of the response buffer in 16-byte units. */
67786 	uint8_t	resp_size;
67787 	uint8_t	reserved8;
67788 	/* Max MR size supported. */
67789 	uint64_t	max_mr_size;
67790 	/* Max QP supported. */
67791 	uint32_t	max_qp;
67792 	/* Max WQEs per QP. */
67793 	uint16_t	max_qp_wr;
67794 	/* Device capability flags. */
67795 	uint16_t	dev_cap_flags;
67796 	/* Allow QP resizing. */
67797 	#define CREQ_QUERY_FUNC_RESP_SB_RESIZE_QP			UINT32_C(0x1)
67798 	/* Specifies Congestion Control (CC) generation. */
67799 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_MASK		UINT32_C(0xe)
67800 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_SFT		1
67801 	/*
67802 	 * Includes support for DCTCP and TCP CC algorithms,
67803 	 * enabling operation in networks where PFC is enabled.
67804 	 */
67805 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN0		(UINT32_C(0x0) << 1)
67806 	/*
67807 	 * Enhances cc_gen0 support with probabilistic marking algorithm,
67808 	 * enabling fast ramp up and convergence,
67809 	 * as well as operation in networks where PFC is not enabled.
67810 	 * Includes a number of parameters that are different from cc_gen0
67811 	 * chips as well as new parameters. TCP CC algorithm is not supported.
67812 	 */
67813 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1		(UINT32_C(0x1) << 1)
67814 	/*
67815 	 * Enhances cc_gen1 support for additional CC parameters:
67816 	 * reduce_init_en, reduce_init_cong_free_rtts_th, random_no_red_en,
67817 	 * actual_cr_shift_correction_en, quota_period_adjust_en
67818 	 */
67819 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT	(UINT32_C(0x2) << 1)
67820 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_LAST		CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT
67821 	/*
67822 	 * Support for the extended RoCE statistics is available. These
67823 	 * statistics are queried via the `query_roce_stats_ext` command
67824 	 * and are enabled on a per-QP basis via `create_qp`.
67825 	 */
67826 	#define CREQ_QUERY_FUNC_RESP_SB_EXT_STATS			UINT32_C(0x10)
67827 	/*
67828 	 * Support for both allocating and registering a new MR via the
67829 	 * `register_mr` command is available. With this feature the
67830 	 * `allocate_mrw` command does not have to be called before
67831 	 * registering.
67832 	 */
67833 	#define CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC		UINT32_C(0x20)
67834 	/*
67835 	 * Support for optimized transmit path to lower latency for WQEs
67836 	 * with inline data.
67837 	 */
67838 	#define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZED_TRANSMIT_ENABLED	UINT32_C(0x40)
67839 	/*
67840 	 * The underlying HW uses the version 2 of the CQEs definitions for
67841 	 * the following CQE types:
67842 	 * RES_UD, RES_RAWETH_QP1, RES_UD_CFA
67843 	 */
67844 	#define CREQ_QUERY_FUNC_RESP_SB_CQE_V2			UINT32_C(0x80)
67845 	/* Support for ping pong push mode is available. */
67846 	#define CREQ_QUERY_FUNC_RESP_SB_PINGPONG_PUSH_MODE		UINT32_C(0x100)
67847 	/* Support for hardware requester retransmission is enabled. */
67848 	#define CREQ_QUERY_FUNC_RESP_SB_HW_REQUESTER_RETX_ENABLED	UINT32_C(0x200)
67849 	/* Support for hardware responder retransmission is enabled. */
67850 	#define CREQ_QUERY_FUNC_RESP_SB_HW_RESPONDER_RETX_ENABLED	UINT32_C(0x400)
67851 	/* Max CQs supported. */
67852 	uint32_t	max_cq;
67853 	/* Max CQEs per CQ supported. */
67854 	uint32_t	max_cqe;
67855 	/* Max PDs supported. */
67856 	uint32_t	max_pd;
67857 	/*
67858 	 * Max SGEs per QP WQE supported. On chips with variable-size WQE support,
67859 	 * this field is applicable only for the backward compatible mode.
67860 	 */
67861 	uint8_t	max_sge;
67862 	/* Max SGEs per SRQ WQE supported. */
67863 	uint8_t	max_srq_sge;
67864 	/* Max outstanding RDMA read & atomic supported. */
67865 	uint8_t	max_qp_rd_atom;
67866 	/* Max outstanding RDMA read & atomic that can be sent from an initiator. */
67867 	uint8_t	max_qp_init_rd_atom;
67868 	/* Max MRs supported. */
67869 	uint32_t	max_mr;
67870 	/* Max MWs supported. */
67871 	uint32_t	max_mw;
67872 	/* Max Raw Ethertype QPs supported. */
67873 	uint32_t	max_raw_eth_qp;
67874 	/* Max AHs supported. */
67875 	uint32_t	max_ah;
67876 	/* Max FMRs supported. */
67877 	uint32_t	max_fmr;
67878 	/* Max WQEs per SRQ supported. */
67879 	uint32_t	max_srq_wr;
67880 	/* Max PKEYs supported. */
67881 	uint32_t	max_pkeys;
67882 	/*
67883 	 * Max inline data supported. On chips with variable-size WQE support,
67884 	 * this field is applicable only for the backward compatible mode.
67885 	 */
67886 	uint32_t	max_inline_data;
67887 	/* Max mappings per FMR supported. */
67888 	uint8_t	max_map_per_fmr;
67889 	/* L2 DB space size in pages. */
67890 	uint8_t	l2_db_space_size;
67891 	/* Max SRQs supported. */
67892 	uint16_t	max_srq;
67893 	/* Max GIDs supported. */
67894 	uint32_t	max_gid;
67895 	/*
67896 	 * An array of 48 8-bit values to specify allocation multiplier for TQM host buffer regions.
67897 	 * Each region occupies 16 MB of TQM PBL address space: 0x00000000, 0x01000000, 0x02000000, etc.
67898 	 * The host needs to allocate (<Number of QPs>*multiplier, rounded up to page size) of physical memory for non-zero slots
67899 	 * and map the pages to the corresponding 16MB regions.
67900 	 * Typically there are total 3 non-zero values in this array, their values are 16, 16, 12.
67901 	 * Cu+ will only populate up to index 11. SR may populate up to index 47.
67902 	 */
67903 	uint32_t	tqm_alloc_reqs[12];
67904 	/* Max Doorbell page indices supported. */
67905 	uint32_t	max_dpi;
67906 	/* Max SGEs per QP WQE supported in the variable-size WQE mode. */
67907 	uint8_t	max_sge_var_wqe;
67908 	uint8_t	reserved_8;
67909 	/* Max inline data supported in the variable-size WQE mode. */
67910 	uint16_t	max_inline_data_var_wqe;
67911 } creq_query_func_resp_sb_t, *pcreq_query_func_resp_sb_t;
67912 
67913 /**********************
67914  * set_func_resources *
67915  **********************/
67916 
67917 
67918 /* cmdq_set_func_resources (size:448b/56B) */
67919 
67920 typedef struct cmdq_set_func_resources {
67921 	/* Command opcode. */
67922 	uint8_t	opcode;
67923 	/*
67924 	 * Set the following resources for the function:
67925 	 * - Max QP, CQ, MR+MW, SRQ per PF
67926 	 * - Max QP, CQ, MR+MW, SRQ per VF
67927 	 */
67928 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES UINT32_C(0x84)
67929 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_LAST		CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES
67930 	/* Size of the command in 16-byte units. */
67931 	uint8_t	cmd_size;
67932 	/* Flags and attribs of the command. */
67933 	uint16_t	flags;
67934 	/*
67935 	 * When set, the 32b `max_mrw_per_vf` field is logically divided
67936 	 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
67937 	 */
67938 	#define CMDQ_SET_FUNC_RESOURCES_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x1)
67939 	/* Driver supplied handle to associate the command and the response. */
67940 	uint16_t	cookie;
67941 	/* Size of the response buffer in 16-byte units. */
67942 	uint8_t	resp_size;
67943 	uint8_t	reserved8;
67944 	/* Host address of the response. */
67945 	uint64_t	resp_addr;
67946 	/* Number of QPs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
67947 	uint32_t	number_of_qp;
67948 	/* Number of MRWs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
67949 	uint32_t	number_of_mrw;
67950 	/* Number of SRQs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
67951 	uint32_t	number_of_srq;
67952 	/* Number of CQs. It is the responsibility of the host to first extend the existing PBL with new addresses to pages to handle the adjustment. Must be greater or equal to current. */
67953 	uint32_t	number_of_cq;
67954 	/* Number of QPs per VF. */
67955 	uint32_t	max_qp_per_vf;
67956 	/*
67957 	 * If the MR/AV split reservation flag is not set, then this field
67958 	 * represents the total number of MR plus AV entries allowed per
67959 	 * VF. For versions of firmware that support the split reservation,
67960 	 * when it is not specified half of the entries will be reserved
67961 	 * for MRs and the other half for AVs.
67962 	 *
67963 	 * If the MR/AV split reservation flag is set, then this
67964 	 * field is logically divided into two 16b fields. Bits `[31:16]`
67965 	 * represents the `max_mr_per_vf` and bits `[15:0]` represents
67966 	 * `max_av_per_vf`. The granularity of these values is defined by
67967 	 * the `mrav_num_entries_unit` field returned by the
67968 	 * `backing_store_qcaps` command.
67969 	 */
67970 	uint32_t	max_mrw_per_vf;
67971 	/* Number of SRQs per VF. */
67972 	uint32_t	max_srq_per_vf;
67973 	/* Number of CQs per VF. */
67974 	uint32_t	max_cq_per_vf;
67975 	/* Number of GIDs per VF. */
67976 	uint32_t	max_gid_per_vf;
67977 	/* Statistics context index for this function. */
67978 	uint32_t	stat_ctx_id;
67979 } cmdq_set_func_resources_t, *pcmdq_set_func_resources_t;
67980 
67981 /* creq_set_func_resources_resp (size:128b/16B) */
67982 
67983 typedef struct creq_set_func_resources_resp {
67984 	uint8_t	type;
67985 	/*
67986 	 * This field indicates the exact type of the completion.
67987 	 * By convention, the LSB identifies the length of the
67988 	 * record in 16B units. Even values indicate 16B
67989 	 * records. Odd values indicate 32B
67990 	 * records.
67991 	 */
67992 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK	UINT32_C(0x3f)
67993 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT	0
67994 	/* QP Async Notification */
67995 		#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
67996 		#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_LAST	CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT
67997 	/* Status of the response. */
67998 	uint8_t	status;
67999 	/* Driver supplied handle to associate the command and the response. */
68000 	uint16_t	cookie;
68001 	uint32_t	reserved32;
68002 	uint8_t	v;
68003 	/*
68004 	 * This value is written by the NIC such that it will be different
68005 	 * for each pass through the completion queue. The even passes
68006 	 * will write 1. The odd passes will write 0.
68007 	 */
68008 	#define CREQ_SET_FUNC_RESOURCES_RESP_V	UINT32_C(0x1)
68009 	/* Event or command opcode. */
68010 	uint8_t	event;
68011 	/* Set function resources command response. */
68012 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES UINT32_C(0x84)
68013 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_LAST		CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES
68014 	uint8_t	reserved48[6];
68015 } creq_set_func_resources_resp_t, *pcreq_set_func_resources_resp_t;
68016 
68017 /*************
68018  * stop_func *
68019  *************/
68020 
68021 
68022 /* cmdq_stop_func (size:128b/16B) */
68023 
68024 typedef struct cmdq_stop_func {
68025 	/* Command opcode. */
68026 	uint8_t	opcode;
68027 	/* Stop the function */
68028 	#define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC UINT32_C(0x82)
68029 	#define CMDQ_STOP_FUNC_OPCODE_LAST	CMDQ_STOP_FUNC_OPCODE_STOP_FUNC
68030 	/* Size of the command in 16-byte units. */
68031 	uint8_t	cmd_size;
68032 	/* Flags and attribs of the command. */
68033 	uint16_t	flags;
68034 	/* Driver supplied handle to associate the command and the response. */
68035 	uint16_t	cookie;
68036 	/* Size of the response buffer in 16-byte units. */
68037 	uint8_t	resp_size;
68038 	uint8_t	reserved8;
68039 	/* Host address of the response. */
68040 	uint64_t	resp_addr;
68041 } cmdq_stop_func_t, *pcmdq_stop_func_t;
68042 
68043 /* creq_stop_func_resp (size:128b/16B) */
68044 
68045 typedef struct creq_stop_func_resp {
68046 	uint8_t	type;
68047 	/*
68048 	 * This field indicates the exact type of the completion.
68049 	 * By convention, the LSB identifies the length of the
68050 	 * record in 16B units. Even values indicate 16B
68051 	 * records. Odd values indicate 32B
68052 	 * records.
68053 	 */
68054 	#define CREQ_STOP_FUNC_RESP_TYPE_MASK	UINT32_C(0x3f)
68055 	#define CREQ_STOP_FUNC_RESP_TYPE_SFT	0
68056 	/* QP Async Notification */
68057 		#define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
68058 		#define CREQ_STOP_FUNC_RESP_TYPE_LAST	CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT
68059 	/* Status of the response. */
68060 	uint8_t	status;
68061 	/* Driver supplied handle to associate the command and the response. */
68062 	uint16_t	cookie;
68063 	uint32_t	reserved32;
68064 	uint8_t	v;
68065 	/*
68066 	 * This value is written by the NIC such that it will be different
68067 	 * for each pass through the completion queue. The even passes
68068 	 * will write 1. The odd passes will write 0.
68069 	 */
68070 	#define CREQ_STOP_FUNC_RESP_V	UINT32_C(0x1)
68071 	/* Event or command opcode. */
68072 	uint8_t	event;
68073 	/* Stop PF command response. */
68074 	#define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC UINT32_C(0x82)
68075 	#define CREQ_STOP_FUNC_RESP_EVENT_LAST	CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC
68076 	uint8_t	reserved48[6];
68077 } creq_stop_func_resp_t, *pcreq_stop_func_resp_t;
68078 
68079 /****************
68080  * read_context *
68081  ****************/
68082 
68083 
68084 /* cmdq_read_context (size:192b/24B) */
68085 
68086 typedef struct cmdq_read_context {
68087 	/* Command opcode. */
68088 	uint8_t	opcode;
68089 	/* Read the current state of any internal resource context. Can only be issued from a PF. */
68090 	#define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT UINT32_C(0x85)
68091 	#define CMDQ_READ_CONTEXT_OPCODE_LAST	CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT
68092 	/* Size of the command in 16-byte units. */
68093 	uint8_t	cmd_size;
68094 	/* Flags and attribs of the command. */
68095 	uint16_t	flags;
68096 	/* Driver supplied handle to associate the command and the response. */
68097 	uint16_t	cookie;
68098 	/* Size of the response buffer in 16-byte units. */
68099 	uint8_t	resp_size;
68100 	uint8_t	reserved8;
68101 	/* Host address of the response. */
68102 	uint64_t	resp_addr;
68103 	uint32_t	type_xid;
68104 	/* Context ID */
68105 	#define CMDQ_READ_CONTEXT_XID_MASK UINT32_C(0xffffff)
68106 	#define CMDQ_READ_CONTEXT_XID_SFT  0
68107 	/* Context type */
68108 	#define CMDQ_READ_CONTEXT_TYPE_MASK UINT32_C(0xff000000)
68109 	#define CMDQ_READ_CONTEXT_TYPE_SFT 24
68110 	/* Read QPC. The context (448 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 28 (448/16) */
68111 		#define CMDQ_READ_CONTEXT_TYPE_QPC   (UINT32_C(0x0) << 24)
68112 	/* Read CQ. The context (64 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 4 (64/16) */
68113 		#define CMDQ_READ_CONTEXT_TYPE_CQ	(UINT32_C(0x1) << 24)
68114 	/* Read MRW. The context (128 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 8 (128/16) */
68115 		#define CMDQ_READ_CONTEXT_TYPE_MRW   (UINT32_C(0x2) << 24)
68116 	/* Read SRQ. The context (64 bytes) goes to resp_addr (as is, without a header), and resp_size should be set to 4 (64/16) */
68117 		#define CMDQ_READ_CONTEXT_TYPE_SRQ   (UINT32_C(0x3) << 24)
68118 		#define CMDQ_READ_CONTEXT_TYPE_LAST CMDQ_READ_CONTEXT_TYPE_SRQ
68119 	uint32_t	unused_0;
68120 } cmdq_read_context_t, *pcmdq_read_context_t;
68121 
68122 /* creq_read_context (size:128b/16B) */
68123 
68124 typedef struct creq_read_context {
68125 	uint8_t	type;
68126 	/*
68127 	 * This field indicates the exact type of the completion.
68128 	 * By convention, the LSB identifies the length of the
68129 	 * record in 16B units. Even values indicate 16B
68130 	 * records. Odd values indicate 32B records.
68131 	 * records.
68132 	 */
68133 	#define CREQ_READ_CONTEXT_TYPE_MASK	UINT32_C(0x3f)
68134 	#define CREQ_READ_CONTEXT_TYPE_SFT	0
68135 	/* QP Async Notification */
68136 		#define CREQ_READ_CONTEXT_TYPE_QP_EVENT  UINT32_C(0x38)
68137 		#define CREQ_READ_CONTEXT_TYPE_LAST	CREQ_READ_CONTEXT_TYPE_QP_EVENT
68138 	/* Status of the response. */
68139 	uint8_t	status;
68140 	/* Driver supplied handle to associate the command and the response. */
68141 	uint16_t	cookie;
68142 	uint32_t	reserved32;
68143 	uint8_t	v;
68144 	/*
68145 	 * This value is written by the NIC such that it will be different
68146 	 * for each pass through the completion queue. The even passes
68147 	 * will write 1. The odd passes will write 0.
68148 	 */
68149 	#define CREQ_READ_CONTEXT_V	UINT32_C(0x1)
68150 	/* Event or command opcode. */
68151 	uint8_t	event;
68152 	/* Read the current state of any internal resource context. Can only be issued from a PF. */
68153 	#define CREQ_READ_CONTEXT_EVENT_READ_CONTEXT UINT32_C(0x85)
68154 	#define CREQ_READ_CONTEXT_EVENT_LAST	CREQ_READ_CONTEXT_EVENT_READ_CONTEXT
68155 	uint16_t	reserved16;
68156 	uint32_t	reserved_32;
68157 } creq_read_context_t, *pcreq_read_context_t;
68158 
68159 /*****************
68160  * map_tc_to_cos *
68161  *****************/
68162 
68163 
68164 /* cmdq_map_tc_to_cos (size:192b/24B) */
68165 
68166 typedef struct cmdq_map_tc_to_cos {
68167 	/* Command opcode. */
68168 	uint8_t	opcode;
68169 	/* Map TC to COS. Can only be issued from a PF. */
68170 	#define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS UINT32_C(0x8a)
68171 	#define CMDQ_MAP_TC_TO_COS_OPCODE_LAST	CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS
68172 	/* Size of the command in 16-byte units. */
68173 	uint8_t	cmd_size;
68174 	/* Flags and attribs of the command. */
68175 	uint16_t	flags;
68176 	/* Driver supplied handle to associate the command and the response. */
68177 	uint16_t	cookie;
68178 	/* Size of the response buffer in 16-byte units. */
68179 	uint8_t	resp_size;
68180 	uint8_t	reserved8;
68181 	/* Host address of the response. */
68182 	uint64_t	resp_addr;
68183 	/* 1st COS index mapped to RoCE */
68184 	uint16_t	cos0;
68185 	/* Don't change this COS. */
68186 	#define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE UINT32_C(0xffff)
68187 	#define CMDQ_MAP_TC_TO_COS_COS0_LAST	CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE
68188 	/* 2nd COS index mapped to RoCE */
68189 	uint16_t	cos1;
68190 	/* Disable this COS. */
68191 	#define CMDQ_MAP_TC_TO_COS_COS1_DISABLE   UINT32_C(0x8000)
68192 	/* Don't change this COS. */
68193 	#define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE UINT32_C(0xffff)
68194 	#define CMDQ_MAP_TC_TO_COS_COS1_LAST	CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE
68195 	uint32_t	unused_0;
68196 } cmdq_map_tc_to_cos_t, *pcmdq_map_tc_to_cos_t;
68197 
68198 /* creq_map_tc_to_cos_resp (size:128b/16B) */
68199 
68200 typedef struct creq_map_tc_to_cos_resp {
68201 	uint8_t	type;
68202 	/*
68203 	 * This field indicates the exact type of the completion.
68204 	 * By convention, the LSB identifies the length of the
68205 	 * record in 16B units. Even values indicate 16B
68206 	 * records. Odd values indicate 32B
68207 	 * records.
68208 	 */
68209 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK	UINT32_C(0x3f)
68210 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT	0
68211 	/* QP Async Notification */
68212 		#define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
68213 		#define CREQ_MAP_TC_TO_COS_RESP_TYPE_LAST	CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT
68214 	/* Status of the response. */
68215 	uint8_t	status;
68216 	/* Driver supplied handle to associate the command and the response. */
68217 	uint16_t	cookie;
68218 	uint32_t	reserved32;
68219 	uint8_t	v;
68220 	/*
68221 	 * This value is written by the NIC such that it will be different
68222 	 * for each pass through the completion queue. The even passes
68223 	 * will write 1. The odd passes will write 0.
68224 	 */
68225 	#define CREQ_MAP_TC_TO_COS_RESP_V	UINT32_C(0x1)
68226 	/* Event or command opcode. */
68227 	uint8_t	event;
68228 	/* Map TC to COS response. */
68229 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS UINT32_C(0x8a)
68230 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_LAST	CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS
68231 	uint8_t	reserved48[6];
68232 } creq_map_tc_to_cos_resp_t, *pcreq_map_tc_to_cos_resp_t;
68233 
68234 /*****************
68235  * query_roce_cc *
68236  *****************/
68237 
68238 
68239 /* cmdq_query_roce_cc (size:128b/16B) */
68240 
68241 typedef struct cmdq_query_roce_cc {
68242 	/* Command opcode. */
68243 	uint8_t	opcode;
68244 	/* Query congestion control. */
68245 	#define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
68246 	#define CMDQ_QUERY_ROCE_CC_OPCODE_LAST	CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC
68247 	/* Size of the command in 16-byte units. */
68248 	uint8_t	cmd_size;
68249 	/* Flags and attribs of the command. */
68250 	uint16_t	flags;
68251 	/* Driver supplied handle to associate the command and the response. */
68252 	uint16_t	cookie;
68253 	/* Size of the response buffer in 16-byte units. */
68254 	uint8_t	resp_size;
68255 	uint8_t	reserved8;
68256 	/* Host address of the response. */
68257 	uint64_t	resp_addr;
68258 } cmdq_query_roce_cc_t, *pcmdq_query_roce_cc_t;
68259 
68260 /* creq_query_roce_cc_resp (size:128b/16B) */
68261 
68262 typedef struct creq_query_roce_cc_resp {
68263 	uint8_t	type;
68264 	/*
68265 	 * This field indicates the exact type of the completion.
68266 	 * By convention, the LSB identifies the length of the
68267 	 * record in 16B units. Even values indicate 16B
68268 	 * records. Odd values indicate 32B
68269 	 * records.
68270 	 */
68271 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK	UINT32_C(0x3f)
68272 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT	0
68273 	/* QP Async Notification */
68274 		#define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
68275 		#define CREQ_QUERY_ROCE_CC_RESP_TYPE_LAST	CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT
68276 	/* Status of the response. */
68277 	uint8_t	status;
68278 	/* Driver supplied handle to associate the command and the response. */
68279 	uint16_t	cookie;
68280 	/* Side buffer size in 16-byte units */
68281 	uint32_t	size;
68282 	uint8_t	v;
68283 	/*
68284 	 * This value is written by the NIC such that it will be different
68285 	 * for each pass through the completion queue. The even passes
68286 	 * will write 1. The odd passes will write 0.
68287 	 */
68288 	#define CREQ_QUERY_ROCE_CC_RESP_V	UINT32_C(0x1)
68289 	/* Event or command opcode. */
68290 	uint8_t	event;
68291 	/* Query congestion control response. */
68292 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC UINT32_C(0x8d)
68293 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_LAST	CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC
68294 	uint8_t	reserved48[6];
68295 } creq_query_roce_cc_resp_t, *pcreq_query_roce_cc_resp_t;
68296 
68297 /* Query congestion control command response side buffer structure. */
68298 /* creq_query_roce_cc_resp_sb (size:256b/32B) */
68299 
68300 typedef struct creq_query_roce_cc_resp_sb {
68301 	/* Command opcode. */
68302 	uint8_t	opcode;
68303 	/* Query congestion control response. */
68304 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
68305 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC
68306 	/* Status of the response. */
68307 	uint8_t	status;
68308 	/* Driver supplied handle to associate the command and the response. */
68309 	uint16_t	cookie;
68310 	/* Flags and attribs of the command. */
68311 	uint16_t	flags;
68312 	/* Size of the response buffer in 16-byte units. */
68313 	uint8_t	resp_size;
68314 	uint8_t	reserved8;
68315 	uint8_t	enable_cc;
68316 	/* Enable. */
68317 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC	UINT32_C(0x1)
68318 	/* unused7 is 7 b */
68319 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_MASK  UINT32_C(0xfe)
68320 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_SFT   1
68321 	uint8_t	tos_dscp_tos_ecn;
68322 	/* IP TOS ECN. */
68323 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
68324 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT  0
68325 	/* IP TOS DSCP. */
68326 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
68327 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT 2
68328 	/* Congestion Probability averaging factor. */
68329 	uint8_t	g;
68330 	/* Number of phases in Fast Recovery and Active Increase. */
68331 	uint8_t	num_phases_per_state;
68332 	/* The starting value of rate. */
68333 	uint16_t	init_cr;
68334 	/* The starting value of target rate. */
68335 	uint16_t	init_tr;
68336 	uint8_t	alt_vlan_pcp;
68337 	/* Alternate vlan pcp value for CNP packets. */
68338 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK UINT32_C(0x7)
68339 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT 0
68340 	/* rsvd1 is 5 b */
68341 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK	UINT32_C(0xf8)
68342 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT	3
68343 	uint8_t	alt_tos_dscp;
68344 	/* Alternate IP TOS DSCP. */
68345 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
68346 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT 0
68347 	/* rsvd4 is 2 b */
68348 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK	UINT32_C(0xc0)
68349 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT	6
68350 	uint8_t	cc_mode;
68351 	/* DCTCP CC algorithm. */
68352 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_DCTCP	UINT32_C(0x0)
68353 	/*
68354 	 * Probabilistic marking CC algorithm. On chips with CC Gen 0
68355 	 * support this will be TCP CC algorithm.
68356 	 */
68357 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC UINT32_C(0x1)
68358 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC
68359 	/* Specifies the RoCE Tx Queue to use for sending CNP packets. */
68360 	uint8_t	tx_queue;
68361 	uint16_t	rtt;
68362 	/* Round trip time in units of usecs */
68363 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK  UINT32_C(0x3fff)
68364 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT   0
68365 	/* rsvd5 is 2 b */
68366 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK UINT32_C(0xc000)
68367 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT 14
68368 	uint16_t	tcp_cp;
68369 	/* The value used as CP when cc_mode is 1(TCP) */
68370 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK UINT32_C(0x3ff)
68371 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT 0
68372 	/* rsvd6 is 6 b */
68373 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK UINT32_C(0xfc00)
68374 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT  10
68375 	/* Inactivity time after which QP CC parameters are initialized */
68376 	uint16_t	inactivity_th;
68377 	/* Number of packets per phase. Max is 255. */
68378 	uint8_t	pkts_per_phase;
68379 	/* Amount of time per phase in units of ms. Max is 15 */
68380 	uint8_t	time_per_phase;
68381 	uint32_t	reserved32;
68382 } creq_query_roce_cc_resp_sb_t, *pcreq_query_roce_cc_resp_sb_t;
68383 
68384 /*
68385  * TLV encapsulated Query congestion control command response
68386  * side buffer, with extended TLV record included for specifying
68387  * the extended configuration for CC level 1.
68388  */
68389 /* creq_query_roce_cc_resp_sb_tlv (size:384b/48B) */
68390 
68391 typedef struct creq_query_roce_cc_resp_sb_tlv {
68392 	/*
68393 	 * The command discriminator is used to differentiate between various
68394 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
68395 	 * command messages as well as newer TLV encapsulated HWRM commands.
68396 	 *
68397 	 * For TLV encapsulated messages this field must be 0x8000.
68398 	 */
68399 	uint16_t	cmd_discr;
68400 	uint8_t	reserved_8b;
68401 	uint8_t	tlv_flags;
68402 	/*
68403 	 * Indicates the presence of additional TLV encapsulated data
68404 	 * follows this TLV.
68405 	 */
68406 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
68407 	/* Last TLV in a sequence of TLVs. */
68408 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
68409 	/* More TLVs follow this TLV. */
68410 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
68411 	/*
68412 	 * When an HWRM receiver detects a TLV type that it does not
68413 	 * support with the TLV required flag set, the receiver must
68414 	 * reject the HWRM message with an error code indicating an
68415 	 * unsupported TLV type.
68416 	 */
68417 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
68418 	/* No */
68419 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
68420 	/* Yes */
68421 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
68422 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
68423 	/*
68424 	 * This field defines the TLV type value which is divided into
68425 	 * two ranges to differentiate between global and local TLV types.
68426 	 * Global TLV types must be unique across all defined TLV types.
68427 	 * Local TLV types are valid only for extensions to a given
68428 	 * HWRM message and may be repeated across different HWRM message
68429 	 * types. There is a direct correlation of each HWRM message type
68430 	 * to a single global TLV type value.
68431 	 *
68432 	 * Global TLV range: `0 - (63k-1)`
68433 	 *
68434 	 * Local TLV range: `63k - (64k-1)`
68435 	 */
68436 	uint16_t	tlv_type;
68437 	/*
68438 	 * Length of the message data encapsulated by this TLV in bytes.
68439 	 * This length does not include the size of the TLV header itself
68440 	 * and it must be an integer multiple of 8B.
68441 	 */
68442 	uint16_t	length;
68443 	/*
68444 	 * Size of the tlv encapsulated response,
68445 	 * including all tlvs and extension data in 16-byte units.
68446 	 */
68447 	uint8_t	total_size;
68448 	uint8_t	reserved56[7];
68449 	/* Command opcode. */
68450 	uint8_t	opcode;
68451 	/* Query congestion control response. */
68452 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
68453 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC
68454 	/* Status of the response. */
68455 	uint8_t	status;
68456 	/* Driver supplied handle to associate the command and the response. */
68457 	uint16_t	cookie;
68458 	/* Flags and attribs of the command. */
68459 	uint16_t	flags;
68460 	/* Size of the response buffer in 16-byte units. */
68461 	uint8_t	resp_size;
68462 	uint8_t	reserved8;
68463 	uint8_t	enable_cc;
68464 	/* Enable. */
68465 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ENABLE_CC	UINT32_C(0x1)
68466 	/* unused7 is 7 b */
68467 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_MASK  UINT32_C(0xfe)
68468 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_SFT   1
68469 	uint8_t	tos_dscp_tos_ecn;
68470 	/* IP TOS ECN. */
68471 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_MASK UINT32_C(0x3)
68472 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_SFT  0
68473 	/* IP TOS DSCP. */
68474 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
68475 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_SFT 2
68476 	/* Congestion Probability averaging factor. */
68477 	uint8_t	g;
68478 	/* Number of phases in Fast Recovery and Active Increase. */
68479 	uint8_t	num_phases_per_state;
68480 	/* The starting value of rate. */
68481 	uint16_t	init_cr;
68482 	/* The starting value of target rate. */
68483 	uint16_t	init_tr;
68484 	uint8_t	alt_vlan_pcp;
68485 	/* Alternate vlan pcp value for CNP packets. */
68486 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
68487 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_SFT 0
68488 	/* rsvd1 is 5 b */
68489 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_MASK	UINT32_C(0xf8)
68490 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_SFT	3
68491 	uint8_t	alt_tos_dscp;
68492 	/* Alternate IP TOS DSCP. */
68493 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
68494 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_SFT 0
68495 	/* rsvd4 is 2 b */
68496 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_MASK	UINT32_C(0xc0)
68497 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_SFT	6
68498 	uint8_t	cc_mode;
68499 	/* DCTCP CC algorithm. */
68500 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_DCTCP	UINT32_C(0x0)
68501 	/*
68502 	 * Probabilistic marking CC algorithm. On chips with CC Gen 0
68503 	 * support this will be TCP CC algorithm.
68504 	 */
68505 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC UINT32_C(0x1)
68506 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC
68507 	/* Specifies the RoCE Tx Queue to use for sending CNP packets. */
68508 	uint8_t	tx_queue;
68509 	uint16_t	rtt;
68510 	/* Round trip time in units of usecs */
68511 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_MASK  UINT32_C(0x3fff)
68512 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_SFT   0
68513 	/* rsvd5 is 2 b */
68514 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_MASK UINT32_C(0xc000)
68515 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_SFT 14
68516 	uint16_t	tcp_cp;
68517 	/* The value used as CP when cc_mode is 1(TCP) */
68518 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_MASK UINT32_C(0x3ff)
68519 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_SFT 0
68520 	/* rsvd6 is 6 b */
68521 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_MASK UINT32_C(0xfc00)
68522 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_SFT  10
68523 	/* Inactivity time after which QP CC parameters are initialized */
68524 	uint16_t	inactivity_th;
68525 	/* Number of packets per phase. Max is 255. */
68526 	uint8_t	pkts_per_phase;
68527 	/* Amount of time per phase in units of ms. Max is 15 */
68528 	uint8_t	time_per_phase;
68529 	uint32_t	reserved32;
68530 } creq_query_roce_cc_resp_sb_tlv_t, *pcreq_query_roce_cc_resp_sb_tlv_t;
68531 
68532 /* creq_query_roce_cc_gen1_resp_sb_tlv (size:704b/88B) */
68533 
68534 typedef struct creq_query_roce_cc_gen1_resp_sb_tlv {
68535 	/*
68536 	 * The command discriminator is used to differentiate between various
68537 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
68538 	 * command messages as well as newer TLV encapsulated HWRM commands.
68539 	 *
68540 	 * For TLV encapsulated messages this field must be 0x8000.
68541 	 */
68542 	uint16_t	cmd_discr;
68543 	uint8_t	reserved_8b;
68544 	uint8_t	tlv_flags;
68545 	/*
68546 	 * Indicates the presence of additional TLV encapsulated data
68547 	 * follows this TLV.
68548 	 */
68549 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
68550 	/* Last TLV in a sequence of TLVs. */
68551 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
68552 	/* More TLVs follow this TLV. */
68553 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
68554 	/*
68555 	 * When an HWRM receiver detects a TLV type that it does not
68556 	 * support with the TLV required flag set, the receiver must
68557 	 * reject the HWRM message with an error code indicating an
68558 	 * unsupported TLV type.
68559 	 */
68560 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
68561 	/* No */
68562 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
68563 	/* Yes */
68564 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
68565 		#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
68566 	/*
68567 	 * This field defines the TLV type value which is divided into
68568 	 * two ranges to differentiate between global and local TLV types.
68569 	 * Global TLV types must be unique across all defined TLV types.
68570 	 * Local TLV types are valid only for extensions to a given
68571 	 * HWRM message and may be repeated across different HWRM message
68572 	 * types. There is a direct correlation of each HWRM message type
68573 	 * to a single global TLV type value.
68574 	 *
68575 	 * Global TLV range: `0 - (63k-1)`
68576 	 *
68577 	 * Local TLV range: `63k - (64k-1)`
68578 	 */
68579 	uint16_t	tlv_type;
68580 	/*
68581 	 * Length of the message data encapsulated by this TLV in bytes.
68582 	 * This length does not include the size of the TLV header itself
68583 	 * and it must be an integer multiple of 8B.
68584 	 */
68585 	uint16_t	length;
68586 	uint64_t	reserved64;
68587 	/* High order bits of inactivity threshold. */
68588 	uint16_t	inactivity_th_hi;
68589 	/* The number of uS between generation of CNPs when cc_mode is probabilistic marking. */
68590 	uint16_t	min_time_between_cnps;
68591 	/* The starting value of congestion probability. Input range is 0 - 1023. */
68592 	uint16_t	init_cp;
68593 	/*
68594 	 * In tr_update_mode 0, Target Rate (TR) is updated to
68595 	 * halfway between the Current Rate (CR) before and after reduction.
68596 	 * In tr_update_mode 1, TR is updated to CR's value before reduction.
68597 	 */
68598 	uint8_t	tr_update_mode;
68599 	/*
68600 	 * Determine for how many RTTs with CNPs in a row, TR is being updated.
68601 	 * 0: TR is updated when QPC. rtts_with_cnps == 0
68602 	 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
68603 	 * 7: TR is updated on all reductions.
68604 	 */
68605 	uint8_t	tr_update_cycles;
68606 	/* Number of RTTs in Fast Recovery stage. */
68607 	uint8_t	fr_num_rtts;
68608 	/* Time increment to increase TR in active increase phase. */
68609 	uint8_t	ai_rate_increase;
68610 	/*
68611 	 * Indicates for how many RTTs with CNPs after the first one
68612 	 * to not reduce rate even if CNPs are received.
68613 	 */
68614 	uint16_t	reduction_relax_rtts_th;
68615 	/*
68616 	 * For low rates, additional number of RTTS with CNPs
68617 	 * for which no rate reduction is made.
68618 	 * num_bits: 14
68619 	 */
68620 	uint16_t	additional_relax_cr_th;
68621 	/*
68622 	 * If CR is less than or equal to this value,
68623 	 * then the actual CR average is set to this value
68624 	 * (shifted by bw_avg_weight).
68625 	 */
68626 	uint16_t	cr_min_th;
68627 	/* Log based averaging weight for QPC variable actual_cr_avg. */
68628 	uint8_t	bw_avg_weight;
68629 	/*
68630 	 * Used to compare CR to this factor times QPC.actual_cr_average
68631 	 * as a reduction reference. Values between 0 and 6 represent factor of
68632 	 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
68633 	 */
68634 	uint8_t	actual_cr_factor;
68635 	/* The level of CR above which CP is set to maximum level. */
68636 	uint16_t	max_cp_cr_th;
68637 	/*
68638 	 * Enable adding fraction of CR to CP.
68639 	 * 0 for disable, 1 for enable.
68640 	 */
68641 	uint8_t	cp_bias_en;
68642 	/* Log based fraction of cr to add to CP when cp_bias_en is 1. */
68643 	uint8_t	cp_bias;
68644 	/*
68645 	 * The value of ECN bits in a CNP packet generated by hardware.
68646 	 * ECN-Capable Transport (ECT) codepoints supported include:
68647 	 * 0 for not_ect, 1 for ect_0, 2 for ect_1
68648 	 */
68649 	uint8_t	cnp_ecn;
68650 	/* Not ECN capable Transport */
68651 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
68652 	/* ECN Capable Transport-1 */
68653 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_1   UINT32_C(0x1)
68654 	/* ECN Capable Transport-0 */
68655 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0   UINT32_C(0x2)
68656 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_LAST   CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0
68657 	/* Enables jitter in RTT. */
68658 	uint8_t	rtt_jitter_en;
68659 	/*
68660 	 * Number of bytes per usec, dependent on port speed.
68661 	 * 200 Gbps: 25,000
68662 	 * 100 Gbps: 12,500
68663 	 * 50 Gbps: 6,250
68664 	 * 25 Gbps: 3125
68665 	 * 10 Gbps: 1250
68666 	 */
68667 	uint16_t	link_bytes_per_usec;
68668 	/*
68669 	 * If CR is greater than or equal to this threshold,
68670 	 * QPC's CC state is reset to its initial state.
68671 	 */
68672 	uint16_t	reset_cc_cr_th;
68673 	/*
68674 	 * The number of valid lsbits in CR and TR.
68675 	 * Supported values include 10 through 14 to support 2^cr_width rate.
68676 	 */
68677 	uint8_t	cr_width;
68678 	/* Lower end of random selection of quota_period. */
68679 	uint8_t	quota_period_min;
68680 	/* Upper end of random selection of quota_period. */
68681 	uint8_t	quota_period_max;
68682 	/*
68683 	 * The absolute maximum possible quota_period,
68684 	 * applicable when rate table for lower 24 levels is used.
68685 	 */
68686 	uint8_t	quota_period_abs_max;
68687 	/* TR never goes below this level. */
68688 	uint16_t	tr_lower_bound;
68689 	/* Factor on probability threshold for adding 0.5 to CR randomly. */
68690 	uint8_t	cr_prob_factor;
68691 	/* Factor on probability threshold for adding 0.5 to TR randomly. */
68692 	uint8_t	tr_prob_factor;
68693 	/*
68694 	 * Threshold to ensure fairness between requester and responder.
68695 	 * If CR is less than the fairness threshold and a quota period has passed
68696 	 * priority will be given to the path that did not last transfer data.
68697 	 */
68698 	uint16_t	fairness_cr_th;
68699 	/* Log based rate reduction divider. */
68700 	uint8_t	red_div;
68701 	/* Threshold for rate reductions when CNPS received over last RTT. */
68702 	uint8_t	cnp_ratio_th;
68703 	/*
68704 	 * Extended number of RTTS to wait, when there is no congestion,
68705 	 * to start doubling the rate.
68706 	 */
68707 	uint16_t	exp_ai_rtts;
68708 	/* Log based CR to CP ratio used in exponential increase. */
68709 	uint8_t	exp_ai_cr_cp_ratio;
68710 	/* Enable use of lowest 24 rate levels rate_table. */
68711 	uint8_t	use_rate_table;
68712 	/*
68713 	 * Determines after how many congestion free RTTs to start
68714 	 * updating CP to track CR.
68715 	 */
68716 	uint16_t	cp_exp_update_th;
68717 	/* The threshold on congestion free RTTs above which AI can increase to 16. */
68718 	uint16_t	high_exp_ai_rtts_th1;
68719 	/* The threshold on congestion free RTTs above which AI can increase to 32. */
68720 	uint16_t	high_exp_ai_rtts_th2;
68721 	/*
68722 	 * The number of congestion free RTTs above which
68723 	 * reduction based on actual rate is enabled.
68724 	 */
68725 	uint16_t	actual_cr_cong_free_rtts_th;
68726 	/*
68727 	 * If rtts_with_cong is greater than 7 (severe congestion) and
68728 	 * CR level post reduction is above this threshold,
68729 	 * then TR is capped to 1.5 times CR..
68730 	 */
68731 	uint16_t	severe_cong_cr_th1;
68732 	/*
68733 	 * If rtts_with_cong is greater than 7 (severe congestion) and
68734 	 * CR level post reduction is above this threshold,
68735 	 * then TR is capped to 1.25 times CR..
68736 	 */
68737 	uint16_t	severe_cong_cr_th2;
68738 	/*
68739 	 * The maximum number of 64B that can be transmitted during RTT time,
68740 	 * including all headers and Inter Packet Gap.
68741 	 */
68742 	uint32_t	link64B_per_rtt;
68743 	/*
68744 	 * The number of bytes to subtract from QPC.cc_bucket
68745 	 * when an ack is scheduled.
68746 	 */
68747 	uint8_t	cc_ack_bytes;
68748 	/*
68749 	 * Enables reduction of CR, TR, and CP to init values when
68750 	 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
68751 	 */
68752 	uint8_t	reduce_init_en;
68753 	/*
68754 	 * Minimum threshold value for number of congestion free RTTs before reducing
68755 	 * to init values for CR, TR, and CP when reduce_init_en is enabled.
68756 	 */
68757 	uint16_t	reduce_init_cong_free_rtts_th;
68758 	/* Enables random no reduction of CR. */
68759 	uint8_t	random_no_red_en;
68760 	/* Enables coarse correction to actual CR when actual RTT is longer than nominal. */
68761 	uint8_t	actual_cr_shift_correction_en;
68762 	/* Enables adjustment to refill quota. */
68763 	uint8_t	quota_period_adjust_en;
68764 	uint8_t	reserved[5];
68765 } creq_query_roce_cc_gen1_resp_sb_tlv_t, *pcreq_query_roce_cc_gen1_resp_sb_tlv_t;
68766 
68767 /***********************
68768  * cmdq_modify_roce_cc *
68769  ***********************/
68770 
68771 
68772 /* cmdq_modify_roce_cc (size:448b/56B) */
68773 
68774 typedef struct cmdq_modify_roce_cc {
68775 	/* Command opcode. */
68776 	uint8_t	opcode;
68777 	/* Modify congestion control. Can only be issued from a PF. */
68778 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
68779 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_LAST	CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC
68780 	/* Size of the command in 16-byte units. */
68781 	uint8_t	cmd_size;
68782 	/* Flags and attribs of the command. */
68783 	uint16_t	flags;
68784 	/* Driver supplied handle to associate the command and the response. */
68785 	uint16_t	cookie;
68786 	/* Size of the response buffer in 16-byte units. */
68787 	uint8_t	resp_size;
68788 	uint8_t	reserved8;
68789 	/* Host address of the response. */
68790 	uint64_t	resp_addr;
68791 	/* Modify mask signifies the field that is requesting the change. */
68792 	uint32_t	modify_mask;
68793 	/* Enable change. */
68794 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC		UINT32_C(0x1)
68795 	/* Running average weight change. */
68796 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G			UINT32_C(0x2)
68797 	/* Number of phases in Fast Recovery. */
68798 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE	UINT32_C(0x4)
68799 	/* The starting value of rate change. */
68800 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR		UINT32_C(0x8)
68801 	/* The starting value of target rate change. */
68802 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR		UINT32_C(0x10)
68803 	/* IP TOS ECN change */
68804 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN		UINT32_C(0x20)
68805 	/* IP TOS DSCP change */
68806 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP		UINT32_C(0x40)
68807 	/* Alternate IP TOS ECN change */
68808 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP	UINT32_C(0x80)
68809 	/* Alternate IP TOS DSCP change */
68810 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP	UINT32_C(0x100)
68811 	/* Round trip time in units of usecs */
68812 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT		UINT32_C(0x200)
68813 	/* Congestion Control mode */
68814 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE		UINT32_C(0x400)
68815 	/* The value used as CP when cc_mode is 1(TCP) */
68816 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP		UINT32_C(0x800)
68817 	/* Specifies the RoCE Tx Queue to use for sending CNP packets */
68818 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE		UINT32_C(0x1000)
68819 	/* Inactivity time after which QP CC parameters are initialized */
68820 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP	UINT32_C(0x2000)
68821 	/* Amount of time per phase in units of ms. Max is 15. */
68822 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TIME_PER_PHASE	UINT32_C(0x4000)
68823 	/* Number of packets per phase. Max is 255. */
68824 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_PKTS_PER_PHASE	UINT32_C(0x8000)
68825 	uint8_t	enable_cc;
68826 	/* Enable. */
68827 	#define CMDQ_MODIFY_ROCE_CC_ENABLE_CC	UINT32_C(0x1)
68828 	/* rsvd1 is 7 b */
68829 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK	UINT32_C(0xfe)
68830 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT	1
68831 	/* Congestion Probability averaging factor. */
68832 	uint8_t	g;
68833 	/* Number of phases in Fast Recovery. */
68834 	uint8_t	num_phases_per_state;
68835 	/* Number of packets per phase. Max is 255. */
68836 	uint8_t	pkts_per_phase;
68837 	/*
68838 	 * The starting value of rate.
68839 	 * The max value supported for CC support level 1 is 1024.
68840 	 */
68841 	uint16_t	init_cr;
68842 	/*
68843 	 * The starting value of target rate.
68844 	 * The max value supported for CC support level 1 is 1024.
68845 	 */
68846 	uint16_t	init_tr;
68847 	uint8_t	tos_dscp_tos_ecn;
68848 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
68849 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK UINT32_C(0x3)
68850 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT  0
68851 	/* IP TOS DSCP. */
68852 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK UINT32_C(0xfc)
68853 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT 2
68854 	uint8_t	alt_vlan_pcp;
68855 	/* Alternate vlan pcp value for CNP packets. */
68856 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK UINT32_C(0x7)
68857 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT 0
68858 	/* rsvd3 is 5 b */
68859 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK	UINT32_C(0xf8)
68860 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT	3
68861 	uint16_t	alt_tos_dscp;
68862 	/* Alternate IP TOS DSCP. */
68863 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
68864 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT 0
68865 	/* rsvd4 is 10 b */
68866 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK	UINT32_C(0xffc0)
68867 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT	6
68868 	uint16_t	rtt;
68869 	/*
68870 	 * Round trip time in units of usecs.
68871 	 * The max value supported for CC support level 1 is 2047.
68872 	 */
68873 	#define CMDQ_MODIFY_ROCE_CC_RTT_MASK  UINT32_C(0x3fff)
68874 	#define CMDQ_MODIFY_ROCE_CC_RTT_SFT   0
68875 	/* rsvd5 is 2 b */
68876 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK UINT32_C(0xc000)
68877 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT 14
68878 	uint16_t	tcp_cp;
68879 	/* The value used as CP when cc_mode is 1(TCP) */
68880 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK UINT32_C(0x3ff)
68881 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT 0
68882 	/* rsvd6 is 6 b */
68883 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK UINT32_C(0xfc00)
68884 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT  10
68885 	uint8_t	cc_mode;
68886 	/* DCTCP */
68887 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_DCTCP_CC_MODE	UINT32_C(0x0)
68888 	/*
68889 	 * Probabilistic marking. On chips with CC Gen 0 support this
68890 	 * will be TCP CC algorithm.
68891 	 */
68892 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
68893 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_LAST		CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE
68894 	/*
68895 	 * Specifies the RoCE Tx Queue to use for sending CNP packets.
68896 	 * CC support level 0 support 0 to 3 Tx queues.
68897 	 * CC support level 1 supports 0 to 7 Tx queues.
68898 	 */
68899 	uint8_t	tx_queue;
68900 	/* Inactivity time after which QP CC parameters are initialized */
68901 	uint16_t	inactivity_th;
68902 	/* Amount of time per phase in units of ms. Max is 15 */
68903 	uint8_t	time_per_phase;
68904 	/* reserved8 is 8 b */
68905 	uint8_t	reserved8_1;
68906 	/* reserved16 is 16 b */
68907 	uint16_t	reserved16;
68908 	uint32_t	reserved32;
68909 	uint64_t	reserved64;
68910 } cmdq_modify_roce_cc_t, *pcmdq_modify_roce_cc_t;
68911 
68912 /*
68913  * TLV encapsulated modify CC command, with extended TLV record
68914  * included for specifying the extended configuration for CC level 1.
68915  */
68916 /* cmdq_modify_roce_cc_tlv (size:640b/80B) */
68917 
68918 typedef struct cmdq_modify_roce_cc_tlv {
68919 	/*
68920 	 * The command discriminator is used to differentiate between various
68921 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
68922 	 * command messages as well as newer TLV encapsulated HWRM commands.
68923 	 *
68924 	 * For TLV encapsulated messages this field must be 0x8000.
68925 	 */
68926 	uint16_t	cmd_discr;
68927 	uint8_t	reserved_8b;
68928 	uint8_t	tlv_flags;
68929 	/*
68930 	 * Indicates the presence of additional TLV encapsulated data
68931 	 * follows this TLV.
68932 	 */
68933 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
68934 	/* Last TLV in a sequence of TLVs. */
68935 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
68936 	/* More TLVs follow this TLV. */
68937 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
68938 	/*
68939 	 * When an HWRM receiver detects a TLV type that it does not
68940 	 * support with the TLV required flag set, the receiver must
68941 	 * reject the HWRM message with an error code indicating an
68942 	 * unsupported TLV type.
68943 	 */
68944 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
68945 	/* No */
68946 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
68947 	/* Yes */
68948 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
68949 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES
68950 	/*
68951 	 * This field defines the TLV type value which is divided into
68952 	 * two ranges to differentiate between global and local TLV types.
68953 	 * Global TLV types must be unique across all defined TLV types.
68954 	 * Local TLV types are valid only for extensions to a given
68955 	 * HWRM message and may be repeated across different HWRM message
68956 	 * types. There is a direct correlation of each HWRM message type
68957 	 * to a single global TLV type value.
68958 	 *
68959 	 * Global TLV range: `0 - (63k-1)`
68960 	 *
68961 	 * Local TLV range: `63k - (64k-1)`
68962 	 */
68963 	uint16_t	tlv_type;
68964 	/*
68965 	 * Length of the message data encapsulated by this TLV in bytes.
68966 	 * This length does not include the size of the TLV header itself
68967 	 * and it must be an integer multiple of 8B.
68968 	 */
68969 	uint16_t	length;
68970 	/* Size of the tlv encapsulated command, including all tlvs and extension data in 16-byte units. */
68971 	uint8_t	total_size;
68972 	uint8_t	reserved56[7];
68973 	/* Command opcode. */
68974 	uint8_t	opcode;
68975 	/* Modify congestion control. Can only be issued from a PF. */
68976 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
68977 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_LAST	CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC
68978 	/* Size of the command in 16-byte units. */
68979 	uint8_t	cmd_size;
68980 	/* Flags and attribs of the command. */
68981 	uint16_t	flags;
68982 	/* Driver supplied handle to associate the command and the response. */
68983 	uint16_t	cookie;
68984 	/* Size of the response buffer in 16-byte units. */
68985 	uint8_t	resp_size;
68986 	uint8_t	reserved8;
68987 	/* Host address of the response. */
68988 	uint64_t	resp_addr;
68989 	/* Modify mask signifies the field that is requesting the change. */
68990 	uint32_t	modify_mask;
68991 	/* Enable change. */
68992 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ENABLE_CC		UINT32_C(0x1)
68993 	/* Running average weight change. */
68994 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_G			UINT32_C(0x2)
68995 	/* Number of phases in Fast Recovery. */
68996 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_NUMPHASEPERSTATE	UINT32_C(0x4)
68997 	/* The starting value of rate change. */
68998 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_CR		UINT32_C(0x8)
68999 	/* The starting value of target rate change. */
69000 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_TR		UINT32_C(0x10)
69001 	/* IP TOS ECN change */
69002 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_ECN		UINT32_C(0x20)
69003 	/* IP TOS DSCP change */
69004 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_DSCP		UINT32_C(0x40)
69005 	/* Alternate IP TOS ECN change */
69006 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_VLAN_PCP	UINT32_C(0x80)
69007 	/* Alternate IP TOS DSCP change */
69008 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_TOS_DSCP	UINT32_C(0x100)
69009 	/* Round trip time in units of usecs */
69010 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_RTT		UINT32_C(0x200)
69011 	/* Congestion Control mode */
69012 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_CC_MODE		UINT32_C(0x400)
69013 	/* The value used as CP when cc_mode is 1(TCP) */
69014 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TCP_CP		UINT32_C(0x800)
69015 	/* Specifies the RoCE Tx Queue to use for sending CNP packets */
69016 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TX_QUEUE		UINT32_C(0x1000)
69017 	/* Inactivity time after which QP CC parameters are initialized */
69018 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INACTIVITY_CP	UINT32_C(0x2000)
69019 	/* Amount of time per phase in units of ms. Max is 15. */
69020 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TIME_PER_PHASE	UINT32_C(0x4000)
69021 	/* Number of packets per phase. Max is 255. */
69022 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_PKTS_PER_PHASE	UINT32_C(0x8000)
69023 	uint8_t	enable_cc;
69024 	/* Enable. */
69025 	#define CMDQ_MODIFY_ROCE_CC_TLV_ENABLE_CC	UINT32_C(0x1)
69026 	/* rsvd1 is 7 b */
69027 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_MASK	UINT32_C(0xfe)
69028 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_SFT	1
69029 	/* Congestion Probability averaging factor. */
69030 	uint8_t	g;
69031 	/* Number of phases in Fast Recovery. */
69032 	uint8_t	num_phases_per_state;
69033 	/* Number of packets per phase. Max is 255. */
69034 	uint8_t	pkts_per_phase;
69035 	/*
69036 	 * The starting value of rate.
69037 	 * The max value supported for CC support level 1 is 1024.
69038 	 */
69039 	uint16_t	init_cr;
69040 	/*
69041 	 * The starting value of target rate.
69042 	 * The max value supported for CC support level 1 is 1024.
69043 	 */
69044 	uint16_t	init_tr;
69045 	uint8_t	tos_dscp_tos_ecn;
69046 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
69047 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_MASK UINT32_C(0x3)
69048 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_SFT  0
69049 	/* IP TOS DSCP. */
69050 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
69051 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_SFT 2
69052 	uint8_t	alt_vlan_pcp;
69053 	/* Alternate vlan pcp value for CNP packets. */
69054 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
69055 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_SFT 0
69056 	/* rsvd3 is 5 b */
69057 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_MASK	UINT32_C(0xf8)
69058 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_SFT	3
69059 	uint16_t	alt_tos_dscp;
69060 	/* Alternate IP TOS DSCP. */
69061 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
69062 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_SFT 0
69063 	/* rsvd4 is 10 b */
69064 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_MASK	UINT32_C(0xffc0)
69065 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_SFT	6
69066 	uint16_t	rtt;
69067 	/*
69068 	 * Round trip time in units of usecs.
69069 	 * The max value supported for CC support level 1 is 2047.
69070 	 */
69071 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_MASK  UINT32_C(0x3fff)
69072 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_SFT   0
69073 	/* rsvd5 is 2 b */
69074 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_MASK UINT32_C(0xc000)
69075 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_SFT 14
69076 	uint16_t	tcp_cp;
69077 	/* The value used as CP when cc_mode is 1(TCP) */
69078 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_MASK UINT32_C(0x3ff)
69079 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_SFT 0
69080 	/* rsvd6 is 6 b */
69081 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_MASK UINT32_C(0xfc00)
69082 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_SFT  10
69083 	uint8_t	cc_mode;
69084 	/* DCTCP */
69085 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_DCTCP_CC_MODE	UINT32_C(0x0)
69086 	/*
69087 	 * Probabilistic marking. On chips with CC Gen 0 support this
69088 	 * will be TCP CC algorithm.
69089 	 */
69090 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
69091 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_LAST		CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE
69092 	/*
69093 	 * Specifies the RoCE Tx Queue to use for sending CNP packets.
69094 	 * CC support level 0 support 0 to 3 Tx queues.
69095 	 * CC support level 1 supports 0 to 7 Tx queues.
69096 	 */
69097 	uint8_t	tx_queue;
69098 	/* Inactivity time after which QP CC parameters are initialized */
69099 	uint16_t	inactivity_th;
69100 	/* Amount of time per phase in units of ms. Max is 15 */
69101 	uint8_t	time_per_phase;
69102 	/* reserved8 is 8 b */
69103 	uint8_t	reserved8_1;
69104 	/* reserved16 is 16 b */
69105 	uint16_t	reserved16;
69106 	uint32_t	reserved32;
69107 	uint64_t	reserved64;
69108 	uint64_t	reservedtlvpad;
69109 } cmdq_modify_roce_cc_tlv_t, *pcmdq_modify_roce_cc_tlv_t;
69110 
69111 /* cmdq_modify_roce_cc_gen1_tlv (size:768b/96B) */
69112 
69113 typedef struct cmdq_modify_roce_cc_gen1_tlv {
69114 	/*
69115 	 * The command discriminator is used to differentiate between various
69116 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
69117 	 * command messages as well as newer TLV encapsulated HWRM commands.
69118 	 *
69119 	 * For TLV encapsulated messages this field must be 0x8000.
69120 	 */
69121 	uint16_t	cmd_discr;
69122 	uint8_t	reserved_8b;
69123 	uint8_t	tlv_flags;
69124 	/*
69125 	 * Indicates the presence of additional TLV encapsulated data
69126 	 * follows this TLV.
69127 	 */
69128 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
69129 	/* Last TLV in a sequence of TLVs. */
69130 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
69131 	/* More TLVs follow this TLV. */
69132 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
69133 	/*
69134 	 * When an HWRM receiver detects a TLV type that it does not
69135 	 * support with the TLV required flag set, the receiver must
69136 	 * reject the HWRM message with an error code indicating an
69137 	 * unsupported TLV type.
69138 	 */
69139 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
69140 	/* No */
69141 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
69142 	/* Yes */
69143 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
69144 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES
69145 	/*
69146 	 * This field defines the TLV type value which is divided into
69147 	 * two ranges to differentiate between global and local TLV types.
69148 	 * Global TLV types must be unique across all defined TLV types.
69149 	 * Local TLV types are valid only for extensions to a given
69150 	 * HWRM message and may be repeated across different HWRM message
69151 	 * types. There is a direct correlation of each HWRM message type
69152 	 * to a single global TLV type value.
69153 	 *
69154 	 * Global TLV range: `0 - (63k-1)`
69155 	 *
69156 	 * Local TLV range: `63k - (64k-1)`
69157 	 */
69158 	uint16_t	tlv_type;
69159 	/*
69160 	 * Length of the message data encapsulated by this TLV in bytes.
69161 	 * This length does not include the size of the TLV header itself
69162 	 * and it must be an integer multiple of 8B.
69163 	 */
69164 	uint16_t	length;
69165 	uint64_t	reserved64;
69166 	/* Modify mask signifies the field that is requesting the change. */
69167 	uint64_t	modify_mask;
69168 	/* Update the number of uS between generation of CNPs for probabilistic marking mode. */
69169 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MIN_TIME_BETWEEN_CNPS		UINT32_C(0x1)
69170 	/*
69171 	 * Update starting value of Congestion Probability (CP).
69172 	 * Maximum value supported is 1023.
69173 	 */
69174 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_INIT_CP			UINT32_C(0x2)
69175 	/* Update Target Rate (TR) Update Mode. */
69176 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_MODE			UINT32_C(0x4)
69177 	/* Update number of RTTs with CNPs in a row for TR update. */
69178 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_CYCLES		UINT32_C(0x8)
69179 	/* Update number of RTTs in Fast Recovery stage. */
69180 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FR_NUM_RTTS			UINT32_C(0x10)
69181 	/* Update time increment to increase TR in active increase phase. */
69182 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_AI_RATE_INCREASE		UINT32_C(0x20)
69183 	/*
69184 	 * Update count of RTTs with CNPs, received after
69185 	 * the first one, to wait, before reducing rate.
69186 	 */
69187 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCTION_RELAX_RTTS_TH	UINT32_C(0x40)
69188 	/*
69189 	 * Update additional number of RTTS with CNPs, to wait,
69190 	 * before further rate reduction, for low rates.
69191 	 */
69192 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ADDITIONAL_RELAX_CR_TH		UINT32_C(0x80)
69193 	/* Update threshold for update to Actual Current Rate (CR) */
69194 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_MIN_TH			UINT32_C(0x100)
69195 	/* Update log based averaging weight for QPC variable actual_cr */
69196 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_BW_AVG_WEIGHT			UINT32_C(0x200)
69197 	/* Update factor used in the computation of rate reduction. */
69198 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_FACTOR		UINT32_C(0x400)
69199 	/* Update the level of CR above which CP is set to maximum level. */
69200 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MAX_CP_CR_TH			UINT32_C(0x800)
69201 	/* Enable adding fraction of CR to CP. */
69202 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS_EN			UINT32_C(0x1000)
69203 	/*
69204 	 * Update log based fraction of CR to add to CP
69205 	 * when cp_bias_en is 1.
69206 	 */
69207 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS			UINT32_C(0x2000)
69208 	/* Update ECN bits in a CNP packet generated by hardware. */
69209 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_ECN			UINT32_C(0x4000)
69210 	/* Update enable of jitter in RTT. */
69211 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RTT_JITTER_EN			UINT32_C(0x8000)
69212 	/* Update number of bytes per usec. */
69213 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK_BYTES_PER_USEC		UINT32_C(0x10000)
69214 	/* Update threshold used to reset QPC CC state to its initial state. */
69215 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RESET_CC_CR_TH			UINT32_C(0x20000)
69216 	/* Update number of valid lsbits in CR and TR */
69217 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_WIDTH			UINT32_C(0x40000)
69218 	/* Update lower end of random selection of quota_period. */
69219 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MIN		UINT32_C(0x80000)
69220 	/* Update upper end of random selection of quota_period. */
69221 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MAX		UINT32_C(0x100000)
69222 	/*
69223 	 * Update absolute maximum possible quota_period,
69224 	 * when rate table for lower 24 levels is used.
69225 	 */
69226 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ABS_MAX		UINT32_C(0x200000)
69227 	/* Update lower bound of TR. */
69228 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_LOWER_BOUND			UINT32_C(0x400000)
69229 	/*
69230 	 * Update factor on probability threshold for adding
69231 	 * 0.5 to CR randomly.
69232 	 */
69233 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_PROB_FACTOR			UINT32_C(0x800000)
69234 	/*
69235 	 * Update factor on probability threshold for adding
69236 	 * 0.5 to TR randomly.
69237 	 */
69238 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_PROB_FACTOR			UINT32_C(0x1000000)
69239 	/*
69240 	 * Update threshold that ensures fairness between requester
69241 	 * and responder
69242 	 */
69243 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FAIRNESS_CR_TH			UINT32_C(0x2000000)
69244 	/* Update log based rate reduction divider. */
69245 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RED_DIV			UINT32_C(0x4000000)
69246 	/*
69247 	 * Update threshold for rate reductions when CNPS received
69248 	 * over last RTT.
69249 	 */
69250 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_RATIO_TH			UINT32_C(0x8000000)
69251 	/*
69252 	 * Update extended number of RTTS to wait,
69253 	 * when there is no congestion, to start doubling the rate.
69254 	 */
69255 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_RTTS			UINT32_C(0x10000000)
69256 	/* Update log based CR to CP ratio used in exponential increase. */
69257 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_CR_CP_RATIO		UINT32_C(0x20000000)
69258 	/*
69259 	 * Update threshold, in congestion free RTTs,
69260 	 * that triggers start of CP update to track CR.
69261 	 */
69262 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_EXP_UPDATE_TH		UINT32_C(0x40000000)
69263 	/*
69264 	 * Update threshold on congestion free RTTs above
69265 	 * which AI can increase to 16.
69266 	 */
69267 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH1		UINT32_C(0x80000000)
69268 	/*
69269 	 * Update threshold on congestion free RTTs above
69270 	 * which AI can increase to 32.
69271 	 */
69272 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH2		UINT32_C(0x100000000)L
69273 	/* Update use of lowest 24 rate levels rate_table. */
69274 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_USE_RATE_TABLE			UINT32_C(0x200000000)L
69275 	/*
69276 	 * Update the maximum number of 64B that can be transmitted
69277 	 * during RTT time.
69278 	 */
69279 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK64B_PER_RTT		UINT32_C(0x400000000)L
69280 	/*
69281 	 * Update number of congestion free RTTs above which
69282 	 * reduction based on actual rate is enabled.
69283 	 */
69284 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_CONG_FREE_RTTS_TH	UINT32_C(0x800000000)L
69285 	/*
69286 	 * Update threshold used in severe congestion for
69287 	 * limiting TR to 1.5 times CR.
69288 	 */
69289 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH1		UINT32_C(0x1000000000)L
69290 	/*
69291 	 * Update threshold used in severe congestion for
69292 	 * limiting TR to 1.25 times CR.
69293 	 */
69294 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH2		UINT32_C(0x2000000000)L
69295 	/*
69296 	 * Update number of bytes to subtract from QPC.cc_bucket
69297 	 * when an ack is scheduled.
69298 	 */
69299 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CC_ACK_BYTES			UINT32_C(0x4000000000)L
69300 	/* Update enable of reduction of CR, TR, and CP to init values. */
69301 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_EN			UINT32_C(0x8000000000)L
69302 	/* Update threshold used for reduction of CR, TR, and CP to init values. */
69303 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_CONG_FREE_RTTS_TH	UINT32_C(0x10000000000)L
69304 	/* Update enable of random no reduction of CR. */
69305 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RANDOM_NO_RED_EN		UINT32_C(0x20000000000)L
69306 	/* Update enable of coarse correction to actual CR. */
69307 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_SHIFT_CORRECTION_EN	UINT32_C(0x40000000000)L
69308 	/* Update enable of adjustment to refill quota. */
69309 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ADJUST_EN		UINT32_C(0x80000000000)L
69310 	/* High order bits of inactivity threshold. */
69311 	uint16_t	inactivity_th_hi;
69312 	/* The number of uS between generation of CNPs when cc_mode is probabilistic marking. */
69313 	uint16_t	min_time_between_cnps;
69314 	/* The starting value of congestion probability. Input range is 0 - 1023. */
69315 	uint16_t	init_cp;
69316 	/*
69317 	 * In tr_update_mode 0, Target Rate (TR) is updated to
69318 	 * halfway between the Current Rate (CR) before and after reduction.
69319 	 * In tr_update_mode 1, TR is updated to CR's value before reduction.
69320 	 */
69321 	uint8_t	tr_update_mode;
69322 	/*
69323 	 * Determine for how many RTTs with CNPs in a row, TR is being updated.
69324 	 * 0: TR is updated when QPC. rtts_with_cnps == 0
69325 	 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
69326 	 * 7: TR is updated on all reductions.
69327 	 */
69328 	uint8_t	tr_update_cycles;
69329 	/* Number of RTTs in Fast Recovery stage. */
69330 	uint8_t	fr_num_rtts;
69331 	/* Time increment to increase TR in active increase phase. */
69332 	uint8_t	ai_rate_increase;
69333 	/*
69334 	 * Indicates for how many RTTs with CNPs after the first one
69335 	 * to not reduce rate even if CNPs are received.
69336 	 */
69337 	uint16_t	reduction_relax_rtts_th;
69338 	/*
69339 	 * For low rates, additional number of RTTS with CNPs
69340 	 * for which no rate reduction is made.
69341 	 * num_bits: 14
69342 	 */
69343 	uint16_t	additional_relax_cr_th;
69344 	/*
69345 	 * If CR is less than or equal to this value,
69346 	 * then the actual CR average is set to this value
69347 	 * (shifted by bw_avg_weight).
69348 	 */
69349 	uint16_t	cr_min_th;
69350 	/* Log based averaging weight for QPC variable actual_cr_avg. */
69351 	uint8_t	bw_avg_weight;
69352 	/*
69353 	 * Used to compare CR to this factor times QPC.actual_cr_average
69354 	 * as a reduction reference. Values between 0 and 6 represent factor of
69355 	 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
69356 	 */
69357 	uint8_t	actual_cr_factor;
69358 	/* The level of CR above which CP is set to maximum level. */
69359 	uint16_t	max_cp_cr_th;
69360 	/*
69361 	 * Enable adding fraction of CR to CP.
69362 	 * 0 for disable, 1 for enable.
69363 	 */
69364 	uint8_t	cp_bias_en;
69365 	/* Log based fraction of cr to add to CP when cp_bias_en is 1. */
69366 	uint8_t	cp_bias;
69367 	/*
69368 	 * The value of ECN bits in a CNP packet generated by hardware.
69369 	 * ECN-Capable Transport (ECT) codepoints supported include:
69370 	 * 0 for not_ect, 1 for ect_0, 2 for ect_1
69371 	 */
69372 	uint8_t	cnp_ecn;
69373 	/* Not ECN capable Transport */
69374 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
69375 	/* ECN Capable Transport-1 */
69376 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_1   UINT32_C(0x1)
69377 	/* ECN Capable Transport-0 */
69378 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0   UINT32_C(0x2)
69379 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_LAST   CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0
69380 	/* Enables jitter in RTT. */
69381 	uint8_t	rtt_jitter_en;
69382 	/*
69383 	 * Number of bytes per usec, dependent on port speed.
69384 	 * 200 Gbps: 25,000
69385 	 * 100 Gbps: 12,500
69386 	 * 50 Gbps: 6,250
69387 	 * 25 Gbps: 3125
69388 	 * 10 Gbps: 1250
69389 	 */
69390 	uint16_t	link_bytes_per_usec;
69391 	/*
69392 	 * If CR is greater than or equal to this threshold,
69393 	 * QPC's CC state is reset to its initial state.
69394 	 */
69395 	uint16_t	reset_cc_cr_th;
69396 	/*
69397 	 * The number of valid lsbits in CR and TR.
69398 	 * Supported values include 10 through 14 to support 2^cr_width rate.
69399 	 */
69400 	uint8_t	cr_width;
69401 	/* Lower end of random selection of quota_period. */
69402 	uint8_t	quota_period_min;
69403 	/* Upper end of random selection of quota_period. */
69404 	uint8_t	quota_period_max;
69405 	/*
69406 	 * The absolute maximum possible quota_period,
69407 	 * applicable when rate table for lower 24 levels is used.
69408 	 */
69409 	uint8_t	quota_period_abs_max;
69410 	/* TR never goes below this level. */
69411 	uint16_t	tr_lower_bound;
69412 	/* Factor on probability threshold for adding 0.5 to CR randomly. */
69413 	uint8_t	cr_prob_factor;
69414 	/* Factor on probability threshold for adding 0.5 to TR randomly. */
69415 	uint8_t	tr_prob_factor;
69416 	/*
69417 	 * Threshold to ensure fairness between requester and responder.
69418 	 * If CR is less than the fairness threshold and a quota period has passed
69419 	 * priority will be given to the path that did not last transfer data.
69420 	 */
69421 	uint16_t	fairness_cr_th;
69422 	/* Log based rate reduction divider. */
69423 	uint8_t	red_div;
69424 	/* Threshold for rate reductions when CNPS received over last RTT. */
69425 	uint8_t	cnp_ratio_th;
69426 	/*
69427 	 * Extended number of RTTS to wait, when there is no congestion,
69428 	 * to start doubling the rate.
69429 	 */
69430 	uint16_t	exp_ai_rtts;
69431 	/* Log based CR to CP ratio used in exponential increase. */
69432 	uint8_t	exp_ai_cr_cp_ratio;
69433 	/* Enable use of lowest 24 rate levels rate_table. */
69434 	uint8_t	use_rate_table;
69435 	/*
69436 	 * Determines after how many congestion free RTTs to start
69437 	 * updating CP to track CR.
69438 	 */
69439 	uint16_t	cp_exp_update_th;
69440 	/* The threshold on congestion free RTTs above which AI can increase to 16. */
69441 	uint16_t	high_exp_ai_rtts_th1;
69442 	/* The threshold on congestion free RTTs above which AI can increase to 32. */
69443 	uint16_t	high_exp_ai_rtts_th2;
69444 	/*
69445 	 * The number of congestion free RTTs above which
69446 	 * reduction based on actual rate is enabled.
69447 	 */
69448 	uint16_t	actual_cr_cong_free_rtts_th;
69449 	/*
69450 	 * If rtts_with_cong is greater than 7 (severe congestion) and
69451 	 * CR level post reduction is above this threshold,
69452 	 * then TR is capped to 1.5 times CR..
69453 	 */
69454 	uint16_t	severe_cong_cr_th1;
69455 	/*
69456 	 * If rtts_with_cong is greater than 7 (severe congestion) and
69457 	 * CR level post reduction is above this threshold,
69458 	 * then TR is capped to 1.25 times CR..
69459 	 */
69460 	uint16_t	severe_cong_cr_th2;
69461 	/*
69462 	 * The maximum number of 64B that can be transmitted during RTT time,
69463 	 * including all headers and Inter Packet Gap.
69464 	 */
69465 	uint32_t	link64B_per_rtt;
69466 	/*
69467 	 * The number of bytes to subtract from QPC.cc_bucket
69468 	 * when an ack is scheduled.
69469 	 */
69470 	uint8_t	cc_ack_bytes;
69471 	/*
69472 	 * Enables reduction of CR, TR, and CP to init values when
69473 	 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
69474 	 */
69475 	uint8_t	reduce_init_en;
69476 	/*
69477 	 * Minimum threshold value for number of congestion free RTTs before reducing
69478 	 * to init values for CR, TR, and CP when reduce_init_en is enabled.
69479 	 */
69480 	uint16_t	reduce_init_cong_free_rtts_th;
69481 	/* Enables random no reduction of CR. */
69482 	uint8_t	random_no_red_en;
69483 	/* Enables coarse correction to actual CR when actual RTT is longer than nominal. */
69484 	uint8_t	actual_cr_shift_correction_en;
69485 	/* Enables adjustment to refill quota. */
69486 	uint8_t	quota_period_adjust_en;
69487 	uint8_t	reserved[5];
69488 } cmdq_modify_roce_cc_gen1_tlv_t, *pcmdq_modify_roce_cc_gen1_tlv_t;
69489 
69490 /* creq_modify_roce_cc_resp (size:128b/16B) */
69491 
69492 typedef struct creq_modify_roce_cc_resp {
69493 	uint8_t	type;
69494 	/*
69495 	 * This field indicates the exact type of the completion.
69496 	 * By convention, the LSB identifies the length of the
69497 	 * record in 16B units. Even values indicate 16B
69498 	 * records. Odd values indicate 32B
69499 	 * records.
69500 	 */
69501 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK	UINT32_C(0x3f)
69502 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT	0
69503 	/* QP Async Notification */
69504 		#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
69505 		#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_LAST	CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT
69506 	/* Status of the response. */
69507 	uint8_t	status;
69508 	/* Driver supplied handle to associate the command and the response. */
69509 	uint16_t	cookie;
69510 	uint32_t	reserved32;
69511 	uint8_t	v;
69512 	/*
69513 	 * This value is written by the NIC such that it will be different
69514 	 * for each pass through the completion queue. The even passes
69515 	 * will write 1. The odd passes will write 0.
69516 	 */
69517 	#define CREQ_MODIFY_ROCE_CC_RESP_V	UINT32_C(0x1)
69518 	/* Event or command opcode. */
69519 	uint8_t	event;
69520 	/* Modify congestion control response. */
69521 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC UINT32_C(0x8c)
69522 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_LAST	CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC
69523 	uint8_t	reserved48[6];
69524 } creq_modify_roce_cc_resp_t, *pcreq_modify_roce_cc_resp_t;
69525 
69526 /******************************
69527  * cmdq_set_link_aggr_mode_cc *
69528  ******************************/
69529 
69530 
69531 /* cmdq_set_link_aggr_mode_cc (size:320b/40B) */
69532 
69533 typedef struct cmdq_set_link_aggr_mode_cc {
69534 	/* Command opcode. */
69535 	uint8_t	opcode;
69536 	/* Set LAG mode. */
69537 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE UINT32_C(0x8f)
69538 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_LAST		CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE
69539 	/* Size of the command in 16-byte units. */
69540 	uint8_t	cmd_size;
69541 	/* Flags and attribs of the command. */
69542 	uint16_t	flags;
69543 	/* Driver supplied handle to associate the command and the response. */
69544 	uint16_t	cookie;
69545 	/* Size of the response buffer in 16-byte units. */
69546 	uint8_t	resp_size;
69547 	uint8_t	reserved8;
69548 	/* Host address of the response. */
69549 	uint64_t	resp_addr;
69550 	/* Modify mask signifies the field that is requesting the change. */
69551 	uint32_t	modify_mask;
69552 	/* Enable Link aggregation. */
69553 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_EN		UINT32_C(0x1)
69554 	/* Bitmap of ports that are eligible to transmit RoCE traffic. */
69555 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_ACTIVE_PORT_MAP	UINT32_C(0x2)
69556 	/* Bitmap of ports that are members of the RoCE LAG. */
69557 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_MEMBER_PORT_MAP	UINT32_C(0x4)
69558 	/* Link aggregation mode being used. */
69559 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_MODE	UINT32_C(0x8)
69560 	/* Stat context ID for all the ports. */
69561 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_STAT_CTX_ID	UINT32_C(0x10)
69562 	uint8_t	aggr_enable;
69563 	/* Enable Link aggregation. */
69564 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_ENABLE	UINT32_C(0x1)
69565 	/* rsvd1 is 7 b */
69566 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_MASK	UINT32_C(0xfe)
69567 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_SFT	1
69568 	uint8_t	active_port_map;
69569 	/* Bitmap of ports that are eligible to transmit RoCE traffic. */
69570 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_MASK UINT32_C(0xf)
69571 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_SFT 0
69572 	/* rsvd2 is 4 b */
69573 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_MASK	UINT32_C(0xf0)
69574 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_SFT	4
69575 	/* Bitmap of ports that are members of the RoCE LAG. */
69576 	uint8_t	member_port_map;
69577 	/* Link aggregation mode being used. */
69578 	uint8_t	link_aggr_mode;
69579 	/* active active mode. */
69580 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
69581 	/* active backup mode. */
69582 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
69583 	/* Balance XOR mode. */
69584 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
69585 	/* 802.3AD mode. */
69586 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD	UINT32_C(0x4)
69587 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_LAST	CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD
69588 	/* Stat context IDs for all 4 ports. */
69589 	uint16_t	stat_ctx_id[4];
69590 	uint64_t	rsvd1;
69591 } cmdq_set_link_aggr_mode_cc_t, *pcmdq_set_link_aggr_mode_cc_t;
69592 
69593 /* creq_set_link_aggr_mode_resources_resp (size:128b/16B) */
69594 
69595 typedef struct creq_set_link_aggr_mode_resources_resp {
69596 	uint8_t	type;
69597 	/*
69598 	 * This field indicates the exact type of the completion.
69599 	 * By convention, the LSB identifies the length of the
69600 	 * record in 16B units. Even values indicate 16B
69601 	 * records. Odd values indicate 32B
69602 	 * records.
69603 	 */
69604 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_MASK	UINT32_C(0x3f)
69605 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_SFT	0
69606 	/* QP Async Notification */
69607 		#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
69608 		#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_LAST	CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT
69609 	/* Status of the response. */
69610 	uint8_t	status;
69611 	/* Driver supplied handle to associate the command and the response. */
69612 	uint16_t	cookie;
69613 	uint32_t	reserved32;
69614 	uint8_t	v;
69615 	/*
69616 	 * This value is written by the NIC such that it will be different
69617 	 * for each pass through the completion queue. The even passes
69618 	 * will write 1. The odd passes will write 0.
69619 	 */
69620 	#define CREQ_SET_LINK_AGGR_MODE_RESP_V	UINT32_C(0x1)
69621 	/* Event or command opcode. */
69622 	uint8_t	event;
69623 	/* Set LAG mode. */
69624 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE UINT32_C(0x8f)
69625 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_LAST		CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE
69626 	uint8_t	reserved48[6];
69627 } creq_set_link_aggr_mode_resources_resp_t, *pcreq_set_link_aggr_mode_resources_resp_t;
69628 
69629 /* Send a request from VF to pass a command to the PF. VF HSI is suspended. */
69630 /* cmdq_vf_backchannel_request (size:256b/32B) */
69631 
69632 typedef struct cmdq_vf_backchannel_request {
69633 	/* Command opcode. */
69634 	uint8_t	opcode;
69635 	/* Send a request from VF to pass a command to the PF. VF HSI is suspended until the PF returns the response */
69636 	#define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
69637 	#define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_LAST		CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST
69638 	/* Size of the command in 16-byte units. */
69639 	uint8_t	cmd_size;
69640 	/* Flags and attribs of the command. */
69641 	uint16_t	flags;
69642 	/* Driver supplied handle to associate the command and the response. */
69643 	uint16_t	cookie;
69644 	/* Size of the response buffer in 16-byte units. */
69645 	uint8_t	resp_size;
69646 	uint8_t	reserved8;
69647 	/* Host address of the response. */
69648 	uint64_t	resp_addr;
69649 	/* Address of command request structure in VF space */
69650 	uint64_t	command_addr;
69651 	/* Command request length (up to 4K). An optional address of the extended response buffer should be provided in the request */
69652 	uint16_t	command_length;
69653 	uint8_t	unused_0[6];
69654 } cmdq_vf_backchannel_request_t, *pcmdq_vf_backchannel_request_t;
69655 
69656 /* Read VF memory (primarily to get the backchannel request blob). */
69657 /* cmdq_read_vf_memory (size:256b/32B) */
69658 
69659 typedef struct cmdq_read_vf_memory {
69660 	/* Command opcode. */
69661 	uint8_t	opcode;
69662 	/* Read VF memory (primarily to get the backchannel request blob). Can only be issued from a PF. */
69663 	#define CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY UINT32_C(0x87)
69664 	#define CMDQ_READ_VF_MEMORY_OPCODE_LAST	CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY
69665 	/* Size of the command in 16-byte units. */
69666 	uint8_t	cmd_size;
69667 	/* Flags and attribs of the command. */
69668 	uint16_t	flags;
69669 	/* Driver supplied handle to associate the command and the response. */
69670 	uint16_t	cookie;
69671 	/* Size of the response buffer in 16-byte units. */
69672 	uint8_t	resp_size;
69673 	uint8_t	reserved8;
69674 	/* Host address of the response. */
69675 	uint64_t	resp_addr;
69676 	/* Address of memory in VF space to read */
69677 	uint64_t	addr;
69678 	/* VF id, as provided in 0xC0 VF request notification */
69679 	uint16_t	vf_id;
69680 	/* Length to read, up to 4K */
69681 	uint16_t	length;
69682 	uint32_t	unused_0;
69683 } cmdq_read_vf_memory_t, *pcmdq_read_vf_memory_t;
69684 
69685 /* Write VF memory (primarily to put the backchannel response blob). */
69686 /* cmdq_complete_vf_request (size:320b/40B) */
69687 
69688 typedef struct cmdq_complete_vf_request {
69689 	/* Command opcode. */
69690 	uint8_t	opcode;
69691 	/* Write VF memory (primarily to put the backchannel response blob), and reenable VF HSI (post a CAG completion to it). Can only be issued from a PF. */
69692 	#define CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST UINT32_C(0x88)
69693 	#define CMDQ_COMPLETE_VF_REQUEST_OPCODE_LAST		CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST
69694 	/* Size of the command in 16-byte units. */
69695 	uint8_t	cmd_size;
69696 	/* Flags and attribs of the command. */
69697 	uint16_t	flags;
69698 	/* Driver supplied handle to associate the command and the response. */
69699 	uint16_t	cookie;
69700 	/* Size of the response buffer in 16-byte units. */
69701 	uint8_t	resp_size;
69702 	uint8_t	reserved8;
69703 	/* Host address of the response. */
69704 	uint64_t	resp_addr;
69705 	/* Optional address of extended response in VF space to write. Length is in resp_size in 16 byte units. */
69706 	uint64_t	addr;
69707 	/* Completion misc field to VF CREQ */
69708 	uint32_t	vf_misc;
69709 	/* VF id, as provided in 0xC0 VF request notification */
69710 	uint16_t	vf_id;
69711 	/* Completion cookie for the VF command, goes to VF CREQ */
69712 	uint16_t	vf_cookie;
69713 	/* Completion status for the VF command, goes to VF CREQ */
69714 	uint8_t	vf_status;
69715 	uint8_t	unused_0[3];
69716 	uint32_t	unused_1;
69717 } cmdq_complete_vf_request_t, *pcmdq_complete_vf_request_t;
69718 
69719 /* RoCE function async event notifications. */
69720 /* creq_func_event (size:128b/16B) */
69721 
69722 typedef struct creq_func_event {
69723 	uint8_t	type;
69724 	/*
69725 	 * This field indicates the exact type of the completion.
69726 	 * By convention, the LSB identifies the length of the
69727 	 * record in 16B units. Even values indicate 16B
69728 	 * records. Odd values indicate 32B
69729 	 * records.
69730 	 */
69731 	#define CREQ_FUNC_EVENT_TYPE_MASK	UINT32_C(0x3f)
69732 	#define CREQ_FUNC_EVENT_TYPE_SFT	0
69733 	/* Function Async Notification */
69734 		#define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT  UINT32_C(0x3a)
69735 		#define CREQ_FUNC_EVENT_TYPE_LAST	CREQ_FUNC_EVENT_TYPE_FUNC_EVENT
69736 	uint8_t	reserved56[7];
69737 	uint8_t	v;
69738 	/*
69739 	 * This value is written by the NIC such that it will be different
69740 	 * for each pass through the completion queue. The even passes
69741 	 * will write 1. The odd passes will write 0.
69742 	 */
69743 	#define CREQ_FUNC_EVENT_V	UINT32_C(0x1)
69744 	/*
69745 	 * This value defines what type of async event has occurred
69746 	 * on the function.
69747 	 */
69748 	uint8_t	event;
69749 	/*
69750 	 * Invalid PBL or PCIE UR response occurred
69751 	 * in SQ WQE or IRRQ read access.
69752 	 */
69753 	#define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR	UINT32_C(0x1)
69754 	/*
69755 	 * Invalid PBL or PCIE UR response occurred
69756 	 * during data read access.
69757 	 */
69758 	#define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR	UINT32_C(0x2)
69759 	/*
69760 	 * Invalid PBL or PCIE UR response occurred
69761 	 * in RQ/SRQ WQE or ORRQ read access.
69762 	 */
69763 	#define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR	UINT32_C(0x3)
69764 	/* Invalid PBL occurred during data write access. */
69765 	#define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR	UINT32_C(0x4)
69766 	/* Invalid PBL occurred during CQ write access. */
69767 	#define CREQ_FUNC_EVENT_EVENT_CQ_ERROR	UINT32_C(0x5)
69768 	/*
69769 	 * Invalid PBL or PCIE UR response occurred in TQM
69770 	 * read access.
69771 	 */
69772 	#define CREQ_FUNC_EVENT_EVENT_TQM_ERROR	UINT32_C(0x6)
69773 	/* PCIE UR response occurred in CFC read access. */
69774 	#define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR	UINT32_C(0x7)
69775 	/* PCIE UR response occurred in CFC read access. */
69776 	#define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR	UINT32_C(0x8)
69777 	/* PCIE UR response occurred in CFC read access. */
69778 	#define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR	UINT32_C(0x9)
69779 	/* PCIE UR response occurred in CFC read access. */
69780 	#define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR	UINT32_C(0xa)
69781 	/*
69782 	 * Invalid PBL or
69783 	 * PCIE UR response
69784 	 * occurred on timer read access.
69785 	 */
69786 	#define CREQ_FUNC_EVENT_EVENT_TIM_ERROR	UINT32_C(0xb)
69787 	/* A VF sent a backchannel command request */
69788 	#define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST	UINT32_C(0x80)
69789 	/* Communication resource (QPC, CQ, SRQ, MRW) exhausted, and resource array extension is enabled */
69790 	#define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED UINT32_C(0x81)
69791 	#define CREQ_FUNC_EVENT_EVENT_LAST		CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED
69792 	uint8_t	reserved48[6];
69793 } creq_func_event_t, *pcreq_func_event_t;
69794 
69795 /* RoCE slowpath command completion events. */
69796 /* creq_qp_event (size:128b/16B) */
69797 
69798 typedef struct creq_qp_event {
69799 	uint8_t	type;
69800 	/*
69801 	 * This field indicates the exact type of the completion.
69802 	 * By convention, the LSB identifies the length of the
69803 	 * record in 16B units. Even values indicate 16B
69804 	 * records. Odd values indicate 32B
69805 	 * records.
69806 	 */
69807 	#define CREQ_QP_EVENT_TYPE_MASK	UINT32_C(0x3f)
69808 	#define CREQ_QP_EVENT_TYPE_SFT	0
69809 	/* QP Async Notification */
69810 		#define CREQ_QP_EVENT_TYPE_QP_EVENT  UINT32_C(0x38)
69811 		#define CREQ_QP_EVENT_TYPE_LAST	CREQ_QP_EVENT_TYPE_QP_EVENT
69812 	/* Status of the response. */
69813 	uint8_t	status;
69814 	/* Success. */
69815 	#define CREQ_QP_EVENT_STATUS_SUCCESS	UINT32_C(0x0)
69816 	/* Fail. */
69817 	#define CREQ_QP_EVENT_STATUS_FAIL		UINT32_C(0x1)
69818 	/* Resources. */
69819 	#define CREQ_QP_EVENT_STATUS_RESOURCES	UINT32_C(0x2)
69820 	/* Invalid command. */
69821 	#define CREQ_QP_EVENT_STATUS_INVALID_CMD	UINT32_C(0x3)
69822 	/* Not implemented. */
69823 	#define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED   UINT32_C(0x4)
69824 	/* Invalid parameter. */
69825 	#define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER UINT32_C(0x5)
69826 	/* Hardware operation failed. */
69827 	#define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR	UINT32_C(0x6)
69828 	/* Firmware operation failed due to internal error. */
69829 	#define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR	UINT32_C(0x7)
69830 	#define CREQ_QP_EVENT_STATUS_LAST		CREQ_QP_EVENT_STATUS_INTERNAL_ERROR
69831 	/* Driver supplied handle to associate the command and the response. */
69832 	uint16_t	cookie;
69833 	uint32_t	reserved32;
69834 	uint8_t	v;
69835 	/*
69836 	 * This value is written by the NIC such that it will be different
69837 	 * for each pass through the completion queue. The even passes
69838 	 * will write 1. The odd passes will write 0.
69839 	 */
69840 	#define CREQ_QP_EVENT_V	UINT32_C(0x1)
69841 	/* Event or command opcode. */
69842 	uint8_t	event;
69843 	/* Create QP command response. */
69844 	#define CREQ_QP_EVENT_EVENT_CREATE_QP		UINT32_C(0x1)
69845 	/* Destroy QP command response. */
69846 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP		UINT32_C(0x2)
69847 	/* Modify QP command response. */
69848 	#define CREQ_QP_EVENT_EVENT_MODIFY_QP		UINT32_C(0x3)
69849 	/* Query QP command response. */
69850 	#define CREQ_QP_EVENT_EVENT_QUERY_QP		UINT32_C(0x4)
69851 	/* Create SRQ command response. */
69852 	#define CREQ_QP_EVENT_EVENT_CREATE_SRQ		UINT32_C(0x5)
69853 	/* Destroy SRQ command response. */
69854 	#define CREQ_QP_EVENT_EVENT_DESTROY_SRQ	UINT32_C(0x6)
69855 	/* Query SRQ command response. */
69856 	#define CREQ_QP_EVENT_EVENT_QUERY_SRQ		UINT32_C(0x8)
69857 	/* Create CQ command response. */
69858 	#define CREQ_QP_EVENT_EVENT_CREATE_CQ		UINT32_C(0x9)
69859 	/* Destroy CQ command response. */
69860 	#define CREQ_QP_EVENT_EVENT_DESTROY_CQ		UINT32_C(0xa)
69861 	/* Resize CQ command response. */
69862 	#define CREQ_QP_EVENT_EVENT_RESIZE_CQ		UINT32_C(0xc)
69863 	/* Allocate MRW command response. */
69864 	#define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW	UINT32_C(0xd)
69865 	/* De-allocate key command response. */
69866 	#define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY	UINT32_C(0xe)
69867 	/* Register MR command response. */
69868 	#define CREQ_QP_EVENT_EVENT_REGISTER_MR	UINT32_C(0xf)
69869 	/* Deregister MR command response. */
69870 	#define CREQ_QP_EVENT_EVENT_DEREGISTER_MR	UINT32_C(0x10)
69871 	/* Add GID command response. */
69872 	#define CREQ_QP_EVENT_EVENT_ADD_GID		UINT32_C(0x11)
69873 	/* Delete GID command response. */
69874 	#define CREQ_QP_EVENT_EVENT_DELETE_GID		UINT32_C(0x12)
69875 	/* Modify GID command response. */
69876 	#define CREQ_QP_EVENT_EVENT_MODIFY_GID		UINT32_C(0x17)
69877 	/* Query GID command response. */
69878 	#define CREQ_QP_EVENT_EVENT_QUERY_GID		UINT32_C(0x18)
69879 	/* Create QP1 command response. */
69880 	#define CREQ_QP_EVENT_EVENT_CREATE_QP1		UINT32_C(0x13)
69881 	/* Destroy QP1 command response. */
69882 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP1	UINT32_C(0x14)
69883 	/* Create AH command response. */
69884 	#define CREQ_QP_EVENT_EVENT_CREATE_AH		UINT32_C(0x15)
69885 	/* Destroy AH command response. */
69886 	#define CREQ_QP_EVENT_EVENT_DESTROY_AH		UINT32_C(0x16)
69887 	/* Initialize firmware command response. */
69888 	#define CREQ_QP_EVENT_EVENT_INITIALIZE_FW	UINT32_C(0x80)
69889 	/* De-initialize firmware command response. */
69890 	#define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW	UINT32_C(0x81)
69891 	/* Stop PF command response. */
69892 	#define CREQ_QP_EVENT_EVENT_STOP_FUNC		UINT32_C(0x82)
69893 	/* Query info PF command response. */
69894 	#define CREQ_QP_EVENT_EVENT_QUERY_FUNC		UINT32_C(0x83)
69895 	/* Set function resources command response. */
69896 	#define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES	UINT32_C(0x84)
69897 	/* Read the current state of any internal resource context. Can only be issued from a PF. */
69898 	#define CREQ_QP_EVENT_EVENT_READ_CONTEXT	UINT32_C(0x85)
69899 	/* Map TC to COS response. */
69900 	#define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS	UINT32_C(0x8a)
69901 	/* Query firmware and interface version response. */
69902 	#define CREQ_QP_EVENT_EVENT_QUERY_VERSION	UINT32_C(0x8b)
69903 	/* Modify congestion control response. */
69904 	#define CREQ_QP_EVENT_EVENT_MODIFY_CC		UINT32_C(0x8c)
69905 	/* Query congestion control response. */
69906 	#define CREQ_QP_EVENT_EVENT_QUERY_CC		UINT32_C(0x8d)
69907 	/* Query RoCE statistics. */
69908 	#define CREQ_QP_EVENT_EVENT_QUERY_ROCE_STATS	UINT32_C(0x8e)
69909 	/* Set LAG mode. */
69910 	#define CREQ_QP_EVENT_EVENT_SET_LINK_AGGR_MODE	UINT32_C(0x8f)
69911 	/*
69912 	 * Query QP for a PF other than the requesting PF. Also can query for more
69913 	 * than one QP.
69914 	 */
69915 	#define CREQ_QP_EVENT_EVENT_QUERY_QP_EXTEND	UINT32_C(0x91)
69916 	/* QP error notification event. */
69917 	#define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
69918 	/* CQ error notification event. */
69919 	#define CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
69920 	#define CREQ_QP_EVENT_EVENT_LAST		CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION
69921 	uint8_t	reserved48[6];
69922 } creq_qp_event_t, *pcreq_qp_event_t;
69923 
69924 /* QP error notification event. */
69925 /* creq_qp_error_notification (size:128b/16B) */
69926 
69927 typedef struct creq_qp_error_notification {
69928 	uint8_t	type;
69929 	/*
69930 	 * This field indicates the exact type of the completion.
69931 	 * By convention, the LSB identifies the length of the
69932 	 * record in 16B units. Even values indicate 16B
69933 	 * records. Odd values indicate 32B
69934 	 * records.
69935 	 */
69936 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK	UINT32_C(0x3f)
69937 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT	0
69938 	/* QP Async Notification */
69939 		#define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT  UINT32_C(0x38)
69940 		#define CREQ_QP_ERROR_NOTIFICATION_TYPE_LAST	CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT
69941 	/* Status of the response. */
69942 	uint8_t	status;
69943 	/* requestor slow path state */
69944 	uint8_t	req_slow_path_state;
69945 	/* requestor error reason */
69946 	uint8_t	req_err_state_reason;
69947 	/* QP context id */
69948 	uint32_t	xid;
69949 	uint8_t	v;
69950 	/*
69951 	 * This value is written by the NIC such that it will be different
69952 	 * for each pass through the completion queue. The even passes
69953 	 * will write 1. The odd passes will write 0.
69954 	 */
69955 	#define CREQ_QP_ERROR_NOTIFICATION_V	UINT32_C(0x1)
69956 	/* Event or command opcode. */
69957 	uint8_t	event;
69958 	/* QP error notification event. */
69959 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
69960 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_LAST		CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION
69961 	/* responder slow path state */
69962 	uint8_t	res_slow_path_state;
69963 	uint8_t	res_err_state_reason;
69964 	/*
69965 	 * Final SQ Consumer Index value. Any additional SQ WQEs will
69966 	 * have to be completed by the user provider.
69967 	 */
69968 	uint16_t	sq_cons_idx;
69969 	/*
69970 	 * Final RQ Consumer Index value. Any additional RQ WQEs will
69971 	 * have to be completed by the user provider.
69972 	 */
69973 	uint16_t	rq_cons_idx;
69974 } creq_qp_error_notification_t, *pcreq_qp_error_notification_t;
69975 
69976 /* CQ error notification event. */
69977 /* creq_cq_error_notification (size:128b/16B) */
69978 
69979 typedef struct creq_cq_error_notification {
69980 	uint8_t	type;
69981 	/*
69982 	 * This field indicates the exact type of the completion.
69983 	 * By convention, the LSB identifies the length of the
69984 	 * record in 16B units. Even values indicate 16B
69985 	 * records. Odd values indicate 32B
69986 	 * records.
69987 	 */
69988 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_MASK	UINT32_C(0x3f)
69989 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_SFT	0
69990 	/* CQ Async Notification */
69991 		#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT  UINT32_C(0x38)
69992 		#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_LAST	CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT
69993 	/* Status of the response. */
69994 	uint8_t	status;
69995 	/* CQ error reason code. */
69996 	uint8_t	cq_err_reason;
69997 	/* Requester completion error for invalid CQ state. */
69998 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_INVALID_ERROR  UINT32_C(0x1)
69999 	/* Requester completion error for CQ overflow. */
70000 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_OVERFLOW_ERROR UINT32_C(0x2)
70001 	/* Attempt to load CQ context resulted in error. */
70002 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_LOAD_ERROR	UINT32_C(0x3)
70003 	/* Responder completion error for invalid CQ state. */
70004 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_INVALID_ERROR  UINT32_C(0x4)
70005 	/* Responder completion error for CQ overflow. */
70006 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR UINT32_C(0x5)
70007 	/* Attempt to load CQ context resulted in error. */
70008 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR	UINT32_C(0x6)
70009 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_LAST		CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR
70010 	uint8_t	reserved8;
70011 	/* CQ context id */
70012 	uint32_t	xid;
70013 	uint8_t	v;
70014 	/*
70015 	 * This value is written by the NIC such that it will be different
70016 	 * for each pass through the completion queue. The even passes
70017 	 * will write 1. The odd passes will write 0.
70018 	 */
70019 	#define CREQ_CQ_ERROR_NOTIFICATION_V	UINT32_C(0x1)
70020 	/* Event or command opcode. */
70021 	uint8_t	event;
70022 	/* CQ error notification event. */
70023 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
70024 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_LAST		CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION
70025 	uint8_t	reserved48[6];
70026 } creq_cq_error_notification_t, *pcreq_cq_error_notification_t;
70027 
70028 /* sq_base (size:64b/8B) */
70029 
70030 typedef struct sq_base {
70031 	/* This field defines the type of SQ WQE. */
70032 	uint8_t	wqe_type;
70033 	/* Send */
70034 	#define SQ_BASE_WQE_TYPE_SEND	UINT32_C(0x0)
70035 	/*
70036 	 * Send with Immediate
70037 	 *
70038 	 * Allowed only on reliable connection (RC) and
70039 	 * unreliable datagram (UD) SQs.
70040 	 */
70041 	#define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD  UINT32_C(0x1)
70042 	/*
70043 	 * Send with Invalidate.
70044 	 *
70045 	 * Allowed only on reliable connection (RC) SQs.
70046 	 */
70047 	#define SQ_BASE_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
70048 	/*
70049 	 * RDMA Write.
70050 	 *
70051 	 * Allowed only on reliable connection (RC) SQs.
70052 	 */
70053 	#define SQ_BASE_WQE_TYPE_WRITE_WQE	UINT32_C(0x4)
70054 	/*
70055 	 * RDMA Write with Immediate.
70056 	 *
70057 	 * Allowed only on reliable connection (RC) SQs.
70058 	 */
70059 	#define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
70060 	/*
70061 	 * RDMA Read.
70062 	 *
70063 	 * Allowed only on reliable connection (RC) SQs.
70064 	 */
70065 	#define SQ_BASE_WQE_TYPE_READ_WQE	UINT32_C(0x6)
70066 	/*
70067 	 * Atomic Compare/Swap.
70068 	 *
70069 	 * Allowed only on reliable connection (RC) SQs.
70070 	 */
70071 	#define SQ_BASE_WQE_TYPE_ATOMIC_CS	UINT32_C(0x8)
70072 	/*
70073 	 * Atomic Fetch/Add.
70074 	 *
70075 	 * Allowed only on reliable connection (RC) SQs.
70076 	 */
70077 	#define SQ_BASE_WQE_TYPE_ATOMIC_FA	UINT32_C(0xb)
70078 	/*
70079 	 * Local Invalidate.
70080 	 *
70081 	 * Allowed only on reliable connection (RC) SQs.
70082 	 */
70083 	#define SQ_BASE_WQE_TYPE_LOCAL_INVALID  UINT32_C(0xc)
70084 	/*
70085 	 * FR-PMR (Fast Register Physical Memory Region)
70086 	 *
70087 	 * Allowed only on reliable connection (RC) SQs.
70088 	 */
70089 	#define SQ_BASE_WQE_TYPE_FR_PMR	UINT32_C(0xd)
70090 	/*
70091 	 * Memory Bind
70092 	 *
70093 	 * Allowed only on reliable connection (RC) SQs.
70094 	 */
70095 	#define SQ_BASE_WQE_TYPE_BIND	UINT32_C(0xe)
70096 	/*
70097 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
70098 	 *
70099 	 * Allowed only on reliable connection (RC) SQs.
70100 	 */
70101 	#define SQ_BASE_WQE_TYPE_FR_PPMR	UINT32_C(0xf)
70102 	#define SQ_BASE_WQE_TYPE_LAST	SQ_BASE_WQE_TYPE_FR_PPMR
70103 	uint8_t	unused_0[7];
70104 } sq_base_t, *psq_base_t;
70105 
70106 /* sq_sge (size:128b/16B) */
70107 
70108 typedef struct sq_sge {
70109 	/*
70110 	 * The virtual address in local memory or a physical address
70111 	 * when l_key value is a reserved value of a physical address.
70112 	 * Driver configures this value in the chip and the chip compares
70113 	 * l_key in SGEs with that reserved value, if equal it access
70114 	 * the physical address specified. The chip however MUST verify
70115 	 * that the QP allows the use reserved key.
70116 	 */
70117 	uint64_t	va_or_pa;
70118 	/*
70119 	 * Local Key associated with this registered MR; The 24 msb of
70120 	 * the key used to index the MRW Table and the 8 lsb are compared
70121 	 * with the 8 bits key part stored in the MRWC. The PBL in the
70122 	 * MRW Context is used to translate the above VA to physical
70123 	 * address.
70124 	 */
70125 	uint32_t	l_key;
70126 	/*
70127 	 * Size of SGE in bytes; Based on page size of the system the
70128 	 * chip knows how many entries are in the PBL
70129 	 */
70130 	uint32_t	size;
70131 } sq_sge_t, *psq_sge_t;
70132 
70133 /* sq_psn_search (size:64b/8B) */
70134 
70135 typedef struct sq_psn_search {
70136 	/* Start PSN. */
70137 	uint32_t	opcode_start_psn;
70138 	/* Start PSN. */
70139 	#define SQ_PSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff)
70140 	#define SQ_PSN_SEARCH_START_PSN_SFT 0
70141 	/* The opcodes are software defined. */
70142 	#define SQ_PSN_SEARCH_OPCODE_MASK   UINT32_C(0xff000000)
70143 	#define SQ_PSN_SEARCH_OPCODE_SFT	24
70144 	uint32_t	flags_next_psn;
70145 	/* Next PSN. Equal to the start PSN of the next WQE. */
70146 	#define SQ_PSN_SEARCH_NEXT_PSN_MASK UINT32_C(0xffffff)
70147 	#define SQ_PSN_SEARCH_NEXT_PSN_SFT 0
70148 	/* Opcode specific flags. */
70149 	#define SQ_PSN_SEARCH_FLAGS_MASK   UINT32_C(0xff000000)
70150 	#define SQ_PSN_SEARCH_FLAGS_SFT	24
70151 } sq_psn_search_t, *psq_psn_search_t;
70152 
70153 /* This PSN table structure is used only on devices where variable size WQEs are supported. */
70154 /* sq_psn_search_ext (size:128b/16B) */
70155 
70156 typedef struct sq_psn_search_ext {
70157 	/* Start PSN. */
70158 	uint32_t	opcode_start_psn;
70159 	/* Start PSN. */
70160 	#define SQ_PSN_SEARCH_EXT_START_PSN_MASK UINT32_C(0xffffff)
70161 	#define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0
70162 	/* The opcodes are software defined. */
70163 	#define SQ_PSN_SEARCH_EXT_OPCODE_MASK   UINT32_C(0xff000000)
70164 	#define SQ_PSN_SEARCH_EXT_OPCODE_SFT	24
70165 	uint32_t	flags_next_psn;
70166 	/* Next PSN. Equal to the start PSN of the next WQE. */
70167 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK UINT32_C(0xffffff)
70168 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0
70169 	/* Opcode specific flags. */
70170 	#define SQ_PSN_SEARCH_EXT_FLAGS_MASK   UINT32_C(0xff000000)
70171 	#define SQ_PSN_SEARCH_EXT_FLAGS_SFT	24
70172 	/*
70173 	 * This field is used only when variable sized WQEs are being used.
70174 	 * This indicates the starting slot index of the corresponding WQE.
70175 	 */
70176 	uint16_t	start_slot_idx;
70177 	/* reserved16 is 16 b */
70178 	uint16_t	reserved16;
70179 	/* reserved32 is 32 b */
70180 	uint32_t	reserved32;
70181 } sq_psn_search_ext_t, *psq_psn_search_ext_t;
70182 
70183 /* This MSN table structure is used only on devices where Hardware based Requester retransmission is used. */
70184 /* sq_msn_search (size:64b/8B) */
70185 
70186 typedef struct sq_msn_search {
70187 	/* MSN search entry. */
70188 	uint64_t	start_idx_next_psn_start_psn;
70189 	/* Start PSN. */
70190 	#define SQ_MSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff)
70191 	#define SQ_MSN_SEARCH_START_PSN_SFT 0
70192 	/* Next PSN. Equal to the start PSN of the next WQE. */
70193 	#define SQ_MSN_SEARCH_NEXT_PSN_MASK 0xffffff000000ULL
70194 	#define SQ_MSN_SEARCH_NEXT_PSN_SFT  24
70195 	/*
70196 	 * For variable-size WQEs, this field indicates the starting
70197 	 * slot index that corresponds to the WQE.
70198 	 * In backward-compatible mode, this is the starting WQE index.
70199 	 */
70200 	#define SQ_MSN_SEARCH_START_IDX_MASK 0xffff000000000000ULL
70201 	#define SQ_MSN_SEARCH_START_IDX_SFT 48
70202 } sq_msn_search_t, *psq_msn_search_t;
70203 
70204 /* Send SQ WQE */
70205 /* sq_send (size:1024b/128B) */
70206 
70207 typedef struct sq_send {
70208 	/* This field defines the type of SQ WQE. */
70209 	uint8_t	wqe_type;
70210 	/* Send */
70211 	#define SQ_SEND_WQE_TYPE_SEND	UINT32_C(0x0)
70212 	/*
70213 	 * Send with Immediate
70214 	 *
70215 	 * Allowed only on reliable connection (RC) and
70216 	 * unreliable datagram (UD) SQs.
70217 	 */
70218 	#define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD  UINT32_C(0x1)
70219 	/*
70220 	 * Send with Invalidate.
70221 	 *
70222 	 * Allowed only on reliable connection (RC) SQs.
70223 	 */
70224 	#define SQ_SEND_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
70225 	#define SQ_SEND_WQE_TYPE_LAST	SQ_SEND_WQE_TYPE_SEND_W_INVALID
70226 	uint8_t	flags;
70227 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70228 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70229 	/*
70230 	 * Set if completion signaling is requested. If this bit is
70231 	 * 0, and the SQ is configured to support Unsignaled completion
70232 	 * the controller should not generate a CQE unless there was
70233 	 * an error. This refers to the CQE on the sender side. (The se
70234 	 * flag refers to the receiver side).
70235 	 */
70236 	#define SQ_SEND_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
70237 	/*
70238 	 * Indication to complete all previous RDMA Read or Atomic WQEs
70239 	 * on the SQ before executing this WQE.
70240 	 *
70241 	 * This flag must be zero for a UD send.
70242 	 */
70243 	#define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
70244 	/*
70245 	 * For local invalidate request. Indication to complete all
70246 	 * previous SQ's WQEs before executing this WQE.
70247 	 *
70248 	 * This flag must be zero for a UD send.
70249 	 */
70250 	#define SQ_SEND_FLAGS_UC_FENCE								UINT32_C(0x4)
70251 	/*
70252 	 * Solicit event flag. Indication sent in BTH header to the
70253 	 * receiver to generate a Completion Event Notification, i.e.
70254 	 * CNQE. This bit should be set only in the last (or only) packet
70255 	 * of the message.
70256 	 */
70257 	#define SQ_SEND_FLAGS_SE									UINT32_C(0x8)
70258 	/*
70259 	 * Indicate that inline data is posted to the SQ in the data
70260 	 * area of this WQE.
70261 	 */
70262 	#define SQ_SEND_FLAGS_INLINE								UINT32_C(0x10)
70263 	/*
70264 	 * If set to 1, then the timestamp from the WQE is used. If
70265 	 * cleared to 0, then TWE provides the timestamp.
70266 	 */
70267 	#define SQ_SEND_FLAGS_WQE_TS_EN								UINT32_C(0x20)
70268 	/*
70269 	 * When set to '1', this operation will cause a trace capture in
70270 	 * each block it passes through.
70271 	 */
70272 	#define SQ_SEND_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
70273 	/*
70274 	 * The number of 16 bytes chunks of data including this first
70275 	 * word of the request that are a valid part of the request. The
70276 	 * valid 16 bytes units other than the WQE structure can be
70277 	 * SGEs (Scatter Gather Elements) OR inline data.
70278 	 *
70279 	 * While this field defines the valid WQE size.  The actual
70280 	 * total WQE size is always 128B.
70281 	 */
70282 	uint8_t	wqe_size;
70283 	uint8_t	reserved8_1;
70284 	/*
70285 	 * Either invalidate key (R_Key of the remote host) that will
70286 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
70287 	 * with Invalidate, or immediate value that will be sent with
70288 	 * ImmDt header if wqe_type is Send with Immediate.
70289 	 */
70290 	uint32_t	inv_key_or_imm_data;
70291 	/* This field represents a 32-bit total data length, in bytes. */
70292 	uint32_t	length;
70293 	/*
70294 	 * When in the SQ of a UD QP, indicates the q_key to be used in
70295 	 * the transmitted packet.  However, if the most significant bit
70296 	 * of this field is set, then the q_key will be taken from QP
70297 	 * context, rather than from this field.
70298 	 *
70299 	 * When in the SQ of a non-UD QP, this field is reserved and
70300 	 * should be filled with zeros.
70301 	 */
70302 	uint32_t	q_key;
70303 	/*
70304 	 * When in the SQ of a UD QP, indicates the destination QP to be
70305 	 * used in the transmitted packet.
70306 	 *
70307 	 * When in the SQ of a non-UD QP, this field is reserved and
70308 	 * should be filled with zeros.
70309 	 */
70310 	uint32_t	dst_qp;
70311 	#define SQ_SEND_DST_QP_MASK UINT32_C(0xffffff)
70312 	#define SQ_SEND_DST_QP_SFT 0
70313 	uint32_t	avid;
70314 	/*
70315 	 * If the serv_type is 'UD', then this field supplies the AVID
70316 	 * (Address Vector ID).
70317 	 */
70318 	#define SQ_SEND_AVID_MASK UINT32_C(0xfffff)
70319 	#define SQ_SEND_AVID_SFT 0
70320 	uint32_t	reserved32;
70321 	uint32_t	timestamp;
70322 	/*
70323 	 * This field specifies a 24-bit timestamp that can be passed
70324 	 * down the TX path and optionally logged in the TXP timestamp
70325 	 * histogram.
70326 	 */
70327 	#define SQ_SEND_TIMESTAMP_MASK UINT32_C(0xffffff)
70328 	#define SQ_SEND_TIMESTAMP_SFT 0
70329 	/*
70330 	 * When inline=0, then this area is filled with from 1 to 6
70331 	 * SGEs based on the wqe_size field.
70332 	 *
70333 	 * When inline=1, this area is filled with payload data for the
70334 	 * send based on the length_or_AVID field.  Bits [7:0] of word 0
70335 	 * hold the first byte to go out on the wire.
70336 	 */
70337 	uint32_t	data[24];
70338 } sq_send_t, *psq_send_t;
70339 
70340 /* Send SQ WQE header. */
70341 /* sq_send_hdr (size:256b/32B) */
70342 
70343 typedef struct sq_send_hdr {
70344 	/* This field defines the type of SQ WQE. */
70345 	uint8_t	wqe_type;
70346 	/* Send */
70347 	#define SQ_SEND_HDR_WQE_TYPE_SEND	UINT32_C(0x0)
70348 	/*
70349 	 * Send with Immediate
70350 	 *
70351 	 * Allowed only on reliable connection (RC) and
70352 	 * unreliable datagram (UD) SQs.
70353 	 */
70354 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_IMMEAD  UINT32_C(0x1)
70355 	/*
70356 	 * Send with Invalidate.
70357 	 *
70358 	 * Allowed only on reliable connection (RC) SQs.
70359 	 */
70360 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
70361 	#define SQ_SEND_HDR_WQE_TYPE_LAST	SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID
70362 	uint8_t	flags;
70363 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70364 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70365 	/*
70366 	 * Set if completion signaling is requested. If this bit is
70367 	 * 0, and the SQ is configured to support Unsignaled completion
70368 	 * the controller should not generate a CQE unless there was
70369 	 * an error. This refers to the CQE on the sender side. (The se
70370 	 * flag refers to the receiver side).
70371 	 */
70372 	#define SQ_SEND_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
70373 	/*
70374 	 * Indication to complete all previous RDMA Read or Atomic WQEs
70375 	 * on the SQ before executing this WQE.
70376 	 *
70377 	 * This flag must be zero for a UD send.
70378 	 */
70379 	#define SQ_SEND_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
70380 	/*
70381 	 * For local invalidate request. Indication to complete all
70382 	 * previous SQ's WQEs before executing this WQE.
70383 	 *
70384 	 * This flag must be zero for a UD send.
70385 	 */
70386 	#define SQ_SEND_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
70387 	/*
70388 	 * Solicit event flag. Indication sent in BTH header to the
70389 	 * receiver to generate a Completion Event Notification, i.e.
70390 	 * CNQE. This bit should be set only in the last (or only) packet
70391 	 * of the message.
70392 	 */
70393 	#define SQ_SEND_HDR_FLAGS_SE									UINT32_C(0x8)
70394 	/*
70395 	 * Indicate that inline data is posted to the SQ in the data
70396 	 * area of this WQE.
70397 	 */
70398 	#define SQ_SEND_HDR_FLAGS_INLINE								UINT32_C(0x10)
70399 	/*
70400 	 * If set to 1, then the timestamp from the WQE is used. If
70401 	 * cleared to 0, then TWE provides the timestamp.
70402 	 */
70403 	#define SQ_SEND_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
70404 	/*
70405 	 * When set to '1', this operation will cause a trace capture in
70406 	 * each block it passes through.
70407 	 */
70408 	#define SQ_SEND_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
70409 	/*
70410 	 * The number of 16 bytes chunks of data including this first
70411 	 * word of the request that are a valid part of the request. The
70412 	 * valid 16 bytes units other than the WQE structure can be
70413 	 * SGEs (Scatter Gather Elements) OR inline data.
70414 	 *
70415 	 * While this field defines the valid WQE size.  The actual
70416 	 * total WQE size is always 128B.
70417 	 */
70418 	uint8_t	wqe_size;
70419 	uint8_t	reserved8_1;
70420 	/*
70421 	 * Either invalidate key (R_Key of the remote host) that will
70422 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
70423 	 * with Invalidate, or immediate value that will be sent with
70424 	 * ImmDt header if wqe_type is Send with Immediate.
70425 	 */
70426 	uint32_t	inv_key_or_imm_data;
70427 	/* This field represents a 32-bit total data length, in bytes. */
70428 	uint32_t	length;
70429 	/*
70430 	 * When in the SQ of a UD QP, indicates the q_key to be used in
70431 	 * the transmitted packet.  However, if the most significant bit
70432 	 * of this field is set, then the q_key will be taken from QP
70433 	 * context, rather than from this field.
70434 	 *
70435 	 * When in the SQ of a non-UD QP, this field is reserved and
70436 	 * should be filled with zeros.
70437 	 */
70438 	uint32_t	q_key;
70439 	/*
70440 	 * When in the SQ of a UD QP, indicates the destination QP to be
70441 	 * used in the transmitted packet.
70442 	 *
70443 	 * When in the SQ of a non-UD QP, this field is reserved and
70444 	 * should be filled with zeros.
70445 	 */
70446 	uint32_t	dst_qp;
70447 	#define SQ_SEND_HDR_DST_QP_MASK UINT32_C(0xffffff)
70448 	#define SQ_SEND_HDR_DST_QP_SFT 0
70449 	uint32_t	avid;
70450 	/*
70451 	 * If the serv_type is 'UD', then this field supplies the AVID
70452 	 * (Address Vector ID).
70453 	 */
70454 	#define SQ_SEND_HDR_AVID_MASK UINT32_C(0xfffff)
70455 	#define SQ_SEND_HDR_AVID_SFT 0
70456 	uint32_t	reserved32;
70457 	uint32_t	timestamp;
70458 	/*
70459 	 * This field specifies a 24-bit timestamp that can be passed
70460 	 * down the TX path and optionally logged in the TXP timestamp
70461 	 * histogram.
70462 	 */
70463 	#define SQ_SEND_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
70464 	#define SQ_SEND_HDR_TIMESTAMP_SFT 0
70465 } sq_send_hdr_t, *psq_send_hdr_t;
70466 
70467 /* Send Raw Ethernet and QP1 SQ WQE */
70468 /* sq_send_raweth_qp1 (size:1024b/128B) */
70469 
70470 typedef struct sq_send_raweth_qp1 {
70471 	/* This field defines the type of SQ WQE. */
70472 	uint8_t	wqe_type;
70473 	/* Send */
70474 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND UINT32_C(0x0)
70475 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND
70476 	uint8_t	flags;
70477 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70478 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70479 	/*
70480 	 * Set if completion signaling is requested. If this bit is
70481 	 * 0, and the SQ is configured to support Unsignaled completion
70482 	 * the controller should not generate a CQE unless there was
70483 	 * an error. This refers to the CQE on the sender side. (The se
70484 	 * flag refers to the receiver side).
70485 	 */
70486 	#define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
70487 	/* This flag must be zero for a Raweth or QP1 send. */
70488 	#define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
70489 	/* This flag must be zero for a Raweth or QP1 send. */
70490 	#define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE								UINT32_C(0x4)
70491 	/* This flag must be zero for a Raweth or QP1 send. */
70492 	#define SQ_SEND_RAWETH_QP1_FLAGS_SE									UINT32_C(0x8)
70493 	/*
70494 	 * Indicate that inline data is posted to the SQ in the data
70495 	 * area of this WQE.
70496 	 */
70497 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE								UINT32_C(0x10)
70498 	/*
70499 	 * If set to 1, then the timestamp from the WQE is used. If
70500 	 * cleared to 0, then TWE provides the timestamp.
70501 	 */
70502 	#define SQ_SEND_RAWETH_QP1_FLAGS_WQE_TS_EN								UINT32_C(0x20)
70503 	/*
70504 	 * When set to '1', this operation will cause a trace capture in
70505 	 * each block it passes through.
70506 	 */
70507 	#define SQ_SEND_RAWETH_QP1_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
70508 	/*
70509 	 * The number of 16 bytes chunks of data including this first
70510 	 * word of the request that are a valid part of the request. The
70511 	 * valid 16 bytes units other than the WQE structure can be
70512 	 * SGEs (Scatter Gather Elements) OR inline data.
70513 	 *
70514 	 * While this field defines the valid WQE size.  The actual
70515 	 * total WQE size is always 128B.
70516 	 */
70517 	uint8_t	wqe_size;
70518 	uint8_t	reserved8;
70519 	/*
70520 	 * All bits in this field must be valid on the first BD of a packet.
70521 	 * Their value on other BDs of the packet will be ignored.
70522 	 */
70523 	uint16_t	lflags;
70524 	/*
70525 	 * If set to 1, the controller replaces the TCP/UPD checksum
70526 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
70527 	 * checksum field of the encapsulated TCP/UDP packets with the
70528 	 * hardware calculated TCP/UDP checksum for the packet associated
70529 	 * with this descriptor.
70530 	 *
70531 	 * This bit must be valid on the first BD of a packet.
70532 	 */
70533 	#define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
70534 	/*
70535 	 * If set to 1,  the controller replaces the IP checksum of the
70536 	 * normal packets, or the inner IP checksum of the encapsulated
70537 	 * packets with the hardware calculated IP checksum for the
70538 	 * packet associated with this descriptor.
70539 	 *
70540 	 * This bit must be valid on the first BD of a packet.
70541 	 */
70542 	#define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
70543 	/*
70544 	 * If set to 1, the controller will not append an Ethernet CRC
70545 	 * to the end of the frame.
70546 	 *
70547 	 * This bit must be valid on the first BD of a packet.
70548 	 *
70549 	 * Packet must be 64B or longer when this flag is set.  It is not
70550 	 * usefull to use this bit with any form of TX offload such as
70551 	 * CSO or LSO.  The intent is that the packet from the host already
70552 	 * has a valid Ethernet CRC on the packet.
70553 	 */
70554 	#define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC		UINT32_C(0x4)
70555 	/*
70556 	 * If set to 1, the device will record the time at which the packet
70557 	 * was actually transmitted at the TX MAC.
70558 	 *
70559 	 * This bit must be valid on the first BD of a packet.
70560 	 */
70561 	#define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP		UINT32_C(0x8)
70562 	/*
70563 	 * If set to 1, The controller replaces the tunnel IP checksum
70564 	 * field with hardware calculated IP checksum for the IP header
70565 	 * of the packet associated with this descriptor.  In case of
70566 	 * VXLAN, the controller also replaces the outer header UDP
70567 	 * checksum with hardware calculated UDP checksum for the packet
70568 	 * associated with this descriptor.
70569 	 */
70570 	#define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
70571 	/*
70572 	 * If set to '1', then the RoCE ICRC will be appended to the
70573 	 * packet.  Packet must be a valid RoCE format packet.
70574 	 */
70575 	#define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC	UINT32_C(0x100)
70576 	/*
70577 	 * If set to '1', then the FCoE CRC will be appended to the
70578 	 * packet.  Packet must be a valid FCoE format packet.
70579 	 */
70580 	#define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC	UINT32_C(0x200)
70581 	/*
70582 	 * This value selects a CFA action to perform on the packet.
70583 	 * Set this value to zero if no CFA action is desired.
70584 	 *
70585 	 * This value must be valid on the first BD of a packet.
70586 	 */
70587 	uint16_t	cfa_action;
70588 	/*
70589 	 * This field represents a 32-bit total data length, in bytes.
70590 	 * Note, however, that the length cannot exceed the MTU.
70591 	 */
70592 	uint32_t	length;
70593 	uint32_t	reserved32_1;
70594 	/*
70595 	 * This value is action meta-data that defines CFA edit operations
70596 	 * that are done in addition to any action editing.
70597 	 */
70598 	uint32_t	cfa_meta;
70599 	/* When key=1, This is the VLAN tag VID value. */
70600 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
70601 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT	0
70602 	/* When key=1, This is the VLAN tag DE value. */
70603 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE	UINT32_C(0x1000)
70604 	/* When key=1, This is the VLAN tag PRI value. */
70605 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
70606 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT	13
70607 	/* When key=1, This is the VLAN tag TPID select value. */
70608 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
70609 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT	16
70610 	/* 0x88a8 */
70611 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
70612 	/* 0x8100 */
70613 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
70614 	/* 0x9100 */
70615 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
70616 	/* 0x9200 */
70617 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
70618 	/* 0x9300 */
70619 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
70620 	/* Value programmed in CFA VLANTPID register. */
70621 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
70622 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST	SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
70623 	/* When key=1, This is the VLAN tag TPID select value. */
70624 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
70625 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
70626 	/*
70627 	 * This field identifies the type of edit to be performed
70628 	 * on the packet.
70629 	 *
70630 	 * This value must be valid on the first BD of a packet.
70631 	 */
70632 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
70633 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT	28
70634 	/* No editing */
70635 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
70636 	/*
70637 	 * - meta[17:16] - TPID select value (0 = 0x8100).
70638 	 * - meta[15:12] - PRI/DE value.
70639 	 * - meta[11:0] - VID value.
70640 	 */
70641 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
70642 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST	SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
70643 	uint32_t	reserved32_2;
70644 	uint32_t	reserved32_3;
70645 	uint32_t	timestamp;
70646 	/*
70647 	 * This field specifies a 24-bit timestamp that can be passed
70648 	 * down the TX path and optionally logged in the TXP timestamp
70649 	 * histogram.
70650 	 */
70651 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_MASK UINT32_C(0xffffff)
70652 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_SFT 0
70653 	/*
70654 	 * When inline=0, then this area is filled with from 1 to 6
70655 	 * SGEs based on the wqe_size field.
70656 	 *
70657 	 * When inline=1, this area is filled with payload data for the
70658 	 * send based on the length_or_AVID field.  Bits [7:0] of word 0
70659 	 * hold the first byte to go out on the wire.
70660 	 */
70661 	uint32_t	data[24];
70662 } sq_send_raweth_qp1_t, *psq_send_raweth_qp1_t;
70663 
70664 /* Send Raw Ethernet and QP1 SQ WQE header. */
70665 /* sq_send_raweth_qp1_hdr (size:256b/32B) */
70666 
70667 typedef struct sq_send_raweth_qp1_hdr {
70668 	/* This field defines the type of SQ WQE. */
70669 	uint8_t	wqe_type;
70670 	/* Send */
70671 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND UINT32_C(0x0)
70672 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND
70673 	uint8_t	flags;
70674 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70675 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70676 	/*
70677 	 * Set if completion signaling is requested. If this bit is
70678 	 * 0, and the SQ is configured to support Unsignaled completion
70679 	 * the controller should not generate a CQE unless there was
70680 	 * an error. This refers to the CQE on the sender side. (The se
70681 	 * flag refers to the receiver side).
70682 	 */
70683 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
70684 	/* This flag must be zero for a Raweth or QP1 send. */
70685 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
70686 	/* This flag must be zero for a Raweth or QP1 send. */
70687 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
70688 	/* This flag must be zero for a Raweth or QP1 send. */
70689 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SE									UINT32_C(0x8)
70690 	/*
70691 	 * Indicate that inline data is posted to the SQ in the data
70692 	 * area of this WQE.
70693 	 */
70694 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE								UINT32_C(0x10)
70695 	/*
70696 	 * If set to 1, then the timestamp from the WQE is used. If
70697 	 * cleared to 0, then TWE provides the timestamp.
70698 	 */
70699 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
70700 	/*
70701 	 * When set to '1', this operation will cause a trace capture in
70702 	 * each block it passes through.
70703 	 */
70704 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
70705 	/*
70706 	 * The number of 16 bytes chunks of data including this first
70707 	 * word of the request that are a valid part of the request. The
70708 	 * valid 16 bytes units other than the WQE structure can be
70709 	 * SGEs (Scatter Gather Elements) OR inline data.
70710 	 *
70711 	 * While this field defines the valid WQE size.  The actual
70712 	 * total WQE size is always 128B.
70713 	 */
70714 	uint8_t	wqe_size;
70715 	uint8_t	reserved8;
70716 	/*
70717 	 * All bits in this field must be valid on the first BD of a packet.
70718 	 * Their value on other BDs of the packet will be ignored.
70719 	 */
70720 	uint16_t	lflags;
70721 	/*
70722 	 * If set to 1, the controller replaces the TCP/UPD checksum
70723 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
70724 	 * checksum field of the encapsulated TCP/UDP packets with the
70725 	 * hardware calculated TCP/UDP checksum for the packet associated
70726 	 * with this descriptor.
70727 	 *
70728 	 * This bit must be valid on the first BD of a packet.
70729 	 */
70730 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
70731 	/*
70732 	 * If set to 1,  the controller replaces the IP checksum of the
70733 	 * normal packets, or the inner IP checksum of the encapsulated
70734 	 * packets with the hardware calculated IP checksum for the
70735 	 * packet associated with this descriptor.
70736 	 *
70737 	 * This bit must be valid on the first BD of a packet.
70738 	 */
70739 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
70740 	/*
70741 	 * If set to 1, the controller will not append an Ethernet CRC
70742 	 * to the end of the frame.
70743 	 *
70744 	 * This bit must be valid on the first BD of a packet.
70745 	 *
70746 	 * Packet must be 64B or longer when this flag is set.  It is not
70747 	 * usefull to use this bit with any form of TX offload such as
70748 	 * CSO or LSO.  The intent is that the packet from the host already
70749 	 * has a valid Ethernet CRC on the packet.
70750 	 */
70751 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_NOCRC		UINT32_C(0x4)
70752 	/*
70753 	 * If set to 1, the device will record the time at which the packet
70754 	 * was actually transmitted at the TX MAC.
70755 	 *
70756 	 * This bit must be valid on the first BD of a packet.
70757 	 */
70758 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_STAMP		UINT32_C(0x8)
70759 	/*
70760 	 * If set to 1, The controller replaces the tunnel IP checksum
70761 	 * field with hardware calculated IP checksum for the IP header
70762 	 * of the packet associated with this descriptor.  In case of
70763 	 * VXLAN, the controller also replaces the outer header UDP
70764 	 * checksum with hardware calculated UDP checksum for the packet
70765 	 * associated with this descriptor.
70766 	 */
70767 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
70768 	/*
70769 	 * If set to '1', then the RoCE ICRC will be appended to the
70770 	 * packet.  Packet must be a valid RoCE format packet.
70771 	 */
70772 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_ROCE_CRC	UINT32_C(0x100)
70773 	/*
70774 	 * If set to '1', then the FCoE CRC will be appended to the
70775 	 * packet.  Packet must be a valid FCoE format packet.
70776 	 */
70777 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_FCOE_CRC	UINT32_C(0x200)
70778 	/*
70779 	 * This value selects a CFA action to perform on the packet.
70780 	 * Set this value to zero if no CFA action is desired.
70781 	 *
70782 	 * This value must be valid on the first BD of a packet.
70783 	 */
70784 	uint16_t	cfa_action;
70785 	/*
70786 	 * This field represents a 32-bit total data length, in bytes.
70787 	 * Note, however, that the length cannot exceed the MTU.
70788 	 */
70789 	uint32_t	length;
70790 	uint32_t	reserved32_1;
70791 	/*
70792 	 * This value is action meta-data that defines CFA edit operations
70793 	 * that are done in addition to any action editing.
70794 	 */
70795 	uint32_t	cfa_meta;
70796 	/* When key=1, This is the VLAN tag VID value. */
70797 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
70798 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_SFT	0
70799 	/* When key=1, This is the VLAN tag DE value. */
70800 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_DE	UINT32_C(0x1000)
70801 	/* When key=1, This is the VLAN tag PRI value. */
70802 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
70803 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_SFT	13
70804 	/* When key=1, This is the VLAN tag TPID select value. */
70805 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
70806 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_SFT	16
70807 	/* 0x88a8 */
70808 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
70809 	/* 0x8100 */
70810 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
70811 	/* 0x9100 */
70812 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
70813 	/* 0x9200 */
70814 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
70815 	/* 0x9300 */
70816 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
70817 	/* Value programmed in CFA VLANTPID register. */
70818 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
70819 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_LAST	SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG
70820 	/* When key=1, This is the VLAN tag TPID select value. */
70821 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
70822 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_SFT 19
70823 	/*
70824 	 * This field identifies the type of edit to be performed
70825 	 * on the packet.
70826 	 *
70827 	 * This value must be valid on the first BD of a packet.
70828 	 */
70829 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
70830 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_SFT	28
70831 	/* No editing */
70832 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
70833 	/*
70834 	 * - meta[17:16] - TPID select value (0 = 0x8100).
70835 	 * - meta[15:12] - PRI/DE value.
70836 	 * - meta[11:0] - VID value.
70837 	 */
70838 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
70839 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_LAST	SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG
70840 	uint32_t	reserved32_2;
70841 	uint32_t	reserved32_3;
70842 	uint32_t	timestamp;
70843 	/*
70844 	 * This field specifies a 24-bit timestamp that can be passed
70845 	 * down the TX path and optionally logged in the TXP timestamp
70846 	 * histogram.
70847 	 */
70848 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
70849 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_SFT 0
70850 } sq_send_raweth_qp1_hdr_t, *psq_send_raweth_qp1_hdr_t;
70851 
70852 /* RDMA SQ WQE */
70853 /* sq_rdma (size:1024b/128B) */
70854 
70855 typedef struct sq_rdma {
70856 	/* This field defines the type of SQ WQE. */
70857 	uint8_t	wqe_type;
70858 	/*
70859 	 * RDMA Write.
70860 	 *
70861 	 * Allowed only on reliable connection (RC) SQs.
70862 	 */
70863 	#define SQ_RDMA_WQE_TYPE_WRITE_WQE	UINT32_C(0x4)
70864 	/*
70865 	 * RDMA Write with Immediate.
70866 	 *
70867 	 * Allowed only on reliable connection (RC) SQs.
70868 	 */
70869 	#define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
70870 	/*
70871 	 * RDMA Read.
70872 	 *
70873 	 * Allowed only on reliable connection (RC) SQs.
70874 	 */
70875 	#define SQ_RDMA_WQE_TYPE_READ_WQE	UINT32_C(0x6)
70876 	#define SQ_RDMA_WQE_TYPE_LAST	SQ_RDMA_WQE_TYPE_READ_WQE
70877 	uint8_t	flags;
70878 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70879 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70880 	/*
70881 	 * Set if completion signaling is requested. If this bit is
70882 	 * 0, and the SQ is configured to support Unsignaled
70883 	 * completion the controller should not generate a CQE
70884 	 * unless there was an error. This refers to CQE on the
70885 	 * sender side (se_flag refers to the receiver side)
70886 	 */
70887 	#define SQ_RDMA_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
70888 	/*
70889 	 * Indication to complete all previous RDMA Read or Atomic
70890 	 * WQEs on the SQ before executing this WQE
70891 	 */
70892 	#define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
70893 	/*
70894 	 * Unconditional fence. Indication to complete all previous
70895 	 * SQ's WQEs before executing this WQE.
70896 	 */
70897 	#define SQ_RDMA_FLAGS_UC_FENCE								UINT32_C(0x4)
70898 	/*
70899 	 * Solicit event. Indication sent in BTH header to the
70900 	 * receiver to generate a Completion Event Notification,
70901 	 * i.e. CNQE. This bit should be set only in the last (or
70902 	 * only) packet of the message.
70903 	 */
70904 	#define SQ_RDMA_FLAGS_SE									UINT32_C(0x8)
70905 	/*
70906 	 * Indicate that inline data is posted to the SQ following
70907 	 * this WQE.  This bit may be 1 only for write operations.
70908 	 */
70909 	#define SQ_RDMA_FLAGS_INLINE								UINT32_C(0x10)
70910 	/*
70911 	 * If set to 1, then the timestamp from the WQE is used. If
70912 	 * cleared to 0, then TWE provides the timestamp.
70913 	 */
70914 	#define SQ_RDMA_FLAGS_WQE_TS_EN								UINT32_C(0x20)
70915 	/*
70916 	 * When set to '1', this operation will cause a trace capture in
70917 	 * each block it passes through.
70918 	 */
70919 	#define SQ_RDMA_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
70920 	/*
70921 	 * The number of 16 bytes chunks of data including this first
70922 	 * wqe of the request that are a valid part of the request. The
70923 	 * valid 16 bytes units other than the WQE structure can be
70924 	 * SGEs (Scatter Gather Elements) OR inline data.
70925 	 *
70926 	 * While this field defines the valid WQE size.  The actual
70927 	 * total WQE size is always 128B.
70928 	 */
70929 	uint8_t	wqe_size;
70930 	uint8_t	reserved8;
70931 	/*
70932 	 * Immediate data - valid for RDMA Write with immediate and
70933 	 * causes the controller to add immDt header with this value
70934 	 */
70935 	uint32_t	imm_data;
70936 	/* Total data length in bytes */
70937 	uint32_t	length;
70938 	uint32_t	reserved32_1;
70939 	/* Remote VA sent to the destination QP */
70940 	uint64_t	remote_va;
70941 	/*
70942 	 * R_Key provided by remote node when the connection was
70943 	 * established and placed in the RETH header. It identify the
70944 	 * MRW on the remote host
70945 	 */
70946 	uint32_t	remote_key;
70947 	uint32_t	timestamp;
70948 	/*
70949 	 * This field specifies a 24-bit timestamp that can be passed
70950 	 * down the TX path and optionally logged in the TXP timestamp
70951 	 * histogram.
70952 	 */
70953 	#define SQ_RDMA_TIMESTAMP_MASK UINT32_C(0xffffff)
70954 	#define SQ_RDMA_TIMESTAMP_SFT 0
70955 	/*
70956 	 * When inline=0, then this area is filled with from 1 to 6
70957 	 * SGEs based on the wqe_size field.
70958 	 *
70959 	 * When inline=1, this area is filled with payload data for the
70960 	 * write based on the length field.  Bits [7:0] of word 0
70961 	 * hold the first byte to go out on the wire.
70962 	 */
70963 	uint32_t	data[24];
70964 } sq_rdma_t, *psq_rdma_t;
70965 
70966 /* RDMA SQ WQE header. */
70967 /* sq_rdma_hdr (size:256b/32B) */
70968 
70969 typedef struct sq_rdma_hdr {
70970 	/* This field defines the type of SQ WQE. */
70971 	uint8_t	wqe_type;
70972 	/*
70973 	 * RDMA Write.
70974 	 *
70975 	 * Allowed only on reliable connection (RC) SQs.
70976 	 */
70977 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_WQE	UINT32_C(0x4)
70978 	/*
70979 	 * RDMA Write with Immediate.
70980 	 *
70981 	 * Allowed only on reliable connection (RC) SQs.
70982 	 */
70983 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
70984 	/*
70985 	 * RDMA Read.
70986 	 *
70987 	 * Allowed only on reliable connection (RC) SQs.
70988 	 */
70989 	#define SQ_RDMA_HDR_WQE_TYPE_READ_WQE	UINT32_C(0x6)
70990 	#define SQ_RDMA_HDR_WQE_TYPE_LAST	SQ_RDMA_HDR_WQE_TYPE_READ_WQE
70991 	uint8_t	flags;
70992 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
70993 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
70994 	/*
70995 	 * Set if completion signaling is requested. If this bit is
70996 	 * 0, and the SQ is configured to support Unsignaled
70997 	 * completion the controller should not generate a CQE
70998 	 * unless there was an error. This refers to CQE on the
70999 	 * sender side (se_flag refers to the receiver side)
71000 	 */
71001 	#define SQ_RDMA_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
71002 	/*
71003 	 * Indication to complete all previous RDMA Read or Atomic
71004 	 * WQEs on the SQ before executing this WQE
71005 	 */
71006 	#define SQ_RDMA_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
71007 	/*
71008 	 * Unconditional fence. Indication to complete all previous
71009 	 * SQ's WQEs before executing this WQE.
71010 	 */
71011 	#define SQ_RDMA_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
71012 	/*
71013 	 * Solicit event. Indication sent in BTH header to the
71014 	 * receiver to generate a Completion Event Notification,
71015 	 * i.e. CNQE. This bit should be set only in the last (or
71016 	 * only) packet of the message.
71017 	 */
71018 	#define SQ_RDMA_HDR_FLAGS_SE									UINT32_C(0x8)
71019 	/*
71020 	 * Indicate that inline data is posted to the SQ following
71021 	 * this WQE.  This bit may be 1 only for write operations.
71022 	 */
71023 	#define SQ_RDMA_HDR_FLAGS_INLINE								UINT32_C(0x10)
71024 	/*
71025 	 * If set to 1, then the timestamp from the WQE is used. If
71026 	 * cleared to 0, then TWE provides the timestamp.
71027 	 */
71028 	#define SQ_RDMA_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
71029 	/*
71030 	 * When set to '1', this operation will cause a trace capture in
71031 	 * each block it passes through.
71032 	 */
71033 	#define SQ_RDMA_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
71034 	/*
71035 	 * The number of 16 bytes chunks of data including this first
71036 	 * wqe of the request that are a valid part of the request. The
71037 	 * valid 16 bytes units other than the WQE structure can be
71038 	 * SGEs (Scatter Gather Elements) OR inline data.
71039 	 *
71040 	 * While this field defines the valid WQE size.  The actual
71041 	 * total WQE size is always 128B.
71042 	 */
71043 	uint8_t	wqe_size;
71044 	uint8_t	reserved8;
71045 	/*
71046 	 * Immediate data - valid for RDMA Write with immediate and
71047 	 * causes the controller to add immDt header with this value
71048 	 */
71049 	uint32_t	imm_data;
71050 	/* Total data length in bytes */
71051 	uint32_t	length;
71052 	uint32_t	reserved32_1;
71053 	/* Remote VA sent to the destination QP */
71054 	uint64_t	remote_va;
71055 	/*
71056 	 * R_Key provided by remote node when the connection was
71057 	 * established and placed in the RETH header. It identify the
71058 	 * MRW on the remote host
71059 	 */
71060 	uint32_t	remote_key;
71061 	uint32_t	timestamp;
71062 	/*
71063 	 * This field specifies a 24-bit timestamp that can be passed
71064 	 * down the TX path and optionally logged in the TXP timestamp
71065 	 * histogram.
71066 	 */
71067 	#define SQ_RDMA_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
71068 	#define SQ_RDMA_HDR_TIMESTAMP_SFT 0
71069 } sq_rdma_hdr_t, *psq_rdma_hdr_t;
71070 
71071 /* Atomic SQ WQE */
71072 /* sq_atomic (size:1024b/128B) */
71073 
71074 typedef struct sq_atomic {
71075 	/* This field defines the type of SQ WQE. */
71076 	uint8_t	wqe_type;
71077 	/*
71078 	 * Atomic Compare/Swap.
71079 	 *
71080 	 * Allowed only on reliable connection (RC) SQs.
71081 	 */
71082 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
71083 	/*
71084 	 * Atomic Fetch/Add.
71085 	 *
71086 	 * Allowed only on reliable connection (RC) SQs.
71087 	 */
71088 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
71089 	#define SQ_ATOMIC_WQE_TYPE_LAST	SQ_ATOMIC_WQE_TYPE_ATOMIC_FA
71090 	uint8_t	flags;
71091 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
71092 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
71093 	/*
71094 	 * Set if completion signaling is requested. If this bit is
71095 	 * 0, and the SQ is configured to support Unsignaled
71096 	 * completion the controller should not generate a CQE
71097 	 * unless there was an error. This refers to CQE on the
71098 	 * sender side (se_flag refers to the receiver side)
71099 	 */
71100 	#define SQ_ATOMIC_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
71101 	/*
71102 	 * Indication to complete all previous RDMA Read or Atomic
71103 	 * WQEs on the SQ before executing this WQE
71104 	 */
71105 	#define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
71106 	/*
71107 	 * Unconditional fence. Indication to complete all previous
71108 	 * SQ's WQEs before executing this WQE.
71109 	 */
71110 	#define SQ_ATOMIC_FLAGS_UC_FENCE								UINT32_C(0x4)
71111 	/*
71112 	 * Solicit event. Indication sent in BTH header to the
71113 	 * receiver to generate a Completion Event Notification,
71114 	 * i.e. CNQE. This bit should be set only in the last (or
71115 	 * only) packet of the message.
71116 	 */
71117 	#define SQ_ATOMIC_FLAGS_SE									UINT32_C(0x8)
71118 	/* NA for this WQE */
71119 	#define SQ_ATOMIC_FLAGS_INLINE								UINT32_C(0x10)
71120 	/*
71121 	 * The atomic WQE does not have a timestamp field, so this field is
71122 	 * ignored and should be zero.
71123 	 */
71124 	#define SQ_ATOMIC_FLAGS_WQE_TS_EN								UINT32_C(0x20)
71125 	/*
71126 	 * When set to '1', this operation will cause a trace capture in
71127 	 * each block it passes through.
71128 	 */
71129 	#define SQ_ATOMIC_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
71130 	uint16_t	reserved16;
71131 	/*
71132 	 * R_Key provided by remote node when the connection was
71133 	 * established and placed in the AETH header. It identify the
71134 	 * MRW on the remote host
71135 	 */
71136 	uint32_t	remote_key;
71137 	/* Remote VA sent to the destination QP */
71138 	uint64_t	remote_va;
71139 	/* Data value to be placed in remote host specified address */
71140 	uint64_t	swap_data;
71141 	/*
71142 	 * Data value to be compared with the value in the remote host
71143 	 * specified address
71144 	 */
71145 	uint64_t	cmp_data;
71146 	/*
71147 	 * The first 16B of the data field must be filled with a single
71148 	 * SGE. This will be used to store the return value from the
71149 	 * Atomic Ack response.  The size of the single SGE must be 8B.
71150 	 */
71151 	uint32_t	data[24];
71152 } sq_atomic_t, *psq_atomic_t;
71153 
71154 /* Atomic SQ WQE header. */
71155 /* sq_atomic_hdr (size:256b/32B) */
71156 
71157 typedef struct sq_atomic_hdr {
71158 	/* This field defines the type of SQ WQE. */
71159 	uint8_t	wqe_type;
71160 	/*
71161 	 * Atomic Compare/Swap.
71162 	 *
71163 	 * Allowed only on reliable connection (RC) SQs.
71164 	 */
71165 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
71166 	/*
71167 	 * Atomic Fetch/Add.
71168 	 *
71169 	 * Allowed only on reliable connection (RC) SQs.
71170 	 */
71171 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
71172 	#define SQ_ATOMIC_HDR_WQE_TYPE_LAST	SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA
71173 	uint8_t	flags;
71174 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
71175 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
71176 	/*
71177 	 * Set if completion signaling is requested. If this bit is
71178 	 * 0, and the SQ is configured to support Unsignaled
71179 	 * completion the controller should not generate a CQE
71180 	 * unless there was an error. This refers to CQE on the
71181 	 * sender side (se_flag refers to the receiver side)
71182 	 */
71183 	#define SQ_ATOMIC_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
71184 	/*
71185 	 * Indication to complete all previous RDMA Read or Atomic
71186 	 * WQEs on the SQ before executing this WQE
71187 	 */
71188 	#define SQ_ATOMIC_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
71189 	/*
71190 	 * Unconditional fence. Indication to complete all previous
71191 	 * SQ's WQEs before executing this WQE.
71192 	 */
71193 	#define SQ_ATOMIC_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
71194 	/*
71195 	 * Solicit event. Indication sent in BTH header to the
71196 	 * receiver to generate a Completion Event Notification,
71197 	 * i.e. CNQE. This bit should be set only in the last (or
71198 	 * only) packet of the message.
71199 	 */
71200 	#define SQ_ATOMIC_HDR_FLAGS_SE									UINT32_C(0x8)
71201 	/* NA for this WQE */
71202 	#define SQ_ATOMIC_HDR_FLAGS_INLINE								UINT32_C(0x10)
71203 	/*
71204 	 * The atomic WQE does not have a timestamp field, so this field is
71205 	 * ignored and should be zero.
71206 	 */
71207 	#define SQ_ATOMIC_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
71208 	/*
71209 	 * When set to '1', this operation will cause a trace capture in
71210 	 * each block it passes through.
71211 	 */
71212 	#define SQ_ATOMIC_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
71213 	uint16_t	reserved16;
71214 	/*
71215 	 * R_Key provided by remote node when the connection was
71216 	 * established and placed in the AETH header. It identify the
71217 	 * MRW on the remote host
71218 	 */
71219 	uint32_t	remote_key;
71220 	/* Remote VA sent to the destination QP */
71221 	uint64_t	remote_va;
71222 	/* Data value to be placed in remote host specified address */
71223 	uint64_t	swap_data;
71224 	/*
71225 	 * Data value to be compared with the value in the remote host
71226 	 * specified address
71227 	 */
71228 	uint64_t	cmp_data;
71229 } sq_atomic_hdr_t, *psq_atomic_hdr_t;
71230 
71231 /* Local Invalidate SQ WQE */
71232 /* sq_localinvalidate (size:1024b/128B) */
71233 
71234 typedef struct sq_localinvalidate {
71235 	/* This field defines the type of SQ WQE. */
71236 	uint8_t	wqe_type;
71237 	/*
71238 	 * Local Invalidate.
71239 	 *
71240 	 * Allowed only on reliable connection (RC) SQs.
71241 	 */
71242 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
71243 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LAST	SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID
71244 	uint8_t	flags;
71245 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
71246 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
71247 	/*
71248 	 * Set if completion signaling is requested. If this bit is
71249 	 * 0, and the SQ is configured to support Unsignaled
71250 	 * completion the controller should not generate a CQE
71251 	 * unless there was an error. This refers to CQE on the
71252 	 * sender side (se_flag refers to the receiver side)
71253 	 */
71254 	#define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
71255 	/*
71256 	 * Indication to complete all previous RDMA Read or Atomic
71257 	 * WQEs on the SQ before executing this WQE
71258 	 */
71259 	#define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
71260 	/*
71261 	 * Unconditional fence. Indication to complete all previous
71262 	 * SQ's WQEs before executing this WQE.
71263 	 */
71264 	#define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE								UINT32_C(0x4)
71265 	/*
71266 	 * Solicit event. Indication sent in BTH header to the
71267 	 * receiver to generate a Completion Event Notification,
71268 	 * i.e. CNQE. This bit should be set only in the last (or
71269 	 * only) packet of the message.
71270 	 */
71271 	#define SQ_LOCALINVALIDATE_FLAGS_SE									UINT32_C(0x8)
71272 	/* NA for this WQE */
71273 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE								UINT32_C(0x10)
71274 	/*
71275 	 * This flag is not applicable and should be 0 for a local memory
71276 	 * operation WQE.
71277 	 */
71278 	#define SQ_LOCALINVALIDATE_FLAGS_WQE_TS_EN								UINT32_C(0x20)
71279 	/*
71280 	 * When set to '1', this operation will cause a trace capture in
71281 	 * each block it passes through.
71282 	 */
71283 	#define SQ_LOCALINVALIDATE_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
71284 	uint16_t	reserved16;
71285 	/*
71286 	 * The local key for the MR/W to invalidate; 24 msb of the key
71287 	 * are used to index the MRW table, 8 lsb are compared with the
71288 	 * 8 bit key in the MRWC
71289 	 */
71290 	uint32_t	inv_l_key;
71291 	uint64_t	reserved64;
71292 	uint8_t	reserved128[16];
71293 	/* The data field for local invalidate is not used. */
71294 	uint32_t	data[24];
71295 } sq_localinvalidate_t, *psq_localinvalidate_t;
71296 
71297 /* Local Invalidate SQ WQE header. */
71298 /* sq_localinvalidate_hdr (size:256b/32B) */
71299 
71300 typedef struct sq_localinvalidate_hdr {
71301 	/* This field defines the type of SQ WQE. */
71302 	uint8_t	wqe_type;
71303 	/*
71304 	 * Local Invalidate.
71305 	 *
71306 	 * Allowed only on reliable connection (RC) SQs.
71307 	 */
71308 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
71309 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LAST	SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID
71310 	uint8_t	flags;
71311 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
71312 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
71313 	/*
71314 	 * Set if completion signaling is requested. If this bit is
71315 	 * 0, and the SQ is configured to support Unsignaled
71316 	 * completion the controller should not generate a CQE
71317 	 * unless there was an error. This refers to CQE on the
71318 	 * sender side (se_flag refers to the receiver side)
71319 	 */
71320 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
71321 	/*
71322 	 * Indication to complete all previous RDMA Read or Atomic
71323 	 * WQEs on the SQ before executing this WQE
71324 	 */
71325 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
71326 	/*
71327 	 * Unconditional fence. Indication to complete all previous
71328 	 * SQ's WQEs before executing this WQE.
71329 	 */
71330 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
71331 	/*
71332 	 * Solicit event. Indication sent in BTH header to the
71333 	 * receiver to generate a Completion Event Notification,
71334 	 * i.e. CNQE. This bit should be set only in the last (or
71335 	 * only) packet of the message.
71336 	 */
71337 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SE									UINT32_C(0x8)
71338 	/* NA for this WQE */
71339 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE								UINT32_C(0x10)
71340 	/*
71341 	 * This flag is not applicable and should be 0 for a local memory
71342 	 * operation WQE.
71343 	 */
71344 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
71345 	/*
71346 	 * When set to '1', this operation will cause a trace capture in
71347 	 * each block it passes through.
71348 	 */
71349 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
71350 	uint16_t	reserved16;
71351 	/*
71352 	 * The local key for the MR/W to invalidate; 24 msb of the key
71353 	 * are used to index the MRW table, 8 lsb are compared with the
71354 	 * 8 bit key in the MRWC
71355 	 */
71356 	uint32_t	inv_l_key;
71357 	uint64_t	reserved64;
71358 	uint8_t	reserved128[16];
71359 } sq_localinvalidate_hdr_t, *psq_localinvalidate_hdr_t;
71360 
71361 /* FR-PMR SQ WQE */
71362 /* sq_fr_pmr (size:1024b/128B) */
71363 
71364 typedef struct sq_fr_pmr {
71365 	/* This field defines the type of SQ WQE. */
71366 	uint8_t	wqe_type;
71367 	/*
71368 	 * FR-PMR (Fast Register Physical Memory Region)
71369 	 *
71370 	 * Allowed only on reliable connection (RC) SQs.
71371 	 */
71372 	#define SQ_FR_PMR_WQE_TYPE_FR_PMR UINT32_C(0xd)
71373 	#define SQ_FR_PMR_WQE_TYPE_LAST  SQ_FR_PMR_WQE_TYPE_FR_PMR
71374 	uint8_t	flags;
71375 	/*
71376 	 * Set if completion signaling is requested. If this bit is
71377 	 * 0, and the SQ is configured to support Unsignaled
71378 	 * completion the controller should not generate a CQE
71379 	 * unless there was an error. This refers to CQE on the
71380 	 * sender side (se_flag refers to the receiver side)
71381 	 */
71382 	#define SQ_FR_PMR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
71383 	/*
71384 	 * Indication to complete all previous RDMA Read or Atomic
71385 	 * WQEs on the SQ before executing this WQE
71386 	 */
71387 	#define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
71388 	/*
71389 	 * Unconditional fence. Indication to complete all previous
71390 	 * SQ's WQEs before executing this WQE.
71391 	 */
71392 	#define SQ_FR_PMR_FLAGS_UC_FENCE		UINT32_C(0x4)
71393 	/* Not Applicable for FR_PMR. Nothing is sent */
71394 	#define SQ_FR_PMR_FLAGS_SE			UINT32_C(0x8)
71395 	/* NA */
71396 	#define SQ_FR_PMR_FLAGS_INLINE		UINT32_C(0x10)
71397 	/*
71398 	 * This flag is not applicable and should be 0 for a local memory
71399 	 * operation WQE.
71400 	 */
71401 	#define SQ_FR_PMR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
71402 	/*
71403 	 * When set to '1', this operation will cause a trace capture in
71404 	 * each block it passes through.
71405 	 */
71406 	#define SQ_FR_PMR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
71407 	/*
71408 	 * This is the new access control for the MR.  '1' means
71409 	 * the operation is allowed.  '0' means operation is
71410 	 * not allowed.
71411 	 */
71412 	uint8_t	access_cntl;
71413 	/* Local Write Access */
71414 	#define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
71415 	/* Remote Read Access */
71416 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
71417 	/* Remote Write Access */
71418 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
71419 	/* Remote Atomic Access */
71420 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
71421 	/* Window Binding Allowed */
71422 	#define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
71423 	uint8_t	zero_based_page_size_log;
71424 	/* Page size. 0 for 4KB page size, ... to 8TB. */
71425 	#define SQ_FR_PMR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71426 	#define SQ_FR_PMR_PAGE_SIZE_LOG_SFT	0
71427 	/* Page size is 4KB. */
71428 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71429 	/* Page size is 8KB. */
71430 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71431 	/* Page size is 16KB. */
71432 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71433 	/* Page size is 32KB. */
71434 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
71435 	/* Page size is 64KB. */
71436 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
71437 	/* Page size is 128KB. */
71438 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
71439 	/* Page size is 256KB. */
71440 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
71441 	/* Page size is 512KB. */
71442 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
71443 	/* Page size is 1MB. */
71444 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
71445 	/* Page size is 2MB. */
71446 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
71447 	/* Page size is 4MB. */
71448 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
71449 	/* Page size is 8MB. */
71450 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
71451 	/* Page size is 16MB. */
71452 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
71453 	/* Page size is 32MB. */
71454 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
71455 	/* Page size is 64MB. */
71456 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
71457 	/* Page size is 128MB. */
71458 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
71459 	/* Page size is 256MB. */
71460 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
71461 	/* Page size is 512MB. */
71462 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
71463 	/* Page size is 1GB. */
71464 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
71465 	/* Page size is 2GB. */
71466 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
71467 	/* Page size is 4GB. */
71468 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
71469 	/* Page size is 8GB. */
71470 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
71471 	/* Page size is 16GB. */
71472 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
71473 	/* Page size is 32GB. */
71474 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
71475 	/* Page size is 64GB. */
71476 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
71477 	/* Page size is 128GB. */
71478 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
71479 	/* Page size is 256GB. */
71480 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
71481 	/* Page size is 512GB. */
71482 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
71483 	/* Page size is 1TB. */
71484 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
71485 	/* Page size is 2TB. */
71486 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
71487 	/* Page size is 4TB. */
71488 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
71489 	/* Page size is 8TB. */
71490 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
71491 		#define SQ_FR_PMR_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T
71492 	/* Indicate the MR is ZBVA (Zero Base VA) */
71493 	#define SQ_FR_PMR_ZERO_BASED		UINT32_C(0x20)
71494 	/*
71495 	 * Local Key; 24 msb of the key are used to index the MRW
71496 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
71497 	 * the MRWC.
71498 	 */
71499 	uint32_t	l_key;
71500 	/* Length in bytes of registered MR */
71501 	uint8_t	length[5];
71502 	uint8_t	reserved8_1;
71503 	uint8_t	reserved8_2;
71504 	uint8_t	numlevels_pbl_page_size_log;
71505 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
71506 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71507 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT	0
71508 	/* Page size is 4KB. */
71509 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71510 	/* Page size is 8KB. */
71511 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71512 	/* Page size is 16KB. */
71513 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71514 	/* Page size is 32KB. */
71515 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
71516 	/* Page size is 64KB. */
71517 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
71518 	/* Page size is 128KB. */
71519 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
71520 	/* Page size is 256KB. */
71521 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
71522 	/* Page size is 512KB. */
71523 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
71524 	/* Page size is 1MB. */
71525 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
71526 	/* Page size is 2MB. */
71527 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
71528 	/* Page size is 4MB. */
71529 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
71530 	/* Page size is 8MB. */
71531 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
71532 	/* Page size is 16MB. */
71533 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
71534 	/* Page size is 32MB. */
71535 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
71536 	/* Page size is 64MB. */
71537 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
71538 	/* Page size is 128MB. */
71539 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
71540 	/* Page size is 256MB. */
71541 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
71542 	/* Page size is 512MB. */
71543 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
71544 	/* Page size is 1GB. */
71545 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
71546 	/* Page size is 2GB. */
71547 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
71548 	/* Page size is 4GB. */
71549 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
71550 	/* Page size is 8GB. */
71551 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
71552 	/* Page size is 16GB. */
71553 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
71554 	/* Page size is 32GB. */
71555 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
71556 	/* Page size is 64GB. */
71557 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
71558 	/* Page size is 128GB. */
71559 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
71560 	/* Page size is 256GB. */
71561 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
71562 	/* Page size is 512GB. */
71563 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
71564 	/* Page size is 1TB. */
71565 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
71566 	/* Page size is 2TB. */
71567 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
71568 	/* Page size is 4TB. */
71569 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
71570 	/* Page size is 8TB. */
71571 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
71572 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
71573 	/* Number of levels of PBL for translation */
71574 	#define SQ_FR_PMR_NUMLEVELS_MASK		UINT32_C(0xc0)
71575 	#define SQ_FR_PMR_NUMLEVELS_SFT		6
71576 	/*
71577 	 * A zero level PBL means that the VA is the physical address used
71578 	 * for the operation.  No translation is done by the PTU.
71579 	 */
71580 		#define SQ_FR_PMR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
71581 	/*
71582 	 * A one layer translation is provided between the logical and
71583 	 * physical address.  The PBL points to a physical page that contains
71584 	 * PBE values that point to actual pg_size physical pages.
71585 	 */
71586 		#define SQ_FR_PMR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
71587 	/*
71588 	 * A two layer translation is provided between the logical and
71589 	 * physical address. The PBL points to a physical page that contains
71590 	 * PDE values that in turn point to pbl_pg_size physical pages that contain
71591 	 * PBE values that point to actual physical pages.
71592 	 */
71593 		#define SQ_FR_PMR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
71594 		#define SQ_FR_PMR_NUMLEVELS_LAST		SQ_FR_PMR_NUMLEVELS_LAYER2
71595 	/* Pointer to the PBL, or PDL depending on number of levels */
71596 	uint64_t	pblptr;
71597 	/* Local Virtual Address */
71598 	uint64_t	va;
71599 	/* The data field for FR-PMR is not used. */
71600 	uint32_t	data[24];
71601 } sq_fr_pmr_t, *psq_fr_pmr_t;
71602 
71603 /* FR-PMR SQ WQE header. */
71604 /* sq_fr_pmr_hdr (size:256b/32B) */
71605 
71606 typedef struct sq_fr_pmr_hdr {
71607 	/* This field defines the type of SQ WQE. */
71608 	uint8_t	wqe_type;
71609 	/*
71610 	 * FR-PMR (Fast Register Physical Memory Region)
71611 	 *
71612 	 * Allowed only on reliable connection (RC) SQs.
71613 	 */
71614 	#define SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR UINT32_C(0xd)
71615 	#define SQ_FR_PMR_HDR_WQE_TYPE_LAST  SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR
71616 	uint8_t	flags;
71617 	/*
71618 	 * Set if completion signaling is requested. If this bit is
71619 	 * 0, and the SQ is configured to support Unsignaled
71620 	 * completion the controller should not generate a CQE
71621 	 * unless there was an error. This refers to CQE on the
71622 	 * sender side (se_flag refers to the receiver side)
71623 	 */
71624 	#define SQ_FR_PMR_HDR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
71625 	/*
71626 	 * Indication to complete all previous RDMA Read or Atomic
71627 	 * WQEs on the SQ before executing this WQE
71628 	 */
71629 	#define SQ_FR_PMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
71630 	/*
71631 	 * Unconditional fence. Indication to complete all previous
71632 	 * SQ's WQEs before executing this WQE.
71633 	 */
71634 	#define SQ_FR_PMR_HDR_FLAGS_UC_FENCE		UINT32_C(0x4)
71635 	/* Not Applicable for FR_PMR. Nothing is sent */
71636 	#define SQ_FR_PMR_HDR_FLAGS_SE			UINT32_C(0x8)
71637 	/* NA */
71638 	#define SQ_FR_PMR_HDR_FLAGS_INLINE		UINT32_C(0x10)
71639 	/*
71640 	 * This flag is not applicable and should be 0 for a local memory
71641 	 * operation WQE.
71642 	 */
71643 	#define SQ_FR_PMR_HDR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
71644 	/*
71645 	 * When set to '1', this operation will cause a trace capture in
71646 	 * each block it passes through.
71647 	 */
71648 	#define SQ_FR_PMR_HDR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
71649 	/*
71650 	 * This is the new access control for the MR.  '1' means
71651 	 * the operation is allowed.  '0' means operation is
71652 	 * not allowed.
71653 	 */
71654 	uint8_t	access_cntl;
71655 	/* Local Write Access */
71656 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
71657 	/* Remote Read Access */
71658 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
71659 	/* Remote Write Access */
71660 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
71661 	/* Remote Atomic Access */
71662 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
71663 	/* Window Binding Allowed */
71664 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
71665 	uint8_t	zero_based_page_size_log;
71666 	/* Page size. 0 for 4KB page size, ... to 8TB. */
71667 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71668 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_SFT	0
71669 	/* Page size is 4KB. */
71670 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71671 	/* Page size is 8KB. */
71672 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71673 	/* Page size is 16KB. */
71674 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71675 	/* Page size is 32KB. */
71676 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
71677 	/* Page size is 64KB. */
71678 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
71679 	/* Page size is 128KB. */
71680 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
71681 	/* Page size is 256KB. */
71682 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
71683 	/* Page size is 512KB. */
71684 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
71685 	/* Page size is 1MB. */
71686 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
71687 	/* Page size is 2MB. */
71688 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
71689 	/* Page size is 4MB. */
71690 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
71691 	/* Page size is 8MB. */
71692 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
71693 	/* Page size is 16MB. */
71694 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
71695 	/* Page size is 32MB. */
71696 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
71697 	/* Page size is 64MB. */
71698 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
71699 	/* Page size is 128MB. */
71700 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
71701 	/* Page size is 256MB. */
71702 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
71703 	/* Page size is 512MB. */
71704 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
71705 	/* Page size is 1GB. */
71706 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
71707 	/* Page size is 2GB. */
71708 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
71709 	/* Page size is 4GB. */
71710 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
71711 	/* Page size is 8GB. */
71712 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
71713 	/* Page size is 16GB. */
71714 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
71715 	/* Page size is 32GB. */
71716 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
71717 	/* Page size is 64GB. */
71718 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
71719 	/* Page size is 128GB. */
71720 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
71721 	/* Page size is 256GB. */
71722 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
71723 	/* Page size is 512GB. */
71724 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
71725 	/* Page size is 1TB. */
71726 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
71727 	/* Page size is 2TB. */
71728 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
71729 	/* Page size is 4TB. */
71730 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
71731 	/* Page size is 8TB. */
71732 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
71733 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
71734 	/* Indicate the MR is ZBVA (Zero Base VA) */
71735 	#define SQ_FR_PMR_HDR_ZERO_BASED		UINT32_C(0x20)
71736 	/*
71737 	 * Local Key; 24 msb of the key are used to index the MRW
71738 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
71739 	 * the MRWC.
71740 	 */
71741 	uint32_t	l_key;
71742 	/* Length in bytes of registered MR */
71743 	uint8_t	length[5];
71744 	uint8_t	reserved8_1;
71745 	uint8_t	reserved8_2;
71746 	uint8_t	numlevels_pbl_page_size_log;
71747 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
71748 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71749 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_SFT	0
71750 	/* Page size is 4KB. */
71751 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71752 	/* Page size is 8KB. */
71753 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71754 	/* Page size is 16KB. */
71755 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71756 	/* Page size is 32KB. */
71757 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
71758 	/* Page size is 64KB. */
71759 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
71760 	/* Page size is 128KB. */
71761 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
71762 	/* Page size is 256KB. */
71763 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
71764 	/* Page size is 512KB. */
71765 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
71766 	/* Page size is 1MB. */
71767 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
71768 	/* Page size is 2MB. */
71769 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
71770 	/* Page size is 4MB. */
71771 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
71772 	/* Page size is 8MB. */
71773 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
71774 	/* Page size is 16MB. */
71775 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
71776 	/* Page size is 32MB. */
71777 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
71778 	/* Page size is 64MB. */
71779 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
71780 	/* Page size is 128MB. */
71781 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
71782 	/* Page size is 256MB. */
71783 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
71784 	/* Page size is 512MB. */
71785 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
71786 	/* Page size is 1GB. */
71787 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
71788 	/* Page size is 2GB. */
71789 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
71790 	/* Page size is 4GB. */
71791 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
71792 	/* Page size is 8GB. */
71793 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
71794 	/* Page size is 16GB. */
71795 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
71796 	/* Page size is 32GB. */
71797 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
71798 	/* Page size is 64GB. */
71799 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
71800 	/* Page size is 128GB. */
71801 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
71802 	/* Page size is 256GB. */
71803 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
71804 	/* Page size is 512GB. */
71805 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
71806 	/* Page size is 1TB. */
71807 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
71808 	/* Page size is 2TB. */
71809 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
71810 	/* Page size is 4TB. */
71811 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
71812 	/* Page size is 8TB. */
71813 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
71814 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
71815 	/* Number of levels of PBL for translation */
71816 	#define SQ_FR_PMR_HDR_NUMLEVELS_MASK		UINT32_C(0xc0)
71817 	#define SQ_FR_PMR_HDR_NUMLEVELS_SFT		6
71818 	/*
71819 	 * A zero level PBL means that the VA is the physical address used
71820 	 * for the operation.  No translation is done by the PTU.
71821 	 */
71822 		#define SQ_FR_PMR_HDR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
71823 	/*
71824 	 * A one layer translation is provided between the logical and
71825 	 * physical address.  The PBL points to a physical page that contains
71826 	 * PBE values that point to actual pg_size physical pages.
71827 	 */
71828 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
71829 	/*
71830 	 * A two layer translation is provided between the logical and
71831 	 * physical address. The PBL points to a physical page that contains
71832 	 * PDE values that in turn point to pbl_pg_size physical pages that contain
71833 	 * PBE values that point to actual physical pages.
71834 	 */
71835 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
71836 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAST		SQ_FR_PMR_HDR_NUMLEVELS_LAYER2
71837 	/* Pointer to the PBL, or PDL depending on number of levels */
71838 	uint64_t	pblptr;
71839 	/* Local Virtual Address */
71840 	uint64_t	va;
71841 } sq_fr_pmr_hdr_t, *psq_fr_pmr_hdr_t;
71842 
71843 /* FR-PPMR SQ WQE */
71844 /* sq_fr_ppmr (size:1024b/128B) */
71845 
71846 typedef struct sq_fr_ppmr {
71847 	/* This field defines the type of SQ WQE. */
71848 	uint8_t	wqe_type;
71849 	/*
71850 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
71851 	 *
71852 	 * Allowed only on reliable connection (RC) SQs.
71853 	 */
71854 	#define SQ_FR_PPMR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
71855 	#define SQ_FR_PPMR_WQE_TYPE_LAST   SQ_FR_PPMR_WQE_TYPE_FR_PPMR
71856 	uint8_t	flags;
71857 	/*
71858 	 * Set if completion signaling is requested. If this bit is
71859 	 * 0, and the SQ is configured to support Unsignaled
71860 	 * completion the controller should not generate a CQE
71861 	 * unless there was an error. This refers to CQE on the
71862 	 * sender side (se_flag refers to the receiver side)
71863 	 */
71864 	#define SQ_FR_PPMR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
71865 	/*
71866 	 * Indication to complete all previous RDMA Read or Atomic
71867 	 * WQEs on the SQ before executing this WQE
71868 	 */
71869 	#define SQ_FR_PPMR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
71870 	/*
71871 	 * Unconditional fence. Indication to complete all previous
71872 	 * SQ's WQEs before executing this WQE.
71873 	 */
71874 	#define SQ_FR_PPMR_FLAGS_UC_FENCE		UINT32_C(0x4)
71875 	/* Not Applicable for FR_PPMR. Nothing is sent */
71876 	#define SQ_FR_PPMR_FLAGS_SE			UINT32_C(0x8)
71877 	/* NA */
71878 	#define SQ_FR_PPMR_FLAGS_INLINE		UINT32_C(0x10)
71879 	/*
71880 	 * This flag is not applicable and should be 0 for a local memory
71881 	 * operation WQE.
71882 	 */
71883 	#define SQ_FR_PPMR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
71884 	/*
71885 	 * When set to '1', this operation will cause a trace capture in
71886 	 * each block it passes through.
71887 	 */
71888 	#define SQ_FR_PPMR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
71889 	/*
71890 	 * This is the new access control for the MR.  '1' means
71891 	 * the operation is allowed.  '0' means operation is
71892 	 * not allowed.
71893 	 */
71894 	uint8_t	access_cntl;
71895 	/* Local Write Access */
71896 	#define SQ_FR_PPMR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
71897 	/* Remote Read Access */
71898 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
71899 	/* Remote Write Access */
71900 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
71901 	/* Remote Atomic Access */
71902 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
71903 	/* Window Binding Allowed */
71904 	#define SQ_FR_PPMR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
71905 	uint8_t	zero_based_page_size_log;
71906 	/* Page size. 0 for 4KB page size, ... to 8TB. */
71907 	#define SQ_FR_PPMR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71908 	#define SQ_FR_PPMR_PAGE_SIZE_LOG_SFT	0
71909 	/* Page size is 4KB. */
71910 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71911 	/* Page size is 8KB. */
71912 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71913 	/* Page size is 16KB. */
71914 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71915 	/* Page size is 32KB. */
71916 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
71917 	/* Page size is 64KB. */
71918 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
71919 	/* Page size is 128KB. */
71920 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
71921 	/* Page size is 256KB. */
71922 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
71923 	/* Page size is 512KB. */
71924 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
71925 	/* Page size is 1MB. */
71926 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
71927 	/* Page size is 2MB. */
71928 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
71929 	/* Page size is 4MB. */
71930 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
71931 	/* Page size is 8MB. */
71932 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
71933 	/* Page size is 16MB. */
71934 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
71935 	/* Page size is 32MB. */
71936 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
71937 	/* Page size is 64MB. */
71938 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
71939 	/* Page size is 128MB. */
71940 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
71941 	/* Page size is 256MB. */
71942 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
71943 	/* Page size is 512MB. */
71944 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
71945 	/* Page size is 1GB. */
71946 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
71947 	/* Page size is 2GB. */
71948 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
71949 	/* Page size is 4GB. */
71950 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
71951 	/* Page size is 8GB. */
71952 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
71953 	/* Page size is 16GB. */
71954 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
71955 	/* Page size is 32GB. */
71956 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
71957 	/* Page size is 64GB. */
71958 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
71959 	/* Page size is 128GB. */
71960 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
71961 	/* Page size is 256GB. */
71962 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
71963 	/* Page size is 512GB. */
71964 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
71965 	/* Page size is 1TB. */
71966 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
71967 	/* Page size is 2TB. */
71968 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
71969 	/* Page size is 4TB. */
71970 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
71971 	/* Page size is 8TB. */
71972 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
71973 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T
71974 	/* Indicate the MR is ZBVA (Zero Base VA) */
71975 	#define SQ_FR_PPMR_ZERO_BASED		UINT32_C(0x20)
71976 	/*
71977 	 * Local Key; 24 msb of the key are used to index the MRW
71978 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
71979 	 * the MRWC.
71980 	 */
71981 	uint32_t	l_key;
71982 	/* Length in bytes of registered MR */
71983 	uint32_t	length;
71984 	/* Sets the proxy_vfid field of the physical memory region. */
71985 	uint16_t	proxy_vfid;
71986 	/* Sets the proxy_pfid field of the physical memory region. */
71987 	uint8_t	proxy_pfid;
71988 	uint8_t	numlevels_pbl_page_size_log;
71989 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
71990 	#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
71991 	#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_SFT	0
71992 	/* Page size is 4KB. */
71993 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
71994 	/* Page size is 8KB. */
71995 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
71996 	/* Page size is 16KB. */
71997 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
71998 	/* Page size is 32KB. */
71999 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
72000 	/* Page size is 64KB. */
72001 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
72002 	/* Page size is 128KB. */
72003 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
72004 	/* Page size is 256KB. */
72005 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
72006 	/* Page size is 512KB. */
72007 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
72008 	/* Page size is 1MB. */
72009 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
72010 	/* Page size is 2MB. */
72011 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
72012 	/* Page size is 4MB. */
72013 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
72014 	/* Page size is 8MB. */
72015 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
72016 	/* Page size is 16MB. */
72017 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
72018 	/* Page size is 32MB. */
72019 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
72020 	/* Page size is 64MB. */
72021 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
72022 	/* Page size is 128MB. */
72023 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
72024 	/* Page size is 256MB. */
72025 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
72026 	/* Page size is 512MB. */
72027 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
72028 	/* Page size is 1GB. */
72029 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
72030 	/* Page size is 2GB. */
72031 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
72032 	/* Page size is 4GB. */
72033 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
72034 	/* Page size is 8GB. */
72035 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
72036 	/* Page size is 16GB. */
72037 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
72038 	/* Page size is 32GB. */
72039 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
72040 	/* Page size is 64GB. */
72041 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
72042 	/* Page size is 128GB. */
72043 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
72044 	/* Page size is 256GB. */
72045 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
72046 	/* Page size is 512GB. */
72047 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
72048 	/* Page size is 1TB. */
72049 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
72050 	/* Page size is 2TB. */
72051 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
72052 	/* Page size is 4TB. */
72053 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
72054 	/* Page size is 8TB. */
72055 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
72056 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
72057 	/* Sets the proxy_vf_valid field of the physical memory region. */
72058 	#define SQ_FR_PPMR_PROXY_VF_VALID		UINT32_C(0x20)
72059 	/* Number of levels of PBL for translation */
72060 	#define SQ_FR_PPMR_NUMLEVELS_MASK		UINT32_C(0xc0)
72061 	#define SQ_FR_PPMR_NUMLEVELS_SFT		6
72062 	/*
72063 	 * A zero level PBL means that the VA is the physical address used
72064 	 * for the operation.  No translation is done by the PTU.
72065 	 */
72066 		#define SQ_FR_PPMR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
72067 	/*
72068 	 * A one layer translation is provided between the logical and
72069 	 * physical address.  The PBL points to a physical page that contains
72070 	 * PBE values that point to actual pg_size physical pages.
72071 	 */
72072 		#define SQ_FR_PPMR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
72073 	/*
72074 	 * A two layer translation is provided between the logical and
72075 	 * physical address. The PBL points to a physical page that contains
72076 	 * PDE values that in turn point to pbl_pg_size physical pages that contain
72077 	 * PBE values that point to actual physical pages.
72078 	 */
72079 		#define SQ_FR_PPMR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
72080 		#define SQ_FR_PPMR_NUMLEVELS_LAST		SQ_FR_PPMR_NUMLEVELS_LAYER2
72081 	/* Pointer to the PBL, or PDL depending on number of levels */
72082 	uint64_t	pblptr;
72083 	/* Local Virtual Address */
72084 	uint64_t	va;
72085 	/* The data field for FR-PPMR is not used. */
72086 	uint32_t	data[24];
72087 } sq_fr_ppmr_t, *psq_fr_ppmr_t;
72088 
72089 /* FR-PPMR SQ WQE header. */
72090 /* sq_fr_ppmr_hdr (size:256b/32B) */
72091 
72092 typedef struct sq_fr_ppmr_hdr {
72093 	/* This field defines the type of SQ WQE. */
72094 	uint8_t	wqe_type;
72095 	/*
72096 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
72097 	 *
72098 	 * Allowed only on reliable connection (RC) SQs.
72099 	 */
72100 	#define SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
72101 	#define SQ_FR_PPMR_HDR_WQE_TYPE_LAST   SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR
72102 	uint8_t	flags;
72103 	/*
72104 	 * Set if completion signaling is requested. If this bit is
72105 	 * 0, and the SQ is configured to support Unsignaled
72106 	 * completion the controller should not generate a CQE
72107 	 * unless there was an error. This refers to CQE on the
72108 	 * sender side (se_flag refers to the receiver side)
72109 	 */
72110 	#define SQ_FR_PPMR_HDR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
72111 	/*
72112 	 * Indication to complete all previous RDMA Read or Atomic
72113 	 * WQEs on the SQ before executing this WQE
72114 	 */
72115 	#define SQ_FR_PPMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
72116 	/*
72117 	 * Unconditional fence. Indication to complete all previous
72118 	 * SQ's WQEs before executing this WQE.
72119 	 */
72120 	#define SQ_FR_PPMR_HDR_FLAGS_UC_FENCE		UINT32_C(0x4)
72121 	/* Not Applicable for FR_PPMR. Nothing is sent */
72122 	#define SQ_FR_PPMR_HDR_FLAGS_SE			UINT32_C(0x8)
72123 	/* NA */
72124 	#define SQ_FR_PPMR_HDR_FLAGS_INLINE		UINT32_C(0x10)
72125 	/*
72126 	 * This flag is not applicable and should be 0 for a local memory
72127 	 * operation WQE.
72128 	 */
72129 	#define SQ_FR_PPMR_HDR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
72130 	/*
72131 	 * When set to '1', this operation will cause a trace capture in
72132 	 * each block it passes through.
72133 	 */
72134 	#define SQ_FR_PPMR_HDR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
72135 	/*
72136 	 * This is the new access control for the MR.  '1' means
72137 	 * the operation is allowed.  '0' means operation is
72138 	 * not allowed.
72139 	 */
72140 	uint8_t	access_cntl;
72141 	/* Local Write Access */
72142 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
72143 	/* Remote Read Access */
72144 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
72145 	/* Remote Write Access */
72146 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
72147 	/* Remote Atomic Access */
72148 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
72149 	/* Window Binding Allowed */
72150 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
72151 	uint8_t	zero_based_page_size_log;
72152 	/* Page size. 0 for 4KB page size, ... to 8TB. */
72153 	#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
72154 	#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_SFT	0
72155 	/* Page size is 4KB. */
72156 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
72157 	/* Page size is 8KB. */
72158 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
72159 	/* Page size is 16KB. */
72160 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
72161 	/* Page size is 32KB. */
72162 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
72163 	/* Page size is 64KB. */
72164 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
72165 	/* Page size is 128KB. */
72166 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
72167 	/* Page size is 256KB. */
72168 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
72169 	/* Page size is 512KB. */
72170 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
72171 	/* Page size is 1MB. */
72172 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
72173 	/* Page size is 2MB. */
72174 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
72175 	/* Page size is 4MB. */
72176 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
72177 	/* Page size is 8MB. */
72178 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
72179 	/* Page size is 16MB. */
72180 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
72181 	/* Page size is 32MB. */
72182 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
72183 	/* Page size is 64MB. */
72184 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
72185 	/* Page size is 128MB. */
72186 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
72187 	/* Page size is 256MB. */
72188 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
72189 	/* Page size is 512MB. */
72190 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
72191 	/* Page size is 1GB. */
72192 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
72193 	/* Page size is 2GB. */
72194 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
72195 	/* Page size is 4GB. */
72196 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
72197 	/* Page size is 8GB. */
72198 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
72199 	/* Page size is 16GB. */
72200 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
72201 	/* Page size is 32GB. */
72202 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
72203 	/* Page size is 64GB. */
72204 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
72205 	/* Page size is 128GB. */
72206 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
72207 	/* Page size is 256GB. */
72208 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
72209 	/* Page size is 512GB. */
72210 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
72211 	/* Page size is 1TB. */
72212 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
72213 	/* Page size is 2TB. */
72214 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
72215 	/* Page size is 4TB. */
72216 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
72217 	/* Page size is 8TB. */
72218 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
72219 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
72220 	/* Indicate the MR is ZBVA (Zero Base VA) */
72221 	#define SQ_FR_PPMR_HDR_ZERO_BASED		UINT32_C(0x20)
72222 	/*
72223 	 * Local Key; 24 msb of the key are used to index the MRW
72224 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
72225 	 * the MRWC.
72226 	 */
72227 	uint32_t	l_key;
72228 	/* Length in bytes of registered MR */
72229 	uint32_t	length;
72230 	/* Sets the proxy_vfid field of the physical memory region. */
72231 	uint16_t	proxy_vfid;
72232 	/* Sets the proxy_pfid field of the physical memory region. */
72233 	uint8_t	proxy_pfid;
72234 	uint8_t	numlevels_pbl_page_size_log;
72235 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
72236 	#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
72237 	#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_SFT	0
72238 	/* Page size is 4KB. */
72239 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
72240 	/* Page size is 8KB. */
72241 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
72242 	/* Page size is 16KB. */
72243 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
72244 	/* Page size is 32KB. */
72245 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
72246 	/* Page size is 64KB. */
72247 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
72248 	/* Page size is 128KB. */
72249 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
72250 	/* Page size is 256KB. */
72251 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
72252 	/* Page size is 512KB. */
72253 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
72254 	/* Page size is 1MB. */
72255 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
72256 	/* Page size is 2MB. */
72257 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
72258 	/* Page size is 4MB. */
72259 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
72260 	/* Page size is 8MB. */
72261 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
72262 	/* Page size is 16MB. */
72263 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
72264 	/* Page size is 32MB. */
72265 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
72266 	/* Page size is 64MB. */
72267 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
72268 	/* Page size is 128MB. */
72269 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
72270 	/* Page size is 256MB. */
72271 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
72272 	/* Page size is 512MB. */
72273 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
72274 	/* Page size is 1GB. */
72275 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
72276 	/* Page size is 2GB. */
72277 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
72278 	/* Page size is 4GB. */
72279 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
72280 	/* Page size is 8GB. */
72281 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
72282 	/* Page size is 16GB. */
72283 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
72284 	/* Page size is 32GB. */
72285 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
72286 	/* Page size is 64GB. */
72287 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
72288 	/* Page size is 128GB. */
72289 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
72290 	/* Page size is 256GB. */
72291 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
72292 	/* Page size is 512GB. */
72293 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
72294 	/* Page size is 1TB. */
72295 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
72296 	/* Page size is 2TB. */
72297 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
72298 	/* Page size is 4TB. */
72299 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
72300 	/* Page size is 8TB. */
72301 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
72302 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
72303 	/* Sets the proxy_vf_valid field of the physical memory region. */
72304 	#define SQ_FR_PPMR_HDR_PROXY_VF_VALID		UINT32_C(0x20)
72305 	/* Number of levels of PBL for translation */
72306 	#define SQ_FR_PPMR_HDR_NUMLEVELS_MASK		UINT32_C(0xc0)
72307 	#define SQ_FR_PPMR_HDR_NUMLEVELS_SFT		6
72308 	/*
72309 	 * A zero level PBL means that the VA is the physical address used
72310 	 * for the operation.  No translation is done by the PTU.
72311 	 */
72312 		#define SQ_FR_PPMR_HDR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
72313 	/*
72314 	 * A one layer translation is provided between the logical and
72315 	 * physical address.  The PBL points to a physical page that contains
72316 	 * PBE values that point to actual pg_size physical pages.
72317 	 */
72318 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
72319 	/*
72320 	 * A two layer translation is provided between the logical and
72321 	 * physical address. The PBL points to a physical page that contains
72322 	 * PDE values that in turn point to pbl_pg_size physical pages that contain
72323 	 * PBE values that point to actual physical pages.
72324 	 */
72325 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
72326 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAST		SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2
72327 	/* Pointer to the PBL, or PDL depending on number of levels */
72328 	uint64_t	pblptr;
72329 	/* Local Virtual Address */
72330 	uint64_t	va;
72331 } sq_fr_ppmr_hdr_t, *psq_fr_ppmr_hdr_t;
72332 
72333 /*
72334  * Bind SQ WQE. This WQE can perform either:
72335  * * type1 "bind memory window", if mw_type==Type1
72336  * * type2 "post send bind memory window", if mw_type==Type2
72337  */
72338 /* sq_bind (size:1024b/128B) */
72339 
72340 typedef struct sq_bind {
72341 	/* This field defines the type of SQ WQE. */
72342 	uint8_t	wqe_type;
72343 	/*
72344 	 * Memory Bind
72345 	 *
72346 	 * Allowed only on reliable connection (RC) SQs.
72347 	 */
72348 	#define SQ_BIND_WQE_TYPE_BIND UINT32_C(0xe)
72349 	#define SQ_BIND_WQE_TYPE_LAST SQ_BIND_WQE_TYPE_BIND
72350 	uint8_t	flags;
72351 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
72352 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
72353 	/*
72354 	 * Set if completion signaling is requested. If this bit is
72355 	 * 0, and the SQ is configured to support Unsignaled
72356 	 * completion the controller should not generate a CQE
72357 	 * unless there was an error. This refers to CQE on the
72358 	 * sender side (se_flag refers to the receiver side)
72359 	 */
72360 	#define SQ_BIND_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
72361 	/*
72362 	 * Indication to complete all previous RDMA Read or Atomic
72363 	 * WQEs on the SQ before executing this WQE
72364 	 */
72365 	#define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
72366 	/*
72367 	 * Unconditional fence. Indication to complete all previous
72368 	 * SQ's WQEs before executing this WQE.
72369 	 */
72370 	#define SQ_BIND_FLAGS_UC_FENCE								UINT32_C(0x4)
72371 	/* NA, nothing is sent. */
72372 	#define SQ_BIND_FLAGS_SE									UINT32_C(0x8)
72373 	/* NA */
72374 	#define SQ_BIND_FLAGS_INLINE								UINT32_C(0x10)
72375 	/*
72376 	 * This flag is not applicable and should be 0 for a local memory
72377 	 * operation WQE.
72378 	 */
72379 	#define SQ_BIND_FLAGS_WQE_TS_EN								UINT32_C(0x20)
72380 	/*
72381 	 * When set to '1', this operation will cause a trace capture in
72382 	 * each block it passes through.
72383 	 */
72384 	#define SQ_BIND_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
72385 	/*
72386 	 * This is the new access control for the MR.  '1' means
72387 	 * the operation is allowed.  '0' means operation is
72388 	 * not allowed.
72389 	 */
72390 	uint8_t	access_cntl;
72391 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK		UINT32_C(0xff)
72392 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT		0
72393 	/*
72394 	 * Local Write Access.
72395 	 *
72396 	 * Local accesses are never allowed for memory windows, so this
72397 	 * bit must always be zero in a bind WQE.  If this bit is ever
72398 	 * set, the bind will fail with an errored completion.
72399 	 */
72400 	#define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE									UINT32_C(0x1)
72401 	/* Remote Read Access */
72402 	#define SQ_BIND_ACCESS_CNTL_REMOTE_READ									UINT32_C(0x2)
72403 	/*
72404 	 * Remote Write Access.
72405 	 *
72406 	 * Note that, if this bit is set, then the parent region to which
72407 	 * the window is being bound must allow local writes.  If this is not
72408 	 * the case, then the bind will fail with an errored completion.
72409 	 */
72410 	#define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE									UINT32_C(0x4)
72411 	/*
72412 	 * Remote Atomic Access.
72413 	 *
72414 	 * Note that, if this bit is set, then the parent region to which
72415 	 * the window is being bound must allow local writes.  If this is not
72416 	 * the case, then the bind will fail with an errored completion.
72417 	 */
72418 	#define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC									UINT32_C(0x8)
72419 	/*
72420 	 * Window Binding Allowed.
72421 	 *
72422 	 * It is never allowed to bind windows to windows, so this bit
72423 	 * must always be zero in a bind WQE.  If this bit is ever set,
72424 	 * the bind will fail with an errored completion.
72425 	 */
72426 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND									UINT32_C(0x10)
72427 	/* reserved8_1 is 8 b */
72428 	uint8_t	reserved8_1;
72429 	uint8_t	mw_type_zero_based;
72430 	/*
72431 	 * If this bit is set, then the newly-bound memory window will be
72432 	 * zero-based.  If clear, then the newly-bound memory window will be
72433 	 * non-zero-based.
72434 	 */
72435 	#define SQ_BIND_ZERO_BASED	UINT32_C(0x1)
72436 	/*
72437 	 * If type1 is specified, then this WQE performs a "bind memory window"
72438 	 * operation on a type1 window.  If type2 is specified, then this WQE
72439 	 * performs a "post send bind memory window" operation on a type2
72440 	 * window.
72441 	 *
72442 	 * Note that the bind WQE cannot change the type of the memory window.
72443 	 *
72444 	 * If a "bind memory window" operation is attempted on a memory window
72445 	 * that was allocated as type2, then the bind will fail with an errored
72446 	 * completion, as "bind memory window" is allowed only on type1 memory
72447 	 * windows.
72448 	 *
72449 	 * Similarly, if a "post send bind memory window" operation is attempted
72450 	 * on a memory window that was allocated as type1, then the bind will fail
72451 	 * with an errored completions, as "post send bind memory window" is allowed
72452 	 * only on type2 memory windows.
72453 	 */
72454 	#define SQ_BIND_MW_TYPE	UINT32_C(0x2)
72455 	/* Type 1 Bind Memory Window */
72456 		#define SQ_BIND_MW_TYPE_TYPE1	(UINT32_C(0x0) << 1)
72457 	/* Type 2 Post Send Bind Memory Window */
72458 		#define SQ_BIND_MW_TYPE_TYPE2	(UINT32_C(0x1) << 1)
72459 		#define SQ_BIND_MW_TYPE_LAST	SQ_BIND_MW_TYPE_TYPE2
72460 	uint8_t	reserved8_2;
72461 	uint16_t	reserved16;
72462 	/*
72463 	 * The L_Key of the parent MR; 24 msb of the key are used to
72464 	 * index the MRW table, 8 lsb are compared with the 8 bit key
72465 	 * in the MRWC.
72466 	 */
72467 	uint32_t	parent_l_key;
72468 	/*
72469 	 * Local Key; 24 msb of the key are used to index the memory
72470 	 * window being bound in the MRW table, 8 lsb are assign to the
72471 	 * 8 bit key_lsb field in the MRWC.
72472 	 */
72473 	uint32_t	l_key;
72474 	/* Local Virtual Address */
72475 	uint64_t	va;
72476 	/*
72477 	 * Length in bytes of registered MW; 40 bits as this is the max
72478 	 * size of an MR/W
72479 	 */
72480 	uint8_t	length[5];
72481 	uint8_t	reserved24[3];
72482 	/* The data field for Bind is not used. */
72483 	uint32_t	data[24];
72484 } sq_bind_t, *psq_bind_t;
72485 
72486 /*
72487  * Bind SQ WQE header. This WQE can perform either:
72488  * * type1 "bind memory window", if mw_type==Type1
72489  * * type2 "post send bind memory window", if mw_type==Type2
72490  */
72491 /* sq_bind_hdr (size:256b/32B) */
72492 
72493 typedef struct sq_bind_hdr {
72494 	/* This field defines the type of SQ WQE. */
72495 	uint8_t	wqe_type;
72496 	/*
72497 	 * Memory Bind
72498 	 *
72499 	 * Allowed only on reliable connection (RC) SQs.
72500 	 */
72501 	#define SQ_BIND_HDR_WQE_TYPE_BIND UINT32_C(0xe)
72502 	#define SQ_BIND_HDR_WQE_TYPE_LAST SQ_BIND_HDR_WQE_TYPE_BIND
72503 	uint8_t	flags;
72504 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
72505 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
72506 	/*
72507 	 * Set if completion signaling is requested. If this bit is
72508 	 * 0, and the SQ is configured to support Unsignaled
72509 	 * completion the controller should not generate a CQE
72510 	 * unless there was an error. This refers to CQE on the
72511 	 * sender side (se_flag refers to the receiver side)
72512 	 */
72513 	#define SQ_BIND_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
72514 	/*
72515 	 * Indication to complete all previous RDMA Read or Atomic
72516 	 * WQEs on the SQ before executing this WQE
72517 	 */
72518 	#define SQ_BIND_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
72519 	/*
72520 	 * Unconditional fence. Indication to complete all previous
72521 	 * SQ's WQEs before executing this WQE.
72522 	 */
72523 	#define SQ_BIND_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
72524 	/* NA, nothing is sent. */
72525 	#define SQ_BIND_HDR_FLAGS_SE									UINT32_C(0x8)
72526 	/* NA */
72527 	#define SQ_BIND_HDR_FLAGS_INLINE								UINT32_C(0x10)
72528 	/*
72529 	 * This flag is not applicable and should be 0 for a local memory
72530 	 * operation WQE.
72531 	 */
72532 	#define SQ_BIND_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
72533 	/*
72534 	 * When set to '1', this operation will cause a trace capture in
72535 	 * each block it passes through.
72536 	 */
72537 	#define SQ_BIND_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
72538 	/*
72539 	 * This is the new access control for the MR.  '1' means
72540 	 * the operation is allowed.  '0' means operation is
72541 	 * not allowed.
72542 	 */
72543 	uint8_t	access_cntl;
72544 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK		UINT32_C(0xff)
72545 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT		0
72546 	/*
72547 	 * Local Write Access.
72548 	 *
72549 	 * Local accesses are never allowed for memory windows, so this
72550 	 * bit must always be zero in a bind WQE.  If this bit is ever
72551 	 * set, the bind will fail with an errored completion.
72552 	 */
72553 	#define SQ_BIND_HDR_ACCESS_CNTL_LOCAL_WRITE									UINT32_C(0x1)
72554 	/* Remote Read Access */
72555 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_READ									UINT32_C(0x2)
72556 	/*
72557 	 * Remote Write Access.
72558 	 *
72559 	 * Note that, if this bit is set, then the parent region to which
72560 	 * the window is being bound must allow local writes.  If this is not
72561 	 * the case, then the bind will fail with an errored completion.
72562 	 */
72563 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_WRITE									UINT32_C(0x4)
72564 	/*
72565 	 * Remote Atomic Access.
72566 	 *
72567 	 * Note that, if this bit is set, then the parent region to which
72568 	 * the window is being bound must allow local writes.  If this is not
72569 	 * the case, then the bind will fail with an errored completion.
72570 	 */
72571 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_ATOMIC									UINT32_C(0x8)
72572 	/*
72573 	 * Window Binding Allowed.
72574 	 *
72575 	 * It is never allowed to bind windows to windows, so this bit
72576 	 * must always be zero in a bind WQE.  If this bit is ever set,
72577 	 * the bind will fail with an errored completion.
72578 	 */
72579 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND									UINT32_C(0x10)
72580 	/* reserved8_1 is 8 b */
72581 	uint8_t	reserved8_1;
72582 	uint8_t	mw_type_zero_based;
72583 	/*
72584 	 * If this bit is set, then the newly-bound memory window will be
72585 	 * zero-based.  If clear, then the newly-bound memory window will be
72586 	 * non-zero-based.
72587 	 */
72588 	#define SQ_BIND_HDR_ZERO_BASED	UINT32_C(0x1)
72589 	/*
72590 	 * If type1 is specified, then this WQE performs a "bind memory window"
72591 	 * operation on a type1 window.  If type2 is specified, then this WQE
72592 	 * performs a "post send bind memory window" operation on a type2
72593 	 * window.
72594 	 *
72595 	 * Note that the bind WQE cannot change the type of the memory window.
72596 	 *
72597 	 * If a "bind memory window" operation is attempted on a memory window
72598 	 * that was allocated as type2, then the bind will fail with an errored
72599 	 * completion, as "bind memory window" is allowed only on type1 memory
72600 	 * windows.
72601 	 *
72602 	 * Similarly, if a "post send bind memory window" operation is attempted
72603 	 * on a memory window that was allocated as type1, then the bind will fail
72604 	 * with an errored completions, as "post send bind memory window" is allowed
72605 	 * only on type2 memory windows.
72606 	 */
72607 	#define SQ_BIND_HDR_MW_TYPE	UINT32_C(0x2)
72608 	/* Type 1 Bind Memory Window */
72609 		#define SQ_BIND_HDR_MW_TYPE_TYPE1	(UINT32_C(0x0) << 1)
72610 	/* Type 2 Post Send Bind Memory Window */
72611 		#define SQ_BIND_HDR_MW_TYPE_TYPE2	(UINT32_C(0x1) << 1)
72612 		#define SQ_BIND_HDR_MW_TYPE_LAST	SQ_BIND_HDR_MW_TYPE_TYPE2
72613 	uint8_t	reserved8_2;
72614 	uint16_t	reserved16;
72615 	/*
72616 	 * The L_Key of the parent MR; 24 msb of the key are used to
72617 	 * index the MRW table, 8 lsb are compared with the 8 bit key
72618 	 * in the MRWC.
72619 	 */
72620 	uint32_t	parent_l_key;
72621 	/*
72622 	 * Local Key; 24 msb of the key are used to index the memory
72623 	 * window being bound in the MRW table, 8 lsb are assign to the
72624 	 * 8 bit key_lsb field in the MRWC.
72625 	 */
72626 	uint32_t	l_key;
72627 	/* Local Virtual Address */
72628 	uint64_t	va;
72629 	/*
72630 	 * Length in bytes of registered MW; 40 bits as this is the max
72631 	 * size of an MR/W
72632 	 */
72633 	uint8_t	length[5];
72634 	uint8_t	reserved24[3];
72635 } sq_bind_hdr_t, *psq_bind_hdr_t;
72636 
72637 /* RQ/SRQ WQE */
72638 /* rq_wqe (size:1024b/128B) */
72639 
72640 typedef struct rq_wqe {
72641 	/* wqe_type is 8 b */
72642 	uint8_t	wqe_type;
72643 	/*
72644 	 * RQ/SRQ WQE.   This WQE is used for posting buffers on
72645 	 * an RQ or SRQ.
72646 	 */
72647 	#define RQ_WQE_WQE_TYPE_RCV UINT32_C(0x80)
72648 	#define RQ_WQE_WQE_TYPE_LAST RQ_WQE_WQE_TYPE_RCV
72649 	/* No flags supported for this WQE type. */
72650 	uint8_t	flags;
72651 	/*
72652 	 * Specify the total number 16B chunks that make up the valid
72653 	 * portion of the WQE.  This includes the first chunk that is the
72654 	 * WQE structure and up to 6 SGE structures.
72655 	 *
72656 	 * While the valid area is defined by the wqe_size field, the
72657 	 * actual WQE size is fixed at 128B.
72658 	 */
72659 	uint8_t	wqe_size;
72660 	uint8_t	reserved8;
72661 	uint32_t	reserved32;
72662 	uint64_t	wr_id;
72663 	/*
72664 	 * Opaque value used by upper layer SW to identify the id of the
72665 	 * WR which generated the WQE. Used in CQE. Valid in the first
72666 	 * SGE of an SRQ WQE.
72667 	 */
72668 	#define RQ_WQE_WR_ID_MASK UINT32_C(0xfffff)
72669 	#define RQ_WQE_WR_ID_SFT 0
72670 	uint8_t	reserved128[16];
72671 	/*
72672 	 * The data field for RQ WQE is filled with from 1 to 6 SGE
72673 	 * structures as defined by the wqe_size field.
72674 	 */
72675 	uint32_t	data[24];
72676 } rq_wqe_t, *prq_wqe_t;
72677 
72678 /* RQ/SRQ WQE header. */
72679 /* rq_wqe_hdr (size:256b/32B) */
72680 
72681 typedef struct rq_wqe_hdr {
72682 	/* wqe_type is 8 b */
72683 	uint8_t	wqe_type;
72684 	/*
72685 	 * RQ/SRQ WQE.   This WQE is used for posting buffers on
72686 	 * an RQ or SRQ.
72687 	 */
72688 	#define RQ_WQE_HDR_WQE_TYPE_RCV UINT32_C(0x80)
72689 	#define RQ_WQE_HDR_WQE_TYPE_LAST RQ_WQE_HDR_WQE_TYPE_RCV
72690 	/* No flags supported for this WQE type. */
72691 	uint8_t	flags;
72692 	/*
72693 	 * Specify the total number 16B chunks that make up the valid
72694 	 * portion of the WQE.  This includes the first chunk that is the
72695 	 * WQE structure and up to 6 SGE structures.
72696 	 *
72697 	 * While the valid area is defined by the wqe_size field, the
72698 	 * actual WQE size is fixed at 128B.
72699 	 */
72700 	uint8_t	wqe_size;
72701 	uint8_t	reserved8;
72702 	uint32_t	reserved32;
72703 	uint64_t	wr_id;
72704 	/*
72705 	 * Opaque value used by upper layer SW to identify the id of the
72706 	 * WR which generated the WQE. Used in CQE. Valid in the first
72707 	 * SGE of an SRQ WQE.
72708 	 */
72709 	#define RQ_WQE_HDR_WR_ID_MASK UINT32_C(0xfffff)
72710 	#define RQ_WQE_HDR_WR_ID_SFT 0
72711 	uint8_t	reserved128[16];
72712 } rq_wqe_hdr_t, *prq_wqe_hdr_t;
72713 
72714 /* cq_base (size:256b/32B) */
72715 
72716 typedef struct cq_base {
72717 	uint64_t	reserved64_1;
72718 	uint64_t	reserved64_2;
72719 	uint64_t	reserved64_3;
72720 	uint8_t	cqe_type_toggle;
72721 	/*
72722 	 * Indicate valid completion - written by the chip. Cumulus
72723 	 * toggle this bit each time it finished consuming all PBL
72724 	 * entries
72725 	 */
72726 	#define CQ_BASE_TOGGLE		UINT32_C(0x1)
72727 	/* This field defines the type of SQ WQE. */
72728 	#define CQ_BASE_CQE_TYPE_MASK	UINT32_C(0x1e)
72729 	#define CQ_BASE_CQE_TYPE_SFT	1
72730 	/*
72731 	 * Requester completion - This is used for both RC and UD SQ
72732 	 * completions.
72733 	 */
72734 		#define CQ_BASE_CQE_TYPE_REQ		(UINT32_C(0x0) << 1)
72735 	/*
72736 	 * Responder RC Completion - This is used for both RQ and SRQ
72737 	 * completions for RC service QPs.
72738 	 */
72739 		#define CQ_BASE_CQE_TYPE_RES_RC	(UINT32_C(0x1) << 1)
72740 	/*
72741 	 * Responder UD Completion - This is used for both RQ and SRQ
72742 	 * completion for UD service QPs.
72743 	 */
72744 		#define CQ_BASE_CQE_TYPE_RES_UD	(UINT32_C(0x2) << 1)
72745 	/*
72746 	 * Responder RawEth and QP1 Completion - This is used for RQ
72747 	 * completion for RawEth service and QP1 service QPs.
72748 	 */
72749 		#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1  (UINT32_C(0x3) << 1)
72750 	/*
72751 	 * Responder UD completion with CFA. This is used for both RQ
72752 	 * and SQ completion for UD service QPs. It includes cfa fields
72753 	 * (some of which carry VLAN information), in place of QP handle.
72754 	 */
72755 		#define CQ_BASE_CQE_TYPE_RES_UD_CFA	(UINT32_C(0x4) << 1)
72756 	/*
72757 	 * NO_OP completion - This is used to indicate that no
72758 	 * operation completion.
72759 	 */
72760 		#define CQ_BASE_CQE_TYPE_NO_OP	(UINT32_C(0xd) << 1)
72761 	/*
72762 	 * Terminal completion - This is used to indicate that no
72763 	 * further completions will be made for this QP on this CQ.
72764 	 */
72765 		#define CQ_BASE_CQE_TYPE_TERMINAL	(UINT32_C(0xe) << 1)
72766 	/* Cut off CQE; for CQ resize see CQ and SRQ Resize */
72767 		#define CQ_BASE_CQE_TYPE_CUT_OFF	(UINT32_C(0xf) << 1)
72768 		#define CQ_BASE_CQE_TYPE_LAST	CQ_BASE_CQE_TYPE_CUT_OFF
72769 	/* This field indicates the status for the CQE. */
72770 	uint8_t	status;
72771 	uint16_t	reserved16;
72772 	uint32_t	reserved32;
72773 } cq_base_t, *pcq_base_t;
72774 
72775 /* Requester CQ CQE */
72776 /* cq_req (size:256b/32B) */
72777 
72778 typedef struct cq_req {
72779 	/*
72780 	 * This is an application level ID used to identify the
72781 	 * QP and its SQ and RQ.
72782 	 */
72783 	uint64_t	qp_handle;
72784 	/*
72785 	 * SQ Consumer Index - points to the entry just past the last WQE
72786 	 * that has been completed by the chip.  Wraps around at
72787 	 * QPC.sq_size (i.e. the valid range of the SQ Consumer Index is 0
72788 	 * to (QPC.sq_size - 1)).
72789 	 */
72790 	uint16_t	sq_cons_idx;
72791 	uint16_t	reserved16_1;
72792 	uint32_t	reserved32_2;
72793 	uint64_t	reserved64;
72794 	uint8_t	cqe_type_toggle;
72795 	/*
72796 	 * Indicate valid completion - written by the chip. Cumulus
72797 	 * toggle this bit each time it finished consuming all PBL
72798 	 * entries
72799 	 */
72800 	#define CQ_REQ_TOGGLE	UINT32_C(0x1)
72801 	/* This field defines the type of SQ WQE. */
72802 	#define CQ_REQ_CQE_TYPE_MASK UINT32_C(0x1e)
72803 	#define CQ_REQ_CQE_TYPE_SFT 1
72804 	/*
72805 	 * Requester completion - This is used for both RC and UD SQ
72806 	 * completions.
72807 	 */
72808 		#define CQ_REQ_CQE_TYPE_REQ   (UINT32_C(0x0) << 1)
72809 		#define CQ_REQ_CQE_TYPE_LAST CQ_REQ_CQE_TYPE_REQ
72810 	/*
72811 	 * When this bit is '1', it indicates that the packet completed
72812 	 * was transmitted using the push accelerated data provided by
72813 	 * the driver. When this bit is '0', it indicates that the packet
72814 	 * had not push acceleration data written or was executed as a
72815 	 * normal packet even though push data was provided.
72816 	 * This field is intended to be used for driver-generated push
72817 	 * statistics. It is not applicable for RC since not all RC packets
72818 	 * return a CQE.
72819 	 */
72820 	#define CQ_REQ_PUSH	UINT32_C(0x20)
72821 	/* This field indicates the status for the CQE. */
72822 	uint8_t	status;
72823 	/* OK is 0 */
72824 	#define CQ_REQ_STATUS_OK			UINT32_C(0x0)
72825 	/* BAD_RESPONSE_ERR is 1 */
72826 	#define CQ_REQ_STATUS_BAD_RESPONSE_ERR	UINT32_C(0x1)
72827 	/* LOCAL_LENGTH_ERR is 2 */
72828 	#define CQ_REQ_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
72829 	/* LOCAL_QP_OPERATION_ERR is 3 */
72830 	#define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x3)
72831 	/* LOCAL_PROTECTION_ERR is 4 */
72832 	#define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x4)
72833 	/* MEMORY_MGT_OPERATION_ERR is 5 */
72834 	#define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x5)
72835 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
72836 	#define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
72837 	/* REMOTE_ACCESS_ERR is 7 */
72838 	#define CQ_REQ_STATUS_REMOTE_ACCESS_ERR	UINT32_C(0x7)
72839 	/* REMOTE_OPERATION_ERR is 8 */
72840 	#define CQ_REQ_STATUS_REMOTE_OPERATION_ERR	UINT32_C(0x8)
72841 	/* RNR_NAK_RETRY_CNT_ERR is 9 */
72842 	#define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR	UINT32_C(0x9)
72843 	/* TRANSPORT_RETRY_CNT_ERR is 10 */
72844 	#define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR	UINT32_C(0xa)
72845 	/* WORK_REQUEST_FLUSHED_ERR is 11 */
72846 	#define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0xb)
72847 	#define CQ_REQ_STATUS_LAST			CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR
72848 	uint16_t	reserved16_2;
72849 	uint32_t	reserved32_1;
72850 } cq_req_t, *pcq_req_t;
72851 
72852 /* Responder RC CQE */
72853 /* cq_res_rc (size:256b/32B) */
72854 
72855 typedef struct cq_res_rc {
72856 	/*
72857 	 * The length of the message's payload in bytes, stored in
72858 	 * the SGEs
72859 	 */
72860 	uint32_t	length;
72861 	/*
72862 	 * Immediate data in case the imm_flag set, R_Key to be
72863 	 * invalidated in case inv_flag is set.
72864 	 */
72865 	uint32_t	imm_data_or_inv_r_key;
72866 	/*
72867 	 * This is an application level ID used to identify the
72868 	 * QP and its SQ and RQ.
72869 	 */
72870 	uint64_t	qp_handle;
72871 	/*
72872 	 * Opaque value - valid when inv_flag is set. Used by driver
72873 	 * to reference the buffer used to store PBL when the MR was
72874 	 * fast registered. The driver can reclaim this buffer after
72875 	 * an MR was remotely invalidated. The controller take that
72876 	 * value from the MR referenced by R_Key
72877 	 */
72878 	uint64_t	mr_handle;
72879 	uint8_t	cqe_type_toggle;
72880 	/*
72881 	 * Indicate valid completion - written by the chip. Cumulus
72882 	 * toggle this bit each time it finished consuming all PBL
72883 	 * entries
72884 	 */
72885 	#define CQ_RES_RC_TOGGLE	UINT32_C(0x1)
72886 	/* This field defines the type of SQ WQE. */
72887 	#define CQ_RES_RC_CQE_TYPE_MASK  UINT32_C(0x1e)
72888 	#define CQ_RES_RC_CQE_TYPE_SFT   1
72889 	/*
72890 	 * Responder RC Completion - This is used for both RQ and SRQ
72891 	 * completions for RC service QPs.
72892 	 */
72893 		#define CQ_RES_RC_CQE_TYPE_RES_RC  (UINT32_C(0x1) << 1)
72894 		#define CQ_RES_RC_CQE_TYPE_LAST   CQ_RES_RC_CQE_TYPE_RES_RC
72895 	/* This field indicates the status for the CQE. */
72896 	uint8_t	status;
72897 	/* OK is 0 */
72898 	#define CQ_RES_RC_STATUS_OK			UINT32_C(0x0)
72899 	/* LOCAL_ACCESS_ERROR is 1 */
72900 	#define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
72901 	/* LOCAL_LENGTH_ERR is 2 */
72902 	#define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
72903 	/* LOCAL_PROTECTION_ERR is 3 */
72904 	#define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
72905 	/* LOCAL_QP_OPERATION_ERR is 4 */
72906 	#define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
72907 	/* MEMORY_MGT_OPERATION_ERR is 5 */
72908 	#define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x5)
72909 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
72910 	#define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
72911 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
72912 	#define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0x7)
72913 	/* HW_FLUSH_ERR is 8 */
72914 	#define CQ_RES_RC_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
72915 	#define CQ_RES_RC_STATUS_LAST			CQ_RES_RC_STATUS_HW_FLUSH_ERR
72916 	uint16_t	flags;
72917 	/*
72918 	 * This flag indicates that the completion is for a SRQ entry
72919 	 * rather than for an RQ entry.
72920 	 */
72921 	#define CQ_RES_RC_FLAGS_SRQ		UINT32_C(0x1)
72922 	/* CQE relates to RQ WQE. */
72923 		#define CQ_RES_RC_FLAGS_SRQ_RQ	UINT32_C(0x0)
72924 	/* CQE relates to SRQ WQE. */
72925 		#define CQ_RES_RC_FLAGS_SRQ_SRQ	UINT32_C(0x1)
72926 		#define CQ_RES_RC_FLAGS_SRQ_LAST	CQ_RES_RC_FLAGS_SRQ_SRQ
72927 	/* Immediate data indicator */
72928 	#define CQ_RES_RC_FLAGS_IMM		UINT32_C(0x2)
72929 	/* R_Key invalidate indicator */
72930 	#define CQ_RES_RC_FLAGS_INV		UINT32_C(0x4)
72931 	#define CQ_RES_RC_FLAGS_RDMA	UINT32_C(0x8)
72932 	/* CQE relates to an incoming Send request */
72933 		#define CQ_RES_RC_FLAGS_RDMA_SEND	(UINT32_C(0x0) << 3)
72934 	/* CQE relates to incoming RDMA Write request */
72935 		#define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE  (UINT32_C(0x1) << 3)
72936 		#define CQ_RES_RC_FLAGS_RDMA_LAST	CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
72937 	uint32_t	srq_or_rq_wr_id;
72938 	/*
72939 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
72940 	 * reference the WQE in order to claim the received data
72941 	 * and reuse the WQE space
72942 	 */
72943 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
72944 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
72945 } cq_res_rc_t, *pcq_res_rc_t;
72946 
72947 /* Responder UD CQE */
72948 /* cq_res_ud (size:256b/32B) */
72949 
72950 typedef struct cq_res_ud {
72951 	uint16_t	length;
72952 	/*
72953 	 * The length of the message's payload in bytes, stored in
72954 	 * the SGEs
72955 	 */
72956 	#define CQ_RES_UD_LENGTH_MASK UINT32_C(0x3fff)
72957 	#define CQ_RES_UD_LENGTH_SFT 0
72958 	/*
72959 	 * This is data from the CFA or VNIC block as indicated by the
72960 	 * ext_meta_format and meta_format fields.
72961 	 */
72962 	uint16_t	cfa_metadata;
72963 	/* When meta_format=1, this value is the VLAN VID. */
72964 	#define CQ_RES_UD_CFA_METADATA_VID_MASK UINT32_C(0xfff)
72965 	#define CQ_RES_UD_CFA_METADATA_VID_SFT 0
72966 	/* When meta_format=1, this value is the VLAN DE. */
72967 	#define CQ_RES_UD_CFA_METADATA_DE	UINT32_C(0x1000)
72968 	/* When meta_format=1, this value is the VLAN PRI. */
72969 	#define CQ_RES_UD_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
72970 	#define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
72971 	/* Immediate data in case the imm_flag set. */
72972 	uint32_t	imm_data;
72973 	/*
72974 	 * This is an application level ID used to identify the
72975 	 * QP and its SQ and RQ.
72976 	 */
72977 	uint64_t	qp_handle;
72978 	/*
72979 	 * Source MAC address for the UD message placed in the WQE
72980 	 * that is completed by this CQE.
72981 	 */
72982 	uint16_t	src_mac[3];
72983 	/* Lower 16b of the Source QP value from the DETH header. */
72984 	uint16_t	src_qp_low;
72985 	uint8_t	cqe_type_toggle;
72986 	/*
72987 	 * Indicate valid completion - written by the chip. Cumulus
72988 	 * toggle this bit each time it finished consuming all PBL
72989 	 * entries
72990 	 */
72991 	#define CQ_RES_UD_TOGGLE	UINT32_C(0x1)
72992 	/* This field defines the type of SQ WQE. */
72993 	#define CQ_RES_UD_CQE_TYPE_MASK  UINT32_C(0x1e)
72994 	#define CQ_RES_UD_CQE_TYPE_SFT   1
72995 	/*
72996 	 * Responder UD Completion - This is used for both RQ and SRQ
72997 	 * completion for UD service QPs.
72998 	 */
72999 		#define CQ_RES_UD_CQE_TYPE_RES_UD  (UINT32_C(0x2) << 1)
73000 		#define CQ_RES_UD_CQE_TYPE_LAST   CQ_RES_UD_CQE_TYPE_RES_UD
73001 	/* This field indicates the status for the CQE. */
73002 	uint8_t	status;
73003 	/*
73004 	 * This indicates that the completion is without error.
73005 	 * All fields are valid.
73006 	 */
73007 	#define CQ_RES_UD_STATUS_OK			UINT32_C(0x0)
73008 	/*
73009 	 * This indicates that write access was not allowed for
73010 	 * at least one of the SGEs in the WQE.
73011 	 *
73012 	 * This is a fatal error.  Only the srq_or_rq_wr_id is field
73013 	 * is valid.
73014 	 */
73015 	#define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
73016 	/*
73017 	 * This indicates that the packet was too long for the WQE
73018 	 * provided on the SRQ/RQ.
73019 	 *
73020 	 * This is not a fatal error.  All the fields are valid.
73021 	 */
73022 	#define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
73023 	/* LOCAL_PROTECTION_ERR is 3 */
73024 	#define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
73025 	/* LOCAL_QP_OPERATION_ERR is 4 */
73026 	#define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
73027 	/* MEMORY_MGT_OPERATION_ERR is 5 */
73028 	#define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
73029 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
73030 	#define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
73031 	/* HW_FLUSH_ERR is 8 */
73032 	#define CQ_RES_UD_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
73033 	#define CQ_RES_UD_STATUS_LAST			CQ_RES_UD_STATUS_HW_FLUSH_ERR
73034 	uint16_t	flags;
73035 	/*
73036 	 * This flag indicates that the completion is for a SRQ entry
73037 	 * rather than for an RQ entry.
73038 	 */
73039 	#define CQ_RES_UD_FLAGS_SRQ		UINT32_C(0x1)
73040 	/* CQE relates to RQ WQE. */
73041 		#define CQ_RES_UD_FLAGS_SRQ_RQ		UINT32_C(0x0)
73042 	/* CQE relates to SRQ WQE. */
73043 		#define CQ_RES_UD_FLAGS_SRQ_SRQ		UINT32_C(0x1)
73044 		#define CQ_RES_UD_FLAGS_SRQ_LAST		CQ_RES_UD_FLAGS_SRQ_SRQ
73045 	/* Immediate data indicator */
73046 	#define CQ_RES_UD_FLAGS_IMM		UINT32_C(0x2)
73047 	#define CQ_RES_UD_FLAGS_UNUSED_MASK	UINT32_C(0xc)
73048 	#define CQ_RES_UD_FLAGS_UNUSED_SFT		2
73049 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
73050 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT	4
73051 	/* RoCEv1 Message */
73052 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
73053 	/* RoCEv2 IPv4 Message */
73054 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
73055 	/* RoCEv2 IPv6 Message */
73056 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
73057 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
73058 	/*
73059 	 * The combination of this value and ext_meta_format indicates
73060 	 * what format the metadata field is.
73061 	 */
73062 	#define CQ_RES_UD_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
73063 	#define CQ_RES_UD_FLAGS_META_FORMAT_SFT	6
73064 	/* No metadata information.  Value is zero. */
73065 		#define CQ_RES_UD_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
73066 	/*
73067 	 * The metadata field contains the VLAN tag and TPID value.
73068 	 * - metadata[11:0] contains the vlan VID value.
73069 	 * - metadata[12] contains the vlan DE value.
73070 	 * - metadata[15:13] contains the vlan PRI value.
73071 	 */
73072 		#define CQ_RES_UD_FLAGS_META_FORMAT_VLAN	(UINT32_C(0x1) << 6)
73073 	/*
73074 	 * If ext_meta_format is equal to 1, the metadata field
73075 	 * contains the lower 16b of the tunnel ID value, justified
73076 	 * to LSB
73077 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
73078 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
73079 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
73080 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
73081 	 * - IPV4 = 0 (not populated)
73082 	 * - IPV6 = Flow Label[19:0]
73083 	 * - PPPoE = sessionID[15:0]
73084 	 * - MPLs = Outer label[19:0]
73085 	 * - UPAR = Selected[31:0] with bit mask
73086 	 */
73087 		#define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID   (UINT32_C(0x2) << 6)
73088 	/*
73089 	 * if ext_meta_format is equal to 1, metadata field contains
73090 	 * 16b metadata from the prepended header (chdr_data).
73091 	 */
73092 		#define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA   (UINT32_C(0x3) << 6)
73093 	/*
73094 	 * If ext_meta_format is equal to 1, the metadata field contains
73095 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
73096 	 * - metadata[8:0] contains the outer_l3_offset.
73097 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
73098 	 */
73099 		#define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET  (UINT32_C(0x4) << 6)
73100 		#define CQ_RES_UD_FLAGS_META_FORMAT_LAST	CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
73101 	/*
73102 	 * The combination of this value and meta_format indicates what
73103 	 * format the metadata field is
73104 	 */
73105 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK  UINT32_C(0xc00)
73106 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT   10
73107 	uint32_t	src_qp_high_srq_or_rq_wr_id;
73108 	/*
73109 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
73110 	 * reference the WQE in order to claim the received data
73111 	 * and reuse the WQE space
73112 	 */
73113 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
73114 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
73115 	/* Upper 8b of the Source QP value from the DETH header. */
73116 	#define CQ_RES_UD_SRC_QP_HIGH_MASK	UINT32_C(0xff000000)
73117 	#define CQ_RES_UD_SRC_QP_HIGH_SFT	24
73118 } cq_res_ud_t, *pcq_res_ud_t;
73119 
73120 /* Responder UD CQE version 2 */
73121 /* cq_res_ud_v2 (size:256b/32B) */
73122 
73123 typedef struct cq_res_ud_v2 {
73124 	uint16_t	length;
73125 	/*
73126 	 * The length of the message's payload in bytes, stored in
73127 	 * the SGEs
73128 	 */
73129 	#define CQ_RES_UD_V2_LENGTH_MASK UINT32_C(0x3fff)
73130 	#define CQ_RES_UD_V2_LENGTH_SFT 0
73131 	/* This is data from the CFA as indicated by the meta_format field. */
73132 	uint16_t	cfa_metadata0;
73133 	/* When meta_format=1, this value is the VLAN VID. */
73134 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
73135 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_SFT 0
73136 	/* When meta_format=1, this value is the VLAN DE. */
73137 	#define CQ_RES_UD_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
73138 	/* When meta_format=1, this value is the VLAN PRI. */
73139 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
73140 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_SFT 13
73141 	/* Immediate data in case the imm_flag set. */
73142 	uint32_t	imm_data;
73143 	/*
73144 	 * This is an application level ID used to identify the
73145 	 * QP and its SQ and RQ.
73146 	 */
73147 	uint64_t	qp_handle;
73148 	/*
73149 	 * Source MAC address for the UD message placed in the WQE
73150 	 * that is completed by this CQE.
73151 	 */
73152 	uint16_t	src_mac[3];
73153 	/* Lower 16b of the Source QP value from the DETH header. */
73154 	uint16_t	src_qp_low;
73155 	uint8_t	cqe_type_toggle;
73156 	/*
73157 	 * Indicate valid completion - written by the chip. Cumulus
73158 	 * toggle this bit each time it finished consuming all PBL
73159 	 * entries
73160 	 */
73161 	#define CQ_RES_UD_V2_TOGGLE	UINT32_C(0x1)
73162 	/* This field defines the type of SQ WQE. */
73163 	#define CQ_RES_UD_V2_CQE_TYPE_MASK  UINT32_C(0x1e)
73164 	#define CQ_RES_UD_V2_CQE_TYPE_SFT   1
73165 	/*
73166 	 * Responder UD Completion - This is used for both RQ and SRQ
73167 	 * completion for UD service QPs.
73168 	 */
73169 		#define CQ_RES_UD_V2_CQE_TYPE_RES_UD  (UINT32_C(0x2) << 1)
73170 		#define CQ_RES_UD_V2_CQE_TYPE_LAST   CQ_RES_UD_V2_CQE_TYPE_RES_UD
73171 	/* This field indicates the status for the CQE. */
73172 	uint8_t	status;
73173 	/*
73174 	 * This indicates that the completion is without error.
73175 	 * All fields are valid.
73176 	 */
73177 	#define CQ_RES_UD_V2_STATUS_OK			UINT32_C(0x0)
73178 	/*
73179 	 * This indicates that write access was not allowed for
73180 	 * at least one of the SGEs in the WQE.
73181 	 *
73182 	 * This is a fatal error.  Only the srq_or_rq_wr_id is field
73183 	 * is valid.
73184 	 */
73185 	#define CQ_RES_UD_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
73186 	/*
73187 	 * This indicates that the packet was too long for the WQE
73188 	 * provided on the SRQ/RQ.
73189 	 *
73190 	 * This is not a fatal error.  All the fields are valid.
73191 	 */
73192 	#define CQ_RES_UD_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
73193 	/* LOCAL_PROTECTION_ERR is 3 */
73194 	#define CQ_RES_UD_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
73195 	/* LOCAL_QP_OPERATION_ERR is 4 */
73196 	#define CQ_RES_UD_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
73197 	/* MEMORY_MGT_OPERATION_ERR is 5 */
73198 	#define CQ_RES_UD_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
73199 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
73200 	#define CQ_RES_UD_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
73201 	/* HW_FLUSH_ERR is 8 */
73202 	#define CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
73203 	#define CQ_RES_UD_V2_STATUS_LAST			CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR
73204 	uint16_t	flags;
73205 	/*
73206 	 * This flag indicates that the completion is for a SRQ entry
73207 	 * rather than for an RQ entry.
73208 	 */
73209 	#define CQ_RES_UD_V2_FLAGS_SRQ			UINT32_C(0x1)
73210 	/* CQE relates to RQ WQE. */
73211 		#define CQ_RES_UD_V2_FLAGS_SRQ_RQ		UINT32_C(0x0)
73212 	/* CQE relates to SRQ WQE. */
73213 		#define CQ_RES_UD_V2_FLAGS_SRQ_SRQ		UINT32_C(0x1)
73214 		#define CQ_RES_UD_V2_FLAGS_SRQ_LAST		CQ_RES_UD_V2_FLAGS_SRQ_SRQ
73215 	/* Immediate data indicator */
73216 	#define CQ_RES_UD_V2_FLAGS_IMM			UINT32_C(0x2)
73217 	#define CQ_RES_UD_V2_FLAGS_UNUSED_MASK		UINT32_C(0xc)
73218 	#define CQ_RES_UD_V2_FLAGS_UNUSED_SFT		2
73219 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
73220 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_SFT	4
73221 	/* RoCEv1 Message */
73222 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
73223 	/* RoCEv2 IPv4 Message */
73224 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
73225 	/* RoCEv2 IPv6 Message */
73226 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
73227 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6
73228 	/* The field indicates what format the metadata field is. */
73229 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
73230 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_SFT	6
73231 	/* No metadata information.  Value is zero. */
73232 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
73233 	/*
73234 	 * The {metadata1, metadata0} fields contain the vtag
73235 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
73236 	 * de, vid[11:0]} The metadata2 field contains the table scope
73237 	 * and action record pointer. - metadata2[25:0] contains the
73238 	 * action record pointer. - metadata2[31:26] contains the table
73239 	 * scope.
73240 	 */
73241 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (UINT32_C(0x1) << 6)
73242 	/*
73243 	 * The {metadata1, metadata0} fields contain the vtag
73244 	 * information:
73245 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
73246 	 * The metadata2 field contains the Tunnel ID
73247 	 * value, justified to LSB. i
73248 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
73249 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
73250 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
73251 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
73252 	 * - IPv4 = 0 (not populated)
73253 	 * - IPv6 = Flow Label[19:0]
73254 	 * - PPPoE = sessionID[15:0]
73255 	 * - MPLs = Outer label[19:0]
73256 	 * - UPAR = Selected[31:0] with bit mask
73257 	 */
73258 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 6)
73259 	/*
73260 	 * The {metadata1, metadata0} fields contain the vtag
73261 	 * information:
73262 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
73263 	 * The metadata2 field contains the 32b metadata from the
73264 	 * prepended header (chdr_data).
73265 	 */
73266 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 6)
73267 	/*
73268 	 * If ext_meta_format is equal to 1, the metadata field contains
73269 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
73270 	 * - metadata[8:0] contains the outer_l3_offset.
73271 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
73272 	 */
73273 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET   (UINT32_C(0x4) << 6)
73274 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_LAST	CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET
73275 	uint32_t	src_qp_high_srq_or_rq_wr_id;
73276 	/*
73277 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
73278 	 * reference the WQE in order to claim the received data
73279 	 * and reuse the WQE space
73280 	 */
73281 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
73282 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_SFT		0
73283 	#define CQ_RES_UD_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
73284 	#define CQ_RES_UD_V2_CFA_METADATA1_SFT		20
73285 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
73286 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
73287 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_SFT	20
73288 	/* 0x88a8 */
73289 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
73290 	/* 0x8100 */
73291 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
73292 	/* 0x9100 */
73293 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
73294 	/* 0x9200 */
73295 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
73296 	/* 0x9300 */
73297 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
73298 	/* Value programmed in CFA VLANTPID register. */
73299 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
73300 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
73301 	/* When meta_format != 0, this value is the VLAN valid. */
73302 	#define CQ_RES_UD_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
73303 	/* Upper 8b of the Source QP value from the DETH header. */
73304 	#define CQ_RES_UD_V2_SRC_QP_HIGH_MASK		UINT32_C(0xff000000)
73305 	#define CQ_RES_UD_V2_SRC_QP_HIGH_SFT		24
73306 } cq_res_ud_v2_t, *pcq_res_ud_v2_t;
73307 
73308 /* Responder UD with CFA CQE */
73309 /* cq_res_ud_cfa (size:256b/32B) */
73310 
73311 typedef struct cq_res_ud_cfa {
73312 	uint16_t	length;
73313 	/*
73314 	 * The length of the message's payload in bytes, stored in
73315 	 * the SGEs
73316 	 */
73317 	#define CQ_RES_UD_CFA_LENGTH_MASK UINT32_C(0x3fff)
73318 	#define CQ_RES_UD_CFA_LENGTH_SFT 0
73319 	/*
73320 	 * This field identifies the CFA action rule that was used
73321 	 * for this packet.
73322 	 */
73323 	uint16_t	cfa_code;
73324 	/* Immediate data in case the imm_flag set. */
73325 	uint32_t	imm_data;
73326 	uint32_t	qid;
73327 	/*
73328 	 * This value indicates the QPID associated with this operation.
73329 	 * The driver will use the qid from thie CQE to map a QP handle
73330 	 * in the completion record returned to the application.
73331 	 */
73332 	#define CQ_RES_UD_CFA_QID_MASK UINT32_C(0xfffff)
73333 	#define CQ_RES_UD_CFA_QID_SFT 0
73334 	/*
73335 	 * This is data from the CFA or VNIC block as indicated by the
73336 	 * ext_meta_format and meta_format fields.
73337 	 */
73338 	uint32_t	cfa_metadata;
73339 	/* When meta_format=1, this value is the VLAN VID. */
73340 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_MASK UINT32_C(0xfff)
73341 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_SFT  0
73342 	/* When meta_format=1, this value is the VLAN DE. */
73343 	#define CQ_RES_UD_CFA_CFA_METADATA_DE	UINT32_C(0x1000)
73344 	/* When meta_format=1, this value is the VLAN PRI. */
73345 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
73346 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_SFT  13
73347 	/* When meta_format=1, this value is the VLAN TPID. */
73348 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_MASK UINT32_C(0xffff0000)
73349 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_SFT 16
73350 	/*
73351 	 * Source MAC address for the UD message placed in the WQE
73352 	 * that is completed by this CQE.
73353 	 */
73354 	uint16_t	src_mac[3];
73355 	/* Lower 16b of the Source QP value from the DETH header. */
73356 	uint16_t	src_qp_low;
73357 	uint8_t	cqe_type_toggle;
73358 	/*
73359 	 * Indicate valid completion - written by the chip. Cumulus
73360 	 * toggle this bit each time it finished consuming all PBL
73361 	 * entries
73362 	 */
73363 	#define CQ_RES_UD_CFA_TOGGLE		UINT32_C(0x1)
73364 	/* This field defines the type of SQ WQE. */
73365 	#define CQ_RES_UD_CFA_CQE_TYPE_MASK	UINT32_C(0x1e)
73366 	#define CQ_RES_UD_CFA_CQE_TYPE_SFT	1
73367 	/*
73368 	 * Responder UD Completion with CFA - This is used for both RQ
73369 	 * and SRQ completion for UD service QPs. It includes cfa fields
73370 	 * (some of which carry VLAN information), in place of the QP
73371 	 * handle. It is also used for QP1 QPs that are treated as UD.
73372 	 */
73373 		#define CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA  (UINT32_C(0x4) << 1)
73374 		#define CQ_RES_UD_CFA_CQE_TYPE_LAST	CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA
73375 	/* This field indicates the status for the CQE. */
73376 	uint8_t	status;
73377 	/*
73378 	 * This indicates that the completion is without error.
73379 	 * All fields are valid.
73380 	 */
73381 	#define CQ_RES_UD_CFA_STATUS_OK			UINT32_C(0x0)
73382 	/*
73383 	 * This indicates that write access was not allowed for
73384 	 * at least one of the SGEs in the WQE.
73385 	 *
73386 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
73387 	 * is valid.
73388 	 */
73389 	#define CQ_RES_UD_CFA_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
73390 	/*
73391 	 * This indicates that the packet was too long for the WQE
73392 	 * provided on the SRQ/RQ.
73393 	 *
73394 	 * This is not a fatal error. All the fields are valid.
73395 	 */
73396 	#define CQ_RES_UD_CFA_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
73397 	/* LOCAL_PROTECTION_ERR is 3 */
73398 	#define CQ_RES_UD_CFA_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
73399 	/* LOCAL_QP_OPERATION_ERR is 4 */
73400 	#define CQ_RES_UD_CFA_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
73401 	/* MEMORY_MGT_OPERATION_ERR is 5 */
73402 	#define CQ_RES_UD_CFA_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
73403 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
73404 	#define CQ_RES_UD_CFA_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
73405 	/* HW_FLUSH_ERR is 8 */
73406 	#define CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
73407 	#define CQ_RES_UD_CFA_STATUS_LAST			CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR
73408 	uint16_t	flags;
73409 	/*
73410 	 * This flag indicates that the completion is for a SRQ entry
73411 	 * rather than for an RQ entry.
73412 	 */
73413 	#define CQ_RES_UD_CFA_FLAGS_SRQ		UINT32_C(0x1)
73414 	/* CQE relates to RQ WQE. */
73415 		#define CQ_RES_UD_CFA_FLAGS_SRQ_RQ		UINT32_C(0x0)
73416 	/* CQE relates to SRQ WQE. */
73417 		#define CQ_RES_UD_CFA_FLAGS_SRQ_SRQ		UINT32_C(0x1)
73418 		#define CQ_RES_UD_CFA_FLAGS_SRQ_LAST		CQ_RES_UD_CFA_FLAGS_SRQ_SRQ
73419 	/* Immediate data indicator */
73420 	#define CQ_RES_UD_CFA_FLAGS_IMM		UINT32_C(0x2)
73421 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_MASK	UINT32_C(0xc)
73422 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_SFT		2
73423 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
73424 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_SFT	4
73425 	/* RoCEv1 Message */
73426 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
73427 	/* RoCEv2 IPv4 Message */
73428 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
73429 	/* RoCEv2 IPv6 Message */
73430 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
73431 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6
73432 	/*
73433 	 * The combination of this value and ext_meta_format indicates
73434 	 * what format the metadata field is.
73435 	 */
73436 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
73437 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_SFT	6
73438 	/*
73439 	 * If ext_meta_format is equal to 0, there is no metadata
73440 	 * information. Value is zero.
73441 	 */
73442 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
73443 	/*
73444 	 * If ext_meta_format is equal to 0, the metadata field contains
73445 	 * the VLAN tag and TPID value.
73446 	 * - metadata[11:0] contains the vlan VID value.
73447 	 * - metadata[12] contains the vlan DE value.
73448 	 * - metadata[15:13] contains the vlan PRI value.
73449 	 * - metadata[31:16] contains the vlan TPID value.
73450 	 */
73451 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_VLAN	(UINT32_C(0x1) << 6)
73452 	/*
73453 	 * If ext_meta_format is equal to 1, the metadata field contains
73454 	 * the Tunnel ID value, justified to LSB.
73455 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
73456 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier
73457 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
73458 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
73459 	 * - IPV4 = 0 (not populated)
73460 	 * - IPV6 = Flow Label[19:0]
73461 	 * - PPPoE = sessionID[15:0]
73462 	 * - MPLs = Outer label[19:0]
73463 	 * - UPAR = Selected[31:0] with bit mask
73464 	 */
73465 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_TUNNEL_ID   (UINT32_C(0x2) << 6)
73466 	/*
73467 	 * if ext_meta_format is equal to 1, metadata field contains
73468 	 * 16b metadata from the prepended header (chdr_data).
73469 	 */
73470 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_CHDR_DATA   (UINT32_C(0x3) << 6)
73471 	/*
73472 	 * If ext_meta_format is equal to 1, the metadata field contains
73473 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset, and
73474 	 * inner_l4_size.
73475 	 * - metadata[8:0] contains the outer_l3_offset.
73476 	 * - metadata[17:9] contains the inner_l2_offset.
73477 	 * - metadata[26:18] contains the inner_l3_offset.
73478 	 * - metadata[31:27] contains the inner_l4_size.
73479 	 */
73480 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET  (UINT32_C(0x4) << 6)
73481 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET
73482 	/*
73483 	 * The combination of this value and meta_format indicates what
73484 	 * format the metadata field is
73485 	 */
73486 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_MASK  UINT32_C(0xc00)
73487 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_SFT   10
73488 	uint32_t	src_qp_high_srq_or_rq_wr_id;
73489 	/*
73490 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
73491 	 * reference the WQE in order to claim the received data
73492 	 * and reuse the WQE space
73493 	 */
73494 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
73495 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_SFT 0
73496 	/* Upper 8b of the Source QP value from the DETH header. */
73497 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_MASK	UINT32_C(0xff000000)
73498 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_SFT	24
73499 } cq_res_ud_cfa_t, *pcq_res_ud_cfa_t;
73500 
73501 /* Responder UD with CFA CQE version 2 */
73502 /* cq_res_ud_cfa_v2 (size:256b/32B) */
73503 
73504 typedef struct cq_res_ud_cfa_v2 {
73505 	uint16_t	length;
73506 	/*
73507 	 * The length of the message's payload in bytes, stored in
73508 	 * the SGEs
73509 	 */
73510 	#define CQ_RES_UD_CFA_V2_LENGTH_MASK UINT32_C(0x3fff)
73511 	#define CQ_RES_UD_CFA_V2_LENGTH_SFT 0
73512 	/* This is data from the CFA as indicated by the meta_format field. */
73513 	uint16_t	cfa_metadata0;
73514 	/* When meta_format=1, this value is the VLAN VID. */
73515 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
73516 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_SFT 0
73517 	/* When meta_format=1, this value is the VLAN DE. */
73518 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
73519 	/* When meta_format=1, this value is the VLAN PRI. */
73520 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
73521 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_SFT 13
73522 	/* Immediate data in case the imm_flag set. */
73523 	uint32_t	imm_data;
73524 	uint32_t	qid;
73525 	/*
73526 	 * This value indicates the QPID associated with this operation.
73527 	 * The driver will use the qid from thie CQE to map a QP handle
73528 	 * in the completion record returned to the application.
73529 	 */
73530 	#define CQ_RES_UD_CFA_V2_QID_MASK UINT32_C(0xfffff)
73531 	#define CQ_RES_UD_CFA_V2_QID_SFT 0
73532 	/*
73533 	 * This is data from the CFA block as indicated by the meta_format
73534 	 * field.
73535 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
73536 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
73537 	 *   act_rec_ptr[25:0]}
73538 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
73539 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
73540 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
73541 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
73542 	 * of the host address from the first BD used to place the packet.
73543 	 */
73544 	uint32_t	cfa_metadata2;
73545 	/*
73546 	 * Source MAC address for the UD message placed in the WQE
73547 	 * that is completed by this CQE.
73548 	 */
73549 	uint16_t	src_mac[3];
73550 	/* Lower 16b of the Source QP value from the DETH header. */
73551 	uint16_t	src_qp_low;
73552 	uint8_t	cqe_type_toggle;
73553 	/*
73554 	 * Indicate valid completion - written by the chip. Cumulus
73555 	 * toggle this bit each time it finished consuming all PBL
73556 	 * entries
73557 	 */
73558 	#define CQ_RES_UD_CFA_V2_TOGGLE		UINT32_C(0x1)
73559 	/* This field defines the type of SQ WQE. */
73560 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_MASK	UINT32_C(0x1e)
73561 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_SFT	1
73562 	/*
73563 	 * Responder UD Completion with CFA - This is used for both RQ
73564 	 * and SRQ completion for UD service QPs. It includes cfa fields
73565 	 * (some of which carry VLAN information), in place of the QP
73566 	 * handle. It is also used for QP1 QPs that are treated as UD.
73567 	 */
73568 		#define CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA  (UINT32_C(0x4) << 1)
73569 		#define CQ_RES_UD_CFA_V2_CQE_TYPE_LAST	CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA
73570 	/* This field indicates the status for the CQE. */
73571 	uint8_t	status;
73572 	/*
73573 	 * This indicates that the completion is without error.
73574 	 * All fields are valid.
73575 	 */
73576 	#define CQ_RES_UD_CFA_V2_STATUS_OK			UINT32_C(0x0)
73577 	/*
73578 	 * This indicates that write access was not allowed for
73579 	 * at least one of the SGEs in the WQE.
73580 	 *
73581 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
73582 	 * is valid.
73583 	 */
73584 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
73585 	/*
73586 	 * This indicates that the packet was too long for the WQE
73587 	 * provided on the SRQ/RQ.
73588 	 *
73589 	 * This is not a fatal error. All the fields are valid.
73590 	 */
73591 	#define CQ_RES_UD_CFA_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
73592 	/* LOCAL_PROTECTION_ERR is 3 */
73593 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
73594 	/* LOCAL_QP_OPERATION_ERR is 4 */
73595 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
73596 	/* MEMORY_MGT_OPERATION_ERR is 5 */
73597 	#define CQ_RES_UD_CFA_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
73598 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
73599 	#define CQ_RES_UD_CFA_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
73600 	/* HW_FLUSH_ERR is 8 */
73601 	#define CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
73602 	#define CQ_RES_UD_CFA_V2_STATUS_LAST			CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR
73603 	uint16_t	flags;
73604 	/*
73605 	 * This flag indicates that the completion is for a SRQ entry
73606 	 * rather than for an RQ entry.
73607 	 */
73608 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ			UINT32_C(0x1)
73609 	/* CQE relates to RQ WQE. */
73610 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_RQ		UINT32_C(0x0)
73611 	/* CQE relates to SRQ WQE. */
73612 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ		UINT32_C(0x1)
73613 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_LAST		CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ
73614 	/* Immediate data indicator */
73615 	#define CQ_RES_UD_CFA_V2_FLAGS_IMM			UINT32_C(0x2)
73616 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_MASK		UINT32_C(0xc)
73617 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_SFT		2
73618 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
73619 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_SFT	4
73620 	/* RoCEv1 Message */
73621 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
73622 	/* RoCEv2 IPv4 Message */
73623 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
73624 	/* RoCEv2 IPv6 Message */
73625 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
73626 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6
73627 	/* The field indicates what format the metadata field is. */
73628 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
73629 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_SFT	6
73630 	/* No metadata information.  Value is zero. */
73631 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
73632 	/*
73633 	 * The {metadata1, metadata0} fields contain the vtag
73634 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
73635 	 * de, vid[11:0]} The metadata2 field contains the table scope
73636 	 * and action record pointer. - metadata2[25:0] contains the
73637 	 * action record pointer. - metadata2[31:26] contains the table
73638 	 * scope.
73639 	 */
73640 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (UINT32_C(0x1) << 6)
73641 	/*
73642 	 * The {metadata1, metadata0} fields contain the vtag
73643 	 * information:
73644 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
73645 	 * The metadata2 field contains the Tunnel ID
73646 	 * value, justified to LSB. i
73647 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
73648 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
73649 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
73650 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
73651 	 * - IPv4 = 0 (not populated)
73652 	 * - IPv6 = Flow Label[19:0]
73653 	 * - PPPoE = sessionID[15:0]
73654 	 * - MPLs = Outer label[19:0]
73655 	 * - UPAR = Selected[31:0] with bit mask
73656 	 */
73657 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 6)
73658 	/*
73659 	 * The {metadata1, metadata0} fields contain the vtag
73660 	 * information:
73661 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
73662 	 * The metadata2 field contains the 32b metadata from the
73663 	 * prepended header (chdr_data).
73664 	 */
73665 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 6)
73666 	/*
73667 	 * If ext_meta_format is equal to 1, the metadata field contains
73668 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
73669 	 * - metadata[8:0] contains the outer_l3_offset.
73670 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
73671 	 */
73672 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET   (UINT32_C(0x4) << 6)
73673 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET
73674 	uint32_t	src_qp_high_srq_or_rq_wr_id;
73675 	/*
73676 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
73677 	 * reference the WQE in order to claim the received data
73678 	 * and reuse the WQE space
73679 	 */
73680 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
73681 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_SFT		0
73682 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
73683 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_SFT		20
73684 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
73685 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
73686 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_SFT	20
73687 	/* 0x88a8 */
73688 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
73689 	/* 0x8100 */
73690 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
73691 	/* 0x9100 */
73692 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
73693 	/* 0x9200 */
73694 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
73695 	/* 0x9300 */
73696 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
73697 	/* Value programmed in CFA VLANTPID register. */
73698 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
73699 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
73700 	/* When meta_format != 0, this value is the VLAN valid. */
73701 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
73702 	/* Upper 8b of the Source QP value from the DETH header. */
73703 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_MASK		UINT32_C(0xff000000)
73704 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_SFT		24
73705 } cq_res_ud_cfa_v2_t, *pcq_res_ud_cfa_v2_t;
73706 
73707 /* Responder RawEth and QP1 CQE */
73708 /* cq_res_raweth_qp1 (size:256b/32B) */
73709 
73710 typedef struct cq_res_raweth_qp1 {
73711 	uint16_t	length;
73712 	/*
73713 	 * The length of the message's payload in bytes, stored in
73714 	 * the SGEs
73715 	 */
73716 	#define CQ_RES_RAWETH_QP1_LENGTH_MASK UINT32_C(0x3fff)
73717 	#define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
73718 	uint16_t	raweth_qp1_flags;
73719 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK		UINT32_C(0x3ff)
73720 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT		0
73721 	/*
73722 	 * When this bit is '1', it indicates a packet that has an
73723 	 * error of some type.  Type of error is indicated in
73724 	 * raweth_qp1_errors.
73725 	 */
73726 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR		UINT32_C(0x1)
73727 	/*
73728 	 * This value indicates what the inner packet determined for the
73729 	 * packet was.
73730 	 */
73731 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK		UINT32_C(0x3c0)
73732 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT		6
73733 	/*
73734 	 * Not Known:
73735 	 * Indicates that the packet type was not known.
73736 	 */
73737 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 6)
73738 	/*
73739 	 * IP Packet:
73740 	 * Indicates that the packet was an IP packet, but further
73741 	 * classification was not possible.
73742 	 */
73743 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 6)
73744 	/*
73745 	 * TCP Packet:
73746 	 * Indicates that the packet was IP and TCP.
73747 	 * This indicates that the raweth_qp1_payload_offset field is valid.
73748 	 */
73749 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 6)
73750 	/*
73751 	 * UDP Packet:
73752 	 * Indicates that the packet was IP and UDP.
73753 	 * This indicates that the raweth_qp1_payload_offset field is valid.
73754 	 */
73755 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 6)
73756 	/*
73757 	 * FCoE Packet:
73758 	 * Indicates that the packet was recognized as a FCoE.
73759 	 * This also indicates that the raweth_qp1_payload_offset field is valid.
73760 	 */
73761 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 6)
73762 	/*
73763 	 * RoCE Packet:
73764 	 * Indicates that the packet was recognized as a RoCE.
73765 	 * This also indicates that the raweth_qp1_payload_offset field is valid.
73766 	 */
73767 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 6)
73768 	/*
73769 	 * ICMP Packet:
73770 	 * Indicates that the packet was recognized as ICMP.
73771 	 * This indicates that the raweth_qp1_payload_offset field is valid.
73772 	 */
73773 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 6)
73774 	/*
73775 	 * PtP packet wo/timestamp:
73776 	 * Indicates that the packet was recognized as a PtP
73777 	 * packet.
73778 	 */
73779 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 6)
73780 	/*
73781 	 * PtP packet w/timestamp:
73782 	 * Indicates that the packet was recognized as a PtP
73783 	 * packet and that a timestamp was taken for the packet.
73784 	 */
73785 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 6)
73786 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
73787 	uint16_t	raweth_qp1_errors;
73788 	/*
73789 	 * This indicates that there was an error in the IP header
73790 	 * checksum.
73791 	 */
73792 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
73793 	/*
73794 	 * This indicates that there was an error in the TCP, UDP
73795 	 * or ICMP checksum.
73796 	 */
73797 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
73798 	/*
73799 	 * This indicates that there was an error in the tunnel
73800 	 * IP header checksum.
73801 	 */
73802 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
73803 	/*
73804 	 * This indicates that there was an error in the tunnel
73805 	 * UDP checksum.
73806 	 */
73807 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
73808 	/*
73809 	 * This indicates that there was a CRC error on either an FCoE
73810 	 * or RoCE packet.  The itype indicates the packet type.
73811 	 */
73812 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR			UINT32_C(0x100)
73813 	/*
73814 	 * This indicates that there was an error in the tunnel
73815 	 * portion of the packet when this
73816 	 * field is non-zero.
73817 	 */
73818 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
73819 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT		9
73820 	/*
73821 	 * No additional error occurred on the tunnel portion
73822 	 * of the packet of the packet does not have a tunnel.
73823 	 */
73824 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
73825 	/*
73826 	 * Indicates that IP header version does not match
73827 	 * expectation from L2 Ethertype for IPv4 and IPv6
73828 	 * in the tunnel header.
73829 	 */
73830 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
73831 	/*
73832 	 * Indicates that header length is out of range in the
73833 	 * tunnel header. Valid for
73834 	 * IPv4.
73835 	 */
73836 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
73837 	/*
73838 	 * Indicates that the physical packet is shorter than that
73839 	 * claimed by the PPPoE header length for a tunnel PPPoE
73840 	 * packet.
73841 	 */
73842 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
73843 	/*
73844 	 * Indicates that physical packet is shorter than that claimed
73845 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
73846 	 * tunnel packet packets.
73847 	 */
73848 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
73849 	/*
73850 	 * Indicates that the physical packet is shorter than that
73851 	 * claimed by the tunnel UDP header length for a tunnel
73852 	 * UDP packet that is not fragmented.
73853 	 */
73854 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
73855 	/*
73856 	 * indicates that the IPv4 TTL or IPv6 hop limit check
73857 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
73858 	 * for IPv4, and IPv6.
73859 	 */
73860 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
73861 		#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
73862 	/*
73863 	 * This indicates that there was an error in the inner
73864 	 * portion of the packet when this
73865 	 * field is non-zero.
73866 	 */
73867 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
73868 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT			12
73869 	/*
73870 	 * No additional error occurred on the tunnel portion
73871 	 * of the packet of the packet does not have a tunnel.
73872 	 */
73873 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
73874 	/*
73875 	 * Indicates that IP header version does not match
73876 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
73877 	 * option other than VFT was parsed on
73878 	 * FCoE packet.
73879 	 */
73880 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
73881 	/*
73882 	 * indicates that header length is out of range. Valid for
73883 	 * IPv4 and RoCE
73884 	 */
73885 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
73886 	/*
73887 	 * indicates that the IPv4 TTL or IPv6 hop limit check
73888 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
73889 	 */
73890 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
73891 	/*
73892 	 * Indicates that physical packet is shorter than that
73893 	 * claimed by the l3 header length. Valid for IPv4,
73894 	 * IPv6 packet or RoCE packets.
73895 	 */
73896 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
73897 	/*
73898 	 * Indicates that the physical packet is shorter than that
73899 	 * claimed by the UDP header length for a UDP packet that is
73900 	 * not fragmented.
73901 	 */
73902 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
73903 	/*
73904 	 * Indicates that TCP header length > IP payload. Valid for
73905 	 * TCP packets only.
73906 	 */
73907 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
73908 	/* Indicates that TCP header length < 5. Valid for TCP. */
73909 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL  (UINT32_C(0x7) << 12)
73910 	/*
73911 	 * Indicates that TCP option headers result in a TCP header
73912 	 * size that does not match data offset in TCP header. Valid
73913 	 * for TCP.
73914 	 */
73915 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
73916 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST			CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
73917 	/*
73918 	 * This field identifies the CFA action rule that was used for this
73919 	 * packet.
73920 	 */
73921 	uint16_t	raweth_qp1_cfa_code;
73922 	/*
73923 	 * This is an application level ID used to identify the
73924 	 * QP and its SQ and RQ.
73925 	 */
73926 	uint64_t	qp_handle;
73927 	uint32_t	raweth_qp1_flags2;
73928 	/*
73929 	 * This indicates that the ip checksum was calculated for the
73930 	 * inner packet and that the ip_cs_error field indicates if there
73931 	 * was an error.
73932 	 */
73933 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
73934 	/*
73935 	 * This indicates that the TCP, UDP or ICMP checksum was
73936 	 * calculated for the inner packet and that the l4_cs_error field
73937 	 * indicates if there was an error.
73938 	 */
73939 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
73940 	/*
73941 	 * This indicates that the ip checksum was calculated for the
73942 	 * tunnel header and that the t_ip_cs_error field indicates if there
73943 	 * was an error.
73944 	 */
73945 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
73946 	/*
73947 	 * This indicates that the UDP checksum was
73948 	 * calculated for the tunnel packet and that the t_l4_cs_error field
73949 	 * indicates if there was an error.
73950 	 */
73951 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
73952 	/* This value indicates what format the raweth_qp1_metadata field is. */
73953 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
73954 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT		4
73955 	/* No metadata information.  Value is zero. */
73956 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
73957 	/*
73958 	 * The raweth_qp1_metadata field contains the VLAN tag and TPID value.
73959 	 * - raweth_qp1_metadata[11:0] contains the vlan VID value.
73960 	 * - raweth_qp1_metadata[12] contains the vlan DE value.
73961 	 * - raweth_qp1_metadata[15:13] contains the vlan PRI value.
73962 	 * - raweth_qp1_metadata[31:16] contains the vlan TPID value.
73963 	 */
73964 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
73965 	/*
73966 	 * If ext_meta_format is equal to 1, the metadata field
73967 	 * contains the lower 16b of the tunnel ID value, justified
73968 	 * to LSB
73969 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
73970 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
73971 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
73972 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
73973 	 * - IPV4 = 0 (not populated)
73974 	 * - IPV6 = Flow Label[19:0]
73975 	 * - PPPoE = sessionID[15:0]
73976 	 * - MPLs = Outer label[19:0]
73977 	 * - UPAR = Selected[31:0] with bit mask
73978 	 */
73979 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
73980 	/*
73981 	 * if ext_meta_format is equal to 1, metadata field contains
73982 	 * 16b metadata from the prepended header (chdr_data).
73983 	 */
73984 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
73985 	/*
73986 	 * If ext_meta_format is equal to 1, the metadata field contains
73987 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
73988 	 * - metadata[8:0] contains the outer_l3_offset.
73989 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
73990 	 */
73991 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
73992 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
73993 	/*
73994 	 * This field indicates the IP type for the inner-most IP header.
73995 	 * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
73996 	 * This value is only valid if itype indicates a packet
73997 	 * with an IP header.
73998 	 */
73999 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE			UINT32_C(0x100)
74000 	/*
74001 	 * This indicates that the complete 1's complement checksum was
74002 	 * calculated for the packet.
74003 	 */
74004 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
74005 	/*
74006 	 * The combination of this value and meta_format indicated what
74007 	 * format the metadata field is.
74008 	 */
74009 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
74010 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_SFT	10
74011 	/*
74012 	 * This value is the complete 1's complement checksum calculated from
74013 	 * the start of the outer L3 header to the end of the packet (not
74014 	 * including the ethernet crc). It is valid when the
74015 	 * 'complete_checksum_calc' flag is set.
74016 	 */
74017 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
74018 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT	16
74019 	/*
74020 	 * This is data from the CFA block as indicated by the meta_format
74021 	 * field.
74022 	 */
74023 	uint32_t	raweth_qp1_metadata;
74024 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_MASK	UINT32_C(0xffff)
74025 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_SFT	0
74026 	/* When meta_format=1, this value is the VLAN VID. */
74027 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK	UINT32_C(0xfff)
74028 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT		0
74029 	/* When meta_format=1, this value is the VLAN DE. */
74030 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE		UINT32_C(0x1000)
74031 	/* When meta_format=1, this value is the VLAN PRI. */
74032 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK	UINT32_C(0xe000)
74033 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT		13
74034 	/* When meta_format=1, this value is the VLAN TPID. */
74035 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK	UINT32_C(0xffff0000)
74036 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT	16
74037 	uint8_t	cqe_type_toggle;
74038 	/*
74039 	 * Indicate valid completion - written by the chip. Cumulus
74040 	 * toggle this bit each time it finished consuming all PBL
74041 	 * entries
74042 	 */
74043 	#define CQ_RES_RAWETH_QP1_TOGGLE		UINT32_C(0x1)
74044 	/* This field defines the type of SQ WQE. */
74045 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK	UINT32_C(0x1e)
74046 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT	1
74047 	/*
74048 	 * Responder RawEth and QP1 Completion - This is used for RQ
74049 	 * completion for RawEth service and QP1 service QPs.
74050 	 */
74051 		#define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1  (UINT32_C(0x3) << 1)
74052 		#define CQ_RES_RAWETH_QP1_CQE_TYPE_LAST	CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1
74053 	/* This field indicates the status for the CQE. */
74054 	uint8_t	status;
74055 	/*
74056 	 * This indicates that the completion is without error.
74057 	 * All fields are valid.
74058 	 */
74059 	#define CQ_RES_RAWETH_QP1_STATUS_OK			UINT32_C(0x0)
74060 	/*
74061 	 * This indicates that write access was not allowed for
74062 	 * at least one of the SGEs in the WQE.
74063 	 *
74064 	 * This is a fatal error.  Only the srq_or_rq_wr_id is field
74065 	 * is valid.
74066 	 */
74067 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
74068 	/*
74069 	 * This indicates that the packet was too long for the WQE
74070 	 * provided on the RQ.
74071 	 *
74072 	 * This is not a fatal error.  All the fields are valid.
74073 	 */
74074 	#define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
74075 	/* LOCAL_PROTECTION_ERR is 3 */
74076 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
74077 	/* LOCAL_QP_OPERATION_ERR is 4 */
74078 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
74079 	/* MEMORY_MGT_OPERATION_ERR is 5 */
74080 	#define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
74081 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
74082 	#define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
74083 	/* HW_FLUSH_ERR is 8 */
74084 	#define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
74085 	#define CQ_RES_RAWETH_QP1_STATUS_LAST			CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR
74086 	uint16_t	flags;
74087 	/*
74088 	 * This flag indicates that the completion is for a SRQ entry
74089 	 * rather than for an RQ entry.
74090 	 */
74091 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ	UINT32_C(0x1)
74092 	/* CQE relates to RQ WQE. */
74093 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ	UINT32_C(0x0)
74094 	/* CQE relates to SRQ WQE. */
74095 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ   UINT32_C(0x1)
74096 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
74097 	uint32_t	raweth_qp1_payload_offset_srq_or_rq_wr_id;
74098 	/*
74099 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
74100 	 * reference the WQE in order to claim the received data
74101 	 * and reuse the WQE space
74102 	 */
74103 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
74104 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT	0
74105 	/*
74106 	 * This value indicates the offset in bytes from the beginning of the packet
74107 	 * where the inner payload starts.  This value is valid for TCP, UDP,
74108 	 * FCoE, and RoCE packets.
74109 	 *
74110 	 * A value of zero indicates an offset of 256 bytes.
74111 	 */
74112 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
74113 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
74114 } cq_res_raweth_qp1_t, *pcq_res_raweth_qp1_t;
74115 
74116 /* Responder RawEth and QP1 CQE version 2 */
74117 /* cq_res_raweth_qp1_v2 (size:256b/32B) */
74118 
74119 typedef struct cq_res_raweth_qp1_v2 {
74120 	uint16_t	length;
74121 	/*
74122 	 * The length of the message's payload in bytes, stored in
74123 	 * the SGEs
74124 	 */
74125 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_MASK UINT32_C(0x3fff)
74126 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_SFT 0
74127 	uint16_t	raweth_qp1_flags;
74128 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_MASK		UINT32_C(0x3ff)
74129 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_SFT		0
74130 	/*
74131 	 * When this bit is '1', it indicates a packet that has an
74132 	 * error of some type.  Type of error is indicated in
74133 	 * raweth_qp1_errors.
74134 	 */
74135 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ERROR		UINT32_C(0x1)
74136 	/*
74137 	 * This value indicates what the inner packet determined for the
74138 	 * packet was.
74139 	 */
74140 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_MASK		UINT32_C(0x3c0)
74141 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_SFT		6
74142 	/*
74143 	 * Not Known:
74144 	 * Indicates that the packet type was not known.
74145 	 */
74146 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 6)
74147 	/*
74148 	 * IP Packet:
74149 	 * Indicates that the packet was an IP packet, but further
74150 	 * classification was not possible.
74151 	 */
74152 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 6)
74153 	/*
74154 	 * TCP Packet:
74155 	 * Indicates that the packet was IP and TCP.
74156 	 * This indicates that the raweth_qp1_payload_offset field is
74157 	 * valid.
74158 	 */
74159 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 6)
74160 	/*
74161 	 * UDP Packet:
74162 	 * Indicates that the packet was IP and UDP.
74163 	 * This indicates that the raweth_qp1_payload_offset field is
74164 	 * valid.
74165 	 */
74166 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 6)
74167 	/*
74168 	 * FCoE Packet:
74169 	 * Indicates that the packet was recognized as a FCoE.
74170 	 * This also indicates that the raweth_qp1_payload_offset field
74171 	 * is valid.
74172 	 */
74173 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 6)
74174 	/*
74175 	 * RoCE Packet:
74176 	 * Indicates that the packet was recognized as a RoCE.
74177 	 * This also indicates that the raweth_qp1_payload_offset field
74178 	 * is valid.
74179 	 */
74180 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 6)
74181 	/*
74182 	 * ICMP Packet:
74183 	 * Indicates that the packet was recognized as ICMP.
74184 	 * This indicates that the raweth_qp1_payload_offset field is
74185 	 * valid.
74186 	 */
74187 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 6)
74188 	/*
74189 	 * PtP packet wo/timestamp:
74190 	 * Indicates that the packet was recognized as a PtP
74191 	 * packet.
74192 	 */
74193 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 6)
74194 	/*
74195 	 * PtP packet w/timestamp:
74196 	 * Indicates that the packet was recognized as a PtP
74197 	 * packet and that a timestamp was taken for the packet.
74198 	 */
74199 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 6)
74200 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_LAST		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
74201 	uint16_t	raweth_qp1_errors;
74202 	/*
74203 	 * This indicates that there was an error in the IP header
74204 	 * checksum.
74205 	 */
74206 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
74207 	/*
74208 	 * This indicates that there was an error in the TCP, UDP
74209 	 * or ICMP checksum.
74210 	 */
74211 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
74212 	/*
74213 	 * This indicates that there was an error in the tunnel
74214 	 * IP header checksum.
74215 	 */
74216 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
74217 	/*
74218 	 * This indicates that there was an error in the tunnel
74219 	 * UDP checksum.
74220 	 */
74221 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
74222 	/*
74223 	 * This indicates that there was a CRC error on either an FCoE
74224 	 * or RoCE packet.  The itype indicates the packet type.
74225 	 */
74226 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_CRC_ERROR			UINT32_C(0x100)
74227 	/*
74228 	 * This indicates that there was an error in the tunnel
74229 	 * portion of the packet when this
74230 	 * field is non-zero.
74231 	 */
74232 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
74233 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT		9
74234 	/*
74235 	 * No additional error occurred on the tunnel portion
74236 	 * of the packet of the packet does not have a tunnel.
74237 	 */
74238 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
74239 	/*
74240 	 * Indicates that IP header version does not match
74241 	 * expectation from L2 Ethertype for IPv4 and IPv6
74242 	 * in the tunnel header.
74243 	 */
74244 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
74245 	/*
74246 	 * Indicates that header length is out of range in the
74247 	 * tunnel header. Valid for
74248 	 * IPv4.
74249 	 */
74250 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
74251 	/*
74252 	 * Indicates that the physical packet is shorter than that
74253 	 * claimed by the PPPoE header length for a tunnel PPPoE
74254 	 * packet.
74255 	 */
74256 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
74257 	/*
74258 	 * Indicates that physical packet is shorter than that claimed
74259 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
74260 	 * tunnel packet packets.
74261 	 */
74262 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
74263 	/*
74264 	 * Indicates that the physical packet is shorter than that
74265 	 * claimed by the tunnel UDP header length for a tunnel
74266 	 * UDP packet that is not fragmented.
74267 	 */
74268 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
74269 	/*
74270 	 * indicates that the IPv4 TTL or IPv6 hop limit check
74271 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
74272 	 * for IPv4, and IPv6.
74273 	 */
74274 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
74275 		#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
74276 	/*
74277 	 * This indicates that there was an error in the inner
74278 	 * portion of the packet when this
74279 	 * field is non-zero.
74280 	 */
74281 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
74282 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_SFT			12
74283 	/*
74284 	 * No additional error occurred on the tunnel portion
74285 	 * of the packet of the packet does not have a tunnel.
74286 	 */
74287 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
74288 	/*
74289 	 * Indicates that IP header version does not match
74290 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
74291 	 * option other than VFT was parsed on
74292 	 * FCoE packet.
74293 	 */
74294 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
74295 	/*
74296 	 * indicates that header length is out of range. Valid for
74297 	 * IPv4 and RoCE
74298 	 */
74299 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
74300 	/*
74301 	 * indicates that the IPv4 TTL or IPv6 hop limit check
74302 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
74303 	 */
74304 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
74305 	/*
74306 	 * Indicates that physical packet is shorter than that
74307 	 * claimed by the l3 header length. Valid for IPv4,
74308 	 * IPv6 packet or RoCE packets.
74309 	 */
74310 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
74311 	/*
74312 	 * Indicates that the physical packet is shorter than that
74313 	 * claimed by the UDP header length for a UDP packet that is
74314 	 * not fragmented.
74315 	 */
74316 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
74317 	/*
74318 	 * Indicates that TCP header length > IP payload. Valid for
74319 	 * TCP packets only.
74320 	 */
74321 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
74322 	/* Indicates that TCP header length < 5. Valid for TCP. */
74323 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL  (UINT32_C(0x7) << 12)
74324 	/*
74325 	 * Indicates that TCP option headers result in a TCP header
74326 	 * size that does not match data offset in TCP header. Valid
74327 	 * for TCP.
74328 	 */
74329 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
74330 		#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
74331 	/* This is data from the CFA as indicated by the meta_format field. */
74332 	uint16_t	cfa_metadata0;
74333 	/* When meta_format=1, this value is the VLAN VID. */
74334 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
74335 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_SFT 0
74336 	/* When meta_format=1, this value is the VLAN DE. */
74337 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
74338 	/* When meta_format=1, this value is the VLAN PRI. */
74339 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
74340 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_SFT 13
74341 	/*
74342 	 * This is an application level ID used to identify the
74343 	 * QP and its SQ and RQ.
74344 	 */
74345 	uint64_t	qp_handle;
74346 	uint32_t	raweth_qp1_flags2;
74347 	/*
74348 	 * When this bit is '0', the cs_ok field has the following
74349 	 * definition:- ip_cs_ok[2:0] = The number of header groups with a
74350 	 * valid IP checksum in the delivered packet, counted from the
74351 	 * outer-most header group to the inner-most header group, stopping
74352 	 * at the first error. - l4_cs_ok[5:3] = The number of header groups
74353 	 * with a valid L4 checksum in the delivered packet, counted from
74354 	 * the outer-most header group to the inner-most header group,
74355 	 * stopping at the first error. When this bit is '1', the cs_ok
74356 	 * field has the following definition: - hdr_cnt[2:0] = The number of
74357 	 * header groups that were parsed by the chip and passed in the
74358 	 * delivered packet. - ip_cs_all_ok[3] =This bit will be '1' if all
74359 	 * the parsed header groups with an IP checksum are valid.
74360 	 * - l4_cs_all_ok[4] = This bit will be '1' if all the parsed header
74361 	 * groups with an L4 checksum are valid.
74362 	 */
74363 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
74364 	/* This value indicates what format the metadata field is. */
74365 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
74366 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_SFT		4
74367 	/* There is no metadata information. Values are zero. */
74368 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
74369 	/*
74370 	 * The {metadata1, metadata0} fields contain the vtag
74371 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
74372 	 * de, vid[11:0]} The metadata2 field contains the table scope
74373 	 * and action record pointer. - metadata2[25:0] contains the
74374 	 * action record pointer. - metadata2[31:26] contains the table
74375 	 * scope.
74376 	 */
74377 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
74378 	/*
74379 	 * The {metadata1, metadata0} fields contain the vtag
74380 	 * information:
74381 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
74382 	 * The metadata2 field contains the Tunnel ID
74383 	 * value, justified to LSB. i
74384 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
74385 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
74386 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
74387 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
74388 	 * - IPv4 = 0 (not populated)
74389 	 * - IPv6 = Flow Label[19:0]
74390 	 * - PPPoE = sessionID[15:0]
74391 	 * - MPLs = Outer label[19:0]
74392 	 * - UPAR = Selected[31:0] with bit mask
74393 	 */
74394 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
74395 	/*
74396 	 * The {metadata1, metadata0} fields contain the vtag
74397 	 * information:
74398 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
74399 	 * The metadata2 field contains the 32b metadata from the prepended
74400 	 * header (chdr_data).
74401 	 */
74402 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
74403 	/*
74404 	 * The {metadata1, metadata0} fields contain the vtag
74405 	 * information:
74406 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
74407 	 * The metadata2 field contains the outer_l3_offset,
74408 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
74409 	 * - metadata2[8:0] contains the outer_l3_offset.
74410 	 * - metadata2[17:9] contains the inner_l2_offset.
74411 	 * - metadata2[26:18] contains the inner_l3_offset.
74412 	 * - metadata2[31:27] contains the inner_l4_size.
74413 	 */
74414 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
74415 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_LAST		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
74416 	/*
74417 	 * This field indicates the IP type for the inner-most IP header.
74418 	 * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
74419 	 * This value is only valid if itype indicates a packet
74420 	 * with an IP header.
74421 	 */
74422 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_IP_TYPE			UINT32_C(0x100)
74423 	/*
74424 	 * This indicates that the complete 1's complement checksum was
74425 	 * calculated for the packet.
74426 	 */
74427 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
74428 	/*
74429 	 * This field indicates the status of IP and L4 CS calculations done
74430 	 * by the chip. The format of this field is indicated by the
74431 	 * cs_all_ok_mode bit.
74432 	 */
74433 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
74434 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_SFT		10
74435 	/*
74436 	 * This value is the complete 1's complement checksum calculated from
74437 	 * the start of the outer L3 header to the end of the packet (not
74438 	 * including the ethernet crc). It is valid when the
74439 	 * 'complete_checksum_calc' flag is set.
74440 	 */
74441 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
74442 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT	16
74443 	/*
74444 	 * This is data from the CFA block as indicated by the meta_format
74445 	 * field.
74446 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
74447 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
74448 	 *   act_rec_ptr[25:0]}
74449 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
74450 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
74451 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
74452 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
74453 	 * of the host address from the first BD used to place the packet.
74454 	 */
74455 	uint32_t	cfa_metadata2;
74456 	uint8_t	cqe_type_toggle;
74457 	/*
74458 	 * Indicate valid completion - written by the chip. Cumulus
74459 	 * toggle this bit each time it finished consuming all PBL
74460 	 * entries
74461 	 */
74462 	#define CQ_RES_RAWETH_QP1_V2_TOGGLE		UINT32_C(0x1)
74463 	/* This field defines the type of SQ WQE. */
74464 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_MASK	UINT32_C(0x1e)
74465 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_SFT	1
74466 	/*
74467 	 * Responder RawEth and QP1 Completion - This is used for RQ
74468 	 * completion for RawEth service and QP1 service QPs.
74469 	 */
74470 		#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1  (UINT32_C(0x3) << 1)
74471 		#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_LAST	CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1
74472 	/* This field indicates the status for the CQE. */
74473 	uint8_t	status;
74474 	/*
74475 	 * This indicates that the completion is without error.
74476 	 * All fields are valid.
74477 	 */
74478 	#define CQ_RES_RAWETH_QP1_V2_STATUS_OK			UINT32_C(0x0)
74479 	/*
74480 	 * This indicates that write access was not allowed for
74481 	 * at least one of the SGEs in the WQE.
74482 	 *
74483 	 * This is a fatal error.  Only the srq_or_rq_wr_id is field
74484 	 * is valid.
74485 	 */
74486 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
74487 	/*
74488 	 * This indicates that the packet was too long for the WQE
74489 	 * provided on the RQ.
74490 	 *
74491 	 * This is not a fatal error.  All the fields are valid.
74492 	 */
74493 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
74494 	/* LOCAL_PROTECTION_ERR is 3 */
74495 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
74496 	/* LOCAL_QP_OPERATION_ERR is 4 */
74497 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
74498 	/* MEMORY_MGT_OPERATION_ERR is 5 */
74499 	#define CQ_RES_RAWETH_QP1_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
74500 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
74501 	#define CQ_RES_RAWETH_QP1_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
74502 	/* HW_FLUSH_ERR is 8 */
74503 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
74504 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LAST			CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR
74505 	uint16_t	flags;
74506 	/*
74507 	 * This flag indicates that the completion is for a SRQ entry
74508 	 * rather than for an RQ entry.
74509 	 */
74510 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ	UINT32_C(0x1)
74511 	/* CQE relates to RQ WQE. */
74512 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_RQ	UINT32_C(0x0)
74513 	/* CQE relates to SRQ WQE. */
74514 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ   UINT32_C(0x1)
74515 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ
74516 	uint32_t	raweth_qp1_payload_offset_srq_or_rq_wr_id;
74517 	/*
74518 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
74519 	 * reference the WQE in order to claim the received data
74520 	 * and reuse the WQE space
74521 	 */
74522 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
74523 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_SFT		0
74524 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
74525 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_SFT		20
74526 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
74527 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
74528 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_SFT	20
74529 	/* 0x88a8 */
74530 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
74531 	/* 0x8100 */
74532 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
74533 	/* 0x9100 */
74534 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
74535 	/* 0x9200 */
74536 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
74537 	/* 0x9300 */
74538 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
74539 	/* Value programmed in CFA VLANTPID register. */
74540 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
74541 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
74542 	/* When meta_format != 0, this value is the VLAN valid. */
74543 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
74544 	/*
74545 	 * This value indicates the offset in bytes from the beginning of
74546 	 * the packet where the inner payload starts.  This value is valid
74547 	 * for TCP, UDP, FCoE, and RoCE packets.
74548 	 *
74549 	 * A value of zero indicates an offset of 256 bytes.
74550 	 */
74551 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
74552 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_SFT  24
74553 } cq_res_raweth_qp1_v2_t, *pcq_res_raweth_qp1_v2_t;
74554 
74555 /* Terminal CQE */
74556 /* cq_terminal (size:256b/32B) */
74557 
74558 typedef struct cq_terminal {
74559 	/*
74560 	 * This is an application level ID used to identify the
74561 	 * QP and its SQ and RQ.
74562 	 */
74563 	uint64_t	qp_handle;
74564 	/*
74565 	 * Final SQ Consumer Index value.  Any additional SQ WQEs will
74566 	 * have to be completed by the user provider.
74567 	 */
74568 	uint16_t	sq_cons_idx;
74569 	/*
74570 	 * Final RQ Consumer Index value.  Any additional RQ WQEs will
74571 	 * have to be completed by the user provider.
74572 	 */
74573 	uint16_t	rq_cons_idx;
74574 	uint32_t	reserved32_1;
74575 	uint64_t	reserved64_3;
74576 	uint8_t	cqe_type_toggle;
74577 	/*
74578 	 * Indicate valid completion - written by the chip. Cumulus
74579 	 * toggle this bit each time it finished consuming all PBL
74580 	 * entries
74581 	 */
74582 	#define CQ_TERMINAL_TOGGLE	UINT32_C(0x1)
74583 	/* This field defines the type of SQ WQE. */
74584 	#define CQ_TERMINAL_CQE_TYPE_MASK	UINT32_C(0x1e)
74585 	#define CQ_TERMINAL_CQE_TYPE_SFT	1
74586 	/*
74587 	 * Terminal completion - This is used to indicate that no
74588 	 * further completions will be made for this QP on this CQ.
74589 	 */
74590 		#define CQ_TERMINAL_CQE_TYPE_TERMINAL  (UINT32_C(0xe) << 1)
74591 		#define CQ_TERMINAL_CQE_TYPE_LAST	CQ_TERMINAL_CQE_TYPE_TERMINAL
74592 	/* This field indicates the status for the CQE. */
74593 	uint8_t	status;
74594 	/* OK is 0 */
74595 	#define CQ_TERMINAL_STATUS_OK UINT32_C(0x0)
74596 	#define CQ_TERMINAL_STATUS_LAST CQ_TERMINAL_STATUS_OK
74597 	uint16_t	reserved16;
74598 	uint32_t	reserved32_2;
74599 } cq_terminal_t, *pcq_terminal_t;
74600 
74601 /* Cutoff CQE */
74602 /* cq_cutoff (size:256b/32B) */
74603 
74604 typedef struct cq_cutoff {
74605 	uint64_t	reserved64_1;
74606 	uint64_t	reserved64_2;
74607 	uint64_t	reserved64_3;
74608 	uint8_t	cqe_type_toggle;
74609 	/*
74610 	 * Indicate valid completion - written by the chip. Cumulus
74611 	 * toggle this bit each time it finished consuming all PBL
74612 	 * entries
74613 	 */
74614 	#define CQ_CUTOFF_TOGGLE		UINT32_C(0x1)
74615 	/* This field defines the type of SQ WQE. */
74616 	#define CQ_CUTOFF_CQE_TYPE_MASK	UINT32_C(0x1e)
74617 	#define CQ_CUTOFF_CQE_TYPE_SFT	1
74618 	/* Cut off CQE; for CQ resize see CQ and SRQ Resize */
74619 		#define CQ_CUTOFF_CQE_TYPE_CUT_OFF	(UINT32_C(0xf) << 1)
74620 		#define CQ_CUTOFF_CQE_TYPE_LAST	CQ_CUTOFF_CQE_TYPE_CUT_OFF
74621 	/*
74622 	 * This field carries the toggle value that must be used to
74623 	 * acknowledge this CQ resize operation. When this CQE is
74624 	 * processed, the driver should send a CQ_CUTOFF_ACK doorbell
74625 	 * to the chip to let the chip know that the resize operation
74626 	 * is complete. This value is used by HW to detect old and
74627 	 * stale CQ_CUTOFF_ACK doorbells that are caused by having
74628 	 * a backup doorbell location or by PCI or other reordering
74629 	 * problems. Only doorbells with the latest value will be honored.
74630 	 * This field is needed only for devices that use the hardware
74631 	 * based doorbell drop recovery feature.
74632 	 */
74633 	#define CQ_CUTOFF_RESIZE_TOGGLE_MASK UINT32_C(0x60)
74634 	#define CQ_CUTOFF_RESIZE_TOGGLE_SFT 5
74635 	/* This field indicates the status for the CQE. */
74636 	uint8_t	status;
74637 	/* OK is 0 */
74638 	#define CQ_CUTOFF_STATUS_OK UINT32_C(0x0)
74639 	#define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK
74640 	uint16_t	reserved16;
74641 	uint32_t	reserved32;
74642 } cq_cutoff_t, *pcq_cutoff_t;
74643 
74644 /* nq_base (size:128b/16B) */
74645 
74646 typedef struct nq_base {
74647 	uint16_t	info10_type;
74648 	/*
74649 	 * This field indicates the exact type of the completion.
74650 	 * By convention, the LSB identifies the length of the
74651 	 * record in 16B units.  Even values indicate 16B
74652 	 * records.  Odd values indicate 32B
74653 	 * records.
74654 	 */
74655 	#define NQ_BASE_TYPE_MASK	UINT32_C(0x3f)
74656 	#define NQ_BASE_TYPE_SFT		0
74657 	/* CQ Notification */
74658 		#define NQ_BASE_TYPE_CQ_NOTIFICATION  UINT32_C(0x30)
74659 	/* SRQ Threshold Event */
74660 		#define NQ_BASE_TYPE_SRQ_EVENT	UINT32_C(0x32)
74661 	/* DBQ Threshold Event */
74662 		#define NQ_BASE_TYPE_DBQ_EVENT	UINT32_C(0x34)
74663 	/* QP Async Notification */
74664 		#define NQ_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
74665 	/* Function Async Notification */
74666 		#define NQ_BASE_TYPE_FUNC_EVENT	UINT32_C(0x3a)
74667 		#define NQ_BASE_TYPE_LAST		NQ_BASE_TYPE_FUNC_EVENT
74668 	/* info10 is 10 b */
74669 	#define NQ_BASE_INFO10_MASK	UINT32_C(0xffc0)
74670 	#define NQ_BASE_INFO10_SFT	6
74671 	/* info16 is 16 b */
74672 	uint16_t	info16;
74673 	/* info32 is 32 b */
74674 	uint32_t	info32;
74675 	/* info32 is 32 b */
74676 	uint64_t	info63_v;
74677 	/*
74678 	 * This value is written by the NIC such that it will be different
74679 	 * for each pass through the completion queue.   The even passes
74680 	 * will write 1.  The odd passes will write 0.
74681 	 */
74682 	#define NQ_BASE_V	UINT32_C(0x1)
74683 	/* info63 is 63 b */
74684 	#define NQ_BASE_INFO63_MASK UINT32_C(0xfffffffe)
74685 	#define NQ_BASE_INFO63_SFT 1
74686 } nq_base_t, *pnq_base_t;
74687 
74688 /* Completion Queue Notification */
74689 /* nq_cn (size:128b/16B) */
74690 
74691 typedef struct nq_cn {
74692 	uint16_t	type;
74693 	/*
74694 	 * This field indicates the exact type of the completion.
74695 	 * By convention, the LSB identifies the length of the
74696 	 * record in 16B units.  Even values indicate 16B
74697 	 * records.  Odd values indicate 32B
74698 	 * records.
74699 	 */
74700 	#define NQ_CN_TYPE_MASK	UINT32_C(0x3f)
74701 	#define NQ_CN_TYPE_SFT		0
74702 	/* CQ Notification */
74703 		#define NQ_CN_TYPE_CQ_NOTIFICATION  UINT32_C(0x30)
74704 		#define NQ_CN_TYPE_LAST		NQ_CN_TYPE_CQ_NOTIFICATION
74705 	/*
74706 	 * This field carries the toggle value that must be used to
74707 	 * re-arm this CQ. The toggle value should be copied into the
74708 	 * doorbell used to CQ_ARMENA, CQ_ARMALL or CQ_ARMSE doorbells.
74709 	 */
74710 	#define NQ_CN_TOGGLE_MASK	UINT32_C(0xc0)
74711 	#define NQ_CN_TOGGLE_SFT	6
74712 	uint16_t	reserved16;
74713 	/*
74714 	 * This is an application level ID used to identify the
74715 	 * CQ.  This field carries the lower 32b of the value.
74716 	 */
74717 	uint32_t	cq_handle_low;
74718 	uint32_t	v;
74719 	/*
74720 	 * This value is written by the NIC such that it will be different
74721 	 * for each pass through the completion queue.   The even passes
74722 	 * will write 1.  The odd passes will write 0.
74723 	 */
74724 	#define NQ_CN_V	UINT32_C(0x1)
74725 	/*
74726 	 * This is an application level ID used to identify the
74727 	 * CQ.  This field carries the upper 32b of the value.
74728 	 */
74729 	uint32_t	cq_handle_high;
74730 } nq_cn_t, *pnq_cn_t;
74731 
74732 /* SRQ Event Notification */
74733 /* nq_srq_event (size:128b/16B) */
74734 
74735 typedef struct nq_srq_event {
74736 	uint8_t	type;
74737 	/*
74738 	 * This field indicates the exact type of the completion.
74739 	 * By convention, the LSB identifies the length of the
74740 	 * record in 16B units.  Even values indicate 16B
74741 	 * records.  Odd values indicate 32B
74742 	 * records.
74743 	 */
74744 	#define NQ_SRQ_EVENT_TYPE_MASK	UINT32_C(0x3f)
74745 	#define NQ_SRQ_EVENT_TYPE_SFT	0
74746 	/* SRQ Threshold Event */
74747 		#define NQ_SRQ_EVENT_TYPE_SRQ_EVENT  UINT32_C(0x32)
74748 		#define NQ_SRQ_EVENT_TYPE_LAST	NQ_SRQ_EVENT_TYPE_SRQ_EVENT
74749 	/*
74750 	 * This field carries the toggle value that must be used
74751 	 * to re-arm this SRQ. The toggle value should be copied
74752 	 * into the doorbell used to SRQ_ARMENA or SRQ_ARM doorbells.
74753 	 */
74754 	#define NQ_SRQ_EVENT_TOGGLE_MASK   UINT32_C(0xc0)
74755 	#define NQ_SRQ_EVENT_TOGGLE_SFT	6
74756 	/*
74757 	 * This value define what type of async event has occurred
74758 	 * on the SRQ.
74759 	 */
74760 	uint8_t	event;
74761 	/* The threshold event has occurred on the specified SRQ. */
74762 	#define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT UINT32_C(0x1)
74763 	#define NQ_SRQ_EVENT_EVENT_LAST		NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT
74764 	uint16_t	reserved16;
74765 	/*
74766 	 * This is the SRQ handle value for the queue that has
74767 	 * reached it's event threshold.  This field carries the
74768 	 * lower 32b of the value.
74769 	 */
74770 	uint32_t	srq_handle_low;
74771 	uint32_t	v;
74772 	/*
74773 	 * This value is written by the NIC such that it will be different
74774 	 * for each pass through the completion queue.   The even passes
74775 	 * will write 1.  The odd passes will write 0.
74776 	 */
74777 	#define NQ_SRQ_EVENT_V	UINT32_C(0x1)
74778 	/*
74779 	 * This is the SRQ handle value for the queue that has
74780 	 * reached it's event threshold.  This field carries the
74781 	 * upper 32b of the value.
74782 	 */
74783 	uint32_t	srq_handle_high;
74784 } nq_srq_event_t, *pnq_srq_event_t;
74785 
74786 /* DBQ Async Event Notification */
74787 /* nq_dbq_event (size:128b/16B) */
74788 
74789 typedef struct nq_dbq_event {
74790 	uint8_t	type;
74791 	/*
74792 	 * This field indicates the exact type of the completion.
74793 	 * By convention, the LSB identifies the length of the
74794 	 * record in 16B units.  Even values indicate 16B
74795 	 * records.  Odd values indicate 32B
74796 	 * records.
74797 	 */
74798 	#define NQ_DBQ_EVENT_TYPE_MASK	UINT32_C(0x3f)
74799 	#define NQ_DBQ_EVENT_TYPE_SFT	0
74800 	/* DBQ Threshold Event */
74801 		#define NQ_DBQ_EVENT_TYPE_DBQ_EVENT  UINT32_C(0x34)
74802 		#define NQ_DBQ_EVENT_TYPE_LAST	NQ_DBQ_EVENT_TYPE_DBQ_EVENT
74803 	/* This value define what type of action the driver should take. */
74804 	uint8_t	event;
74805 	/*
74806 	 * The driver should start writing dummy values to the
74807 	 * the doorbell in an attempt to consume all the PCIE
74808 	 * posted write resources and prevent doorbell overflow.
74809 	 */
74810 	#define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT UINT32_C(0x1)
74811 	#define NQ_DBQ_EVENT_EVENT_LAST		NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT
74812 	uint16_t	db_pfid;
74813 	/*
74814 	 * This is the PFID of function that wrote the doorbell that
74815 	 * crossed the async event threshold.
74816 	 */
74817 	#define NQ_DBQ_EVENT_DB_PFID_MASK UINT32_C(0xf)
74818 	#define NQ_DBQ_EVENT_DB_PFID_SFT 0
74819 	uint32_t	db_dpi;
74820 	/*
74821 	 * This is the DPI of the doorbell write that crossed
74822 	 * the async event threshold.
74823 	 */
74824 	#define NQ_DBQ_EVENT_DB_DPI_MASK UINT32_C(0xfffff)
74825 	#define NQ_DBQ_EVENT_DB_DPI_SFT 0
74826 	uint32_t	v;
74827 	/*
74828 	 * This value is written by the NIC such that it will be different
74829 	 * for each pass through the completion queue.   The even passes
74830 	 * will write 1.  The odd passes will write 0.
74831 	 */
74832 	#define NQ_DBQ_EVENT_V	UINT32_C(0x1)
74833 	uint32_t	db_type_db_xid;
74834 	/*
74835 	 * DB 'XID' field from doorbell that crossed the async event
74836 	 * threshold.  This is a QPID, SID, or CID, depending on
74837 	 * the db_type field.
74838 	 */
74839 	#define NQ_DBQ_EVENT_DB_XID_MASK UINT32_C(0xfffff)
74840 	#define NQ_DBQ_EVENT_DB_XID_SFT  0
74841 	/*
74842 	 * DB 'type' field from doorbell that crossed the async event
74843 	 * threshold.
74844 	 */
74845 	#define NQ_DBQ_EVENT_DB_TYPE_MASK UINT32_C(0xf0000000)
74846 	#define NQ_DBQ_EVENT_DB_TYPE_SFT 28
74847 } nq_dbq_event_t, *pnq_dbq_event_t;
74848 
74849 /* Input Read Request Queue (IRRQ) Message */
74850 /* xrrq_irrq (size:256b/32B) */
74851 
74852 typedef struct xrrq_irrq {
74853 	uint16_t	credits_type;
74854 	/* Type indication */
74855 	#define XRRQ_IRRQ_TYPE	UINT32_C(0x1)
74856 	/* RDMA Read */
74857 		#define XRRQ_IRRQ_TYPE_READ_REQ	UINT32_C(0x0)
74858 	/* Atomic */
74859 		#define XRRQ_IRRQ_TYPE_ATOMIC_REQ  UINT32_C(0x1)
74860 		#define XRRQ_IRRQ_TYPE_LAST	XRRQ_IRRQ_TYPE_ATOMIC_REQ
74861 	/*
74862 	 * The credit code calculated by Rx path when receiving the
74863 	 * request. It will be placed in the syndrome credit code with
74864 	 * the acks on first and last response.
74865 	 */
74866 	#define XRRQ_IRRQ_CREDITS_MASK   UINT32_C(0xf800)
74867 	#define XRRQ_IRRQ_CREDITS_SFT	11
74868 	uint16_t	reserved16;
74869 	uint32_t	reserved32;
74870 	uint32_t	psn;
74871 	/* The PSN of the outstanding incoming request */
74872 	#define XRRQ_IRRQ_PSN_MASK UINT32_C(0xffffff)
74873 	#define XRRQ_IRRQ_PSN_SFT 0
74874 	uint32_t	msn;
74875 	/*
74876 	 * The value of QPC.pending_ack_msn after it is incremented as a
74877 	 * result of receiving the read/atomic request.  IRRQ.msn-1 will be
74878 	 * placed in the MSN field of the first response and IRRQ.msn will
74879 	 * placed in the MSN field of the last or only response.
74880 	 */
74881 	#define XRRQ_IRRQ_MSN_MASK UINT32_C(0xffffff)
74882 	#define XRRQ_IRRQ_MSN_SFT 0
74883 	/*
74884 	 * Virtual address on local host for RDMA READ
74885 	 *
74886 	 * In case of duplicate Atomic, the VA is not required to
74887 	 * be validated, only the PSN is, thus this field is used
74888 	 * to store the value returned in the Ack to the atomic
74889 	 * request, and if duplicate arrives, this value is used
74890 	 * again for resending the ack.
74891 	 */
74892 	uint64_t	va_or_atomic_result;
74893 	/* The key to the MR/W in the request */
74894 	uint32_t	rdma_r_key;
74895 	/* Length in bytes of the data requested. Length must be 8 if type is atomic. */
74896 	uint32_t	length;
74897 } xrrq_irrq_t, *pxrrq_irrq_t;
74898 
74899 /* Output Read Request Queue (ORRQ) Message */
74900 /* xrrq_orrq (size:256b/32B) */
74901 
74902 typedef struct xrrq_orrq {
74903 	uint16_t	num_sges_type;
74904 	/* Type indication */
74905 	#define XRRQ_ORRQ_TYPE	UINT32_C(0x1)
74906 	/* RDMA Read */
74907 		#define XRRQ_ORRQ_TYPE_READ_REQ	UINT32_C(0x0)
74908 	/* Atomic */
74909 		#define XRRQ_ORRQ_TYPE_ATOMIC_REQ  UINT32_C(0x1)
74910 		#define XRRQ_ORRQ_TYPE_LAST	XRRQ_ORRQ_TYPE_ATOMIC_REQ
74911 	/*
74912 	 * Up to 6 SGEs. This value is 1 if type is atomic as one
74913 	 * SGE is required to store Atomic response result field. 2
74914 	 * more bits allocated for future growth.
74915 	 *
74916 	 * Note that, if num_sges is 1 for an RDMA Read request, then
74917 	 * the first_sge_phy_or_sing_sge_va, single_sge_l_key, and
74918 	 * single_sge_size fields will be populated from the single
74919 	 * SGE.
74920 	 *
74921 	 * If num_sges is 2 or more for an RDMA Read request, then
74922 	 * the first_sge_phy_or_sing_sge_va field carries the
74923 	 * physical address in host memory where the first sge is
74924 	 * stored.  The single_sge_l_key and single_sge_size fields
74925 	 * are unused in this case.
74926 	 *
74927 	 * A special case is a zero-length, zero-sge RDMA read request
74928 	 * WQE.  In this situation, num_sges will be 1.  However,
74929 	 * first_sge_phy_or_sing_sge_va, single_sge_l_key, and
74930 	 * single_sge_size will all be populated with zeros.
74931 	 */
74932 	#define XRRQ_ORRQ_NUM_SGES_MASK  UINT32_C(0xf800)
74933 	#define XRRQ_ORRQ_NUM_SGES_SFT   11
74934 	uint16_t	reserved16;
74935 	/* Length in bytes of the data requested. Length must be 8 if type is atomic. */
74936 	uint32_t	length;
74937 	uint32_t	psn;
74938 	/* The PSN of the outstanding outgoing request */
74939 	#define XRRQ_ORRQ_PSN_MASK UINT32_C(0xffffff)
74940 	#define XRRQ_ORRQ_PSN_SFT 0
74941 	uint32_t	end_psn;
74942 	/*
74943 	 * The expected last PSN on a response to this request where
74944 	 * an ack with response, rather than just response, should
74945 	 * arrive. If ack arrive with smaller PSN than end_psn then it
74946 	 * is considered a NAK.
74947 	 */
74948 	#define XRRQ_ORRQ_END_PSN_MASK UINT32_C(0xffffff)
74949 	#define XRRQ_ORRQ_END_PSN_SFT 0
74950 	/*
74951 	 * If num_sges == 1 this is the va of that SGE. Otherwise,
74952 	 * physical address to the first SGE specified by the WQE.
74953 	 * Points to the first SGE in the Request's WQE in the SQ.
74954 	 * It is assumed that WQE does not cross page boundaries!
74955 	 * Driver is responsible to enforce that. SGEs are 16B
74956 	 * aligned 0b0000 lsb added to get 64 bit address.
74957 	 */
74958 	uint64_t	first_sge_phy_or_sing_sge_va;
74959 	/* The L_Key of a single SGE if used */
74960 	uint32_t	single_sge_l_key;
74961 	/* The size in bytes of the single SGE if used */
74962 	uint32_t	single_sge_size;
74963 } xrrq_orrq_t, *pxrrq_orrq_t;
74964 
74965 /* Page Table Entry (PTE) */
74966 /* ptu_pte (size:64b/8B) */
74967 
74968 typedef struct ptu_pte {
74969 	uint64_t	page_next_to_last_last_valid;
74970 	/*
74971 	 * This field indicates if the PTE is valid.   A value of '0'
74972 	 * indicates that the page is not valid.  A value of '1'
74973 	 * indicates that the page is valid.  A reference to an
74974 	 * invalid page will return a PTU error.
74975 	 */
74976 	#define PTU_PTE_VALID		UINT32_C(0x1)
74977 	/*
74978 	 * This field is used only for "ring" PBLs that are used for
74979 	 * SQ, RQ, SRQ, or CQ structures.   For all other PBL structures,
74980 	 * this bit should be zero.  When this bit is '1', it indicates
74981 	 * that the page pointed to by this PTE is the last page in the
74982 	 * ring.  A prefetch for the ring should use the first PTE in
74983 	 * the PBL.
74984 	 */
74985 	#define PTU_PTE_LAST		UINT32_C(0x2)
74986 	/*
74987 	 * This field is used only for "ring" PBLs that are used for
74988 	 * SQ, RQ, SRQ, or CQ structures.   For all other PBL structures,
74989 	 * this bit should be zero.  When this bit is '1', it indicates
74990 	 * that this is the next-to-last page of the PBL.
74991 	 */
74992 	#define PTU_PTE_NEXT_TO_LAST	UINT32_C(0x4)
74993 	/* These bits should be programmed to zero. */
74994 	#define PTU_PTE_UNUSED_MASK	UINT32_C(0xff8)
74995 	#define PTU_PTE_UNUSED_SFT	3
74996 	/*
74997 	 * This is the upper bits of the physical page controlled by
74998 	 * this PTE.   If the page is larger than 4KB, then the unused
74999 	 * lower bits of the page address should be zero.
75000 	 */
75001 	#define PTU_PTE_PAGE_MASK	UINT32_C(0xfffff000)
75002 	#define PTU_PTE_PAGE_SFT	12
75003 } ptu_pte_t, *pptu_pte_t;
75004 
75005 /* Page Directory Entry (PDE) */
75006 /* ptu_pde (size:64b/8B) */
75007 
75008 typedef struct ptu_pde {
75009 	uint64_t	page_valid;
75010 	/*
75011 	 * This field indicates if the PTE is valid.   A value of '0'
75012 	 * indicates that the page is not valid.  A value of '1'
75013 	 * indicates that the page is valid.  A reference to an
75014 	 * invalid page will return a PTU error.
75015 	 */
75016 	#define PTU_PDE_VALID	UINT32_C(0x1)
75017 	/* These bits should be programmed to zero. */
75018 	#define PTU_PDE_UNUSED_MASK UINT32_C(0xffe)
75019 	#define PTU_PDE_UNUSED_SFT 1
75020 	/*
75021 	 * This is the upper bits of the physical page controlled by
75022 	 * this PTE.   If the page is larger than 4KB, then the unused
75023 	 * lower bits of the page address should be zero.
75024 	 */
75025 	#define PTU_PDE_PAGE_MASK  UINT32_C(0xfffff000)
75026 	#define PTU_PDE_PAGE_SFT   12
75027 } ptu_pde_t, *pptu_pde_t;
75028 
75029 /*
75030  * This is the 64b doorbell format.  The host writes this message
75031  * format directly to byte offset 0 of the appropriate doorbell page.
75032  */
75033 /* dbc_dbc (size:64b/8B) */
75034 
75035 typedef struct dbc_dbc {
75036 	uint32_t	index;
75037 	/*
75038 	 * This value is the index being written.
75039 	 *
75040 	 * For SQ, RQ, and SRQ, this is the producer index and the unit is
75041 	 * 16B of queue space for L2 path and for the Engine path. For RoCE
75042 	 * path there is a legacy mode with 128B unit size and a variable
75043 	 * size WQE mode with 16B unit size of queue space. This mode is
75044 	 * configured in the QP.
75045 	 *
75046 	 * For CQ this is the consumer index and the unit is 32B of queue
75047 	 * space for the RoCE/Engine path and the CQ index unit is 16B of
75048 	 * queue space for the L2 path.
75049 	 *
75050 	 * For NQ this is the consumer index and the unit is always 16B of
75051 	 * queue space.
75052 	 *
75053 	 * The index size is 24b for L2 and engine paths and 16b for the
75054 	 * RoCE path. Unused bits should be written as zero.
75055 	 */
75056 	#define DBC_DBC_INDEX_MASK UINT32_C(0xffffff)
75057 	#define DBC_DBC_INDEX_SFT  0
75058 	/*
75059 	 * The epoch bit provides a frame of reference for the queue index.
75060 	 * S/W will toggle this bit in the doorbell each time index range is
75061 	 * wrapped. This allows the receiving HW block to more efficiently
75062 	 * detect out-of-order doorbells and to ignore the older doorbells.
75063 	 * Out-of-order doorbells occur normally during dropped doorbell
75064 	 * recovery.
75065 	 */
75066 	#define DBC_DBC_EPOCH	UINT32_C(0x1000000)
75067 	/*
75068 	 * The toggle value is used in CQ_ARMENA, CQ_ARMSE, CQ_ARMALL,
75069 	 * SRQ_ARMENA, SRQ_ARM, and CQ_CUTOFF_ACK doorbells to qualify the
75070 	 * doorbell as valid.  This value should be taken from the latest
75071 	 * NQE or cutoff completion.
75072 	 *
75073 	 * Doorbells of the above types with the wrong toggle value will
75074 	 * be ignored.  This is how old values in of backup doorbells
75075 	 * are ignored.
75076 	 */
75077 	#define DBC_DBC_TOGGLE_MASK UINT32_C(0x6000000)
75078 	#define DBC_DBC_TOGGLE_SFT 25
75079 	uint32_t	type_path_xid;
75080 	/*
75081 	 * This value identifies the resource that the doorbell is intended
75082 	 * to notify.
75083 	 *
75084 	 * For SQ and RQ, this is the QPID.  For SRQ, this is the SID.  For
75085 	 * CQ, this is the CID. For NQ, this is the NID.
75086 	 *
75087 	 * Bits [19:16] of this values must be zero for a SID value.
75088 	 */
75089 	#define DBC_DBC_XID_MASK	UINT32_C(0xfffff)
75090 	#define DBC_DBC_XID_SFT	0
75091 	/*
75092 	 * This value defines the intended doorbell path between RoCE and
75093 	 * L2.
75094 	 */
75095 	#define DBC_DBC_PATH_MASK	UINT32_C(0x3000000)
75096 	#define DBC_DBC_PATH_SFT	24
75097 	/* This is a RoCE doorbell message. */
75098 		#define DBC_DBC_PATH_ROCE	(UINT32_C(0x0) << 24)
75099 	/* This is a L2 doorbell message. */
75100 		#define DBC_DBC_PATH_L2		(UINT32_C(0x1) << 24)
75101 	/* Engine path doorbell. */
75102 		#define DBC_DBC_PATH_ENGINE	(UINT32_C(0x2) << 24)
75103 		#define DBC_DBC_PATH_LAST	DBC_DBC_PATH_ENGINE
75104 	/*
75105 	 * This indicates it is valid doorbell update. It should be set for
75106 	 * each doorbell written to the chip and set when doorbell message is
75107 	 * written to the backup doorbell location. The bit should be cleared
75108 	 * in the backup doorbell location at time zero to indicate that the
75109 	 * backup doorbell has not yet been written.
75110 	 */
75111 	#define DBC_DBC_VALID		UINT32_C(0x4000000)
75112 	/*
75113 	 * When this bit is set to one, the chip will capture debug
75114 	 * information for the doorbell ring. This is intended to only be
75115 	 * used on SQ doorbell rings.
75116 	 */
75117 	#define DBC_DBC_DEBUG_TRACE	UINT32_C(0x8000000)
75118 	/* This value identifies the type of doorbell being written. */
75119 	#define DBC_DBC_TYPE_MASK	UINT32_C(0xf0000000)
75120 	#define DBC_DBC_TYPE_SFT	28
75121 	/*
75122 	 * This is a SQ producer index update.   It indicates one or more
75123 	 * new entries have been written to the SQ for the QPID indicated
75124 	 * on the xID field. This type is valid for L2, RoCE and Engine
75125 	 * path.
75126 	 */
75127 		#define DBC_DBC_TYPE_SQ		(UINT32_C(0x0) << 28)
75128 	/*
75129 	 * This is a RQ producer index update.   It indicates one or more
75130 	 * new entries have been written to the RQ for the QPID indicated
75131 	 * on the xID field. This type is valid for RoCE path.
75132 	 */
75133 		#define DBC_DBC_TYPE_RQ		(UINT32_C(0x1) << 28)
75134 	/*
75135 	 * This is a SRQ producer index update.   It indicates one or more
75136 	 * new entries have been written to the SRQ for the SID indicated
75137 	 * on the xID field. This type is valid for L2 and RoCE path.
75138 	 */
75139 		#define DBC_DBC_TYPE_SRQ		(UINT32_C(0x2) << 28)
75140 	/*
75141 	 * This doorbell command arms the SRQ async event.
75142 	 * The xID field must identify the SID that is begin armed.
75143 	 * The index field is will set the arm threshold such that
75144 	 * a notification will be generated if less than that number
75145 	 * or SRQ entries are posted. This type is valid for RoCE path.
75146 	 */
75147 		#define DBC_DBC_TYPE_SRQ_ARM	(UINT32_C(0x3) << 28)
75148 	/*
75149 	 * This is a CQ consumer index update.   It indicates one or more
75150 	 * entries have been processed off the CQ indicated on the xID
75151 	 * field.This type is valid for L2, RoCE and Engine path.
75152 	 */
75153 		#define DBC_DBC_TYPE_CQ		(UINT32_C(0x4) << 28)
75154 	/*
75155 	 * this is a CQ consumer index update that also arms the CQ for
75156 	 * solicited events. This type is valid for RoCE path.
75157 	 */
75158 		#define DBC_DBC_TYPE_CQ_ARMSE	(UINT32_C(0x5) << 28)
75159 	/*
75160 	 * This is a CQ consumer index update that also arms the CQ
75161 	 * for any new CQE. This type is valid for L2, RoCE and Engine
75162 	 * path.
75163 	 */
75164 		#define DBC_DBC_TYPE_CQ_ARMALL	(UINT32_C(0x6) << 28)
75165 	/*
75166 	 * This is a CQ arm enable message.  This message must be sent
75167 	 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
75168 	 * message will be accepted.
75169 	 *
75170 	 * This doorbell can only be sent from the privileged (first)
75171 	 * doorbell page of a function.
75172 	 */
75173 		#define DBC_DBC_TYPE_CQ_ARMENA	(UINT32_C(0x7) << 28)
75174 	/*
75175 	 * This doorbell command enables the SRQ async event
75176 	 * to be armed.  This message must be sent from the privileged
75177 	 * driver before a new SRQ_ARM message will be accepted.
75178 	 * The xID field must identify the SID that is begin enabled
75179 	 * for arm.
75180 	 *
75181 	 * This doorbell can only be sent from the privileged (first)
75182 	 * doorbell page of a function.
75183 	 */
75184 		#define DBC_DBC_TYPE_SRQ_ARMENA	(UINT32_C(0x8) << 28)
75185 	/*
75186 	 * This doorbell command indicates that the cutoff CQE has
75187 	 * been processed and the driver is now processing completions
75188 	 * from the new CQ.
75189 	 *
75190 	 * The index field for this doorbell type must be zero.
75191 	 */
75192 		#define DBC_DBC_TYPE_CQ_CUTOFF_ACK  (UINT32_C(0x9) << 28)
75193 	/*
75194 	 * This is a NQ consumer index update. It indicates one or more
75195 	 * entries have been processed off the NQ indicated on the xID
75196 	 * field. This type is valid for L2, RoCE and Engine path.
75197 	 */
75198 		#define DBC_DBC_TYPE_NQ		(UINT32_C(0xa) << 28)
75199 	/*
75200 	 * This is a NQ consumer index update that also arms the NQ for
75201 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
75202 	 */
75203 		#define DBC_DBC_TYPE_NQ_ARM	(UINT32_C(0xb) << 28)
75204 	/*
75205 	 * This is a NQ consumer index update that also arms the NQ for
75206 	 * any new NQE. It is used for the legacy INT mask. This type
75207 	 * is valid for L2, RoCE and Engine path.
75208 	 */
75209 		#define DBC_DBC_TYPE_NQ_MASK	(UINT32_C(0xe) << 28)
75210 	/*
75211 	 * This doorbell command is used during doorbell moderation
75212 	 * to consume system BW and help prevent doorbell FIFO
75213 	 * overflow.
75214 	 *
75215 	 * All other fields should be zero for NULL doorbell.
75216 	 * For doorbell recovery, NULL doorbell type in the Application
75217 	 * table indicates that it is the last QP entry for the function.
75218 	 * This type is valid for L2, RoCE and Engine path.
75219 	 */
75220 		#define DBC_DBC_TYPE_NULL	(UINT32_C(0xf) << 28)
75221 		#define DBC_DBC_TYPE_LAST	DBC_DBC_TYPE_NULL
75222 } dbc_dbc_t, *pdbc_dbc_t;
75223 
75224 /*
75225  * This is the 32b doorbell format.  The host writes this message
75226  * format directly to byte offset 8 of the appropriate doorbell page.
75227  */
75228 /* dbc_dbc32 (size:32b/4B) */
75229 
75230 typedef struct dbc_dbc32 {
75231 	uint32_t	type_abs_incr_xid;
75232 	/*
75233 	 * This value identifies the resource that the doorbell is intended
75234 	 * to notify.
75235 	 *
75236 	 * For SQ and RQ, this is the QPID.  For SRQ, this is the SID.  For
75237 	 * CQ, this is the CID.
75238 	 *
75239 	 * Bits [19:16] of this values must be zero for a SID value.
75240 	 */
75241 	#define DBC_DBC32_XID_MASK UINT32_C(0xfffff)
75242 	#define DBC_DBC32_XID_SFT  0
75243 	/*
75244 	 * This value defines the intended doorbell path between RoCE and
75245 	 * L2.
75246 	 */
75247 	#define DBC_DBC32_PATH_MASK UINT32_C(0xc00000)
75248 	#define DBC_DBC32_PATH_SFT 22
75249 	/* This is a RoCE doorbell message. */
75250 		#define DBC_DBC32_PATH_ROCE  (UINT32_C(0x0) << 22)
75251 	/* This is a L2 doorbell message. */
75252 		#define DBC_DBC32_PATH_L2	(UINT32_C(0x1) << 22)
75253 		#define DBC_DBC32_PATH_LAST DBC_DBC32_PATH_L2
75254 	/*
75255 	 * When abs=0, this value is the value to add to the appropriate
75256 	 * index value.
75257 	 *
75258 	 * When abs=1, this value is the new value for the index.  Absolute
75259 	 * value is used when the queue is being wrapped.  When abs=1,
75260 	 * the incr value follows the same rules as the index value
75261 	 * in the 64b doorbell.
75262 	 */
75263 	#define DBC_DBC32_INCR_MASK UINT32_C(0xf000000)
75264 	#define DBC_DBC32_INCR_SFT 24
75265 	/* This value defines how the incr value will be interpreted. */
75266 	#define DBC_DBC32_ABS	UINT32_C(0x10000000)
75267 	/* This value identifies the type of doorbell being written. */
75268 	#define DBC_DBC32_TYPE_MASK UINT32_C(0xe0000000)
75269 	#define DBC_DBC32_TYPE_SFT 29
75270 	/*
75271 	 * This is a SQ producer index update.   It indicates one or more
75272 	 * new entries have been written to the SQ for the QPID indicated
75273 	 * on the xID field.
75274 	 */
75275 		#define DBC_DBC32_TYPE_SQ	(UINT32_C(0x0) << 29)
75276 		#define DBC_DBC32_TYPE_LAST DBC_DBC32_TYPE_SQ
75277 } dbc_dbc32_t, *pdbc_dbc32_t;
75278 
75279 /*
75280  * This is the 64b Push Start doorbell format. The host writes this message
75281  * format directly to offset of each push associated WCB (write combine
75282  * buffer) within doorbell page. WCB#0 = offset 16, WCB#1 = offset 24,
75283  * WCB#2 = offset 32, ... The start doorbell is followed by write combining
75284  * data to the WCB and then that is followed by a end doorbell.
75285  */
75286 /* db_push_start (size:64b/8B) */
75287 
75288 typedef struct db_push_start {
75289 	uint64_t	db;
75290 	/*
75291 	 * This is the push index and should be the SQ slot index, aligned
75292 	 * to the start of the corresponding push WQE/packet in the Send
75293 	 * Queue.
75294 	 *
75295 	 * The index size is 16b for RoCE path and 24b for L2 and Engine
75296 	 * paths. Any unused bits should be written as zero.
75297 	 *
75298 	 * The index unit is 16B for L2 path. For RoCE there is a legacy
75299 	 * mode with 128B unit size and a variable size mode with 16B unit
75300 	 * size. For Engine mode, the unit size is 16B, where RQEs are
75301 	 * always 128B - so it always increments by eight 16B slots per
75302 	 * RQE.
75303 	 *
75304 	 * > This field is not used by the older versions of the chip, but
75305 	 * > is used in this and future revisions of the chip. In older
75306 	 * > versions of the chip, the driver is required to complete the
75307 	 * > push doorbell operation by following it with a regular doorbell
75308 	 * > which will be used to properly increment the producer index.
75309 	 * > This extra doorbell write is not needed on this and future
75310 	 * > versions of the chip.
75311 	 */
75312 	#define DB_PUSH_START_DB_INDEX_MASK	UINT32_C(0xffffff)
75313 	#define DB_PUSH_START_DB_INDEX_SFT	0
75314 	/*
75315 	 * This value is the PI index (lower 8bits) within 4K DPI
75316 	 * associated with push write. It is the doorbell page that
75317 	 * contains the WCB that will be used.
75318 	 */
75319 	#define DB_PUSH_START_DB_PI_LO_MASK	UINT32_C(0xff000000)
75320 	#define DB_PUSH_START_DB_PI_LO_SFT	24
75321 	/*
75322 	 * This value identifies the resource that the doorbell is intended
75323 	 * to notify.
75324 	 *
75325 	 * This is the QPID.
75326 	 */
75327 	#define DB_PUSH_START_DB_XID_MASK	UINT32_C(0xfffff00000000)L
75328 	#define DB_PUSH_START_DB_XID_SFT	32
75329 	/*
75330 	 * This value is the PI index (upper 4bits) within 4K DPI
75331 	 * associated with push write. It is the doorbell page that
75332 	 * contains the WCB that will be used.
75333 	 */
75334 	#define DB_PUSH_START_DB_PI_HI_MASK	UINT32_C(0xf0000000000000)L
75335 	#define DB_PUSH_START_DB_PI_HI_SFT	52
75336 	/* This value identifies the type of doorbell being written. */
75337 	#define DB_PUSH_START_DB_TYPE_MASK	UINT32_C(0xf000000000000000)L
75338 	#define DB_PUSH_START_DB_TYPE_SFT	60
75339 	/*
75340 	 * This is a SQ producer index update for Push. It indicates
75341 	 * one or more new entries have been written to the SQ for the
75342 	 * QPID indicated on the `xid` field.
75343 	 */
75344 		#define DB_PUSH_START_DB_TYPE_PUSH_START  (UINT32_C(0xc)L << 60)
75345 	/*
75346 	 * This is a SQ producer index update for Push. It indicates
75347 	 * one or more new entries have been written to the SQ for the
75348 	 * QPID indicated on the `xid` field.
75349 	 */
75350 		#define DB_PUSH_START_DB_TYPE_PUSH_END	(UINT32_C(0xd)L << 60)
75351 		#define DB_PUSH_START_DB_TYPE_LAST	DB_PUSH_START_DB_TYPE_PUSH_END
75352 } db_push_start_t, *pdb_push_start_t;
75353 
75354 /*
75355  * This is the 64b Push End doorbell format. The host writes this message
75356  * format directly to offset of each push associated WCB (write combine
75357  * buffer) within doorbell page. WCB#0 = offset 16, WCB#1 = offset 24,
75358  * WCB#2 = offset 32, ... The start doorbell is followed by write combining
75359  * data to the WCB and then that is followed by a end doorbell.
75360  */
75361 /* db_push_end (size:64b/8B) */
75362 
75363 typedef struct db_push_end {
75364 	uint64_t	db;
75365 	/*
75366 	 * This is the producer index and should be the queue index of the
75367 	 * last WQE written plus the length field contained in that WQE.
75368 	 * For example, if the length is 8 index units and the WQE was
75369 	 * written to the first location in the queue (zero), this index
75370 	 * should be written to 8. The index should point to the start of
75371 	 * the first location that has not been filled in with WQE data.
75372 	 *
75373 	 * For L2 and Engine SQ, the index unit is 16B. For RoCE there are
75374 	 * two modes. For Legacy fixed size RQE mode, the unit is 128B. For
75375 	 * variable size RQE mode, the unit is 16B.
75376 	 *
75377 	 * The index size is 24b for L2 and engine paths and 16b for the
75378 	 * RoCE path. Unused bits should be written as zero.
75379 	 *
75380 	 * > In past revisions of this chip, this field was the push index
75381 	 * > rather than the producer index. For this version of the chip
75382 	 * > and future versions of the chip, this field must be the
75383 	 * > producer index, as described above.
75384 	 * >
75385 	 * > Also, in past revisions of this chip, an additional
75386 	 * > doorbell write was needed to communicate the producer index.
75387 	 * > In this and future versions of the chip, this extra doorbell
75388 	 * > write is no longer needed.
75389 	 */
75390 	#define DB_PUSH_END_DB_INDEX_MASK	UINT32_C(0xffffff)
75391 	#define DB_PUSH_END_DB_INDEX_SFT	0
75392 	/*
75393 	 * This value is the PI index (lower 8bits) within 4K DPI
75394 	 * associated with push write. It is the doorbell page that
75395 	 * contains the WCB that will be used.
75396 	 */
75397 	#define DB_PUSH_END_DB_PI_LO_MASK	UINT32_C(0xff000000)
75398 	#define DB_PUSH_END_DB_PI_LO_SFT	24
75399 	/*
75400 	 * This value identifies the resource that the doorbell is intended
75401 	 * to notify.
75402 	 *
75403 	 * This is the QPID.
75404 	 */
75405 	#define DB_PUSH_END_DB_XID_MASK	UINT32_C(0xfffff00000000)L
75406 	#define DB_PUSH_END_DB_XID_SFT	32
75407 	/*
75408 	 * This value is the PI index (upper 4bits) within 4K DPI
75409 	 * associated with push write. It is the doorbell page that
75410 	 * contains the WCB that will be used.
75411 	 */
75412 	#define DB_PUSH_END_DB_PI_HI_MASK	UINT32_C(0xf0000000000000)L
75413 	#define DB_PUSH_END_DB_PI_HI_SFT	52
75414 	/*
75415 	 * This value defines the intended doorbell path between RoCE and
75416 	 * L2.
75417 	 */
75418 	#define DB_PUSH_END_DB_PATH_MASK	UINT32_C(0x300000000000000)L
75419 	#define DB_PUSH_END_DB_PATH_SFT	56
75420 	/* This is a RoCE doorbell message. */
75421 		#define DB_PUSH_END_DB_PATH_ROCE	(UINT32_C(0x0)L << 56)
75422 	/* This is a L2 doorbell message. */
75423 		#define DB_PUSH_END_DB_PATH_L2	(UINT32_C(0x1)L << 56)
75424 	/* Engine path doorbell. */
75425 		#define DB_PUSH_END_DB_PATH_ENGINE	(UINT32_C(0x2)L << 56)
75426 		#define DB_PUSH_END_DB_PATH_LAST	DB_PUSH_END_DB_PATH_ENGINE
75427 	/*
75428 	 * When this bit is set to one, the chip will capture debug
75429 	 * information for the doorbell ring. This is intended to only be
75430 	 * used on SQ doorbell rings.
75431 	 */
75432 	#define DB_PUSH_END_DB_DEBUG_TRACE	UINT32_C(0x800000000000000)L
75433 	/* This value identifies the type of doorbell being written. */
75434 	#define DB_PUSH_END_DB_TYPE_MASK	UINT32_C(0xf000000000000000)L
75435 	#define DB_PUSH_END_DB_TYPE_SFT	60
75436 	/*
75437 	 * This is a SQ producer index update for Push. It indicates
75438 	 * one or more new entries have been written to the SQ for the
75439 	 * QPID indicated on the `xid` field.
75440 	 */
75441 		#define DB_PUSH_END_DB_TYPE_PUSH_START   (UINT32_C(0xc)L << 60)
75442 	/*
75443 	 * This is a SQ producer index update for Push. It indicates
75444 	 * one or more new entries have been written to the SQ for the
75445 	 * QPID indicated on the `xid` field.
75446 	 */
75447 		#define DB_PUSH_END_DB_TYPE_PUSH_END	(UINT32_C(0xd)L << 60)
75448 		#define DB_PUSH_END_DB_TYPE_LAST	DB_PUSH_END_DB_TYPE_PUSH_END
75449 } db_push_end_t, *pdb_push_end_t;
75450 
75451 /*
75452  * This is the Push information that is the second 8B of the Push
75453  * Doorbell.
75454  */
75455 /* db_push_info (size:64b/8B) */
75456 
75457 typedef struct db_push_info {
75458 	uint32_t	push_size_push_index;
75459 	/*
75460 	 * This value is the index for the push being started. For
75461 	 * example, if the push_size is 8 index units and the WQE was
75462 	 * written to the first location in the queue (zero), this
75463 	 * push_index should be written to 0. The push_index should point
75464 	 * to the start of the first location that the push is started.
75465 	 *
75466 	 * The push_index unit is 16B, except in RoCE legacy WQE mode, in
75467 	 * which case the unit is 128B.
75468 	 *
75469 	 * The push_index size is 24b for L2 and 16b for the RoCE path.
75470 	 * Unused bits should be written as zero.
75471 	 */
75472 	#define DB_PUSH_INFO_PUSH_INDEX_MASK UINT32_C(0xffffff)
75473 	#define DB_PUSH_INFO_PUSH_INDEX_SFT 0
75474 	/*
75475 	 * This value defines the size of push. The unit is 8B. The value
75476 	 * 0 means 256B size of push. The push write is done in 8B units
75477 	 * by the SW.
75478 	 *
75479 	 * Note: For packet rate performance reasons, it is recommended
75480 	 * that SW aligns push requests with a granularity of 16B.
75481 	 */
75482 	#define DB_PUSH_INFO_PUSH_SIZE_MASK UINT32_C(0x1f000000)
75483 	#define DB_PUSH_INFO_PUSH_SIZE_SFT  24
75484 	uint32_t	reserved32;
75485 } db_push_info_t, *pdb_push_info_t;
75486 
75487 /*
75488  * This is the "Absolute" 32b Doorbell format. The host writes this
75489  * message format directly to byte offset 0xC of the appropriate
75490  * doorbell page.
75491  *
75492  * Absolute doorbells are supported for only a limited number of
75493  * functions and for a limited number of xID values within each
75494  * function.
75495  *
75496  * Doorbell recovery can be supported for absolute 32b doorbells.
75497  */
75498 /* dbc_absolute_db_32 (size:32b/4B) */
75499 
75500 typedef struct dbc_absolute_db_32 {
75501 	uint32_t	index;
75502 	/*
75503 	 * This value is the index being written. For SQ, RQ, SRQ, this is
75504 	 * the producer index and should be the queue index of the last WQE
75505 	 * or BD written plus the length field contained in that WQE/BD.
75506 	 * For example, if the length is 8 index units and the WQE was
75507 	 * written to the first location in the queue (zero), this index
75508 	 * should be written to 8. The index should point to the start of
75509 	 * the first location that has not been filled in with WQE/BD data.
75510 	 *
75511 	 * For CQ, this is the consumer index and should be the starting
75512 	 * queue index of the last CQE processed plus the size of the last
75513 	 * processed CQE in index units. The index should point to the start
75514 	 * of the first CQE in the queue that has not been processed.
75515 	 *
75516 	 * For NQ, this is the consumer index and should be the starting
75517 	 * queue index of the last NQE processed plus the size of the last
75518 	 * processed NQE in index units. The index should point to the start
75519 	 * of the first NQE in the queue that has not been processed.
75520 	 *
75521 	 * For L2 and Engine SQ, the index unit is 16B. For RoCE there are
75522 	 * two modes. For Legacy fixed size RQE mode, the unit is 128B. For
75523 	 * variable size RQE mode, the unit is 16B. For RoCE and engine CQs,
75524 	 * the index unit is 32B. For L2 CQs, the index unit is 16B.
75525 	 *
75526 	 * For NQ this is the consumer index and the unit is always 16B of
75527 	 * queue space.
75528 	 *
75529 	 * The index size is 16b for all queue types. This limits the size
75530 	 * of some queues when absolute doorbells are in use. Unused bits
75531 	 * should be written as zero.
75532 	 */
75533 	#define DBC_ABSOLUTE_DB_32_INDEX_MASK	UINT32_C(0xffff)
75534 	#define DBC_ABSOLUTE_DB_32_INDEX_SFT	0
75535 	/*
75536 	 * The epoch bit provides a frame of reference for the queue index.
75537 	 * S/W will toggle this bit in the doorbell each time index range is
75538 	 * wrapped. This allows the receiving HW block to more efficiently
75539 	 * detect out-of-order doorbells and to ignore the older doorbells.
75540 	 * Out-of-order doorbells occur normally during dropped doorbell
75541 	 * recovery.
75542 	 */
75543 	#define DBC_ABSOLUTE_DB_32_EPOCH		UINT32_C(0x10000)
75544 	/*
75545 	 * The resize_toggle bit tells that the CQ cutoff is done.
75546 	 * Every time CQ is resized by CQ cutoff, this bit toggles when it
75547 	 * is done. If this bit toggles, HW can restart to use the resized
75548 	 * CQ.
75549 	 */
75550 	#define DBC_ABSOLUTE_DB_32_RESIZE_TOGGLE	UINT32_C(0x20000)
75551 	/*
75552 	 * This value identifies the resource that the doorbell is intended
75553 	 * to notify.
75554 	 *
75555 	 * This is a "modified" xID value. The DBR block will convert this
75556 	 * value into the full xID value by looking up the base xID for this
75557 	 * particular function and adding the mxID value to that base value.
75558 	 */
75559 	#define DBC_ABSOLUTE_DB_32_MXID_MASK	UINT32_C(0xfc0000)
75560 	#define DBC_ABSOLUTE_DB_32_MXID_SFT	18
75561 	/*
75562 	 * This value defines the intended doorbell path between RoCE and
75563 	 * L2.
75564 	 */
75565 	#define DBC_ABSOLUTE_DB_32_PATH_MASK	UINT32_C(0x3000000)
75566 	#define DBC_ABSOLUTE_DB_32_PATH_SFT	24
75567 	/* This is a RoCE doorbell message. */
75568 		#define DBC_ABSOLUTE_DB_32_PATH_ROCE	(UINT32_C(0x0) << 24)
75569 	/* This is a L2 doorbell message. */
75570 		#define DBC_ABSOLUTE_DB_32_PATH_L2		(UINT32_C(0x1) << 24)
75571 		#define DBC_ABSOLUTE_DB_32_PATH_LAST	DBC_ABSOLUTE_DB_32_PATH_L2
75572 	/*
75573 	 * This indicates it is valid doorbell update. It should be set for
75574 	 * each doorbell written to the chip and set when doorbell message is
75575 	 * written to the backup doorbell location. The bit should be cleared
75576 	 * in the backup doorbell location at time zero to indicate that the
75577 	 * backup doorbell has not yet been written.
75578 	 */
75579 	#define DBC_ABSOLUTE_DB_32_VALID		UINT32_C(0x4000000)
75580 	/*
75581 	 * When this bit is set to one, the chip will capture debug
75582 	 * information for the doorbell ring. This is intended to only be
75583 	 * used on SQ doorbell rings.
75584 	 */
75585 	#define DBC_ABSOLUTE_DB_32_DEBUG_TRACE	UINT32_C(0x8000000)
75586 	/* This value identifies the type of doorbell being written. */
75587 	#define DBC_ABSOLUTE_DB_32_TYPE_MASK	UINT32_C(0xf0000000)
75588 	#define DBC_ABSOLUTE_DB_32_TYPE_SFT	28
75589 	/*
75590 	 * This is a SQ producer index update.   It indicates one or more
75591 	 * new entries have been written to the SQ for the QPID indicated
75592 	 * on the xID field. This type is valid for L2, RoCE and Engine
75593 	 * path.
75594 	 */
75595 		#define DBC_ABSOLUTE_DB_32_TYPE_SQ		(UINT32_C(0x0) << 28)
75596 	/*
75597 	 * This is a RQ producer index update.   It indicates one or more
75598 	 * new entries have been written to the RQ for the QPID indicated
75599 	 * on the xID field. This type is valid for RoCE path.
75600 	 */
75601 		#define DBC_ABSOLUTE_DB_32_TYPE_RQ		(UINT32_C(0x1) << 28)
75602 	/*
75603 	 * This is a SRQ producer index update.   It indicates one or more
75604 	 * new entries have been written to the SRQ for the SID indicated
75605 	 * on the xID field. This type is valid for L2 and RoCE path.
75606 	 */
75607 		#define DBC_ABSOLUTE_DB_32_TYPE_SRQ		(UINT32_C(0x2) << 28)
75608 	/*
75609 	 * This doorbell command arms the SRQ async event.
75610 	 * The xID field must identify the SID that is begin armed.
75611 	 * The index field is will set the arm threshold such that
75612 	 * a notification will be generated if less than that number
75613 	 * or SRQ entries are posted. This type is valid for RoCE path.
75614 	 */
75615 		#define DBC_ABSOLUTE_DB_32_TYPE_SRQ_ARM	(UINT32_C(0x3) << 28)
75616 	/*
75617 	 * This is a CQ consumer index update.   It indicates one or more
75618 	 * entries have been processed off the CQ indicated on the xID
75619 	 * field.This type is valid for L2, RoCE and Engine path.
75620 	 */
75621 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ		(UINT32_C(0x4) << 28)
75622 	/*
75623 	 * this is a CQ consumer index update that also arms the CQ for
75624 	 * solicited events. This type is valid for RoCE path.
75625 	 */
75626 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMSE	(UINT32_C(0x5) << 28)
75627 	/*
75628 	 * This is a CQ consumer index update that also arms the CQ
75629 	 * for any new CQE. This type is valid for L2, RoCE and Engine
75630 	 * path.
75631 	 */
75632 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMALL	(UINT32_C(0x6) << 28)
75633 	/*
75634 	 * This is a NQ consumer index update. It indicates one or more
75635 	 * entries have been processed off the NQ indicated on the xID
75636 	 * field. This type is valid for L2, RoCE and Engine path.
75637 	 */
75638 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ		(UINT32_C(0xa) << 28)
75639 	/*
75640 	 * This is a NQ consumer index update that also arms the NQ for
75641 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
75642 	 */
75643 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ_ARM	(UINT32_C(0xb) << 28)
75644 	/*
75645 	 * This is a NQ consumer index update that also arms the NQ for
75646 	 * any new NQE. It is used for the legacy INT mask. This type
75647 	 * is valid for L2, RoCE and Engine path.
75648 	 */
75649 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ_MASK	(UINT32_C(0xe) << 28)
75650 	/*
75651 	 * This doorbell command is used during doorbell moderation
75652 	 * to consume system BW and help prevent doorbell FIFO
75653 	 * overflow.
75654 	 *
75655 	 * All other fields should be zero for NULL doorbell.
75656 	 * For doorbell recovery, NULL doorbell type in the Application
75657 	 * table indicates that it is the last QP entry for the function.
75658 	 * This type is valid for L2, RoCE and Engine path.
75659 	 */
75660 		#define DBC_ABSOLUTE_DB_32_TYPE_NULL	(UINT32_C(0xf) << 28)
75661 		#define DBC_ABSOLUTE_DB_32_TYPE_LAST	DBC_ABSOLUTE_DB_32_TYPE_NULL
75662 } dbc_absolute_db_32_t, *pdbc_absolute_db_32_t;
75663 
75664 /*
75665  * This is the "Relative" 32b Doorbell format. The host writes this
75666  * message format directly to byte offset 8 of the appropriate doorbell
75667  * page.
75668  *
75669  * Doorbell recovery can not be supported for relative doorbells. So
75670  * relative doorbells are only safe to use when SOC is supporting the
75671  * context backing store in local DDR. If that is the case, it is safe
75672  * to turn off doorbell drops and use this type of doorbell.
75673  */
75674 /* dbc_relative_db_32 (size:32b/4B) */
75675 
75676 typedef struct dbc_relative_db_32 {
75677 	uint32_t	xid;
75678 	/*
75679 	 * This value identifies the resource that the doorbell is intended
75680 	 * to notify.
75681 	 *
75682 	 * For SQ, this is the QPID value.
75683 	 */
75684 	#define DBC_RELATIVE_DB_32_XID_MASK	UINT32_C(0xfffff)
75685 	#define DBC_RELATIVE_DB_32_XID_SFT	0
75686 	/*
75687 	 * This value defines the intended doorbell path between RoCE and
75688 	 * L2.
75689 	 */
75690 	#define DBC_RELATIVE_DB_32_PATH_MASK	UINT32_C(0xc00000)
75691 	#define DBC_RELATIVE_DB_32_PATH_SFT	22
75692 	/* This is a RoCE doorbell message. */
75693 		#define DBC_RELATIVE_DB_32_PATH_ROCE	(UINT32_C(0x0) << 22)
75694 	/* This is a L2 doorbell message. */
75695 		#define DBC_RELATIVE_DB_32_PATH_L2	(UINT32_C(0x1) << 22)
75696 		#define DBC_RELATIVE_DB_32_PATH_LAST	DBC_RELATIVE_DB_32_PATH_L2
75697 	/*
75698 	 * This value is the value to add to the appropriate index value.
75699 	 *
75700 	 * The increment unit is 16B for L2 path. For RoCE there is a
75701 	 * legacy mode with 128B unit size and a variable size mode with
75702 	 * 32B unit size. For Engine mode, the unit size is always 128B.
75703 	 */
75704 	#define DBC_RELATIVE_DB_32_INCR_MASK	UINT32_C(0x1f000000)
75705 	#define DBC_RELATIVE_DB_32_INCR_SFT	24
75706 	/* This value identifies the type of doorbell being written. */
75707 	#define DBC_RELATIVE_DB_32_TYPE_MASK	UINT32_C(0xe0000000)
75708 	#define DBC_RELATIVE_DB_32_TYPE_SFT	29
75709 	/*
75710 	 * This is a SQ producer index update.   It indicates one or more
75711 	 * new entries have been written to the SQ for the QPID indicated
75712 	 * on the xID field. This type is valid for L2, RoCE and Engine
75713 	 * path.
75714 	 */
75715 		#define DBC_RELATIVE_DB_32_TYPE_SQ	(UINT32_C(0x0) << 29)
75716 	/*
75717 	 * This is a SRQ producer index update.   It indicates one or more
75718 	 * new entries have been written to the SRQ for the SID indicated
75719 	 * on the xID field. This type is valid for L2 and RoCE path.
75720 	 */
75721 		#define DBC_RELATIVE_DB_32_TYPE_SRQ	(UINT32_C(0x1) << 29)
75722 	/*
75723 	 * This is a CQ consumer index update.   It indicates one or more
75724 	 * entries have been processed off the CQ indicated on the xID
75725 	 * field.This type is valid for L2, RoCE and Engine path.
75726 	 */
75727 		#define DBC_RELATIVE_DB_32_TYPE_CQ	(UINT32_C(0x2) << 29)
75728 	/*
75729 	 * This is a CQ consumer index update that also arms the CQ
75730 	 * for any new CQE. This type is valid for L2, RoCE and Engine
75731 	 * path.
75732 	 */
75733 		#define DBC_RELATIVE_DB_32_TYPE_CQ_ARMALL  (UINT32_C(0x3) << 29)
75734 	/*
75735 	 * This is a NQ consumer index update. It indicates one or more
75736 	 * entries have been processed off the NQ indicated on the xID
75737 	 * field. This type is valid for L2, RoCE and Engine path.
75738 	 */
75739 		#define DBC_RELATIVE_DB_32_TYPE_NQ	(UINT32_C(0x4) << 29)
75740 	/*
75741 	 * This is a NQ consumer index update that also arms the NQ for
75742 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
75743 	 */
75744 		#define DBC_RELATIVE_DB_32_TYPE_NQ_ARM	(UINT32_C(0x5) << 29)
75745 	/*
75746 	 * This is a NQ consumer index update that also arms the NQ for
75747 	 * any new NQE. It is used for the legacy INT mask. This type
75748 	 * is valid for L2, RoCE and Engine path.
75749 	 */
75750 		#define DBC_RELATIVE_DB_32_TYPE_NQ_MASK	(UINT32_C(0x6) << 29)
75751 		#define DBC_RELATIVE_DB_32_TYPE_LAST	DBC_RELATIVE_DB_32_TYPE_NQ_MASK
75752 } dbc_relative_db_32_t, *pdbc_relative_db_32_t;
75753 
75754 /*
75755  * The kernel memory structure is per-type (SQ, RQ, SRQ/SRQ_ARM and
75756  * CQ/CQ_ARMSE/CQ_ARMALL). Each kernel driver will support a table for
75757  * the doorbell recovery.
75758  */
75759 /* dbc_drk (size:128b/16B) */
75760 
75761 typedef struct dbc_drk {
75762 	uint32_t	db_format_linked_last_valid;
75763 	/*
75764 	 * This indicates it is valid entry. It should be set for each
75765 	 * doorbell written to the chip. The bit should be cleared at time
75766 	 * zero to indicate that it has not yet been written. The bit i
75767 	 * should be cleared when the function for the table is disabled.
75768 	 */
75769 	#define DBC_DRK_VALID	UINT32_C(0x1)
75770 	/* This indicates it is last entry for the table. */
75771 	#define DBC_DRK_LAST	UINT32_C(0x2)
75772 	/* This indicates it is entry for the next 4KB kernel memory pointer. */
75773 	#define DBC_DRK_LINKED	UINT32_C(0x4)
75774 	/*
75775 	 * This field indicates if the doorbells in the table are 32b
75776 	 * absolute or 64b format.
75777 	 */
75778 	#define DBC_DRK_DB_FORMAT	UINT32_C(0x8)
75779 	/* The doorbells are 64b format. */
75780 		#define DBC_DRK_DB_FORMAT_B64   (UINT32_C(0x0) << 3)
75781 	/*
75782 	 * The doorbells are in the absolute 32b format. The doorbell
75783 	 * is in the right-most half of the 64b space provided in the
75784 	 * application table entry.
75785 	 */
75786 		#define DBC_DRK_DB_FORMAT_B32A  (UINT32_C(0x1) << 3)
75787 		#define DBC_DRK_DB_FORMAT_LAST DBC_DRK_DB_FORMAT_B32A
75788 	uint32_t	pi;
75789 	/*
75790 	 * Page Index portion of DPI{VF_VALID,VFID,PI}. The pi needs to match
75791 	 * the value from the context DPI for the operation to be valid or the
75792 	 * pi must be zero, indicating a write from the privileged driver.
75793 	 *
75794 	 * pi in the kernel memory table is there for DBR to generate the DPI
75795 	 * message to the client.
75796 	 */
75797 	#define DBC_DRK_PI_MASK UINT32_C(0xffff)
75798 	#define DBC_DRK_PI_SFT 0
75799 	/*
75800 	 * It is the application memory page(4KB) pointer when linked = 0.
75801 	 * It is the next kernel memory page(4KB) pointer when linked = 1.
75802 	 * The pointer doesn't have to be aligned to the page(4KB) but it
75803 	 * should be aligned to 128B boundary. This means that the bottom
75804 	 * 7b of the pointer must be zero.
75805 	 */
75806 	uint64_t	memptr;
75807 } dbc_drk_t, *pdbc_drk_t;
75808 
75809 /*
75810  * This is a firmware status register that indicates the software status
75811  * exposed by the firmware to the host.
75812  *
75813  * > This register is not present in previous versions of this chip.
75814  */
75815 /* fw_status_reg (size:32b/4B) */
75816 
75817 typedef struct fw_status_reg {
75818 	uint32_t	fw_status;
75819 	/*
75820 	 * These bits indicate the status as being reported by the firmware.
75821 	 *
75822 	 * The value should be interpreted as follows:
75823 	 * A value below 0x8000 is an indication that the firmware is still in the
75824 	 * process of starting up and is not ready. The host driver should
75825 	 * continue waiting with a timeout for firmware status to be ready.
75826 	 * >	0x0000 to 0x00FF : SBL state information
75827 	 * >	0x0200 to 0x02FF : SBI state information
75828 	 * >	0x0400 to 0x04FF : SRT state information
75829 	 * >	0x0600 to 0x06FF : CRT/CHIMP state information
75830 	 * >	0x0800 to 0x08FF : External Firmware state information
75831 	 * >	0x0A00 to 0x0FFF : Reserved for future fw functionality
75832 	 *
75833 	 * A value of 0x8000 indicates firmware is ready and healthy. The host
75834 	 * driver can start initiating HWRM commands to the firmware.
75835 	 *
75836 	 * A value over 0x8000 is an indication that the firmware has detected
75837 	 * a fatal error, this error could be in one of the hardware block or
75838 	 * in a software module. The lower 8 bits indicate a block/module
75839 	 * specific error and the upper 8 bits identify the hardware block
75840 	 * or firmware module that was the source of the error.
75841 	 * >	0x81XX - 0xBFXX  : 63 ASIC blocks
75842 	 * >	0xC0XX to 0xFDXX : 62 Firmware modules
75843 	 * >	0xFE00 to 0xFEFF : External firmware module
75844 	 * >	0xFFXX	: Reserved for future
75845 	 */
75846 	#define FW_STATUS_REG_CODE_MASK		UINT32_C(0xffff)
75847 	#define FW_STATUS_REG_CODE_SFT		0
75848 	/* Indicates firmware is ready. */
75849 		#define FW_STATUS_REG_CODE_READY		UINT32_C(0x8000)
75850 		#define FW_STATUS_REG_CODE_LAST		FW_STATUS_REG_CODE_READY
75851 	/*
75852 	 * Image Degraded bit. If set indicates that one of the firmware
75853 	 * image is degraded.
75854 	 *
75855 	 * The firmware binary located on NVM has redundant copies to protect
75856 	 * against corruption. When one of the primary or secondary copy is
75857 	 * detected as corrupted, this bit will be set by the firmware either
75858 	 * as part of power on from the context of hwrm_fw_health_check.
75859 	 */
75860 	#define FW_STATUS_REG_IMAGE_DEGRADED	UINT32_C(0x10000)
75861 	/*
75862 	 * Recoverable bit. If set indicates that the fatal error is
75863 	 * recoverable with a full reset.
75864 	 *
75865 	 * This bit should be used by host software and deployment models
75866 	 * that support error recovery by resetting the controller. A recovery
75867 	 * should be attempted from a fatal error condition only if this bit
75868 	 * is set. This bit is meaningful only when the code field is greater
75869 	 * than 0x8000 (32768 decimal).
75870 	 */
75871 	#define FW_STATUS_REG_RECOVERABLE		UINT32_C(0x20000)
75872 	/*
75873 	 * Crash dump is in process. If set indicates that the firmware is
75874 	 * currently recording a crash dump.
75875 	 *
75876 	 * This bit provides a hint to the host driver if the firmware is
75877 	 * currently recording a crash dump. Host driers should avoid resetting
75878 	 * the controller when a crash dump is in progress if possible. This
75879 	 * bit is meaningful only when the code field is greater than
75880 	 * 0x8000 (32768 decimal).
75881 	 */
75882 	#define FW_STATUS_REG_CRASHDUMP_ONGOING	UINT32_C(0x40000)
75883 	/*
75884 	 * Crash dump is available. If set indicates that a firmware crash dump
75885 	 * was recorded before and is now available.
75886 	 *
75887 	 * This bit provides indication to the host driver that the firmware has
75888 	 * completed a crash dump. This bit is meaningful only when the code
75889 	 * field is greater than 0x8000 (32768 decimal).
75890 	 */
75891 	#define FW_STATUS_REG_CRASHDUMP_COMPLETE	UINT32_C(0x80000)
75892 	/*
75893 	 * This bit is used to indicate device state when it enters the shutdown mode
75894 	 * and stopped the communication with the host. The host should initiate the
75895 	 * reload of firmware image or initiate the reset to bring the device to the
75896 	 * normal operational state and re-establish the communication.
75897 	 *
75898 	 * This bit is meaningful only when the code field is greater than 0x8000
75899 	 * (32768 decimal).
75900 	 */
75901 	#define FW_STATUS_REG_SHUTDOWN		UINT32_C(0x100000)
75902 	/*
75903 	 * This bit will be set to 1 by the FW when FW crashed without master
75904 	 * function.
75905 	 *
75906 	 * This bit is controller specific, not all products will support this bit.
75907 	 * This bit is valid only when the code field is greater than 0x8000
75908 	 * (32768 decimal).
75909 	 */
75910 	#define FW_STATUS_REG_CRASHED_NO_MASTER	UINT32_C(0x200000)
75911 	/*
75912 	 * The firmware sets this bit to 1 when the firmware has taken an exception
75913 	 * and expects to initiate error recovery.
75914 	 *
75915 	 * This bit is valid only when the code field is greater than 0x8000
75916 	 * (32768 decimal).
75917 	 */
75918 	#define FW_STATUS_REG_RECOVERING		UINT32_C(0x400000)
75919 	/*
75920 	 * The SBL sets this bit to indicate whether manu_debug pin is detected high
75921 	 * or low.
75922 	 */
75923 	#define FW_STATUS_REG_MANU_DEBUG_STATUS	UINT32_C(0x800000)
75924 } fw_status_reg_t, *pfw_status_reg_t;
75925 
75926 /*
75927  * This structure is fixed at the beginning of the ChiMP SRAM (GRC
75928  * offset: 0x31001F0). Host software is expected to read from this
75929  * location for a defined signature. If it exists, the software can
75930  * assume the presence of this structure and the validity of the
75931  * FW_STATUS location in the next field.
75932  */
75933 /* hcomm_status (size:64b/8B) */
75934 
75935 typedef struct hcomm_status {
75936 	uint32_t	sig_ver;
75937 	/*
75938 	 * This field defines the version of the structure. The latest
75939 	 * version value is 1.
75940 	 */
75941 	#define HCOMM_STATUS_VER_MASK	UINT32_C(0xff)
75942 	#define HCOMM_STATUS_VER_SFT	0
75943 		#define HCOMM_STATUS_VER_LATEST	UINT32_C(0x1)
75944 		#define HCOMM_STATUS_VER_LAST	HCOMM_STATUS_VER_LATEST
75945 	/*
75946 	 * This field is to store the signature value to indicate the
75947 	 * presence of the structure.
75948 	 */
75949 	#define HCOMM_STATUS_SIGNATURE_MASK UINT32_C(0xffffff00)
75950 	#define HCOMM_STATUS_SIGNATURE_SFT 8
75951 		#define HCOMM_STATUS_SIGNATURE_VAL   (UINT32_C(0x484353) << 8)
75952 		#define HCOMM_STATUS_SIGNATURE_LAST HCOMM_STATUS_SIGNATURE_VAL
75953 	uint32_t	fw_status_loc;
75954 	#define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK	UINT32_C(0x3)
75955 	#define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT	0
75956 	/* PCIE configuration space */
75957 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
75958 	/* GRC space */
75959 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC	UINT32_C(0x1)
75960 	/* BAR0 space */
75961 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0	UINT32_C(0x2)
75962 	/* BAR1 space */
75963 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1	UINT32_C(0x3)
75964 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST	HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
75965 	/*
75966 	 * This offset where the fw_status register is located. The value
75967 	 * is generally 4-byte aligned.
75968 	 */
75969 	#define HCOMM_STATUS_TRUE_OFFSET_MASK	UINT32_C(0xfffffffc)
75970 	#define HCOMM_STATUS_TRUE_OFFSET_SFT	2
75971 } hcomm_status_t, *phcomm_status_t;
75972 
75973 /* This is the GRC offset where the hcomm_status struct resides. */
75974 #define HCOMM_STATUS_STRUCT_LOC 0x31001F0UL
75975 
75976 /***********************
75977  * hwrm_selftest_qlist *
75978  ***********************/
75979 
75980 
75981 /* hwrm_selftest_qlist_input (size:128b/16B) */
75982 
75983 typedef struct hwrm_selftest_qlist_input {
75984 	/* The HWRM command request type. */
75985 	uint16_t	req_type;
75986 	/*
75987 	 * The completion ring to send the completion event on. This should
75988 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
75989 	 */
75990 	uint16_t	cmpl_ring;
75991 	/*
75992 	 * The sequence ID is used by the driver for tracking multiple
75993 	 * commands. This ID is treated as opaque data by the firmware and
75994 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
75995 	 */
75996 	uint16_t	seq_id;
75997 	/*
75998 	 * The target ID of the command:
75999 	 * * 0x0-0xFFF8 - The function ID
76000 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76001 	 * * 0xFFFD - Reserved for user-space HWRM interface
76002 	 * * 0xFFFF - HWRM
76003 	 */
76004 	uint16_t	target_id;
76005 	/*
76006 	 * A physical address pointer pointing to a host buffer that the
76007 	 * command's response data will be written. This can be either a host
76008 	 * physical address (HPA) or a guest physical address (GPA) and must
76009 	 * point to a physically contiguous block of memory.
76010 	 */
76011 	uint64_t	resp_addr;
76012 } hwrm_selftest_qlist_input_t, *phwrm_selftest_qlist_input_t;
76013 
76014 /* hwrm_selftest_qlist_output (size:2240b/280B) */
76015 
76016 typedef struct hwrm_selftest_qlist_output {
76017 	/* The specific error status for the command. */
76018 	uint16_t	error_code;
76019 	/* The HWRM command request type. */
76020 	uint16_t	req_type;
76021 	/* The sequence ID from the original command. */
76022 	uint16_t	seq_id;
76023 	/* The length of the response data in number of bytes. */
76024 	uint16_t	resp_len;
76025 	/*
76026 	 * This field represents the number of tests available to be
76027 	 * requested by a driver.
76028 	 */
76029 	uint8_t	num_tests;
76030 	/* This field indicates which self-test is available to be run. */
76031 	uint8_t	available_tests;
76032 	/* Can run the NVM test. */
76033 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_NVM_TEST		UINT32_C(0x1)
76034 	/* Can run the link test. */
76035 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_LINK_TEST		UINT32_C(0x2)
76036 	/* Can run the register test. */
76037 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_REGISTER_TEST		UINT32_C(0x4)
76038 	/* Can run the memory test. */
76039 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_MEMORY_TEST		UINT32_C(0x8)
76040 	/* Can run the PCIe serdes test. */
76041 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
76042 	/* Can run the Ethernet serdes test. */
76043 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76044 	uint8_t	offline_tests;
76045 	/* The NVM test is an offline test. */
76046 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_NVM_TEST		UINT32_C(0x1)
76047 	/* The link test is an offline test. */
76048 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_LINK_TEST		UINT32_C(0x2)
76049 	/* The register test is an offline test. */
76050 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_REGISTER_TEST		UINT32_C(0x4)
76051 	/* The memory test is an offline test. */
76052 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_MEMORY_TEST		UINT32_C(0x8)
76053 	/* The PCIe serdes test is an offline test. */
76054 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
76055 	/* The Ethernet serdes test is an offline test. */
76056 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76057 	uint8_t	unused_0;
76058 	/*
76059 	 * This field represents the maximum timeout for all the
76060 	 * tests to complete in milliseconds.
76061 	 */
76062 	uint16_t	test_timeout;
76063 	uint8_t	unused_1[2];
76064 	/*
76065 	 * This field represents the name of the NVM test (ASCII chars
76066 	 * with NULL at the end).
76067 	 */
76068 	char	test0_name[32];
76069 	/*
76070 	 * This field represents the name of the link test (ASCII chars
76071 	 * with NULL at the end).
76072 	 */
76073 	char	test1_name[32];
76074 	/*
76075 	 * This field represents the name of the register test (ASCII chars
76076 	 * with NULL at the end).
76077 	 */
76078 	char	test2_name[32];
76079 	/*
76080 	 * This field represents the name of the memory test (ASCII chars
76081 	 * with NULL at the end).
76082 	 */
76083 	char	test3_name[32];
76084 	/*
76085 	 * This field represents the name of the PCIe serdes test (ASCII chars
76086 	 * with NULL at the end).
76087 	 */
76088 	char	test4_name[32];
76089 	/*
76090 	 * This field represents the name of the Ethernet serdes test (ASCII chars
76091 	 * with NULL at the end).
76092 	 */
76093 	char	test5_name[32];
76094 	/*
76095 	 * This field represents the name of some future test (ASCII chars
76096 	 * with NULL at the end).
76097 	 */
76098 	char	test6_name[32];
76099 	/*
76100 	 * This field represents the name of some future test (ASCII chars
76101 	 * with NULL at the end).
76102 	 */
76103 	char	test7_name[32];
76104 	/*
76105 	 * The lowest available target BER that is supported by FW eyescope.
76106 	 * A Value of 3 indicates that FW supports 1e-8, 1e-9, 1e-10, and 1e-11.
76107 	 */
76108 	uint8_t	eyescope_target_BER_support;
76109 	/* Eyescope supports a target BER of 1e-8 */
76110 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E8_SUPPORTED  UINT32_C(0x0)
76111 	/* Eyescope supports a target BER of 1e-9 */
76112 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E9_SUPPORTED  UINT32_C(0x1)
76113 	/* Eyescope supports a target BER of 1e-10 */
76114 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E10_SUPPORTED UINT32_C(0x2)
76115 	/* Eyescope supports a target BER of 1e-11 */
76116 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E11_SUPPORTED UINT32_C(0x3)
76117 	/* Eyescope supports a target BER of 1e-12 */
76118 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED UINT32_C(0x4)
76119 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_LAST		HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED
76120 	uint8_t	unused_2[6];
76121 	/*
76122 	 * This field is used in Output records to indicate that the output
76123 	 * is completely written to RAM.  This field should be read as '1'
76124 	 * to indicate that the output has been completely written.
76125 	 * When writing a command completion or response to an internal processor,
76126 	 * the order of writes has to be such that this field is written last.
76127 	 */
76128 	uint8_t	valid;
76129 } hwrm_selftest_qlist_output_t, *phwrm_selftest_qlist_output_t;
76130 
76131 /**********************
76132  * hwrm_selftest_exec *
76133  **********************/
76134 
76135 
76136 /* hwrm_selftest_exec_input (size:192b/24B) */
76137 
76138 typedef struct hwrm_selftest_exec_input {
76139 	/* The HWRM command request type. */
76140 	uint16_t	req_type;
76141 	/*
76142 	 * The completion ring to send the completion event on. This should
76143 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76144 	 */
76145 	uint16_t	cmpl_ring;
76146 	/*
76147 	 * The sequence ID is used by the driver for tracking multiple
76148 	 * commands. This ID is treated as opaque data by the firmware and
76149 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76150 	 */
76151 	uint16_t	seq_id;
76152 	/*
76153 	 * The target ID of the command:
76154 	 * * 0x0-0xFFF8 - The function ID
76155 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76156 	 * * 0xFFFD - Reserved for user-space HWRM interface
76157 	 * * 0xFFFF - HWRM
76158 	 */
76159 	uint16_t	target_id;
76160 	/*
76161 	 * A physical address pointer pointing to a host buffer that the
76162 	 * command's response data will be written. This can be either a host
76163 	 * physical address (HPA) or a guest physical address (GPA) and must
76164 	 * point to a physically contiguous block of memory.
76165 	 */
76166 	uint64_t	resp_addr;
76167 	/* This field indicates which self-test is being requested to run. */
76168 	uint8_t	flags;
76169 	/* Run the NVM test. */
76170 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_NVM_TEST		UINT32_C(0x1)
76171 	/* Run the link test. */
76172 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_LINK_TEST		UINT32_C(0x2)
76173 	/* Run the register test. */
76174 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_REGISTER_TEST		UINT32_C(0x4)
76175 	/* Run the memory test. */
76176 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_MEMORY_TEST		UINT32_C(0x8)
76177 	/* Run the PCIe serdes test. */
76178 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
76179 	/* Run the Ethernet serdes test. */
76180 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76181 	uint8_t	unused_0[7];
76182 } hwrm_selftest_exec_input_t, *phwrm_selftest_exec_input_t;
76183 
76184 /* hwrm_selftest_exec_output (size:128b/16B) */
76185 
76186 typedef struct hwrm_selftest_exec_output {
76187 	/* The specific error status for the command. */
76188 	uint16_t	error_code;
76189 	/* The HWRM command request type. */
76190 	uint16_t	req_type;
76191 	/* The sequence ID from the original command. */
76192 	uint16_t	seq_id;
76193 	/* The length of the response data in number of bytes. */
76194 	uint16_t	resp_len;
76195 	/* The following tests were requested to be run. */
76196 	uint8_t	requested_tests;
76197 	/* A request was made to run the NVM test. */
76198 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_NVM_TEST		UINT32_C(0x1)
76199 	/* A request was made to run the link test. */
76200 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_LINK_TEST		UINT32_C(0x2)
76201 	/* A request was made to run the register test. */
76202 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_REGISTER_TEST		UINT32_C(0x4)
76203 	/* A request was made to run the memory test. */
76204 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_MEMORY_TEST		UINT32_C(0x8)
76205 	/* A request was made to run the PCIe serdes test. */
76206 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
76207 	/* A request was made to run the Ethernet serdes test. */
76208 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76209 	/*
76210 	 * If a test was requested to be run as seen in the requested_tests field,
76211 	 * this bit indicates whether the test was successful(1) or failed(0).
76212 	 */
76213 	uint8_t	test_success;
76214 	/* If requested, a value of 1 indicates the NVM test completed successfully. */
76215 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_NVM_TEST		UINT32_C(0x1)
76216 	/* If requested, a value of 1 indicates the link test completed successfully. */
76217 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_LINK_TEST		UINT32_C(0x2)
76218 	/* If requested, a value of 1 indicates the register test completed successfully. */
76219 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_REGISTER_TEST		UINT32_C(0x4)
76220 	/* If requested, a value of 1 indicates the memory test completed successfully. */
76221 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_MEMORY_TEST		UINT32_C(0x8)
76222 	/* If requested, a value of 1 indicates the PCIe serdes test completed successfully. */
76223 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_PCIE_SERDES_TEST	UINT32_C(0x10)
76224 	/* If requested, a value of 1 indicates the Ethernet serdes test completed successfully. */
76225 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76226 	uint8_t	unused_0[5];
76227 	/*
76228 	 * This field is used in Output records to indicate that the output
76229 	 * is completely written to RAM.  This field should be read as '1'
76230 	 * to indicate that the output has been completely written.
76231 	 * When writing a command completion or response to an internal processor,
76232 	 * the order of writes has to be such that this field is written last.
76233 	 */
76234 	uint8_t	valid;
76235 } hwrm_selftest_exec_output_t, *phwrm_selftest_exec_output_t;
76236 
76237 /*********************
76238  * hwrm_selftest_irq *
76239  *********************/
76240 
76241 
76242 /* hwrm_selftest_irq_input (size:128b/16B) */
76243 
76244 typedef struct hwrm_selftest_irq_input {
76245 	/* The HWRM command request type. */
76246 	uint16_t	req_type;
76247 	/*
76248 	 * The completion ring to send the completion event on. This should
76249 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76250 	 */
76251 	uint16_t	cmpl_ring;
76252 	/*
76253 	 * The sequence ID is used by the driver for tracking multiple
76254 	 * commands. This ID is treated as opaque data by the firmware and
76255 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76256 	 */
76257 	uint16_t	seq_id;
76258 	/*
76259 	 * The target ID of the command:
76260 	 * * 0x0-0xFFF8 - The function ID
76261 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76262 	 * * 0xFFFD - Reserved for user-space HWRM interface
76263 	 * * 0xFFFF - HWRM
76264 	 */
76265 	uint16_t	target_id;
76266 	/*
76267 	 * A physical address pointer pointing to a host buffer that the
76268 	 * command's response data will be written. This can be either a host
76269 	 * physical address (HPA) or a guest physical address (GPA) and must
76270 	 * point to a physically contiguous block of memory.
76271 	 */
76272 	uint64_t	resp_addr;
76273 } hwrm_selftest_irq_input_t, *phwrm_selftest_irq_input_t;
76274 
76275 /* hwrm_selftest_irq_output (size:128b/16B) */
76276 
76277 typedef struct hwrm_selftest_irq_output {
76278 	/* The specific error status for the command. */
76279 	uint16_t	error_code;
76280 	/* The HWRM command request type. */
76281 	uint16_t	req_type;
76282 	/* The sequence ID from the original command. */
76283 	uint16_t	seq_id;
76284 	/* The length of the response data in number of bytes. */
76285 	uint16_t	resp_len;
76286 	uint8_t	unused_0[7];
76287 	/*
76288 	 * This field is used in Output records to indicate that the output
76289 	 * is completely written to RAM.  This field should be read as '1'
76290 	 * to indicate that the output has been completely written.
76291 	 * When writing a command completion or response to an internal processor,
76292 	 * the order of writes has to be such that this field is written last.
76293 	 */
76294 	uint8_t	valid;
76295 } hwrm_selftest_irq_output_t, *phwrm_selftest_irq_output_t;
76296 
76297 /**************************************
76298  * hwrm_selftest_retrieve_serdes_data *
76299  **************************************/
76300 
76301 
76302 /* hwrm_selftest_retrieve_serdes_data_input (size:320b/40B) */
76303 
76304 typedef struct hwrm_selftest_retrieve_serdes_data_input {
76305 	/* The HWRM command request type. */
76306 	uint16_t	req_type;
76307 	/*
76308 	 * The completion ring to send the completion event on. This should
76309 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76310 	 */
76311 	uint16_t	cmpl_ring;
76312 	/*
76313 	 * The sequence ID is used by the driver for tracking multiple
76314 	 * commands. This ID is treated as opaque data by the firmware and
76315 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76316 	 */
76317 	uint16_t	seq_id;
76318 	/*
76319 	 * The target ID of the command:
76320 	 * * 0x0-0xFFF8 - The function ID
76321 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76322 	 * * 0xFFFD - Reserved for user-space HWRM interface
76323 	 * * 0xFFFF - HWRM
76324 	 */
76325 	uint16_t	target_id;
76326 	/*
76327 	 * A physical address pointer pointing to a host buffer that the
76328 	 * command's response data will be written. This can be either a host
76329 	 * physical address (HPA) or a guest physical address (GPA) and must
76330 	 * point to a physically contiguous block of memory.
76331 	 */
76332 	uint64_t	resp_addr;
76333 	/* Host address data is to DMA'd to. */
76334 	uint64_t	resp_data_addr;
76335 	/*
76336 	 * This field contains the offset into the captured data to begin
76337 	 * copying the data to the host from. This should be set to 0 on the
76338 	 * initial call to this command.
76339 	 */
76340 	uint32_t	resp_data_offset;
76341 	/*
76342 	 * Size of the buffer pointed to by resp_data_addr. The firmware may
76343 	 * use this entire buffer or less than the entire buffer, but never more.
76344 	 */
76345 	uint16_t	data_len;
76346 	/*
76347 	 * This field allows this command to request the individual serdes tests
76348 	 * to be run using this command.
76349 	 */
76350 	uint8_t	flags;
76351 	/* Unused. */
76352 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_MASK	UINT32_C(0x7)
76353 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_SFT	0
76354 	/* Display eye_projection */
76355 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_EYE_PROJECTION	UINT32_C(0x8)
76356 	/* Run the PCIe serdes test. */
76357 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
76358 	/* Run the Ethernet serdes test. */
76359 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
76360 	uint8_t	options;
76361 	/*
76362 	 * This field represents the PCIE lane number on which tools wants to
76363 	 * retrieve eye plot. This field is valid only when ‘pcie_serdes_test’ flag is set.
76364 	 * Valid values from 0 to 16.
76365 	 */
76366 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PCIE_LANE_NO_MASK	UINT32_C(0xf)
76367 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PCIE_LANE_NO_SFT	0
76368 	/* This value indicates the Horizontal or vertical plot direction. */
76369 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION		UINT32_C(0x10)
76370 	/* Value 0 indicates Horizontal plot request. */
76371 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_HORIZONTAL	(UINT32_C(0x0) << 4)
76372 	/* Value 1 indicates vertical plot request. */
76373 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_VERTICAL	(UINT32_C(0x1) << 4)
76374 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_VERTICAL
76375 	/* This value indicates eye projection type */
76376 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE		UINT32_C(0x20)
76377 	/*
76378 	 * Value 0 indicates left/top projection in horizontal/vertical
76379 	 * This value is valid only when eye_projection flag was set.
76380 	 */
76381 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_LEFT_TOP	(UINT32_C(0x0) << 5)
76382 	/*
76383 	 * Value 1 indicates right/bottom projection in horizontal/vertical
76384 	 * This value is valid only when eye_projection flag was set.
76385 	 */
76386 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM  (UINT32_C(0x1) << 5)
76387 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM
76388 	/* Reserved for future. */
76389 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_RSVD_MASK		UINT32_C(0xc0)
76390 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_RSVD_SFT		6
76391 	/*
76392 	 * This field allows this command to request a specific targetBER
76393 	 * to be run using this command.
76394 	 */
76395 	uint8_t	targetBER;
76396 	/* When collecting an eyescope, measure with a target BER of 1e-8 */
76397 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E8  UINT32_C(0x0)
76398 	/* When collecting an eyescope, measure with a target BER of 1e-9 */
76399 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E9  UINT32_C(0x1)
76400 	/* When collecting an eyescope, measure with a target BER of 1e-10 */
76401 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E10 UINT32_C(0x2)
76402 	/* When collecting an eyescope, measure with a target BER of 1e-11 */
76403 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E11 UINT32_C(0x3)
76404 	/* When collecting an eyescope, measure with a target BER of 1e-12 */
76405 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E12 UINT32_C(0x4)
76406 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E12
76407 	/*
76408 	 * This field allows this command to specify the action to take when
76409 	 * collecting an eyescope.
76410 	 */
76411 	uint8_t	action;
76412 	/*
76413 	 * Value 0 indicates that collection of the eyescope should be
76414 	 * returned synchronously in the output.  This only applies to
76415 	 * a targetBER of 1e-8.
76416 	 */
76417 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_SYNCHRONOUS UINT32_C(0x0)
76418 	/* Value 1 indicates to the firmware to start the collection of the eyescope. */
76419 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_START	UINT32_C(0x1)
76420 	/*
76421 	 * Value 2 indicates to the firmware to respond with a progress percentage
76422 	 * of the current eyescope collection from 0.0 to 100.0.
76423 	 */
76424 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_PROGRESS	UINT32_C(0x2)
76425 	/*
76426 	 * Value 3 indicates to stop the eyescope.  if the progress percentage
76427 	 * is 100.0, the data will be DMAed back to resp_data_addr.
76428 	 */
76429 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_STOP	UINT32_C(0x3)
76430 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_STOP
76431 	uint8_t	unused[6];
76432 } hwrm_selftest_retrieve_serdes_data_input_t, *phwrm_selftest_retrieve_serdes_data_input_t;
76433 
76434 /* hwrm_selftest_retrieve_serdes_data_output (size:192b/24B) */
76435 
76436 typedef struct hwrm_selftest_retrieve_serdes_data_output {
76437 	/* The specific error status for the command. */
76438 	uint16_t	error_code;
76439 	/* The HWRM command request type. */
76440 	uint16_t	req_type;
76441 	/* The sequence ID from the original command. */
76442 	uint16_t	seq_id;
76443 	/* The length of the response data in number of bytes. */
76444 	uint16_t	resp_len;
76445 	/* Total length of stored data. */
76446 	uint16_t	total_data_len;
76447 	/*
76448 	 * Amount of data DMA'd to host by this call. The driver can use this
76449 	 * field along with the total_data_len field above to determine the
76450 	 * value to write to the resp_data_offset field in the next call
76451 	 * if more than one call to these commands is required to retrieve all
76452 	 * the stored data.
76453 	 */
76454 	uint16_t	copied_data_len;
76455 	/*
76456 	 * Percentage of completion of collection of BER values from the current
76457 	 * eyescope operation in tenths of a percentage. 0 (0.0) to 1000 (100.0)
76458 	 */
76459 	uint16_t	progress_percent;
76460 	/* Timeout in seconds for timeout of an individual BER point. */
76461 	uint16_t	timeout;
76462 	uint8_t	flags;
76463 	/*
76464 	 * This value indicates the structure of data returned by the firmware
76465 	 * when DMA'ed to resp_data_addr
76466 	 */
76467 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE		UINT32_C(0x1)
76468 	/*
76469 	 * Value 0 indicates that bit_count value is a raw total
76470 	 * such that BER = error_count / bit_count.
76471 	 */
76472 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_TOTAL  UINT32_C(0x0)
76473 	/*
76474 	 * Value 1 indicates that bit count is a power of
76475 	 * 2 that bit_count is normalized to.  A Value of 42 indicates
76476 	 * that BER = error_count / 2^42
76477 	 */
76478 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_POW2   UINT32_C(0x1)
76479 		#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
76480 	/* Reserved for future. */
76481 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_RSVD_MASK			UINT32_C(0xfe)
76482 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_RSVD_SFT			1
76483 	uint8_t	unused_0;
76484 	/*
76485 	 * Size of header prepended to the bit_count and error_count array.
76486 	 * Use this value to skip forward to the bit_count and error_count array.
76487 	 */
76488 	uint16_t	hdr_size;
76489 	uint8_t	unused_1[3];
76490 	/*
76491 	 * This field is used in Output records to indicate that the output
76492 	 * is completely written to RAM.  This field should be read as '1'
76493 	 * to indicate that the output has been completely written.
76494 	 * When writing a command completion or response to an internal processor,
76495 	 * the order of writes has to be such that this field is written last.
76496 	 */
76497 	uint8_t	valid;
76498 } hwrm_selftest_retrieve_serdes_data_output_t, *phwrm_selftest_retrieve_serdes_data_output_t;
76499 
76500 /******************************
76501  * hwrm_mfg_fru_write_control *
76502  ******************************/
76503 
76504 
76505 /* hwrm_mfg_fru_write_control_input (size:192b/24B) */
76506 
76507 typedef struct hwrm_mfg_fru_write_control_input {
76508 	/* The HWRM command request type. */
76509 	uint16_t	req_type;
76510 	/*
76511 	 * The completion ring to send the completion event on. This should
76512 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76513 	 */
76514 	uint16_t	cmpl_ring;
76515 	/*
76516 	 * The sequence ID is used by the driver for tracking multiple
76517 	 * commands. This ID is treated as opaque data by the firmware and
76518 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76519 	 */
76520 	uint16_t	seq_id;
76521 	/*
76522 	 * The target ID of the command:
76523 	 * * 0x0-0xFFF8 - The function ID
76524 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76525 	 * * 0xFFFD - Reserved for user-space HWRM interface
76526 	 * * 0xFFFF - HWRM
76527 	 */
76528 	uint16_t	target_id;
76529 	/*
76530 	 * A physical address pointer pointing to a host buffer that the
76531 	 * command's response data will be written. This can be either a host
76532 	 * physical address (HPA) or a guest physical address (GPA) and must
76533 	 * point to a physically contiguous block of memory.
76534 	 */
76535 	uint64_t	resp_addr;
76536 	/*
76537 	 * This field indicates the lock/unlock operation. 0 means Unlock and
76538 	 * 1 means Lock.
76539 	 */
76540 	uint32_t	fru_lock;
76541 	uint32_t	unused_0;
76542 } hwrm_mfg_fru_write_control_input_t, *phwrm_mfg_fru_write_control_input_t;
76543 
76544 /* hwrm_mfg_fru_write_control_output (size:128b/16B) */
76545 
76546 typedef struct hwrm_mfg_fru_write_control_output {
76547 	/* The specific error status for the command. */
76548 	uint16_t	error_code;
76549 	/* The HWRM command request type. */
76550 	uint16_t	req_type;
76551 	/* The sequence ID from the original command. */
76552 	uint16_t	seq_id;
76553 	/* The length of the response data in number of bytes. */
76554 	uint16_t	resp_len;
76555 	uint8_t	unused_0[7];
76556 	/*
76557 	 * This field is used in Output records to indicate that the output
76558 	 * is completely written to RAM.  This field should be read as '1'
76559 	 * to indicate that the output has been completely written.
76560 	 * When writing a command completion or response to an internal processor,
76561 	 * the order of writes has to be such that this field is written last.
76562 	 */
76563 	uint8_t	valid;
76564 } hwrm_mfg_fru_write_control_output_t, *phwrm_mfg_fru_write_control_output_t;
76565 
76566 /*************************
76567  * hwrm_mfg_timers_query *
76568  *************************/
76569 
76570 
76571 /* hwrm_mfg_timers_query_input (size:192b/24B) */
76572 
76573 typedef struct hwrm_mfg_timers_query_input {
76574 	/* The HWRM command request type. */
76575 	uint16_t	req_type;
76576 	/*
76577 	 * The completion ring to send the completion event on. This should
76578 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76579 	 */
76580 	uint16_t	cmpl_ring;
76581 	/*
76582 	 * The sequence ID is used by the driver for tracking multiple
76583 	 * commands. This ID is treated as opaque data by the firmware and
76584 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76585 	 */
76586 	uint16_t	seq_id;
76587 	/*
76588 	 * The target ID of the command:
76589 	 * * 0x0-0xFFF8 - The function ID
76590 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76591 	 * * 0xFFFD - Reserved for user-space HWRM interface
76592 	 * * 0xFFFF - HWRM
76593 	 */
76594 	uint16_t	target_id;
76595 	/*
76596 	 * A physical address pointer pointing to a host buffer that the
76597 	 * command's response data will be written. This can be either a host
76598 	 * physical address (HPA) or a guest physical address (GPA) and must
76599 	 * point to a physically contiguous block of memory.
76600 	 */
76601 	uint64_t	resp_addr;
76602 	uint64_t	unused_0;
76603 } hwrm_mfg_timers_query_input_t, *phwrm_mfg_timers_query_input_t;
76604 
76605 /* hwrm_mfg_timers_query_output (size:192b/24B) */
76606 
76607 typedef struct hwrm_mfg_timers_query_output {
76608 	/* The specific error status for the command. */
76609 	uint16_t	error_code;
76610 	/* The HWRM command request type. */
76611 	uint16_t	req_type;
76612 	/* The sequence ID from the original command. */
76613 	uint16_t	seq_id;
76614 	/* The length of the response data in number of bytes. */
76615 	uint16_t	resp_len;
76616 	/*
76617 	 * This is free running counter value running at 1 usec per tick.
76618 	 * The value can wrap around. On error, a value of 0 on all ticks
76619 	 * will be returned.
76620 	 */
76621 	uint32_t	us_tick;
76622 	/*
76623 	 * This is free running counter value running at 1 msec per tick.
76624 	 * The value can wrap around. On error, a value of 0 on all ticks
76625 	 * will be returned.
76626 	 */
76627 	uint32_t	ms_tick;
76628 	/*
76629 	 * This is free running counter value running at 100 msec per tick.
76630 	 * The value can wrap around. On error, a value of 0 on all ticks
76631 	 * will be returned.
76632 	 */
76633 	uint32_t	ms100_tick;
76634 	uint8_t	unused_0[3];
76635 	/*
76636 	 * This field is used in Output records to indicate that the output
76637 	 * is completely written to RAM.  This field should be read as '1'
76638 	 * to indicate that the output has been completely written.
76639 	 * When writing a command completion or response to an internal processor,
76640 	 * the order of writes has to be such that this field is written last.
76641 	 */
76642 	uint8_t	valid;
76643 } hwrm_mfg_timers_query_output_t, *phwrm_mfg_timers_query_output_t;
76644 
76645 /********************
76646  * hwrm_mfg_otp_cfg *
76647  ********************/
76648 
76649 
76650 /* hwrm_mfg_otp_cfg_input (size:256b/32B) */
76651 
76652 typedef struct hwrm_mfg_otp_cfg_input {
76653 	/* The HWRM command request type. */
76654 	uint16_t	req_type;
76655 	/*
76656 	 * The completion ring to send the completion event on. This should
76657 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76658 	 */
76659 	uint16_t	cmpl_ring;
76660 	/*
76661 	 * The sequence ID is used by the driver for tracking multiple
76662 	 * commands. This ID is treated as opaque data by the firmware and
76663 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76664 	 */
76665 	uint16_t	seq_id;
76666 	/*
76667 	 * The target ID of the command:
76668 	 * * 0x0-0xFFF8 - The function ID
76669 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76670 	 * * 0xFFFD - Reserved for user-space HWRM interface
76671 	 * * 0xFFFF - HWRM
76672 	 */
76673 	uint16_t	target_id;
76674 	/*
76675 	 * A physical address pointer pointing to a host buffer that the
76676 	 * command's response data will be written. This can be either a host
76677 	 * physical address (HPA) or a guest physical address (GPA) and must
76678 	 * point to a physically contiguous block of memory.
76679 	 */
76680 	uint64_t	resp_addr;
76681 	uint16_t	enables;
76682 	/*
76683 	 * This bit must be '1' for the crid field to be
76684 	 * configured.
76685 	 */
76686 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_CRID	UINT32_C(0x1)
76687 	/*
76688 	 * This bit must be '1' for the srt_rev_id field to be
76689 	 * configured.
76690 	 */
76691 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_SRT_REV_ID	UINT32_C(0x2)
76692 	/*
76693 	 * This bit must be '1' for the crt_rev_id field to be
76694 	 * configured.
76695 	 */
76696 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_CRT_REV_ID	UINT32_C(0x4)
76697 	/*
76698 	 * This bit must be '1' for the sbi_rev_id field to be
76699 	 * configured.
76700 	 */
76701 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_SBI_REV_ID	UINT32_C(0x8)
76702 	/* This field indicates the crid value to be set. */
76703 	uint16_t	crid_cfg_value;
76704 	/* This field indicates the srt rev id value to be set. */
76705 	uint16_t	srt_rev_id_cfg_value;
76706 	/* This field indicates the crt rev id value to be set. */
76707 	uint16_t	crt_rev_id_cfg_value;
76708 	/* This field indicates the sbi rev id value to be set. */
76709 	uint16_t	sbi_rev_id_cfg_value;
76710 	uint8_t	unused_0[6];
76711 } hwrm_mfg_otp_cfg_input_t, *phwrm_mfg_otp_cfg_input_t;
76712 
76713 /* hwrm_mfg_otp_cfg_output (size:128b/16B) */
76714 
76715 typedef struct hwrm_mfg_otp_cfg_output {
76716 	/* The specific error status for the command. */
76717 	uint16_t	error_code;
76718 	/* The HWRM command request type. */
76719 	uint16_t	req_type;
76720 	/* The sequence ID from the original command. */
76721 	uint16_t	seq_id;
76722 	/* The length of the response data in number of bytes. */
76723 	uint16_t	resp_len;
76724 	uint8_t	unused_0[7];
76725 	/*
76726 	 * This field is used in Output records to indicate that the output
76727 	 * is completely written to RAM.  This field should be read as '1'
76728 	 * to indicate that the output has been completely written.
76729 	 * When writing a command completion or response to an internal processor,
76730 	 * the order of writes has to be such that this field is written last.
76731 	 */
76732 	uint8_t	valid;
76733 } hwrm_mfg_otp_cfg_output_t, *phwrm_mfg_otp_cfg_output_t;
76734 
76735 /*********************
76736  * hwrm_mfg_otp_qcfg *
76737  *********************/
76738 
76739 
76740 /* hwrm_mfg_otp_qcfg_input (size:192b/24B) */
76741 
76742 typedef struct hwrm_mfg_otp_qcfg_input {
76743 	/* The HWRM command request type. */
76744 	uint16_t	req_type;
76745 	/*
76746 	 * The completion ring to send the completion event on. This should
76747 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76748 	 */
76749 	uint16_t	cmpl_ring;
76750 	/*
76751 	 * The sequence ID is used by the driver for tracking multiple
76752 	 * commands. This ID is treated as opaque data by the firmware and
76753 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76754 	 */
76755 	uint16_t	seq_id;
76756 	/*
76757 	 * The target ID of the command:
76758 	 * * 0x0-0xFFF8 - The function ID
76759 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76760 	 * * 0xFFFD - Reserved for user-space HWRM interface
76761 	 * * 0xFFFF - HWRM
76762 	 */
76763 	uint16_t	target_id;
76764 	/*
76765 	 * A physical address pointer pointing to a host buffer that the
76766 	 * command's response data will be written. This can be either a host
76767 	 * physical address (HPA) or a guest physical address (GPA) and must
76768 	 * point to a physically contiguous block of memory.
76769 	 */
76770 	uint64_t	resp_addr;
76771 	uint16_t	enables;
76772 	/*
76773 	 * This bit must be '1' for the crid field to be
76774 	 * queried.
76775 	 */
76776 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_CRID	UINT32_C(0x1)
76777 	/*
76778 	 * This bit must be '1' for the srt_rev_id field to be
76779 	 * queried.
76780 	 */
76781 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_SRT_REV_ID	UINT32_C(0x2)
76782 	/*
76783 	 * This bit must be '1' for the crt_rev_id field to be
76784 	 * queried.
76785 	 */
76786 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_CRT_REV_ID	UINT32_C(0x4)
76787 	/*
76788 	 * This bit must be '1' for the sbi_rev_id field to be
76789 	 * queried.
76790 	 */
76791 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_SBI_REV_ID	UINT32_C(0x8)
76792 	uint8_t	unused_0[6];
76793 } hwrm_mfg_otp_qcfg_input_t, *phwrm_mfg_otp_qcfg_input_t;
76794 
76795 /* hwrm_mfg_otp_qcfg_output (size:192b/24B) */
76796 
76797 typedef struct hwrm_mfg_otp_qcfg_output {
76798 	/* The specific error status for the command. */
76799 	uint16_t	error_code;
76800 	/* The HWRM command request type. */
76801 	uint16_t	req_type;
76802 	/* The sequence ID from the original command. */
76803 	uint16_t	seq_id;
76804 	/* The length of the response data in number of bytes. */
76805 	uint16_t	resp_len;
76806 	/*
76807 	 * This field contains the value of current device type. The
76808 	 * value indicates the current chip mode (Unassigned/AB_PROD).
76809 	 */
76810 	uint32_t	enc_device_type;
76811 	/* This field indicates the current crid value. */
76812 	uint16_t	crid;
76813 	/* This field indicates the current srt rev id value. */
76814 	uint16_t	srt_rev_id;
76815 	/* This field indicates the current crt rev id value. */
76816 	uint16_t	crt_rev_id;
76817 	/* This field indicates the current sbi rev id value. */
76818 	uint16_t	sbi_rev_id;
76819 	uint8_t	unused_0[3];
76820 	/*
76821 	 * This field is used in Output records to indicate that the output
76822 	 * is completely written to RAM.  This field should be read as '1'
76823 	 * to indicate that the output has been completely written.
76824 	 * When writing a command completion or response to an internal processor,
76825 	 * the order of writes has to be such that this field is written last.
76826 	 */
76827 	uint8_t	valid;
76828 } hwrm_mfg_otp_qcfg_output_t, *phwrm_mfg_otp_qcfg_output_t;
76829 
76830 /**********************
76831  * hwrm_mfg_hdma_test *
76832  **********************/
76833 
76834 
76835 /* hwrm_mfg_hdma_test_input (size:384b/48B) */
76836 
76837 typedef struct hwrm_mfg_hdma_test_input {
76838 	/* The HWRM command request type. */
76839 	uint16_t	req_type;
76840 	/*
76841 	 * The completion ring to send the completion event on. This should
76842 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76843 	 */
76844 	uint16_t	cmpl_ring;
76845 	/*
76846 	 * The sequence ID is used by the driver for tracking multiple
76847 	 * commands. This ID is treated as opaque data by the firmware and
76848 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76849 	 */
76850 	uint16_t	seq_id;
76851 	/*
76852 	 * The target ID of the command:
76853 	 * * 0x0-0xFFF8 - The function ID
76854 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76855 	 * * 0xFFFD - Reserved for user-space HWRM interface
76856 	 * * 0xFFFF - HWRM
76857 	 */
76858 	uint16_t	target_id;
76859 	/*
76860 	 * A physical address pointer pointing to a host buffer that the
76861 	 * command's response data will be written. This can be either a host
76862 	 * physical address (HPA) or a guest physical address (GPA) and must
76863 	 * point to a physically contiguous block of memory.
76864 	 */
76865 	uint64_t	resp_addr;
76866 	/* The host (DMA) buffer physical addr for the firmware to read from. */
76867 	uint64_t	host_src_data_addr;
76868 	/* The host (DMA) buffer physical addr for the firmware to write to. */
76869 	uint64_t	host_dst_data_addr;
76870 	/*
76871 	 * The user provided data pattern which will be used in the DMA
76872 	 * transfer.
76873 	 */
76874 	uint64_t	user_data_pattern;
76875 	/* Timeout value to stop the test. */
76876 	uint16_t	timeout;
76877 	/* The number of DMA transfers to be done in the test. */
76878 	uint16_t	repeat_count;
76879 	/* Types can be any of "incremental", "fixed", or "random". */
76880 	uint16_t	subtype;
76881 	/* Test is run with the incremental data pattern. */
76882 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_INCREMENTAL UINT32_C(0x1)
76883 	/* Test is run with the fixed data pattern. */
76884 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_FIXED	UINT32_C(0x2)
76885 	/* Test is run with a random data pattern. */
76886 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_RANDOM	UINT32_C(0x3)
76887 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_LAST	HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_RANDOM
76888 	/* The length of the data used in the DMA transfers. */
76889 	uint16_t	data_len;
76890 } hwrm_mfg_hdma_test_input_t, *phwrm_mfg_hdma_test_input_t;
76891 
76892 /* hwrm_mfg_hdma_test_output (size:128b/16B) */
76893 
76894 typedef struct hwrm_mfg_hdma_test_output {
76895 	/* The specific error status for the command. */
76896 	uint16_t	error_code;
76897 	/* The HWRM command request type. */
76898 	uint16_t	req_type;
76899 	/* The sequence ID from the original command. */
76900 	uint16_t	seq_id;
76901 	/* The length of the response data in number of bytes. */
76902 	uint16_t	resp_len;
76903 	uint8_t	unused_0[7];
76904 	/*
76905 	 * This field is used in Output records to indicate that the output
76906 	 * is completely written to RAM.  This field should be read as '1'
76907 	 * to indicate that the output has been completely written.
76908 	 * When writing a command completion or response to an internal processor,
76909 	 * the order of writes has to be such that this field is written last.
76910 	 */
76911 	uint8_t	valid;
76912 } hwrm_mfg_hdma_test_output_t, *phwrm_mfg_hdma_test_output_t;
76913 
76914 /*****************************
76915  * hwrm_mfg_fru_eeprom_write *
76916  *****************************/
76917 
76918 
76919 /* hwrm_mfg_fru_eeprom_write_input (size:256b/32B) */
76920 
76921 typedef struct hwrm_mfg_fru_eeprom_write_input {
76922 	/* The HWRM command request type. */
76923 	uint16_t	req_type;
76924 	/*
76925 	 * The completion ring to send the completion event on. This should
76926 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
76927 	 */
76928 	uint16_t	cmpl_ring;
76929 	/*
76930 	 * The sequence ID is used by the driver for tracking multiple
76931 	 * commands. This ID is treated as opaque data by the firmware and
76932 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
76933 	 */
76934 	uint16_t	seq_id;
76935 	/*
76936 	 * The target ID of the command:
76937 	 * * 0x0-0xFFF8 - The function ID
76938 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
76939 	 * * 0xFFFD - Reserved for user-space HWRM interface
76940 	 * * 0xFFFF - HWRM
76941 	 */
76942 	uint16_t	target_id;
76943 	/*
76944 	 * A physical address pointer pointing to a host buffer that the
76945 	 * command's response data will be written. This can be either a host
76946 	 * physical address (HPA) or a guest physical address (GPA) and must
76947 	 * point to a physically contiguous block of memory.
76948 	 */
76949 	uint64_t	resp_addr;
76950 	/*
76951 	 * The host (DMA) buffer physical addr for the firmware to read from.
76952 	 * This buffer is populated with the fru binary bits which is going
76953 	 * to be programmed into the fru memory.
76954 	 */
76955 	uint64_t	data_addr;
76956 	/* i2c slave address. If set to 0xffff, fw will decide what to use. */
76957 	uint16_t	i2c_slave_addr;
76958 	/* Size of the buffer pointed to by data_addr. */
76959 	uint16_t	data_len;
76960 	/* The offset within the SEEPROM to start programming. */
76961 	uint16_t	offset;
76962 	uint8_t	unused[2];
76963 } hwrm_mfg_fru_eeprom_write_input_t, *phwrm_mfg_fru_eeprom_write_input_t;
76964 
76965 /* hwrm_mfg_fru_eeprom_write_output (size:128b/16B) */
76966 
76967 typedef struct hwrm_mfg_fru_eeprom_write_output {
76968 	/* The specific error status for the command. */
76969 	uint16_t	error_code;
76970 	/* The HWRM command request type. */
76971 	uint16_t	req_type;
76972 	/* The sequence ID from the original command. */
76973 	uint16_t	seq_id;
76974 	/* The length of the response data in number of bytes. */
76975 	uint16_t	resp_len;
76976 	/* Total length of data written to the fru memory. */
76977 	uint16_t	total_data_len;
76978 	uint16_t	unused_0;
76979 	uint8_t	unused_1[3];
76980 	/*
76981 	 * This field is used in Output records to indicate that the output
76982 	 * is completely written to RAM.  This field should be read as '1'
76983 	 * to indicate that the output has been completely written.
76984 	 * When writing a command completion or response to an internal processor,
76985 	 * the order of writes has to be such that this field is written last.
76986 	 */
76987 	uint8_t	valid;
76988 } hwrm_mfg_fru_eeprom_write_output_t, *phwrm_mfg_fru_eeprom_write_output_t;
76989 
76990 /****************************
76991  * hwrm_mfg_fru_eeprom_read *
76992  ****************************/
76993 
76994 
76995 /* hwrm_mfg_fru_eeprom_read_input (size:256b/32B) */
76996 
76997 typedef struct hwrm_mfg_fru_eeprom_read_input {
76998 	/* The HWRM command request type. */
76999 	uint16_t	req_type;
77000 	/*
77001 	 * The completion ring to send the completion event on. This should
77002 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77003 	 */
77004 	uint16_t	cmpl_ring;
77005 	/*
77006 	 * The sequence ID is used by the driver for tracking multiple
77007 	 * commands. This ID is treated as opaque data by the firmware and
77008 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77009 	 */
77010 	uint16_t	seq_id;
77011 	/*
77012 	 * The target ID of the command:
77013 	 * * 0x0-0xFFF8 - The function ID
77014 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77015 	 * * 0xFFFD - Reserved for user-space HWRM interface
77016 	 * * 0xFFFF - HWRM
77017 	 */
77018 	uint16_t	target_id;
77019 	/*
77020 	 * A physical address pointer pointing to a host buffer that the
77021 	 * command's response data will be written. This can be either a host
77022 	 * physical address (HPA) or a guest physical address (GPA) and must
77023 	 * point to a physically contiguous block of memory.
77024 	 */
77025 	uint64_t	resp_addr;
77026 	/*
77027 	 * The host (DMA) buffer physical addr for the firmware to write to.
77028 	 * This buffer is populated with the fru binary bits which is going
77029 	 * to be read from the fru memory.
77030 	 */
77031 	uint64_t	data_addr;
77032 	/* i2c slave address. If set to 0xffff, fw will decide what to use. */
77033 	uint16_t	i2c_slave_addr;
77034 	/*
77035 	 * Size of the buffer pointed to by data_addr. The firmware may
77036 	 * use this entire buffer or less than the entire buffer, but never
77037 	 * more.
77038 	 */
77039 	uint16_t	data_len;
77040 	/* The offset within the SEEPROM to start reading. */
77041 	uint16_t	offset;
77042 	uint8_t	unused[2];
77043 } hwrm_mfg_fru_eeprom_read_input_t, *phwrm_mfg_fru_eeprom_read_input_t;
77044 
77045 /* hwrm_mfg_fru_eeprom_read_output (size:128b/16B) */
77046 
77047 typedef struct hwrm_mfg_fru_eeprom_read_output {
77048 	/* The specific error status for the command. */
77049 	uint16_t	error_code;
77050 	/* The HWRM command request type. */
77051 	uint16_t	req_type;
77052 	/* The sequence ID from the original command. */
77053 	uint16_t	seq_id;
77054 	/* The length of the response data in number of bytes. */
77055 	uint16_t	resp_len;
77056 	/* Total length of data written to the host memory. */
77057 	uint16_t	total_data_len;
77058 	uint16_t	unused_0;
77059 	uint8_t	unused_1[3];
77060 	/*
77061 	 * This field is used in Output records to indicate that the output
77062 	 * is completely written to RAM.  This field should be read as '1'
77063 	 * to indicate that the output has been completely written.
77064 	 * When writing a command completion or response to an internal processor,
77065 	 * the order of writes has to be such that this field is written last.
77066 	 */
77067 	uint8_t	valid;
77068 } hwrm_mfg_fru_eeprom_read_output_t, *phwrm_mfg_fru_eeprom_read_output_t;
77069 
77070 /**********************
77071  * hwrm_mfg_soc_image *
77072  **********************/
77073 
77074 
77075 /* hwrm_mfg_soc_image_input (size:512b/64B) */
77076 
77077 typedef struct hwrm_mfg_soc_image_input {
77078 	/* The HWRM command request type. */
77079 	uint16_t	req_type;
77080 	/*
77081 	 * The completion ring to send the completion event on. This should
77082 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77083 	 */
77084 	uint16_t	cmpl_ring;
77085 	/*
77086 	 * The sequence ID is used by the driver for tracking multiple
77087 	 * commands. This ID is treated as opaque data by the firmware and
77088 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77089 	 */
77090 	uint16_t	seq_id;
77091 	/*
77092 	 * The target ID of the command:
77093 	 * * 0x0-0xFFF8 - The function ID
77094 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77095 	 * * 0xFFFD - Reserved for user-space HWRM interface
77096 	 * * 0xFFFF - HWRM
77097 	 */
77098 	uint16_t	target_id;
77099 	/*
77100 	 * A physical address pointer pointing to a host buffer that the
77101 	 * command's response data will be written. This can be either a host
77102 	 * physical address (HPA) or a guest physical address (GPA) and must
77103 	 * point to a physically contiguous block of memory.
77104 	 */
77105 	uint64_t	resp_addr;
77106 	/*
77107 	 * TBD. Work in progress.
77108 	 * This field is the signature value used by SoC UEFI.
77109 	 */
77110 	uint32_t	image_signature;
77111 	/*
77112 	 * TBD. Work in progress.
77113 	 * This field is unused for now.
77114 	 */
77115 	uint32_t	image_type;
77116 	/*
77117 	 * The offset within the image content that is being provided by the
77118 	 * current invocation of this HWRM command. The primate firmware does
77119 	 * not offer any score boarding services to ensure entire image
77120 	 * content is transferred, it is the responsibility of the caller to
77121 	 * ensure image consistency.
77122 	 */
77123 	uint32_t	image_offset;
77124 	/*
77125 	 * Size in bytes for the image content. The maximum value this field
77126 	 * can specify is 4096.
77127 	 */
77128 	uint32_t	image_length;
77129 	/*
77130 	 * Address in host memory where the image content is located. This
77131 	 * location should be 4KB aligned.
77132 	 */
77133 	uint64_t	host_src_addr;
77134 	/*
77135 	 * Address in SoC address space where the provided image content is
77136 	 * to be copied. Primate firmware will copy the image content from
77137 	 * host memory to this location. If the image size is more than the
77138 	 * maximum size that can be transferred with each invocation of this
77139 	 * command, then this address should be updated by the caller for
77140 	 * each invocation to copy the full image.
77141 	 */
77142 	uint64_t	soc_dest_addr;
77143 	/*
77144 	 * Indicates the entrypoint in the image that should be used. This
77145 	 * field is optional. When set to 0, the SoC will determine the
77146 	 * entrypoint on its own.
77147 	 */
77148 	uint32_t	entrypoint_offset;
77149 	uint32_t	flags;
77150 	/*
77151 	 * This bit should be set to '1' only when an image transfer is
77152 	 * being initiated for each unique image_signature.
77153 	 */
77154 	#define HWRM_MFG_SOC_IMAGE_INPUT_FLAGS_START	UINT32_C(0x1)
77155 	/*
77156 	 * This bit should be set to '1' only when an image transfer for a
77157 	 * given image_signature is complete.
77158 	 */
77159 	#define HWRM_MFG_SOC_IMAGE_INPUT_FLAGS_END	UINT32_C(0x2)
77160 	/*
77161 	 * An incrementing number starting with 1 for each invocation of this
77162 	 * HWRM command for any given image_id. No two invocation of this
77163 	 * command for a given image_id shall carry the same seq_number. Each
77164 	 * consecutive invocation of this command for any given image_id
77165 	 * shall increment this number by 1. The value 0 is used when
77166 	 * seq_number is invalid when no image content is being moved.
77167 	 */
77168 	uint32_t	seq_number;
77169 	/*  */
77170 	uint32_t	reserved1;
77171 } hwrm_mfg_soc_image_input_t, *phwrm_mfg_soc_image_input_t;
77172 
77173 /* hwrm_mfg_soc_image_output (size:128b/16B) */
77174 
77175 typedef struct hwrm_mfg_soc_image_output {
77176 	/* The specific error status for the command. */
77177 	uint16_t	error_code;
77178 	/* The HWRM command request type. */
77179 	uint16_t	req_type;
77180 	/* The sequence ID from the original command. */
77181 	uint16_t	seq_id;
77182 	/* The length of the response data in number of bytes. */
77183 	uint16_t	resp_len;
77184 	uint8_t	unused_1[7];
77185 	/*
77186 	 * This field is used in Output records to indicate that the output
77187 	 * is completely written to RAM.  This field should be read as '1'
77188 	 * to indicate that the output has been completely written.
77189 	 * When writing a command completion or response to an internal
77190 	 * processor, the order of writes has to be such that this field is
77191 	 * written last.
77192 	 */
77193 	uint8_t	valid;
77194 } hwrm_mfg_soc_image_output_t, *phwrm_mfg_soc_image_output_t;
77195 
77196 /************************
77197  * hwrm_mfg_soc_qstatus *
77198  ************************/
77199 
77200 
77201 /* hwrm_mfg_soc_qstatus_input (size:192b/24B) */
77202 
77203 typedef struct hwrm_mfg_soc_qstatus_input {
77204 	/* The HWRM command request type. */
77205 	uint16_t	req_type;
77206 	/*
77207 	 * The completion ring to send the completion event on. This should
77208 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77209 	 */
77210 	uint16_t	cmpl_ring;
77211 	/*
77212 	 * The sequence ID is used by the driver for tracking multiple
77213 	 * commands. This ID is treated as opaque data by the firmware and
77214 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77215 	 */
77216 	uint16_t	seq_id;
77217 	/*
77218 	 * The target ID of the command:
77219 	 * * 0x0-0xFFF8 - The function ID
77220 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77221 	 * * 0xFFFD - Reserved for user-space HWRM interface
77222 	 * * 0xFFFF - HWRM
77223 	 */
77224 	uint16_t	target_id;
77225 	/*
77226 	 * A physical address pointer pointing to a host buffer that the
77227 	 * command's response data will be written. This can be either a host
77228 	 * physical address (HPA) or a guest physical address (GPA) and must
77229 	 * point to a physically contiguous block of memory.
77230 	 */
77231 	uint64_t	resp_addr;
77232 	/*  */
77233 	uint32_t	reserved1;
77234 	/*  */
77235 	uint32_t	reserved2;
77236 } hwrm_mfg_soc_qstatus_input_t, *phwrm_mfg_soc_qstatus_input_t;
77237 
77238 /* hwrm_mfg_soc_qstatus_output (size:576b/72B) */
77239 
77240 typedef struct hwrm_mfg_soc_qstatus_output {
77241 	/* The specific error status for the command. */
77242 	uint16_t	error_code;
77243 	/* The HWRM command request type. */
77244 	uint16_t	req_type;
77245 	/* The sequence ID from the original command. */
77246 	uint16_t	seq_id;
77247 	/* The length of the response data in number of bytes. */
77248 	uint16_t	resp_len;
77249 	/*
77250 	 * This field describes capabilities of primate firmware for SoC
77251 	 * image.
77252 	 */
77253 	uint32_t	primate_flags;
77254 	/*  */
77255 	uint32_t	reserved1;
77256 	/* This field contains the current content of the AP_STATUS register. */
77257 	uint32_t	ap_status;
77258 	/*
77259 	 * This field contains the current content of the CRMU_STATUS
77260 	 * register.
77261 	 */
77262 	uint32_t	crmu_status;
77263 	/*
77264 	 * If an image provision operation is in process, this field will
77265 	 * provide information on requested image signature else the contents
77266 	 * are undefined.
77267 	 */
77268 	uint32_t	image_signature;
77269 	/*
77270 	 * If an image provision operation is in process, this field will
77271 	 * provide information on requested image command else the contents
77272 	 * are undefined.
77273 	 */
77274 	uint32_t	image_command;
77275 	/*
77276 	 * If an image provision operation is in process, this field will
77277 	 * provide the requested image name else the contents are undefined.
77278 	 */
77279 	uint8_t	image_name[32];
77280 	uint8_t	unused_1[7];
77281 	/*
77282 	 * This field is used in Output records to indicate that the output
77283 	 * is completely written to RAM.  This field should be read as '1'
77284 	 * to indicate that the output has been completely written.
77285 	 * When writing a command completion or response to an internal
77286 	 * processor, the order of writes has to be such that this field is
77287 	 * written last.
77288 	 */
77289 	uint8_t	valid;
77290 } hwrm_mfg_soc_qstatus_output_t, *phwrm_mfg_soc_qstatus_output_t;
77291 
77292 /*******************************
77293  * hwrm_mfg_param_seeprom_sync *
77294  *******************************/
77295 
77296 
77297 /* hwrm_mfg_param_seeprom_sync_input (size:640b/80B) */
77298 
77299 typedef struct hwrm_mfg_param_seeprom_sync_input {
77300 	/* The HWRM command request type. */
77301 	uint16_t	req_type;
77302 	/*
77303 	 * The completion ring to send the completion event on. This should
77304 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77305 	 */
77306 	uint16_t	cmpl_ring;
77307 	/*
77308 	 * The sequence ID is used by the driver for tracking multiple
77309 	 * commands. This ID is treated as opaque data by the firmware and
77310 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77311 	 */
77312 	uint16_t	seq_id;
77313 	/*
77314 	 * The target ID of the command:
77315 	 * * 0x0-0xFFF8 - The function ID
77316 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77317 	 * * 0xFFFD - Reserved for user-space HWRM interface
77318 	 * * 0xFFFF - HWRM
77319 	 */
77320 	uint16_t	target_id;
77321 	/*
77322 	 * A physical address pointer pointing to a host buffer that the
77323 	 * command's response data will be written. This can be either a host
77324 	 * physical address (HPA) or a guest physical address (GPA) and must
77325 	 * point to a physically contiguous block of memory.
77326 	 */
77327 	uint64_t	resp_addr;
77328 	/*
77329 	 * The host (DMA) buffer physical addr for the firmware to read from.
77330 	 * This buffer is populated with the parameter binary bits which is
77331 	 * going to be programmed into the seeprom memory.
77332 	 */
77333 	uint64_t	data_addr;
77334 	/* Size of the buffer pointed to by data_addr. */
77335 	uint16_t	data_len;
77336 	/* The offset within the SEEPROM to start programming. */
77337 	uint16_t	offset;
77338 	uint32_t	flags;
77339 	/*
77340 	 * This bit must be '1' to sync the parameters available in factory
77341 	 * config to seeprom binary before writing to seeprom
77342 	 */
77343 	#define HWRM_MFG_PARAM_SEEPROM_SYNC_INPUT_FLAGS_FAC_CFG_SYNC	UINT32_C(0x1)
77344 	/*
77345 	 * This bit must be '1' for the seeprom data to be written to
77346 	 * a specified address with out any change in the binary
77347 	 */
77348 	#define HWRM_MFG_PARAM_SEEPROM_SYNC_INPUT_FLAGS_WRITE_BINARY_ONLY	UINT32_C(0x80000000)
77349 	/* Reserved for future use. */
77350 	uint8_t	reserved[48];
77351 } hwrm_mfg_param_seeprom_sync_input_t, *phwrm_mfg_param_seeprom_sync_input_t;
77352 
77353 /* hwrm_mfg_param_seeprom_sync_output (size:128b/16B) */
77354 
77355 typedef struct hwrm_mfg_param_seeprom_sync_output {
77356 	/* The specific error status for the command. */
77357 	uint16_t	error_code;
77358 	/* The HWRM command request type. */
77359 	uint16_t	req_type;
77360 	/* The sequence ID from the original command. */
77361 	uint16_t	seq_id;
77362 	/* The length of the response data in number of bytes. */
77363 	uint16_t	resp_len;
77364 	/* Total length of data written to the seeprom memory. */
77365 	uint16_t	total_data_len;
77366 	uint16_t	unused_0;
77367 	uint8_t	unused_1[3];
77368 	/*
77369 	 * This field is used in Output records to indicate that the output
77370 	 * is completely written to RAM.  This field should be read as '1'
77371 	 * to indicate that the output has been completely written.
77372 	 * When writing a command completion or response to an internal processor,
77373 	 * the order of writes has to be such that this field is written last.
77374 	 */
77375 	uint8_t	valid;
77376 } hwrm_mfg_param_seeprom_sync_output_t, *phwrm_mfg_param_seeprom_sync_output_t;
77377 
77378 /*******************************
77379  * hwrm_mfg_param_seeprom_read *
77380  *******************************/
77381 
77382 
77383 /* hwrm_mfg_param_seeprom_read_input (size:256b/32B) */
77384 
77385 typedef struct hwrm_mfg_param_seeprom_read_input {
77386 	/* The HWRM command request type. */
77387 	uint16_t	req_type;
77388 	/*
77389 	 * The completion ring to send the completion event on. This should
77390 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77391 	 */
77392 	uint16_t	cmpl_ring;
77393 	/*
77394 	 * The sequence ID is used by the driver for tracking multiple
77395 	 * commands. This ID is treated as opaque data by the firmware and
77396 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77397 	 */
77398 	uint16_t	seq_id;
77399 	/*
77400 	 * The target ID of the command:
77401 	 * * 0x0-0xFFF8 - The function ID
77402 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77403 	 * * 0xFFFD - Reserved for user-space HWRM interface
77404 	 * * 0xFFFF - HWRM
77405 	 */
77406 	uint16_t	target_id;
77407 	/*
77408 	 * A physical address pointer pointing to a host buffer that the
77409 	 * command's response data will be written. This can be either a host
77410 	 * physical address (HPA) or a guest physical address (GPA) and must
77411 	 * point to a physically contiguous block of memory.
77412 	 */
77413 	uint64_t	resp_addr;
77414 	/*
77415 	 * The host (DMA) buffer physical addr for the firmware to write to.
77416 	 * This buffer is populated with the parameter binary bits which is
77417 	 * going to be read from the seeprom memory.
77418 	 */
77419 	uint64_t	data_addr;
77420 	/*
77421 	 * Size of the buffer pointed to by data_addr. The firmware may
77422 	 * use this entire buffer or less than the entire buffer, but never
77423 	 * more.
77424 	 */
77425 	uint16_t	data_len;
77426 	/* The offset within the SEEPROM to start reading. */
77427 	uint16_t	offset;
77428 	uint8_t	unused[4];
77429 } hwrm_mfg_param_seeprom_read_input_t, *phwrm_mfg_param_seeprom_read_input_t;
77430 
77431 /* hwrm_mfg_param_seeprom_read_output (size:128b/16B) */
77432 
77433 typedef struct hwrm_mfg_param_seeprom_read_output {
77434 	/* The specific error status for the command. */
77435 	uint16_t	error_code;
77436 	/* The HWRM command request type. */
77437 	uint16_t	req_type;
77438 	/* The sequence ID from the original command. */
77439 	uint16_t	seq_id;
77440 	/* The length of the response data in number of bytes. */
77441 	uint16_t	resp_len;
77442 	/* Total length of data written to the host memory. */
77443 	uint16_t	total_data_len;
77444 	uint16_t	unused_0[2];
77445 	/*
77446 	 * This field is used in Output records to indicate that the output
77447 	 * is completely written to RAM.  This field should be read as '1'
77448 	 * to indicate that the output has been completely written.
77449 	 * When writing a command completion or response to an internal processor,
77450 	 * the order of writes has to be such that this field is written last.
77451 	 */
77452 	uint8_t	valid;
77453 	uint8_t	unused_1;
77454 } hwrm_mfg_param_seeprom_read_output_t, *phwrm_mfg_param_seeprom_read_output_t;
77455 
77456 /*********************************
77457  * hwrm_mfg_param_seeprom_health *
77458  *********************************/
77459 
77460 
77461 /* hwrm_mfg_param_seeprom_health_input (size:192b/24B) */
77462 
77463 typedef struct hwrm_mfg_param_seeprom_health_input {
77464 	/* The HWRM command request type. */
77465 	uint16_t	req_type;
77466 	/*
77467 	 * The completion ring to send the completion event on. This should
77468 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77469 	 */
77470 	uint16_t	cmpl_ring;
77471 	/*
77472 	 * The sequence ID is used by the driver for tracking multiple
77473 	 * commands. This ID is treated as opaque data by the firmware and
77474 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77475 	 */
77476 	uint16_t	seq_id;
77477 	/*
77478 	 * The target ID of the command:
77479 	 * * 0x0-0xFFF8 - The function ID
77480 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77481 	 * * 0xFFFD - Reserved for user-space HWRM interface
77482 	 * * 0xFFFF - HWRM
77483 	 */
77484 	uint16_t	target_id;
77485 	/*
77486 	 * A physical address pointer pointing to a host buffer that the
77487 	 * command's response data will be written. This can be either a host
77488 	 * physical address (HPA) or a guest physical address (GPA) and must
77489 	 * point to a physically contiguous block of memory.
77490 	 */
77491 	uint64_t	resp_addr;
77492 	uint64_t	unused_0;
77493 } hwrm_mfg_param_seeprom_health_input_t, *phwrm_mfg_param_seeprom_health_input_t;
77494 
77495 /* hwrm_mfg_param_seeprom_health_output (size:128b/16B) */
77496 
77497 typedef struct hwrm_mfg_param_seeprom_health_output {
77498 	/* The specific error status for the command. */
77499 	uint16_t	error_code;
77500 	/* The HWRM command request type. */
77501 	uint16_t	req_type;
77502 	/* The sequence ID from the original command. */
77503 	uint16_t	seq_id;
77504 	/* The length of the response data in number of bytes. */
77505 	uint16_t	resp_len;
77506 	uint32_t	health_status;
77507 	/* No response from the device */
77508 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_NO_RESPONSE		UINT32_C(0x1)
77509 	/* Data checksum fail */
77510 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_CHECKSUM_FAIL	UINT32_C(0x2)
77511 	/* Mac address not populated */
77512 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_NO_MAC_ADDRESS	UINT32_C(0x4)
77513 	/* Part number not populated */
77514 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_NO_PART_NUMBER	UINT32_C(0x8)
77515 	/* Serial number not populated */
77516 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_NO_SR_NUMBER	UINT32_C(0x10)
77517 	/* Package description not populated */
77518 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_STATUS_NO_PKG_DESCRIPTION	UINT32_C(0x20)
77519 	uint16_t	health_code;
77520 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_SUCCESS	UINT32_C(0x0)
77521 	/* No response from the device */
77522 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_NO_RESPONSE	UINT32_C(0x1)
77523 	/* Data checksum fail */
77524 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_CHECKSUM_FAIL  UINT32_C(0x2)
77525 	/* Mac address not populated */
77526 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_NO_MAC_ADDRESS UINT32_C(0x3)
77527 	#define HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_LAST	HWRM_MFG_PARAM_SEEPROM_HEALTH_OUTPUT_HEALTH_CODE_NO_MAC_ADDRESS
77528 	/*
77529 	 * This field is used in Output records to indicate that the output
77530 	 * is completely written to RAM.  This field should be read as '1'
77531 	 * to indicate that the output has been completely written.
77532 	 * When writing a command completion or response to an internal processor,
77533 	 * the order of writes has to be such that this field is written last.
77534 	 */
77535 	uint8_t	valid;
77536 	uint8_t	unused_1;
77537 } hwrm_mfg_param_seeprom_health_output_t, *phwrm_mfg_param_seeprom_health_output_t;
77538 
77539 /*****************************
77540  * hwrm_mfg_prvsn_export_csr *
77541  *****************************/
77542 
77543 
77544 /* hwrm_mfg_prvsn_export_csr_input (size:256b/32B) */
77545 
77546 typedef struct hwrm_mfg_prvsn_export_csr_input {
77547 	/* The HWRM command request type. */
77548 	uint16_t	req_type;
77549 	/*
77550 	 * The completion ring to send the completion event on. This should
77551 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77552 	 */
77553 	uint16_t	cmpl_ring;
77554 	/*
77555 	 * The sequence ID is used by the driver for tracking multiple
77556 	 * commands. This ID is treated as opaque data by the firmware and
77557 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77558 	 */
77559 	uint16_t	seq_id;
77560 	/*
77561 	 * The target ID of the command:
77562 	 * * 0x0-0xFFF8 - The function ID
77563 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77564 	 * * 0xFFFD - Reserved for user-space HWRM interface
77565 	 * * 0xFFFF - HWRM
77566 	 */
77567 	uint16_t	target_id;
77568 	/*
77569 	 * A physical address pointer pointing to a host buffer that the
77570 	 * command's response data will be written. This can be either a host
77571 	 * physical address (HPA) or a guest physical address (GPA) and must
77572 	 * point to a physically contiguous block of memory.
77573 	 */
77574 	uint64_t	resp_addr;
77575 	/*
77576 	 * 64-bit Host destination address.  This is the host address where
77577 	 * data will be written.
77578 	 */
77579 	uint64_t	host_dest_addr;
77580 	/* Provisioning slot number.  0-indexed. */
77581 	uint8_t	slot;
77582 	uint8_t	unused_0;
77583 	/* Size in bytes of the available host buffer. */
77584 	uint16_t	host_buf_len;
77585 	uint32_t	unused_1;
77586 } hwrm_mfg_prvsn_export_csr_input_t, *phwrm_mfg_prvsn_export_csr_input_t;
77587 
77588 /* hwrm_mfg_prvsn_export_csr_output (size:128b/16B) */
77589 
77590 typedef struct hwrm_mfg_prvsn_export_csr_output {
77591 	/* The specific error status for the command. */
77592 	uint16_t	error_code;
77593 	/* The HWRM command request type. */
77594 	uint16_t	req_type;
77595 	/* The sequence ID from the original command. */
77596 	uint16_t	seq_id;
77597 	/* The length of the response data in number of bytes. */
77598 	uint16_t	resp_len;
77599 	/* Provisioning slot number.  0-indexed. */
77600 	uint8_t	slot;
77601 	uint8_t	unused_0;
77602 	/* Size in bytes of the exported CSR. */
77603 	uint16_t	csr_len;
77604 	uint8_t	unused_1[3];
77605 	/*
77606 	 * This field is used in Output records to indicate that the output
77607 	 * is completely written to RAM.  This field should be read as '1'
77608 	 * to indicate that the output has been completely written.
77609 	 * When writing a command completion or response to an internal
77610 	 * processor, the order of writes has to be such that this field is
77611 	 * written last.
77612 	 */
77613 	uint8_t	valid;
77614 } hwrm_mfg_prvsn_export_csr_output_t, *phwrm_mfg_prvsn_export_csr_output_t;
77615 
77616 /* hwrm_mfg_prvsn_export_csr_cmd_err (size:64b/8B) */
77617 
77618 typedef struct hwrm_mfg_prvsn_export_csr_cmd_err {
77619 	/*
77620 	 * command specific error codes that goes to
77621 	 * the cmd_err field in Common HWRM Error Response.
77622 	 */
77623 	uint8_t	code;
77624 	/* Unknown error. */
77625 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
77626 	/* Slot invalid */
77627 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_SLOT_INVALID  UINT32_C(0x1)
77628 	/* Host provided buffer is too small */
77629 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_BUFFER_LENGTH UINT32_C(0x2)
77630 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_LAST	HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_BUFFER_LENGTH
77631 	uint8_t	unused_0[7];
77632 } hwrm_mfg_prvsn_export_csr_cmd_err_t, *phwrm_mfg_prvsn_export_csr_cmd_err_t;
77633 
77634 /******************************
77635  * hwrm_mfg_prvsn_import_cert *
77636  ******************************/
77637 
77638 
77639 /* hwrm_mfg_prvsn_import_cert_input (size:256b/32B) */
77640 
77641 typedef struct hwrm_mfg_prvsn_import_cert_input {
77642 	/* The HWRM command request type. */
77643 	uint16_t	req_type;
77644 	/*
77645 	 * The completion ring to send the completion event on. This should
77646 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77647 	 */
77648 	uint16_t	cmpl_ring;
77649 	/*
77650 	 * The sequence ID is used by the driver for tracking multiple
77651 	 * commands. This ID is treated as opaque data by the firmware and
77652 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77653 	 */
77654 	uint16_t	seq_id;
77655 	/*
77656 	 * The target ID of the command:
77657 	 * * 0x0-0xFFF8 - The function ID
77658 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77659 	 * * 0xFFFD - Reserved for user-space HWRM interface
77660 	 * * 0xFFFF - HWRM
77661 	 */
77662 	uint16_t	target_id;
77663 	/*
77664 	 * A physical address pointer pointing to a host buffer that the
77665 	 * command's response data will be written. This can be either a host
77666 	 * physical address (HPA) or a guest physical address (GPA) and must
77667 	 * point to a physically contiguous block of memory.
77668 	 */
77669 	uint64_t	resp_addr;
77670 	/*
77671 	 * 64-bit Host source address.  This is the host address where
77672 	 * source data is located.
77673 	 */
77674 	uint64_t	host_src_addr;
77675 	/* Provisioning slot number.  0-indexed. */
77676 	uint8_t	slot;
77677 	uint8_t	unused_0;
77678 	/* Size in bytes of the certificate chain. */
77679 	uint16_t	cert_len;
77680 	uint32_t	unused_1;
77681 } hwrm_mfg_prvsn_import_cert_input_t, *phwrm_mfg_prvsn_import_cert_input_t;
77682 
77683 /* hwrm_mfg_prvsn_import_cert_output (size:128b/16B) */
77684 
77685 typedef struct hwrm_mfg_prvsn_import_cert_output {
77686 	/* The specific error status for the command. */
77687 	uint16_t	error_code;
77688 	/* The HWRM command request type. */
77689 	uint16_t	req_type;
77690 	/* The sequence ID from the original command. */
77691 	uint16_t	seq_id;
77692 	/* The length of the response data in number of bytes. */
77693 	uint16_t	resp_len;
77694 	/* Provisioning slot number.  0-indexed. */
77695 	uint8_t	slot;
77696 	/* Provisioned state */
77697 	uint8_t	state;
77698 	/* Certificate chain is not provisioned. */
77699 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_NOT_PROVISIONED UINT32_C(0x0)
77700 	/* Certificate chain successfully provisioned. */
77701 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_PROVISIONED	UINT32_C(0x1)
77702 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_LAST	HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_PROVISIONED
77703 	uint8_t	unused_0[5];
77704 	/*
77705 	 * This field is used in Output records to indicate that the output
77706 	 * is completely written to RAM.  This field should be read as '1'
77707 	 * to indicate that the output has been completely written.
77708 	 * When writing a command completion or response to an internal
77709 	 * processor, the order of writes has to be such that this field is
77710 	 * written last.
77711 	 */
77712 	uint8_t	valid;
77713 } hwrm_mfg_prvsn_import_cert_output_t, *phwrm_mfg_prvsn_import_cert_output_t;
77714 
77715 /* hwrm_mfg_prvsn_import_cert_cmd_err (size:64b/8B) */
77716 
77717 typedef struct hwrm_mfg_prvsn_import_cert_cmd_err {
77718 	/*
77719 	 * command specific error codes that goes to
77720 	 * the cmd_err field in Common HWRM Error Response.
77721 	 */
77722 	uint8_t	code;
77723 	/* Unknown error. */
77724 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
77725 	/* Slot invalid */
77726 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_SLOT_INVALID	UINT32_C(0x1)
77727 	/* Slot is provisioned and locked */
77728 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_SLOT_LOCKED	UINT32_C(0x2)
77729 	/* Non-volatile storage is full or in error. */
77730 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_STORAGE		UINT32_C(0x3)
77731 	/* Certificate chain verification failed. */
77732 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_CERT_VERIFY_FAIL	UINT32_C(0x4)
77733 	/* There is no self-signed device id certificate on device */
77734 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_SIGNED_DEVICE_CERT UINT32_C(0x5)
77735 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_LAST		HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_SIGNED_DEVICE_CERT
77736 	uint8_t	unused_0[7];
77737 } hwrm_mfg_prvsn_import_cert_cmd_err_t, *phwrm_mfg_prvsn_import_cert_cmd_err_t;
77738 
77739 /****************************
77740  * hwrm_mfg_prvsn_get_state *
77741  ****************************/
77742 
77743 
77744 /* hwrm_mfg_prvsn_get_state_input (size:128b/16B) */
77745 
77746 typedef struct hwrm_mfg_prvsn_get_state_input {
77747 	/* The HWRM command request type. */
77748 	uint16_t	req_type;
77749 	/*
77750 	 * The completion ring to send the completion event on. This should
77751 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77752 	 */
77753 	uint16_t	cmpl_ring;
77754 	/*
77755 	 * The sequence ID is used by the driver for tracking multiple
77756 	 * commands. This ID is treated as opaque data by the firmware and
77757 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77758 	 */
77759 	uint16_t	seq_id;
77760 	/*
77761 	 * The target ID of the command:
77762 	 * * 0x0-0xFFF8 - The function ID
77763 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77764 	 * * 0xFFFD - Reserved for user-space HWRM interface
77765 	 * * 0xFFFF - HWRM
77766 	 */
77767 	uint16_t	target_id;
77768 	/*
77769 	 * A physical address pointer pointing to a host buffer that the
77770 	 * command's response data will be written. This can be either a host
77771 	 * physical address (HPA) or a guest physical address (GPA) and must
77772 	 * point to a physically contiguous block of memory.
77773 	 */
77774 	uint64_t	resp_addr;
77775 } hwrm_mfg_prvsn_get_state_input_t, *phwrm_mfg_prvsn_get_state_input_t;
77776 
77777 /* hwrm_mfg_prvsn_get_state_output (size:128b/16B) */
77778 
77779 typedef struct hwrm_mfg_prvsn_get_state_output {
77780 	/* The specific error status for the command. */
77781 	uint16_t	error_code;
77782 	/* The HWRM command request type. */
77783 	uint16_t	req_type;
77784 	/* The sequence ID from the original command. */
77785 	uint16_t	seq_id;
77786 	/* The length of the response data in number of bytes. */
77787 	uint16_t	resp_len;
77788 	/* Flag indicating if provision get state is valid. */
77789 	uint8_t	get_state_valid;
77790 	/*
77791 	 * Provision get state is invalid.  The attestation agent has not
77792 	 * yet initialized and not completed verification of the
77793 	 * provisioned certificate chain.
77794 	 * The slot_status field is undetermined.
77795 	 */
77796 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_INVALID  UINT32_C(0x0)
77797 	/* Provision get state is valid for SPDM. */
77798 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_SPDM	UINT32_C(0x1)
77799 	/* Provision get state is valid for Cerberus. */
77800 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_CERBERUS UINT32_C(0x2)
77801 	/* Provision get state is valid.  There is no attestation agent. */
77802 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_NONE	UINT32_C(0xff)
77803 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_LAST	HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_NONE
77804 	/*
77805 	 * An 8-bit mask returning the provisioned state of the imported
77806 	 * certificate chain on the device for each available slot.
77807 	 * Bit-N corresponding to slot N.
77808 	 * The slot_status field is undetermined if get_state_valid = 0.
77809 	 */
77810 	uint8_t	slot_status;
77811 	/* Slot N entries */
77812 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_MASK	UINT32_C(0xff)
77813 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_SFT		0
77814 	/* Slot N is not provisioned. */
77815 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_NOT_PROVISIONED  UINT32_C(0x0)
77816 	/*
77817 	 * Slot N is provisioned and certificate chain is loaded
77818 	 * successfully by the attestation agent.
77819 	 */
77820 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_PROVISIONED	UINT32_C(0x1)
77821 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_LAST		HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_PROVISIONED
77822 	uint8_t	unused_0[5];
77823 	/*
77824 	 * This field is used in Output records to indicate that the output
77825 	 * is completely written to RAM.  This field should be read as '1'
77826 	 * to indicate that the output has been completely written.
77827 	 * When writing a command completion or response to an internal
77828 	 * processor, the order of writes has to be such that this field is
77829 	 * written last.
77830 	 */
77831 	uint8_t	valid;
77832 } hwrm_mfg_prvsn_get_state_output_t, *phwrm_mfg_prvsn_get_state_output_t;
77833 
77834 /********************************
77835  * hwrm_mfg_get_nvm_measurement *
77836  ********************************/
77837 
77838 
77839 /* hwrm_mfg_get_nvm_measurement_input (size:128b/16B) */
77840 
77841 typedef struct hwrm_mfg_get_nvm_measurement_input {
77842 	/* The HWRM command request type. */
77843 	uint16_t	req_type;
77844 	/*
77845 	 * The completion ring to send the completion event on. This should
77846 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77847 	 */
77848 	uint16_t	cmpl_ring;
77849 	/*
77850 	 * The sequence ID is used by the driver for tracking multiple
77851 	 * commands. This ID is treated as opaque data by the firmware and
77852 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77853 	 */
77854 	uint16_t	seq_id;
77855 	/*
77856 	 * The target ID of the command:
77857 	 * * 0x0-0xFFF8 - The function ID
77858 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77859 	 * * 0xFFFD - Reserved for user-space HWRM interface
77860 	 * * 0xFFFF - HWRM
77861 	 */
77862 	uint16_t	target_id;
77863 	/*
77864 	 * A physical address pointer pointing to a host buffer that the
77865 	 * command's response data will be written. This can be either a host
77866 	 * physical address (HPA) or a guest physical address (GPA) and must
77867 	 * point to a physically contiguous block of memory.
77868 	 */
77869 	uint64_t	resp_addr;
77870 } hwrm_mfg_get_nvm_measurement_input_t, *phwrm_mfg_get_nvm_measurement_input_t;
77871 
77872 /* hwrm_mfg_get_nvm_measurement_output (size:448b/56B) */
77873 
77874 typedef struct hwrm_mfg_get_nvm_measurement_output {
77875 	/* The specific error status for the command. */
77876 	uint16_t	error_code;
77877 	/* The HWRM command request type. */
77878 	uint16_t	req_type;
77879 	/* The sequence ID from the original command. */
77880 	uint16_t	seq_id;
77881 	/* The length of the response data in number of bytes. */
77882 	uint16_t	resp_len;
77883 	/* Flag indicating if the hash returned is valid. */
77884 	uint8_t	hash_state;
77885 	/*
77886 	 * Measurement hash is invalid.  There was an error
77887 	 * calculating the hash or firmware does not support NVM
77888 	 * measurement.
77889 	 */
77890 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_INVALID UINT32_C(0x0)
77891 	/* Measurement hash is valid. */
77892 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_VALID   UINT32_C(0x1)
77893 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_LAST   HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_VALID
77894 	/*
77895 	 * Flag indicating whether the measurement was calculated
77896 	 * in real time or calculated during bootup time.
77897 	 */
77898 	uint8_t	calc_time;
77899 	/* Measurement was calculated during bootup time. */
77900 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_BOOTUP UINT32_C(0x0)
77901 	/* Measurement is calculated in real time */
77902 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LIVE   UINT32_C(0x1)
77903 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LAST  HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LIVE
77904 	uint8_t	unused_0[6];
77905 	/* Thirty two bytes HMAC SHA256 hash of NVM configuration. */
77906 	uint8_t	hash[32];
77907 	uint8_t	unused_1[7];
77908 	/*
77909 	 * This field is used in Output records to indicate that the output
77910 	 * is completely written to RAM.  This field should be read as '1'
77911 	 * to indicate that the output has been completely written.
77912 	 * When writing a command completion or response to an internal
77913 	 * processor, the order of writes has to be such that this field is
77914 	 * written last.
77915 	 */
77916 	uint8_t	valid;
77917 } hwrm_mfg_get_nvm_measurement_output_t, *phwrm_mfg_get_nvm_measurement_output_t;
77918 
77919 /*************************
77920  * hwrm_mfg_psoc_qstatus *
77921  *************************/
77922 
77923 
77924 /* hwrm_mfg_psoc_qstatus_input (size:192b/24B) */
77925 
77926 typedef struct hwrm_mfg_psoc_qstatus_input {
77927 	/* The HWRM command request type. */
77928 	uint16_t	req_type;
77929 	/*
77930 	 * The completion ring to send the completion event on. This should
77931 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
77932 	 */
77933 	uint16_t	cmpl_ring;
77934 	/*
77935 	 * The sequence ID is used by the driver for tracking multiple
77936 	 * commands. This ID is treated as opaque data by the firmware and
77937 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
77938 	 */
77939 	uint16_t	seq_id;
77940 	/*
77941 	 * The target ID of the command:
77942 	 * * 0x0-0xFFF8 - The function ID
77943 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
77944 	 * * 0xFFFD - Reserved for user-space HWRM interface
77945 	 * * 0xFFFF - HWRM
77946 	 */
77947 	uint16_t	target_id;
77948 	/*
77949 	 * A physical address pointer pointing to a host buffer that the
77950 	 * command's response data will be written. This can be either a host
77951 	 * physical address (HPA) or a guest physical address (GPA) and must
77952 	 * point to a physically contiguous block of memory.
77953 	 */
77954 	uint64_t	resp_addr;
77955 	/*  */
77956 	uint32_t	reserved1;
77957 	/*  */
77958 	uint32_t	reserved2;
77959 } hwrm_mfg_psoc_qstatus_input_t, *phwrm_mfg_psoc_qstatus_input_t;
77960 
77961 /* hwrm_mfg_psoc_qstatus_output (size:768b/96B) */
77962 
77963 typedef struct hwrm_mfg_psoc_qstatus_output {
77964 	/* The specific error status for the command. */
77965 	uint16_t	error_code;
77966 	/* The HWRM command request type. */
77967 	uint16_t	req_type;
77968 	/* The sequence ID from the original command. */
77969 	uint16_t	seq_id;
77970 	/* The length of the response data in number of bytes. */
77971 	uint16_t	resp_len;
77972 	/* PBL version info. Start at 0, roll if change in structure */
77973 	uint8_t	pbl_info_version;
77974 	/* PBL info length. Counts all bytes. */
77975 	uint8_t	pbl_info_length;
77976 	/*
77977 	 * Hardware generation major version. Rolled on incompatible hardware
77978 	 * changes.
77979 	 */
77980 	uint8_t	hw_generation_major;
77981 	/* Hardware generation minor version. Tracks minor changes. */
77982 	uint8_t	hw_generation_minor;
77983 	/* Reserved. */
77984 	uint8_t	feature_support;
77985 	/* Firmware version major. */
77986 	uint8_t	fw_version_major;
77987 	/* Firmware version minor. */
77988 	uint8_t	fw_version_minor;
77989 	/* Indicate which of the two firmware images is active. */
77990 	uint8_t	active_image;
77991 	/* Identifies PSoC specific part. */
77992 	uint32_t	silicon_id;
77993 	/* Length of part number string in bytes, including NULL terminator. */
77994 	uint8_t	part_number_string_length;
77995 	uint8_t	unused_1[3];
77996 	/* Part number string in ASCII. */
77997 	uint8_t	part_number_string[64];
77998 	uint8_t	unused_2[7];
77999 	/*
78000 	 * This field is used in Output records to indicate that the output
78001 	 * is completely written to RAM.  This field should be read as '1'
78002 	 * to indicate that the output has been completely written.
78003 	 * When writing a command completion or response to an internal
78004 	 * processor, the order of writes has to be such that this field is
78005 	 * written last.
78006 	 */
78007 	uint8_t	valid;
78008 } hwrm_mfg_psoc_qstatus_output_t, *phwrm_mfg_psoc_qstatus_output_t;
78009 
78010 /***************************
78011  * hwrm_mfg_selftest_qlist *
78012  ***************************/
78013 
78014 
78015 /* hwrm_mfg_selftest_qlist_input (size:128b/16B) */
78016 
78017 typedef struct hwrm_mfg_selftest_qlist_input {
78018 	/* The HWRM command request type. */
78019 	uint16_t	req_type;
78020 	/*
78021 	 * The completion ring to send the completion event on. This should
78022 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
78023 	 */
78024 	uint16_t	cmpl_ring;
78025 	/*
78026 	 * The sequence ID is used by the driver for tracking multiple
78027 	 * commands. This ID is treated as opaque data by the firmware and
78028 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
78029 	 */
78030 	uint16_t	seq_id;
78031 	/*
78032 	 * The target ID of the command:
78033 	 * * 0x0-0xFFF8 - The function ID
78034 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
78035 	 * * 0xFFFD - Reserved for user-space HWRM interface
78036 	 * * 0xFFFF - HWRM
78037 	 */
78038 	uint16_t	target_id;
78039 	/*
78040 	 * A physical address pointer pointing to a host buffer that the
78041 	 * command's response data will be written. This can be either a host
78042 	 * physical address (HPA) or a guest physical address (GPA) and must
78043 	 * point to a physically contiguous block of memory.
78044 	 */
78045 	uint64_t	resp_addr;
78046 } hwrm_mfg_selftest_qlist_input_t, *phwrm_mfg_selftest_qlist_input_t;
78047 
78048 /* hwrm_mfg_selftest_qlist_output (size:192b/24B) */
78049 
78050 typedef struct hwrm_mfg_selftest_qlist_output {
78051 	/* The specific error status for the command. */
78052 	uint16_t	error_code;
78053 	/* The HWRM command request type. */
78054 	uint16_t	req_type;
78055 	/* The sequence ID from the original command. */
78056 	uint16_t	seq_id;
78057 	/* The length of the response data in number of bytes. */
78058 	uint16_t	resp_len;
78059 	/*
78060 	 * This field represents the number of tests available to be
78061 	 * requested by manufacturing tool.
78062 	 */
78063 	uint8_t	num_tests;
78064 	/* This field indicates which self-test is available to be run. */
78065 	uint8_t	available_tests;
78066 	/*
78067 	 * Can run the peripheral tests. Individual peripherals are
78068 	 * specified in peripheral_tests field.
78069 	 */
78070 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_PERIPHERAL_TEST	UINT32_C(0x1)
78071 	/*
78072 	 * This field represents the maximum timeout for all the
78073 	 * tests to complete in milliseconds.
78074 	 */
78075 	uint16_t	test_timeout;
78076 	/*
78077 	 * This field is a 32 bits bitmap, each bit specifies a peripheral
78078 	 * test.
78079 	 */
78080 	uint32_t	peripheral_tests;
78081 	/* Can run memory test on Co-CPU peripheral */
78082 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
78083 	/* Can run test on dpll eeprom peripheral */
78084 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_DPLL_EEPROM	UINT32_C(0x2)
78085 	/* Can run test on dpll mmcx connector peripheral */
78086 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_DPLL_MMCX	UINT32_C(0x4)
78087 	/* Can run test on gnss peripheral */
78088 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_GNSS		UINT32_C(0x8)
78089 	/* Can run pcie test on Co-CPU peripheral */
78090 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
78091 	/* Can run test on internal fabric peripheral */
78092 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
78093 	/* Can run test on oven controlled crystal oscillator peripheral */
78094 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_OCXO		UINT32_C(0x40)
78095 	/* Can run test on telecom pll peripheral */
78096 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_TELECOM_PLL	UINT32_C(0x80)
78097 	uint8_t	unused_2[7];
78098 	/*
78099 	 * This field is used in Output records to indicate that the output
78100 	 * is completely written to RAM.  This field should be read as '1'
78101 	 * to indicate that the output has been completely written.
78102 	 * When writing a command completion or response to an internal processor,
78103 	 * the order of writes has to be such that this field is written last.
78104 	 */
78105 	uint8_t	valid;
78106 } hwrm_mfg_selftest_qlist_output_t, *phwrm_mfg_selftest_qlist_output_t;
78107 
78108 /**************************
78109  * hwrm_mfg_selftest_exec *
78110  **************************/
78111 
78112 
78113 /* hwrm_mfg_selftest_exec_input (size:192b/24B) */
78114 
78115 typedef struct hwrm_mfg_selftest_exec_input {
78116 	/* The HWRM command request type. */
78117 	uint16_t	req_type;
78118 	/*
78119 	 * The completion ring to send the completion event on. This should
78120 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
78121 	 */
78122 	uint16_t	cmpl_ring;
78123 	/*
78124 	 * The sequence ID is used by the driver for tracking multiple
78125 	 * commands. This ID is treated as opaque data by the firmware and
78126 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
78127 	 */
78128 	uint16_t	seq_id;
78129 	/*
78130 	 * The target ID of the command:
78131 	 * * 0x0-0xFFF8 - The function ID
78132 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
78133 	 * * 0xFFFD - Reserved for user-space HWRM interface
78134 	 * * 0xFFFF - HWRM
78135 	 */
78136 	uint16_t	target_id;
78137 	/*
78138 	 * A physical address pointer pointing to a host buffer that the
78139 	 * command's response data will be written. This can be either a host
78140 	 * physical address (HPA) or a guest physical address (GPA) and must
78141 	 * point to a physically contiguous block of memory.
78142 	 */
78143 	uint64_t	resp_addr;
78144 	/* This field indicates which self-test is being requested to run. */
78145 	uint8_t	flags;
78146 	/*
78147 	 * Run the Peripheral tests specified in peripheral_tests
78148 	 * field.
78149 	 */
78150 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_FLAGS_PERIPHERAL_TEST	UINT32_C(0x1)
78151 	uint8_t	unused_0[3];
78152 	/*
78153 	 * This field is a 32 bits bitmap to specify which peripheral tests to
78154 	 * run, each bit specifies a peripheral test.
78155 	 */
78156 	uint32_t	peripheral_tests;
78157 	/* Run memory test on Co-CPU peripheral */
78158 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
78159 	/* Run test on dpll eeprom peripheral */
78160 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_DPLL_EEPROM	UINT32_C(0x2)
78161 	/* Run test on dpll mmcx connector peripheral */
78162 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_DPLL_MMCX	UINT32_C(0x4)
78163 	/* Run test on gnss peripheral */
78164 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_GNSS		UINT32_C(0x8)
78165 	/* Run pcie test on Co-CPU peripheral */
78166 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
78167 	/* Run test on internal fabric peripheral */
78168 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
78169 	/* Run test on oven controlled crystal oscillator peripheral */
78170 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_OCXO		UINT32_C(0x40)
78171 	/* Run test on telecom pll peripheral */
78172 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_TELECOM_PLL	UINT32_C(0x80)
78173 } hwrm_mfg_selftest_exec_input_t, *phwrm_mfg_selftest_exec_input_t;
78174 
78175 /* hwrm_mfg_selftest_exec_output (size:192b/24B) */
78176 
78177 typedef struct hwrm_mfg_selftest_exec_output {
78178 	/* The specific error status for the command. */
78179 	uint16_t	error_code;
78180 	/* The HWRM command request type. */
78181 	uint16_t	req_type;
78182 	/* The sequence ID from the original command. */
78183 	uint16_t	seq_id;
78184 	/* The length of the response data in number of bytes. */
78185 	uint16_t	resp_len;
78186 	/* The following tests were requested to be run. */
78187 	uint8_t	requested_tests;
78188 	/* A request was made to run the peripheral tests. */
78189 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_PERIPHERAL_TEST	UINT32_C(0x1)
78190 	/*
78191 	 * If a test was requested to be run as seen in the requested_tests
78192 	 * field, this bit indicates whether the test was successful(1) or
78193 	 * failed(0).
78194 	 */
78195 	uint8_t	test_success;
78196 	/*
78197 	 * If requested, a value of 1 indicates the peripheral tests
78198 	 * completed successfully.
78199 	 */
78200 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_PERIPHERAL_TEST	UINT32_C(0x1)
78201 	uint8_t	unused_0[2];
78202 	/*
78203 	 * This field is a 32 bits bitmap for firmware to indicate which
78204 	 * peripheral tests are specified by the host, each bit specifies
78205 	 * a peripheral test.
78206 	 */
78207 	uint32_t	peripheral_requested_tests;
78208 	/* Co-CPU peripheral test requested */
78209 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
78210 	/* dpll eeprom peripheral test requested */
78211 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_DPLL_EEPROM	UINT32_C(0x2)
78212 	/* dpll mmcx connector peripheral test requested */
78213 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_DPLL_MMCX	UINT32_C(0x4)
78214 	/* gnss peripheral test requested */
78215 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_GNSS		UINT32_C(0x8)
78216 	/* pcie test on Co-CPU peripheral test requested */
78217 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
78218 	/* internal fabric peripheral test requested */
78219 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
78220 	/* oven controlled crystal oscillator peripheral test requested */
78221 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_OCXO		UINT32_C(0x40)
78222 	/* telecom pll peripheral test requested */
78223 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_TELECOM_PLL	UINT32_C(0x80)
78224 	/*
78225 	 * This field is a 32 bits bitmap for firmware to indicate which
78226 	 * peripheral tests are successfully executed, each bit specifies
78227 	 * a peripheral test.
78228 	 */
78229 	uint32_t	peripheral_tests_success;
78230 	/* Co-CPU peripheral test is successfully executed */
78231 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_CO_CPU_MEMORY	UINT32_C(0x1)
78232 	/* dpll eeprom peripheral test is successfully executed */
78233 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_DPLL_EEPROM	UINT32_C(0x2)
78234 	/* dpll mmcx connector peripheral test is successfully executed */
78235 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_DPLL_MMCX	UINT32_C(0x4)
78236 	/* gnss peripheral test is successfully executed */
78237 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_GNSS		UINT32_C(0x8)
78238 	/* pcie test on Co-CPU peripheral test is successfully executed */
78239 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_CO_CPU_PCIE	UINT32_C(0x10)
78240 	/* internal fabric peripheral test is successfully executed */
78241 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_INTERNAL_FABRIC	UINT32_C(0x20)
78242 	/*
78243 	 * oven controlled crystal oscillator peripheral test is successfully
78244 	 * executed
78245 	 */
78246 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_OCXO		UINT32_C(0x40)
78247 	/* telecom pll peripheral test is successfully executed */
78248 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_TELECOM_PLL	UINT32_C(0x80)
78249 	uint8_t	unused_1[3];
78250 	/*
78251 	 * This field is used in Output records to indicate that the output
78252 	 * is completely written to RAM.  This field should be read as '1'
78253 	 * to indicate that the output has been completely written.
78254 	 * When writing a command completion or response to an internal processor,
78255 	 * the order of writes has to be such that this field is written last.
78256 	 */
78257 	uint8_t	valid;
78258 } hwrm_mfg_selftest_exec_output_t, *phwrm_mfg_selftest_exec_output_t;
78259 
78260 /****************
78261  * hwrm_oem_cmd *
78262  ****************/
78263 
78264 
78265 /* hwrm_oem_cmd_input (size:1024b/128B) */
78266 
78267 typedef struct hwrm_oem_cmd_input {
78268 	/* The HWRM command request type. */
78269 	uint16_t	req_type;
78270 	/*
78271 	 * The completion ring to send the completion event on. This should
78272 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
78273 	 */
78274 	uint16_t	cmpl_ring;
78275 	/*
78276 	 * The sequence ID is used by the driver for tracking multiple
78277 	 * commands. This ID is treated as opaque data by the firmware and
78278 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
78279 	 */
78280 	uint16_t	seq_id;
78281 	/*
78282 	 * The target ID of the command:
78283 	 * * 0x0-0xFFF8 - The function ID
78284 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
78285 	 * * 0xFFFD - Reserved for user-space HWRM interface
78286 	 * * 0xFFFF - HWRM
78287 	 */
78288 	uint16_t	target_id;
78289 	/*
78290 	 * A physical address pointer pointing to a host buffer that the
78291 	 * command's response data will be written. This can be either a host
78292 	 * physical address (HPA) or a guest physical address (GPA) and must
78293 	 * point to a physically contiguous block of memory.
78294 	 */
78295 	uint64_t	resp_addr;
78296 	uint32_t	IANA;
78297 	uint32_t	unused_0;
78298 	/* This field contains the vendor specific command data. */
78299 	uint32_t	oem_data[26];
78300 } hwrm_oem_cmd_input_t, *phwrm_oem_cmd_input_t;
78301 
78302 /* hwrm_oem_cmd_output (size:768b/96B) */
78303 
78304 typedef struct hwrm_oem_cmd_output {
78305 	/* The specific error status for the command. */
78306 	uint16_t	error_code;
78307 	/* The HWRM command request type. */
78308 	uint16_t	req_type;
78309 	/* The sequence ID from the original command. */
78310 	uint16_t	seq_id;
78311 	/* The length of the response data in number of bytes. */
78312 	uint16_t	resp_len;
78313 	uint32_t	IANA;
78314 	uint32_t	unused_0;
78315 	/* This field contains the vendor specific response data. */
78316 	uint32_t	oem_data[18];
78317 	uint8_t	unused_1[7];
78318 	/*
78319 	 * This field is used in Output records to indicate that the output
78320 	 * is completely written to RAM.  This field should be read as '1'
78321 	 * to indicate that the output has been completely written.
78322 	 * When writing a command completion or response to an internal processor,
78323 	 * the order of writes has to be such that this field is written last.
78324 	 */
78325 	uint8_t	valid;
78326 } hwrm_oem_cmd_output_t, *phwrm_oem_cmd_output_t;
78327 
78328 /***********
78329  * hwrm_sv *
78330  ***********/
78331 
78332 
78333 /* hwrm_sv_input (size:1152b/144B) */
78334 
78335 typedef struct hwrm_sv_input {
78336 	/* The HWRM command request type. */
78337 	uint16_t	req_type;
78338 	/*
78339 	 * The completion ring to send the completion event on. This should
78340 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
78341 	 */
78342 	uint16_t	cmpl_ring;
78343 	/*
78344 	 * The sequence ID is used by the driver for tracking multiple
78345 	 * commands. This ID is treated as opaque data by the firmware and
78346 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
78347 	 */
78348 	uint16_t	seq_id;
78349 	/*
78350 	 * The target ID of the command:
78351 	 * * 0x0-0xFFF8 - The function ID
78352 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
78353 	 * * 0xFFFD - Reserved for user-space HWRM interface
78354 	 * * 0xFFFF - HWRM
78355 	 */
78356 	uint16_t	target_id;
78357 	/*
78358 	 * A physical address pointer pointing to a host buffer that the
78359 	 * command's response data will be written. This can be either a host
78360 	 * physical address (HPA) or a guest physical address (GPA) and must
78361 	 * point to a physically contiguous block of memory.
78362 	 */
78363 	uint64_t	resp_addr;
78364 	uint32_t	opaque[32];
78365 } hwrm_sv_input_t, *phwrm_sv_input_t;
78366 
78367 /* hwrm_sv_output (size:1088b/136B) */
78368 
78369 typedef struct hwrm_sv_output {
78370 	/* The specific error status for the command. */
78371 	uint16_t	error_code;
78372 	/* The HWRM command request type. */
78373 	uint16_t	req_type;
78374 	/* The sequence ID from the original command. */
78375 	uint16_t	seq_id;
78376 	/* The length of the response data in number of bytes. */
78377 	uint16_t	resp_len;
78378 	uint32_t	opaque[32];
78379 } hwrm_sv_output_t, *phwrm_sv_output_t;
78380 
78381 #endif /* _HSI_STRUCT_DEF_H_ */
78382