xref: /openbsd/sys/dev/pci/if_bnxtreg.h (revision 76d0caae)
1 /*	$OpenBSD: if_bnxtreg.h,v 1.3 2019/04/24 10:09:49 jmatthew Exp $	*/
2 /*-
3  *   BSD LICENSE
4  *
5  *   Copyright (c) 2016 Broadcom, All Rights Reserved.
6  *   The term Broadcom refers to Broadcom Limited and/or its subsidiaries
7  *
8  *   Redistribution and use in source and binary forms, with or without
9  *   modification, are permitted provided that the following conditions
10  *   are met:
11  *     * Redistributions of source code must retain the above copyright
12  *       notice, this list of conditions and the following disclaimer.
13  *     * Redistributions in binary form must reproduce the above copyright
14  *       notice, this list of conditions and the following disclaimer in
15  *       the documentation and/or other materials provided with the
16  *       distribution.
17  *
18  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /****************************************************************************
32  *
33  * Description: Definition of HSI data structures
34  *
35  * Date:  08/31/17 17:55:46
36  *
37  * Note:  This file is scripted generated by hsi_decode.py.
38  *	DO NOT modify this file manually !!!!
39  *
40  ****************************************************************************/
41 #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_
42 #define _HSI_STRUCT_DEF_EXTERNAL_H_
43 /* HSI and HWRM Specification 1.8.1 */
44 #define HWRM_VERSION_MAJOR	1
45 #define HWRM_VERSION_MINOR	8
46 #define HWRM_VERSION_UPDATE	1
47 
48 #define HWRM_VERSION_RSVD	7
49 
50 #define HWRM_VERSION_STR	"1.8.1.7"
51 /*
52  * Following is the signature for HWRM message field that indicates not
53  * applicable (All F's). Need to cast it the size of the field if needed.
54  */
55 #define HWRM_NA_SIGNATURE	((uint32_t)(-1))
56 #define HWRM_MAX_REQ_LEN	(128)  /* hwrm_func_buf_rgtr */
57 #define HWRM_MAX_RESP_LEN	(272)  /* hwrm_selftest_qlist */
58 #define HW_HASH_INDEX_SIZE	0x80	/* 7 bit indirection table index. */
59 #define HW_HASH_KEY_SIZE	40
60 #define HWRM_RESP_VALID_KEY	1 /* valid key for HWRM response */
61 #define ROCE_SP_HSI_VERSION_MAJOR	1
62 #define ROCE_SP_HSI_VERSION_MINOR	8
63 #define ROCE_SP_HSI_VERSION_UPDATE	1
64 
65 #define ROCE_SP_HSI_VERSION_STR	"1.8.1"
66 /*
67  * Following is the signature for ROCE_SP_HSI message field that indicates not
68  * applicable (All F's). Need to cast it the size of the field if needed.
69  */
70 #define ROCE_SP_HSI_NA_SIGNATURE	((uint32_t)(-1))
71 /*
72  * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM)
73  * specification describes the data structures used in Ethernet packet or RDMA
74  * message data transfers as well as an abstract interface for managing Ethernet
75  * NIC hardware resources.
76  */
77 /* Ethernet Data path Host Structures */
78 /*
79  * Description: The following three sections document the host structures used
80  * between device and software drivers for communicating Ethernet packets.
81  */
82 /* BD Ring Structures */
83 /*
84  * Description: This structure is used to inform the NIC of a location for and
85  * an aggregation buffer that will be used for packet data that is received. An
86  * aggregation buffer creates a different kind of completion operation for a
87  * packet where a variable number of BDs may be used to place the packet in the
88  * host. RX Rings that have aggregation buffers are known as aggregation rings
89  * and must contain only aggregation buffers.
90  */
91 /*
92  * Note: BD Ring structures are written by the driver to TX Rings and RX Rings
93  * to indicate to the chip there is more buffer space in the host that needs to
94  * be transmitted or is available for receive data.
95  */
96 /* BD Base (8 bytes) */
97 
98 struct bd_base {
99 	uint8_t type;
100 	/* This value identifies the type of buffer descriptor. */
101 	#define BD_BASE_TYPE_MASK				UINT32_C(0x3f)
102 	#define BD_BASE_TYPE_SFT				0
103 	/*
104 	 * Indicates that this BD is 16B long and is used for normal L2
105 	 * packet transmission.
106 	 */
107 	#define BD_BASE_TYPE_TX_BD_SHORT			UINT32_C(0x0)
108 	/*
109 	 * Indicates that this BD is 1BB long and is an empty TX BD. Not
110 	 * valid for use by the driver.
111 	 */
112 	#define BD_BASE_TYPE_TX_BD_EMPTY			UINT32_C(0x1)
113 	/*
114 	 * Indicates that this BD is 16B long and is an RX Producer (ie.
115 	 * empty) buffer descriptor.
116 	 */
117 	#define BD_BASE_TYPE_RX_PROD_PKT			UINT32_C(0x4)
118 	/*
119 	 * Indicates that this BD is 16B long and is an RX Producer
120 	 * Buffer BD.
121 	 */
122 	#define BD_BASE_TYPE_RX_PROD_BFR			UINT32_C(0x5)
123 	/*
124 	 * Indicates that this BD is 16B long and is an RX Producer
125 	 * Assembly Buffer Descriptor.
126 	 */
127 	#define BD_BASE_TYPE_RX_PROD_AGG			UINT32_C(0x6)
128 	/*
129 	 * Indicates that this BD is 32B long and is used for normal L2
130 	 * packet transmission.
131 	 */
132 	#define BD_BASE_TYPE_TX_BD_LONG			UINT32_C(0x10)
133 	uint8_t unused_1[7];
134 } __attribute__((packed));
135 
136 /* Short TX BD (16 bytes) */
137 
138 struct tx_bd_short {
139 	uint16_t flags_type;
140 	/*
141 	 * All bits in this field must be valid on the first BD of a packet.
142 	 * Only the packet_end bit must be valid for the remaining BDs of a
143 	 * packet.
144 	 */
145 	/* This value identifies the type of buffer descriptor. */
146 	#define TX_BD_SHORT_TYPE_MASK				UINT32_C(0x3f)
147 	#define TX_BD_SHORT_TYPE_SFT				0
148 	/*
149 	 * Indicates that this BD is 16B long and is used for normal L2
150 	 * packet transmission.
151 	 */
152 	#define TX_BD_SHORT_TYPE_TX_BD_SHORT			UINT32_C(0x0)
153 	/*
154 	 * If set to 1, the packet ends with the data in the buffer pointed to
155 	 * by this descriptor. This flag must be valid on every BD.
156 	 */
157 	#define TX_BD_SHORT_FLAGS_PACKET_END			UINT32_C(0x40)
158 	/*
159 	 * If set to 1, the device will not generate a completion for this
160 	 * transmit packet unless there is an error in it's processing. If this
161 	 * bit is set to 0, then the packet will be completed normally. This bit
162 	 * must be valid only on the first BD of a packet.
163 	 */
164 	#define TX_BD_SHORT_FLAGS_NO_CMPL			UINT32_C(0x80)
165 	/*
166 	 * This value indicates how many 16B BD locations are consumed in the
167 	 * ring by this packet. A value of 1 indicates that this BD is the only
168 	 * BD (and that the it is a short BD). A value of 3 indicates either 3
169 	 * short BDs or 1 long BD and one short BD in the packet. A value of 0
170 	 * indicates that there are 32 BD locations in the packet (the maximum).
171 	 * This field is valid only on the first BD of a packet.
172 	 */
173 	#define TX_BD_SHORT_FLAGS_BD_CNT_MASK			UINT32_C(0x1f00)
174 	#define TX_BD_SHORT_FLAGS_BD_CNT_SFT			8
175 	/*
176 	 * This value is a hint for the length of the entire packet. It is used
177 	 * by the chip to optimize internal processing. The packet will be
178 	 * dropped if the hint is too short. This field is valid only on the
179 	 * first BD of a packet.
180 	 */
181 	#define TX_BD_SHORT_FLAGS_LHINT_MASK			UINT32_C(0x6000)
182 	#define TX_BD_SHORT_FLAGS_LHINT_SFT			13
183 	/* indicates packet length < 512B */
184 	#define TX_BD_SHORT_FLAGS_LHINT_LT512			(UINT32_C(0x0) << 13)
185 	/* indicates 512 <= packet length < 1KB */
186 	#define TX_BD_SHORT_FLAGS_LHINT_LT1K			(UINT32_C(0x1) << 13)
187 	/* indicates 1KB <= packet length < 2KB */
188 	#define TX_BD_SHORT_FLAGS_LHINT_LT2K			(UINT32_C(0x2) << 13)
189 	/* indicates packet length >= 2KB */
190 	#define TX_BD_SHORT_FLAGS_LHINT_GTE2K			(UINT32_C(0x3) << 13)
191 	#define TX_BD_SHORT_FLAGS_LHINT_LAST	TX_BD_SHORT_FLAGS_LHINT_GTE2K
192 	/*
193 	 * If set to 1, the device immediately updates the Send Consumer Index
194 	 * after the buffer associated with this descriptor has been transferred
195 	 * via DMA to NIC memory from host memory. An interrupt may or may not
196 	 * be generated according to the state of the interrupt avoidance
197 	 * mechanisms. If this bit is set to 0, then the Consumer Index is only
198 	 * updated as soon as one of the host interrupt coalescing conditions
199 	 * has been met. This bit must be valid on the first BD of a packet.
200 	 */
201 	#define TX_BD_SHORT_FLAGS_COAL_NOW			UINT32_C(0x8000)
202 	/*
203 	 * All bits in this field must be valid on the first BD of a packet.
204 	 * Only the packet_end bit must be valid for the remaining BDs of a
205 	 * packet.
206 	 */
207 	#define TX_BD_SHORT_FLAGS_MASK				UINT32_C(0xffc0)
208 	#define TX_BD_SHORT_FLAGS_SFT				6
209 	uint16_t len;
210 	/*
211 	 * This is the length of the host physical buffer this BD describes in
212 	 * bytes. This field must be valid on all BDs of a packet.
213 	 */
214 	uint32_t opaque;
215 	/*
216 	 * The opaque data field is pass through to the completion and can be
217 	 * used for any data that the driver wants to associate with the
218 	 * transmit BD. This field must be valid on the first BD of a packet.
219 	 */
220 	uint64_t addr;
221 	/*
222 	 * This is the host physical address for the portion of the packet
223 	 * described by this TX BD. This value must be valid on all BDs of a
224 	 * packet.
225 	 */
226 } __attribute__((packed));
227 
228 /* Long TX BD (32 bytes split to 2 16-byte struct) */
229 
230 struct tx_bd_long {
231 	uint16_t flags_type;
232 	/*
233 	 * All bits in this field must be valid on the first BD of a packet.
234 	 * Only the packet_end bit must be valid for the remaining BDs of a
235 	 * packet.
236 	 */
237 	/* This value identifies the type of buffer descriptor. */
238 	#define TX_BD_LONG_TYPE_MASK				UINT32_C(0x3f)
239 	#define TX_BD_LONG_TYPE_SFT				0
240 	/*
241 	 * Indicates that this BD is 32B long and is used for normal L2
242 	 * packet transmission.
243 	 */
244 	#define TX_BD_LONG_TYPE_TX_BD_LONG			UINT32_C(0x10)
245 	/*
246 	 * If set to 1, the packet ends with the data in the buffer pointed to
247 	 * by this descriptor. This flag must be valid on every BD.
248 	 */
249 	#define TX_BD_LONG_FLAGS_PACKET_END			UINT32_C(0x40)
250 	/*
251 	 * If set to 1, the device will not generate a completion for this
252 	 * transmit packet unless there is an error in it's processing. If this
253 	 * bit is set to 0, then the packet will be completed normally. This bit
254 	 * must be valid only on the first BD of a packet.
255 	 */
256 	#define TX_BD_LONG_FLAGS_NO_CMPL			UINT32_C(0x80)
257 	/*
258 	 * This value indicates how many 16B BD locations are consumed in the
259 	 * ring by this packet. A value of 1 indicates that this BD is the only
260 	 * BD (and that the it is a short BD). A value of 3 indicates either 3
261 	 * short BDs or 1 long BD and one short BD in the packet. A value of 0
262 	 * indicates that there are 32 BD locations in the packet (the maximum).
263 	 * This field is valid only on the first BD of a packet.
264 	 */
265 	#define TX_BD_LONG_FLAGS_BD_CNT_MASK			UINT32_C(0x1f00)
266 	#define TX_BD_LONG_FLAGS_BD_CNT_SFT			8
267 	/*
268 	 * This value is a hint for the length of the entire packet. It is used
269 	 * by the chip to optimize internal processing. The packet will be
270 	 * dropped if the hint is too short. This field is valid only on the
271 	 * first BD of a packet.
272 	 */
273 	#define TX_BD_LONG_FLAGS_LHINT_MASK			UINT32_C(0x6000)
274 	#define TX_BD_LONG_FLAGS_LHINT_SFT			13
275 	/* indicates packet length < 512B */
276 	#define TX_BD_LONG_FLAGS_LHINT_LT512			(UINT32_C(0x0) << 13)
277 	/* indicates 512 <= packet length < 1KB */
278 	#define TX_BD_LONG_FLAGS_LHINT_LT1K			(UINT32_C(0x1) << 13)
279 	/* indicates 1KB <= packet length < 2KB */
280 	#define TX_BD_LONG_FLAGS_LHINT_LT2K			(UINT32_C(0x2) << 13)
281 	/* indicates packet length >= 2KB */
282 	#define TX_BD_LONG_FLAGS_LHINT_GTE2K			(UINT32_C(0x3) << 13)
283 	#define TX_BD_LONG_FLAGS_LHINT_LAST	TX_BD_LONG_FLAGS_LHINT_GTE2K
284 	/*
285 	 * If set to 1, the device immediately updates the Send Consumer Index
286 	 * after the buffer associated with this descriptor has been transferred
287 	 * via DMA to NIC memory from host memory. An interrupt may or may not
288 	 * be generated according to the state of the interrupt avoidance
289 	 * mechanisms. If this bit is set to 0, then the Consumer Index is only
290 	 * updated as soon as one of the host interrupt coalescing conditions
291 	 * has been met. This bit must be valid on the first BD of a packet.
292 	 */
293 	#define TX_BD_LONG_FLAGS_COAL_NOW			UINT32_C(0x8000)
294 	/*
295 	 * All bits in this field must be valid on the first BD of a packet.
296 	 * Only the packet_end bit must be valid for the remaining BDs of a
297 	 * packet.
298 	 */
299 	#define TX_BD_LONG_FLAGS_MASK				UINT32_C(0xffc0)
300 	#define TX_BD_LONG_FLAGS_SFT				6
301 	uint16_t len;
302 	/*
303 	 * This is the length of the host physical buffer this BD describes in
304 	 * bytes. This field must be valid on all BDs of a packet.
305 	 */
306 	uint32_t opaque;
307 	/*
308 	 * The opaque data field is pass through to the completion and can be
309 	 * used for any data that the driver wants to associate with the
310 	 * transmit BD. This field must be valid on the first BD of a packet.
311 	 */
312 	uint64_t addr;
313 	/*
314 	 * This is the host physical address for the portion of the packet
315 	 * described by this TX BD. This value must be valid on all BDs of a
316 	 * packet.
317 	 */
318 } __attribute__((packed));
319 
320 /* last 16 bytes of Long TX BD */
321 
322 struct tx_bd_long_hi {
323 	uint16_t lflags;
324 	/*
325 	 * All bits in this field must be valid on the first BD of a packet.
326 	 * Their value on other BDs of the packet will be ignored.
327 	 */
328 	/*
329 	 * If set to 1, the controller replaces the TCP/UPD checksum fields of
330 	 * normal TCP/UPD checksum, or the inner TCP/UDP checksum field of the
331 	 * encapsulated TCP/UDP packets with the hardware calculated TCP/UDP
332 	 * checksum for the packet associated with this descriptor. The flag is
333 	 * ignored if the LSO flag is set. This bit must be valid on the first
334 	 * BD of a packet.
335 	 */
336 	#define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM		UINT32_C(0x1)
337 	/*
338 	 * If set to 1, the controller replaces the IP checksum of the normal
339 	 * packets, or the inner IP checksum of the encapsulated packets with
340 	 * the hardware calculated IP checksum for the packet associated with
341 	 * this descriptor. This bit must be valid on the first BD of a packet.
342 	 */
343 	#define TX_BD_LONG_LFLAGS_IP_CHKSUM			UINT32_C(0x2)
344 	/*
345 	 * If set to 1, the controller will not append an Ethernet CRC to the
346 	 * end of the frame. This bit must be valid on the first BD of a packet.
347 	 * Packet must be 64B or longer when this flag is set. It is not useful
348 	 * to use this bit with any form of TX offload such as CSO or LSO. The
349 	 * intent is that the packet from the host already has a valid Ethernet
350 	 * CRC on the packet.
351 	 */
352 	#define TX_BD_LONG_LFLAGS_NOCRC				UINT32_C(0x4)
353 	/*
354 	 * If set to 1, the device will record the time at which the packet was
355 	 * actually transmitted at the TX MAC. This bit must be valid on the
356 	 * first BD of a packet.
357 	 */
358 	#define TX_BD_LONG_LFLAGS_STAMP				UINT32_C(0x8)
359 	/*
360 	 * If set to 1, The controller replaces the tunnel IP checksum field
361 	 * with hardware calculated IP checksum for the IP header of the packet
362 	 * associated with this descriptor. For outer UDP checksum, global outer
363 	 * UDP checksum TE_NIC register needs to be enabled. If the global outer
364 	 * UDP checksum TE_NIC register bit is set, outer UDP checksum will be
365 	 * calculated for the following cases: 1. Packets with tcp_udp_chksum
366 	 * flag set to offload checksum for inner packet AND the inner packet is
367 	 * TCP/UDP. If the inner packet is ICMP for example (non-TCP/UDP), even
368 	 * if the tcp_udp_chksum is set, the outer UDP checksum will not be
369 	 * calculated. 2. Packets with lso flag set which implies inner TCP
370 	 * checksum calculation as part of LSO operation.
371 	 */
372 	#define TX_BD_LONG_LFLAGS_T_IP_CHKSUM			UINT32_C(0x10)
373 	/*
374 	 * If set to 1, the device will treat this packet with LSO(Large Send
375 	 * Offload) processing for both normal or encapsulated packets, which is
376 	 * a form of TCP segmentation. When this bit is 1, the hdr_size and mss
377 	 * fields must be valid. The driver doesn't need to set t_ip_chksum,
378 	 * ip_chksum, and tcp_udp_chksum flags since the controller will replace
379 	 * the appropriate checksum fields for segmented packets. When this bit
380 	 * is 1, the hdr_size and mss fields must be valid.
381 	 */
382 	#define TX_BD_LONG_LFLAGS_LSO				UINT32_C(0x20)
383 	/*
384 	 * If set to zero when LSO is '1', then the IPID will be treated as a
385 	 * 16b number and will be wrapped if it exceeds a value of 0xffff. If
386 	 * set to one when LSO is '1', then the IPID will be treated as a 15b
387 	 * number and will be wrapped if it exceeds a value 0f 0x7fff.
388 	 */
389 	#define TX_BD_LONG_LFLAGS_IPID_FMT			UINT32_C(0x40)
390 	/*
391 	 * If set to zero when LSO is '1', then the IPID of the tunnel IP header
392 	 * will not be modified during LSO operations. If set to one when LSO is
393 	 * '1', then the IPID of the tunnel IP header will be incremented for
394 	 * each subsequent segment of an LSO operation. The flag is ignored if
395 	 * the LSO packet is a normal (non-tunneled) TCP packet.
396 	 */
397 	#define TX_BD_LONG_LFLAGS_T_IPID			UINT32_C(0x80)
398 	/*
399 	 * If set to '1', then the RoCE ICRC will be appended to the packet.
400 	 * Packet must be a valid RoCE format packet.
401 	 */
402 	#define TX_BD_LONG_LFLAGS_ROCE_CRC			UINT32_C(0x100)
403 	/*
404 	 * If set to '1', then the FCoE CRC will be appended to the packet.
405 	 * Packet must be a valid FCoE format packet.
406 	 */
407 	#define TX_BD_LONG_LFLAGS_FCOE_CRC			UINT32_C(0x200)
408 	uint16_t hdr_size;
409 	/*
410 	 * When LSO is '1', this field must contain the offset of the TCP
411 	 * payload from the beginning of the packet in as 16b words. In case of
412 	 * encapsulated/tunneling packet, this field contains the offset of the
413 	 * inner TCP payload from beginning of the packet as 16-bit words. This
414 	 * value must be valid on the first BD of a packet.
415 	 */
416 	#define TX_BD_LONG_HDR_SIZE_MASK			UINT32_C(0x1ff)
417 	#define TX_BD_LONG_HDR_SIZE_SFT				0
418 	uint32_t mss;
419 	/*
420 	 * This is the MSS value that will be used to do the LSO processing. The
421 	 * value is the length in bytes of the TCP payload for each segment
422 	 * generated by the LSO operation. This value must be valid on the first
423 	 * BD of a packet.
424 	 */
425 	#define TX_BD_LONG_MSS_MASK				UINT32_C(0x7fff)
426 	#define TX_BD_LONG_MSS_SFT				0
427 	uint16_t unused_2;
428 	uint16_t cfa_action;
429 	/*
430 	 * This value selects a CFA action to perform on the packet. Set this
431 	 * value to zero if no CFA action is desired. This value must be valid
432 	 * on the first BD of a packet.
433 	 */
434 	uint32_t cfa_meta;
435 	/*
436 	 * This value is action meta-data that defines CFA edit operations that
437 	 * are done in addition to any action editing.
438 	 */
439 	/* When key=1, This is the VLAN tag VID value. */
440 	#define TX_BD_LONG_CFA_META_VLAN_VID_MASK		UINT32_C(0xfff)
441 	#define TX_BD_LONG_CFA_META_VLAN_VID_SFT		0
442 	/* When key=1, This is the VLAN tag DE value. */
443 	#define TX_BD_LONG_CFA_META_VLAN_DE			UINT32_C(0x1000)
444 	/* When key=1, This is the VLAN tag PRI value. */
445 	#define TX_BD_LONG_CFA_META_VLAN_PRI_MASK		UINT32_C(0xe000)
446 	#define TX_BD_LONG_CFA_META_VLAN_PRI_SFT		13
447 	/* When key=1, This is the VLAN tag TPID select value. */
448 	#define TX_BD_LONG_CFA_META_VLAN_TPID_MASK		UINT32_C(0x70000)
449 	#define TX_BD_LONG_CFA_META_VLAN_TPID_SFT		16
450 	/* 0x88a8 */
451 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8		(UINT32_C(0x0) << 16)
452 	/* 0x8100 */
453 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100		(UINT32_C(0x1) << 16)
454 	/* 0x9100 */
455 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100		(UINT32_C(0x2) << 16)
456 	/* 0x9200 */
457 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200		(UINT32_C(0x3) << 16)
458 	/* 0x9300 */
459 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300		(UINT32_C(0x4) << 16)
460 	/* Value programmed in CFA VLANTPID register. */
461 	#define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG		(UINT32_C(0x5) << 16)
462 	#define TX_BD_LONG_CFA_META_VLAN_TPID_LAST	TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
463 	/* When key=1, This is the VLAN tag TPID select value. */
464 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK		UINT32_C(0xff80000)
465 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT		19
466 	/*
467 	 * This field identifies the type of edit to be performed on the packet.
468 	 * This value must be valid on the first BD of a packet.
469 	 */
470 	#define TX_BD_LONG_CFA_META_KEY_MASK			UINT32_C(0xf0000000)
471 	#define TX_BD_LONG_CFA_META_KEY_SFT			28
472 	/* No editing */
473 	#define TX_BD_LONG_CFA_META_KEY_NONE			(UINT32_C(0x0) << 28)
474 	/*
475 	 * - meta[17:16] - TPID select value (0 = 0x8100). - meta[15:12]
476 	 * - PRI/DE value. - meta[11:0] - VID value.
477 	 */
478 	#define TX_BD_LONG_CFA_META_KEY_VLAN_TAG		(UINT32_C(0x1) << 28)
479 	#define TX_BD_LONG_CFA_META_KEY_LAST	TX_BD_LONG_CFA_META_KEY_VLAN_TAG
480 } __attribute__((packed));
481 
482 /* Empty TX BD (16 bytes) */
483 
484 struct tx_bd_empty {
485 	uint8_t type;
486 	/* This value identifies the type of buffer descriptor. */
487 	#define TX_BD_EMPTY_TYPE_MASK				UINT32_C(0x3f)
488 	#define TX_BD_EMPTY_TYPE_SFT				0
489 	/*
490 	 * Indicates that this BD is 1BB long and is an empty TX BD. Not
491 	 * valid for use by the driver.
492 	 */
493 	#define TX_BD_EMPTY_TYPE_TX_BD_EMPTY			UINT32_C(0x1)
494 	uint8_t unused_1[3];
495 	uint8_t unused_2;
496 	uint8_t unused_3[3];
497 	uint64_t unused_4;
498 } __attribute__((packed));
499 
500 /* RX Producer Packet BD (16 bytes) */
501 
502 struct rx_prod_pkt_bd {
503 	uint16_t flags_type;
504 	/* This value identifies the type of buffer descriptor. */
505 	#define RX_PROD_PKT_BD_TYPE_MASK			UINT32_C(0x3f)
506 	#define RX_PROD_PKT_BD_TYPE_SFT				0
507 	/*
508 	 * Indicates that this BD is 16B long and is an RX Producer (ie.
509 	 * empty) buffer descriptor.
510 	 */
511 	#define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT		UINT32_C(0x4)
512 	/*
513 	 * If set to 1, the packet will be placed at the address plus 2B. The 2
514 	 * Bytes of padding will be written as zero.
515 	 */
516 	/*
517 	 * This is intended to be used when the host buffer is cache-line
518 	 * aligned to produce packets that are easy to parse in host memory
519 	 * while still allowing writes to be cache line aligned.
520 	 */
521 	#define RX_PROD_PKT_BD_FLAGS_SOP_PAD			UINT32_C(0x40)
522 	/*
523 	 * If set to 1, the packet write will be padded out to the nearest
524 	 * cache-line with zero value padding.
525 	 */
526 	/*
527 	 * If receive buffers start/end on cache-line boundaries, this feature
528 	 * will ensure that all data writes on the PCI bus start/end on cache
529 	 * line boundaries.
530 	 */
531 	#define RX_PROD_PKT_BD_FLAGS_EOP_PAD			UINT32_C(0x80)
532 	/*
533 	 * This value is the number of additional buffers in the ring that
534 	 * describe the buffer space to be consumed for the this packet. If the
535 	 * value is zero, then the packet must fit within the space described by
536 	 * this BD. If this value is 1 or more, it indicates how many additional
537 	 * "buffer" BDs are in the ring immediately following this BD to be used
538 	 * for the same network packet. Even if the packet to be placed does not
539 	 * need all the additional buffers, they will be consumed anyway.
540 	 */
541 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK		UINT32_C(0x300)
542 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT		8
543 	#define RX_PROD_PKT_BD_FLAGS_MASK			UINT32_C(0xffc0)
544 	#define RX_PROD_PKT_BD_FLAGS_SFT			6
545 	uint16_t len;
546 	/*
547 	 * This is the length in Bytes of the host physical buffer where data
548 	 * for the packet may be placed in host memory.
549 	 */
550 	/*
551 	 * While this is a Byte resolution value, it is often advantageous to
552 	 * ensure that the buffers provided end on a host cache line.
553 	 */
554 	uint32_t opaque;
555 	/*
556 	 * The opaque data field is pass through to the completion and can be
557 	 * used for any data that the driver wants to associate with this
558 	 * receive buffer set.
559 	 */
560 	uint64_t addr;
561 	/*
562 	 * This is the host physical address where data for the packet may by
563 	 * placed in host memory.
564 	 */
565 	/*
566 	 * While this is a Byte resolution value, it is often advantageous to
567 	 * ensure that the buffers provide start on a host cache line.
568 	 */
569 } __attribute__((packed));
570 
571 /* RX Producer Buffer BD (16 bytes) */
572 
573 struct rx_prod_bfr_bd {
574 	uint16_t flags_type;
575 	/* This value identifies the type of buffer descriptor. */
576 	#define RX_PROD_BFR_BD_TYPE_MASK			UINT32_C(0x3f)
577 	#define RX_PROD_BFR_BD_TYPE_SFT				0
578 	/*
579 	 * Indicates that this BD is 16B long and is an RX Producer
580 	 * Buffer BD.
581 	 */
582 	#define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR		UINT32_C(0x5)
583 	#define RX_PROD_BFR_BD_FLAGS_MASK			UINT32_C(0xffc0)
584 	#define RX_PROD_BFR_BD_FLAGS_SFT			6
585 	uint16_t len;
586 	/*
587 	 * This is the length in Bytes of the host physical buffer where data
588 	 * for the packet may be placed in host memory.
589 	 */
590 	/*
591 	 * While this is a Byte resolution value, it is often advantageous to
592 	 * ensure that the buffers provided end on a host cache line.
593 	 */
594 	uint32_t opaque;
595 	/* This field is not used. */
596 	uint64_t addr;
597 	/*
598 	 * This is the host physical address where data for the packet may by
599 	 * placed in host memory.
600 	 */
601 	/*
602 	 * While this is a Byte resolution value, it is often advantageous to
603 	 * ensure that the buffers provide start on a host cache line.
604 	 */
605 } __attribute__((packed));
606 
607 /* RX Producer Aggregation BD (16 bytes) */
608 
609 struct rx_prod_agg_bd {
610 	uint16_t flags_type;
611 	/* This value identifies the type of buffer descriptor. */
612 	#define RX_PROD_AGG_BD_TYPE_MASK			UINT32_C(0x3f)
613 	#define RX_PROD_AGG_BD_TYPE_SFT				0
614 	/*
615 	 * Indicates that this BD is 16B long and is an RX Producer
616 	 * Assembly Buffer Descriptor.
617 	 */
618 	#define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG		UINT32_C(0x6)
619 	/*
620 	 * If set to 1, the packet write will be padded out to the nearest
621 	 * cache-line with zero value padding.
622 	 */
623 	/*
624 	 * If receive buffers start/end on cache-line boundaries, this feature
625 	 * will ensure that all data writes on the PCI bus end on cache line
626 	 * boundaries.
627 	 */
628 	#define RX_PROD_AGG_BD_FLAGS_EOP_PAD			UINT32_C(0x40)
629 	#define RX_PROD_AGG_BD_FLAGS_MASK			UINT32_C(0xffc0)
630 	#define RX_PROD_AGG_BD_FLAGS_SFT			6
631 	uint16_t len;
632 	/*
633 	 * This is the length in Bytes of the host physical buffer where data
634 	 * for the packet may be placed in host memory.
635 	 */
636 	/*
637 	 * While this is a Byte resolution value, it is often advantageous to
638 	 * ensure that the buffers provided end on a host cache line.
639 	 */
640 	uint32_t opaque;
641 	/*
642 	 * The opaque data field is pass through to the completion and can be
643 	 * used for any data that the driver wants to associate with this
644 	 * receive assembly buffer.
645 	 */
646 	uint64_t addr;
647 	/*
648 	 * This is the host physical address where data for the packet may by
649 	 * placed in host memory.
650 	 */
651 	/*
652 	 * While this is a Byte resolution value, it is often advantageous to
653 	 * ensure that the buffers provide start on a host cache line.
654 	 */
655 } __attribute__((packed));
656 
657 /* Completion Ring Structures */
658 /* Note: This structure is used by the HWRM to communicate HWRM Error. */
659 /* Base Completion Record (16 bytes) */
660 
661 struct cmpl_base {
662 	uint16_t type;
663 	/* unused is 10 b */
664 	/*
665 	 * This field indicates the exact type of the completion. By convention,
666 	 * the LSB identifies the length of the record in 16B units. Even values
667 	 * indicate 16B records. Odd values indicate 32B records.
668 	 */
669 	#define CMPL_BASE_TYPE_MASK				UINT32_C(0x3f)
670 	#define CMPL_BASE_TYPE_SFT				0
671 	/* TX L2 completion: Completion of TX packet. Length = 16B */
672 	#define CMPL_BASE_TYPE_TX_L2				UINT32_C(0x0)
673 	/* RX L2 completion: Completion of and L2 RX packet. Length = 32B */
674 	#define CMPL_BASE_TYPE_RX_L2				UINT32_C(0x11)
675 	/*
676 	 * RX Aggregation Buffer completion : Completion of an L2
677 	 * aggregation buffer in support of TPA, HDS, or Jumbo packet
678 	 * completion. Length = 16B
679 	 */
680 	#define CMPL_BASE_TYPE_RX_AGG				UINT32_C(0x12)
681 	/*
682 	 * RX L2 TPA Start Completion: Completion at the beginning of a
683 	 * TPA operation. Length = 32B
684 	 */
685 	#define CMPL_BASE_TYPE_RX_TPA_START			UINT32_C(0x13)
686 	/*
687 	 * RX L2 TPA End Completion: Completion at the end of a TPA
688 	 * operation. Length = 32B
689 	 */
690 	#define CMPL_BASE_TYPE_RX_TPA_END			UINT32_C(0x15)
691 	/*
692 	 * Statistics Ejection Completion: Completion of statistics data
693 	 * ejection buffer. Length = 16B
694 	 */
695 	#define CMPL_BASE_TYPE_STAT_EJECT			UINT32_C(0x1a)
696 	/* HWRM Command Completion: Completion of an HWRM command. */
697 	#define CMPL_BASE_TYPE_HWRM_DONE			UINT32_C(0x20)
698 	/* Forwarded HWRM Request */
699 	#define CMPL_BASE_TYPE_HWRM_FWD_REQ			UINT32_C(0x22)
700 	/* Forwarded HWRM Response */
701 	#define CMPL_BASE_TYPE_HWRM_FWD_RESP			UINT32_C(0x24)
702 	/* HWRM Asynchronous Event Information */
703 	#define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT		UINT32_C(0x2e)
704 	/* CQ Notification */
705 	#define CMPL_BASE_TYPE_CQ_NOTIFICATION			UINT32_C(0x30)
706 	/* SRQ Threshold Event */
707 	#define CMPL_BASE_TYPE_SRQ_EVENT			UINT32_C(0x32)
708 	/* DBQ Threshold Event */
709 	#define CMPL_BASE_TYPE_DBQ_EVENT			UINT32_C(0x34)
710 	/* QP Async Notification */
711 	#define CMPL_BASE_TYPE_QP_EVENT			UINT32_C(0x38)
712 	/* Function Async Notification */
713 	#define CMPL_BASE_TYPE_FUNC_EVENT			UINT32_C(0x3a)
714 	/* unused is 10 b */
715 	uint16_t info1;
716 	/* info1 is 16 b */
717 	uint32_t info2;
718 	/* info2 is 32 b */
719 	uint32_t info3_v;
720 	/* info3 is 31 b */
721 	/*
722 	 * This value is written by the NIC such that it will be different for
723 	 * each pass through the completion queue. The even passes will write 1.
724 	 * The odd passes will write 0.
725 	 */
726 	#define CMPL_BASE_V					UINT32_C(0x1)
727 	/* info3 is 31 b */
728 	#define CMPL_BASE_INFO3_MASK				UINT32_C(0xfffffffe)
729 	#define CMPL_BASE_INFO3_SFT				1
730 	uint32_t info4;
731 	/* info4 is 32 b */
732 } __attribute__((packed));
733 
734 /* TX Completion Record (16 bytes) */
735 
736 struct tx_cmpl {
737 	uint16_t flags_type;
738 	/*
739 	 * This field indicates the exact type of the completion. By convention,
740 	 * the LSB identifies the length of the record in 16B units. Even values
741 	 * indicate 16B records. Odd values indicate 32B records.
742 	 */
743 	#define TX_CMPL_TYPE_MASK				UINT32_C(0x3f)
744 	#define TX_CMPL_TYPE_SFT				0
745 	/* TX L2 completion: Completion of TX packet. Length = 16B */
746 	#define TX_CMPL_TYPE_TX_L2				UINT32_C(0x0)
747 	/*
748 	 * When this bit is '1', it indicates a packet that has an error of some
749 	 * type. Type of error is indicated in error_flags.
750 	 */
751 	#define TX_CMPL_FLAGS_ERROR				UINT32_C(0x40)
752 	/*
753 	 * When this bit is '1', it indicates that the packet completed was
754 	 * transmitted using the push acceleration data provided by the driver.
755 	 * When this bit is '0', it indicates that the packet had not push
756 	 * acceleration data written or was executed as a normal packet even
757 	 * though push data was provided.
758 	 */
759 	#define TX_CMPL_FLAGS_PUSH				UINT32_C(0x80)
760 	#define TX_CMPL_FLAGS_MASK				UINT32_C(0xffc0)
761 	#define TX_CMPL_FLAGS_SFT				6
762 	uint16_t unused_0;
763 	/* unused1 is 16 b */
764 	uint32_t opaque;
765 	/*
766 	 * This is a copy of the opaque field from the first TX BD of this
767 	 * transmitted packet.
768 	 */
769 	uint16_t errors_v;
770 	/*
771 	 * This value is written by the NIC such that it will be different for
772 	 * each pass through the completion queue. The even passes will write 1.
773 	 * The odd passes will write 0.
774 	 */
775 	#define TX_CMPL_V					UINT32_C(0x1)
776 	/*
777 	 * This error indicates that there was some sort of problem with the BDs
778 	 * for the packet.
779 	 */
780 	#define TX_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
781 	#define TX_CMPL_ERRORS_BUFFER_ERROR_SFT			1
782 	/* No error */
783 	#define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR		(UINT32_C(0x0) << 1)
784 	/* Bad Format: BDs were not formatted correctly. */
785 	#define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT		(UINT32_C(0x2) << 1)
786 	#define TX_CMPL_ERRORS_BUFFER_ERROR_LAST	TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
787 	/*
788 	 * When this bit is '1', it indicates that the length of the packet was
789 	 * zero. No packet was transmitted.
790 	 */
791 	#define TX_CMPL_ERRORS_ZERO_LENGTH_PKT			UINT32_C(0x10)
792 	/*
793 	 * When this bit is '1', it indicates that the packet was longer than
794 	 * the programmed limit in TDI. No packet was transmitted.
795 	 */
796 	#define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH		UINT32_C(0x20)
797 	/*
798 	 * When this bit is '1', it indicates that one or more of the BDs
799 	 * associated with this packet generated a PCI error. This probably
800 	 * means the address was not valid.
801 	 */
802 	#define TX_CMPL_ERRORS_DMA_ERROR			UINT32_C(0x40)
803 	/*
804 	 * When this bit is '1', it indicates that the packet was longer than
805 	 * indicated by the hint. No packet was transmitted.
806 	 */
807 	#define TX_CMPL_ERRORS_HINT_TOO_SHORT			UINT32_C(0x80)
808 	/*
809 	 * When this bit is '1', it indicates that the packet was dropped due to
810 	 * Poison TLP error on one or more of the TLPs in the PXP completion.
811 	 */
812 	#define TX_CMPL_ERRORS_POISON_TLP_ERROR			UINT32_C(0x100)
813 	#define TX_CMPL_ERRORS_MASK				UINT32_C(0xfffe)
814 	#define TX_CMPL_ERRORS_SFT				1
815 	uint16_t unused_1;
816 	/* unused2 is 16 b */
817 	uint32_t unused_2;
818 	/* unused3 is 32 b */
819 } __attribute__((packed));
820 
821 /* RX Packet Completion Record (32 bytes split to 2 16-byte struct) */
822 
823 struct rx_pkt_cmpl {
824 	uint16_t flags_type;
825 	/*
826 	 * This field indicates the exact type of the completion. By convention,
827 	 * the LSB identifies the length of the record in 16B units. Even values
828 	 * indicate 16B records. Odd values indicate 32B records.
829 	 */
830 	#define RX_PKT_CMPL_TYPE_MASK				UINT32_C(0x3f)
831 	#define RX_PKT_CMPL_TYPE_SFT				0
832 	/* RX L2 completion: Completion of and L2 RX packet. Length = 32B */
833 	#define RX_PKT_CMPL_TYPE_RX_L2				UINT32_C(0x11)
834 	/*
835 	 * When this bit is '1', it indicates a packet that has an error of some
836 	 * type. Type of error is indicated in error_flags.
837 	 */
838 	#define RX_PKT_CMPL_FLAGS_ERROR				UINT32_C(0x40)
839 	/* This field indicates how the packet was placed in the buffer. */
840 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
841 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT			7
842 	/* Normal: Packet was placed using normal algorithm. */
843 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
844 	/* Jumbo: Packet was placed using jumbo algorithm. */
845 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
846 	/*
847 	 * Header/Data Separation: Packet was placed using Header/Data
848 	 * separation algorithm. The separation location is indicated by
849 	 * the itype field.
850 	 */
851 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
852 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST	RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
853 	/* This bit is '1' if the RSS field in this completion is valid. */
854 	#define RX_PKT_CMPL_FLAGS_RSS_VALID			UINT32_C(0x400)
855 	/* unused is 1 b */
856 	#define RX_PKT_CMPL_FLAGS_UNUSED			UINT32_C(0x800)
857 	/*
858 	 * This value indicates what the inner packet determined for the packet
859 	 * was.
860 	 */
861 	#define RX_PKT_CMPL_FLAGS_ITYPE_MASK			UINT32_C(0xf000)
862 	#define RX_PKT_CMPL_FLAGS_ITYPE_SFT			12
863 	/* Not Known: Indicates that the packet type was not known. */
864 	#define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
865 	/*
866 	 * IP Packet: Indicates that the packet was an IP packet, but
867 	 * further classification was not possible.
868 	 */
869 	#define RX_PKT_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
870 	/*
871 	 * TCP Packet: Indicates that the packet was IP and TCP. This
872 	 * indicates that the payload_offset field is valid.
873 	 */
874 	#define RX_PKT_CMPL_FLAGS_ITYPE_TCP			(UINT32_C(0x2) << 12)
875 	/*
876 	 * UDP Packet: Indicates that the packet was IP and UDP. This
877 	 * indicates that the payload_offset field is valid.
878 	 */
879 	#define RX_PKT_CMPL_FLAGS_ITYPE_UDP			(UINT32_C(0x3) << 12)
880 	/*
881 	 * FCoE Packet: Indicates that the packet was recognized as a
882 	 * FCoE. This also indicates that the payload_offset field is
883 	 * valid.
884 	 */
885 	#define RX_PKT_CMPL_FLAGS_ITYPE_FCOE			(UINT32_C(0x4) << 12)
886 	/*
887 	 * RoCE Packet: Indicates that the packet was recognized as a
888 	 * RoCE. This also indicates that the payload_offset field is
889 	 * valid.
890 	 */
891 	#define RX_PKT_CMPL_FLAGS_ITYPE_ROCE			(UINT32_C(0x5) << 12)
892 	/*
893 	 * ICMP Packet: Indicates that the packet was recognized as
894 	 * ICMP. This indicates that the payload_offset field is valid.
895 	 */
896 	#define RX_PKT_CMPL_FLAGS_ITYPE_ICMP			(UINT32_C(0x7) << 12)
897 	/*
898 	 * PtP packet wo/timestamp: Indicates that the packet was
899 	 * recognized as a PtP packet.
900 	 */
901 	#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
902 	/*
903 	 * PtP packet w/timestamp: Indicates that the packet was
904 	 * recognized as a PtP packet and that a timestamp was taken for
905 	 * the packet.
906 	 */
907 	#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
908 	#define RX_PKT_CMPL_FLAGS_ITYPE_LAST	RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
909 	#define RX_PKT_CMPL_FLAGS_MASK				UINT32_C(0xffc0)
910 	#define RX_PKT_CMPL_FLAGS_SFT				6
911 	uint16_t len;
912 	/*
913 	 * This is the length of the data for the packet stored in the buffer(s)
914 	 * identified by the opaque value. This includes the packet BD and any
915 	 * associated buffer BDs. This does not include the the length of any
916 	 * data places in aggregation BDs.
917 	 */
918 	uint32_t opaque;
919 	/*
920 	 * This is a copy of the opaque field from the RX BD this completion
921 	 * corresponds to.
922 	 */
923 	uint8_t agg_bufs_v1;
924 	/* unused1 is 2 b */
925 	/*
926 	 * This value is written by the NIC such that it will be different for
927 	 * each pass through the completion queue. The even passes will write 1.
928 	 * The odd passes will write 0.
929 	 */
930 	#define RX_PKT_CMPL_V1					UINT32_C(0x1)
931 	/*
932 	 * This value is the number of aggregation buffers that follow this
933 	 * entry in the completion ring that are a part of this packet. If the
934 	 * value is zero, then the packet is completely contained in the buffer
935 	 * space provided for the packet in the RX ring.
936 	 */
937 	#define RX_PKT_CMPL_AGG_BUFS_MASK			UINT32_C(0x3e)
938 	#define RX_PKT_CMPL_AGG_BUFS_SFT			1
939 	/* unused1 is 2 b */
940 	uint8_t rss_hash_type;
941 	/*
942 	 * This is the RSS hash type for the packet. The value is packed
943 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. The
944 	 * value of tuple_extrac_op provides the information about what fields
945 	 * the hash was computed on. * 0: The RSS hash was computed over source
946 	 * IP address, destination IP address, source port, and destination port
947 	 * of inner IP and TCP or UDP headers. Note: For non-tunneled packets,
948 	 * the packet headers are considered inner packet headers for the RSS
949 	 * hash computation purpose. * 1: The RSS hash was computed over source
950 	 * IP address and destination IP address of inner IP header. Note: For
951 	 * non-tunneled packets, the packet headers are considered inner packet
952 	 * headers for the RSS hash computation purpose. * 2: The RSS hash was
953 	 * computed over source IP address, destination IP address, source port,
954 	 * and destination port of IP and TCP or UDP headers of outer tunnel
955 	 * headers. Note: For non-tunneled packets, this value is not
956 	 * applicable. * 3: The RSS hash was computed over source IP address and
957 	 * destination IP address of IP header of outer tunnel headers. Note:
958 	 * For non-tunneled packets, this value is not applicable. Note that
959 	 * 4-tuples values listed above are applicable for layer 4 protocols
960 	 * supported and enabled for RSS in the hardware, HWRM firmware, and
961 	 * drivers. For example, if RSS hash is supported and enabled for TCP
962 	 * traffic only, then the values of tuple_extract_op corresponding to
963 	 * 4-tuples are only valid for TCP traffic.
964 	 */
965 	uint8_t payload_offset;
966 	/*
967 	 * This value indicates the offset in bytes from the beginning of the
968 	 * packet where the inner payload starts. This value is valid for TCP,
969 	 * UDP, FCoE, and RoCE packets. A value of zero indicates that header is
970 	 * 256B into the packet.
971 	 */
972 	uint8_t unused_1;
973 	/* unused2 is 8 b */
974 	uint32_t rss_hash;
975 	/*
976 	 * This value is the RSS hash value calculated for the packet based on
977 	 * the mode bits and key value in the VNIC.
978 	 */
979 } __attribute__((packed));
980 
981 /* last 16 bytes of RX Packet Completion Record */
982 
983 struct rx_pkt_cmpl_hi {
984 	uint32_t flags2;
985 	/*
986 	 * This indicates that the ip checksum was calculated for the inner
987 	 * packet and that the ip_cs_error field indicates if there was an
988 	 * error.
989 	 */
990 	#define RX_PKT_CMPL_FLAGS2_IP_CS_CALC			UINT32_C(0x1)
991 	/*
992 	 * This indicates that the TCP, UDP or ICMP checksum was calculated for
993 	 * the inner packet and that the l4_cs_error field indicates if there
994 	 * was an error.
995 	 */
996 	#define RX_PKT_CMPL_FLAGS2_L4_CS_CALC			UINT32_C(0x2)
997 	/*
998 	 * This indicates that the ip checksum was calculated for the tunnel
999 	 * header and that the t_ip_cs_error field indicates if there was an
1000 	 * error.
1001 	 */
1002 	#define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC			UINT32_C(0x4)
1003 	/*
1004 	 * This indicates that the UDP checksum was calculated for the tunnel
1005 	 * packet and that the t_l4_cs_error field indicates if there was an
1006 	 * error.
1007 	 */
1008 	#define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC			UINT32_C(0x8)
1009 	/* This value indicates what format the metadata field is. */
1010 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK		UINT32_C(0xf0)
1011 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT		4
1012 	/* No metadata informtaion. Value is zero. */
1013 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
1014 	/*
1015 	 * The metadata field contains the VLAN tag and TPID value. -
1016 	 * metadata[11:0] contains the vlan VID value. - metadata[12]
1017 	 * contains the vlan DE value. - metadata[15:13] contains the
1018 	 * vlan PRI value. - metadata[31:16] contains the vlan TPID
1019 	 * value.
1020 	 */
1021 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
1022 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST	RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
1023 	/*
1024 	 * This field indicates the IP type for the inner-most IP header. A
1025 	 * value of '0' indicates IPv4. A value of '1' indicates IPv6. This
1026 	 * value is only valid if itype indicates a packet with an IP header.
1027 	 */
1028 	#define RX_PKT_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
1029 	uint32_t metadata;
1030 	/*
1031 	 * This is data from the CFA block as indicated by the meta_format
1032 	 * field.
1033 	 */
1034 	/* When meta_format=1, this value is the VLAN VID. */
1035 	#define RX_PKT_CMPL_METADATA_VID_MASK			UINT32_C(0xfff)
1036 	#define RX_PKT_CMPL_METADATA_VID_SFT			0
1037 	/* When meta_format=1, this value is the VLAN DE. */
1038 	#define RX_PKT_CMPL_METADATA_DE				UINT32_C(0x1000)
1039 	/* When meta_format=1, this value is the VLAN PRI. */
1040 	#define RX_PKT_CMPL_METADATA_PRI_MASK			UINT32_C(0xe000)
1041 	#define RX_PKT_CMPL_METADATA_PRI_SFT			13
1042 	/* When meta_format=1, this value is the VLAN TPID. */
1043 	#define RX_PKT_CMPL_METADATA_TPID_MASK			UINT32_C(0xffff0000)
1044 	#define RX_PKT_CMPL_METADATA_TPID_SFT			16
1045 	uint16_t errors_v2;
1046 	/*
1047 	 * This value is written by the NIC such that it will be different for
1048 	 * each pass through the completion queue. The even passes will write 1.
1049 	 * The odd passes will write 0.
1050 	 */
1051 	#define RX_PKT_CMPL_V2					UINT32_C(0x1)
1052 	/*
1053 	 * This error indicates that there was some sort of problem with the BDs
1054 	 * for the packet that was found after part of the packet was already
1055 	 * placed. The packet should be treated as invalid.
1056 	 */
1057 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
1058 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT		1
1059 	/* No buffer error */
1060 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
1061 	/*
1062 	 * Did Not Fit: Packet did not fit into packet buffer provided.
1063 	 * For regular placement, this means the packet did not fit in
1064 	 * the buffer provided. For HDS and jumbo placement, this means
1065 	 * that the packet could not be placed into 7 physical buffers
1066 	 * or less.
1067 	 */
1068 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT	(UINT32_C(0x1) << 1)
1069 	/*
1070 	 * Not On Chip: All BDs needed for the packet were not on-chip
1071 	 * when the packet arrived.
1072 	 */
1073 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP	(UINT32_C(0x2) << 1)
1074 	/* Bad Format: BDs were not formatted correctly. */
1075 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
1076 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
1077 	/* This indicates that there was an error in the IP header checksum. */
1078 	#define RX_PKT_CMPL_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
1079 	/*
1080 	 * This indicates that there was an error in the TCP, UDP or ICMP
1081 	 * checksum.
1082 	 */
1083 	#define RX_PKT_CMPL_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
1084 	/*
1085 	 * This indicates that there was an error in the tunnel IP header
1086 	 * checksum.
1087 	 */
1088 	#define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR		UINT32_C(0x40)
1089 	/* This indicates that there was an error in the tunnel UDP checksum. */
1090 	#define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR		UINT32_C(0x80)
1091 	/*
1092 	 * This indicates that there was a CRC error on either an FCoE or RoCE
1093 	 * packet. The itype indicates the packet type.
1094 	 */
1095 	#define RX_PKT_CMPL_ERRORS_CRC_ERROR			UINT32_C(0x100)
1096 	/*
1097 	 * This indicates that there was an error in the tunnel portion of the
1098 	 * packet when this field is non-zero.
1099 	 */
1100 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
1101 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT		9
1102 	/*
1103 	 * No additional error occurred on the tunnel portion of the
1104 	 * packet of the packet does not have a tunnel.
1105 	 */
1106 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR	(UINT32_C(0x0) << 9)
1107 	/*
1108 	 * Indicates that IP header version does not match expectation
1109 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
1110 	 */
1111 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION   (UINT32_C(0x1) << 9)
1112 	/*
1113 	 * Indicates that header length is out of range in the tunnel
1114 	 * header. Valid for IPv4.
1115 	 */
1116 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN   (UINT32_C(0x2) << 9)
1117 	/*
1118 	 * Indicates that the physical packet is shorter than that
1119 	 * claimed by the PPPoE header length for a tunnel PPPoE packet.
1120 	 */
1121 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (UINT32_C(0x3) << 9)
1122 	/*
1123 	 * Indicates that physical packet is shorter than that claimed
1124 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
1125 	 * tunnel packet packets.
1126 	 */
1127 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR   (UINT32_C(0x4) << 9)
1128 	/*
1129 	 * Indicates that the physical packet is shorter than that
1130 	 * claimed by the tunnel UDP header length for a tunnel UDP
1131 	 * packet that is not fragmented.
1132 	 */
1133 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR  (UINT32_C(0x5) << 9)
1134 	/*
1135 	 * indicates that the IPv4 TTL or IPv6 hop limit check have
1136 	 * failed (e.g. TTL = 0) in the tunnel header. Valid for IPv4,
1137 	 * and IPv6.
1138 	 */
1139 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL	(UINT32_C(0x6) << 9)
1140 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST	RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
1141 	/*
1142 	 * This indicates that there was an error in the inner portion of the
1143 	 * packet when this field is non-zero.
1144 	 */
1145 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK		UINT32_C(0xf000)
1146 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT		12
1147 	/*
1148 	 * No additional error occurred on the tunnel portion of the
1149 	 * packet of the packet does not have a tunnel.
1150 	 */
1151 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
1152 	/*
1153 	 * Indicates that IP header version does not match expectation
1154 	 * from L2 Ethertype for IPv4 and IPv6 or that option other than
1155 	 * VFT was parsed on FCoE packet.
1156 	 */
1157 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION	(UINT32_C(0x1) << 12)
1158 	/*
1159 	 * indicates that header length is out of range. Valid for IPv4
1160 	 * and RoCE
1161 	 */
1162 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 12)
1163 	/*
1164 	 * indicates that the IPv4 TTL or IPv6 hop limit check have
1165 	 * failed (e.g. TTL = 0). Valid for IPv4, and IPv6
1166 	 */
1167 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL	(UINT32_C(0x3) << 12)
1168 	/*
1169 	 * Indicates that physical packet is shorter than that claimed
1170 	 * by the l3 header length. Valid for IPv4, IPv6 packet or RoCE
1171 	 * packets.
1172 	 */
1173 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR	(UINT32_C(0x4) << 12)
1174 	/*
1175 	 * Indicates that the physical packet is shorter than that
1176 	 * claimed by the UDP header length for a UDP packet that is not
1177 	 * fragmented.
1178 	 */
1179 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
1180 	/*
1181 	 * Indicates that TCP header length > IP payload. Valid for TCP
1182 	 * packets only.
1183 	 */
1184 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN	(UINT32_C(0x6) << 12)
1185 	/* Indicates that TCP header length < 5. Valid for TCP. */
1186 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
1187 	/*
1188 	 * Indicates that TCP option headers result in a TCP header size
1189 	 * that does not match data offset in TCP header. Valid for TCP.
1190 	 */
1191 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN	(UINT32_C(0x8) << 12)
1192 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST	RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
1193 	#define RX_PKT_CMPL_ERRORS_MASK				UINT32_C(0xfffe)
1194 	#define RX_PKT_CMPL_ERRORS_SFT				1
1195 	uint16_t cfa_code;
1196 	/*
1197 	 * This field identifies the CFA action rule that was used for this
1198 	 * packet.
1199 	 */
1200 	uint32_t reorder;
1201 	/*
1202 	 * This value holds the reordering sequence number for the packet. If
1203 	 * the reordering sequence is not valid, then this value is zero. The
1204 	 * reordering domain for the packet is in the bottom 8 to 10b of the
1205 	 * rss_hash value. The bottom 20b of this value contain the ordering
1206 	 * domain value for the packet.
1207 	 */
1208 	#define RX_PKT_CMPL_REORDER_MASK			UINT32_C(0xffffff)
1209 	#define RX_PKT_CMPL_REORDER_SFT				0
1210 } __attribute__((packed));
1211 
1212 /* RX L2 TPA Start Completion Record (32 bytes split to 2 16-byte struct) */
1213 
1214 struct rx_tpa_start_cmpl {
1215 	uint16_t flags_type;
1216 	/*
1217 	 * This field indicates the exact type of the completion. By convention,
1218 	 * the LSB identifies the length of the record in 16B units. Even values
1219 	 * indicate 16B records. Odd values indicate 32B records.
1220 	 */
1221 	#define RX_TPA_START_CMPL_TYPE_MASK			UINT32_C(0x3f)
1222 	#define RX_TPA_START_CMPL_TYPE_SFT			0
1223 	/*
1224 	 * RX L2 TPA Start Completion: Completion at the beginning of a
1225 	 * TPA operation. Length = 32B
1226 	 */
1227 	#define RX_TPA_START_CMPL_TYPE_RX_TPA_START		UINT32_C(0x13)
1228 	/* This bit will always be '0' for TPA start completions. */
1229 	#define RX_TPA_START_CMPL_FLAGS_ERROR			UINT32_C(0x40)
1230 	/* This field indicates how the packet was placed in the buffer. */
1231 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
1232 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT		7
1233 	/*
1234 	 * Jumbo: TPA Packet was placed using jumbo algorithm. This
1235 	 * means that the first buffer will be filled with data before
1236 	 * moving to aggregation buffers. Each aggregation buffer will
1237 	 * be filled before moving to the next aggregation buffer.
1238 	 */
1239 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO	(UINT32_C(0x1) << 7)
1240 	/*
1241 	 * Header/Data Separation: Packet was placed using Header/Data
1242 	 * separation algorithm. The separation location is indicated by
1243 	 * the itype field.
1244 	 */
1245 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
1246 	/*
1247 	 * GRO/Jumbo: Packet will be placed using GRO/Jumbo where the
1248 	 * first packet is filled with data. Subsequent packets will be
1249 	 * placed such that any one packet does not span two aggregation
1250 	 * buffers unless it starts at the beginning of an aggregation
1251 	 * buffer.
1252 	 */
1253 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
1254 	/*
1255 	 * GRO/Header-Data Separation: Packet will be placed using
1256 	 * GRO/HDS where the header is in the first packet. Payload of
1257 	 * each packet will be placed such that any one packet does not
1258 	 * span two aggregation buffers unless it starts at the
1259 	 * beginning of an aggregation buffer.
1260 	 */
1261 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
1262 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST	RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
1263 	/* This bit is '1' if the RSS field in this completion is valid. */
1264 	#define RX_TPA_START_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
1265 	/* unused is 1 b */
1266 	#define RX_TPA_START_CMPL_FLAGS_UNUSED			UINT32_C(0x800)
1267 	/*
1268 	 * This value indicates what the inner packet determined for the packet
1269 	 * was.
1270 	 */
1271 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
1272 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT		12
1273 	/* TCP Packet: Indicates that the packet was IP and TCP. */
1274 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
1275 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST	RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
1276 	#define RX_TPA_START_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
1277 	#define RX_TPA_START_CMPL_FLAGS_SFT			6
1278 	uint16_t len;
1279 	/*
1280 	 * This value indicates the amount of packet data written to the buffer
1281 	 * the opaque field in this completion corresponds to.
1282 	 */
1283 	uint32_t opaque;
1284 	/*
1285 	 * This is a copy of the opaque field from the RX BD this completion
1286 	 * corresponds to.
1287 	 */
1288 	uint8_t v1;
1289 	/* unused1 is 7 b */
1290 	/*
1291 	 * This value is written by the NIC such that it will be different for
1292 	 * each pass through the completion queue. The even passes will write 1.
1293 	 * The odd passes will write 0.
1294 	 */
1295 	#define RX_TPA_START_CMPL_V1				UINT32_C(0x1)
1296 	/* unused1 is 7 b */
1297 	uint8_t rss_hash_type;
1298 	/*
1299 	 * This is the RSS hash type for the packet. The value is packed
1300 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. The
1301 	 * value of tuple_extrac_op provides the information about what fields
1302 	 * the hash was computed on. * 0: The RSS hash was computed over source
1303 	 * IP address, destination IP address, source port, and destination port
1304 	 * of inner IP and TCP or UDP headers. Note: For non-tunneled packets,
1305 	 * the packet headers are considered inner packet headers for the RSS
1306 	 * hash computation purpose. * 1: The RSS hash was computed over source
1307 	 * IP address and destination IP address of inner IP header. Note: For
1308 	 * non-tunneled packets, the packet headers are considered inner packet
1309 	 * headers for the RSS hash computation purpose. * 2: The RSS hash was
1310 	 * computed over source IP address, destination IP address, source port,
1311 	 * and destination port of IP and TCP or UDP headers of outer tunnel
1312 	 * headers. Note: For non-tunneled packets, this value is not
1313 	 * applicable. * 3: The RSS hash was computed over source IP address and
1314 	 * destination IP address of IP header of outer tunnel headers. Note:
1315 	 * For non-tunneled packets, this value is not applicable. Note that
1316 	 * 4-tuples values listed above are applicable for layer 4 protocols
1317 	 * supported and enabled for RSS in the hardware, HWRM firmware, and
1318 	 * drivers. For example, if RSS hash is supported and enabled for TCP
1319 	 * traffic only, then the values of tuple_extract_op corresponding to
1320 	 * 4-tuples are only valid for TCP traffic.
1321 	 */
1322 	uint16_t agg_id;
1323 	/*
1324 	 * This is the aggregation ID that the completion is associated with.
1325 	 * Use this number to correlate the TPA start completion with the TPA
1326 	 * end completion.
1327 	 */
1328 	/* unused2 is 9 b */
1329 	/*
1330 	 * This is the aggregation ID that the completion is associated with.
1331 	 * Use this number to correlate the TPA start completion with the TPA
1332 	 * end completion.
1333 	 */
1334 	#define RX_TPA_START_CMPL_AGG_ID_MASK			UINT32_C(0xfe00)
1335 	#define RX_TPA_START_CMPL_AGG_ID_SFT			9
1336 	uint32_t rss_hash;
1337 	/*
1338 	 * This value is the RSS hash value calculated for the packet based on
1339 	 * the mode bits and key value in the VNIC.
1340 	 */
1341 } __attribute__((packed));
1342 
1343 /* last 16 bytes of RX L2 TPA Start Completion Record */
1344 
1345 struct rx_tpa_start_cmpl_hi {
1346 	uint32_t flags2;
1347 	/*
1348 	 * This indicates that the ip checksum was calculated for the inner
1349 	 * packet and that the sum passed for all segments included in the
1350 	 * aggregation.
1351 	 */
1352 	#define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
1353 	/*
1354 	 * This indicates that the TCP, UDP or ICMP checksum was calculated for
1355 	 * the inner packet and that the sum passed for all segments included in
1356 	 * the aggregation.
1357 	 */
1358 	#define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
1359 	/*
1360 	 * This indicates that the ip checksum was calculated for the tunnel
1361 	 * header and that the sum passed for all segments included in the
1362 	 * aggregation.
1363 	 */
1364 	#define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
1365 	/*
1366 	 * This indicates that the UDP checksum was calculated for the tunnel
1367 	 * packet and that the sum passed for all segments included in the
1368 	 * aggregation.
1369 	 */
1370 	#define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
1371 	/* This value indicates what format the metadata field is. */
1372 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
1373 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT	4
1374 	/* No metadata informtaion. Value is zero. */
1375 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE	(UINT32_C(0x0) << 4)
1376 	/*
1377 	 * The metadata field contains the VLAN tag and TPID value. -
1378 	 * metadata[11:0] contains the vlan VID value. - metadata[12]
1379 	 * contains the vlan DE value. - metadata[15:13] contains the
1380 	 * vlan PRI value. - metadata[31:16] contains the vlan TPID
1381 	 * value.
1382 	 */
1383 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN	(UINT32_C(0x1) << 4)
1384 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST	RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
1385 	/*
1386 	 * This field indicates the IP type for the inner-most IP header. A
1387 	 * value of '0' indicates IPv4. A value of '1' indicates IPv6.
1388 	 */
1389 	#define RX_TPA_START_CMPL_FLAGS2_IP_TYPE		UINT32_C(0x100)
1390 	uint32_t metadata;
1391 	/*
1392 	 * This is data from the CFA block as indicated by the meta_format
1393 	 * field.
1394 	 */
1395 	/* When meta_format=1, this value is the VLAN VID. */
1396 	#define RX_TPA_START_CMPL_METADATA_VID_MASK		UINT32_C(0xfff)
1397 	#define RX_TPA_START_CMPL_METADATA_VID_SFT		0
1398 	/* When meta_format=1, this value is the VLAN DE. */
1399 	#define RX_TPA_START_CMPL_METADATA_DE			UINT32_C(0x1000)
1400 	/* When meta_format=1, this value is the VLAN PRI. */
1401 	#define RX_TPA_START_CMPL_METADATA_PRI_MASK		UINT32_C(0xe000)
1402 	#define RX_TPA_START_CMPL_METADATA_PRI_SFT		13
1403 	/* When meta_format=1, this value is the VLAN TPID. */
1404 	#define RX_TPA_START_CMPL_METADATA_TPID_MASK		UINT32_C(0xffff0000)
1405 	#define RX_TPA_START_CMPL_METADATA_TPID_SFT		16
1406 	uint16_t v2;
1407 	/* unused4 is 15 b */
1408 	/*
1409 	 * This value is written by the NIC such that it will be different for
1410 	 * each pass through the completion queue. The even passes will write 1.
1411 	 * The odd passes will write 0.
1412 	 */
1413 	#define RX_TPA_START_CMPL_V2				UINT32_C(0x1)
1414 	/* unused4 is 15 b */
1415 	uint16_t cfa_code;
1416 	/*
1417 	 * This field identifies the CFA action rule that was used for this
1418 	 * packet.
1419 	 */
1420 	uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
1421 	/*
1422 	 * This is the size in bytes of the inner most L4 header. This can be
1423 	 * subtracted from the payload_offset to determine the start of the
1424 	 * inner most L4 header.
1425 	 */
1426 	/*
1427 	 * This is the offset from the beginning of the packet in bytes for the
1428 	 * outer L3 header. If there is no outer L3 header, then this value is
1429 	 * zero.
1430 	 */
1431 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK		UINT32_C(0x1ff)
1432 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT		0
1433 	/*
1434 	 * This is the offset from the beginning of the packet in bytes for the
1435 	 * inner most L2 header.
1436 	 */
1437 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK		UINT32_C(0x3fe00)
1438 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT		9
1439 	/*
1440 	 * This is the offset from the beginning of the packet in bytes for the
1441 	 * inner most L3 header.
1442 	 */
1443 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK		UINT32_C(0x7fc0000)
1444 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT		18
1445 	/*
1446 	 * This is the size in bytes of the inner most L4 header. This can be
1447 	 * subtracted from the payload_offset to determine the start of the
1448 	 * inner most L4 header.
1449 	 */
1450 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK		UINT32_C(0xf8000000)
1451 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT		27
1452 } __attribute__((packed));
1453 
1454 /* RX TPA End Completion Record (32 bytes split to 2 16-byte struct) */
1455 
1456 struct rx_tpa_end_cmpl {
1457 	uint16_t flags_type;
1458 	/*
1459 	 * This field indicates the exact type of the completion. By convention,
1460 	 * the LSB identifies the length of the record in 16B units. Even values
1461 	 * indicate 16B records. Odd values indicate 32B records.
1462 	 */
1463 	#define RX_TPA_END_CMPL_TYPE_MASK			UINT32_C(0x3f)
1464 	#define RX_TPA_END_CMPL_TYPE_SFT			0
1465 	/*
1466 	 * RX L2 TPA End Completion: Completion at the end of a TPA
1467 	 * operation. Length = 32B
1468 	 */
1469 	#define RX_TPA_END_CMPL_TYPE_RX_TPA_END		UINT32_C(0x15)
1470 	/*
1471 	 * When this bit is '1', it indicates a packet that has an error of some
1472 	 * type. Type of error is indicated in error_flags.
1473 	 */
1474 	#define RX_TPA_END_CMPL_FLAGS_ERROR			UINT32_C(0x40)
1475 	/* This field indicates how the packet was placed in the buffer. */
1476 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
1477 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT		7
1478 	/*
1479 	 * Jumbo: TPA Packet was placed using jumbo algorithm. This
1480 	 * means that the first buffer will be filled with data before
1481 	 * moving to aggregation buffers. Each aggregation buffer will
1482 	 * be filled before moving to the next aggregation buffer.
1483 	 */
1484 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
1485 	/*
1486 	 * Header/Data Separation: Packet was placed using Header/Data
1487 	 * separation algorithm. The separation location is indicated by
1488 	 * the itype field.
1489 	 */
1490 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
1491 	/*
1492 	 * GRO/Jumbo: Packet will be placed using GRO/Jumbo where the
1493 	 * first packet is filled with data. Subsequent packets will be
1494 	 * placed such that any one packet does not span two aggregation
1495 	 * buffers unless it starts at the beginning of an aggregation
1496 	 * buffer.
1497 	 */
1498 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
1499 	/*
1500 	 * GRO/Header-Data Separation: Packet will be placed using
1501 	 * GRO/HDS where the header is in the first packet. Payload of
1502 	 * each packet will be placed such that any one packet does not
1503 	 * span two aggregation buffers unless it starts at the
1504 	 * beginning of an aggregation buffer.
1505 	 */
1506 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
1507 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST	RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
1508 	/* unused is 2 b */
1509 	#define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK		UINT32_C(0xc00)
1510 	#define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT		10
1511 	/*
1512 	 * This value indicates what the inner packet determined for the packet
1513 	 * was. - 2 TCP Packet Indicates that the packet was IP and TCP. This
1514 	 * indicates that the ip_cs field is valid and that the tcp_udp_cs field
1515 	 * is valid and contains the TCP checksum. This also indicates that the
1516 	 * payload_offset field is valid.
1517 	 */
1518 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
1519 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT			12
1520 	#define RX_TPA_END_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
1521 	#define RX_TPA_END_CMPL_FLAGS_SFT			6
1522 	uint16_t len;
1523 	/*
1524 	 * This value is zero for TPA End completions. There is no data in the
1525 	 * buffer that corresponds to the opaque value in this completion.
1526 	 */
1527 	uint32_t opaque;
1528 	/*
1529 	 * This is a copy of the opaque field from the RX BD this completion
1530 	 * corresponds to.
1531 	 */
1532 	uint8_t agg_bufs_v1;
1533 	/* unused1 is 1 b */
1534 	/*
1535 	 * This value is written by the NIC such that it will be different for
1536 	 * each pass through the completion queue. The even passes will write 1.
1537 	 * The odd passes will write 0.
1538 	 */
1539 	#define RX_TPA_END_CMPL_V1				UINT32_C(0x1)
1540 	/*
1541 	 * This value is the number of aggregation buffers that follow this
1542 	 * entry in the completion ring that are a part of this aggregation
1543 	 * packet. If the value is zero, then the packet is completely contained
1544 	 * in the buffer space provided in the aggregation start completion.
1545 	 */
1546 	#define RX_TPA_END_CMPL_AGG_BUFS_MASK			UINT32_C(0x7e)
1547 	#define RX_TPA_END_CMPL_AGG_BUFS_SFT			1
1548 	/* unused1 is 1 b */
1549 	uint8_t tpa_segs;
1550 	/* This value is the number of segments in the TPA operation. */
1551 	uint8_t payload_offset;
1552 	/*
1553 	 * This value indicates the offset in bytes from the beginning of the
1554 	 * packet where the inner payload starts. This value is valid for TCP,
1555 	 * UDP, FCoE, and RoCE packets. A value of zero indicates an offset of
1556 	 * 256 bytes.
1557 	 */
1558 	uint8_t agg_id;
1559 	/*
1560 	 * This is the aggregation ID that the completion is associated with.
1561 	 * Use this number to correlate the TPA start completion with the TPA
1562 	 * end completion.
1563 	 */
1564 	/* unused2 is 1 b */
1565 	/*
1566 	 * This is the aggregation ID that the completion is associated with.
1567 	 * Use this number to correlate the TPA start completion with the TPA
1568 	 * end completion.
1569 	 */
1570 	#define RX_TPA_END_CMPL_AGG_ID_MASK			UINT32_C(0xfe)
1571 	#define RX_TPA_END_CMPL_AGG_ID_SFT			1
1572 	uint32_t tsdelta;
1573 	/*
1574 	 * For non-GRO packets, this value is the timestamp delta between
1575 	 * earliest and latest timestamp values for TPA packet. If packets were
1576 	 * not time stamped, then delta will be zero. For GRO packets, this
1577 	 * field is zero except for the following sub-fields. - tsdelta[31]
1578 	 * Timestamp present indication. When '0', no Timestamp option is in the
1579 	 * packet. When '1', then a Timestamp option is present in the packet.
1580 	 */
1581 } __attribute__((packed));
1582 
1583 /* last 16 bytes of RX TPA End Completion Record */
1584 
1585 struct rx_tpa_end_cmpl_hi {
1586 	uint32_t tpa_dup_acks;
1587 	/* unused3 is 28 b */
1588 	/*
1589 	 * This value is the number of duplicate ACKs that have been received as
1590 	 * part of the TPA operation.
1591 	 */
1592 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK		UINT32_C(0xf)
1593 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT		0
1594 	/* unused3 is 28 b */
1595 	uint16_t tpa_seg_len;
1596 	/*
1597 	 * This value is the valid when TPA completion is active. It indicates
1598 	 * the length of the longest segment of the TPA operation for LRO mode
1599 	 * and the length of the first segment in GRO mode. This value may be
1600 	 * used by GRO software to re-construct the original packet stream from
1601 	 * the TPA packet. This is the length of all but the last segment for
1602 	 * GRO. In LRO mode this value may be used to indicate MSS size to the
1603 	 * stack.
1604 	 */
1605 	uint16_t unused_3;
1606 	/* unused4 is 16 b */
1607 	uint16_t errors_v2;
1608 	/*
1609 	 * This value is written by the NIC such that it will be different for
1610 	 * each pass through the completion queue. The even passes will write 1.
1611 	 * The odd passes will write 0.
1612 	 */
1613 	#define RX_TPA_END_CMPL_V2				UINT32_C(0x1)
1614 	/*
1615 	 * This error indicates that there was some sort of problem with the BDs
1616 	 * for the packet that was found after part of the packet was already
1617 	 * placed. The packet should be treated as invalid.
1618 	 */
1619 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
1620 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT		1
1621 	/*
1622 	 * This error occurs when there is a fatal HW problem in the
1623 	 * chip only. It indicates that there were not BDs on chip but
1624 	 * that there was adequate reservation. provided by the TPA
1625 	 * block.
1626 	 */
1627 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP   (UINT32_C(0x2) << 1)
1628 	/*
1629 	 * This error occurs when TPA block was not configured to
1630 	 * reserve adequate BDs for TPA operations on this RX ring. All
1631 	 * data for the TPA operation was not placed. This error can
1632 	 * also be generated when the number of segments is not
1633 	 * programmed correctly in TPA and the 33 total aggregation
1634 	 * buffers allowed for the TPA operation has been exceeded.
1635 	 */
1636 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR	(UINT32_C(0x4) << 1)
1637 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
1638 	#define RX_TPA_END_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
1639 	#define RX_TPA_END_CMPL_ERRORS_SFT			1
1640 	uint16_t unused_4;
1641 	/* unused5 is 16 b */
1642 	uint32_t start_opaque;
1643 	/*
1644 	 * This is the opaque value that was completed for the TPA start
1645 	 * completion that corresponds to this TPA end completion.
1646 	 */
1647 } __attribute__((packed));
1648 
1649 /* RX Aggregation Buffer Completion Record (16 bytes) */
1650 
1651 struct rx_abuf_cmpl {
1652 	uint16_t type;
1653 	/* unused is 10 b */
1654 	/*
1655 	 * This field indicates the exact type of the completion. By convention,
1656 	 * the LSB identifies the length of the record in 16B units. Even values
1657 	 * indicate 16B records. Odd values indicate 32B records.
1658 	 */
1659 	#define RX_ABUF_CMPL_TYPE_MASK				UINT32_C(0x3f)
1660 	#define RX_ABUF_CMPL_TYPE_SFT				0
1661 	/*
1662 	 * RX Aggregation Buffer completion : Completion of an L2
1663 	 * aggregation buffer in support of TPA, HDS, or Jumbo packet
1664 	 * completion. Length = 16B
1665 	 */
1666 	#define RX_ABUF_CMPL_TYPE_RX_AGG			UINT32_C(0x12)
1667 	/* unused is 10 b */
1668 	uint16_t len;
1669 	/*
1670 	 * This is the length of the data for the packet stored in this
1671 	 * aggregation buffer identified by the opaque value. This does not
1672 	 * include the length of any data placed in other aggregation BDs or in
1673 	 * the packet or buffer BDs. This length does not include any space
1674 	 * added due to hdr_offset register during HDS placement mode.
1675 	 */
1676 	uint32_t opaque;
1677 	/*
1678 	 * This is a copy of the opaque field from the RX BD this aggregation
1679 	 * buffer corresponds to.
1680 	 */
1681 	uint32_t v;
1682 	/* unused2 is 31 b */
1683 	/*
1684 	 * This value is written by the NIC such that it will be different for
1685 	 * each pass through the completion queue. The even passes will write 1.
1686 	 * The odd passes will write 0.
1687 	 */
1688 	#define RX_ABUF_CMPL_V					UINT32_C(0x1)
1689 	/* unused2 is 31 b */
1690 	uint32_t unused_2;
1691 	/* unused3 is 32 b */
1692 } __attribute__((packed));
1693 
1694 /* Statistics Ejection Buffer Completion Record (16 bytes) */
1695 
1696 struct eject_cmpl {
1697 	uint16_t type;
1698 	/* unused is 10 b */
1699 	/*
1700 	 * This field indicates the exact type of the completion. By convention,
1701 	 * the LSB identifies the length of the record in 16B units. Even values
1702 	 * indicate 16B records. Odd values indicate 32B records.
1703 	 */
1704 	#define EJECT_CMPL_TYPE_MASK				UINT32_C(0x3f)
1705 	#define EJECT_CMPL_TYPE_SFT				0
1706 	/*
1707 	 * Statistics Ejection Completion: Completion of statistics data
1708 	 * ejection buffer. Length = 16B
1709 	 */
1710 	#define EJECT_CMPL_TYPE_STAT_EJECT			UINT32_C(0x1a)
1711 	/* unused is 10 b */
1712 	uint16_t len;
1713 	/* This is the length of the statistics data stored in this buffer. */
1714 	uint32_t opaque;
1715 	/*
1716 	 * This is a copy of the opaque field from the RX BD this ejection
1717 	 * buffer corresponds to.
1718 	 */
1719 	uint32_t v;
1720 	/* unused2 is 31 b */
1721 	/*
1722 	 * This value is written by the NIC such that it will be different for
1723 	 * each pass through the completion queue. The even passes will write 1.
1724 	 * The odd passes will write 0.
1725 	 */
1726 	#define EJECT_CMPL_V					UINT32_C(0x1)
1727 	/* unused2 is 31 b */
1728 	uint32_t unused_2;
1729 	/* unused3 is 32 b */
1730 } __attribute__((packed));
1731 
1732 /* HWRM Completion Record (16 bytes) */
1733 
1734 struct hwrm_cmpl {
1735 	uint16_t type;
1736 	/* unused is 10 b */
1737 	/*
1738 	 * This field indicates the exact type of the completion. By convention,
1739 	 * the LSB identifies the length of the record in 16B units. Even values
1740 	 * indicate 16B records. Odd values indicate 32B records.
1741 	 */
1742 	#define HWRM_CMPL_TYPE_MASK				UINT32_C(0x3f)
1743 	#define HWRM_CMPL_TYPE_SFT				0
1744 	/* HWRM Command Completion: Completion of an HWRM command. */
1745 	#define HWRM_CMPL_TYPE_HWRM_DONE			UINT32_C(0x20)
1746 	/* unused is 10 b */
1747 	uint16_t sequence_id;
1748 	/* This is the sequence_id of the HWRM command that has completed. */
1749 	uint32_t unused_1;
1750 	/* unused2 is 32 b */
1751 	uint32_t v;
1752 	/* unused3 is 31 b */
1753 	/*
1754 	 * This value is written by the NIC such that it will be different for
1755 	 * each pass through the completion queue. The even passes will write 1.
1756 	 * The odd passes will write 0.
1757 	 */
1758 	#define HWRM_CMPL_V					UINT32_C(0x1)
1759 	/* unused3 is 31 b */
1760 	uint32_t unused_3;
1761 	/* unused4 is 32 b */
1762 } __attribute__((packed));
1763 
1764 /* HWRM Forwarded Request (16 bytes) */
1765 
1766 struct hwrm_fwd_req_cmpl {
1767 	uint16_t req_len_type;
1768 	/* Length of forwarded request in bytes. */
1769 	/*
1770 	 * This field indicates the exact type of the completion. By convention,
1771 	 * the LSB identifies the length of the record in 16B units. Even values
1772 	 * indicate 16B records. Odd values indicate 32B records.
1773 	 */
1774 	#define HWRM_FWD_REQ_CMPL_TYPE_MASK			UINT32_C(0x3f)
1775 	#define HWRM_FWD_REQ_CMPL_TYPE_SFT			0
1776 	/* Forwarded HWRM Request */
1777 	#define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ		UINT32_C(0x22)
1778 	/* Length of forwarded request in bytes. */
1779 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK			UINT32_C(0xffc0)
1780 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT			6
1781 	uint16_t source_id;
1782 	/*
1783 	 * Source ID of this request. Typically used in forwarding requests and
1784 	 * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
1785 	 * Reserved for internal processors 0xFFFF - HWRM
1786 	 */
1787 	uint32_t unused_0;
1788 	/* unused1 is 32 b */
1789 	uint64_t req_buf_addr_v;
1790 	/* Address of forwarded request. */
1791 	/*
1792 	 * This value is written by the NIC such that it will be different for
1793 	 * each pass through the completion queue. The even passes will write 1.
1794 	 * The odd passes will write 0.
1795 	 */
1796 	#define HWRM_FWD_REQ_CMPL_V				UINT32_C(0x1)
1797 	/* Address of forwarded request. */
1798 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK		UINT32_C(0xfffffffe)
1799 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT		1
1800 } __attribute__((packed));
1801 
1802 /* HWRM Forwarded Response (16 bytes) */
1803 
1804 struct hwrm_fwd_resp_cmpl {
1805 	uint16_t type;
1806 	/* unused1 is 10 b */
1807 	/*
1808 	 * This field indicates the exact type of the completion. By convention,
1809 	 * the LSB identifies the length of the record in 16B units. Even values
1810 	 * indicate 16B records. Odd values indicate 32B records.
1811 	 */
1812 	#define HWRM_FWD_RESP_CMPL_TYPE_MASK			UINT32_C(0x3f)
1813 	#define HWRM_FWD_RESP_CMPL_TYPE_SFT			0
1814 	/* Forwarded HWRM Response */
1815 	#define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP		UINT32_C(0x24)
1816 	/* unused1 is 10 b */
1817 	uint16_t source_id;
1818 	/*
1819 	 * Source ID of this response. Typically used in forwarding requests and
1820 	 * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
1821 	 * Reserved for internal processors 0xFFFF - HWRM
1822 	 */
1823 	uint16_t resp_len;
1824 	/* Length of forwarded response in bytes. */
1825 	uint16_t unused_1;
1826 	/* unused2 is 16 b */
1827 	uint64_t resp_buf_addr_v;
1828 	/* Address of forwarded response. */
1829 	/*
1830 	 * This value is written by the NIC such that it will be different for
1831 	 * each pass through the completion queue. The even passes will write 1.
1832 	 * The odd passes will write 0.
1833 	 */
1834 	#define HWRM_FWD_RESP_CMPL_V				UINT32_C(0x1)
1835 	/* Address of forwarded response. */
1836 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK		UINT32_C(0xfffffffe)
1837 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT		1
1838 } __attribute__((packed));
1839 
1840 #define GET_EVENT_ID(x) \
1841 	((x) == 0x30 ? "VF_FLR": \
1842 	((x) == 0x20 ? "PF_DRVR_UNLOAD": \
1843 	((x) == 0x10 ? "FUNC_DRVR_UNLOAD": \
1844 	((x) == 0xff ? "HWRM_ERROR": \
1845 	((x) == 0x32 ? "PF_VF_COMM_STATUS_CHANGE": \
1846 	((x) == 0x33 ? "VF_CFG_CHANGE": \
1847 	((x) == 0x11 ? "FUNC_DRVR_LOAD": \
1848 	((x) == 0x31 ? "VF_MAC_ADDR_CHANGE": \
1849 	((x) == 0x34 ? "LLFC_PFC_CHANGE": \
1850 	((x) == 0x4 ? "PORT_CONN_NOT_ALLOWED": \
1851 	((x) == 0x5 ? "LINK_SPEED_CFG_NOT_ALLOWED": \
1852 	((x) == 0x6 ? "LINK_SPEED_CFG_CHANGE": \
1853 	((x) == 0x7 ? "PORT_PHY_CFG_CHANGE": \
1854 	((x) == 0x0 ? "LINK_STATUS_CHANGE": \
1855 	((x) == 0x1 ? "LINK_MTU_CHANGE": \
1856 	((x) == 0x2 ? "LINK_SPEED_CHANGE": \
1857 	((x) == 0x3 ? "DCB_CONFIG_CHANGE": \
1858 	((x) == 0x12 ? "FUNC_FLR_PROC_CMPLT": \
1859 	((x) == 0x21 ? "PF_DRVR_LOAD": \
1860 	"Unknown event_id")))))))))))))))))))
1861 
1862 /* HWRM Asynchronous Event Completion Record (16 bytes) */
1863 
1864 struct hwrm_async_event_cmpl {
1865 	uint16_t type;
1866 	/* unused1 is 10 b */
1867 	/*
1868 	 * This field indicates the exact type of the completion. By convention,
1869 	 * the LSB identifies the length of the record in 16B units. Even values
1870 	 * indicate 16B records. Odd values indicate 32B records.
1871 	 */
1872 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK			UINT32_C(0x3f)
1873 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT			0
1874 	/* HWRM Asynchronous Event Information */
1875 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT	UINT32_C(0x2e)
1876 	/* unused1 is 10 b */
1877 	uint16_t event_id;
1878 	/* Identifiers of events. */
1879 	/* Link status changed */
1880 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
1881 	/* Link MTU changed */
1882 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE	UINT32_C(0x1)
1883 	/* Link speed changed */
1884 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE  UINT32_C(0x2)
1885 	/* DCB Configuration changed */
1886 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE  UINT32_C(0x3)
1887 	/* Port connection not allowed */
1888 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
1889 	/* Link speed configuration was not allowed */
1890 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
1891 	/* Link speed configuration change */
1892 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
1893 	/* Port PHY configuration change */
1894 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
1895 	/* Function driver unloaded */
1896 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD   UINT32_C(0x10)
1897 	/* Function driver loaded */
1898 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD	UINT32_C(0x11)
1899 	/* Function FLR related processing has completed */
1900 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
1901 	/* PF driver unloaded */
1902 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD	UINT32_C(0x20)
1903 	/* PF driver loaded */
1904 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD	UINT32_C(0x21)
1905 	/* VF Function Level Reset (FLR) */
1906 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR		UINT32_C(0x30)
1907 	/* VF MAC Address Change */
1908 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
1909 	/* PF-VF communication channel status change. */
1910 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
1911 	/* VF Configuration Change */
1912 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE	UINT32_C(0x33)
1913 	/* LLFC/PFC Configuration Change */
1914 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE	UINT32_C(0x34)
1915 	/* HWRM Error */
1916 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR	UINT32_C(0xff)
1917 	uint32_t event_data2;
1918 	/* Event specific data */
1919 	uint8_t opaque_v;
1920 	/* opaque is 7 b */
1921 	/*
1922 	 * This value is written by the NIC such that it will be different for
1923 	 * each pass through the completion queue. The even passes will write 1.
1924 	 * The odd passes will write 0.
1925 	 */
1926 	#define HWRM_ASYNC_EVENT_CMPL_V				UINT32_C(0x1)
1927 	/* opaque is 7 b */
1928 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK		UINT32_C(0xfe)
1929 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT		1
1930 	uint8_t timestamp_lo;
1931 	/* 8-lsb timestamp from POR (100-msec resolution) */
1932 	uint16_t timestamp_hi;
1933 	/* 16-lsb timestamp from POR (100-msec resolution) */
1934 	uint32_t event_data1;
1935 	/* Event specific data */
1936 } __attribute__((packed));
1937 
1938 /* HWRM Asynchronous Event Completion Record for link status change (16 bytes) */
1939 
1940 struct hwrm_async_event_cmpl_link_status_change {
1941 	uint16_t type;
1942 	/* unused1 is 10 b */
1943 	/*
1944 	 * This field indicates the exact type of the completion. By convention,
1945 	 * the LSB identifies the length of the record in 16B units. Even values
1946 	 * indicate 16B records. Odd values indicate 32B records.
1947 	 */
1948 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK UINT32_C(0x3f)
1949 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT  0
1950 	/* HWRM Asynchronous Event Information */
1951 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
1952 	/* unused1 is 10 b */
1953 	uint16_t event_id;
1954 	/* Identifiers of events. */
1955 	/* Link status changed */
1956 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
1957 	uint32_t event_data2;
1958 	/* Event specific data */
1959 	uint8_t opaque_v;
1960 	/* opaque is 7 b */
1961 	/*
1962 	 * This value is written by the NIC such that it will be different for
1963 	 * each pass through the completion queue. The even passes will write 1.
1964 	 * The odd passes will write 0.
1965 	 */
1966 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V	UINT32_C(0x1)
1967 	/* opaque is 7 b */
1968 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
1969 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
1970 	uint8_t timestamp_lo;
1971 	/* 8-lsb timestamp from POR (100-msec resolution) */
1972 	uint16_t timestamp_hi;
1973 	/* 16-lsb timestamp from POR (100-msec resolution) */
1974 	uint32_t event_data1;
1975 	/* Event specific data */
1976 	/* Indicates link status change */
1977 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE UINT32_C(0x1)
1978 	/*
1979 	 * If this bit set to 0, then it indicates that the link was up
1980 	 * and it went down.
1981 	 */
1982 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN (UINT32_C(0x0) << 0)
1983 	/*
1984 	 * If this bit is set to 1, then it indicates that the link was
1985 	 * down and it went up.
1986 	 */
1987 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP (UINT32_C(0x1) << 0)
1988 	#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
1989 	/* Indicates the physical port this link status change occur */
1990 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK UINT32_C(0xe)
1991 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT 1
1992 	/* PORT ID */
1993 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff0)
1994 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT 4
1995 } __attribute__((packed));
1996 
1997 /* HWRM Asynchronous Event Completion Record for link MTU change (16 bytes) */
1998 
1999 struct hwrm_async_event_cmpl_link_mtu_change {
2000 	uint16_t type;
2001 	/* unused1 is 10 b */
2002 	/*
2003 	 * This field indicates the exact type of the completion. By convention,
2004 	 * the LSB identifies the length of the record in 16B units. Even values
2005 	 * indicate 16B records. Odd values indicate 32B records.
2006 	 */
2007 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK	UINT32_C(0x3f)
2008 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT	0
2009 	/* HWRM Asynchronous Event Information */
2010 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2011 	/* unused1 is 10 b */
2012 	uint16_t event_id;
2013 	/* Identifiers of events. */
2014 	/* Link MTU changed */
2015 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
2016 	uint32_t event_data2;
2017 	/* Event specific data */
2018 	uint8_t opaque_v;
2019 	/* opaque is 7 b */
2020 	/*
2021 	 * This value is written by the NIC such that it will be different for
2022 	 * each pass through the completion queue. The even passes will write 1.
2023 	 * The odd passes will write 0.
2024 	 */
2025 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V		UINT32_C(0x1)
2026 	/* opaque is 7 b */
2027 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK  UINT32_C(0xfe)
2028 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT   1
2029 	uint8_t timestamp_lo;
2030 	/* 8-lsb timestamp from POR (100-msec resolution) */
2031 	uint16_t timestamp_hi;
2032 	/* 16-lsb timestamp from POR (100-msec resolution) */
2033 	uint32_t event_data1;
2034 	/* Event specific data */
2035 	/* The new MTU of the link in bytes. */
2036 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK UINT32_C(0xffff)
2037 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
2038 } __attribute__((packed));
2039 
2040 /* HWRM Asynchronous Event Completion Record for link speed change (16 bytes) */
2041 
2042 struct hwrm_async_event_cmpl_link_speed_change {
2043 	uint16_t type;
2044 	/* unused1 is 10 b */
2045 	/*
2046 	 * This field indicates the exact type of the completion. By convention,
2047 	 * the LSB identifies the length of the record in 16B units. Even values
2048 	 * indicate 16B records. Odd values indicate 32B records.
2049 	 */
2050 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK  UINT32_C(0x3f)
2051 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT   0
2052 	/* HWRM Asynchronous Event Information */
2053 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2054 	/* unused1 is 10 b */
2055 	uint16_t event_id;
2056 	/* Identifiers of events. */
2057 	/* Link speed changed */
2058 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
2059 	uint32_t event_data2;
2060 	/* Event specific data */
2061 	uint8_t opaque_v;
2062 	/* opaque is 7 b */
2063 	/*
2064 	 * This value is written by the NIC such that it will be different for
2065 	 * each pass through the completion queue. The even passes will write 1.
2066 	 * The odd passes will write 0.
2067 	 */
2068 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V	UINT32_C(0x1)
2069 	/* opaque is 7 b */
2070 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2071 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
2072 	uint8_t timestamp_lo;
2073 	/* 8-lsb timestamp from POR (100-msec resolution) */
2074 	uint16_t timestamp_hi;
2075 	/* 16-lsb timestamp from POR (100-msec resolution) */
2076 	uint32_t event_data1;
2077 	/* Event specific data */
2078 	/*
2079 	 * When this bit is '1', the link was forced to the force_link_speed
2080 	 * value.
2081 	 */
2082 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE UINT32_C(0x1)
2083 	/* The new link speed in 100 Mbps units. */
2084 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK UINT32_C(0xfffe)
2085 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT 1
2086 	/* 100Mb link speed */
2087 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB (UINT32_C(0x1) << 1)
2088 	/* 1Gb link speed */
2089 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB (UINT32_C(0xa) << 1)
2090 	/* 2Gb link speed */
2091 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB (UINT32_C(0x14) << 1)
2092 	/* 2.5Gb link speed */
2093 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB (UINT32_C(0x19) << 1)
2094 	/* 10Gb link speed */
2095 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB (UINT32_C(0x64) << 1)
2096 	/* 20Mb link speed */
2097 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB (UINT32_C(0xc8) << 1)
2098 	/* 25Gb link speed */
2099 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB (UINT32_C(0xfa) << 1)
2100 	/* 40Gb link speed */
2101 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB (UINT32_C(0x190) << 1)
2102 	/* 50Gb link speed */
2103 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB (UINT32_C(0x1f4) << 1)
2104 	/* 100Gb link speed */
2105 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB (UINT32_C(0x3e8) << 1)
2106 	#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
2107 	/* PORT ID */
2108 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff0000)
2109 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT 16
2110 } __attribute__((packed));
2111 
2112 /* HWRM Asynchronous Event Completion Record for DCB Config change (16 bytes) */
2113 
2114 struct hwrm_async_event_cmpl_dcb_config_change {
2115 	uint16_t type;
2116 	/* unused1 is 10 b */
2117 	/*
2118 	 * This field indicates the exact type of the completion. By convention,
2119 	 * the LSB identifies the length of the record in 16B units. Even values
2120 	 * indicate 16B records. Odd values indicate 32B records.
2121 	 */
2122 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK  UINT32_C(0x3f)
2123 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT   0
2124 	/* HWRM Asynchronous Event Information */
2125 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2126 	/* unused1 is 10 b */
2127 	uint16_t event_id;
2128 	/* Identifiers of events. */
2129 	/* DCB Configuration changed */
2130 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
2131 	uint32_t event_data2;
2132 	/* Event specific data */
2133 	/* ETS configuration change */
2134 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS UINT32_C(0x1)
2135 	/* PFC configuration change */
2136 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC UINT32_C(0x2)
2137 	/* APP configuration change */
2138 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP UINT32_C(0x4)
2139 	uint8_t opaque_v;
2140 	/* opaque is 7 b */
2141 	/*
2142 	 * This value is written by the NIC such that it will be different for
2143 	 * each pass through the completion queue. The even passes will write 1.
2144 	 * The odd passes will write 0.
2145 	 */
2146 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V	UINT32_C(0x1)
2147 	/* opaque is 7 b */
2148 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2149 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
2150 	uint8_t timestamp_lo;
2151 	/* 8-lsb timestamp from POR (100-msec resolution) */
2152 	uint16_t timestamp_hi;
2153 	/* 16-lsb timestamp from POR (100-msec resolution) */
2154 	uint32_t event_data1;
2155 	/* Event specific data */
2156 	/* PORT ID */
2157 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
2158 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
2159 	/* Priority recommended for RoCE traffic */
2160 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK UINT32_C(0xff0000)
2161 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT 16
2162 	/* none is 255 */
2163 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE (UINT32_C(0xff) << 16)
2164 	#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
2165 	/* Priority recommended for L2 traffic */
2166 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK UINT32_C(0xff000000)
2167 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT 24
2168 	/* none is 255 */
2169 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE (UINT32_C(0xff) << 24)
2170 	#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
2171 } __attribute__((packed));
2172 
2173 /* HWRM Asynchronous Event Completion Record for port connection not allowed (16 bytes) */
2174 
2175 struct hwrm_async_event_cmpl_port_conn_not_allowed {
2176 	uint16_t type;
2177 	/* unused1 is 10 b */
2178 	/*
2179 	 * This field indicates the exact type of the completion. By convention,
2180 	 * the LSB identifies the length of the record in 16B units. Even values
2181 	 * indicate 16B records. Odd values indicate 32B records.
2182 	 */
2183 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK UINT32_C(0x3f)
2184 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT 0
2185 	/* HWRM Asynchronous Event Information */
2186 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2187 	/* unused1 is 10 b */
2188 	uint16_t event_id;
2189 	/* Identifiers of events. */
2190 	/* Port connection not allowed */
2191 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
2192 	uint32_t event_data2;
2193 	/* Event specific data */
2194 	uint8_t opaque_v;
2195 	/* opaque is 7 b */
2196 	/*
2197 	 * This value is written by the NIC such that it will be different for
2198 	 * each pass through the completion queue. The even passes will write 1.
2199 	 * The odd passes will write 0.
2200 	 */
2201 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V	UINT32_C(0x1)
2202 	/* opaque is 7 b */
2203 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
2204 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
2205 	uint8_t timestamp_lo;
2206 	/* 8-lsb timestamp from POR (100-msec resolution) */
2207 	uint16_t timestamp_hi;
2208 	/* 16-lsb timestamp from POR (100-msec resolution) */
2209 	uint32_t event_data1;
2210 	/* Event specific data */
2211 	/* PORT ID */
2212 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
2213 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
2214 	/*
2215 	 * This value indicates the current port level enforcement policy for
2216 	 * the optics module when there is an optical module mismatch and port
2217 	 * is not connected.
2218 	 */
2219 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK UINT32_C(0xff0000)
2220 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT 16
2221 	/* No enforcement */
2222 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE (UINT32_C(0x0) << 16)
2223 	/* Disable Transmit side Laser. */
2224 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX (UINT32_C(0x1) << 16)
2225 	/* Raise a warning message. */
2226 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG (UINT32_C(0x2) << 16)
2227 	/* Power down the module. */
2228 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN (UINT32_C(0x3) << 16)
2229 	#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
2230 } __attribute__((packed));
2231 
2232 /* HWRM Asynchronous Event Completion Record for link speed config not allowed (16 bytes) */
2233 
2234 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
2235 	uint16_t type;
2236 	/* unused1 is 10 b */
2237 	/*
2238 	 * This field indicates the exact type of the completion. By convention,
2239 	 * the LSB identifies the length of the record in 16B units. Even values
2240 	 * indicate 16B records. Odd values indicate 32B records.
2241 	 */
2242 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK UINT32_C(0x3f)
2243 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT 0
2244 	/* HWRM Asynchronous Event Information */
2245 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2246 	/* unused1 is 10 b */
2247 	uint16_t event_id;
2248 	/* Identifiers of events. */
2249 	/* Link speed configuration was not allowed */
2250 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
2251 	uint32_t event_data2;
2252 	/* Event specific data */
2253 	uint8_t opaque_v;
2254 	/* opaque is 7 b */
2255 	/*
2256 	 * This value is written by the NIC such that it will be different for
2257 	 * each pass through the completion queue. The even passes will write 1.
2258 	 * The odd passes will write 0.
2259 	 */
2260 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V UINT32_C(0x1)
2261 	/* opaque is 7 b */
2262 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
2263 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
2264 	uint8_t timestamp_lo;
2265 	/* 8-lsb timestamp from POR (100-msec resolution) */
2266 	uint16_t timestamp_hi;
2267 	/* 16-lsb timestamp from POR (100-msec resolution) */
2268 	uint32_t event_data1;
2269 	/* Event specific data */
2270 	/* PORT ID */
2271 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
2272 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
2273 } __attribute__((packed));
2274 
2275 /* HWRM Asynchronous Event Completion Record for link speed configuration change (16 bytes) */
2276 
2277 struct hwrm_async_event_cmpl_link_speed_cfg_change {
2278 	uint16_t type;
2279 	/* unused1 is 10 b */
2280 	/*
2281 	 * This field indicates the exact type of the completion. By convention,
2282 	 * the LSB identifies the length of the record in 16B units. Even values
2283 	 * indicate 16B records. Odd values indicate 32B records.
2284 	 */
2285 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
2286 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT 0
2287 	/* HWRM Asynchronous Event Information */
2288 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2289 	/* unused1 is 10 b */
2290 	uint16_t event_id;
2291 	/* Identifiers of events. */
2292 	/* Link speed configuration change */
2293 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
2294 	uint32_t event_data2;
2295 	/* Event specific data */
2296 	uint8_t opaque_v;
2297 	/* opaque is 7 b */
2298 	/*
2299 	 * This value is written by the NIC such that it will be different for
2300 	 * each pass through the completion queue. The even passes will write 1.
2301 	 * The odd passes will write 0.
2302 	 */
2303 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V	UINT32_C(0x1)
2304 	/* opaque is 7 b */
2305 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2306 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
2307 	uint8_t timestamp_lo;
2308 	/* 8-lsb timestamp from POR (100-msec resolution) */
2309 	uint16_t timestamp_hi;
2310 	/* 16-lsb timestamp from POR (100-msec resolution) */
2311 	uint32_t event_data1;
2312 	/* Event specific data */
2313 	/* PORT ID */
2314 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
2315 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
2316 	/*
2317 	 * If set to 1, it indicates that the supported link speeds
2318 	 * configuration on the port has changed. If set to 0, then there is no
2319 	 * change in supported link speeds configuration.
2320 	 */
2321 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE UINT32_C(0x10000)
2322 	/*
2323 	 * If set to 1, it indicates that the link speed configuration on the
2324 	 * port has become illegal or invalid. If set to 0, then the link speed
2325 	 * configuration on the port is legal or valid.
2326 	 */
2327 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG UINT32_C(0x20000)
2328 } __attribute__((packed));
2329 
2330 /* HWRM Asynchronous Event Completion Record for port PHY configuration change (16 bytes) */
2331 
2332 struct hwrm_async_event_cmpl_port_phy_cfg_change {
2333 	uint16_t type;
2334 	/* unused1 is 10 b */
2335 	/*
2336 	 * This field indicates the exact type of the completion. By convention,
2337 	 * the LSB identifies the length of the record in 16B units. Even values
2338 	 * indicate 16B records. Odd values indicate 32B records.
2339 	 */
2340 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK UINT32_C(0x3f)
2341 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT 0
2342 	/* HWRM Asynchronous Event Information */
2343 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2344 	/* unused1 is 10 b */
2345 	uint16_t event_id;
2346 	/* Identifiers of events. */
2347 	/* Port PHY configuration change */
2348 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
2349 	uint32_t event_data2;
2350 	/* Event specific data */
2351 	uint8_t opaque_v;
2352 	/* opaque is 7 b */
2353 	/*
2354 	 * This value is written by the NIC such that it will be different for
2355 	 * each pass through the completion queue. The even passes will write 1.
2356 	 * The odd passes will write 0.
2357 	 */
2358 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V	UINT32_C(0x1)
2359 	/* opaque is 7 b */
2360 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2361 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
2362 	uint8_t timestamp_lo;
2363 	/* 8-lsb timestamp from POR (100-msec resolution) */
2364 	uint16_t timestamp_hi;
2365 	/* 16-lsb timestamp from POR (100-msec resolution) */
2366 	uint32_t event_data1;
2367 	/* Event specific data */
2368 	/* PORT ID */
2369 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
2370 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
2371 	/*
2372 	 * If set to 1, it indicates that the FEC configuration on the port has
2373 	 * changed. If set to 0, then there is no change in FEC configuration.
2374 	 */
2375 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE UINT32_C(0x10000)
2376 	/*
2377 	 * If set to 1, it indicates that the EEE configuration on the port has
2378 	 * changed. If set to 0, then there is no change in EEE configuration on
2379 	 * the port.
2380 	 */
2381 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE UINT32_C(0x20000)
2382 	/*
2383 	 * If set to 1, it indicates that the pause configuration on the PHY has
2384 	 * changed. If set to 0, then there is no change in the pause
2385 	 * configuration on the PHY.
2386 	 */
2387 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE UINT32_C(0x40000)
2388 } __attribute__((packed));
2389 
2390 /* HWRM Asynchronous Event Completion Record for Function Driver Unload (16 bytes) */
2391 
2392 struct hwrm_async_event_cmpl_func_drvr_unload {
2393 	uint16_t type;
2394 	/* unused1 is 10 b */
2395 	/*
2396 	 * This field indicates the exact type of the completion. By convention,
2397 	 * the LSB identifies the length of the record in 16B units. Even values
2398 	 * indicate 16B records. Odd values indicate 32B records.
2399 	 */
2400 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK   UINT32_C(0x3f)
2401 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT	0
2402 	/* HWRM Asynchronous Event Information */
2403 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2404 	/* unused1 is 10 b */
2405 	uint16_t event_id;
2406 	/* Identifiers of events. */
2407 	/* Function driver unloaded */
2408 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
2409 	uint32_t event_data2;
2410 	/* Event specific data */
2411 	uint8_t opaque_v;
2412 	/* opaque is 7 b */
2413 	/*
2414 	 * This value is written by the NIC such that it will be different for
2415 	 * each pass through the completion queue. The even passes will write 1.
2416 	 * The odd passes will write 0.
2417 	 */
2418 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V	UINT32_C(0x1)
2419 	/* opaque is 7 b */
2420 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
2421 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT  1
2422 	uint8_t timestamp_lo;
2423 	/* 8-lsb timestamp from POR (100-msec resolution) */
2424 	uint16_t timestamp_hi;
2425 	/* 16-lsb timestamp from POR (100-msec resolution) */
2426 	uint32_t event_data1;
2427 	/* Event specific data */
2428 	/* Function ID */
2429 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
2430 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
2431 } __attribute__((packed));
2432 
2433 /* HWRM Asynchronous Event Completion Record for Function Driver load (16 bytes) */
2434 
2435 struct hwrm_async_event_cmpl_func_drvr_load {
2436 	uint16_t type;
2437 	/* unused1 is 10 b */
2438 	/*
2439 	 * This field indicates the exact type of the completion. By convention,
2440 	 * the LSB identifies the length of the record in 16B units. Even values
2441 	 * indicate 16B records. Odd values indicate 32B records.
2442 	 */
2443 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK	UINT32_C(0x3f)
2444 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT	0
2445 	/* HWRM Asynchronous Event Information */
2446 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2447 	/* unused1 is 10 b */
2448 	uint16_t event_id;
2449 	/* Identifiers of events. */
2450 	/* Function driver loaded */
2451 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
2452 	uint32_t event_data2;
2453 	/* Event specific data */
2454 	uint8_t opaque_v;
2455 	/* opaque is 7 b */
2456 	/*
2457 	 * This value is written by the NIC such that it will be different for
2458 	 * each pass through the completion queue. The even passes will write 1.
2459 	 * The odd passes will write 0.
2460 	 */
2461 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V		UINT32_C(0x1)
2462 	/* opaque is 7 b */
2463 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK   UINT32_C(0xfe)
2464 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT	1
2465 	uint8_t timestamp_lo;
2466 	/* 8-lsb timestamp from POR (100-msec resolution) */
2467 	uint16_t timestamp_hi;
2468 	/* 16-lsb timestamp from POR (100-msec resolution) */
2469 	uint32_t event_data1;
2470 	/* Event specific data */
2471 	/* Function ID */
2472 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
2473 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
2474 } __attribute__((packed));
2475 
2476 /* HWRM Asynchronous Event Completion Record to indicate completion of FLR related processing (16 bytes) */
2477 
2478 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
2479 	uint16_t type;
2480 	/* unused1 is 10 b */
2481 	/*
2482 	 * This field indicates the exact type of the completion. By convention,
2483 	 * the LSB identifies the length of the record in 16B units. Even values
2484 	 * indicate 16B records. Odd values indicate 32B records.
2485 	 */
2486 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK UINT32_C(0x3f)
2487 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT 0
2488 	/* HWRM Asynchronous Event Information */
2489 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2490 	/* unused1 is 10 b */
2491 	uint16_t event_id;
2492 	/* Identifiers of events. */
2493 	/* Function FLR related processing has completed */
2494 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
2495 	uint32_t event_data2;
2496 	/* Event specific data */
2497 	uint8_t opaque_v;
2498 	/* opaque is 7 b */
2499 	/*
2500 	 * This value is written by the NIC such that it will be different for
2501 	 * each pass through the completion queue. The even passes will write 1.
2502 	 * The odd passes will write 0.
2503 	 */
2504 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V	UINT32_C(0x1)
2505 	/* opaque is 7 b */
2506 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK UINT32_C(0xfe)
2507 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
2508 	uint8_t timestamp_lo;
2509 	/* 8-lsb timestamp from POR (100-msec resolution) */
2510 	uint16_t timestamp_hi;
2511 	/* 16-lsb timestamp from POR (100-msec resolution) */
2512 	uint32_t event_data1;
2513 	/* Event specific data */
2514 	/* Function ID */
2515 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
2516 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT 0
2517 } __attribute__((packed));
2518 
2519 /* HWRM Asynchronous Event Completion Record for PF Driver Unload (16 bytes) */
2520 
2521 struct hwrm_async_event_cmpl_pf_drvr_unload {
2522 	uint16_t type;
2523 	/* unused1 is 10 b */
2524 	/*
2525 	 * This field indicates the exact type of the completion. By convention,
2526 	 * the LSB identifies the length of the record in 16B units. Even values
2527 	 * indicate 16B records. Odd values indicate 32B records.
2528 	 */
2529 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK	UINT32_C(0x3f)
2530 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT	0
2531 	/* HWRM Asynchronous Event Information */
2532 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2533 	/* unused1 is 10 b */
2534 	uint16_t event_id;
2535 	/* Identifiers of events. */
2536 	/* PF driver unloaded */
2537 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
2538 	uint32_t event_data2;
2539 	/* Event specific data */
2540 	uint8_t opaque_v;
2541 	/* opaque is 7 b */
2542 	/*
2543 	 * This value is written by the NIC such that it will be different for
2544 	 * each pass through the completion queue. The even passes will write 1.
2545 	 * The odd passes will write 0.
2546 	 */
2547 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V		UINT32_C(0x1)
2548 	/* opaque is 7 b */
2549 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK   UINT32_C(0xfe)
2550 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT	1
2551 	uint8_t timestamp_lo;
2552 	/* 8-lsb timestamp from POR (100-msec resolution) */
2553 	uint16_t timestamp_hi;
2554 	/* 16-lsb timestamp from POR (100-msec resolution) */
2555 	uint32_t event_data1;
2556 	/* Event specific data */
2557 	/* PF ID */
2558 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
2559 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
2560 	/* Indicates the physical port this pf belongs to */
2561 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK UINT32_C(0x70000)
2562 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT 16
2563 } __attribute__((packed));
2564 
2565 /* HWRM Asynchronous Event Completion Record for PF Driver load (16 bytes) */
2566 
2567 struct hwrm_async_event_cmpl_pf_drvr_load {
2568 	uint16_t type;
2569 	/* unused1 is 10 b */
2570 	/*
2571 	 * This field indicates the exact type of the completion. By convention,
2572 	 * the LSB identifies the length of the record in 16B units. Even values
2573 	 * indicate 16B records. Odd values indicate 32B records.
2574 	 */
2575 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK	UINT32_C(0x3f)
2576 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT	0
2577 	/* HWRM Asynchronous Event Information */
2578 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2579 	/* unused1 is 10 b */
2580 	uint16_t event_id;
2581 	/* Identifiers of events. */
2582 	/* PF driver loaded */
2583 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
2584 	uint32_t event_data2;
2585 	/* Event specific data */
2586 	uint8_t opaque_v;
2587 	/* opaque is 7 b */
2588 	/*
2589 	 * This value is written by the NIC such that it will be different for
2590 	 * each pass through the completion queue. The even passes will write 1.
2591 	 * The odd passes will write 0.
2592 	 */
2593 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V		UINT32_C(0x1)
2594 	/* opaque is 7 b */
2595 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK	UINT32_C(0xfe)
2596 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT	1
2597 	uint8_t timestamp_lo;
2598 	/* 8-lsb timestamp from POR (100-msec resolution) */
2599 	uint16_t timestamp_hi;
2600 	/* 16-lsb timestamp from POR (100-msec resolution) */
2601 	uint32_t event_data1;
2602 	/* Event specific data */
2603 	/* PF ID */
2604 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
2605 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
2606 	/* Indicates the physical port this pf belongs to */
2607 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK UINT32_C(0x70000)
2608 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT 16
2609 } __attribute__((packed));
2610 
2611 /* HWRM Asynchronous Event Completion Record for VF FLR (16 bytes) */
2612 
2613 struct hwrm_async_event_cmpl_vf_flr {
2614 	uint16_t type;
2615 	/* unused1 is 10 b */
2616 	/*
2617 	 * This field indicates the exact type of the completion. By convention,
2618 	 * the LSB identifies the length of the record in 16B units. Even values
2619 	 * indicate 16B records. Odd values indicate 32B records.
2620 	 */
2621 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK		UINT32_C(0x3f)
2622 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT		0
2623 	/* HWRM Asynchronous Event Information */
2624 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2625 	/* unused1 is 10 b */
2626 	uint16_t event_id;
2627 	/* Identifiers of events. */
2628 	/* VF Function Level Reset (FLR) */
2629 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR	UINT32_C(0x30)
2630 	uint32_t event_data2;
2631 	/* Event specific data */
2632 	uint8_t opaque_v;
2633 	/* opaque is 7 b */
2634 	/*
2635 	 * This value is written by the NIC such that it will be different for
2636 	 * each pass through the completion queue. The even passes will write 1.
2637 	 * The odd passes will write 0.
2638 	 */
2639 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V			UINT32_C(0x1)
2640 	/* opaque is 7 b */
2641 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK	UINT32_C(0xfe)
2642 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT		1
2643 	uint8_t timestamp_lo;
2644 	/* 8-lsb timestamp from POR (100-msec resolution) */
2645 	uint16_t timestamp_hi;
2646 	/* 16-lsb timestamp from POR (100-msec resolution) */
2647 	uint32_t event_data1;
2648 	/* Event specific data */
2649 	/* VF ID */
2650 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
2651 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
2652 } __attribute__((packed));
2653 
2654 /* HWRM Asynchronous Event Completion Record for VF MAC Addr change (16 bytes) */
2655 
2656 struct hwrm_async_event_cmpl_vf_mac_addr_change {
2657 	uint16_t type;
2658 	/* unused1 is 10 b */
2659 	/*
2660 	 * This field indicates the exact type of the completion. By convention,
2661 	 * the LSB identifies the length of the record in 16B units. Even values
2662 	 * indicate 16B records. Odd values indicate 32B records.
2663 	 */
2664 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK UINT32_C(0x3f)
2665 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT  0
2666 	/* HWRM Asynchronous Event Information */
2667 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2668 	/* unused1 is 10 b */
2669 	uint16_t event_id;
2670 	/* Identifiers of events. */
2671 	/* VF MAC Address Change */
2672 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
2673 	uint32_t event_data2;
2674 	/* Event specific data */
2675 	uint8_t opaque_v;
2676 	/* opaque is 7 b */
2677 	/*
2678 	 * This value is written by the NIC such that it will be different for
2679 	 * each pass through the completion queue. The even passes will write 1.
2680 	 * The odd passes will write 0.
2681 	 */
2682 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V	UINT32_C(0x1)
2683 	/* opaque is 7 b */
2684 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2685 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
2686 	uint8_t timestamp_lo;
2687 	/* 8-lsb timestamp from POR (100-msec resolution) */
2688 	uint16_t timestamp_hi;
2689 	/* 16-lsb timestamp from POR (100-msec resolution) */
2690 	uint32_t event_data1;
2691 	/* Event specific data */
2692 	/* VF ID */
2693 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
2694 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
2695 } __attribute__((packed));
2696 
2697 /* HWRM Asynchronous Event Completion Record for PF-VF communication status change (16 bytes) */
2698 
2699 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
2700 	uint16_t type;
2701 	/* unused1 is 10 b */
2702 	/*
2703 	 * This field indicates the exact type of the completion. By convention,
2704 	 * the LSB identifies the length of the record in 16B units. Even values
2705 	 * indicate 16B records. Odd values indicate 32B records.
2706 	 */
2707 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK UINT32_C(0x3f)
2708 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT 0
2709 	/* HWRM Asynchronous Event Information */
2710 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2711 	/* unused1 is 10 b */
2712 	uint16_t event_id;
2713 	/* Identifiers of events. */
2714 	/* PF-VF communication channel status change. */
2715 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
2716 	uint32_t event_data2;
2717 	/* Event specific data */
2718 	uint8_t opaque_v;
2719 	/* opaque is 7 b */
2720 	/*
2721 	 * This value is written by the NIC such that it will be different for
2722 	 * each pass through the completion queue. The even passes will write 1.
2723 	 * The odd passes will write 0.
2724 	 */
2725 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V   UINT32_C(0x1)
2726 	/* opaque is 7 b */
2727 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
2728 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
2729 	uint8_t timestamp_lo;
2730 	/* 8-lsb timestamp from POR (100-msec resolution) */
2731 	uint16_t timestamp_hi;
2732 	/* 16-lsb timestamp from POR (100-msec resolution) */
2733 	uint32_t event_data1;
2734 	/* Event specific data */
2735 	/*
2736 	 * If this bit is set to 1, then it indicates that the PF-VF
2737 	 * communication was lost and it is established. If this bit set to 0,
2738 	 * then it indicates that the PF-VF communication was established and it
2739 	 * is lost.
2740 	 */
2741 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED UINT32_C(0x1)
2742 } __attribute__((packed));
2743 
2744 /* HWRM Asynchronous Event Completion Record for VF configuration change (16 bytes) */
2745 
2746 struct hwrm_async_event_cmpl_vf_cfg_change {
2747 	uint16_t type;
2748 	/* unused1 is 10 b */
2749 	/*
2750 	 * This field indicates the exact type of the completion. By convention,
2751 	 * the LSB identifies the length of the record in 16B units. Even values
2752 	 * indicate 16B records. Odd values indicate 32B records.
2753 	 */
2754 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK	UINT32_C(0x3f)
2755 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT	0
2756 	/* HWRM Asynchronous Event Information */
2757 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2758 	/* unused1 is 10 b */
2759 	uint16_t event_id;
2760 	/* Identifiers of events. */
2761 	/* VF Configuration Change */
2762 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
2763 	uint32_t event_data2;
2764 	/* Event specific data */
2765 	uint8_t opaque_v;
2766 	/* opaque is 7 b */
2767 	/*
2768 	 * This value is written by the NIC such that it will be different for
2769 	 * each pass through the completion queue. The even passes will write 1.
2770 	 * The odd passes will write 0.
2771 	 */
2772 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V		UINT32_C(0x1)
2773 	/* opaque is 7 b */
2774 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK	UINT32_C(0xfe)
2775 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT	1
2776 	uint8_t timestamp_lo;
2777 	/* 8-lsb timestamp from POR (100-msec resolution) */
2778 	uint16_t timestamp_hi;
2779 	/* 16-lsb timestamp from POR (100-msec resolution) */
2780 	uint32_t event_data1;
2781 	/*
2782 	 * Each flag provided in this field indicates a specific VF
2783 	 * configuration change. At least one of these flags shall be set to 1
2784 	 * when an asynchronous event completion of this type is provided by the
2785 	 * HWRM.
2786 	 */
2787 	/*
2788 	 * If this bit is set to 1, then the value of MTU was changed on this
2789 	 * VF. If set to 0, then this bit should be ignored.
2790 	 */
2791 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE UINT32_C(0x1)
2792 	/*
2793 	 * If this bit is set to 1, then the value of MRU was changed on this
2794 	 * VF. If set to 0, then this bit should be ignored.
2795 	 */
2796 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE UINT32_C(0x2)
2797 	/*
2798 	 * If this bit is set to 1, then the value of default MAC address was
2799 	 * changed on this VF. If set to 0, then this bit should be ignored.
2800 	 */
2801 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE UINT32_C(0x4)
2802 	/*
2803 	 * If this bit is set to 1, then the value of default VLAN was changed
2804 	 * on this VF. If set to 0, then this bit should be ignored.
2805 	 */
2806 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE UINT32_C(0x8)
2807 } __attribute__((packed));
2808 
2809 /* HWRM Asynchronous Event Completion Record for llfc pfc status change (16 bytes) */
2810 
2811 struct hwrm_async_event_cmpl_llfc_pfc_change {
2812 	uint16_t type;
2813 	/* unused1 is 10 b */
2814 	/*
2815 	 * This field indicates the exact type of the completion. By convention,
2816 	 * the LSB identifies the length of the record in 16B units. Even values
2817 	 * indicate 16B records. Odd values indicate 32B records.
2818 	 */
2819 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK	UINT32_C(0x3f)
2820 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT	0
2821 	/* HWRM Asynchronous Event Information */
2822 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2823 	/* unused1 is 10 b */
2824 	uint16_t event_id;
2825 	/* Identifiers of events. */
2826 	/* LLFC/PFC Configuration Change */
2827 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
2828 	uint32_t event_data2;
2829 	/* Event specific data */
2830 	uint8_t opaque_v;
2831 	/* opaque is 7 b */
2832 	/*
2833 	 * This value is written by the NIC such that it will be different for
2834 	 * each pass through the completion queue. The even passes will write 1.
2835 	 * The odd passes will write 0.
2836 	 */
2837 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V		UINT32_C(0x1)
2838 	/* opaque is 7 b */
2839 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK  UINT32_C(0xfe)
2840 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT   1
2841 	uint8_t timestamp_lo;
2842 	/* 8-lsb timestamp from POR (100-msec resolution) */
2843 	uint16_t timestamp_hi;
2844 	/* 16-lsb timestamp from POR (100-msec resolution) */
2845 	uint32_t event_data1;
2846 	/* Event specific data */
2847 	/* Indicates llfc pfc status change */
2848 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK UINT32_C(0x3)
2849 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT 0
2850 	/* If this field set to 1, then it indicates that llfc is enabled. */
2851 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC (UINT32_C(0x1) << 0)
2852 	/* If this field is set to 2, then it indicates that pfc is enabled. */
2853 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC (UINT32_C(0x2) << 0)
2854 	#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
2855 	/* Indicates the physical port this llfc pfc change occur */
2856 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK UINT32_C(0x1c)
2857 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT 2
2858 	/* PORT ID */
2859 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0x1fffe0)
2860 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT 5
2861 } __attribute__((packed));
2862 
2863 /* HWRM Asynchronous Event Completion Record for HWRM Error (16 bytes) */
2864 
2865 struct hwrm_async_event_cmpl_hwrm_error {
2866 	uint16_t type;
2867 	/* unused1 is 10 b */
2868 	/*
2869 	 * This field indicates the exact type of the completion. By convention,
2870 	 * the LSB identifies the length of the record in 16B units. Even values
2871 	 * indicate 16B records. Odd values indicate 32B records.
2872 	 */
2873 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK	UINT32_C(0x3f)
2874 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT	0
2875 	/* HWRM Asynchronous Event Information */
2876 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
2877 	/* unused1 is 10 b */
2878 	uint16_t event_id;
2879 	/* Identifiers of events. */
2880 	/* HWRM Error */
2881 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
2882 	uint32_t event_data2;
2883 	/* Event specific data */
2884 	/* Severity of HWRM Error */
2885 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK UINT32_C(0xff)
2886 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT 0
2887 	/* Warning */
2888 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING UINT32_C(0x0)
2889 	/* Non-fatal Error */
2890 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL UINT32_C(0x1)
2891 	/* Fatal Error */
2892 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL UINT32_C(0x2)
2893 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST	HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
2894 	uint8_t opaque_v;
2895 	/* opaque is 7 b */
2896 	/*
2897 	 * This value is written by the NIC such that it will be different for
2898 	 * each pass through the completion queue. The even passes will write 1.
2899 	 * The odd passes will write 0.
2900 	 */
2901 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V		UINT32_C(0x1)
2902 	/* opaque is 7 b */
2903 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK	UINT32_C(0xfe)
2904 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT	1
2905 	uint8_t timestamp_lo;
2906 	/* 8-lsb timestamp from POR (100-msec resolution) */
2907 	uint16_t timestamp_hi;
2908 	/* 16-lsb timestamp from POR (100-msec resolution) */
2909 	uint32_t event_data1;
2910 	/* Event specific data */
2911 	/* Time stamp for error event */
2912 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP UINT32_C(0x1)
2913 } __attribute__((packed));
2914 
2915 /* Door Bell Formats */
2916 /*
2917  * Description: The backup version of the packet must be valid in the TX ring
2918  * before the push doorbell is written to the chip. The first 32b and the BD
2919  * portion of the push doorbell must be written in multiples of 32b units on the
2920  * PCI interface. The data portion of the push doorbell may be written in
2921  * multiples of 8b units on the PCI interface. A push update must contain
2922  * exactly one push packet. The backup version of the packet must start with a
2923  * long (32B) BD and the BDs must be less than or equal to 16x16B units long.
2924  */
2925 /*
2926  * Note: This door bell format is used by the driver when it wants to push a
2927  * packet into the chip for super-fast transmission. This pushes a partial BD
2928  * and the packet data into the chip. If the chip has room, it will transmit the
2929  * packet. If the chip dosn't have room, it will read the BD and packet data
2930  * from host memory as a normal packet.
2931  */
2932 /* TX Door Bell Format (4 bytes) */
2933 
2934 struct tx_doorbell {
2935 	uint32_t key_idx;
2936 	/*
2937 	 * This value indicates the type of door bell operation that is begin
2938 	 * requested. This value is '0' for TX door bell operations.
2939 	 */
2940 	/*
2941 	 * BD Index of next BD that will be used to transmit data on the TX ring
2942 	 * mapped to this door bell. NIC may read and process all BDs up to, but
2943 	 * not including this index.
2944 	 */
2945 	#define TX_DOORBELL_IDX_MASK				UINT32_C(0xffffff)
2946 	#define TX_DOORBELL_IDX_SFT				0
2947 	/* reserved is 4 b */
2948 	#define TX_DOORBELL_RESERVED_MASK			UINT32_C(0xf000000)
2949 	#define TX_DOORBELL_RESERVED_SFT			24
2950 	/*
2951 	 * This value indicates the type of door bell operation that is begin
2952 	 * requested. This value is '0' for TX door bell operations.
2953 	 */
2954 	#define TX_DOORBELL_KEY_MASK				UINT32_C(0xf0000000)
2955 	#define TX_DOORBELL_KEY_SFT				28
2956 	/* TX Operation */
2957 	#define TX_DOORBELL_KEY_TX				(UINT32_C(0x0) << 28)
2958 } __attribute__((packed));
2959 
2960 /* RX Door Bell Format (4 bytes) */
2961 
2962 struct rx_doorbell {
2963 	uint32_t key_idx;
2964 	/*
2965 	 * This value indicates the type of door bell operation that is begin
2966 	 * requested. This value is '1' for RX door bell operations.
2967 	 */
2968 	/*
2969 	 * BD Index of next BD that will be used for an empty receive buffer on
2970 	 * the RX ring mapped to this door bell. NIC may read and process all
2971 	 * BDs up to, but not including this index.
2972 	 */
2973 	#define RX_DOORBELL_IDX_MASK				UINT32_C(0xffffff)
2974 	#define RX_DOORBELL_IDX_SFT				0
2975 	/* reserved is 4 b */
2976 	#define RX_DOORBELL_RESERVED_MASK			UINT32_C(0xf000000)
2977 	#define RX_DOORBELL_RESERVED_SFT			24
2978 	/*
2979 	 * This value indicates the type of door bell operation that is begin
2980 	 * requested. This value is '1' for RX door bell operations.
2981 	 */
2982 	#define RX_DOORBELL_KEY_MASK				UINT32_C(0xf0000000)
2983 	#define RX_DOORBELL_KEY_SFT				28
2984 	/* RX Operation */
2985 	#define RX_DOORBELL_KEY_RX				(UINT32_C(0x1) << 28)
2986 } __attribute__((packed));
2987 
2988 /* CMP Door Bell Format (4 bytes) */
2989 
2990 struct cmpl_doorbell {
2991 	uint32_t key_mask_valid_idx;
2992 	/*
2993 	 * This value indicates the type of door bell operation that is begin
2994 	 * requested. This value is '2' for CMP door bell operations.
2995 	 */
2996 	/*
2997 	 * BD Index of the most recently handed completion record on the
2998 	 * completion ring mapped to this door bell. NIC may write this location
2999 	 * again with a new completion.
3000 	 */
3001 	#define CMPL_DOORBELL_IDX_MASK				UINT32_C(0xffffff)
3002 	#define CMPL_DOORBELL_IDX_SFT				0
3003 	/* reserved is 2 b */
3004 	#define CMPL_DOORBELL_RESERVED_MASK			UINT32_C(0x3000000)
3005 	#define CMPL_DOORBELL_RESERVED_SFT			24
3006 	/*
3007 	 * This indicates if the BDIDX value is valid for this update when it is
3008 	 * '1'. When it is '0', the BDIDX value should be ignored.
3009 	 */
3010 	#define CMPL_DOORBELL_IDX_VALID				UINT32_C(0x4000000)
3011 	/*
3012 	 * This bit indicates the new interrupt mask state for the interrupt
3013 	 * associated with the BDIDX. A '1', means the interrupt is to be
3014 	 * masked. A '0' indicates the interrupt is to be unmasked.
3015 	 */
3016 	#define CMPL_DOORBELL_MASK				UINT32_C(0x8000000)
3017 	/*
3018 	 * This value indicates the type of door bell operation that is begin
3019 	 * requested. This value is '2' for CMP door bell operations.
3020 	 */
3021 	#define CMPL_DOORBELL_KEY_MASK				UINT32_C(0xf0000000)
3022 	#define CMPL_DOORBELL_KEY_SFT				28
3023 	/* Completion Operation */
3024 	#define CMPL_DOORBELL_KEY_CMPL				(UINT32_C(0x2) << 28)
3025 } __attribute__((packed));
3026 
3027 /* Status Door Bell Format (4 bytes) */
3028 
3029 struct status_doorbell {
3030 	uint32_t key_idx;
3031 	/*
3032 	 * This value indicates the type of door bell operation that is begin
3033 	 * requested. This value is '3' for Status door bell operations.
3034 	 */
3035 	/*
3036 	 * BD Index of the status record for which space is now available to the
3037 	 * NIC.
3038 	 */
3039 	/*
3040 	 * While there is no actual BD associated with the index, the similar
3041 	 * scheme is being used to communicate to the NIC that space is
3042 	 * available for status completions.
3043 	 */
3044 	#define STATUS_DOORBELL_IDX_MASK			UINT32_C(0xffffff)
3045 	#define STATUS_DOORBELL_IDX_SFT				0
3046 	/* reserved is 4 b */
3047 	#define STATUS_DOORBELL_RESERVED_MASK			UINT32_C(0xf000000)
3048 	#define STATUS_DOORBELL_RESERVED_SFT			24
3049 	/*
3050 	 * This value indicates the type of door bell operation that is begin
3051 	 * requested. This value is '3' for Status door bell operations.
3052 	 */
3053 	#define STATUS_DOORBELL_KEY_MASK			UINT32_C(0xf0000000)
3054 	#define STATUS_DOORBELL_KEY_SFT				28
3055 	/* Status Operation */
3056 	#define STATUS_DOORBELL_KEY_STAT			(UINT32_C(0x3) << 28)
3057 } __attribute__((packed));
3058 
3059 /* Push w/32B BD Door Bell Format (32 bytes) */
3060 
3061 struct push32_doorbell {
3062 	uint32_t key_sz_idx;
3063 	/*
3064 	 * This value indicates the type of door bell operation that is begin
3065 	 * requested. This value is 4 for push door bell operations.
3066 	 */
3067 	/*
3068 	 * This is the BD Index of last BD of the push packet that will be used
3069 	 * to transmit data on the TX ring mapped to this door bell.
3070 	 */
3071 	#define PUSH32_DOORBELL_IDX_MASK			UINT32_C(0xffffff)
3072 	#define PUSH32_DOORBELL_IDX_SFT				0
3073 	/*
3074 	 * This is the number of 16B BDs spaces consumed in the TX Ring by the
3075 	 * "backup" version of the packet being pushed. A value of 1 is invalid
3076 	 * since backup must start with a long 32B BE. A value of 2 indicates
3077 	 * just the first 32B BE. A value of 3 indicates 32B+16B BD. etc. A
3078 	 * value of 0 indicates 16x16B BD spaces are consumed.
3079 	 */
3080 	#define PUSH32_DOORBELL_SZ_MASK				UINT32_C(0xf000000)
3081 	#define PUSH32_DOORBELL_SZ_SFT				24
3082 	/*
3083 	 * This value indicates the type of door bell operation that is begin
3084 	 * requested. This value is 4 for push door bell operations.
3085 	 */
3086 	#define PUSH32_DOORBELL_KEY_MASK			UINT32_C(0xf0000000)
3087 	#define PUSH32_DOORBELL_KEY_SFT				28
3088 	/* Push Operation */
3089 	#define PUSH32_DOORBELL_KEY_PUSH			(UINT32_C(0x4) << 28)
3090 	uint16_t flags_type;
3091 	/*
3092 	 * All bits in this field must be valid on the first BD of a packet.
3093 	 * Only the packet_end bit must be valid for the remaining BDs of a
3094 	 * packet.
3095 	 */
3096 	/* This value identifies the type of buffer descriptor. */
3097 	#define PUSH32_DOORBELL_TYPE_MASK			UINT32_C(0x3f)
3098 	#define PUSH32_DOORBELL_TYPE_SFT			0
3099 	/*
3100 	 * Indicates that this BD is 32B long and is used for normal L2
3101 	 * packet transmission.
3102 	 */
3103 	#define PUSH32_DOORBELL_TYPE_TX_BD_LONG		UINT32_C(0x10)
3104 	/*
3105 	 * If set to 1, the packet ends with the data in the buffer pointed to
3106 	 * by this descriptor. This flag must be valid on every BD. This bit
3107 	 * must be set on all push doorbells.
3108 	 */
3109 	#define PUSH32_DOORBELL_FLAGS_PACKET_END		UINT32_C(0x40)
3110 	/*
3111 	 * If set to 1, the device will not generate a completion for this
3112 	 * transmit packet unless there is an error in it's processing. If this
3113 	 * bit is set to 0, then the packet will be completed normally. This bit
3114 	 * must be valid only on the first BD of a packet.
3115 	 */
3116 	#define PUSH32_DOORBELL_FLAGS_NO_CMPL			UINT32_C(0x80)
3117 	/*
3118 	 * This value must match the sz field in the first 32b of the push
3119 	 * operation except that if 16x16B BD locations are consumed in the ring
3120 	 * by this packet, then this value must be 16 (not zero).
3121 	 */
3122 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_MASK		UINT32_C(0x1f00)
3123 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_SFT		8
3124 	/*
3125 	 * This value is a hint for the length of the entire packet. It is used
3126 	 * by the chip to optimize internal processing. The packet will be
3127 	 * dropped if the hint is too short. This field is valid only on the
3128 	 * first BD of a packet.
3129 	 */
3130 	#define PUSH32_DOORBELL_FLAGS_LHINT_MASK		UINT32_C(0x6000)
3131 	#define PUSH32_DOORBELL_FLAGS_LHINT_SFT			13
3132 	/* indicates packet length < 512B */
3133 	#define PUSH32_DOORBELL_FLAGS_LHINT_LT512		(UINT32_C(0x0) << 13)
3134 	/* indicates 512 <= packet length < 1KB */
3135 	#define PUSH32_DOORBELL_FLAGS_LHINT_LT1K		(UINT32_C(0x1) << 13)
3136 	/* indicates 1KB <= packet length < 2KB */
3137 	#define PUSH32_DOORBELL_FLAGS_LHINT_LT2K		(UINT32_C(0x2) << 13)
3138 	/* indicates packet length >= 2KB */
3139 	#define PUSH32_DOORBELL_FLAGS_LHINT_GTE2K		(UINT32_C(0x3) << 13)
3140 	#define PUSH32_DOORBELL_FLAGS_LHINT_LAST	PUSH32_DOORBELL_FLAGS_LHINT_GTE2K
3141 	/*
3142 	 * If set to 1, the device immediately updates the Send Consumer Index
3143 	 * after the buffer associated with this descriptor has been transferred
3144 	 * via DMA to NIC memory from host memory. An interrupt may or may not
3145 	 * be generated according to the state of the interrupt avoidance
3146 	 * mechanisms. If this bit is set to 0, then the Consumer Index is only
3147 	 * updated as soon as one of the host interrupt coalescing conditions
3148 	 * has been met. This bit must be valid on the first BD of a packet.
3149 	 */
3150 	#define PUSH32_DOORBELL_FLAGS_COAL_NOW			UINT32_C(0x8000)
3151 	/*
3152 	 * All bits in this field must be valid on the first BD of a packet.
3153 	 * Only the packet_end bit must be valid for the remaining BDs of a
3154 	 * packet.
3155 	 */
3156 	#define PUSH32_DOORBELL_FLAGS_MASK			UINT32_C(0xffc0)
3157 	#define PUSH32_DOORBELL_FLAGS_SFT			6
3158 	uint16_t len;
3159 	/*
3160 	 * This is the length of the host physical buffer this BD describes in
3161 	 * bytes. This field must be valid on all BDs of a packet.
3162 	 */
3163 	uint32_t opaque;
3164 	/*
3165 	 * The opaque data field is pass through to the completion and can be
3166 	 * used for any data that the driver wants to associate with the
3167 	 * transmit BD. This field must be valid on the first BD of a packet.
3168 	 */
3169 	uint16_t lflags;
3170 	/*
3171 	 * All bits in this field must be valid on the first BD of a packet.
3172 	 * Their value on other BDs of the packet will be ignored.
3173 	 */
3174 	/*
3175 	 * If set to 1, the controller replaces the TCP/UPD checksum fields of
3176 	 * normal TCP/UPD checksum, or the inner TCP/UDP checksum field of the
3177 	 * encapsulated TCP/UDP packets with the hardware calculated TCP/UDP
3178 	 * checksum for the packet associated with this descriptor. The flag is
3179 	 * ignored if the LSO flag is set. This bit must be valid on the first
3180 	 * BD of a packet.
3181 	 */
3182 	#define PUSH32_DOORBELL_LFLAGS_TCP_UDP_CHKSUM		UINT32_C(0x1)
3183 	/*
3184 	 * If set to 1, the controller replaces the IP checksum of the normal
3185 	 * packets, or the inner IP checksum of the encapsulated packets with
3186 	 * the hardware calculated IP checksum for the packet associated with
3187 	 * this descriptor. This bit must be valid on the first BD of a packet.
3188 	 */
3189 	#define PUSH32_DOORBELL_LFLAGS_IP_CHKSUM		UINT32_C(0x2)
3190 	/*
3191 	 * If set to 1, the controller will not append an Ethernet CRC to the
3192 	 * end of the frame. This bit must be valid on the first BD of a packet.
3193 	 * Packet must be 64B or longer when this flag is set. It is not useful
3194 	 * to use this bit with any form of TX offload such as CSO or LSO. The
3195 	 * intent is that the packet from the host already has a valid Ethernet
3196 	 * CRC on the packet.
3197 	 */
3198 	#define PUSH32_DOORBELL_LFLAGS_NOCRC			UINT32_C(0x4)
3199 	/*
3200 	 * If set to 1, the device will record the time at which the packet was
3201 	 * actually transmitted at the TX MAC. This bit must be valid on the
3202 	 * first BD of a packet.
3203 	 */
3204 	#define PUSH32_DOORBELL_LFLAGS_STAMP			UINT32_C(0x8)
3205 	/*
3206 	 * If set to 1, The controller replaces the tunnel IP checksum field
3207 	 * with hardware calculated IP checksum for the IP header of the packet
3208 	 * associated with this descriptor. For outer UDP checksum, global outer
3209 	 * UDP checksum TE_NIC register needs to be enabled. If the global outer
3210 	 * UDP checksum TE_NIC register bit is set, outer UDP checksum will be
3211 	 * calculated for the following cases: 1. Packets with tcp_udp_chksum
3212 	 * flag set to offload checksum for inner packet AND the inner packet is
3213 	 * TCP/UDP. If the inner packet is ICMP for example (non-TCP/UDP), even
3214 	 * if the tcp_udp_chksum is set, the outer UDP checksum will not be
3215 	 * calculated. 2. Packets with lso flag set which implies inner TCP
3216 	 * checksum calculation as part of LSO operation.
3217 	 */
3218 	#define PUSH32_DOORBELL_LFLAGS_T_IP_CHKSUM		UINT32_C(0x10)
3219 	/*
3220 	 * If set to 1, the device will treat this packet with LSO(Large Send
3221 	 * Offload) processing for both normal or encapsulated packets, which is
3222 	 * a form of TCP segmentation. When this bit is 1, the hdr_size and mss
3223 	 * fields must be valid. The driver doesn't need to set t_ip_chksum,
3224 	 * ip_chksum, and tcp_udp_chksum flags since the controller will replace
3225 	 * the appropriate checksum fields for segmented packets. When this bit
3226 	 * is 1, the hdr_size and mss fields must be valid.
3227 	 */
3228 	#define PUSH32_DOORBELL_LFLAGS_LSO			UINT32_C(0x20)
3229 	/*
3230 	 * If set to zero when LSO is '1', then the IPID will be treated as a
3231 	 * 16b number and will be wrapped if it exceeds a value of 0xffff. If
3232 	 * set to one when LSO is '1', then the IPID will be treated as a 15b
3233 	 * number and will be wrapped if it exceeds a value 0f 0x7fff.
3234 	 */
3235 	#define PUSH32_DOORBELL_LFLAGS_IPID_FMT			UINT32_C(0x40)
3236 	/*
3237 	 * If set to zero when LSO is '1', then the IPID of the tunnel IP header
3238 	 * will not be modified during LSO operations. If set to one when LSO is
3239 	 * '1', then the IPID of the tunnel IP header will be incremented for
3240 	 * each subsequent segment of an LSO operation. The flag is ignored if
3241 	 * the LSO packet is a normal (non-tunneled) TCP packet.
3242 	 */
3243 	#define PUSH32_DOORBELL_LFLAGS_T_IPID			UINT32_C(0x80)
3244 	/*
3245 	 * If set to '1', then the RoCE ICRC will be appended to the packet.
3246 	 * Packet must be a valid RoCE format packet.
3247 	 */
3248 	#define PUSH32_DOORBELL_LFLAGS_ROCE_CRC			UINT32_C(0x100)
3249 	/*
3250 	 * If set to '1', then the FCoE CRC will be appended to the packet.
3251 	 * Packet must be a valid FCoE format packet.
3252 	 */
3253 	#define PUSH32_DOORBELL_LFLAGS_FCOE_CRC			UINT32_C(0x200)
3254 	uint16_t hdr_size;
3255 	/*
3256 	 * When LSO is '1', this field must contain the offset of the TCP
3257 	 * payload from the beginning of the packet in as 16b words. In case of
3258 	 * encapsulated/tunneling packet, this field contains the offset of the
3259 	 * inner TCP payload from beginning of the packet as 16-bit words. This
3260 	 * value must be valid on the first BD of a packet.
3261 	 */
3262 	#define PUSH32_DOORBELL_HDR_SIZE_MASK			UINT32_C(0x1ff)
3263 	#define PUSH32_DOORBELL_HDR_SIZE_SFT			0
3264 	uint32_t mss;
3265 	/*
3266 	 * This is the MSS value that will be used to do the LSO processing. The
3267 	 * value is the length in bytes of the TCP payload for each segment
3268 	 * generated by the LSO operation. This value must be valid on the first
3269 	 * BD of a packet.
3270 	 */
3271 	#define PUSH32_DOORBELL_MSS_MASK			UINT32_C(0x7fff)
3272 	#define PUSH32_DOORBELL_MSS_SFT				0
3273 	uint16_t unused_2;
3274 	uint16_t cfa_action;
3275 	/*
3276 	 * This value selects a CFA action to perform on the packet. Set this
3277 	 * value to zero if no CFA action is desired. This value must be valid
3278 	 * on the first BD of a packet.
3279 	 */
3280 	uint32_t cfa_meta;
3281 	/*
3282 	 * This value is action meta-data that defines CFA edit operations that
3283 	 * are done in addition to any action editing.
3284 	 */
3285 	/* When key=1, This is the VLAN tag VID value. */
3286 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_MASK		UINT32_C(0xfff)
3287 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_SFT		0
3288 	/* When key=1, This is the VLAN tag DE value. */
3289 	#define PUSH32_DOORBELL_CFA_META_VLAN_DE		UINT32_C(0x1000)
3290 	/* When key=1, This is the VLAN tag PRI value. */
3291 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_MASK		UINT32_C(0xe000)
3292 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_SFT		13
3293 	/* When key=1, This is the VLAN tag TPID select value. */
3294 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_MASK		UINT32_C(0x70000)
3295 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_SFT		16
3296 	/* 0x88a8 */
3297 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
3298 	/* 0x8100 */
3299 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
3300 	/* 0x9100 */
3301 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
3302 	/* 0x9200 */
3303 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
3304 	/* 0x9300 */
3305 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
3306 	/* Value programmed in CFA VLANTPID register. */
3307 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
3308 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_LAST	PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG
3309 	/* When key=1, This is the VLAN tag TPID select value. */
3310 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_MASK	UINT32_C(0xff80000)
3311 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_SFT	19
3312 	/*
3313 	 * This field identifies the type of edit to be performed on the packet.
3314 	 * This value must be valid on the first BD of a packet.
3315 	 */
3316 	#define PUSH32_DOORBELL_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
3317 	#define PUSH32_DOORBELL_CFA_META_KEY_SFT		28
3318 	/* No editing */
3319 	#define PUSH32_DOORBELL_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
3320 	/*
3321 	 * - meta[17:16] - TPID select value (0 = 0x8100). - meta[15:12]
3322 	 * - PRI/DE value. - meta[11:0] - VID value.
3323 	 */
3324 	#define PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG		(UINT32_C(0x1) << 28)
3325 	#define PUSH32_DOORBELL_CFA_META_KEY_LAST	PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG
3326 	uint32_t data[25];
3327 	/*
3328 	 * This is the data for the push packet. If the packet data does not fit
3329 	 * in the first pass, data writing can continue at offset 4 of the
3330 	 * doorbell for up to 4 additional passes for a total data size of 512B
3331 	 * maximum.
3332 	 */
3333 } __attribute__((packed));
3334 
3335 /* Doorbell Structures */
3336 /*
3337  * Description: This is the RoCE 32b Doorbell format. The host writes this
3338  * message format directly to byte offset 8 of the appropriate doorbell page.
3339  */
3340 /* 64b Doorbell Format (8 bytes) */
3341 
3342 struct dbr_dbr {
3343 	uint32_t index;
3344 	/*
3345 	 * This value is the index being written. For SQ, RQ, SRQ, this is the
3346 	 * producer index and should be the queue index of the last WQE written
3347 	 * plus 1. For CQ, this is the consumer index and should be the index of
3348 	 * the last CQE processed plus 1.
3349 	 */
3350 	#define DBR_DBR_INDEX_MASK				UINT32_C(0xfffff)
3351 	#define DBR_DBR_INDEX_SFT				0
3352 	#define DBR_DBR_RESERVED12_MASK				UINT32_C(0xfff00000)
3353 	#define DBR_DBR_RESERVED12_SFT				20
3354 	uint32_t type_xid;
3355 	/* This value identifies the type of doorbell being written. */
3356 	/*
3357 	 * This value identifies the resource that the doorbell is intended to
3358 	 * notify. For SQ and RQ, this is the QPID. For SRQ, this is the SID.
3359 	 * For CQ, this is the CID. Bits [19:16] of this values must be zero for
3360 	 * a SID value.
3361 	 */
3362 	#define DBR_DBR_XID_MASK				UINT32_C(0xfffff)
3363 	#define DBR_DBR_XID_SFT					0
3364 	#define DBR_DBR_RESERVED8_MASK				UINT32_C(0xff00000)
3365 	#define DBR_DBR_RESERVED8_SFT				20
3366 	/* This value identifies the type of doorbell being written. */
3367 	#define DBR_DBR_TYPE_MASK				UINT32_C(0xf0000000)
3368 	#define DBR_DBR_TYPE_SFT				28
3369 	/*
3370 	 * This is a SQ producer index update. It indicates one or more
3371 	 * new entries have been written to the SQ for the QPID
3372 	 * indicated on the xID field.
3373 	 */
3374 	#define DBR_DBR_TYPE_SQ				(UINT32_C(0x0) << 28)
3375 	/*
3376 	 * This is a RQ producer index update. It indicates one or more
3377 	 * new entries have been written to the RQ for the QPID
3378 	 * indicated on the xID field.
3379 	 */
3380 	#define DBR_DBR_TYPE_RQ				(UINT32_C(0x1) << 28)
3381 	/*
3382 	 * This is a SRQ producer index update. It indicates one or more
3383 	 * new entries have been written to the SRQ for the SID
3384 	 * indicated on the xID field.
3385 	 */
3386 	#define DBR_DBR_TYPE_SRQ				(UINT32_C(0x2) << 28)
3387 	/*
3388 	 * This doorbell command arms the SRQ async event. The xID field
3389 	 * must identify the SID that is begin armed. The index field is
3390 	 * will set the arm threshold such that a notification will be
3391 	 * generated if less than that number or SRQ entries are posted.
3392 	 */
3393 	#define DBR_DBR_TYPE_SRQ_ARM				(UINT32_C(0x3) << 28)
3394 	/*
3395 	 * This is a CQ consumer index update. It indicates one or more
3396 	 * entries have been processed off the CQ indicated on the xID
3397 	 * field.
3398 	 */
3399 	#define DBR_DBR_TYPE_CQ				(UINT32_C(0x4) << 28)
3400 	/*
3401 	 * this is a CQ consumer index update that also arms the CQ for
3402 	 * solicited events.
3403 	 */
3404 	#define DBR_DBR_TYPE_CQ_ARMSE				(UINT32_C(0x5) << 28)
3405 	/*
3406 	 * This is a CQ consumer index update that also arms the CQ for
3407 	 * any new CQE.
3408 	 */
3409 	#define DBR_DBR_TYPE_CQ_ARMALL				(UINT32_C(0x6) << 28)
3410 	/*
3411 	 * This is a CQ arm enable message. This message must be sent
3412 	 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
3413 	 * message will be accepted. This doorbell can only be sent from
3414 	 * the privileged (first) doorbell page of a function.
3415 	 */
3416 	#define DBR_DBR_TYPE_CQ_ARMENA				(UINT32_C(0x7) << 28)
3417 	/*
3418 	 * This doorbell command enables the SRQ async event to be
3419 	 * armed. This message must be setn from the privileged driver
3420 	 * before a new SRQ_ARM message will be accepted. The xID field
3421 	 * must identify the SID that is begin enabled for arm. This
3422 	 * doorbell can only be sent from the privileged (first)
3423 	 * doorbell page of a function.
3424 	 */
3425 	#define DBR_DBR_TYPE_SRQ_ARMENA			(UINT32_C(0x8) << 28)
3426 	/*
3427 	 * This doorbell command indicates that the cutoff CQE has been
3428 	 * processed and the driver is now processing completions from
3429 	 * the new CQ. The index field for this doorbell type must be
3430 	 * zero.
3431 	 */
3432 	#define DBR_DBR_TYPE_CQ_CUTOFF_ACK			(UINT32_C(0x9) << 28)
3433 	/*
3434 	 * This doorbell command is used during doorbell moderation to
3435 	 * consume system BW and help prevent doorbell FIFO overflow.
3436 	 * All other fields should be zero for NULL doorbell.
3437 	 */
3438 	#define DBR_DBR_TYPE_NULL				(UINT32_C(0xf) << 28)
3439 } __attribute__((packed));
3440 
3441 /* 32b Doorbell Format (4 bytes) */
3442 
3443 struct dbr_dbr32 {
3444 	uint32_t type_abs_incr_xid;
3445 	/* This value identifies the type of doorbell being written. */
3446 	/*
3447 	 * This value identifies the resource that the doorbell is intended to
3448 	 * notify. For SQ and RQ, this is the QPID. For SRQ, this is the SID.
3449 	 * For CQ, this is the CID. Bits [19:16] of this values must be zero for
3450 	 * a SID value.
3451 	 */
3452 	#define DBR_DBR32_XID_MASK				UINT32_C(0xfffff)
3453 	#define DBR_DBR32_XID_SFT				0
3454 	#define DBR_DBR32_RESERVED4_MASK			UINT32_C(0xf00000)
3455 	#define DBR_DBR32_RESERVED4_SFT				20
3456 	/*
3457 	 * When abs=0, this value is the value to add to the appropriate index
3458 	 * value. When abs=1, this value is the new value for the index.
3459 	 * Absolute value is used when the queue is being wrapped. When abs=1,
3460 	 * the incr value follows the same rules as the index value in the 64b
3461 	 * doorbell.
3462 	 */
3463 	#define DBR_DBR32_INCR_MASK				UINT32_C(0xf000000)
3464 	#define DBR_DBR32_INCR_SFT				24
3465 	/* This value defines how the incr value will be interpreted. */
3466 	#define DBR_DBR32_ABS					UINT32_C(0x10000000)
3467 	/* This value identifies the type of doorbell being written. */
3468 	#define DBR_DBR32_TYPE_MASK				UINT32_C(0xe0000000)
3469 	#define DBR_DBR32_TYPE_SFT				29
3470 	/*
3471 	 * This is a SQ producer index update. It indicates one or more
3472 	 * new entries have been written to the SQ for the QPID
3473 	 * indicated on the xID field.
3474 	 */
3475 	#define DBR_DBR32_TYPE_SQ				(UINT32_C(0x0) << 29)
3476 } __attribute__((packed));
3477 
3478 /* SQ WQE Structures */
3479 /*
3480  * Description: This is the Bind WQE structure. This WQE can perform either: *
3481  * type1 "bind memory window", if mw_type==Type1 * type2 "post send bind memory
3482  * window", if mw_type==Type2
3483  */
3484 /* Base SQ WQE (8 bytes) */
3485 
3486 struct sq_base {
3487 	uint8_t wqe_type;
3488 	/* This field defines the type of SQ WQE. */
3489 	/* Send */
3490 	#define SQ_BASE_WQE_TYPE_SEND				UINT32_C(0x0)
3491 	/*
3492 	 * Send with Immediate Allowed only on reliable connection (RC)
3493 	 * and unreliable datagram (UD) SQ's.
3494 	 */
3495 	#define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD			UINT32_C(0x1)
3496 	/*
3497 	 * Send with Invalidate. Allowed only on reliable connection
3498 	 * (RC) SQ's.
3499 	 */
3500 	#define SQ_BASE_WQE_TYPE_SEND_W_INVALID		UINT32_C(0x2)
3501 	/* RDMA Write. Allowed only on reliable connection (RC) SQ's. */
3502 	#define SQ_BASE_WQE_TYPE_WRITE_WQE			UINT32_C(0x4)
3503 	/*
3504 	 * RDMA Write with Immediate. Allowed only on reliable
3505 	 * connection (RC) SQ's.
3506 	 */
3507 	#define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD		UINT32_C(0x5)
3508 	/* RDMA Read. Allowed only on reliable connection (RC) SQ's. */
3509 	#define SQ_BASE_WQE_TYPE_READ_WQE			UINT32_C(0x6)
3510 	/*
3511 	 * Atomic Compare/Swap. Allowed only on reliable connection (RC)
3512 	 * SQ's.
3513 	 */
3514 	#define SQ_BASE_WQE_TYPE_ATOMIC_CS			UINT32_C(0x8)
3515 	/* Atomic Fetch/Add. Allowed only on reliable connection (RC) SQ's. */
3516 	#define SQ_BASE_WQE_TYPE_ATOMIC_FA			UINT32_C(0xb)
3517 	/* Local Invalidate. Allowed only on reliable connection (RC) SQ's. */
3518 	#define SQ_BASE_WQE_TYPE_LOCAL_INVALID			UINT32_C(0xc)
3519 	/*
3520 	 * FR-PMR (Fast Register Physical Memory Region) Allowed only on
3521 	 * reliable connection (RC) SQ's.
3522 	 */
3523 	#define SQ_BASE_WQE_TYPE_FR_PMR			UINT32_C(0xd)
3524 	/* Memory Bind Allowed only on reliable connection (RC) SQ's. */
3525 	#define SQ_BASE_WQE_TYPE_BIND				UINT32_C(0xe)
3526 	uint8_t unused_0[7];
3527 } __attribute__((packed));
3528 
3529 /* WQE SGE (16 bytes) */
3530 
3531 struct sq_sge {
3532 	uint64_t va_or_pa;
3533 	/*
3534 	 * The virtual address in local memory or a physical address when l_key
3535 	 * value is a reserved value of a physical address. Driver configures
3536 	 * this value in the chip and the chip compares l_key in SGEs with that
3537 	 * reserved value, if equal it access the physical address specified.
3538 	 * The chip however MUST verify that the QP allows the use reserved key.
3539 	 */
3540 	uint32_t l_key;
3541 	/*
3542 	 * Local Key associated with this registered MR; The 24 msb of the key
3543 	 * used to index the MRW Table and the 8 lsb are compared with the 8
3544 	 * bits key part stored in the MRWC. The PBL in the MRW Context is used
3545 	 * to translate the above VA to physical address.
3546 	 */
3547 	uint32_t size;
3548 	/*
3549 	 * Size of SGE in bytes; Based on page size of the system the chip knows
3550 	 * how many entries are in the PBL
3551 	 */
3552 } __attribute__((packed));
3553 
3554 /* PSN Search Structure (8 bytes) */
3555 
3556 struct sq_psn_search {
3557 	uint32_t opcode_start_psn;
3558 	/* The opcodes are software defined. */
3559 	/* Start PSN. */
3560 	#define SQ_PSN_SEARCH_START_PSN_MASK			UINT32_C(0xffffff)
3561 	#define SQ_PSN_SEARCH_START_PSN_SFT			0
3562 	/* The opcodes are software defined. */
3563 	#define SQ_PSN_SEARCH_OPCODE_MASK			UINT32_C(0xff000000)
3564 	#define SQ_PSN_SEARCH_OPCODE_SFT			24
3565 	uint32_t flags_next_psn;
3566 	/* Opcode specific flags. */
3567 	/* Next PSN. Equal to the start PSN of the next WQE. */
3568 	#define SQ_PSN_SEARCH_NEXT_PSN_MASK			UINT32_C(0xffffff)
3569 	#define SQ_PSN_SEARCH_NEXT_PSN_SFT			0
3570 	/* Opcode specific flags. */
3571 	#define SQ_PSN_SEARCH_FLAGS_MASK			UINT32_C(0xff000000)
3572 	#define SQ_PSN_SEARCH_FLAGS_SFT				24
3573 } __attribute__((packed));
3574 
3575 /* Send SQ WQE (40 bytes) */
3576 
3577 struct sq_send {
3578 	uint8_t wqe_type;
3579 	/* This field defines the type of SQ WQE. */
3580 	/* Send */
3581 	#define SQ_SEND_WQE_TYPE_SEND				UINT32_C(0x0)
3582 	/*
3583 	 * Send with Immediate Allowed only on reliable connection (RC)
3584 	 * and unreliable datagram (UD) SQ's.
3585 	 */
3586 	#define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD			UINT32_C(0x1)
3587 	/*
3588 	 * Send with Invalidate. Allowed only on reliable connection
3589 	 * (RC) SQ's.
3590 	 */
3591 	#define SQ_SEND_WQE_TYPE_SEND_W_INVALID		UINT32_C(0x2)
3592 	uint8_t flags;
3593 	/*
3594 	 * Set if completion signaling is requested. If this bit is 0, and the
3595 	 * SQ is configured to support Unsignaled completion the controller
3596 	 * should not generate a CQE unless there was an error. This refers to
3597 	 * the CQE on the sender side. (The se flag refers to the receiver
3598 	 * side).
3599 	 */
3600 	#define SQ_SEND_FLAGS_SIGNAL_COMP			UINT32_C(0x1)
3601 	/*
3602 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
3603 	 * SQ before executing this WQE. This flag must be zero for a UD send.
3604 	 */
3605 	#define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE		UINT32_C(0x2)
3606 	/*
3607 	 * For local invalidate request. Indicate to complete all previous SQ's
3608 	 * WQEs before executing this WQE. This flag must be zero for a UD send.
3609 	 */
3610 	#define SQ_SEND_FLAGS_UC_FENCE				UINT32_C(0x4)
3611 	/*
3612 	 * Solicit event flag. Indication sent in BTH header to the receiver to
3613 	 * generate a Completion Event Notification, i.e. CNQE. This bit should
3614 	 * be set only in the last (or only) packet of the message.
3615 	 */
3616 	#define SQ_SEND_FLAGS_SE				UINT32_C(0x8)
3617 	/*
3618 	 * Indicate that inline data is posted to the SQ in the data area of
3619 	 * this WQE.
3620 	 */
3621 	#define SQ_SEND_FLAGS_INLINE				UINT32_C(0x10)
3622 	uint8_t wqe_size;
3623 	/*
3624 	 * The number of 16 bytes chunks of data including this first word of
3625 	 * the request that are a valid part of the request. The valid 16 bytes
3626 	 * units other than the WQE structure can be SGEs (Scatter Gather
3627 	 * Elements) OR inline data. While this field defines the valid WQE
3628 	 * size. The actual total WQE size is always 128B.
3629 	 */
3630 	uint8_t reserved8_1;
3631 	uint32_t inv_key_or_imm_data;
3632 	/*
3633 	 * Either invalidate key (R_Key of the remote host) that will be send
3634 	 * with IETH (Invalidate ETH) if wqe_type is of Send with Invalidate, or
3635 	 * immediate value that will be sent with ImmDt header if wqe_type is
3636 	 * Send with Immediate.
3637 	 */
3638 	uint32_t length;
3639 	/* This field represents a 32-bit total data length, in bytes. */
3640 	uint32_t q_key;
3641 	/*
3642 	 * When in the SQ of a UD QP, indicates the q_key to be used in the
3643 	 * transmitted packet. However, if the most significant bit of this
3644 	 * field is set, then the q_key will be taken from QP context, rather
3645 	 * than from this field. When in the SQ of a non-UD QP, this field is
3646 	 * reserved and should be filled with zeros.
3647 	 */
3648 	uint32_t dst_qp;
3649 	/*
3650 	 * When in the SQ of a UD QP, indicates the destination QP to be used in
3651 	 * the transmitted packet. When in the SQ of a non-UD QP, this field is
3652 	 * reserved and should be filled with zeros.
3653 	 */
3654 	#define SQ_SEND_DST_QP_MASK				UINT32_C(0xffffff)
3655 	#define SQ_SEND_DST_QP_SFT				0
3656 	#define SQ_SEND_RESERVED8_2_MASK			UINT32_C(0xff000000)
3657 	#define SQ_SEND_RESERVED8_2_SFT				24
3658 	uint32_t avid;
3659 	/* This field is reserved for future expansion of the AVID. */
3660 	/*
3661 	 * If the serv_type is 'UD', then this field supplies the AVID (Address
3662 	 * Vector ID).
3663 	 */
3664 	#define SQ_SEND_AVID_MASK				UINT32_C(0xfffff)
3665 	#define SQ_SEND_AVID_SFT				0
3666 	/* This field is reserved for future expansion of the AVID. */
3667 	#define SQ_SEND_RESERVED_AVID_MASK			UINT32_C(0xfff00000)
3668 	#define SQ_SEND_RESERVED_AVID_SFT			20
3669 	uint64_t reserved64;
3670 	uint32_t data[24];
3671 	/*
3672 	 * When inline=0, then this area is filled with from 1 to 6 SGEs based
3673 	 * on the wqe_size field. When inline=1, this area is filled with
3674 	 * payload data for the send based on the length_or_AVID field. Bits
3675 	 * [7:0] of word 0 hold the first byte to go out on the wire.
3676 	 */
3677 } __attribute__((packed));
3678 
3679 /* Send Raw Ethernet and QP1 SQ WQE (40 bytes) */
3680 
3681 struct sq_send_raweth_qp1 {
3682 	uint8_t wqe_type;
3683 	/* This field defines the type of SQ WQE. */
3684 	/* Send */
3685 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND		UINT32_C(0x0)
3686 	uint8_t flags;
3687 	/*
3688 	 * Set if completion signaling is requested. If this bit is 0, and the
3689 	 * SQ is configured to support Unsignaled completion the controller
3690 	 * should not generate a CQE unless there was an error. This refers to
3691 	 * the CQE on the sender side. (The se flag refers to the receiver
3692 	 * side).
3693 	 */
3694 	#define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
3695 	/* This flag must be zero for a Raweth or QP1 send. */
3696 	#define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
3697 	/* This flag must be zero for a Raweth or QP1 send. */
3698 	#define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE		UINT32_C(0x4)
3699 	/* This flag must be zero for a Raweth or QP1 send. */
3700 	#define SQ_SEND_RAWETH_QP1_FLAGS_SE			UINT32_C(0x8)
3701 	/*
3702 	 * Indicate that inline data is posted to the SQ in the data area of
3703 	 * this WQE.
3704 	 */
3705 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE			UINT32_C(0x10)
3706 	uint8_t wqe_size;
3707 	/*
3708 	 * The number of 16 bytes chunks of data including this first word of
3709 	 * the request that are a valid part of the request. The valid 16 bytes
3710 	 * units other than the WQE structure can be SGEs (Scatter Gather
3711 	 * Elements) OR inline data. While this field defines the valid WQE
3712 	 * size. The actual total WQE size is always 128B.
3713 	 */
3714 	uint8_t reserved8;
3715 	uint16_t lflags;
3716 	/*
3717 	 * All bits in this field must be valid on the first BD of a packet.
3718 	 * Their value on other BDs of the packet will be ignored.
3719 	 */
3720 	/*
3721 	 * If set to 1, the controller replaces the TCP/UPD checksum fields of
3722 	 * normal TCP/UPD checksum, or the inner TCP/UDP checksum field of the
3723 	 * encapsulated TCP/UDP packets with the hardware calculated TCP/UDP
3724 	 * checksum for the packet associated with this descriptor. This bit
3725 	 * must be valid on the first BD of a packet.
3726 	 */
3727 	#define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
3728 	/*
3729 	 * If set to 1, the controller replaces the IP checksum of the normal
3730 	 * packets, or the inner IP checksum of the encapsulated packets with
3731 	 * the hardware calculated IP checksum for the packet associated with
3732 	 * this descriptor. This bit must be valid on the first BD of a packet.
3733 	 */
3734 	#define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM		UINT32_C(0x2)
3735 	/*
3736 	 * If set to 1, the controller will not append an Ethernet CRC to the
3737 	 * end of the frame. This bit must be valid on the first BD of a packet.
3738 	 * Packet must be 64B or longer when this flag is set. It is not usefull
3739 	 * to use this bit with any form of TX offload such as CSO or LSO. The
3740 	 * intent is that the packet from the host already has a valid Ethernet
3741 	 * CRC on the packet.
3742 	 */
3743 	#define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC			UINT32_C(0x4)
3744 	/*
3745 	 * If set to 1, the device will record the time at which the packet was
3746 	 * actually transmitted at the TX MAC. This bit must be valid on the
3747 	 * first BD of a packet.
3748 	 */
3749 	#define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP			UINT32_C(0x8)
3750 	/*
3751 	 * If set to 1, The controller replaces the tunnel IP checksum field
3752 	 * with hardware calculated IP checksum for the IP header of the packet
3753 	 * associated with this descriptor. In case of VXLAN, the controller
3754 	 * also replaces the outer header UDP checksum with hardware calculated
3755 	 * UDP checksum for the packet associated with this descriptor.
3756 	 */
3757 	#define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM		UINT32_C(0x10)
3758 	/* This bit is reserved and should be zero. */
3759 	#define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_1		UINT32_C(0x20)
3760 	/* This bit is reserved and should be zero. */
3761 	#define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_2		UINT32_C(0x40)
3762 	/* This bit is reserved and should be zero. */
3763 	#define SQ_SEND_RAWETH_QP1_LFLAGS_RESERVED1_3		UINT32_C(0x80)
3764 	/*
3765 	 * If set to '1', then the RoCE ICRC will be appended to the packet.
3766 	 * Packet must be a valid RoCE format packet.
3767 	 */
3768 	#define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC		UINT32_C(0x100)
3769 	/*
3770 	 * If set to '1', then the FCoE CRC will be appended to the packet.
3771 	 * Packet must be a valid FCoE format packet.
3772 	 */
3773 	#define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC		UINT32_C(0x200)
3774 	uint16_t cfa_action;
3775 	/*
3776 	 * This value selects a CFA action to perform on the packet. Set this
3777 	 * value to zero if no CFA action is desired. This value must be valid
3778 	 * on the first BD of a packet.
3779 	 */
3780 	uint32_t length;
3781 	/*
3782 	 * This field represents a 32-bit total data length, in bytes. Note,
3783 	 * however, that the length cannot exceed the MTU.
3784 	 */
3785 	uint32_t reserved32_1;
3786 	uint32_t cfa_meta;
3787 	/*
3788 	 * This value is action meta-data that defines CFA edit operations that
3789 	 * are done in addition to any action editing.
3790 	 */
3791 	/* When key=1, This is the VLAN tag VID value. */
3792 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
3793 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT	0
3794 	/* When key=1, This is the VLAN tag DE value. */
3795 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE		UINT32_C(0x1000)
3796 	/* When key=1, This is the VLAN tag PRI value. */
3797 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
3798 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT	13
3799 	/* When key=1, This is the VLAN tag TPID select value. */
3800 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
3801 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT	16
3802 	/* 0x88a8 */
3803 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
3804 	/* 0x8100 */
3805 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
3806 	/* 0x9100 */
3807 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
3808 	/* 0x9200 */
3809 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
3810 	/* 0x9300 */
3811 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
3812 	/* Value programmed in CFA VLANTPID register. */
3813 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
3814 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST	SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
3815 	/* When key=1, This is the VLAN tag TPID select value. */
3816 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK	UINT32_C(0xff80000)
3817 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT	19
3818 	/*
3819 	 * This field identifies the type of edit to be performed on the packet.
3820 	 * This value must be valid on the first BD of a packet.
3821 	 */
3822 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
3823 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT		28
3824 	/* No editing */
3825 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
3826 	/*
3827 	 * - meta[17:16] - TPID select value (0 = 0x8100). - meta[15:12]
3828 	 * - PRI/DE value. - meta[11:0] - VID value.
3829 	 */
3830 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
3831 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST	SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
3832 	uint32_t reserved32_2;
3833 	uint64_t reserved64;
3834 	uint32_t data[24];
3835 	/*
3836 	 * When inline=0, then this area is filled with from 1 to 6 SGEs based
3837 	 * on the wqe_size field. When inline=1, this area is filled with
3838 	 * payload data for the send based on the length_or_AVID field. Bits
3839 	 * [7:0] of word 0 hold the first byte to go out on the wire.
3840 	 */
3841 } __attribute__((packed));
3842 
3843 /* RDMA SQ WQE (40 bytes) */
3844 
3845 struct sq_rdma {
3846 	uint8_t wqe_type;
3847 	/* This field defines the type of SQ WQE. */
3848 	/* RDMA Write. Allowed only on reliable connection (RC) SQ's. */
3849 	#define SQ_RDMA_WQE_TYPE_WRITE_WQE			UINT32_C(0x4)
3850 	/*
3851 	 * RDMA Write with Immediate. Allowed only on reliable
3852 	 * connection (RC) SQ's.
3853 	 */
3854 	#define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD		UINT32_C(0x5)
3855 	/* RDMA Read. Allowed only on reliable connection (RC) SQ's. */
3856 	#define SQ_RDMA_WQE_TYPE_READ_WQE			UINT32_C(0x6)
3857 	uint8_t flags;
3858 	/*
3859 	 * Set if completion signaling is requested. If this bit is 0, and the
3860 	 * SQ is configured to support Unsignaled completion the controller
3861 	 * should not generate a CQE unless there was an error. This refer to
3862 	 * CQE on the sender side (se_flag refer to the receiver side)
3863 	 */
3864 	#define SQ_RDMA_FLAGS_SIGNAL_COMP			UINT32_C(0x1)
3865 	/*
3866 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
3867 	 * SQ before executing this WQE
3868 	 */
3869 	#define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE		UINT32_C(0x2)
3870 	/*
3871 	 * Unconditional fence. Indicate to complete all previous SQ's WQEs
3872 	 * before executing this WQE.
3873 	 */
3874 	#define SQ_RDMA_FLAGS_UC_FENCE				UINT32_C(0x4)
3875 	/*
3876 	 * Solicit event. Indication sent in BTH header to the receiver to
3877 	 * generate a Completion Event Notification, i.e. CNQE. This bit should
3878 	 * be set only in the last (or only) packet of the message.
3879 	 */
3880 	#define SQ_RDMA_FLAGS_SE				UINT32_C(0x8)
3881 	/*
3882 	 * Indicate that inline data is posted to the SQ following this WQE.
3883 	 * This bit may be 1 only for write operations.
3884 	 */
3885 	#define SQ_RDMA_FLAGS_INLINE				UINT32_C(0x10)
3886 	uint8_t wqe_size;
3887 	/*
3888 	 * The number of 16 bytes chunks of data including this first wqe of the
3889 	 * request that are a valid part of the request. The valid 16 bytes
3890 	 * units other than the WQE structure can be SGEs (Scatter Gather
3891 	 * Elements) OR inline data. While this field defines the valid WQE
3892 	 * size. The actual total WQE size is always 128B.
3893 	 */
3894 	uint8_t reserved8;
3895 	uint32_t imm_data;
3896 	/*
3897 	 * Immediate data - valid for RDMA Write with immediate and causes the
3898 	 * controller to add immDt header with this value
3899 	 */
3900 	uint32_t length;
3901 	/* Total data length in bytes */
3902 	uint32_t reserved32_1;
3903 	uint64_t remote_va;
3904 	/* Remote VA sent to the destination QP */
3905 	uint32_t remote_key;
3906 	/*
3907 	 * R_Key provided by remote node when the connection was established and
3908 	 * placed in the RETH header. It identify the MRW on the remote host
3909 	 */
3910 	uint32_t reserved32_2;
3911 	uint32_t data[24];
3912 	/*
3913 	 * When inline=0, then this area is filled with from 1 to 6 SGEs based
3914 	 * on the wqe_size field. When inline=1, this area is filled with
3915 	 * payload data for the write based on the length field. Bits [7:0] of
3916 	 * word 0 hold the first byte to go out on the wire.
3917 	 */
3918 } __attribute__((packed));
3919 
3920 /* Atomic SQ WQE (40 bytes) */
3921 
3922 struct sq_atomic {
3923 	uint8_t wqe_type;
3924 	/* This field defines the type of SQ WQE. */
3925 	/*
3926 	 * Atomic Compare/Swap. Allowed only on reliable connection (RC)
3927 	 * SQ's.
3928 	 */
3929 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS			UINT32_C(0x8)
3930 	/* Atomic Fetch/Add. Allowed only on reliable connection (RC) SQ's. */
3931 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA			UINT32_C(0xb)
3932 	uint8_t flags;
3933 	/*
3934 	 * Set if completion signaling is requested. If this bit is 0, and the
3935 	 * SQ is configured to support Unsignaled completion the controller
3936 	 * should not generate a CQE unless there was an error. This refer to
3937 	 * CQE on the sender side (se_flag refer to the receiver side)
3938 	 */
3939 	#define SQ_ATOMIC_FLAGS_SIGNAL_COMP			UINT32_C(0x1)
3940 	/*
3941 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
3942 	 * SQ before executing this WQE
3943 	 */
3944 	#define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE		UINT32_C(0x2)
3945 	/*
3946 	 * Unconditional fence. Indicate to complete all previous SQ's WQEs
3947 	 * before executing this WQE.
3948 	 */
3949 	#define SQ_ATOMIC_FLAGS_UC_FENCE			UINT32_C(0x4)
3950 	/*
3951 	 * Solicit event. Indication sent in BTH header to the receiver to
3952 	 * generate a Completion Event Notification, i.e. CNQE. This bit should
3953 	 * be set only in the last (or only) packet of the message.
3954 	 */
3955 	#define SQ_ATOMIC_FLAGS_SE				UINT32_C(0x8)
3956 	/* NA for this WQE. */
3957 	#define SQ_ATOMIC_FLAGS_INLINE				UINT32_C(0x10)
3958 	uint16_t reserved16;
3959 	uint32_t remote_key;
3960 	/*
3961 	 * R_Key provided by remote node when the connection was established and
3962 	 * placed in the AETH header. It identify the MRW on the remote host
3963 	 */
3964 	uint64_t remote_va;
3965 	/* Remote VA sent to the destination QP */
3966 	uint64_t swap_data;
3967 	/* Data value to be placed in remote host specified address */
3968 	uint64_t cmp_data;
3969 	/*
3970 	 * Data value to be compared with the value in the remote host specified
3971 	 * address
3972 	 */
3973 	uint32_t data[24];
3974 	/*
3975 	 * The first 16B of the data field must be filled with a single SGE.
3976 	 * This will be used to store the return value from the Atomic Ack
3977 	 * response. The size of the single SGE must be 8B.
3978 	 */
3979 } __attribute__((packed));
3980 
3981 /* Local Invalidate SQ WQE (40 bytes) */
3982 
3983 struct sq_localinvalidate {
3984 	uint8_t wqe_type;
3985 	/* This field defines the type of SQ WQE. */
3986 	/* Local Invalidate. Allowed only on reliable connection (RC) SQ's. */
3987 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID	UINT32_C(0xc)
3988 	uint8_t flags;
3989 	/*
3990 	 * Set if completion signaling is requested. If this bit is 0, and the
3991 	 * SQ is configured to support Unsignaled completion the controller
3992 	 * should not generate a CQE unless there was an error. This refer to
3993 	 * CQE on the sender side (se_flag refer to the receiver side)
3994 	 */
3995 	#define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
3996 	/*
3997 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
3998 	 * SQ before executing this WQE
3999 	 */
4000 	#define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
4001 	/*
4002 	 * Unconditional fence. Indicate to complete all previous SQ's WQEs
4003 	 * before executing this WQE.
4004 	 */
4005 	#define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE		UINT32_C(0x4)
4006 	/*
4007 	 * Solicit event. Indication sent in BTH header to the receiver to
4008 	 * generate a Completion Event Notification, i.e. CNQE. This bit should
4009 	 * be set only in the last (or only) packet of the message.
4010 	 */
4011 	#define SQ_LOCALINVALIDATE_FLAGS_SE			UINT32_C(0x8)
4012 	/* NA for this WQE */
4013 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE			UINT32_C(0x10)
4014 	uint16_t reserved16;
4015 	uint32_t inv_l_key;
4016 	/*
4017 	 * The local key for the MR/W to invalidate; 24 msb of the key are used
4018 	 * to index the MRW table, 8 lsb are compared with the 8 bit key in the
4019 	 * MRWC
4020 	 */
4021 	uint64_t reserved64;
4022 	uint32_t reserved128[4];
4023 	uint32_t data[24];
4024 	/* The data field for local invalidate is not used. */
4025 } __attribute__((packed));
4026 
4027 /* FR-PMR SQ WQE (40 bytes) */
4028 
4029 struct sq_fr_pmr {
4030 	uint8_t wqe_type;
4031 	/* This field defines the type of SQ WQE. */
4032 	/*
4033 	 * FR-PMR (Fast Register Physical Memory Region) Allowed only on
4034 	 * reliable connection (RC) SQ's.
4035 	 */
4036 	#define SQ_FR_PMR_WQE_TYPE_FR_PMR			UINT32_C(0xd)
4037 	uint8_t flags;
4038 	/*
4039 	 * Set if completion signaling is requested. If this bit is 0, and the
4040 	 * SQ is configured to support Unsignaled completion the controller
4041 	 * should not generate a CQE unless there was an error. This refer to
4042 	 * CQE on the sender side (se_flag refer to the receiver side)
4043 	 */
4044 	#define SQ_FR_PMR_FLAGS_SIGNAL_COMP			UINT32_C(0x1)
4045 	/*
4046 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
4047 	 * SQ before executing this WQE
4048 	 */
4049 	#define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE		UINT32_C(0x2)
4050 	/*
4051 	 * Unconditional fence. Indicate to complete all previous SQ's WQEs
4052 	 * before executing this WQE.
4053 	 */
4054 	#define SQ_FR_PMR_FLAGS_UC_FENCE			UINT32_C(0x4)
4055 	/* Not Applicable for FR_PMR. Nothing is sent */
4056 	#define SQ_FR_PMR_FLAGS_SE				UINT32_C(0x8)
4057 	/* NA. */
4058 	#define SQ_FR_PMR_FLAGS_INLINE				UINT32_C(0x10)
4059 	uint8_t access_cntl;
4060 	/*
4061 	 * This is the new access control for the MR. '1' means the operation is
4062 	 * allowed. '0' means operation is not allowed.
4063 	 */
4064 	/* Local Write Access */
4065 	#define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE		UINT32_C(0x1)
4066 	/* Remote Read Access */
4067 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ		UINT32_C(0x2)
4068 	/* Remote Write Access */
4069 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE		UINT32_C(0x4)
4070 	/* Remote Atomic Access */
4071 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC		UINT32_C(0x8)
4072 	/* Window Binding Allowed */
4073 	#define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND		UINT32_C(0x10)
4074 	uint8_t zero_based_page_size_log;
4075 	/* 0 for 4KB page size, ... to 8GB */
4076 	#define SQ_FR_PMR_PAGE_SIZE_LOG_MASK			UINT32_C(0x1f)
4077 	#define SQ_FR_PMR_PAGE_SIZE_LOG_SFT			0
4078 	/* Page size is 4KB. */
4079 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K		UINT32_C(0x0)
4080 	/* Page size is 8KB. */
4081 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K		UINT32_C(0x1)
4082 	/* Page size is 64KB. */
4083 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K		UINT32_C(0x4)
4084 	/* Page size is 256KB. */
4085 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K		UINT32_C(0x6)
4086 	/* Page size is 1MB. */
4087 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M		UINT32_C(0x8)
4088 	/* Page size is 2MB. */
4089 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M		UINT32_C(0x9)
4090 	/* Page size is 4MB. */
4091 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M		UINT32_C(0xa)
4092 	/* Page size is 1GB. */
4093 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G		UINT32_C(0x12)
4094 	/* Indicate the MR is ZBVA (Zero Base VA) */
4095 	#define SQ_FR_PMR_ZERO_BASED				UINT32_C(0x20)
4096 	#define SQ_FR_PMR_RESERVED2_MASK			UINT32_C(0xc0)
4097 	#define SQ_FR_PMR_RESERVED2_SFT				6
4098 	uint32_t l_key;
4099 	/*
4100 	 * Local Key; 24 msb of the key are used to index the MRW table, 8 lsb
4101 	 * are assigned to the 8 bit key_lsb field in the MRWC.
4102 	 */
4103 	uint8_t length[5];
4104 	/* Length in bytes of registered MR */
4105 	uint8_t reserved8_1;
4106 	uint8_t reserved8_2;
4107 	uint8_t numlevels_pbl_page_size_log;
4108 	/* Number of levels of PBL for translation */
4109 	/* PBL page size. 0 for 4KB page size. */
4110 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK		UINT32_C(0x1f)
4111 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT			0
4112 	/* Page size is 4KB. */
4113 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K		UINT32_C(0x0)
4114 	/* Page size is 8KB. */
4115 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K		UINT32_C(0x1)
4116 	/* Page size is 64KB. */
4117 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K		UINT32_C(0x4)
4118 	/* Page size is 256KB. */
4119 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K		UINT32_C(0x6)
4120 	/* Page size is 1MB. */
4121 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M		UINT32_C(0x8)
4122 	/* Page size is 2MB. */
4123 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M		UINT32_C(0x9)
4124 	/* Page size is 4MB. */
4125 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M		UINT32_C(0xa)
4126 	/* Page size is 1GB. */
4127 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G		UINT32_C(0x12)
4128 	#define SQ_FR_PMR_RESERVED1				UINT32_C(0x20)
4129 	/* Number of levels of PBL for translation */
4130 	#define SQ_FR_PMR_NUMLEVELS_MASK			UINT32_C(0xc0)
4131 	#define SQ_FR_PMR_NUMLEVELS_SFT				6
4132 	/*
4133 	 * A zero level PBL means that the VA is the physical address
4134 	 * used for the operation. No translation is done by the PTU.
4135 	 */
4136 	#define SQ_FR_PMR_NUMLEVELS_PHYSICAL			(UINT32_C(0x0) << 6)
4137 	/*
4138 	 * A one layer translation is provided between the logical and
4139 	 * physical address. The PBL points to a physical page that
4140 	 * contains PBE values that point to actual pg_size physical
4141 	 * pages.
4142 	 */
4143 	#define SQ_FR_PMR_NUMLEVELS_LAYER1			(UINT32_C(0x1) << 6)
4144 	/*
4145 	 * A two layer translation is provided between the logical and
4146 	 * physical address. The PBL points to a physical page that
4147 	 * contains PDE values that in turn point to pbl_pg_size
4148 	 * physical pages that contain PBE values that point to actual
4149 	 * physical pages.
4150 	 */
4151 	#define SQ_FR_PMR_NUMLEVELS_LAYER2			(UINT32_C(0x2) << 6)
4152 	uint64_t pblptr;
4153 	/* Pointer to the PBL, or PDL depending on number of levels */
4154 	uint64_t va;
4155 	/* Local Virtual Address */
4156 	uint32_t data[24];
4157 	/* The data field for FR-PRM is not used. */
4158 } __attribute__((packed));
4159 
4160 /* Bind SQ WQE (40 bytes) */
4161 
4162 struct sq_bind {
4163 	uint8_t wqe_type;
4164 	/* This field defines the type of SQ WQE. */
4165 	/* Memory Bind Allowed only on reliable connection (RC) SQ's. */
4166 	#define SQ_BIND_WQE_TYPE_BIND				UINT32_C(0xe)
4167 	uint8_t flags;
4168 	/*
4169 	 * Set if completion signaling is requested. If this bit is 0, and the
4170 	 * SQ is configured to support Unsignaled completion the controller
4171 	 * should not generate a CQE unless there was an error. This refer to
4172 	 * CQE on the sender side (se_flag refer to the receiver side)
4173 	 */
4174 	#define SQ_BIND_FLAGS_SIGNAL_COMP			UINT32_C(0x1)
4175 	/*
4176 	 * Indication to complete all previous RDMA Read or Atomic WQEs on the
4177 	 * SQ before executing this WQE
4178 	 */
4179 	#define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE		UINT32_C(0x2)
4180 	/*
4181 	 * Unconditional fence. Indicate to complete all previous SQ's WQEs
4182 	 * before executing this WQE.
4183 	 */
4184 	#define SQ_BIND_FLAGS_UC_FENCE				UINT32_C(0x4)
4185 	/* NA, nothing is sent. */
4186 	#define SQ_BIND_FLAGS_SE				UINT32_C(0x8)
4187 	/* NA */
4188 	#define SQ_BIND_FLAGS_INLINE				UINT32_C(0x10)
4189 	uint8_t access_cntl;
4190 	/*
4191 	 * This is the new access control for the MR. '1' means the operation is
4192 	 * allowed. '0' means operation is not allowed.
4193 	 */
4194 	/*
4195 	 * Local Write Access. Local accesses are never allowed for memory
4196 	 * windows, so this bit must always be zero in a bind WQE. If this bit
4197 	 * is ever set, the bind will fail with an errored completion.
4198 	 */
4199 	#define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE			UINT32_C(0x1)
4200 	/* Remote Read Access */
4201 	#define SQ_BIND_ACCESS_CNTL_REMOTE_READ			UINT32_C(0x2)
4202 	/*
4203 	 * Remote Write Access. Note that, if this bit is set, then the parent
4204 	 * region to which the window is being bound must allow local writes. If
4205 	 * this is not the case, then the bind will fail with an errored
4206 	 * completion.
4207 	 */
4208 	#define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE		UINT32_C(0x4)
4209 	/*
4210 	 * Remote Atomic Access. Note that, if this bit is set, then the parent
4211 	 * region to which the window is being bound must allow local writes. If
4212 	 * this is not the case, then the bind will fail with an errored
4213 	 * completion.
4214 	 */
4215 	#define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC		UINT32_C(0x8)
4216 	/*
4217 	 * Window Binding Allowed. It is never allowed to bind windows to
4218 	 * windows, so this bit must always be zero in a bind WQE. If this bit
4219 	 * is ever set, the bind will fail with an errored completion.
4220 	 */
4221 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND			UINT32_C(0x10)
4222 	uint8_t reserved8_1;
4223 	/* reserved8_1 is 8 b */
4224 	uint8_t mw_type_zero_based;
4225 	/*
4226 	 * If this bit is set, then the newly-bound memory window will be zero-
4227 	 * based. If clear, then the newly-bound memory window will be non-zero-
4228 	 * based.
4229 	 */
4230 	#define SQ_BIND_ZERO_BASED				UINT32_C(0x1)
4231 	/*
4232 	 * If type1 is specified, then this WQE performs a "bind memory window"
4233 	 * operation on a type1 window. If type2 is specified, then this WQE
4234 	 * performs a "post send bind memory window" operation on a type2
4235 	 * window. Note that the bind WQE cannot change the type of the memory
4236 	 * window. If a "bind memory window" operation is attempted on a memory
4237 	 * window that was allocated as type2, then the bind will fail with an
4238 	 * errored completion, as "bind memory window" is allowed only on type1
4239 	 * memory windows. Similarly, if a "post send bind memory window"
4240 	 * operation is attempted on a memory window that was allocated as
4241 	 * type1, then the bind will fail with an errored completions, as "post
4242 	 * send bind memory window" is allowed only on type2 memory windows.
4243 	 */
4244 	#define SQ_BIND_MW_TYPE					UINT32_C(0x2)
4245 	/* Type 1 Bind Memory Window */
4246 	#define SQ_BIND_MW_TYPE_TYPE1				(UINT32_C(0x0) << 1)
4247 	/* Type 2 Post Send Bind Memory Window */
4248 	#define SQ_BIND_MW_TYPE_TYPE2				(UINT32_C(0x1) << 1)
4249 	#define SQ_BIND_RESERVED6_MASK				UINT32_C(0xfc)
4250 	#define SQ_BIND_RESERVED6_SFT				2
4251 	uint8_t reserved8_2;
4252 	uint16_t reserved16;
4253 	uint32_t parent_l_key;
4254 	/*
4255 	 * The L_Key of the parent MR; 24 msb of the key are used to index the
4256 	 * MRW table, 8 lsb are compared with the 8 bit key in the MRWC.
4257 	 */
4258 	uint32_t l_key;
4259 	/*
4260 	 * Local Key; 24 msb of the key are used to index the memory window
4261 	 * being bound in the MRW table, 8 lsb are assign to the 8 bit key_lsb
4262 	 * field in the MRWC.
4263 	 */
4264 	uint64_t va;
4265 	/* Local Virtual Address */
4266 	uint8_t length[5];
4267 	/*
4268 	 * Length in bytes of registered MW; 40 bits as this is the max size of
4269 	 * an MR/W
4270 	 */
4271 	uint8_t data_reserved24[99];
4272 	/* The data field for Bind is not used. */
4273 	#define SQ_BIND_RESERVED24_MASK				UINT32_C(0xffffff00)
4274 	#define SQ_BIND_RESERVED24_SFT				8
4275 	/* The data field for Bind is not used. */
4276 	#define SQ_BIND_DATA_MASK				UINT32_C(0xffffffff)
4277 	#define SQ_BIND_DATA_SFT				0
4278 } __attribute__((packed));
4279 
4280 /* RQ/SRQ WQE Structures */
4281 /* Description: This is the RQ/SRQ WQE structure. */
4282 /* RQ/SRQ WQE (40 bytes) */
4283 
4284 struct rq_wqe {
4285 	uint8_t wqe_type;
4286 	/* wqe_type is 8 b */
4287 	/* RQ/SRQ WQE. This WQE is used for posting buffers on an RQ or SRQ. */
4288 	#define RQ_WQE_WQE_TYPE_RCV				UINT32_C(0x80)
4289 	uint8_t flags;
4290 	/* No flags supported for this WQE type. */
4291 	uint8_t wqe_size;
4292 	/*
4293 	 * Specify the total number 16B chunks that make up the valid portion of
4294 	 * the WQE. This includes the first chunk that is the WQE structure and
4295 	 * up to 6 SGE structures. While the valid area is defined by the
4296 	 * wqe_size field, the actual WQE size is fixed at 128B.
4297 	 */
4298 	uint8_t reserved8;
4299 	uint32_t reserved32;
4300 	uint64_t wr_id;
4301 	/*
4302 	 * Opaque value used by upper layer SW to identify the id of the WR
4303 	 * which generated the WQE. Used in CQE. Valid in the first SGE of an
4304 	 * SRQ WQE.
4305 	 */
4306 	#define RQ_WQE_WR_ID_MASK				UINT32_C(0xfffff)
4307 	#define RQ_WQE_WR_ID_SFT				0
4308 	#define RQ_WQE_RESERVED44_MASK				UINT32_C(0xfff00000)
4309 	#define RQ_WQE_RESERVED44_SFT				20
4310 	uint32_t reserved128[4];
4311 	uint32_t data[24];
4312 	/*
4313 	 * The data field for RQ WQE is filled with from 1 to 6 SGE structures
4314 	 * as defined by the wqe_size field.
4315 	 */
4316 } __attribute__((packed));
4317 
4318 /* CQ CQE Structures */
4319 /* Description: This is the Cutoff CQE structure. */
4320 /* Base CQE (32 bytes) */
4321 
4322 struct cq_base {
4323 	uint64_t reserved64_1;
4324 	uint64_t reserved64_2;
4325 	uint64_t reserved64_3;
4326 	uint8_t cqe_type_toggle;
4327 	/*
4328 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4329 	 * bit each time it finished consuming all PBL entries
4330 	 */
4331 	#define CQ_BASE_TOGGLE					UINT32_C(0x1)
4332 	/* This field defines the type of SQ WQE. */
4333 	#define CQ_BASE_CQE_TYPE_MASK				UINT32_C(0x1e)
4334 	#define CQ_BASE_CQE_TYPE_SFT				1
4335 	/*
4336 	 * Requester completion - This is used for both RC and UD SQ
4337 	 * completions.
4338 	 */
4339 	#define CQ_BASE_CQE_TYPE_REQ				(UINT32_C(0x0) << 1)
4340 	/*
4341 	 * Responder RC Completion - This is used for both RQ and SRQ
4342 	 * completions for RC service QPs.
4343 	 */
4344 	#define CQ_BASE_CQE_TYPE_RES_RC			(UINT32_C(0x1) << 1)
4345 	/*
4346 	 * Responder UD Completion - This is used for both RQ and SRQ
4347 	 * completion for UD service QPs.
4348 	 */
4349 	#define CQ_BASE_CQE_TYPE_RES_UD			(UINT32_C(0x2) << 1)
4350 	/*
4351 	 * Responder RawEth and QP1 Completion - This is used for RQ
4352 	 * completion for RawEth service and QP1 service QPs.
4353 	 */
4354 	#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1		(UINT32_C(0x3) << 1)
4355 	/*
4356 	 * Terminal completion - This is used to indicate that no
4357 	 * further completions will be made for this QP on this CQ.
4358 	 */
4359 	#define CQ_BASE_CQE_TYPE_TERMINAL			(UINT32_C(0xe) << 1)
4360 	/* Cut off CQE; for CQ resize see CQ and SRQ Resize */
4361 	#define CQ_BASE_CQE_TYPE_CUT_OFF			(UINT32_C(0xf) << 1)
4362 	#define CQ_BASE_RESERVED3_MASK				UINT32_C(0xe0)
4363 	#define CQ_BASE_RESERVED3_SFT				5
4364 	uint8_t status;
4365 	/* This field indicates the status for the CQE. */
4366 	uint16_t reserved16;
4367 	uint32_t reserved32;
4368 } __attribute__((packed));
4369 
4370 /* Requester CQ CQE (32 bytes) */
4371 
4372 struct cq_req {
4373 	uint64_t qp_handle;
4374 	/*
4375 	 * This is an application level ID used to identify the QP and its SQ
4376 	 * and RQ.
4377 	 */
4378 	uint16_t sq_cons_idx;
4379 	/*
4380 	 * SQ Consumer Index - points to the entry just past the last WQE that
4381 	 * has been completed by the chip. Wraps around at QPC.sq_size (i.e. the
4382 	 * valid range of the SQ Consumer Index is 0 to (QPC.sq_size - 1)).
4383 	 */
4384 	uint16_t reserved16_1;
4385 	uint32_t reserved32_2;
4386 	uint64_t reserved64;
4387 	uint8_t cqe_type_toggle;
4388 	/*
4389 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4390 	 * bit each time it finished consuming all PBL entries
4391 	 */
4392 	#define CQ_REQ_TOGGLE					UINT32_C(0x1)
4393 	/* This field defines the type of SQ WQE. */
4394 	#define CQ_REQ_CQE_TYPE_MASK				UINT32_C(0x1e)
4395 	#define CQ_REQ_CQE_TYPE_SFT				1
4396 	/*
4397 	 * Requester completion - This is used for both RC and UD SQ
4398 	 * completions.
4399 	 */
4400 	#define CQ_REQ_CQE_TYPE_REQ				(UINT32_C(0x0) << 1)
4401 	#define CQ_REQ_RESERVED3_MASK				UINT32_C(0xe0)
4402 	#define CQ_REQ_RESERVED3_SFT				5
4403 	uint8_t status;
4404 	/* This field indicates the status for the CQE. */
4405 	/* OK is 0 */
4406 	#define CQ_REQ_STATUS_OK				UINT32_C(0x0)
4407 	/* BAD_RESPONSE_ERR is 1 */
4408 	#define CQ_REQ_STATUS_BAD_RESPONSE_ERR			UINT32_C(0x1)
4409 	/* LOCAL_LENGTH_ERR is 2 */
4410 	#define CQ_REQ_STATUS_LOCAL_LENGTH_ERR			UINT32_C(0x2)
4411 	/* LOCAL_QP_OPERATION_ERR is 3 */
4412 	#define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR		UINT32_C(0x3)
4413 	/* LOCAL_PROTECTION_ERR is 4 */
4414 	#define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR		UINT32_C(0x4)
4415 	/* MEMORY_MGT_OPERATION_ERR is 5 */
4416 	#define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR		UINT32_C(0x5)
4417 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
4418 	#define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR	UINT32_C(0x6)
4419 	/* REMOTE_ACCESS_ERR is 7 */
4420 	#define CQ_REQ_STATUS_REMOTE_ACCESS_ERR		UINT32_C(0x7)
4421 	/* REMOTE_OPERATION_ERR is 8 */
4422 	#define CQ_REQ_STATUS_REMOTE_OPERATION_ERR		UINT32_C(0x8)
4423 	/* RNR_NAK_RETRY_CNT_ERR is 9 */
4424 	#define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR		UINT32_C(0x9)
4425 	/* TRANSPORT_RETRY_CNT_ERR is 10 */
4426 	#define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR		UINT32_C(0xa)
4427 	/* WORK_REQUEST_FLUSHED_ERR is 11 */
4428 	#define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR		UINT32_C(0xb)
4429 	uint16_t reserved16_2;
4430 	uint32_t reserved32_1;
4431 } __attribute__((packed));
4432 
4433 /* Responder RC CQE (32 bytes) */
4434 
4435 struct cq_res_rc {
4436 	uint32_t length;
4437 	/* The length of the message's payload in bytes, stored in the SGEs */
4438 	uint32_t imm_data_or_inv_r_key;
4439 	/*
4440 	 * Immediate data in case the imm_flag set, R_Key to be invalidated in
4441 	 * case inv_flag is set.
4442 	 */
4443 	uint64_t qp_handle;
4444 	/*
4445 	 * This is an application level ID used to identify the QP and its SQ
4446 	 * and RQ.
4447 	 */
4448 	uint64_t mr_handle;
4449 	/*
4450 	 * Opaque value - valid when inv_flag is set. Used by driver to
4451 	 * reference the buffer used to store PBL when the MR was fast
4452 	 * registered. The driver can reclaim this buffer after an MR was
4453 	 * remotely invalidated. The controller take that value from the MR
4454 	 * referenced by R_Key
4455 	 */
4456 	uint8_t cqe_type_toggle;
4457 	/*
4458 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4459 	 * bit each time it finished consuming all PBL entries
4460 	 */
4461 	#define CQ_RES_RC_TOGGLE				UINT32_C(0x1)
4462 	/* This field defines the type of SQ WQE. */
4463 	#define CQ_RES_RC_CQE_TYPE_MASK				UINT32_C(0x1e)
4464 	#define CQ_RES_RC_CQE_TYPE_SFT				1
4465 	/*
4466 	 * Responder RC Completion - This is used for both RQ and SRQ
4467 	 * completions for RC service QPs.
4468 	 */
4469 	#define CQ_RES_RC_CQE_TYPE_RES_RC			(UINT32_C(0x1) << 1)
4470 	#define CQ_RES_RC_RESERVED3_MASK			UINT32_C(0xe0)
4471 	#define CQ_RES_RC_RESERVED3_SFT				5
4472 	uint8_t status;
4473 	/* This field indicates the status for the CQE. */
4474 	/* OK is 0 */
4475 	#define CQ_RES_RC_STATUS_OK				UINT32_C(0x0)
4476 	/* LOCAL_ACCESS_ERROR is 1 */
4477 	#define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR		UINT32_C(0x1)
4478 	/* LOCAL_LENGTH_ERR is 2 */
4479 	#define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR		UINT32_C(0x2)
4480 	/* LOCAL_PROTECTION_ERR is 3 */
4481 	#define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR		UINT32_C(0x3)
4482 	/* LOCAL_QP_OPERATION_ERR is 4 */
4483 	#define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
4484 	/* MEMORY_MGT_OPERATION_ERR is 5 */
4485 	#define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR	UINT32_C(0x5)
4486 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
4487 	#define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR	UINT32_C(0x6)
4488 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
4489 	#define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR	UINT32_C(0x7)
4490 	/* HW_FLUSH_ERR is 8 */
4491 	#define CQ_RES_RC_STATUS_HW_FLUSH_ERR			UINT32_C(0x8)
4492 	uint16_t flags;
4493 	/*
4494 	 * This flag indicates that the completion is for a SRQ entry rather
4495 	 * than for an RQ entry.
4496 	 */
4497 	#define CQ_RES_RC_FLAGS_SRQ				UINT32_C(0x1)
4498 	/* CQE relates to RQ WQE. */
4499 	#define CQ_RES_RC_FLAGS_SRQ_RQ				(UINT32_C(0x0) << 0)
4500 	/* CQE relates to SRQ WQE. */
4501 	#define CQ_RES_RC_FLAGS_SRQ_SRQ			(UINT32_C(0x1) << 0)
4502 	#define CQ_RES_RC_FLAGS_SRQ_LAST	CQ_RES_RC_FLAGS_SRQ_SRQ
4503 	/* Immediate data indicator */
4504 	#define CQ_RES_RC_FLAGS_IMM				UINT32_C(0x2)
4505 	/* R_Key invalidate indicator */
4506 	#define CQ_RES_RC_FLAGS_INV				UINT32_C(0x4)
4507 	#define CQ_RES_RC_FLAGS_RDMA				UINT32_C(0x8)
4508 	/* CQE relates to an incoming Send request */
4509 	#define CQ_RES_RC_FLAGS_RDMA_SEND			(UINT32_C(0x0) << 3)
4510 	/* CQE relates to incoming RDMA Write request */
4511 	#define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE		(UINT32_C(0x1) << 3)
4512 	#define CQ_RES_RC_FLAGS_RDMA_LAST	CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
4513 	uint32_t srq_or_rq_wr_id;
4514 	/*
4515 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to reference the
4516 	 * WQE in order to claim the received data and reuse the WQE space
4517 	 */
4518 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK			UINT32_C(0xfffff)
4519 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT			0
4520 	#define CQ_RES_RC_RESERVED12_MASK			UINT32_C(0xfff00000)
4521 	#define CQ_RES_RC_RESERVED12_SFT			20
4522 } __attribute__((packed));
4523 
4524 /* Responder UD CQE (32 bytes) */
4525 
4526 struct cq_res_ud {
4527 	uint32_t length;
4528 	/* The length of the message's payload in bytes, stored in the SGEs */
4529 	#define CQ_RES_UD_LENGTH_MASK				UINT32_C(0x3fff)
4530 	#define CQ_RES_UD_LENGTH_SFT				0
4531 	#define CQ_RES_UD_RESERVED18_MASK			UINT32_C(0xffffc000)
4532 	#define CQ_RES_UD_RESERVED18_SFT			14
4533 	uint32_t imm_data;
4534 	/* Immediate data in case the imm_flag set. */
4535 	uint64_t qp_handle;
4536 	/*
4537 	 * This is an application level ID used to identify the QP and its SQ
4538 	 * and RQ.
4539 	 */
4540 	uint16_t src_mac[3];
4541 	/*
4542 	 * Source MAC address for the UD message placed in the WQE that is
4543 	 * completed by this CQE.
4544 	 */
4545 	uint16_t src_qp_low;
4546 	/* Lower 16b of the Source QP value from the DETH header. */
4547 	uint8_t cqe_type_toggle;
4548 	/*
4549 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4550 	 * bit each time it finished consuming all PBL entries
4551 	 */
4552 	#define CQ_RES_UD_TOGGLE				UINT32_C(0x1)
4553 	/* This field defines the type of SQ WQE. */
4554 	#define CQ_RES_UD_CQE_TYPE_MASK				UINT32_C(0x1e)
4555 	#define CQ_RES_UD_CQE_TYPE_SFT				1
4556 	/*
4557 	 * Responder UD Completion - This is used for both RQ and SRQ
4558 	 * completion for UD service QPs.
4559 	 */
4560 	#define CQ_RES_UD_CQE_TYPE_RES_UD			(UINT32_C(0x2) << 1)
4561 	#define CQ_RES_UD_RESERVED3_MASK			UINT32_C(0xe0)
4562 	#define CQ_RES_UD_RESERVED3_SFT				5
4563 	uint8_t status;
4564 	/* This field indicates the status for the CQE. */
4565 	/*
4566 	 * This indicates that the completion is without error. All
4567 	 * fields are valid.
4568 	 */
4569 	#define CQ_RES_UD_STATUS_OK				UINT32_C(0x0)
4570 	/*
4571 	 * This indicates that write access was not allowed for at least
4572 	 * one of the SGEs in the WQE. This is a fatal error. Only the
4573 	 * srq_or_rq_wr_id is field is valid.
4574 	 */
4575 	#define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR		UINT32_C(0x1)
4576 	/*
4577 	 * This indicates that the packet was too long for the WQE
4578 	 * provided on the SRQ/RQ. This is not a fatal error. All the
4579 	 * fields are valid.
4580 	 */
4581 	#define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR		UINT32_C(0x2)
4582 	/* LOCAL_PROTECTION_ERR is 3 */
4583 	#define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR		UINT32_C(0x3)
4584 	/* LOCAL_QP_OPERATION_ERR is 4 */
4585 	#define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
4586 	/* MEMORY_MGT_OPERATION_ERR is 5 */
4587 	#define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR	UINT32_C(0x5)
4588 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
4589 	#define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR	UINT32_C(0x7)
4590 	/* HW_FLUSH_ERR is 8 */
4591 	#define CQ_RES_UD_STATUS_HW_FLUSH_ERR			UINT32_C(0x8)
4592 	uint16_t flags;
4593 	/*
4594 	 * This flag indicates that the completion is for a SRQ entry rather
4595 	 * than for an RQ entry.
4596 	 */
4597 	#define CQ_RES_UD_FLAGS_SRQ				UINT32_C(0x1)
4598 	/* CQE relates to RQ WQE. */
4599 	#define CQ_RES_UD_FLAGS_SRQ_RQ				(UINT32_C(0x0) << 0)
4600 	/* CQE relates to SRQ WQE. */
4601 	#define CQ_RES_UD_FLAGS_SRQ_SRQ			(UINT32_C(0x1) << 0)
4602 	#define CQ_RES_UD_FLAGS_SRQ_LAST	CQ_RES_UD_FLAGS_SRQ_SRQ
4603 	/* Immediate data indicator */
4604 	#define CQ_RES_UD_FLAGS_IMM				UINT32_C(0x2)
4605 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK		UINT32_C(0xc)
4606 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT			2
4607 	/* RoCEv1 Message */
4608 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1			(UINT32_C(0x0) << 2)
4609 	/* RoCEv2 IPv4 Message */
4610 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4		(UINT32_C(0x2) << 2)
4611 	/* RoCEv2 IPv6 Message */
4612 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6		(UINT32_C(0x3) << 2)
4613 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
4614 	uint32_t src_qp_high_srq_or_rq_wr_id;
4615 	/* Upper 8b of the Source QP value from the DETH header. */
4616 	/*
4617 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to reference the
4618 	 * WQE in order to claim the received data and reuse the WQE space
4619 	 */
4620 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK			UINT32_C(0xfffff)
4621 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT			0
4622 	#define CQ_RES_UD_RESERVED4_MASK			UINT32_C(0xf00000)
4623 	#define CQ_RES_UD_RESERVED4_SFT				20
4624 	/* Upper 8b of the Source QP value from the DETH header. */
4625 	#define CQ_RES_UD_SRC_QP_HIGH_MASK			UINT32_C(0xff000000)
4626 	#define CQ_RES_UD_SRC_QP_HIGH_SFT			24
4627 } __attribute__((packed));
4628 
4629 /* Responder RawEth and QP1 CQE (32 bytes) */
4630 
4631 struct cq_res_raweth_qp1 {
4632 	uint16_t length;
4633 	/* The length of the message's payload in bytes, stored in the SGEs */
4634 	#define CQ_RES_RAWETH_QP1_LENGTH_MASK			UINT32_C(0x3fff)
4635 	#define CQ_RES_RAWETH_QP1_LENGTH_SFT			0
4636 	#define CQ_RES_RAWETH_QP1_RESERVED2_MASK		UINT32_C(0xc000)
4637 	#define CQ_RES_RAWETH_QP1_RESERVED2_SFT			14
4638 	uint16_t raweth_qp1_flags;
4639 	/*
4640 	 * When this bit is '1', it indicates a packet that has an error of some
4641 	 * type. Type of error is indicated in raweth_qp1_errors.
4642 	 */
4643 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR	UINT32_C(0x1)
4644 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_MASK UINT32_C(0x3e)
4645 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_RESERVED5_1_SFT 1
4646 	/*
4647 	 * This value indicates what the inner packet determined for the packet
4648 	 * was.
4649 	 */
4650 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK	UINT32_C(0x3c0)
4651 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT	6
4652 	/* Not Known: Indicates that the packet type was not known. */
4653 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 6)
4654 	/*
4655 	 * IP Packet: Indicates that the packet was an IP packet, but
4656 	 * further classification was not possible.
4657 	 */
4658 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP	(UINT32_C(0x1) << 6)
4659 	/*
4660 	 * TCP Packet: Indicates that the packet was IP and TCP. This
4661 	 * indicates that the raweth_qp1_payload_offset field is valid.
4662 	 */
4663 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP	(UINT32_C(0x2) << 6)
4664 	/*
4665 	 * UDP Packet: Indicates that the packet was IP and UDP. This
4666 	 * indicates that the raweth_qp1_payload_offset field is valid.
4667 	 */
4668 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP	(UINT32_C(0x3) << 6)
4669 	/*
4670 	 * FCoE Packet: Indicates that the packet was recognized as a
4671 	 * FCoE. This also indicates that the raweth_qp1_payload_offset
4672 	 * field is valid.
4673 	 */
4674 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE	(UINT32_C(0x4) << 6)
4675 	/*
4676 	 * RoCE Packet: Indicates that the packet was recognized as a
4677 	 * RoCE. This also indicates that the raweth_qp1_payload_offset
4678 	 * field is valid.
4679 	 */
4680 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE	(UINT32_C(0x5) << 6)
4681 	/*
4682 	 * ICMP Packet: Indicates that the packet was recognized as
4683 	 * ICMP. This indicates that the raweth_qp1_payload_offset field
4684 	 * is valid.
4685 	 */
4686 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP	(UINT32_C(0x7) << 6)
4687 	/*
4688 	 * PtP packet wo/timestamp: Indicates that the packet was
4689 	 * recognized as a PtP packet.
4690 	 */
4691 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 6)
4692 	/*
4693 	 * PtP packet w/timestamp: Indicates that the packet was
4694 	 * recognized as a PtP packet and that a timestamp was taken for
4695 	 * the packet.
4696 	 */
4697 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 6)
4698 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST	CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
4699 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK		UINT32_C(0x3ff)
4700 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT		0
4701 	#define CQ_RES_RAWETH_QP1_RESERVED6_MASK		UINT32_C(0xfc00)
4702 	#define CQ_RES_RAWETH_QP1_RESERVED6_SFT			10
4703 	uint16_t raweth_qp1_errors;
4704 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_MASK UINT32_C(0xf)
4705 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_RESERVED4_SFT  0
4706 	/* This indicates that there was an error in the IP header checksum. */
4707 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR	UINT32_C(0x10)
4708 	/*
4709 	 * This indicates that there was an error in the TCP, UDP or ICMP
4710 	 * checksum.
4711 	 */
4712 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR	UINT32_C(0x20)
4713 	/*
4714 	 * This indicates that there was an error in the tunnel IP header
4715 	 * checksum.
4716 	 */
4717 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR  UINT32_C(0x40)
4718 	/* This indicates that there was an error in the tunnel UDP checksum. */
4719 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR  UINT32_C(0x80)
4720 	/*
4721 	 * This indicates that there was a CRC error on either an FCoE or RoCE
4722 	 * packet. The itype indicates the packet type.
4723 	 */
4724 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR	UINT32_C(0x100)
4725 	/*
4726 	 * This indicates that there was an error in the tunnel portion of the
4727 	 * packet when this field is non-zero.
4728 	 */
4729 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
4730 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT 9
4731 	/*
4732 	 * No additional error occurred on the tunnel portion of the
4733 	 * packet of the packet does not have a tunnel.
4734 	 */
4735 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
4736 	/*
4737 	 * Indicates that IP header version does not match expectation
4738 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
4739 	 */
4740 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (UINT32_C(0x1) << 9)
4741 	/*
4742 	 * Indicates that header length is out of range in the tunnel
4743 	 * header. Valid for IPv4.
4744 	 */
4745 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (UINT32_C(0x2) << 9)
4746 	/*
4747 	 * Indicates that the physical packet is shorter than that
4748 	 * claimed by the PPPoE header length for a tunnel PPPoE packet.
4749 	 */
4750 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (UINT32_C(0x3) << 9)
4751 	/*
4752 	 * Indicates that physical packet is shorter than that claimed
4753 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
4754 	 * tunnel packet packets.
4755 	 */
4756 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (UINT32_C(0x4) << 9)
4757 	/*
4758 	 * Indicates that the physical packet is shorter than that
4759 	 * claimed by the tunnel UDP header length for a tunnel UDP
4760 	 * packet that is not fragmented.
4761 	 */
4762 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (UINT32_C(0x5) << 9)
4763 	/*
4764 	 * indicates that the IPv4 TTL or IPv6 hop limit check have
4765 	 * failed (e.g. TTL = 0) in the tunnel header. Valid for IPv4,
4766 	 * and IPv6.
4767 	 */
4768 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (UINT32_C(0x6) << 9)
4769 	#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
4770 	/*
4771 	 * This indicates that there was an error in the inner portion of the
4772 	 * packet when this field is non-zero.
4773 	 */
4774 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
4775 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT  12
4776 	/*
4777 	 * No additional error occurred on the tunnel portion of the
4778 	 * packet of the packet does not have a tunnel.
4779 	 */
4780 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
4781 	/*
4782 	 * Indicates that IP header version does not match expectation
4783 	 * from L2 Ethertype for IPv4 and IPv6 or that option other than
4784 	 * VFT was parsed on FCoE packet.
4785 	 */
4786 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION (UINT32_C(0x1) << 12)
4787 	/*
4788 	 * indicates that header length is out of range. Valid for IPv4
4789 	 * and RoCE
4790 	 */
4791 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN (UINT32_C(0x2) << 12)
4792 	/*
4793 	 * indicates that the IPv4 TTL or IPv6 hop limit check have
4794 	 * failed (e.g. TTL = 0). Valid for IPv4, and IPv6
4795 	 */
4796 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
4797 	/*
4798 	 * Indicates that physical packet is shorter than that claimed
4799 	 * by the l3 header length. Valid for IPv4, IPv6 packet or RoCE
4800 	 * packets.
4801 	 */
4802 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR (UINT32_C(0x4) << 12)
4803 	/*
4804 	 * Indicates that the physical packet is shorter than that
4805 	 * claimed by the UDP header length for a UDP packet that is not
4806 	 * fragmented.
4807 	 */
4808 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (UINT32_C(0x5) << 12)
4809 	/*
4810 	 * Indicates that TCP header length > IP payload. Valid for TCP
4811 	 * packets only.
4812 	 */
4813 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN (UINT32_C(0x6) << 12)
4814 	/* Indicates that TCP header length < 5. Valid for TCP. */
4815 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (UINT32_C(0x7) << 12)
4816 	/*
4817 	 * Indicates that TCP option headers result in a TCP header size
4818 	 * that does not match data offset in TCP header. Valid for TCP.
4819 	 */
4820 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (UINT32_C(0x8) << 12)
4821 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST	CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4822 	uint16_t raweth_qp1_cfa_code;
4823 	/*
4824 	 * This field identifies the CFA action rule that was used for this
4825 	 * packet.
4826 	 */
4827 	uint64_t qp_handle;
4828 	/*
4829 	 * This is an application level ID used to identify the QP and its SQ
4830 	 * and RQ.
4831 	 */
4832 	uint32_t raweth_qp1_flags2;
4833 	/*
4834 	 * This indicates that the ip checksum was calculated for the inner
4835 	 * packet and that the ip_cs_error field indicates if there was an
4836 	 * error.
4837 	 */
4838 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC	UINT32_C(0x1)
4839 	/*
4840 	 * This indicates that the TCP, UDP or ICMP checksum was calculated for
4841 	 * the inner packet and that the l4_cs_error field indicates if there
4842 	 * was an error.
4843 	 */
4844 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC	UINT32_C(0x2)
4845 	/*
4846 	 * This indicates that the ip checksum was calculated for the tunnel
4847 	 * header and that the t_ip_cs_error field indicates if there was an
4848 	 * error.
4849 	 */
4850 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC   UINT32_C(0x4)
4851 	/*
4852 	 * This indicates that the UDP checksum was calculated for the tunnel
4853 	 * packet and that the t_l4_cs_error field indicates if there was an
4854 	 * error.
4855 	 */
4856 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC   UINT32_C(0x8)
4857 	/* This value indicates what format the raweth_qp1_metadata field is. */
4858 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
4859 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT 4
4860 	/* No metadata information. Value is zero. */
4861 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
4862 	/*
4863 	 * The raweth_qp1_metadata field contains the VLAN tag and TPID
4864 	 * value. - raweth_qp1_metadata[11:0] contains the vlan VID
4865 	 * value. - raweth_qp1_metadata[12] contains the vlan DE value.
4866 	 * - raweth_qp1_metadata[15:13] contains the vlan PRI value. -
4867 	 * raweth_qp1_metadata[31:16] contains the vlan TPID value.
4868 	 */
4869 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
4870 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST	CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN
4871 	/*
4872 	 * This field indicates the IP type for the inner-most IP header. A
4873 	 * value of '0' indicates IPv4. A value of '1' indicates IPv6. This
4874 	 * value is only valid if itype indicates a packet with an IP header.
4875 	 */
4876 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE	UINT32_C(0x100)
4877 	uint32_t raweth_qp1_metadata;
4878 	/*
4879 	 * This is data from the CFA block as indicated by the meta_format
4880 	 * field.
4881 	 */
4882 	/* When meta_format=1, this value is the VLAN VID. */
4883 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK	UINT32_C(0xfff)
4884 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT	0
4885 	/* When meta_format=1, this value is the VLAN DE. */
4886 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE	UINT32_C(0x1000)
4887 	/* When meta_format=1, this value is the VLAN PRI. */
4888 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK	UINT32_C(0xe000)
4889 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT	13
4890 	/* When meta_format=1, this value is the VLAN TPID. */
4891 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK	UINT32_C(0xffff0000)
4892 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT	16
4893 	uint8_t cqe_type_toggle;
4894 	/*
4895 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4896 	 * bit each time it finished consuming all PBL entries
4897 	 */
4898 	#define CQ_RES_RAWETH_QP1_TOGGLE			UINT32_C(0x1)
4899 	/* This field defines the type of SQ WQE. */
4900 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK			UINT32_C(0x1e)
4901 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT			1
4902 	/*
4903 	 * Responder RawEth and QP1 Completion - This is used for RQ
4904 	 * completion for RawEth service and QP1 service QPs.
4905 	 */
4906 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1	(UINT32_C(0x3) << 1)
4907 	#define CQ_RES_RAWETH_QP1_RESERVED3_MASK		UINT32_C(0xe0)
4908 	#define CQ_RES_RAWETH_QP1_RESERVED3_SFT			5
4909 	uint8_t status;
4910 	/* This field indicates the status for the CQE. */
4911 	/*
4912 	 * This indicates that the completion is without error. All
4913 	 * fields are valid.
4914 	 */
4915 	#define CQ_RES_RAWETH_QP1_STATUS_OK			UINT32_C(0x0)
4916 	/*
4917 	 * This indicates that write access was not allowed for at least
4918 	 * one of the SGEs in the WQE. This is a fatal error. Only the
4919 	 * srq_or_rq_wr_id is field is valid.
4920 	 */
4921 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
4922 	/*
4923 	 * This indicates that the packet was too long for the WQE
4924 	 * provided on the RQ. This is not a fatal error. All the fields
4925 	 * are valid.
4926 	 */
4927 	#define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
4928 	/* LOCAL_PROTECTION_ERR is 3 */
4929 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
4930 	/* LOCAL_QP_OPERATION_ERR is 4 */
4931 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
4932 	/* MEMORY_MGT_OPERATION_ERR is 5 */
4933 	#define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
4934 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
4935 	#define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
4936 	/* HW_FLUSH_ERR is 8 */
4937 	#define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
4938 	uint16_t flags;
4939 	/*
4940 	 * This flag indicates that the completion is for a SRQ entry rather
4941 	 * than for an RQ entry.
4942 	 */
4943 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ			UINT32_C(0x1)
4944 	/* CQE relates to RQ WQE. */
4945 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ			UINT32_C(0x0)
4946 	/* CQE relates to SRQ WQE. */
4947 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ		UINT32_C(0x1)
4948 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST	CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
4949 	uint32_t raweth_qp1_payload_offset_srq_or_rq_wr_id;
4950 	/*
4951 	 * This value indicates the offset in bytes from the beginning of the
4952 	 * packet where the inner payload starts. This value is valid for TCP,
4953 	 * UDP, FCoE, and RoCE packets. A value of zero indicates an offset of
4954 	 * 256 bytes.
4955 	 */
4956 	/*
4957 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to reference the
4958 	 * WQE in order to claim the received data and reuse the WQE space
4959 	 */
4960 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK		UINT32_C(0xfffff)
4961 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT		0
4962 	#define CQ_RES_RAWETH_QP1_RESERVED4_MASK		UINT32_C(0xf00000)
4963 	#define CQ_RES_RAWETH_QP1_RESERVED4_SFT			20
4964 	/*
4965 	 * This value indicates the offset in bytes from the beginning of the
4966 	 * packet where the inner payload starts. This value is valid for TCP,
4967 	 * UDP, FCoE, and RoCE packets. A value of zero indicates an offset of
4968 	 * 256 bytes.
4969 	 */
4970 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK   UINT32_C(0xff000000)
4971 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT	24
4972 } __attribute__((packed));
4973 
4974 /* Terminal CQE (32 bytes) */
4975 
4976 struct cq_terminal {
4977 	uint64_t qp_handle;
4978 	/*
4979 	 * This is an application level ID used to identify the QP and its SQ
4980 	 * and RQ.
4981 	 */
4982 	uint16_t sq_cons_idx;
4983 	/*
4984 	 * Final SQ Consumer Index value. Any additional SQ WQEs will have to be
4985 	 * completed by the user provider.
4986 	 */
4987 	uint16_t rq_cons_idx;
4988 	/*
4989 	 * Final RQ Consumer Index value. Any additional RQ WQEs will have to be
4990 	 * completed by the user provider.
4991 	 */
4992 	uint32_t reserved32_1;
4993 	uint64_t reserved64_3;
4994 	uint8_t cqe_type_toggle;
4995 	/*
4996 	 * Indicate valid completion - written by the chip. Cumulus toggle this
4997 	 * bit each time it finished consuming all PBL entries
4998 	 */
4999 	#define CQ_TERMINAL_TOGGLE				UINT32_C(0x1)
5000 	/* This field defines the type of SQ WQE. */
5001 	#define CQ_TERMINAL_CQE_TYPE_MASK			UINT32_C(0x1e)
5002 	#define CQ_TERMINAL_CQE_TYPE_SFT			1
5003 	/*
5004 	 * Terminal completion - This is used to indicate that no
5005 	 * further completions will be made for this QP on this CQ.
5006 	 */
5007 	#define CQ_TERMINAL_CQE_TYPE_TERMINAL			(UINT32_C(0xe) << 1)
5008 	#define CQ_TERMINAL_RESERVED3_MASK			UINT32_C(0xe0)
5009 	#define CQ_TERMINAL_RESERVED3_SFT			5
5010 	uint8_t status;
5011 	/* This field indicates the status for the CQE. */
5012 	/* OK is 0 */
5013 	#define CQ_TERMINAL_STATUS_OK				UINT32_C(0x0)
5014 	uint16_t reserved16;
5015 	uint32_t reserved32_2;
5016 } __attribute__((packed));
5017 
5018 /* Cutoff CQE (32 bytes) */
5019 
5020 struct cq_cutoff {
5021 	uint64_t reserved64_1;
5022 	uint64_t reserved64_2;
5023 	uint64_t reserved64_3;
5024 	uint8_t cqe_type_toggle;
5025 	/*
5026 	 * Indicate valid completion - written by the chip. Cumulus toggle this
5027 	 * bit each time it finished consuming all PBL entries
5028 	 */
5029 	#define CQ_CUTOFF_TOGGLE				UINT32_C(0x1)
5030 	/* This field defines the type of SQ WQE. */
5031 	#define CQ_CUTOFF_CQE_TYPE_MASK				UINT32_C(0x1e)
5032 	#define CQ_CUTOFF_CQE_TYPE_SFT				1
5033 	/* Cut off CQE; for CQ resize see CQ and SRQ Resize */
5034 	#define CQ_CUTOFF_CQE_TYPE_CUT_OFF			(UINT32_C(0xf) << 1)
5035 	#define CQ_CUTOFF_RESERVED3_MASK			UINT32_C(0xe0)
5036 	#define CQ_CUTOFF_RESERVED3_SFT				5
5037 	uint8_t status;
5038 	/* This field indicates the status for the CQE. */
5039 	/* OK is 0 */
5040 	#define CQ_CUTOFF_STATUS_OK				UINT32_C(0x0)
5041 	uint16_t reserved16;
5042 	uint32_t reserved32;
5043 } __attribute__((packed));
5044 
5045 /* Notification Queue (NQ) Structures */
5046 /*
5047  * Description: This completion indicates that the DBQ has reached the
5048  * programmed threshold value.
5049  */
5050 /* Base NQ Record (16 bytes) */
5051 
5052 struct nq_base {
5053 	uint16_t info10_type;
5054 	/* info10 is 10 b */
5055 	/*
5056 	 * This field indicates the exact type of the completion. By convention,
5057 	 * the LSB identifies the length of the record in 16B units. Even values
5058 	 * indicate 16B records. Odd values indicate 32B records.
5059 	 */
5060 	#define NQ_BASE_TYPE_MASK				UINT32_C(0x3f)
5061 	#define NQ_BASE_TYPE_SFT				0
5062 	/* CQ Notification */
5063 	#define NQ_BASE_TYPE_CQ_NOTIFICATION			UINT32_C(0x30)
5064 	/* SRQ Threshold Event */
5065 	#define NQ_BASE_TYPE_SRQ_EVENT				UINT32_C(0x32)
5066 	/* DBQ Threshold Event */
5067 	#define NQ_BASE_TYPE_DBQ_EVENT				UINT32_C(0x34)
5068 	/* QP Async Notification */
5069 	#define NQ_BASE_TYPE_QP_EVENT				UINT32_C(0x38)
5070 	/* Function Async Notification */
5071 	#define NQ_BASE_TYPE_FUNC_EVENT			UINT32_C(0x3a)
5072 	/* info10 is 10 b */
5073 	#define NQ_BASE_INFO10_MASK				UINT32_C(0xffc0)
5074 	#define NQ_BASE_INFO10_SFT				6
5075 	uint16_t info16;
5076 	/* info16 is 16 b */
5077 	uint32_t info32;
5078 	/* info32 is 32 b */
5079 	uint64_t info63_v;
5080 	/* info63 is 63 b */
5081 	/*
5082 	 * This value is written by the NIC such that it will be different for
5083 	 * each pass through the completion queue. The even passes will write 1.
5084 	 * The odd passes will write 0.
5085 	 */
5086 	#define NQ_BASE_V					UINT32_C(0x1)
5087 	/* info63 is 63 b */
5088 	#define NQ_BASE_INFO63_MASK				UINT32_C(0xfffffffe)
5089 	#define NQ_BASE_INFO63_SFT				1
5090 } __attribute__((packed));
5091 
5092 /* Completion Queue Notification (16 bytes) */
5093 
5094 struct nq_cn {
5095 	uint16_t type;
5096 	/*
5097 	 * This field indicates the exact type of the completion. By convention,
5098 	 * the LSB identifies the length of the record in 16B units. Even values
5099 	 * indicate 16B records. Odd values indicate 32B records.
5100 	 */
5101 	#define NQ_CN_TYPE_MASK					UINT32_C(0x3f)
5102 	#define NQ_CN_TYPE_SFT					0
5103 	/* CQ Notification */
5104 	#define NQ_CN_TYPE_CQ_NOTIFICATION			UINT32_C(0x30)
5105 	#define NQ_CN_RESERVED9_MASK				UINT32_C(0xffc0)
5106 	#define NQ_CN_RESERVED9_SFT				6
5107 	uint16_t reserved16;
5108 	uint32_t cq_handle_low;
5109 	/*
5110 	 * This is an application level ID used to identify the CQ. This field
5111 	 * carries the lower 32b of the value.
5112 	 */
5113 	uint32_t v;
5114 	/*
5115 	 * This value is written by the NIC such that it will be different for
5116 	 * each pass through the completion queue. The even passes will write 1.
5117 	 * The odd passes will write 0.
5118 	 */
5119 	#define NQ_CN_V						UINT32_C(0x1)
5120 	#define NQ_CN_RESERVED31_MASK				UINT32_C(0xfffffffe)
5121 	#define NQ_CN_RESERVED31_SFT				1
5122 	uint32_t cq_handle_high;
5123 	/*
5124 	 * This is an application level ID used to identify the CQ. This field
5125 	 * carries the upper 32b of the value.
5126 	 */
5127 } __attribute__((packed));
5128 
5129 /* SRQ Event Notification (16 bytes) */
5130 
5131 struct nq_srq_event {
5132 	uint8_t type;
5133 	/*
5134 	 * This field indicates the exact type of the completion. By convention,
5135 	 * the LSB identifies the length of the record in 16B units. Even values
5136 	 * indicate 16B records. Odd values indicate 32B records.
5137 	 */
5138 	#define NQ_SRQ_EVENT_TYPE_MASK				UINT32_C(0x3f)
5139 	#define NQ_SRQ_EVENT_TYPE_SFT				0
5140 	/* SRQ Threshold Event */
5141 	#define NQ_SRQ_EVENT_TYPE_SRQ_EVENT			UINT32_C(0x32)
5142 	#define NQ_SRQ_EVENT_RESERVED1_MASK			UINT32_C(0xc0)
5143 	#define NQ_SRQ_EVENT_RESERVED1_SFT			6
5144 	uint8_t event;
5145 	/* This value define what type of async event has occurred on the SRQ. */
5146 	/* The threshold event has occurred on the specified SRQ. */
5147 	#define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT		UINT32_C(0x1)
5148 	uint16_t reserved16;
5149 	uint32_t srq_handle_low;
5150 	/*
5151 	 * This is the SRQ handle value for the queue that has reached it's
5152 	 * event threshold. This field carries the lower 32b of the value.
5153 	 */
5154 	uint32_t v;
5155 	/*
5156 	 * This value is written by the NIC such that it will be different for
5157 	 * each pass through the completion queue. The even passes will write 1.
5158 	 * The odd passes will write 0.
5159 	 */
5160 	#define NQ_SRQ_EVENT_V					UINT32_C(0x1)
5161 	#define NQ_SRQ_EVENT_RESERVED31_MASK			UINT32_C(0xfffffffe)
5162 	#define NQ_SRQ_EVENT_RESERVED31_SFT			1
5163 	uint32_t srq_handle_high;
5164 	/*
5165 	 * This is the SRQ handle value for the queue that has reached it's
5166 	 * event threshold. This field carries the upper 32b of the value.
5167 	 */
5168 } __attribute__((packed));
5169 
5170 /* DBQ Async Event Notification (16 bytes) */
5171 
5172 struct nq_dbq_event {
5173 	uint8_t type;
5174 	/*
5175 	 * This field indicates the exact type of the completion. By convention,
5176 	 * the LSB identifies the length of the record in 16B units. Even values
5177 	 * indicate 16B records. Odd values indicate 32B records.
5178 	 */
5179 	#define NQ_DBQ_EVENT_TYPE_MASK				UINT32_C(0x3f)
5180 	#define NQ_DBQ_EVENT_TYPE_SFT				0
5181 	/* DBQ Threshold Event */
5182 	#define NQ_DBQ_EVENT_TYPE_DBQ_EVENT			UINT32_C(0x34)
5183 	#define NQ_DBQ_EVENT_RESERVED1_MASK			UINT32_C(0xc0)
5184 	#define NQ_DBQ_EVENT_RESERVED1_SFT			6
5185 	uint8_t event;
5186 	/* This value define what type of action the driver should take. */
5187 	/*
5188 	 * The driver should start writing dummy values to the the
5189 	 * doorbell in an attempt to consume all the PCIE posted write
5190 	 * resources and prevent doorbell overflow.
5191 	 */
5192 	#define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT		UINT32_C(0x1)
5193 	uint16_t db_pfid;
5194 	/*
5195 	 * This is the PFID of function that wrote the doorbell that crossed the
5196 	 * async event threshold.
5197 	 */
5198 	#define NQ_DBQ_EVENT_DB_PFID_MASK			UINT32_C(0xf)
5199 	#define NQ_DBQ_EVENT_DB_PFID_SFT			0
5200 	#define NQ_DBQ_EVENT_RESERVED12_MASK			UINT32_C(0xfff0)
5201 	#define NQ_DBQ_EVENT_RESERVED12_SFT			4
5202 	uint32_t db_dpi;
5203 	/*
5204 	 * This is the DPI of the doorbell write that crossed the async event
5205 	 * threshold.
5206 	 */
5207 	#define NQ_DBQ_EVENT_DB_DPI_MASK			UINT32_C(0xfffff)
5208 	#define NQ_DBQ_EVENT_DB_DPI_SFT				0
5209 	#define NQ_DBQ_EVENT_RESERVED12_2_MASK			UINT32_C(0xfff00000)
5210 	#define NQ_DBQ_EVENT_RESERVED12_2_SFT			20
5211 	uint32_t v;
5212 	/*
5213 	 * This value is written by the NIC such that it will be different for
5214 	 * each pass through the completion queue. The even passes will write 1.
5215 	 * The odd passes will write 0.
5216 	 */
5217 	#define NQ_DBQ_EVENT_V					UINT32_C(0x1)
5218 	#define NQ_DBQ_EVENT_RESERVED32_MASK			UINT32_C(0xfffffffe)
5219 	#define NQ_DBQ_EVENT_RESERVED32_SFT			1
5220 	uint32_t db_type_db_xid;
5221 	/* DB 'type' field from doorbell that crossed the async event threshold. */
5222 	/*
5223 	 * DB 'XID' field from doorbell that crossed the async event threshold.
5224 	 * This is a QPID, SID, or CID, depending on the db_type field.
5225 	 */
5226 	#define NQ_DBQ_EVENT_DB_XID_MASK			UINT32_C(0xfffff)
5227 	#define NQ_DBQ_EVENT_DB_XID_SFT				0
5228 	#define NQ_DBQ_EVENT_RESERVED8_MASK			UINT32_C(0xff00000)
5229 	#define NQ_DBQ_EVENT_RESERVED8_SFT			20
5230 	/* DB 'type' field from doorbell that crossed the async event threshold. */
5231 	#define NQ_DBQ_EVENT_DB_TYPE_MASK			UINT32_C(0xf0000000)
5232 	#define NQ_DBQ_EVENT_DB_TYPE_SFT			28
5233 } __attribute__((packed));
5234 
5235 /* Read Request/Response Queue Structures */
5236 /*
5237  * Description: This queue messages is used on the ORRQ to indicate output read
5238  * requests to the RX side of the chip.
5239  */
5240 /* Input Read Request Queue (IRRQ) Message (32 bytes) */
5241 
5242 struct xrrq_irrq {
5243 	uint16_t credits_type;
5244 	/*
5245 	 * The credit code calculated by Rx path when receiving the request. It
5246 	 * will be placed in the syndrome credit code with the acks on first and
5247 	 * last response.
5248 	 */
5249 	/* Type indication */
5250 	#define XRRQ_IRRQ_TYPE					UINT32_C(0x1)
5251 	/* RDMA Read */
5252 	#define XRRQ_IRRQ_TYPE_READ_REQ			UINT32_C(0x0)
5253 	/* Atomic */
5254 	#define XRRQ_IRRQ_TYPE_ATOMIC_REQ			UINT32_C(0x1)
5255 	#define XRRQ_IRRQ_RESERVED10_MASK			UINT32_C(0x7fe)
5256 	#define XRRQ_IRRQ_RESERVED10_SFT			1
5257 	/*
5258 	 * The credit code calculated by Rx path when receiving the request. It
5259 	 * will be placed in the syndrome credit code with the acks on first and
5260 	 * last response.
5261 	 */
5262 	#define XRRQ_IRRQ_CREDITS_MASK				UINT32_C(0xf800)
5263 	#define XRRQ_IRRQ_CREDITS_SFT				11
5264 	uint16_t reserved16;
5265 	uint32_t reserved32;
5266 	uint32_t psn;
5267 	/* The PSN of the outstanding incoming request */
5268 	#define XRRQ_IRRQ_PSN_MASK				UINT32_C(0xffffff)
5269 	#define XRRQ_IRRQ_PSN_SFT				0
5270 	#define XRRQ_IRRQ_RESERVED8_1_MASK			UINT32_C(0xff000000)
5271 	#define XRRQ_IRRQ_RESERVED8_1_SFT			24
5272 	uint32_t msn;
5273 	/*
5274 	 * The value of QPC.pending_ack_msn after it is incremented as a result
5275 	 * of receiving the read/atomic request. IRRQ.msn-1 will be placed in
5276 	 * the MSN field of the first response and IRRQ.msn will placed in the
5277 	 * MSN field of the last or only response.
5278 	 */
5279 	#define XRRQ_IRRQ_MSN_MASK				UINT32_C(0xffffff)
5280 	#define XRRQ_IRRQ_MSN_SFT				0
5281 	#define XRRQ_IRRQ_RESERVED8_2_MASK			UINT32_C(0xff000000)
5282 	#define XRRQ_IRRQ_RESERVED8_2_SFT			24
5283 	uint64_t va_or_atomic_result;
5284 	/*
5285 	 * Virtual address on local host for RDMA READ In case of duplicate
5286 	 * Atomic, the VA is not required to be validated, only the PSN is, thus
5287 	 * this field is used to store the value returned in the Ack to the
5288 	 * atomic request, and if duplicate arrives, this value is used again
5289 	 * for resending the ack.
5290 	 */
5291 	uint32_t rdma_r_key;
5292 	/* The key to the MR/W in the request */
5293 	uint32_t length;
5294 	/*
5295 	 * Length in bytes of the data requested. Length must be 8 if type is
5296 	 * atomic.
5297 	 */
5298 } __attribute__((packed));
5299 
5300 /* Output Read Request Queue (ORRQ) Message (32 bytes) */
5301 
5302 struct xrrq_orrq {
5303 	uint16_t num_sges_type;
5304 	/*
5305 	 * Up to 6 SGEs. This value is 1 if type is atomic as one SGE is
5306 	 * required to store Atomic response result field. 2 more bits allocated
5307 	 * for future growth. Note that, if num_sges is 1 for an RDMA Read
5308 	 * request, then the first_sge_phy_or_sing_sge_va, single_sge_l_key, and
5309 	 * single_sge_size fields will be populated from the single SGE. If
5310 	 * num_sges is 2 or more for an RDMA Read request, then the
5311 	 * first_sge_phy_or_sing_sge_va field carries the physical address in
5312 	 * host memory where the first sge is stored. The single_sge_l_key and
5313 	 * single_sge_size fields are unused in this case. A special case is a
5314 	 * zero-length, zero-sge RDMA read request WQE. In this situation,
5315 	 * num_sges will be 1. However, first_sge_phy_or_sing_sge_va,
5316 	 * single_sge_l_key, and single_sge_size will all be populated with
5317 	 * zeros.
5318 	 */
5319 	/* Type indication */
5320 	#define XRRQ_ORRQ_TYPE					UINT32_C(0x1)
5321 	/* RDMA Read */
5322 	#define XRRQ_ORRQ_TYPE_READ_REQ			UINT32_C(0x0)
5323 	/* Atomic */
5324 	#define XRRQ_ORRQ_TYPE_ATOMIC_REQ			UINT32_C(0x1)
5325 	#define XRRQ_ORRQ_RESERVED10_MASK			UINT32_C(0x7fe)
5326 	#define XRRQ_ORRQ_RESERVED10_SFT			1
5327 	/*
5328 	 * Up to 6 SGEs. This value is 1 if type is atomic as one SGE is
5329 	 * required to store Atomic response result field. 2 more bits allocated
5330 	 * for future growth. Note that, if num_sges is 1 for an RDMA Read
5331 	 * request, then the first_sge_phy_or_sing_sge_va, single_sge_l_key, and
5332 	 * single_sge_size fields will be populated from the single SGE. If
5333 	 * num_sges is 2 or more for an RDMA Read request, then the
5334 	 * first_sge_phy_or_sing_sge_va field carries the physical address in
5335 	 * host memory where the first sge is stored. The single_sge_l_key and
5336 	 * single_sge_size fields are unused in this case. A special case is a
5337 	 * zero-length, zero-sge RDMA read request WQE. In this situation,
5338 	 * num_sges will be 1. However, first_sge_phy_or_sing_sge_va,
5339 	 * single_sge_l_key, and single_sge_size will all be populated with
5340 	 * zeros.
5341 	 */
5342 	#define XRRQ_ORRQ_NUM_SGES_MASK				UINT32_C(0xf800)
5343 	#define XRRQ_ORRQ_NUM_SGES_SFT				11
5344 	uint16_t reserved16;
5345 	uint32_t length;
5346 	/*
5347 	 * Length in bytes of the data requested. Length must be 8 if type is
5348 	 * atomic.
5349 	 */
5350 	uint32_t psn;
5351 	/* The PSN of the outstanding outgoing request */
5352 	#define XRRQ_ORRQ_PSN_MASK				UINT32_C(0xffffff)
5353 	#define XRRQ_ORRQ_PSN_SFT				0
5354 	#define XRRQ_ORRQ_RESERVED8_1_MASK			UINT32_C(0xff000000)
5355 	#define XRRQ_ORRQ_RESERVED8_1_SFT			24
5356 	uint32_t end_psn;
5357 	/*
5358 	 * The expected last PSN on a response to this request where an ack with
5359 	 * response, rather than just response, should arrive. If ack arrive
5360 	 * with smaller PSN than end_psn then it is considered a NAK.
5361 	 */
5362 	#define XRRQ_ORRQ_END_PSN_MASK				UINT32_C(0xffffff)
5363 	#define XRRQ_ORRQ_END_PSN_SFT				0
5364 	#define XRRQ_ORRQ_RESERVED8_2_MASK			UINT32_C(0xff000000)
5365 	#define XRRQ_ORRQ_RESERVED8_2_SFT			24
5366 	uint64_t first_sge_phy_or_sing_sge_va;
5367 	/*
5368 	 * If num_sges == 1 this is the va of that SGE. Otherwise, physical
5369 	 * address to the first SGE specified by the WQE. Points to the first
5370 	 * SGE in the Request's WQE in the SQ. It is assumed that WQE does not
5371 	 * cross page boundaries! Driver is responsible to enforce that. SGEs
5372 	 * are 16B aligned 0b0000 lsb added to get 64 bit address.
5373 	 */
5374 	uint32_t single_sge_l_key;
5375 	/* The L_Key of a single SGE if used */
5376 	uint32_t single_sge_size;
5377 	/* The size in bytes of the single SGE if used */
5378 } __attribute__((packed));
5379 
5380 /* Page Buffer List Memory Structures (PBL) */
5381 /*
5382  * Description: Page directory entries point to a page directories made up of
5383  * PTE values.
5384  */
5385 /* Page Table Entry (PTE) (8 bytes) */
5386 
5387 struct ptu_pte {
5388 	uint64_t page_next_to_last_last_valid;
5389 	/*
5390 	 * This is the upper bits of the physical page controlled by this PTE.
5391 	 * If the page is larger than 4KB, then the unused lower bits of the
5392 	 * page address should be zero.
5393 	 */
5394 	/*
5395 	 * This field indicates if the PTE is valid. A value of '0' indicates
5396 	 * that the page is not valid. A value of '1' indicates that the page is
5397 	 * valid. A reference to an invalid page will return a PTU error.
5398 	 */
5399 	#define PTU_PTE_VALID					UINT32_C(0x1)
5400 	/*
5401 	 * This field is used only for "ring" PBLs that are used for SQ, RQ,
5402 	 * SRQ, or CQ structures. For all other PBL structures, this bit should
5403 	 * be zero. When this bit is '1', it indicates that the page pointed to
5404 	 * by this PTE is the last page in the ring. A prefetch for the ring
5405 	 * should use the first PTE in the PBL.
5406 	 */
5407 	#define PTU_PTE_LAST					UINT32_C(0x2)
5408 	/*
5409 	 * This field is used only for "ring" PBLs that are used for SQ, RQ,
5410 	 * SRQ, or CQ structures. For all other PBL structures, this bit should
5411 	 * be zero. When this bit is '1', it indicates that this is the next-to-
5412 	 * last page of the PBL.
5413 	 */
5414 	#define PTU_PTE_NEXT_TO_LAST				UINT32_C(0x4)
5415 	/* These bits should be programmed to zero. */
5416 	/*
5417 	 * This is the upper bits of the physical page controlled by this PTE.
5418 	 * If the page is larger than 4KB, then the unused lower bits of the
5419 	 * page address should be zero.
5420 	 */
5421 	#define PTU_PTE_PAGE_MASK				UINT32_C(0xfffff000)
5422 	#define PTU_PTE_PAGE_SFT				12
5423 } __attribute__((packed));
5424 
5425 /* Page Directory Entry (PDE) (8 bytes) */
5426 
5427 struct ptu_pde {
5428 	uint64_t page_valid;
5429 	/*
5430 	 * This is the upper bits of the physical page controlled by this PTE.
5431 	 * If the page is larger than 4KB, then the unused lower bits of the
5432 	 * page address should be zero.
5433 	 */
5434 	/*
5435 	 * This field indicates if the PTE is valid. A value of '0' indicates
5436 	 * that the page is not valid. A value of '1' indicates that the page is
5437 	 * valid. A reference to an invalid page will return a PTU error.
5438 	 */
5439 	#define PTU_PDE_VALID					UINT32_C(0x1)
5440 	/* These bits should be programmed to zero. */
5441 	/*
5442 	 * This is the upper bits of the physical page controlled by this PTE.
5443 	 * If the page is larger than 4KB, then the unused lower bits of the
5444 	 * page address should be zero.
5445 	 */
5446 	#define PTU_PDE_PAGE_MASK				UINT32_C(0xfffff000)
5447 	#define PTU_PDE_PAGE_SFT				12
5448 } __attribute__((packed));
5449 
5450 /* RoCE Fastpath Host Structures */
5451 /*
5452  * Note: This section documents the host structures used between RoCE state
5453  * machines and RoCE drivers/libraries.
5454  */
5455 /* hwrm_ver_get */
5456 /*
5457  * Description: This function is called by a driver to determine the HWRM
5458  * interface version supported by the HWRM firmware, the version of HWRM
5459  * firmware implementation, the name of HWRM firmware, the versions of other
5460  * embedded firmwares, and the names of other embedded firmwares, etc. Any
5461  * interface or firmware version with major = 0, minor = 0, and update = 0 shall
5462  * be considered an invalid version.
5463  */
5464 /* Input (24 bytes) */
5465 
5466 struct hwrm_ver_get_input {
5467 	uint16_t req_type;
5468 	/*
5469 	 * This value indicates what type of request this is. The format for the
5470 	 * rest of the command is determined by this field.
5471 	 */
5472 	uint16_t cmpl_ring;
5473 	/*
5474 	 * This value indicates the what completion ring the request will be
5475 	 * optionally completed on. If the value is -1, then no CR completion
5476 	 * will be generated. Any other value must be a valid CR ring_id value
5477 	 * for this function.
5478 	 */
5479 	uint16_t seq_id;
5480 	/* This value indicates the command sequence number. */
5481 	uint16_t target_id;
5482 	/*
5483 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5484 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5485 	 */
5486 	uint64_t resp_addr;
5487 	/*
5488 	 * This is the host address where the response will be written when the
5489 	 * request is complete. This area must be 16B aligned and must be
5490 	 * cleared to zero before the request is made.
5491 	 */
5492 	uint8_t hwrm_intf_maj;
5493 	/*
5494 	 * This field represents the major version of HWRM interface
5495 	 * specification supported by the driver HWRM implementation. The
5496 	 * interface major version is intended to change only when non backward
5497 	 * compatible changes are made to the HWRM interface specification.
5498 	 */
5499 	uint8_t hwrm_intf_min;
5500 	/*
5501 	 * This field represents the minor version of HWRM interface
5502 	 * specification supported by the driver HWRM implementation. A change
5503 	 * in interface minor version is used to reflect significant backward
5504 	 * compatible modification to HWRM interface specification. This can be
5505 	 * due to addition or removal of functionality. HWRM interface
5506 	 * specifications with the same major version but different minor
5507 	 * versions are compatible.
5508 	 */
5509 	uint8_t hwrm_intf_upd;
5510 	/*
5511 	 * This field represents the update version of HWRM interface
5512 	 * specification supported by the driver HWRM implementation. The
5513 	 * interface update version is used to reflect minor changes or bug
5514 	 * fixes to a released HWRM interface specification.
5515 	 */
5516 	uint8_t unused_0[5];
5517 } __attribute__((packed));
5518 
5519 /* Output (128 bytes) */
5520 
5521 struct hwrm_ver_get_output {
5522 	uint16_t error_code;
5523 	/*
5524 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
5525 	 * and fail the call with an error when appropriate
5526 	 */
5527 	uint16_t req_type;
5528 	/* This field returns the type of original request. */
5529 	uint16_t seq_id;
5530 	/* This field provides original sequence number of the command. */
5531 	uint16_t resp_len;
5532 	/*
5533 	 * This field is the length of the response in bytes. The last byte of
5534 	 * the response is a valid flag that will read as '1' when the command
5535 	 * has been completely written to memory.
5536 	 */
5537 	uint8_t hwrm_intf_maj;
5538 	/*
5539 	 * This field represents the major version of HWRM interface
5540 	 * specification supported by the HWRM implementation. The interface
5541 	 * major version is intended to change only when non backward compatible
5542 	 * changes are made to the HWRM interface specification. A HWRM
5543 	 * implementation that is compliant with this specification shall
5544 	 * provide value of 1 in this field.
5545 	 */
5546 	uint8_t hwrm_intf_min;
5547 	/*
5548 	 * This field represents the minor version of HWRM interface
5549 	 * specification supported by the HWRM implementation. A change in
5550 	 * interface minor version is used to reflect significant backward
5551 	 * compatible modification to HWRM interface specification. This can be
5552 	 * due to addition or removal of functionality. HWRM interface
5553 	 * specifications with the same major version but different minor
5554 	 * versions are compatible. A HWRM implementation that is compliant with
5555 	 * this specification shall provide value of 2 in this field.
5556 	 */
5557 	uint8_t hwrm_intf_upd;
5558 	/*
5559 	 * This field represents the update version of HWRM interface
5560 	 * specification supported by the HWRM implementation. The interface
5561 	 * update version is used to reflect minor changes or bug fixes to a
5562 	 * released HWRM interface specification. A HWRM implementation that is
5563 	 * compliant with this specification shall provide value of 2 in this
5564 	 * field.
5565 	 */
5566 	uint8_t hwrm_intf_rsvd;
5567 	uint8_t hwrm_fw_maj;
5568 	/*
5569 	 * This field represents the major version of HWRM firmware. A change in
5570 	 * firmware major version represents a major firmware release.
5571 	 */
5572 	uint8_t hwrm_fw_min;
5573 	/*
5574 	 * This field represents the minor version of HWRM firmware. A change in
5575 	 * firmware minor version represents significant firmware functionality
5576 	 * changes.
5577 	 */
5578 	uint8_t hwrm_fw_bld;
5579 	/*
5580 	 * This field represents the build version of HWRM firmware. A change in
5581 	 * firmware build version represents bug fixes to a released firmware.
5582 	 */
5583 	uint8_t hwrm_fw_rsvd;
5584 	/*
5585 	 * This field is a reserved field. This field can be used to represent
5586 	 * firmware branches or customer specific releases tied to a specific
5587 	 * (major,minor,update) version of the HWRM firmware.
5588 	 */
5589 	uint8_t mgmt_fw_maj;
5590 	/*
5591 	 * This field represents the major version of mgmt firmware. A change in
5592 	 * major version represents a major release.
5593 	 */
5594 	uint8_t mgmt_fw_min;
5595 	/*
5596 	 * This field represents the minor version of mgmt firmware. A change in
5597 	 * minor version represents significant functionality changes.
5598 	 */
5599 	uint8_t mgmt_fw_bld;
5600 	/*
5601 	 * This field represents the build version of mgmt firmware. A change in
5602 	 * update version represents bug fixes.
5603 	 */
5604 	uint8_t mgmt_fw_rsvd;
5605 	/*
5606 	 * This field is a reserved field. This field can be used to represent
5607 	 * firmware branches or customer specific releases tied to a specific
5608 	 * (major,minor,update) version
5609 	 */
5610 	uint8_t netctrl_fw_maj;
5611 	/*
5612 	 * This field represents the major version of network control firmware.
5613 	 * A change in major version represents a major release.
5614 	 */
5615 	uint8_t netctrl_fw_min;
5616 	/*
5617 	 * This field represents the minor version of network control firmware.
5618 	 * A change in minor version represents significant functionality
5619 	 * changes.
5620 	 */
5621 	uint8_t netctrl_fw_bld;
5622 	/*
5623 	 * This field represents the build version of network control firmware.
5624 	 * A change in update version represents bug fixes.
5625 	 */
5626 	uint8_t netctrl_fw_rsvd;
5627 	/*
5628 	 * This field is a reserved field. This field can be used to represent
5629 	 * firmware branches or customer specific releases tied to a specific
5630 	 * (major,minor,update) version
5631 	 */
5632 	uint32_t dev_caps_cfg;
5633 	/*
5634 	 * This field is used to indicate device's capabilities and
5635 	 * configurations.
5636 	 */
5637 	/*
5638 	 * If set to 1, then secure firmware update behavior is supported. If
5639 	 * set to 0, then secure firmware update behavior is not supported.
5640 	 */
5641 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED UINT32_C(0x1)
5642 	/*
5643 	 * If set to 1, then firmware based DCBX agent is supported. If set to
5644 	 * 0, then firmware based DCBX agent capability is not supported on this
5645 	 * device.
5646 	 */
5647 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED UINT32_C(0x2)
5648 	/*
5649 	 * If set to 1, then HWRM short command format is supported. If set to
5650 	 * 0, then HWRM short command format is not supported.
5651 	 */
5652 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED UINT32_C(0x4)
5653 	/*
5654 	 * If set to 1, then HWRM short command format is required. If set to 0,
5655 	 * then HWRM short command format is not required.
5656 	 */
5657 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED UINT32_C(0x8)
5658 	uint8_t roce_fw_maj;
5659 	/*
5660 	 * This field represents the major version of RoCE firmware. A change in
5661 	 * major version represents a major release.
5662 	 */
5663 	uint8_t roce_fw_min;
5664 	/*
5665 	 * This field represents the minor version of RoCE firmware. A change in
5666 	 * minor version represents significant functionality changes.
5667 	 */
5668 	uint8_t roce_fw_bld;
5669 	/*
5670 	 * This field represents the build version of RoCE firmware. A change in
5671 	 * update version represents bug fixes.
5672 	 */
5673 	uint8_t roce_fw_rsvd;
5674 	/*
5675 	 * This field is a reserved field. This field can be used to represent
5676 	 * firmware branches or customer specific releases tied to a specific
5677 	 * (major,minor,update) version
5678 	 */
5679 	char hwrm_fw_name[16];
5680 	/*
5681 	 * This field represents the name of HWRM FW (ASCII chars with NULL at
5682 	 * the end).
5683 	 */
5684 	char mgmt_fw_name[16];
5685 	/*
5686 	 * This field represents the name of mgmt FW (ASCII chars with NULL at
5687 	 * the end).
5688 	 */
5689 	char netctrl_fw_name[16];
5690 	/*
5691 	 * This field represents the name of network control firmware (ASCII
5692 	 * chars with NULL at the end).
5693 	 */
5694 	uint32_t reserved2[4];
5695 	/*
5696 	 * This field is reserved for future use. The responder should set it to
5697 	 * 0. The requester should ignore this field.
5698 	 */
5699 	char roce_fw_name[16];
5700 	/*
5701 	 * This field represents the name of RoCE FW (ASCII chars with NULL at
5702 	 * the end).
5703 	 */
5704 	uint16_t chip_num;
5705 	/* This field returns the chip number. */
5706 	uint8_t chip_rev;
5707 	/* This field returns the revision of chip. */
5708 	uint8_t chip_metal;
5709 	/* This field returns the chip metal number. */
5710 	uint8_t chip_bond_id;
5711 	/* This field returns the bond id of the chip. */
5712 	uint8_t chip_platform_type;
5713 	/*
5714 	 * This value indicates the type of platform used for chip
5715 	 * implementation.
5716 	 */
5717 	/* ASIC */
5718 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC	UINT32_C(0x0)
5719 	/* FPGA platform of the chip. */
5720 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA	UINT32_C(0x1)
5721 	/* Palladium platform of the chip. */
5722 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM  UINT32_C(0x2)
5723 	uint16_t max_req_win_len;
5724 	/*
5725 	 * This field returns the maximum value of request window that is
5726 	 * supported by the HWRM. The request window is mapped into device
5727 	 * address space using MMIO.
5728 	 */
5729 	uint16_t max_resp_len;
5730 	/* This field returns the maximum value of response buffer in bytes. */
5731 	uint16_t def_req_timeout;
5732 	/* This field returns the default request timeout value in milliseconds. */
5733 	uint8_t init_pending;
5734 	/* This field will indicate if any subsystems is not fully initialized. */
5735 	/*
5736 	 * If set to 1, device is not ready. If set to 0, device is ready to
5737 	 * accept all HWRM commands.
5738 	 */
5739 	#define HWRM_VER_GET_OUTPUT_INIT_PENDING_DEV_NOT_RDY	UINT32_C(0x1)
5740 	uint8_t unused_0;
5741 	uint8_t unused_1;
5742 	uint8_t valid;
5743 	/*
5744 	 * This field is used in Output records to indicate that the output is
5745 	 * completely written to RAM. This field should be read as '1' to
5746 	 * indicate that the output has been completely written. When writing a
5747 	 * command completion or response to an internal processor, the order of
5748 	 * writes has to be such that this field is written last.
5749 	 */
5750 } __attribute__((packed));
5751 
5752 /* hwrm_func_reset */
5753 /*
5754  * Description: This command resets a hardware function (PCIe function) and
5755  * frees any resources used by the function. This command shall be initiated by
5756  * the driver after an FLR has occurred to prepare the function for re-use. This
5757  * command may also be initiated by a driver prior to doing it's own
5758  * configuration. This command puts the function into the reset state. In the
5759  * reset state, global and port related features of the chip are not available.
5760  */
5761 /*
5762  * Note: This command will reset a function that has already been disabled or
5763  * idled. The command returns all the resources owned by the function so a new
5764  * driver may allocate and configure resources normally.
5765  */
5766 /* Input (24 bytes) */
5767 
5768 struct hwrm_func_reset_input {
5769 	uint16_t req_type;
5770 	/*
5771 	 * This value indicates what type of request this is. The format for the
5772 	 * rest of the command is determined by this field.
5773 	 */
5774 	uint16_t cmpl_ring;
5775 	/*
5776 	 * This value indicates the what completion ring the request will be
5777 	 * optionally completed on. If the value is -1, then no CR completion
5778 	 * will be generated. Any other value must be a valid CR ring_id value
5779 	 * for this function.
5780 	 */
5781 	uint16_t seq_id;
5782 	/* This value indicates the command sequence number. */
5783 	uint16_t target_id;
5784 	/*
5785 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5786 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5787 	 */
5788 	uint64_t resp_addr;
5789 	/*
5790 	 * This is the host address where the response will be written when the
5791 	 * request is complete. This area must be 16B aligned and must be
5792 	 * cleared to zero before the request is made.
5793 	 */
5794 	uint32_t enables;
5795 	/* This bit must be '1' for the vf_id_valid field to be configured. */
5796 	#define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
5797 	uint16_t vf_id;
5798 	/*
5799 	 * The ID of the VF that this PF is trying to reset. Only the parent PF
5800 	 * shall be allowed to reset a child VF. A parent PF driver shall use
5801 	 * this field only when a specific child VF is requested to be reset.
5802 	 */
5803 	uint8_t func_reset_level;
5804 	/* This value indicates the level of a function reset. */
5805 	/*
5806 	 * Reset the caller function and its children VFs (if any). If
5807 	 * no children functions exist, then reset the caller function
5808 	 * only.
5809 	 */
5810 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL   UINT32_C(0x0)
5811 	/* Reset the caller function only */
5812 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME	UINT32_C(0x1)
5813 	/*
5814 	 * Reset all children VFs of the caller function driver if the
5815 	 * caller is a PF driver. It is an error to specify this level
5816 	 * by a VF driver. It is an error to specify this level by a PF
5817 	 * driver with no children VFs.
5818 	 */
5819 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN UINT32_C(0x2)
5820 	/*
5821 	 * Reset a specific VF of the caller function driver if the
5822 	 * caller is the parent PF driver. It is an error to specify
5823 	 * this level by a VF driver. It is an error to specify this
5824 	 * level by a PF driver that is not the parent of the VF that is
5825 	 * being requested to reset.
5826 	 */
5827 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF	UINT32_C(0x3)
5828 	uint8_t unused_0;
5829 } __attribute__((packed));
5830 
5831 /* Output (16 bytes) */
5832 
5833 struct hwrm_func_reset_output {
5834 	uint16_t error_code;
5835 	/*
5836 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
5837 	 * and fail the call with an error when appropriate
5838 	 */
5839 	uint16_t req_type;
5840 	/* This field returns the type of original request. */
5841 	uint16_t seq_id;
5842 	/* This field provides original sequence number of the command. */
5843 	uint16_t resp_len;
5844 	/*
5845 	 * This field is the length of the response in bytes. The last byte of
5846 	 * the response is a valid flag that will read as '1' when the command
5847 	 * has been completely written to memory.
5848 	 */
5849 	uint32_t unused_0;
5850 	uint8_t unused_1;
5851 	uint8_t unused_2;
5852 	uint8_t unused_3;
5853 	uint8_t valid;
5854 	/*
5855 	 * This field is used in Output records to indicate that the output is
5856 	 * completely written to RAM. This field should be read as '1' to
5857 	 * indicate that the output has been completely written. When writing a
5858 	 * command completion or response to an internal processor, the order of
5859 	 * writes has to be such that this field is written last.
5860 	 */
5861 } __attribute__((packed));
5862 
5863 /* hwrm_func_getfid */
5864 /*
5865  * Description: This command returns the FID value for the function. If a valid
5866  * pci_id is provided, then this function returns fid for that PCI function.
5867  * Otherwise, it returns FID of the requesting function. This value is needed to
5868  * configure Rings and MSI-X vectors so their DMA operations appear correctly on
5869  * the PCI bus. For PF-HWRM commands, there is no need for FID. Similarly there
5870  * is no need for FID for VF-HWRM commands. In the PF-VF communication, only PF
5871  * needs to know FIDs.
5872  */
5873 /* Input (24 bytes) */
5874 
5875 struct hwrm_func_getfid_input {
5876 	uint16_t req_type;
5877 	/*
5878 	 * This value indicates what type of request this is. The format for the
5879 	 * rest of the command is determined by this field.
5880 	 */
5881 	uint16_t cmpl_ring;
5882 	/*
5883 	 * This value indicates the what completion ring the request will be
5884 	 * optionally completed on. If the value is -1, then no CR completion
5885 	 * will be generated. Any other value must be a valid CR ring_id value
5886 	 * for this function.
5887 	 */
5888 	uint16_t seq_id;
5889 	/* This value indicates the command sequence number. */
5890 	uint16_t target_id;
5891 	/*
5892 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5893 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5894 	 */
5895 	uint64_t resp_addr;
5896 	/*
5897 	 * This is the host address where the response will be written when the
5898 	 * request is complete. This area must be 16B aligned and must be
5899 	 * cleared to zero before the request is made.
5900 	 */
5901 	uint32_t enables;
5902 	/* This bit must be '1' for the pci_id field to be configured. */
5903 	#define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID		UINT32_C(0x1)
5904 	uint16_t pci_id;
5905 	/*
5906 	 * This value is the PCI ID of the queried function. If ARI is enabled,
5907 	 * then it is Bus Number (8b):Function Number(8b). Otherwise, it is Bus
5908 	 * Number (8b):Device Number (5b):Function Number(3b).
5909 	 */
5910 	uint16_t unused_0;
5911 } __attribute__((packed));
5912 
5913 /* Output (16 bytes) */
5914 
5915 struct hwrm_func_getfid_output {
5916 	uint16_t error_code;
5917 	/*
5918 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
5919 	 * and fail the call with an error when appropriate
5920 	 */
5921 	uint16_t req_type;
5922 	/* This field returns the type of original request. */
5923 	uint16_t seq_id;
5924 	/* This field provides original sequence number of the command. */
5925 	uint16_t resp_len;
5926 	/*
5927 	 * This field is the length of the response in bytes. The last byte of
5928 	 * the response is a valid flag that will read as '1' when the command
5929 	 * has been completely written to memory.
5930 	 */
5931 	uint16_t fid;
5932 	/*
5933 	 * FID value. This value is used to identify operations on the PCI bus
5934 	 * as belonging to a particular PCI function.
5935 	 */
5936 	uint8_t unused_0;
5937 	uint8_t unused_1;
5938 	uint8_t unused_2;
5939 	uint8_t unused_3;
5940 	uint8_t unused_4;
5941 	uint8_t valid;
5942 	/*
5943 	 * This field is used in Output records to indicate that the output is
5944 	 * completely written to RAM. This field should be read as '1' to
5945 	 * indicate that the output has been completely written. When writing a
5946 	 * command completion or response to an internal processor, the order of
5947 	 * writes has to be such that this field is written last.
5948 	 */
5949 } __attribute__((packed));
5950 
5951 /* hwrm_func_vf_alloc */
5952 /*
5953  * Description: This command is used to allocate requested number of virtual
5954  * functions on a physical function. It will return the FID value of the first
5955  * virtual function. The FIDs of the remaining virtual functions can be derived
5956  * by sequentially incrementing the FID value of the first VF. This command
5957  * supports the following models for VF allocation: # Allocation of one or more
5958  * VFs from a PF without specifying the first VF ID # Allocation of multiple VFs
5959  * from a PF starting with a specific VF # Allocation of a specific VF from a PF
5960  * If this command is called on a virtual function or a physical function that
5961  * is not enabled for SR-IOV, the HWRM shall return an error. The VF IDs
5962  * returned by this function remain valid after the VF is disabled or reset.
5963  */
5964 /* Input (24 bytes) */
5965 
5966 struct hwrm_func_vf_alloc_input {
5967 	uint16_t req_type;
5968 	/*
5969 	 * This value indicates what type of request this is. The format for the
5970 	 * rest of the command is determined by this field.
5971 	 */
5972 	uint16_t cmpl_ring;
5973 	/*
5974 	 * This value indicates the what completion ring the request will be
5975 	 * optionally completed on. If the value is -1, then no CR completion
5976 	 * will be generated. Any other value must be a valid CR ring_id value
5977 	 * for this function.
5978 	 */
5979 	uint16_t seq_id;
5980 	/* This value indicates the command sequence number. */
5981 	uint16_t target_id;
5982 	/*
5983 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5984 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5985 	 */
5986 	uint64_t resp_addr;
5987 	/*
5988 	 * This is the host address where the response will be written when the
5989 	 * request is complete. This area must be 16B aligned and must be
5990 	 * cleared to zero before the request is made.
5991 	 */
5992 	uint32_t enables;
5993 	/* This bit must be '1' for the first_vf_id field to be configured. */
5994 	#define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
5995 	uint16_t first_vf_id;
5996 	/*
5997 	 * This value is used to identify a Virtual Function (VF). The scope of
5998 	 * VF ID is local within a PF.
5999 	 */
6000 	uint16_t num_vfs;
6001 	/* The number of virtual functions requested. */
6002 } __attribute__((packed));
6003 
6004 /* Output (16 bytes) */
6005 
6006 struct hwrm_func_vf_alloc_output {
6007 	uint16_t error_code;
6008 	/*
6009 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6010 	 * and fail the call with an error when appropriate
6011 	 */
6012 	uint16_t req_type;
6013 	/* This field returns the type of original request. */
6014 	uint16_t seq_id;
6015 	/* This field provides original sequence number of the command. */
6016 	uint16_t resp_len;
6017 	/*
6018 	 * This field is the length of the response in bytes. The last byte of
6019 	 * the response is a valid flag that will read as '1' when the command
6020 	 * has been completely written to memory.
6021 	 */
6022 	uint16_t first_vf_id;
6023 	/* The ID of the first VF allocated. */
6024 	uint8_t unused_0;
6025 	uint8_t unused_1;
6026 	uint8_t unused_2;
6027 	uint8_t unused_3;
6028 	uint8_t unused_4;
6029 	uint8_t valid;
6030 	/*
6031 	 * This field is used in Output records to indicate that the output is
6032 	 * completely written to RAM. This field should be read as '1' to
6033 	 * indicate that the output has been completely written. When writing a
6034 	 * command completion or response to an internal processor, the order of
6035 	 * writes has to be such that this field is written last.
6036 	 */
6037 } __attribute__((packed));
6038 
6039 /* hwrm_func_vf_free */
6040 /*
6041  * Description: This command will free allocated virtual functions on a physical
6042  * function. If this command is called on a virtual function or a physical
6043  * function that is not enabled for SR-IOV, the HWRM shall return an error.
6044  * After the successful completion of this command, the VF IDs of the VFs that
6045  * are freed on the PF are invalid.
6046  */
6047 /* Input (24 bytes) */
6048 
6049 struct hwrm_func_vf_free_input {
6050 	uint16_t req_type;
6051 	/*
6052 	 * This value indicates what type of request this is. The format for the
6053 	 * rest of the command is determined by this field.
6054 	 */
6055 	uint16_t cmpl_ring;
6056 	/*
6057 	 * This value indicates the what completion ring the request will be
6058 	 * optionally completed on. If the value is -1, then no CR completion
6059 	 * will be generated. Any other value must be a valid CR ring_id value
6060 	 * for this function.
6061 	 */
6062 	uint16_t seq_id;
6063 	/* This value indicates the command sequence number. */
6064 	uint16_t target_id;
6065 	/*
6066 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6067 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6068 	 */
6069 	uint64_t resp_addr;
6070 	/*
6071 	 * This is the host address where the response will be written when the
6072 	 * request is complete. This area must be 16B aligned and must be
6073 	 * cleared to zero before the request is made.
6074 	 */
6075 	uint32_t enables;
6076 	/* This bit must be '1' for the first_vf_id field to be configured. */
6077 	#define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
6078 	uint16_t first_vf_id;
6079 	/*
6080 	 * This value is used to identify a Virtual Function (VF). The scope of
6081 	 * VF ID is local within a PF.
6082 	 */
6083 	uint16_t num_vfs;
6084 	/*
6085 	 * The number of virtual functions requested. 0xFFFF - Cleanup all
6086 	 * children of this PF.
6087 	 */
6088 } __attribute__((packed));
6089 
6090 /* Output (16 bytes) */
6091 
6092 struct hwrm_func_vf_free_output {
6093 	uint16_t error_code;
6094 	/*
6095 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6096 	 * and fail the call with an error when appropriate
6097 	 */
6098 	uint16_t req_type;
6099 	/* This field returns the type of original request. */
6100 	uint16_t seq_id;
6101 	/* This field provides original sequence number of the command. */
6102 	uint16_t resp_len;
6103 	/*
6104 	 * This field is the length of the response in bytes. The last byte of
6105 	 * the response is a valid flag that will read as '1' when the command
6106 	 * has been completely written to memory.
6107 	 */
6108 	uint32_t unused_0;
6109 	uint8_t unused_1;
6110 	uint8_t unused_2;
6111 	uint8_t unused_3;
6112 	uint8_t valid;
6113 	/*
6114 	 * This field is used in Output records to indicate that the output is
6115 	 * completely written to RAM. This field should be read as '1' to
6116 	 * indicate that the output has been completely written. When writing a
6117 	 * command completion or response to an internal processor, the order of
6118 	 * writes has to be such that this field is written last.
6119 	 */
6120 } __attribute__((packed));
6121 
6122 /* hwrm_func_vf_cfg */
6123 /*
6124  * Description: This command allows configuration of a VF by its driver. If this
6125  * function is called by a PF driver, then the HWRM shall fail this command. If
6126  * guest VLAN and/or MAC address are provided in this command, then the HWRM
6127  * shall set up appropriate MAC/VLAN filters for the VF that is being
6128  * configured. A VF driver should set VF MTU/MRU using this command prior to
6129  * allocating RX VNICs or TX rings for the corresponding VF.
6130  */
6131 /* Input (32 bytes) */
6132 
6133 struct hwrm_func_vf_cfg_input {
6134 	uint16_t req_type;
6135 	/*
6136 	 * This value indicates what type of request this is. The format for the
6137 	 * rest of the command is determined by this field.
6138 	 */
6139 	uint16_t cmpl_ring;
6140 	/*
6141 	 * This value indicates the what completion ring the request will be
6142 	 * optionally completed on. If the value is -1, then no CR completion
6143 	 * will be generated. Any other value must be a valid CR ring_id value
6144 	 * for this function.
6145 	 */
6146 	uint16_t seq_id;
6147 	/* This value indicates the command sequence number. */
6148 	uint16_t target_id;
6149 	/*
6150 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6151 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6152 	 */
6153 	uint64_t resp_addr;
6154 	/*
6155 	 * This is the host address where the response will be written when the
6156 	 * request is complete. This area must be 16B aligned and must be
6157 	 * cleared to zero before the request is made.
6158 	 */
6159 	uint32_t enables;
6160 	/* This bit must be '1' for the mtu field to be configured. */
6161 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU		UINT32_C(0x1)
6162 	/* This bit must be '1' for the guest_vlan field to be configured. */
6163 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN	UINT32_C(0x2)
6164 	/* This bit must be '1' for the async_event_cr field to be configured. */
6165 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4)
6166 	/* This bit must be '1' for the dflt_mac_addr field to be configured. */
6167 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR	UINT32_C(0x8)
6168 	uint16_t mtu;
6169 	/*
6170 	 * The maximum transmission unit requested on the function. The HWRM
6171 	 * should make sure that the mtu of the function does not exceed the mtu
6172 	 * of the physical port that this function is associated with. In
6173 	 * addition to requesting mtu per function, it is possible to configure
6174 	 * mtu per transmit ring. By default, the mtu of each transmit ring
6175 	 * associated with a function is equal to the mtu of the function. The
6176 	 * HWRM should make sure that the mtu of each transmit ring that is
6177 	 * assigned to a function has a valid mtu.
6178 	 */
6179 	uint16_t guest_vlan;
6180 	/*
6181 	 * The guest VLAN for the function being configured. This field's format
6182 	 * is same as 802.1Q Tag's Tag Control Information (TCI) format that
6183 	 * includes both Priority Code Point (PCP) and VLAN Identifier (VID).
6184 	 */
6185 	uint16_t async_event_cr;
6186 	/*
6187 	 * ID of the target completion ring for receiving asynchronous event
6188 	 * completions. If this field is not valid, then the HWRM shall use the
6189 	 * default completion ring of the function that is being configured as
6190 	 * the target completion ring for providing any asynchronous event
6191 	 * completions for that function. If this field is valid, then the HWRM
6192 	 * shall use the completion ring identified by this ID as the target
6193 	 * completion ring for providing any asynchronous event completions for
6194 	 * the function that is being configured.
6195 	 */
6196 	uint8_t dflt_mac_addr[6];
6197 	/*
6198 	 * This value is the current MAC address requested by the VF driver to
6199 	 * be configured on this VF. A value of 00-00-00-00-00-00 indicates no
6200 	 * MAC address configuration is requested by the VF driver. The parent
6201 	 * PF driver may reject or overwrite this MAC address.
6202 	 */
6203 } __attribute__((packed));
6204 
6205 /* Output (16 bytes) */
6206 
6207 struct hwrm_func_vf_cfg_output {
6208 	uint16_t error_code;
6209 	/*
6210 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6211 	 * and fail the call with an error when appropriate
6212 	 */
6213 	uint16_t req_type;
6214 	/* This field returns the type of original request. */
6215 	uint16_t seq_id;
6216 	/* This field provides original sequence number of the command. */
6217 	uint16_t resp_len;
6218 	/*
6219 	 * This field is the length of the response in bytes. The last byte of
6220 	 * the response is a valid flag that will read as '1' when the command
6221 	 * has been completely written to memory.
6222 	 */
6223 	uint32_t unused_0;
6224 	uint8_t unused_1;
6225 	uint8_t unused_2;
6226 	uint8_t unused_3;
6227 	uint8_t valid;
6228 	/*
6229 	 * This field is used in Output records to indicate that the output is
6230 	 * completely written to RAM. This field should be read as '1' to
6231 	 * indicate that the output has been completely written. When writing a
6232 	 * command completion or response to an internal processor, the order of
6233 	 * writes has to be such that this field is written last.
6234 	 */
6235 } __attribute__((packed));
6236 
6237 /* hwrm_func_qcaps */
6238 /*
6239  * Description: This command returns capabilities of a function. The input FID
6240  * value is used to indicate what function is being queried. This allows a
6241  * physical function driver to query virtual functions that are children of the
6242  * physical function. The output FID value is needed to configure Rings and
6243  * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
6244  */
6245 /* Input (24 bytes) */
6246 
6247 struct hwrm_func_qcaps_input {
6248 	uint16_t req_type;
6249 	/*
6250 	 * This value indicates what type of request this is. The format for the
6251 	 * rest of the command is determined by this field.
6252 	 */
6253 	uint16_t cmpl_ring;
6254 	/*
6255 	 * This value indicates the what completion ring the request will be
6256 	 * optionally completed on. If the value is -1, then no CR completion
6257 	 * will be generated. Any other value must be a valid CR ring_id value
6258 	 * for this function.
6259 	 */
6260 	uint16_t seq_id;
6261 	/* This value indicates the command sequence number. */
6262 	uint16_t target_id;
6263 	/*
6264 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6265 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6266 	 */
6267 	uint64_t resp_addr;
6268 	/*
6269 	 * This is the host address where the response will be written when the
6270 	 * request is complete. This area must be 16B aligned and must be
6271 	 * cleared to zero before the request is made.
6272 	 */
6273 	uint16_t fid;
6274 	/*
6275 	 * Function ID of the function that is being queried. 0xFF... (All Fs)
6276 	 * if the query is for the requesting function.
6277 	 */
6278 	uint16_t unused_0[3];
6279 } __attribute__((packed));
6280 
6281 /* Output (80 bytes) */
6282 
6283 struct hwrm_func_qcaps_output {
6284 	uint16_t error_code;
6285 	/*
6286 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6287 	 * and fail the call with an error when appropriate
6288 	 */
6289 	uint16_t req_type;
6290 	/* This field returns the type of original request. */
6291 	uint16_t seq_id;
6292 	/* This field provides original sequence number of the command. */
6293 	uint16_t resp_len;
6294 	/*
6295 	 * This field is the length of the response in bytes. The last byte of
6296 	 * the response is a valid flag that will read as '1' when the command
6297 	 * has been completely written to memory.
6298 	 */
6299 	uint16_t fid;
6300 	/*
6301 	 * FID value. This value is used to identify operations on the PCI bus
6302 	 * as belonging to a particular PCI function.
6303 	 */
6304 	uint16_t port_id;
6305 	/*
6306 	 * Port ID of port that this function is associated with. Valid only for
6307 	 * the PF. 0xFF... (All Fs) if this function is not associated with any
6308 	 * port. 0xFF... (All Fs) if this function is called from a VF.
6309 	 */
6310 	uint32_t flags;
6311 	/* If 1, then Push mode is supported on this function. */
6312 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED   UINT32_C(0x1)
6313 	/* If 1, then the global MSI-X auto-masking is enabled for the device. */
6314 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING UINT32_C(0x2)
6315 	/*
6316 	 * If 1, then the Precision Time Protocol (PTP) processing is supported
6317 	 * on this function. The HWRM should enable PTP on only a single
6318 	 * Physical Function (PF) per port.
6319 	 */
6320 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED	UINT32_C(0x4)
6321 	/*
6322 	 * If 1, then RDMA over Converged Ethernet (RoCE) v1 is supported on
6323 	 * this function.
6324 	 */
6325 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED	UINT32_C(0x8)
6326 	/*
6327 	 * If 1, then RDMA over Converged Ethernet (RoCE) v2 is supported on
6328 	 * this function.
6329 	 */
6330 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED	UINT32_C(0x10)
6331 	/*
6332 	 * If 1, then control and configuration of WoL magic packet are
6333 	 * supported on this function.
6334 	 */
6335 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED UINT32_C(0x20)
6336 	/*
6337 	 * If 1, then control and configuration of bitmap pattern packet are
6338 	 * supported on this function.
6339 	 */
6340 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED	UINT32_C(0x40)
6341 	/*
6342 	 * If set to 1, then the control and configuration of rate limit of an
6343 	 * allocated TX ring on the queried function is supported.
6344 	 */
6345 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED  UINT32_C(0x80)
6346 	/*
6347 	 * If 1, then control and configuration of minimum and maximum
6348 	 * bandwidths are supported on the queried function.
6349 	 */
6350 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED   UINT32_C(0x100)
6351 	/*
6352 	 * If the query is for a VF, then this flag shall be ignored. If this
6353 	 * query is for a PF and this flag is set to 1, then the PF has the
6354 	 * capability to set the rate limits on the TX rings of its children
6355 	 * VFs. If this query is for a PF and this flag is set to 0, then the PF
6356 	 * does not have the capability to set the rate limits on the TX rings
6357 	 * of its children VFs.
6358 	 */
6359 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED UINT32_C(0x200)
6360 	/*
6361 	 * If the query is for a VF, then this flag shall be ignored. If this
6362 	 * query is for a PF and this flag is set to 1, then the PF has the
6363 	 * capability to set the minimum and/or maximum bandwidths for its
6364 	 * children VFs. If this query is for a PF and this flag is set to 0,
6365 	 * then the PF does not have the capability to set the minimum or
6366 	 * maximum bandwidths for its children VFs.
6367 	 */
6368 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED   UINT32_C(0x400)
6369 	/*
6370 	 * Standard TX Ring mode is used for the allocation of TX ring and
6371 	 * underlying scheduling resources that allow bandwidth reservation and
6372 	 * limit settings on the queried function. If set to 1, then standard TX
6373 	 * ring mode is supported on the queried function. If set to 0, then
6374 	 * standard TX ring mode is not available on the queried function.
6375 	 */
6376 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED UINT32_C(0x800)
6377 	uint8_t mac_address[6];
6378 	/*
6379 	 * This value is current MAC address configured for this function. A
6380 	 * value of 00-00-00-00-00-00 indicates no MAC address is currently
6381 	 * configured.
6382 	 */
6383 	uint16_t max_rsscos_ctx;
6384 	/*
6385 	 * The maximum number of RSS/COS contexts that can be allocated to the
6386 	 * function.
6387 	 */
6388 	uint16_t max_cmpl_rings;
6389 	/*
6390 	 * The maximum number of completion rings that can be allocated to the
6391 	 * function.
6392 	 */
6393 	uint16_t max_tx_rings;
6394 	/*
6395 	 * The maximum number of transmit rings that can be allocated to the
6396 	 * function.
6397 	 */
6398 	uint16_t max_rx_rings;
6399 	/*
6400 	 * The maximum number of receive rings that can be allocated to the
6401 	 * function.
6402 	 */
6403 	uint16_t max_l2_ctxs;
6404 	/*
6405 	 * The maximum number of L2 contexts that can be allocated to the
6406 	 * function.
6407 	 */
6408 	uint16_t max_vnics;
6409 	/* The maximum number of VNICs that can be allocated to the function. */
6410 	uint16_t first_vf_id;
6411 	/*
6412 	 * The identifier for the first VF enabled on a PF. This is valid only
6413 	 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
6414 	 * called on a PF with SR-IOV disabled or on a VF.
6415 	 */
6416 	uint16_t max_vfs;
6417 	/*
6418 	 * The maximum number of VFs that can be allocated to the function. This
6419 	 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
6420 	 * command is called on a PF with SR-IOV disabled or on a VF.
6421 	 */
6422 	uint16_t max_stat_ctx;
6423 	/*
6424 	 * The maximum number of statistic contexts that can be allocated to the
6425 	 * function.
6426 	 */
6427 	uint32_t max_encap_records;
6428 	/*
6429 	 * The maximum number of Encapsulation records that can be offloaded by
6430 	 * this function.
6431 	 */
6432 	uint32_t max_decap_records;
6433 	/*
6434 	 * The maximum number of decapsulation records that can be offloaded by
6435 	 * this function.
6436 	 */
6437 	uint32_t max_tx_em_flows;
6438 	/*
6439 	 * The maximum number of Exact Match (EM) flows that can be offloaded by
6440 	 * this function on the TX side.
6441 	 */
6442 	uint32_t max_tx_wm_flows;
6443 	/*
6444 	 * The maximum number of Wildcard Match (WM) flows that can be offloaded
6445 	 * by this function on the TX side.
6446 	 */
6447 	uint32_t max_rx_em_flows;
6448 	/*
6449 	 * The maximum number of Exact Match (EM) flows that can be offloaded by
6450 	 * this function on the RX side.
6451 	 */
6452 	uint32_t max_rx_wm_flows;
6453 	/*
6454 	 * The maximum number of Wildcard Match (WM) flows that can be offloaded
6455 	 * by this function on the RX side.
6456 	 */
6457 	uint32_t max_mcast_filters;
6458 	/*
6459 	 * The maximum number of multicast filters that can be supported by this
6460 	 * function on the RX side.
6461 	 */
6462 	uint32_t max_flow_id;
6463 	/*
6464 	 * The maximum value of flow_id that can be supported in completion
6465 	 * records.
6466 	 */
6467 	uint32_t max_hw_ring_grps;
6468 	/*
6469 	 * The maximum number of HW ring groups that can be supported on this
6470 	 * function.
6471 	 */
6472 	uint16_t max_sp_tx_rings;
6473 	/*
6474 	 * The maximum number of strict priority transmit rings that can be
6475 	 * allocated to the function. This number indicates the maximum number
6476 	 * of TX rings that can be assigned strict priorities out of the maximum
6477 	 * number of TX rings that can be allocated (max_tx_rings) to the
6478 	 * function.
6479 	 */
6480 	uint8_t unused_0;
6481 	uint8_t valid;
6482 	/*
6483 	 * This field is used in Output records to indicate that the output is
6484 	 * completely written to RAM. This field should be read as '1' to
6485 	 * indicate that the output has been completely written. When writing a
6486 	 * command completion or response to an internal processor, the order of
6487 	 * writes has to be such that this field is written last.
6488 	 */
6489 } __attribute__((packed));
6490 
6491 /* hwrm_func_qcfg */
6492 /*
6493  * Description: This command returns the current configuration of a function.
6494  * The input FID value is used to indicate what function is being queried. This
6495  * allows a physical function driver to query virtual functions that are
6496  * children of the physical function. The output FID value is needed to
6497  * configure Rings and MSI-X vectors so their DMA operations appear correctly on
6498  * the PCI bus. This command should be called by every driver after
6499  * 'hwrm_func_cfg' to get the actual number of resources allocated by the HWRM.
6500  * The values returned by hwrm_func_qcfg are the values the driver shall use.
6501  * These values may be different than what was originally requested in the
6502  * 'hwrm_func_cfg' command.
6503  */
6504 /* Input (24 bytes) */
6505 
6506 struct hwrm_func_qcfg_input {
6507 	uint16_t req_type;
6508 	/*
6509 	 * This value indicates what type of request this is. The format for the
6510 	 * rest of the command is determined by this field.
6511 	 */
6512 	uint16_t cmpl_ring;
6513 	/*
6514 	 * This value indicates the what completion ring the request will be
6515 	 * optionally completed on. If the value is -1, then no CR completion
6516 	 * will be generated. Any other value must be a valid CR ring_id value
6517 	 * for this function.
6518 	 */
6519 	uint16_t seq_id;
6520 	/* This value indicates the command sequence number. */
6521 	uint16_t target_id;
6522 	/*
6523 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6524 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6525 	 */
6526 	uint64_t resp_addr;
6527 	/*
6528 	 * This is the host address where the response will be written when the
6529 	 * request is complete. This area must be 16B aligned and must be
6530 	 * cleared to zero before the request is made.
6531 	 */
6532 	uint16_t fid;
6533 	/*
6534 	 * Function ID of the function that is being queried. 0xFF... (All Fs)
6535 	 * if the query is for the requesting function.
6536 	 */
6537 	uint16_t unused_0[3];
6538 } __attribute__((packed));
6539 
6540 /* Output (72 bytes) */
6541 
6542 struct hwrm_func_qcfg_output {
6543 	uint16_t error_code;
6544 	/*
6545 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6546 	 * and fail the call with an error when appropriate
6547 	 */
6548 	uint16_t req_type;
6549 	/* This field returns the type of original request. */
6550 	uint16_t seq_id;
6551 	/* This field provides original sequence number of the command. */
6552 	uint16_t resp_len;
6553 	/*
6554 	 * This field is the length of the response in bytes. The last byte of
6555 	 * the response is a valid flag that will read as '1' when the command
6556 	 * has been completely written to memory.
6557 	 */
6558 	uint16_t fid;
6559 	/*
6560 	 * FID value. This value is used to identify operations on the PCI bus
6561 	 * as belonging to a particular PCI function.
6562 	 */
6563 	uint16_t port_id;
6564 	/*
6565 	 * Port ID of port that this function is associated with. 0xFF... (All
6566 	 * Fs) if this function is not associated with any port.
6567 	 */
6568 	uint16_t vlan;
6569 	/*
6570 	 * This value is the current VLAN setting for this function. The value
6571 	 * of 0 for this field indicates no priority tagging or VLAN is used.
6572 	 * This field's format is same as 802.1Q Tag's Tag Control Information
6573 	 * (TCI) format that includes both Priority Code Point (PCP) and VLAN
6574 	 * Identifier (VID).
6575 	 */
6576 	uint16_t flags;
6577 	/*
6578 	 * If 1, then magic packet based Out-Of-Box WoL is enabled on the port
6579 	 * associated with this function.
6580 	 */
6581 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED UINT32_C(0x1)
6582 	/*
6583 	 * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled on
6584 	 * the port associated with this function.
6585 	 */
6586 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED	UINT32_C(0x2)
6587 	/*
6588 	 * If set to 1, then FW based DCBX agent is enabled and running on the
6589 	 * port associated with this function. If set to 0, then DCBX agent is
6590 	 * not running in the firmware.
6591 	 */
6592 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED  UINT32_C(0x4)
6593 	/*
6594 	 * Standard TX Ring mode is used for the allocation of TX ring and
6595 	 * underlying scheduling resources that allow bandwidth reservation and
6596 	 * limit settings on the queried function. If set to 1, then standard TX
6597 	 * ring mode is enabled on the queried function. If set to 0, then the
6598 	 * standard TX ring mode is disabled on the queried function. In this
6599 	 * extended TX ring resource mode, the minimum and maximum bandwidth
6600 	 * settings are not supported to allow the allocation of TX rings to
6601 	 * span multiple scheduler nodes.
6602 	 */
6603 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED UINT32_C(0x8)
6604 	/*
6605 	 * If set to 1 then FW based LLDP agent is enabled and running on the
6606 	 * port associated with this function. If set to 0 then the LLDP agent
6607 	 * is not running in the firmware.
6608 	 */
6609 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED  UINT32_C(0x10)
6610 	/*
6611 	 * If set to 1, then multi-host mode is active for this function. If set
6612 	 * to 0, then multi-host mode is inactive for this function or not
6613 	 * applicable for this device.
6614 	 */
6615 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST		UINT32_C(0x20)
6616 	uint8_t mac_address[6];
6617 	/*
6618 	 * This value is current MAC address configured for this function. A
6619 	 * value of 00-00-00-00-00-00 indicates no MAC address is currently
6620 	 * configured.
6621 	 */
6622 	uint16_t pci_id;
6623 	/*
6624 	 * This value is current PCI ID of this function. If ARI is enabled,
6625 	 * then it is Bus Number (8b):Function Number(8b). Otherwise, it is Bus
6626 	 * Number (8b):Device Number (4b):Function Number(4b). If multi-host
6627 	 * mode is active, the 4 lsb will indicate the PF index for this
6628 	 * function.
6629 	 */
6630 	uint16_t alloc_rsscos_ctx;
6631 	/* The number of RSS/COS contexts currently allocated to the function. */
6632 	uint16_t alloc_cmpl_rings;
6633 	/*
6634 	 * The number of completion rings currently allocated to the function.
6635 	 * This does not include the rings allocated to any children functions
6636 	 * if any.
6637 	 */
6638 	uint16_t alloc_tx_rings;
6639 	/*
6640 	 * The number of transmit rings currently allocated to the function.
6641 	 * This does not include the rings allocated to any children functions
6642 	 * if any.
6643 	 */
6644 	uint16_t alloc_rx_rings;
6645 	/*
6646 	 * The number of receive rings currently allocated to the function. This
6647 	 * does not include the rings allocated to any children functions if
6648 	 * any.
6649 	 */
6650 	uint16_t alloc_l2_ctx;
6651 	/* The allocated number of L2 contexts to the function. */
6652 	uint16_t alloc_vnics;
6653 	/* The allocated number of vnics to the function. */
6654 	uint16_t mtu;
6655 	/*
6656 	 * The maximum transmission unit of the function. For rings allocated on
6657 	 * this function, this default value is used if ring MTU is not
6658 	 * specified.
6659 	 */
6660 	uint16_t mru;
6661 	/*
6662 	 * The maximum receive unit of the function. For vnics allocated on this
6663 	 * function, this default value is used if vnic MRU is not specified.
6664 	 */
6665 	uint16_t stat_ctx_id;
6666 	/* The statistics context assigned to a function. */
6667 	uint8_t port_partition_type;
6668 	/*
6669 	 * The HWRM shall return Unknown value for this field when this command
6670 	 * is used to query VF's configuration.
6671 	 */
6672 	/* Single physical function */
6673 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF	UINT32_C(0x0)
6674 	/* Multiple physical functions */
6675 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS	UINT32_C(0x1)
6676 	/* Network Partitioning 1.0 */
6677 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
6678 	/* Network Partitioning 1.5 */
6679 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
6680 	/* Network Partitioning 2.0 */
6681 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
6682 	/* Unknown */
6683 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
6684 	uint8_t port_pf_cnt;
6685 	/*
6686 	 * This field will indicate number of physical functions on this
6687 	 * port_partition. HWRM shall return unavail (i.e. value of 0) for this
6688 	 * field when this command is used to query VF's configuration or from
6689 	 * older firmware that doesn't support this field.
6690 	 */
6691 	/* number of PFs is not available */
6692 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL	UINT32_C(0x0)
6693 	uint16_t dflt_vnic_id;
6694 	/* The default VNIC ID assigned to a function that is being queried. */
6695 	uint8_t unused_0;
6696 	uint8_t unused_1;
6697 	uint32_t min_bw;
6698 	/*
6699 	 * Minimum BW allocated for this function. The HWRM will translate this
6700 	 * value into byte counter and time interval used for the scheduler
6701 	 * inside the device. A value of 0 indicates the minimum bandwidth is
6702 	 * not configured.
6703 	 */
6704 	/* The bandwidth value. */
6705 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK	UINT32_C(0xfffffff)
6706 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT	0
6707 	/* The granularity of the value (bits or bytes). */
6708 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE		UINT32_C(0x10000000)
6709 	/* Value is in bits. */
6710 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS	(UINT32_C(0x0) << 28)
6711 	/* Value is in bytes. */
6712 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES	(UINT32_C(0x1) << 28)
6713 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST	HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
6714 	/* bw_value_unit is 3 b */
6715 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
6716 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
6717 	/* Value is in Mb or MB (base 10). */
6718 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA   (UINT32_C(0x0) << 29)
6719 	/* Value is in Kb or KB (base 10). */
6720 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO   (UINT32_C(0x2) << 29)
6721 	/* Value is in bits or bytes. */
6722 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE   (UINT32_C(0x4) << 29)
6723 	/* Value is in Gb or GB (base 10). */
6724 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA   (UINT32_C(0x6) << 29)
6725 	/* Value is in 1/100th of a percentage of total bandwidth. */
6726 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
6727 	/* Invalid unit */
6728 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
6729 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
6730 	uint32_t max_bw;
6731 	/*
6732 	 * Maximum BW allocated for this function. The HWRM will translate this
6733 	 * value into byte counter and time interval used for the scheduler
6734 	 * inside the device. A value of 0 indicates that the maximum bandwidth
6735 	 * is not configured.
6736 	 */
6737 	/* The bandwidth value. */
6738 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK	UINT32_C(0xfffffff)
6739 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT	0
6740 	/* The granularity of the value (bits or bytes). */
6741 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE		UINT32_C(0x10000000)
6742 	/* Value is in bits. */
6743 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS	(UINT32_C(0x0) << 28)
6744 	/* Value is in bytes. */
6745 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES	(UINT32_C(0x1) << 28)
6746 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST	HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
6747 	/* bw_value_unit is 3 b */
6748 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
6749 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
6750 	/* Value is in Mb or MB (base 10). */
6751 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA   (UINT32_C(0x0) << 29)
6752 	/* Value is in Kb or KB (base 10). */
6753 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO   (UINT32_C(0x2) << 29)
6754 	/* Value is in bits or bytes. */
6755 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE   (UINT32_C(0x4) << 29)
6756 	/* Value is in Gb or GB (base 10). */
6757 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA   (UINT32_C(0x6) << 29)
6758 	/* Value is in 1/100th of a percentage of total bandwidth. */
6759 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
6760 	/* Invalid unit */
6761 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
6762 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
6763 	uint8_t evb_mode;
6764 	/*
6765 	 * This value indicates the Edge virtual bridge mode for the domain that
6766 	 * this function belongs to.
6767 	 */
6768 	/* No Edge Virtual Bridging (EVB) */
6769 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB		UINT32_C(0x0)
6770 	/* Virtual Ethernet Bridge (VEB) */
6771 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB		UINT32_C(0x1)
6772 	/* Virtual Ethernet Port Aggregator (VEPA) */
6773 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA		UINT32_C(0x2)
6774 	uint8_t unused_2;
6775 	uint16_t alloc_vfs;
6776 	/*
6777 	 * The number of VFs that are allocated to the function. This is valid
6778 	 * only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command
6779 	 * is called on a PF with SR-IOV disabled or on a VF.
6780 	 */
6781 	uint32_t alloc_mcast_filters;
6782 	/*
6783 	 * The number of allocated multicast filters for this function on the RX
6784 	 * side.
6785 	 */
6786 	uint32_t alloc_hw_ring_grps;
6787 	/* The number of allocated HW ring groups for this function. */
6788 	uint16_t alloc_sp_tx_rings;
6789 	/*
6790 	 * The number of strict priority transmit rings out of currently
6791 	 * allocated TX rings to the function (alloc_tx_rings).
6792 	 */
6793 	uint8_t unused_3;
6794 	uint8_t valid;
6795 	/*
6796 	 * This field is used in Output records to indicate that the output is
6797 	 * completely written to RAM. This field should be read as '1' to
6798 	 * indicate that the output has been completely written. When writing a
6799 	 * command completion or response to an internal processor, the order of
6800 	 * writes has to be such that this field is written last.
6801 	 */
6802 } __attribute__((packed));
6803 
6804 /* hwrm_func_vlan_qcfg */
6805 /*
6806  * Description: This command should be called by PF driver to get the current
6807  * C-TAG, S-TAG and correcponsing PCP and TPID values configured for the
6808  * function.
6809  */
6810 /* Input (24 bytes) */
6811 
6812 struct hwrm_func_vlan_qcfg_input {
6813 	uint16_t req_type;
6814 	/*
6815 	 * This value indicates what type of request this is. The format for the
6816 	 * rest of the command is determined by this field.
6817 	 */
6818 	uint16_t cmpl_ring;
6819 	/*
6820 	 * This value indicates the what completion ring the request will be
6821 	 * optionally completed on. If the value is -1, then no CR completion
6822 	 * will be generated. Any other value must be a valid CR ring_id value
6823 	 * for this function.
6824 	 */
6825 	uint16_t seq_id;
6826 	/* This value indicates the command sequence number. */
6827 	uint16_t target_id;
6828 	/*
6829 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6830 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6831 	 */
6832 	uint64_t resp_addr;
6833 	/*
6834 	 * This is the host address where the response will be written when the
6835 	 * request is complete. This area must be 16B aligned and must be
6836 	 * cleared to zero before the request is made.
6837 	 */
6838 	uint16_t fid;
6839 	/*
6840 	 * Function ID of the function that is being configured. If set to
6841 	 * 0xFF... (All Fs), then the configuration is for the requesting
6842 	 * function.
6843 	 */
6844 	uint16_t unused_0[3];
6845 } __attribute__((packed));
6846 
6847 /* Output (40 bytes) */
6848 
6849 struct hwrm_func_vlan_qcfg_output {
6850 	uint16_t error_code;
6851 	/*
6852 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6853 	 * and fail the call with an error when appropriate
6854 	 */
6855 	uint16_t req_type;
6856 	/* This field returns the type of original request. */
6857 	uint16_t seq_id;
6858 	/* This field provides original sequence number of the command. */
6859 	uint16_t resp_len;
6860 	/*
6861 	 * This field is the length of the response in bytes. The last byte of
6862 	 * the response is a valid flag that will read as '1' when the command
6863 	 * has been completely written to memory.
6864 	 */
6865 	uint32_t unused_0;
6866 	uint8_t unused_1;
6867 	uint8_t unused_2;
6868 	uint8_t unused_3;
6869 	uint8_t valid;
6870 	/*
6871 	 * This field is used in Output records to indicate that the output is
6872 	 * completely written to RAM. This field should be read as '1' to
6873 	 * indicate that the output has been completely written. When writing a
6874 	 * command completion or response to an internal processor, the order of
6875 	 * writes has to be such that this field is written last.
6876 	 */
6877 	uint16_t stag_vid;
6878 	/* S-TAG VLAN identifier configured for the function. */
6879 	uint8_t stag_pcp;
6880 	/* S-TAG PCP value configured for the function. */
6881 	uint8_t unused_4;
6882 	uint16_t stag_tpid; /* big endian */
6883 	/*
6884 	 * S-TAG TPID value configured for the function. This field is specified
6885 	 * in network byte order.
6886 	 */
6887 	uint16_t ctag_vid;
6888 	/* C-TAG VLAN identifier configured for the function. */
6889 	uint8_t ctag_pcp;
6890 	/* C-TAG PCP value configured for the function. */
6891 	uint8_t unused_5;
6892 	uint16_t ctag_tpid; /* big endian */
6893 	/*
6894 	 * C-TAG TPID value configured for the function. This field is specified
6895 	 * in network byte order.
6896 	 */
6897 	uint32_t rsvd2;
6898 	/* Future use. */
6899 	uint32_t rsvd3;
6900 	/* Future use. */
6901 	uint32_t unused_6;
6902 } __attribute__((packed));
6903 
6904 /* hwrm_func_vlan_cfg */
6905 /*
6906  * Description: This command allows PF driver to configure C-TAG, S-TAG and
6907  * corresponding PCP and TPID values for a function.
6908  */
6909 /* Input (48 bytes) */
6910 
6911 struct hwrm_func_vlan_cfg_input {
6912 	uint16_t req_type;
6913 	/*
6914 	 * This value indicates what type of request this is. The format for the
6915 	 * rest of the command is determined by this field.
6916 	 */
6917 	uint16_t cmpl_ring;
6918 	/*
6919 	 * This value indicates the what completion ring the request will be
6920 	 * optionally completed on. If the value is -1, then no CR completion
6921 	 * will be generated. Any other value must be a valid CR ring_id value
6922 	 * for this function.
6923 	 */
6924 	uint16_t seq_id;
6925 	/* This value indicates the command sequence number. */
6926 	uint16_t target_id;
6927 	/*
6928 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
6929 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
6930 	 */
6931 	uint64_t resp_addr;
6932 	/*
6933 	 * This is the host address where the response will be written when the
6934 	 * request is complete. This area must be 16B aligned and must be
6935 	 * cleared to zero before the request is made.
6936 	 */
6937 	uint16_t fid;
6938 	/*
6939 	 * Function ID of the function that is being configured. If set to
6940 	 * 0xFF... (All Fs), then the configuration is for the requesting
6941 	 * function.
6942 	 */
6943 	uint8_t unused_0;
6944 	uint8_t unused_1;
6945 	uint32_t enables;
6946 	/* This bit must be '1' for the stag_vid field to be configured. */
6947 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID	UINT32_C(0x1)
6948 	/* This bit must be '1' for the ctag_vid field to be configured. */
6949 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID	UINT32_C(0x2)
6950 	/* This bit must be '1' for the stag_pcp field to be configured. */
6951 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP	UINT32_C(0x4)
6952 	/* This bit must be '1' for the ctag_pcp field to be configured. */
6953 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP	UINT32_C(0x8)
6954 	/* This bit must be '1' for the stag_tpid field to be configured. */
6955 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID	UINT32_C(0x10)
6956 	/* This bit must be '1' for the ctag_tpid field to be configured. */
6957 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID	UINT32_C(0x20)
6958 	uint16_t stag_vid;
6959 	/* S-TAG VLAN identifier configured for the function. */
6960 	uint8_t stag_pcp;
6961 	/* S-TAG PCP value configured for the function. */
6962 	uint8_t unused_2;
6963 	uint16_t stag_tpid; /* big endian */
6964 	/*
6965 	 * S-TAG TPID value configured for the function. This field is specified
6966 	 * in network byte order.
6967 	 */
6968 	uint16_t ctag_vid;
6969 	/* C-TAG VLAN identifier configured for the function. */
6970 	uint8_t ctag_pcp;
6971 	/* C-TAG PCP value configured for the function. */
6972 	uint8_t unused_3;
6973 	uint16_t ctag_tpid; /* big endian */
6974 	/*
6975 	 * C-TAG TPID value configured for the function. This field is specified
6976 	 * in network byte order.
6977 	 */
6978 	uint32_t rsvd1;
6979 	/* Future use. */
6980 	uint32_t rsvd2;
6981 	/* Future use. */
6982 	uint32_t unused_4;
6983 } __attribute__((packed));
6984 
6985 /* Output (16 bytes) */
6986 
6987 struct hwrm_func_vlan_cfg_output {
6988 	uint16_t error_code;
6989 	/*
6990 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
6991 	 * and fail the call with an error when appropriate
6992 	 */
6993 	uint16_t req_type;
6994 	/* This field returns the type of original request. */
6995 	uint16_t seq_id;
6996 	/* This field provides original sequence number of the command. */
6997 	uint16_t resp_len;
6998 	/*
6999 	 * This field is the length of the response in bytes. The last byte of
7000 	 * the response is a valid flag that will read as '1' when the command
7001 	 * has been completely written to memory.
7002 	 */
7003 	uint32_t unused_0;
7004 	uint8_t unused_1;
7005 	uint8_t unused_2;
7006 	uint8_t unused_3;
7007 	uint8_t valid;
7008 	/*
7009 	 * This field is used in Output records to indicate that the output is
7010 	 * completely written to RAM. This field should be read as '1' to
7011 	 * indicate that the output has been completely written. When writing a
7012 	 * command completion or response to an internal processor, the order of
7013 	 * writes has to be such that this field is written last.
7014 	 */
7015 } __attribute__((packed));
7016 
7017 /* hwrm_func_cfg */
7018 /*
7019  * Description: This command allows configuration of a PF by the corresponding
7020  * PF driver. This command also allows configuration of a child VF by its parent
7021  * PF driver. The input FID value is used to indicate what function is being
7022  * configured. This allows a PF driver to configure the PF owned by itself or a
7023  * virtual function that is a child of the PF. This command allows to reserve
7024  * resources for a VF by its parent PF. To reverse the process, the command
7025  * should be called with all enables flags cleared for resources. This will free
7026  * allocated resources for the VF and return them to the resource pool. If this
7027  * command is requested by a VF driver to configure or reserve resources, then
7028  * the HWRM shall fail this command. If default MAC address and/or VLAN are
7029  * provided in this command, then the HWRM shall set up appropriate MAC/VLAN
7030  * filters for the function that is being configured. If source properties
7031  * checks are enabled and default MAC address and/or IP address are provided in
7032  * this command, then the HWRM shall set appropriate source property checks
7033  * based on provided MAC and/or IP addresses. The parent PF driver should not
7034  * set MTU/MRU for a VF using this command. This is to allow MTU/MRU setting by
7035  * the VF driver. If the MTU or MRU for a VF is set by the PF driver, then the
7036  * HWRM should ignore it. A function's MTU/MRU should be set prior to allocating
7037  * RX VNICs or TX rings. A PF driver calls hwrm_func_cfg to allocate resources
7038  * for itself or its children VFs. All function drivers shall call hwrm_func_cfg
7039  * to reserve resources. A request to hwrm_func_cfg may not be fully granted;
7040  * that is, a request for resources may be larger than what can be supported by
7041  * the device and the HWRM will allocate the best set of resources available,
7042  * but that may be less than requested. If all the amounts requested could not
7043  * be fulfilled, the HWRM shall allocate what it could and return a status code
7044  * of success. A function driver should call hwrm_func_qcfg immediately after
7045  * hwrm_func_cfg to determine what resources were assigned to the configured
7046  * function. A call by a PF driver to hwrm_func_cfg to allocate resources for
7047  * itself shall only allocate resources for the PF driver to use, not for its
7048  * children VFs. Likewise, a call to hwrm_func_qcfg shall return the resources
7049  * available for the PF driver to use, not what is available to its children
7050  * VFs.
7051  */
7052 /* Input (88 bytes) */
7053 
7054 struct hwrm_func_cfg_input {
7055 	uint16_t req_type;
7056 	/*
7057 	 * This value indicates what type of request this is. The format for the
7058 	 * rest of the command is determined by this field.
7059 	 */
7060 	uint16_t cmpl_ring;
7061 	/*
7062 	 * This value indicates the what completion ring the request will be
7063 	 * optionally completed on. If the value is -1, then no CR completion
7064 	 * will be generated. Any other value must be a valid CR ring_id value
7065 	 * for this function.
7066 	 */
7067 	uint16_t seq_id;
7068 	/* This value indicates the command sequence number. */
7069 	uint16_t target_id;
7070 	/*
7071 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7072 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7073 	 */
7074 	uint64_t resp_addr;
7075 	/*
7076 	 * This is the host address where the response will be written when the
7077 	 * request is complete. This area must be 16B aligned and must be
7078 	 * cleared to zero before the request is made.
7079 	 */
7080 	uint16_t fid;
7081 	/*
7082 	 * Function ID of the function that is being configured. If set to
7083 	 * 0xFF... (All Fs), then the the configuration is for the requesting
7084 	 * function.
7085 	 */
7086 	uint8_t unused_0;
7087 	uint8_t unused_1;
7088 	uint32_t flags;
7089 	/*
7090 	 * When this bit is '1', the function is disabled with source MAC
7091 	 * address check. This is an anti-spoofing check. If this flag is set,
7092 	 * then the function shall be configured to disallow transmission of
7093 	 * frames with the source MAC address that is configured for this
7094 	 * function.
7095 	 */
7096 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE UINT32_C(0x1)
7097 	/*
7098 	 * When this bit is '1', the function is enabled with source MAC address
7099 	 * check. This is an anti-spoofing check. If this flag is set, then the
7100 	 * function shall be configured to allow transmission of frames with the
7101 	 * source MAC address that is configured for this function.
7102 	 */
7103 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE UINT32_C(0x2)
7104 	/* reserved */
7105 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK		UINT32_C(0x1fc)
7106 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT		2
7107 	/*
7108 	 * Standard TX Ring mode is used for the allocation of TX ring and
7109 	 * underlying scheduling resources that allow bandwidth reservation and
7110 	 * limit settings on the queried function. If set to 1, then standard TX
7111 	 * ring mode is requested to be enabled on the function being
7112 	 * configured.
7113 	 */
7114 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE  UINT32_C(0x200)
7115 	/*
7116 	 * Standard TX Ring mode is used for the allocation of TX ring and
7117 	 * underlying scheduling resources that allow bandwidth reservation and
7118 	 * limit settings on the queried function. If set to 1, then the
7119 	 * standard TX ring mode is requested to be disabled on the function
7120 	 * being configured. In this extended TX ring resource mode, the minimum
7121 	 * and maximum bandwidth settings are not supported to allow the
7122 	 * allocation of TX rings to span multiple scheduler nodes.
7123 	 */
7124 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE UINT32_C(0x400)
7125 	/*
7126 	 * If this bit is set, virtual mac address configured in this command
7127 	 * will be persistent over warm boot.
7128 	 */
7129 	#define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST	UINT32_C(0x800)
7130 	/*
7131 	 * This bit only applies to the VF. If this bit is set, the statistic
7132 	 * context counters will not be cleared when the statistic context is
7133 	 * freed or a function reset is called on VF. This bit will be cleared
7134 	 * when the PF is unloaded or a function reset is called on the PF.
7135 	 */
7136 	#define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC   UINT32_C(0x1000)
7137 	/*
7138 	 * This bit requests that the firmware test to see if all the assets
7139 	 * requested in this command (i.e. number of TX rings) are available.
7140 	 * The firmware will return an error if the requested assets are not
7141 	 * available. The firwmare will NOT reserve the assets if they are
7142 	 * available.
7143 	 */
7144 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST	UINT32_C(0x2000)
7145 	uint32_t enables;
7146 	/* This bit must be '1' for the mtu field to be configured. */
7147 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MTU			UINT32_C(0x1)
7148 	/* This bit must be '1' for the mru field to be configured. */
7149 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x2)
7150 	/* This bit must be '1' for the num_rsscos_ctxs field to be configured. */
7151 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS	UINT32_C(0x4)
7152 	/* This bit must be '1' for the num_cmpl_rings field to be configured. */
7153 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS	UINT32_C(0x8)
7154 	/* This bit must be '1' for the num_tx_rings field to be configured. */
7155 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS	UINT32_C(0x10)
7156 	/* This bit must be '1' for the num_rx_rings field to be configured. */
7157 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS	UINT32_C(0x20)
7158 	/* This bit must be '1' for the num_l2_ctxs field to be configured. */
7159 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS		UINT32_C(0x40)
7160 	/* This bit must be '1' for the num_vnics field to be configured. */
7161 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS		UINT32_C(0x80)
7162 	/* This bit must be '1' for the num_stat_ctxs field to be configured. */
7163 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS	UINT32_C(0x100)
7164 	/* This bit must be '1' for the dflt_mac_addr field to be configured. */
7165 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR	UINT32_C(0x200)
7166 	/* This bit must be '1' for the dflt_vlan field to be configured. */
7167 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN		UINT32_C(0x400)
7168 	/* This bit must be '1' for the dflt_ip_addr field to be configured. */
7169 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR	UINT32_C(0x800)
7170 	/* This bit must be '1' for the min_bw field to be configured. */
7171 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW		UINT32_C(0x1000)
7172 	/* This bit must be '1' for the max_bw field to be configured. */
7173 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW		UINT32_C(0x2000)
7174 	/* This bit must be '1' for the async_event_cr field to be configured. */
7175 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4000)
7176 	/*
7177 	 * This bit must be '1' for the vlan_antispoof_mode field to be
7178 	 * configured.
7179 	 */
7180 	#define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE	UINT32_C(0x8000)
7181 	/*
7182 	 * This bit must be '1' for the allowed_vlan_pris field to be
7183 	 * configured.
7184 	 */
7185 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS	UINT32_C(0x10000)
7186 	/* This bit must be '1' for the evb_mode field to be configured. */
7187 	#define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE		UINT32_C(0x20000)
7188 	/*
7189 	 * This bit must be '1' for the num_mcast_filters field to be
7190 	 * configured.
7191 	 */
7192 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS	UINT32_C(0x40000)
7193 	/* This bit must be '1' for the num_hw_ring_grps field to be configured. */
7194 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS	UINT32_C(0x80000)
7195 	uint16_t mtu;
7196 	/*
7197 	 * The maximum transmission unit of the function. The HWRM should make
7198 	 * sure that the mtu of the function does not exceed the mtu of the
7199 	 * physical port that this function is associated with. In addition to
7200 	 * configuring mtu per function, it is possible to configure mtu per
7201 	 * transmit ring. By default, the mtu of each transmit ring associated
7202 	 * with a function is equal to the mtu of the function. The HWRM should
7203 	 * make sure that the mtu of each transmit ring that is assigned to a
7204 	 * function has a valid mtu.
7205 	 */
7206 	uint16_t mru;
7207 	/*
7208 	 * The maximum receive unit of the function. The HWRM should make sure
7209 	 * that the mru of the function does not exceed the mru of the physical
7210 	 * port that this function is associated with. In addition to
7211 	 * configuring mru per function, it is possible to configure mru per
7212 	 * vnic. By default, the mru of each vnic associated with a function is
7213 	 * equal to the mru of the function. The HWRM should make sure that the
7214 	 * mru of each vnic that is assigned to a function has a valid mru.
7215 	 */
7216 	uint16_t num_rsscos_ctxs;
7217 	/* The number of RSS/COS contexts requested for the function. */
7218 	uint16_t num_cmpl_rings;
7219 	/*
7220 	 * The number of completion rings requested for the function. This does
7221 	 * not include the rings allocated to any children functions if any.
7222 	 */
7223 	uint16_t num_tx_rings;
7224 	/*
7225 	 * The number of transmit rings requested for the function. This does
7226 	 * not include the rings allocated to any children functions if any.
7227 	 */
7228 	uint16_t num_rx_rings;
7229 	/*
7230 	 * The number of receive rings requested for the function. This does not
7231 	 * include the rings allocated to any children functions if any.
7232 	 */
7233 	uint16_t num_l2_ctxs;
7234 	/* The requested number of L2 contexts for the function. */
7235 	uint16_t num_vnics;
7236 	/* The requested number of vnics for the function. */
7237 	uint16_t num_stat_ctxs;
7238 	/* The requested number of statistic contexts for the function. */
7239 	uint16_t num_hw_ring_grps;
7240 	/*
7241 	 * The number of HW ring groups that should be reserved for this
7242 	 * function.
7243 	 */
7244 	uint8_t dflt_mac_addr[6];
7245 	/* The default MAC address for the function being configured. */
7246 	uint16_t dflt_vlan;
7247 	/*
7248 	 * The default VLAN for the function being configured. This field's
7249 	 * format is same as 802.1Q Tag's Tag Control Information (TCI) format
7250 	 * that includes both Priority Code Point (PCP) and VLAN Identifier
7251 	 * (VID).
7252 	 */
7253 	uint32_t dflt_ip_addr[4]; /* big endian */
7254 	/*
7255 	 * The default IP address for the function being configured. This
7256 	 * address is only used in enabling source property check.
7257 	 */
7258 	uint32_t min_bw;
7259 	/*
7260 	 * Minimum BW allocated for this function. The HWRM will translate this
7261 	 * value into byte counter and time interval used for the scheduler
7262 	 * inside the device.
7263 	 */
7264 	/* The bandwidth value. */
7265 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK	UINT32_C(0xfffffff)
7266 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT		0
7267 	/* The granularity of the value (bits or bytes). */
7268 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE		UINT32_C(0x10000000)
7269 	/* Value is in bits. */
7270 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
7271 	/* Value is in bytes. */
7272 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
7273 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST	HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
7274 	/* bw_value_unit is 3 b */
7275 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
7276 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
7277 	/* Value is in Mb or MB (base 10). */
7278 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
7279 	/* Value is in Kb or KB (base 10). */
7280 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
7281 	/* Value is in bits or bytes. */
7282 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
7283 	/* Value is in Gb or GB (base 10). */
7284 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
7285 	/* Value is in 1/100th of a percentage of total bandwidth. */
7286 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
7287 	/* Invalid unit */
7288 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID  (UINT32_C(0x7) << 29)
7289 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
7290 	uint32_t max_bw;
7291 	/*
7292 	 * Maximum BW allocated for this function. The HWRM will translate this
7293 	 * value into byte counter and time interval used for the scheduler
7294 	 * inside the device.
7295 	 */
7296 	/* The bandwidth value. */
7297 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK	UINT32_C(0xfffffff)
7298 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT		0
7299 	/* The granularity of the value (bits or bytes). */
7300 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE		UINT32_C(0x10000000)
7301 	/* Value is in bits. */
7302 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
7303 	/* Value is in bytes. */
7304 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
7305 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST	HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
7306 	/* bw_value_unit is 3 b */
7307 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
7308 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
7309 	/* Value is in Mb or MB (base 10). */
7310 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
7311 	/* Value is in Kb or KB (base 10). */
7312 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
7313 	/* Value is in bits or bytes. */
7314 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
7315 	/* Value is in Gb or GB (base 10). */
7316 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
7317 	/* Value is in 1/100th of a percentage of total bandwidth. */
7318 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
7319 	/* Invalid unit */
7320 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID  (UINT32_C(0x7) << 29)
7321 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
7322 	uint16_t async_event_cr;
7323 	/*
7324 	 * ID of the target completion ring for receiving asynchronous event
7325 	 * completions. If this field is not valid, then the HWRM shall use the
7326 	 * default completion ring of the function that is being configured as
7327 	 * the target completion ring for providing any asynchronous event
7328 	 * completions for that function. If this field is valid, then the HWRM
7329 	 * shall use the completion ring identified by this ID as the target
7330 	 * completion ring for providing any asynchronous event completions for
7331 	 * the function that is being configured.
7332 	 */
7333 	uint8_t vlan_antispoof_mode;
7334 	/* VLAN Anti-spoofing mode. */
7335 	/* No VLAN anti-spoofing checks are enabled */
7336 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK   UINT32_C(0x0)
7337 	/* Validate VLAN against the configured VLAN(s) */
7338 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN UINT32_C(0x1)
7339 	/* Insert VLAN if it does not exist, otherwise discard */
7340 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE UINT32_C(0x2)
7341 	/* Insert VLAN if it does not exist, override VLAN if it exists */
7342 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN UINT32_C(0x3)
7343 	uint8_t allowed_vlan_pris;
7344 	/*
7345 	 * This bit field defines VLAN PRIs that are allowed on this function.
7346 	 * If nth bit is set, then VLAN PRI n is allowed on this function.
7347 	 */
7348 	uint8_t evb_mode;
7349 	/*
7350 	 * The HWRM shall allow a PF driver to change EVB mode for the partition
7351 	 * it belongs to. The HWRM shall not allow a VF driver to change the EVB
7352 	 * mode. The HWRM shall take into account the switching of EVB mode from
7353 	 * one to another and reconfigure hardware resources as appropriately.
7354 	 * The switching from VEB to VEPA mode requires the disabling of the
7355 	 * loopback traffic. Additionally, source knock outs are handled
7356 	 * differently in VEB and VEPA modes.
7357 	 */
7358 	/* No Edge Virtual Bridging (EVB) */
7359 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB		UINT32_C(0x0)
7360 	/* Virtual Ethernet Bridge (VEB) */
7361 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB		UINT32_C(0x1)
7362 	/* Virtual Ethernet Port Aggregator (VEPA) */
7363 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA		UINT32_C(0x2)
7364 	uint8_t unused_2;
7365 	uint16_t num_mcast_filters;
7366 	/*
7367 	 * The number of multicast filters that should be reserved for this
7368 	 * function on the RX side.
7369 	 */
7370 } __attribute__((packed));
7371 
7372 /* Output (16 bytes) */
7373 
7374 struct hwrm_func_cfg_output {
7375 	uint16_t error_code;
7376 	/*
7377 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7378 	 * and fail the call with an error when appropriate
7379 	 */
7380 	uint16_t req_type;
7381 	/* This field returns the type of original request. */
7382 	uint16_t seq_id;
7383 	/* This field provides original sequence number of the command. */
7384 	uint16_t resp_len;
7385 	/*
7386 	 * This field is the length of the response in bytes. The last byte of
7387 	 * the response is a valid flag that will read as '1' when the command
7388 	 * has been completely written to memory.
7389 	 */
7390 	uint32_t unused_0;
7391 	uint8_t unused_1;
7392 	uint8_t unused_2;
7393 	uint8_t unused_3;
7394 	uint8_t valid;
7395 	/*
7396 	 * This field is used in Output records to indicate that the output is
7397 	 * completely written to RAM. This field should be read as '1' to
7398 	 * indicate that the output has been completely written. When writing a
7399 	 * command completion or response to an internal processor, the order of
7400 	 * writes has to be such that this field is written last.
7401 	 */
7402 } __attribute__((packed));
7403 
7404 /* hwrm_func_qstats */
7405 /*
7406  * Description: This command returns statistics of a function. The input FID
7407  * value is used to indicate what function is being queried. This allows a
7408  * physical function driver to query virtual functions that are children of the
7409  * physical function. The HWRM shall return any unsupported counter with a value
7410  * of 0xFFFFFFFF for 32-bit counters and 0xFFFFFFFFFFFFFFFF for 64-bit counters.
7411  */
7412 /* Input (24 bytes) */
7413 
7414 struct hwrm_func_qstats_input {
7415 	uint16_t req_type;
7416 	/*
7417 	 * This value indicates what type of request this is. The format for the
7418 	 * rest of the command is determined by this field.
7419 	 */
7420 	uint16_t cmpl_ring;
7421 	/*
7422 	 * This value indicates the what completion ring the request will be
7423 	 * optionally completed on. If the value is -1, then no CR completion
7424 	 * will be generated. Any other value must be a valid CR ring_id value
7425 	 * for this function.
7426 	 */
7427 	uint16_t seq_id;
7428 	/* This value indicates the command sequence number. */
7429 	uint16_t target_id;
7430 	/*
7431 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7432 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7433 	 */
7434 	uint64_t resp_addr;
7435 	/*
7436 	 * This is the host address where the response will be written when the
7437 	 * request is complete. This area must be 16B aligned and must be
7438 	 * cleared to zero before the request is made.
7439 	 */
7440 	uint16_t fid;
7441 	/*
7442 	 * Function ID of the function that is being queried. 0xFF... (All Fs)
7443 	 * if the query is for the requesting function.
7444 	 */
7445 	uint16_t unused_0[3];
7446 } __attribute__((packed));
7447 
7448 /* Output (176 bytes) */
7449 
7450 struct hwrm_func_qstats_output {
7451 	uint16_t error_code;
7452 	/*
7453 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7454 	 * and fail the call with an error when appropriate
7455 	 */
7456 	uint16_t req_type;
7457 	/* This field returns the type of original request. */
7458 	uint16_t seq_id;
7459 	/* This field provides original sequence number of the command. */
7460 	uint16_t resp_len;
7461 	/*
7462 	 * This field is the length of the response in bytes. The last byte of
7463 	 * the response is a valid flag that will read as '1' when the command
7464 	 * has been completely written to memory.
7465 	 */
7466 	uint64_t tx_ucast_pkts;
7467 	/* Number of transmitted unicast packets on the function. */
7468 	uint64_t tx_mcast_pkts;
7469 	/* Number of transmitted multicast packets on the function. */
7470 	uint64_t tx_bcast_pkts;
7471 	/* Number of transmitted broadcast packets on the function. */
7472 	uint64_t tx_discard_pkts;
7473 	/*
7474 	 * Number of transmitted packets that were discarded due to internal NIC
7475 	 * resource problems. For transmit, this can only happen if TMP is
7476 	 * configured to allow dropping in HOL blocking conditions, which is not
7477 	 * a normal configuration.
7478 	 */
7479 	uint64_t tx_drop_pkts;
7480 	/*
7481 	 * Number of dropped packets on transmit path on the function. These are
7482 	 * packets that have been marked for drop by the TE CFA block or are
7483 	 * packets that exceeded the transmit MTU limit for the function.
7484 	 */
7485 	uint64_t tx_ucast_bytes;
7486 	/* Number of transmitted bytes for unicast traffic on the function. */
7487 	uint64_t tx_mcast_bytes;
7488 	/* Number of transmitted bytes for multicast traffic on the function. */
7489 	uint64_t tx_bcast_bytes;
7490 	/* Number of transmitted bytes for broadcast traffic on the function. */
7491 	uint64_t rx_ucast_pkts;
7492 	/* Number of received unicast packets on the function. */
7493 	uint64_t rx_mcast_pkts;
7494 	/* Number of received multicast packets on the function. */
7495 	uint64_t rx_bcast_pkts;
7496 	/* Number of received broadcast packets on the function. */
7497 	uint64_t rx_discard_pkts;
7498 	/*
7499 	 * Number of received packets that were discarded on the function due to
7500 	 * resource limitations. This can happen for 3 reasons. # The BD used
7501 	 * for the packet has a bad format. # There were no BDs available in the
7502 	 * ring for the packet. # There were no BDs available on-chip for the
7503 	 * packet.
7504 	 */
7505 	uint64_t rx_drop_pkts;
7506 	/*
7507 	 * Number of dropped packets on received path on the function. These are
7508 	 * packets that have been marked for drop by the RE CFA.
7509 	 */
7510 	uint64_t rx_ucast_bytes;
7511 	/* Number of received bytes for unicast traffic on the function. */
7512 	uint64_t rx_mcast_bytes;
7513 	/* Number of received bytes for multicast traffic on the function. */
7514 	uint64_t rx_bcast_bytes;
7515 	/* Number of received bytes for broadcast traffic on the function. */
7516 	uint64_t rx_agg_pkts;
7517 	/* Number of aggregated unicast packets on the function. */
7518 	uint64_t rx_agg_bytes;
7519 	/* Number of aggregated unicast bytes on the function. */
7520 	uint64_t rx_agg_events;
7521 	/* Number of aggregation events on the function. */
7522 	uint64_t rx_agg_aborts;
7523 	/* Number of aborted aggregations on the function. */
7524 	uint32_t unused_0;
7525 	uint8_t unused_1;
7526 	uint8_t unused_2;
7527 	uint8_t unused_3;
7528 	uint8_t valid;
7529 	/*
7530 	 * This field is used in Output records to indicate that the output is
7531 	 * completely written to RAM. This field should be read as '1' to
7532 	 * indicate that the output has been completely written. When writing a
7533 	 * command completion or response to an internal processor, the order of
7534 	 * writes has to be such that this field is written last.
7535 	 */
7536 } __attribute__((packed));
7537 
7538 /* hwrm_func_clr_stats */
7539 /*
7540  * Description: This command clears statistics of a function. The input FID
7541  * value is used to indicate what function's statistics is being cleared. This
7542  * allows a physical function driver to clear statistics of virtual functions
7543  * that are children of the physical function.
7544  */
7545 /* Input (24 bytes) */
7546 
7547 struct hwrm_func_clr_stats_input {
7548 	uint16_t req_type;
7549 	/*
7550 	 * This value indicates what type of request this is. The format for the
7551 	 * rest of the command is determined by this field.
7552 	 */
7553 	uint16_t cmpl_ring;
7554 	/*
7555 	 * This value indicates the what completion ring the request will be
7556 	 * optionally completed on. If the value is -1, then no CR completion
7557 	 * will be generated. Any other value must be a valid CR ring_id value
7558 	 * for this function.
7559 	 */
7560 	uint16_t seq_id;
7561 	/* This value indicates the command sequence number. */
7562 	uint16_t target_id;
7563 	/*
7564 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7565 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7566 	 */
7567 	uint64_t resp_addr;
7568 	/*
7569 	 * This is the host address where the response will be written when the
7570 	 * request is complete. This area must be 16B aligned and must be
7571 	 * cleared to zero before the request is made.
7572 	 */
7573 	uint16_t fid;
7574 	/*
7575 	 * Function ID of the function. 0xFF... (All Fs) if the query is for the
7576 	 * requesting function.
7577 	 */
7578 	uint16_t unused_0[3];
7579 } __attribute__((packed));
7580 
7581 /* Output (16 bytes) */
7582 
7583 struct hwrm_func_clr_stats_output {
7584 	uint16_t error_code;
7585 	/*
7586 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7587 	 * and fail the call with an error when appropriate
7588 	 */
7589 	uint16_t req_type;
7590 	/* This field returns the type of original request. */
7591 	uint16_t seq_id;
7592 	/* This field provides original sequence number of the command. */
7593 	uint16_t resp_len;
7594 	/*
7595 	 * This field is the length of the response in bytes. The last byte of
7596 	 * the response is a valid flag that will read as '1' when the command
7597 	 * has been completely written to memory.
7598 	 */
7599 	uint32_t unused_0;
7600 	uint8_t unused_1;
7601 	uint8_t unused_2;
7602 	uint8_t unused_3;
7603 	uint8_t valid;
7604 	/*
7605 	 * This field is used in Output records to indicate that the output is
7606 	 * completely written to RAM. This field should be read as '1' to
7607 	 * indicate that the output has been completely written. When writing a
7608 	 * command completion or response to an internal processor, the order of
7609 	 * writes has to be such that this field is written last.
7610 	 */
7611 } __attribute__((packed));
7612 
7613 /* hwrm_func_vf_resc_free */
7614 /* Description: This command frees resources of a vf. */
7615 /* Input (24 bytes) */
7616 
7617 struct hwrm_func_vf_resc_free_input {
7618 	uint16_t req_type;
7619 	/*
7620 	 * This value indicates what type of request this is. The format for the
7621 	 * rest of the command is determined by this field.
7622 	 */
7623 	uint16_t cmpl_ring;
7624 	/*
7625 	 * This value indicates the what completion ring the request will be
7626 	 * optionally completed on. If the value is -1, then no CR completion
7627 	 * will be generated. Any other value must be a valid CR ring_id value
7628 	 * for this function.
7629 	 */
7630 	uint16_t seq_id;
7631 	/* This value indicates the command sequence number. */
7632 	uint16_t target_id;
7633 	/*
7634 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7635 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7636 	 */
7637 	uint64_t resp_addr;
7638 	/*
7639 	 * This is the host address where the response will be written when the
7640 	 * request is complete. This area must be 16B aligned and must be
7641 	 * cleared to zero before the request is made.
7642 	 */
7643 	uint16_t vf_id;
7644 	/*
7645 	 * This value is used to identify a Virtual Function (VF). The scope of
7646 	 * VF ID is local within a PF.
7647 	 */
7648 	uint16_t unused_0[3];
7649 } __attribute__((packed));
7650 
7651 /* Output (16 bytes) */
7652 
7653 struct hwrm_func_vf_resc_free_output {
7654 	uint16_t error_code;
7655 	/*
7656 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7657 	 * and fail the call with an error when appropriate
7658 	 */
7659 	uint16_t req_type;
7660 	/* This field returns the type of original request. */
7661 	uint16_t seq_id;
7662 	/* This field provides original sequence number of the command. */
7663 	uint16_t resp_len;
7664 	/*
7665 	 * This field is the length of the response in bytes. The last byte of
7666 	 * the response is a valid flag that will read as '1' when the command
7667 	 * has been completely written to memory.
7668 	 */
7669 	uint32_t unused_0;
7670 	uint8_t unused_1;
7671 	uint8_t unused_2;
7672 	uint8_t unused_3;
7673 	uint8_t valid;
7674 	/*
7675 	 * This field is used in Output records to indicate that the output is
7676 	 * completely written to RAM. This field should be read as '1' to
7677 	 * indicate that the output has been completely written. When writing a
7678 	 * command completion or response to an internal processor, the order of
7679 	 * writes has to be such that this field is written last.
7680 	 */
7681 } __attribute__((packed));
7682 
7683 /* hwrm_func_vf_vnic_ids_query */
7684 /* Description: This command is used to query vf vnic ids. */
7685 /* Input (32 bytes) */
7686 
7687 struct hwrm_func_vf_vnic_ids_query_input {
7688 	uint16_t req_type;
7689 	/*
7690 	 * This value indicates what type of request this is. The format for the
7691 	 * rest of the command is determined by this field.
7692 	 */
7693 	uint16_t cmpl_ring;
7694 	/*
7695 	 * This value indicates the what completion ring the request will be
7696 	 * optionally completed on. If the value is -1, then no CR completion
7697 	 * will be generated. Any other value must be a valid CR ring_id value
7698 	 * for this function.
7699 	 */
7700 	uint16_t seq_id;
7701 	/* This value indicates the command sequence number. */
7702 	uint16_t target_id;
7703 	/*
7704 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7705 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7706 	 */
7707 	uint64_t resp_addr;
7708 	/*
7709 	 * This is the host address where the response will be written when the
7710 	 * request is complete. This area must be 16B aligned and must be
7711 	 * cleared to zero before the request is made.
7712 	 */
7713 	uint16_t vf_id;
7714 	/*
7715 	 * This value is used to identify a Virtual Function (VF). The scope of
7716 	 * VF ID is local within a PF.
7717 	 */
7718 	uint8_t unused_0;
7719 	uint8_t unused_1;
7720 	uint32_t max_vnic_id_cnt;
7721 	/* Max number of vnic ids in vnic id table */
7722 	uint64_t vnic_id_tbl_addr;
7723 	/* This is the address for VF VNIC ID table */
7724 } __attribute__((packed));
7725 
7726 /* Output (16 bytes) */
7727 
7728 struct hwrm_func_vf_vnic_ids_query_output {
7729 	uint16_t error_code;
7730 	/*
7731 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7732 	 * and fail the call with an error when appropriate
7733 	 */
7734 	uint16_t req_type;
7735 	/* This field returns the type of original request. */
7736 	uint16_t seq_id;
7737 	/* This field provides original sequence number of the command. */
7738 	uint16_t resp_len;
7739 	/*
7740 	 * This field is the length of the response in bytes. The last byte of
7741 	 * the response is a valid flag that will read as '1' when the command
7742 	 * has been completely written to memory.
7743 	 */
7744 	uint32_t vnic_id_cnt;
7745 	/* Actual number of vnic ids Each VNIC ID is written as a 32-bit number. */
7746 	uint8_t unused_0;
7747 	uint8_t unused_1;
7748 	uint8_t unused_2;
7749 	uint8_t valid;
7750 	/*
7751 	 * This field is used in Output records to indicate that the output is
7752 	 * completely written to RAM. This field should be read as '1' to
7753 	 * indicate that the output has been completely written. When writing a
7754 	 * command completion or response to an internal processor, the order of
7755 	 * writes has to be such that this field is written last.
7756 	 */
7757 } __attribute__((packed));
7758 
7759 /* hwrm_func_drv_rgtr */
7760 /*
7761  * Description: This command is used by the function driver to register its
7762  * information with the HWRM. A function driver shall implement this command. A
7763  * function driver shall use this command during the driver initialization right
7764  * after the HWRM version discovery and default ring resources allocation.
7765  */
7766 /* Input (80 bytes) */
7767 
7768 struct hwrm_func_drv_rgtr_input {
7769 	uint16_t req_type;
7770 	/*
7771 	 * This value indicates what type of request this is. The format for the
7772 	 * rest of the command is determined by this field.
7773 	 */
7774 	uint16_t cmpl_ring;
7775 	/*
7776 	 * This value indicates the what completion ring the request will be
7777 	 * optionally completed on. If the value is -1, then no CR completion
7778 	 * will be generated. Any other value must be a valid CR ring_id value
7779 	 * for this function.
7780 	 */
7781 	uint16_t seq_id;
7782 	/* This value indicates the command sequence number. */
7783 	uint16_t target_id;
7784 	/*
7785 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7786 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7787 	 */
7788 	uint64_t resp_addr;
7789 	/*
7790 	 * This is the host address where the response will be written when the
7791 	 * request is complete. This area must be 16B aligned and must be
7792 	 * cleared to zero before the request is made.
7793 	 */
7794 	uint32_t flags;
7795 	/*
7796 	 * When this bit is '1', the function driver is requesting all requests
7797 	 * from its children VF drivers to be forwarded to itself. This flag can
7798 	 * only be set by the PF driver. If a VF driver sets this flag, it
7799 	 * should be ignored by the HWRM.
7800 	 */
7801 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE	UINT32_C(0x1)
7802 	/*
7803 	 * When this bit is '1', the function is requesting none of the requests
7804 	 * from its children VF drivers to be forwarded to itself. This flag can
7805 	 * only be set by the PF driver. If a VF driver sets this flag, it
7806 	 * should be ignored by the HWRM.
7807 	 */
7808 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE	UINT32_C(0x2)
7809 	uint32_t enables;
7810 	/* This bit must be '1' for the os_type field to be configured. */
7811 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE	UINT32_C(0x1)
7812 	/* This bit must be '1' for the ver field to be configured. */
7813 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER		UINT32_C(0x2)
7814 	/* This bit must be '1' for the timestamp field to be configured. */
7815 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP	UINT32_C(0x4)
7816 	/* This bit must be '1' for the vf_req_fwd field to be configured. */
7817 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD	UINT32_C(0x8)
7818 	/* This bit must be '1' for the async_event_fwd field to be configured. */
7819 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD   UINT32_C(0x10)
7820 	uint16_t os_type;
7821 	/*
7822 	 * This value indicates the type of OS. The values are based on
7823 	 * CIM_OperatingSystem.mof file as published by the DMTF.
7824 	 */
7825 	/* Unknown */
7826 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN	UINT32_C(0x0)
7827 	/* Other OS not listed below. */
7828 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER		UINT32_C(0x1)
7829 	/* MSDOS OS. */
7830 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS		UINT32_C(0xe)
7831 	/* Windows OS. */
7832 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS	UINT32_C(0x12)
7833 	/* Solaris OS. */
7834 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS	UINT32_C(0x1d)
7835 	/* Linux OS. */
7836 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX		UINT32_C(0x24)
7837 	/* FreeBSD OS. */
7838 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD	UINT32_C(0x2a)
7839 	/* VMware ESXi OS. */
7840 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI		UINT32_C(0x68)
7841 	/* Microsoft Windows 8 64-bit OS. */
7842 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864	UINT32_C(0x73)
7843 	/* Microsoft Windows Server 2012 R2 OS. */
7844 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2	UINT32_C(0x74)
7845 	uint8_t ver_maj;
7846 	/* This is the major version of the driver. */
7847 	uint8_t ver_min;
7848 	/* This is the minor version of the driver. */
7849 	uint8_t ver_upd;
7850 	/* This is the update version of the driver. */
7851 	uint8_t unused_0;
7852 	uint16_t unused_1;
7853 	uint32_t timestamp;
7854 	/*
7855 	 * This is a 32-bit timestamp provided by the driver for keep alive. The
7856 	 * timestamp is in multiples of 1ms.
7857 	 */
7858 	uint32_t unused_2;
7859 	uint32_t vf_req_fwd[8];
7860 	/*
7861 	 * This is a 256-bit bit mask provided by the PF driver for letting the
7862 	 * HWRM know what commands issued by the VF driver to the HWRM should be
7863 	 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
7864 	 * Setting Nth bit to 1 indicates that requests from the VF driver with
7865 	 * req_type equal to N shall be forwarded to the parent PF driver. This
7866 	 * field is not valid for the VF driver.
7867 	 */
7868 	uint32_t async_event_fwd[8];
7869 	/*
7870 	 * This is a 256-bit bit mask provided by the function driver (PF or VF
7871 	 * driver) to indicate the list of asynchronous event completions to be
7872 	 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
7873 	 * by the function driver shall result in the HWRM forwarding
7874 	 * asynchronous event completion with event_id equal to N. If all bits
7875 	 * are set to 0 (value of 0), then the HWRM shall not forward any
7876 	 * asynchronous event completion to this function driver.
7877 	 */
7878 } __attribute__((packed));
7879 
7880 /* Output (16 bytes) */
7881 
7882 struct hwrm_func_drv_rgtr_output {
7883 	uint16_t error_code;
7884 	/*
7885 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7886 	 * and fail the call with an error when appropriate
7887 	 */
7888 	uint16_t req_type;
7889 	/* This field returns the type of original request. */
7890 	uint16_t seq_id;
7891 	/* This field provides original sequence number of the command. */
7892 	uint16_t resp_len;
7893 	/*
7894 	 * This field is the length of the response in bytes. The last byte of
7895 	 * the response is a valid flag that will read as '1' when the command
7896 	 * has been completely written to memory.
7897 	 */
7898 	uint32_t unused_0;
7899 	uint8_t unused_1;
7900 	uint8_t unused_2;
7901 	uint8_t unused_3;
7902 	uint8_t valid;
7903 	/*
7904 	 * This field is used in Output records to indicate that the output is
7905 	 * completely written to RAM. This field should be read as '1' to
7906 	 * indicate that the output has been completely written. When writing a
7907 	 * command completion or response to an internal processor, the order of
7908 	 * writes has to be such that this field is written last.
7909 	 */
7910 } __attribute__((packed));
7911 
7912 /* hwrm_func_drv_unrgtr */
7913 /*
7914  * Description: This command is used by the function driver to un register with
7915  * the HWRM. A function driver shall implement this command. A function driver
7916  * shall use this command during the driver unloading.
7917  */
7918 /* Input (24 bytes) */
7919 
7920 struct hwrm_func_drv_unrgtr_input {
7921 	uint16_t req_type;
7922 	/*
7923 	 * This value indicates what type of request this is. The format for the
7924 	 * rest of the command is determined by this field.
7925 	 */
7926 	uint16_t cmpl_ring;
7927 	/*
7928 	 * This value indicates the what completion ring the request will be
7929 	 * optionally completed on. If the value is -1, then no CR completion
7930 	 * will be generated. Any other value must be a valid CR ring_id value
7931 	 * for this function.
7932 	 */
7933 	uint16_t seq_id;
7934 	/* This value indicates the command sequence number. */
7935 	uint16_t target_id;
7936 	/*
7937 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7938 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7939 	 */
7940 	uint64_t resp_addr;
7941 	/*
7942 	 * This is the host address where the response will be written when the
7943 	 * request is complete. This area must be 16B aligned and must be
7944 	 * cleared to zero before the request is made.
7945 	 */
7946 	uint32_t flags;
7947 	/*
7948 	 * When this bit is '1', the function driver is notifying the HWRM to
7949 	 * prepare for the shutdown.
7950 	 */
7951 	#define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN UINT32_C(0x1)
7952 	uint32_t unused_0;
7953 } __attribute__((packed));
7954 
7955 /* Output (16 bytes) */
7956 
7957 struct hwrm_func_drv_unrgtr_output {
7958 	uint16_t error_code;
7959 	/*
7960 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
7961 	 * and fail the call with an error when appropriate
7962 	 */
7963 	uint16_t req_type;
7964 	/* This field returns the type of original request. */
7965 	uint16_t seq_id;
7966 	/* This field provides original sequence number of the command. */
7967 	uint16_t resp_len;
7968 	/*
7969 	 * This field is the length of the response in bytes. The last byte of
7970 	 * the response is a valid flag that will read as '1' when the command
7971 	 * has been completely written to memory.
7972 	 */
7973 	uint32_t unused_0;
7974 	uint8_t unused_1;
7975 	uint8_t unused_2;
7976 	uint8_t unused_3;
7977 	uint8_t valid;
7978 	/*
7979 	 * This field is used in Output records to indicate that the output is
7980 	 * completely written to RAM. This field should be read as '1' to
7981 	 * indicate that the output has been completely written. When writing a
7982 	 * command completion or response to an internal processor, the order of
7983 	 * writes has to be such that this field is written last.
7984 	 */
7985 } __attribute__((packed));
7986 
7987 /* hwrm_func_buf_rgtr */
7988 /*
7989  * Description: This command is used by the PF driver to register buffers used
7990  * in the PF-VF communication with the HWRM. The PF driver uses this command to
7991  * register buffers for each PF-VF channel. A parent PF may issue this command
7992  * per child VF. If VF ID is not valid, then this command is used to register
7993  * buffers for all children VFs of the PF.
7994  */
7995 /* Input (128 bytes) */
7996 
7997 struct hwrm_func_buf_rgtr_input {
7998 	uint16_t req_type;
7999 	/*
8000 	 * This value indicates what type of request this is. The format for the
8001 	 * rest of the command is determined by this field.
8002 	 */
8003 	uint16_t cmpl_ring;
8004 	/*
8005 	 * This value indicates the what completion ring the request will be
8006 	 * optionally completed on. If the value is -1, then no CR completion
8007 	 * will be generated. Any other value must be a valid CR ring_id value
8008 	 * for this function.
8009 	 */
8010 	uint16_t seq_id;
8011 	/* This value indicates the command sequence number. */
8012 	uint16_t target_id;
8013 	/*
8014 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8015 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8016 	 */
8017 	uint64_t resp_addr;
8018 	/*
8019 	 * This is the host address where the response will be written when the
8020 	 * request is complete. This area must be 16B aligned and must be
8021 	 * cleared to zero before the request is made.
8022 	 */
8023 	uint32_t enables;
8024 	/* This bit must be '1' for the vf_id field to be configured. */
8025 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID		UINT32_C(0x1)
8026 	/* This bit must be '1' for the err_buf_addr field to be configured. */
8027 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR	UINT32_C(0x2)
8028 	uint16_t vf_id;
8029 	/*
8030 	 * This value is used to identify a Virtual Function (VF). The scope of
8031 	 * VF ID is local within a PF.
8032 	 */
8033 	uint16_t req_buf_num_pages;
8034 	/* This field represents the number of pages used for request buffer(s). */
8035 	uint16_t req_buf_page_size;
8036 	/* This field represents the page size used for request buffer(s). */
8037 	/* 16 bytes */
8038 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B	UINT32_C(0x4)
8039 	/* 4 Kbytes */
8040 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K	UINT32_C(0xc)
8041 	/* 8 Kbytes */
8042 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K	UINT32_C(0xd)
8043 	/* 64 Kbytes */
8044 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K	UINT32_C(0x10)
8045 	/* 2 Mbytes */
8046 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M	UINT32_C(0x15)
8047 	/* 4 Mbytes */
8048 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M	UINT32_C(0x16)
8049 	/* 1 Gbytes */
8050 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G	UINT32_C(0x1e)
8051 	uint16_t req_buf_len;
8052 	/* The length of the request buffer per VF in bytes. */
8053 	uint16_t resp_buf_len;
8054 	/* The length of the response buffer in bytes. */
8055 	uint8_t unused_0;
8056 	uint8_t unused_1;
8057 	uint64_t req_buf_page_addr0;
8058 	/* This field represents the page address of page #0. */
8059 	uint64_t req_buf_page_addr1;
8060 	/* This field represents the page address of page #1. */
8061 	uint64_t req_buf_page_addr2;
8062 	/* This field represents the page address of page #2. */
8063 	uint64_t req_buf_page_addr3;
8064 	/* This field represents the page address of page #3. */
8065 	uint64_t req_buf_page_addr4;
8066 	/* This field represents the page address of page #4. */
8067 	uint64_t req_buf_page_addr5;
8068 	/* This field represents the page address of page #5. */
8069 	uint64_t req_buf_page_addr6;
8070 	/* This field represents the page address of page #6. */
8071 	uint64_t req_buf_page_addr7;
8072 	/* This field represents the page address of page #7. */
8073 	uint64_t req_buf_page_addr8;
8074 	/* This field represents the page address of page #8. */
8075 	uint64_t req_buf_page_addr9;
8076 	/* This field represents the page address of page #9. */
8077 	uint64_t error_buf_addr;
8078 	/*
8079 	 * This field is used to receive the error reporting from the chipset.
8080 	 * Only applicable for PFs.
8081 	 */
8082 	uint64_t resp_buf_addr;
8083 	/* This field is used to receive the response forwarded by the HWRM. */
8084 } __attribute__((packed));
8085 
8086 /* Output (16 bytes) */
8087 
8088 struct hwrm_func_buf_rgtr_output {
8089 	uint16_t error_code;
8090 	/*
8091 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
8092 	 * and fail the call with an error when appropriate
8093 	 */
8094 	uint16_t req_type;
8095 	/* This field returns the type of original request. */
8096 	uint16_t seq_id;
8097 	/* This field provides original sequence number of the command. */
8098 	uint16_t resp_len;
8099 	/*
8100 	 * This field is the length of the response in bytes. The last byte of
8101 	 * the response is a valid flag that will read as '1' when the command
8102 	 * has been completely written to memory.
8103 	 */
8104 	uint32_t unused_0;
8105 	uint8_t unused_1;
8106 	uint8_t unused_2;
8107 	uint8_t unused_3;
8108 	uint8_t valid;
8109 	/*
8110 	 * This field is used in Output records to indicate that the output is
8111 	 * completely written to RAM. This field should be read as '1' to
8112 	 * indicate that the output has been completely written. When writing a
8113 	 * command completion or response to an internal processor, the order of
8114 	 * writes has to be such that this field is written last.
8115 	 */
8116 } __attribute__((packed));
8117 
8118 /* hwrm_func_buf_unrgtr */
8119 /*
8120  * Description: This command is used by the PF driver to unregister buffers used
8121  * in the PF-VF communication with the HWRM. The PF driver uses this command to
8122  * unregister buffers for PF-VF communication. A parent PF may issue this
8123  * command to unregister buffers for communication between the PF and a specific
8124  * VF. If the VF ID is not valid, then this command is used to unregister
8125  * buffers used for communications with all children VFs of the PF.
8126  */
8127 /* Input (24 bytes) */
8128 
8129 struct hwrm_func_buf_unrgtr_input {
8130 	uint16_t req_type;
8131 	/*
8132 	 * This value indicates what type of request this is. The format for the
8133 	 * rest of the command is determined by this field.
8134 	 */
8135 	uint16_t cmpl_ring;
8136 	/*
8137 	 * This value indicates the what completion ring the request will be
8138 	 * optionally completed on. If the value is -1, then no CR completion
8139 	 * will be generated. Any other value must be a valid CR ring_id value
8140 	 * for this function.
8141 	 */
8142 	uint16_t seq_id;
8143 	/* This value indicates the command sequence number. */
8144 	uint16_t target_id;
8145 	/*
8146 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8147 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8148 	 */
8149 	uint64_t resp_addr;
8150 	/*
8151 	 * This is the host address where the response will be written when the
8152 	 * request is complete. This area must be 16B aligned and must be
8153 	 * cleared to zero before the request is made.
8154 	 */
8155 	uint32_t enables;
8156 	/* This bit must be '1' for the vf_id field to be configured. */
8157 	#define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID	UINT32_C(0x1)
8158 	uint16_t vf_id;
8159 	/*
8160 	 * This value is used to identify a Virtual Function (VF). The scope of
8161 	 * VF ID is local within a PF.
8162 	 */
8163 	uint16_t unused_0;
8164 } __attribute__((packed));
8165 
8166 /* Output (16 bytes) */
8167 
8168 struct hwrm_func_buf_unrgtr_output {
8169 	uint16_t error_code;
8170 	/*
8171 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
8172 	 * and fail the call with an error when appropriate
8173 	 */
8174 	uint16_t req_type;
8175 	/* This field returns the type of original request. */
8176 	uint16_t seq_id;
8177 	/* This field provides original sequence number of the command. */
8178 	uint16_t resp_len;
8179 	/*
8180 	 * This field is the length of the response in bytes. The last byte of
8181 	 * the response is a valid flag that will read as '1' when the command
8182 	 * has been completely written to memory.
8183 	 */
8184 	uint32_t unused_0;
8185 	uint8_t unused_1;
8186 	uint8_t unused_2;
8187 	uint8_t unused_3;
8188 	uint8_t valid;
8189 	/*
8190 	 * This field is used in Output records to indicate that the output is
8191 	 * completely written to RAM. This field should be read as '1' to
8192 	 * indicate that the output has been completely written. When writing a
8193 	 * command completion or response to an internal processor, the order of
8194 	 * writes has to be such that this field is written last.
8195 	 */
8196 } __attribute__((packed));
8197 
8198 /* hwrm_func_drv_qver */
8199 /*
8200  * Description: This command is used to query the version of the driver. Any
8201  * driver version with major = 0, minor = 0, and update = 0 shall be considered
8202  * an invalid or unknown version.
8203  */
8204 /* Input (24 bytes) */
8205 
8206 struct hwrm_func_drv_qver_input {
8207 	uint16_t req_type;
8208 	/*
8209 	 * This value indicates what type of request this is. The format for the
8210 	 * rest of the command is determined by this field.
8211 	 */
8212 	uint16_t cmpl_ring;
8213 	/*
8214 	 * This value indicates the what completion ring the request will be
8215 	 * optionally completed on. If the value is -1, then no CR completion
8216 	 * will be generated. Any other value must be a valid CR ring_id value
8217 	 * for this function.
8218 	 */
8219 	uint16_t seq_id;
8220 	/* This value indicates the command sequence number. */
8221 	uint16_t target_id;
8222 	/*
8223 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8224 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8225 	 */
8226 	uint64_t resp_addr;
8227 	/*
8228 	 * This is the host address where the response will be written when the
8229 	 * request is complete. This area must be 16B aligned and must be
8230 	 * cleared to zero before the request is made.
8231 	 */
8232 	uint32_t reserved;
8233 	/* Reserved for future use */
8234 	uint16_t fid;
8235 	/*
8236 	 * Function ID of the function that is being queried. 0xFF... (All Fs)
8237 	 * if the query is for the requesting function.
8238 	 */
8239 	uint16_t unused_0;
8240 } __attribute__((packed));
8241 
8242 /* Output (16 bytes) */
8243 
8244 struct hwrm_func_drv_qver_output {
8245 	uint16_t error_code;
8246 	/*
8247 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
8248 	 * and fail the call with an error when appropriate
8249 	 */
8250 	uint16_t req_type;
8251 	/* This field returns the type of original request. */
8252 	uint16_t seq_id;
8253 	/* This field provides original sequence number of the command. */
8254 	uint16_t resp_len;
8255 	/*
8256 	 * This field is the length of the response in bytes. The last byte of
8257 	 * the response is a valid flag that will read as '1' when the command
8258 	 * has been completely written to memory.
8259 	 */
8260 	uint16_t os_type;
8261 	/*
8262 	 * This value indicates the type of OS. The values are based on
8263 	 * CIM_OperatingSystem.mof file as published by the DMTF.
8264 	 */
8265 	/* Unknown */
8266 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN	UINT32_C(0x0)
8267 	/* Other OS not listed below. */
8268 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER	UINT32_C(0x1)
8269 	/* MSDOS OS. */
8270 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS	UINT32_C(0xe)
8271 	/* Windows OS. */
8272 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS	UINT32_C(0x12)
8273 	/* Solaris OS. */
8274 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS	UINT32_C(0x1d)
8275 	/* Linux OS. */
8276 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX	UINT32_C(0x24)
8277 	/* FreeBSD OS. */
8278 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD	UINT32_C(0x2a)
8279 	/* VMware ESXi OS. */
8280 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI		UINT32_C(0x68)
8281 	/* Microsoft Windows 8 64-bit OS. */
8282 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864	UINT32_C(0x73)
8283 	/* Microsoft Windows Server 2012 R2 OS. */
8284 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2	UINT32_C(0x74)
8285 	uint8_t ver_maj;
8286 	/* This is the major version of the driver. */
8287 	uint8_t ver_min;
8288 	/* This is the minor version of the driver. */
8289 	uint8_t ver_upd;
8290 	/* This is the update version of the driver. */
8291 	uint8_t unused_0;
8292 	uint8_t unused_1;
8293 	uint8_t valid;
8294 	/*
8295 	 * This field is used in Output records to indicate that the output is
8296 	 * completely written to RAM. This field should be read as '1' to
8297 	 * indicate that the output has been completely written. When writing a
8298 	 * command completion or response to an internal processor, the order of
8299 	 * writes has to be such that this field is written last.
8300 	 */
8301 } __attribute__((packed));
8302 
8303 /* hwrm_port_phy_cfg */
8304 /*
8305  * Description: This command configures the PHY device for the port. It allows
8306  * setting of the most generic settings for the PHY. The HWRM shall complete
8307  * this command as soon as PHY settings are configured. They may not be applied
8308  * when the command response is provided. A VF driver shall not be allowed to
8309  * configure PHY using this command. In a network partition mode, a PF driver
8310  * shall not be allowed to configure PHY using this command.
8311  */
8312 /* Input (56 bytes) */
8313 
8314 struct hwrm_port_phy_cfg_input {
8315 	uint16_t req_type;
8316 	/*
8317 	 * This value indicates what type of request this is. The format for the
8318 	 * rest of the command is determined by this field.
8319 	 */
8320 	uint16_t cmpl_ring;
8321 	/*
8322 	 * This value indicates the what completion ring the request will be
8323 	 * optionally completed on. If the value is -1, then no CR completion
8324 	 * will be generated. Any other value must be a valid CR ring_id value
8325 	 * for this function.
8326 	 */
8327 	uint16_t seq_id;
8328 	/* This value indicates the command sequence number. */
8329 	uint16_t target_id;
8330 	/*
8331 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8332 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8333 	 */
8334 	uint64_t resp_addr;
8335 	/*
8336 	 * This is the host address where the response will be written when the
8337 	 * request is complete. This area must be 16B aligned and must be
8338 	 * cleared to zero before the request is made.
8339 	 */
8340 	uint32_t flags;
8341 	/*
8342 	 * When this bit is set to '1', the PHY for the port shall be reset. #
8343 	 * If this bit is set to 1, then the HWRM shall reset the PHY after
8344 	 * applying PHY configuration changes specified in this command. # In
8345 	 * order to guarantee that PHY configuration changes specified in this
8346 	 * command take effect, the HWRM client should set this flag to 1. # If
8347 	 * this bit is not set to 1, then the HWRM may reset the PHY depending
8348 	 * on the current PHY configuration and settings specified in this
8349 	 * command.
8350 	 */
8351 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY		UINT32_C(0x1)
8352 	/* deprecated bit. Do not use!!! */
8353 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED	UINT32_C(0x2)
8354 	/*
8355 	 * When this bit is set to '1', the link shall be forced to the
8356 	 * force_link_speed value. When this bit is set to '1', the HWRM client
8357 	 * should not enable any of the auto negotiation related fields
8358 	 * represented by auto_XXX fields in this command. When this bit is set
8359 	 * to '1' and the HWRM client has enabled a auto_XXX field in this
8360 	 * command, then the HWRM shall ignore the enabled auto_XXX field. When
8361 	 * this bit is set to zero, the link shall be allowed to autoneg.
8362 	 */
8363 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE		UINT32_C(0x4)
8364 	/*
8365 	 * When this bit is set to '1', the auto-negotiation process shall be
8366 	 * restarted on the link.
8367 	 */
8368 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG	UINT32_C(0x8)
8369 	/*
8370 	 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
8371 	 * requested to be enabled on this link. If EEE is not supported on this
8372 	 * port, then this flag shall be ignored by the HWRM.
8373 	 */
8374 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE	UINT32_C(0x10)
8375 	/*
8376 	 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
8377 	 * requested to be disabled on this link. If EEE is not supported on
8378 	 * this port, then this flag shall be ignored by the HWRM.
8379 	 */
8380 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE	UINT32_C(0x20)
8381 	/*
8382 	 * When this bit is set to '1' and EEE is enabled on this link, then TX
8383 	 * LPI is requested to be enabled on the link. If EEE is not supported
8384 	 * on this port, then this flag shall be ignored by the HWRM. If EEE is
8385 	 * disabled on this port, then this flag shall be ignored by the HWRM.
8386 	 */
8387 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE	UINT32_C(0x40)
8388 	/*
8389 	 * When this bit is set to '1' and EEE is enabled on this link, then TX
8390 	 * LPI is requested to be disabled on the link. If EEE is not supported
8391 	 * on this port, then this flag shall be ignored by the HWRM. If EEE is
8392 	 * disabled on this port, then this flag shall be ignored by the HWRM.
8393 	 */
8394 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE   UINT32_C(0x80)
8395 	/*
8396 	 * When set to 1, then the HWRM shall enable FEC autonegotitation on
8397 	 * this port if supported. When set to 0, then this flag shall be
8398 	 * ignored. If FEC autonegotiation is not supported, then the HWRM shall
8399 	 * ignore this flag.
8400 	 */
8401 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE   UINT32_C(0x100)
8402 	/*
8403 	 * When set to 1, then the HWRM shall disable FEC autonegotiation on
8404 	 * this port if supported. When set to 0, then this flag shall be
8405 	 * ignored. If FEC autonegotiation is not supported, then the HWRM shall
8406 	 * ignore this flag.
8407 	 */
8408 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE  UINT32_C(0x200)
8409 	/*
8410 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
8411 	 * on this port if supported. When set to 0, then this flag shall be
8412 	 * ignored. If FEC CLAUSE 74 is not supported, then the HWRM shall
8413 	 * ignore this flag.
8414 	 */
8415 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE  UINT32_C(0x400)
8416 	/*
8417 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
8418 	 * on this port if supported. When set to 0, then this flag shall be
8419 	 * ignored. If FEC CLAUSE 74 is not supported, then the HWRM shall
8420 	 * ignore this flag.
8421 	 */
8422 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE UINT32_C(0x800)
8423 	/*
8424 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed
8425 	 * Solomon) on this port if supported. When set to 0, then this flag
8426 	 * shall be ignored. If FEC CLAUSE 91 is not supported, then the HWRM
8427 	 * shall ignore this flag.
8428 	 */
8429 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE  UINT32_C(0x1000)
8430 	/*
8431 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed
8432 	 * Solomon) on this port if supported. When set to 0, then this flag
8433 	 * shall be ignored. If FEC CLAUSE 91 is not supported, then the HWRM
8434 	 * shall ignore this flag.
8435 	 */
8436 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE UINT32_C(0x2000)
8437 	/*
8438 	 * When this bit is set to '1', the link shall be forced to be taken
8439 	 * down. # When this bit is set to '1", all other command input settings
8440 	 * related to the link speed shall be ignored. Once the link state is
8441 	 * forced down, it can be explicitly cleared from that state by setting
8442 	 * this flag to '0'. # If this flag is set to '0', then the link shall
8443 	 * be cleared from forced down state if the link is in forced down
8444 	 * state. There may be conditions (e.g. out-of-band or sideband
8445 	 * configuration changes for the link) outside the scope of the HWRM
8446 	 * implementation that may clear forced down link state.
8447 	 */
8448 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN	UINT32_C(0x4000)
8449 	uint32_t enables;
8450 	/* This bit must be '1' for the auto_mode field to be configured. */
8451 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE	UINT32_C(0x1)
8452 	/* This bit must be '1' for the auto_duplex field to be configured. */
8453 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX	UINT32_C(0x2)
8454 	/* This bit must be '1' for the auto_pause field to be configured. */
8455 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE	UINT32_C(0x4)
8456 	/* This bit must be '1' for the auto_link_speed field to be configured. */
8457 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED	UINT32_C(0x8)
8458 	/*
8459 	 * This bit must be '1' for the auto_link_speed_mask field to be
8460 	 * configured.
8461 	 */
8462 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK UINT32_C(0x10)
8463 	/* This bit must be '1' for the wirespeed field to be configured. */
8464 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED	UINT32_C(0x20)
8465 	/* This bit must be '1' for the lpbk field to be configured. */
8466 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK		UINT32_C(0x40)
8467 	/* This bit must be '1' for the preemphasis field to be configured. */
8468 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS	UINT32_C(0x80)
8469 	/* This bit must be '1' for the force_pause field to be configured. */
8470 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE	UINT32_C(0x100)
8471 	/*
8472 	 * This bit must be '1' for the eee_link_speed_mask field to be
8473 	 * configured.
8474 	 */
8475 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK UINT32_C(0x200)
8476 	/* This bit must be '1' for the tx_lpi_timer field to be configured. */
8477 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER	UINT32_C(0x400)
8478 	uint16_t port_id;
8479 	/* Port ID of port that is to be configured. */
8480 	uint16_t force_link_speed;
8481 	/*
8482 	 * This is the speed that will be used if the force bit is '1'. If
8483 	 * unsupported speed is selected, an error will be generated.
8484 	 */
8485 	/* 100Mb link speed */
8486 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB	UINT32_C(0x1)
8487 	/* 1Gb link speed */
8488 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB	UINT32_C(0xa)
8489 	/* 2Gb link speed */
8490 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB	UINT32_C(0x14)
8491 	/* 2.5Gb link speed */
8492 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB	UINT32_C(0x19)
8493 	/* 10Gb link speed */
8494 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB	UINT32_C(0x64)
8495 	/* 20Mb link speed */
8496 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB	UINT32_C(0xc8)
8497 	/* 25Gb link speed */
8498 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB	UINT32_C(0xfa)
8499 	/* 40Gb link speed */
8500 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB	UINT32_C(0x190)
8501 	/* 50Gb link speed */
8502 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB	UINT32_C(0x1f4)
8503 	/* 100Gb link speed */
8504 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB	UINT32_C(0x3e8)
8505 	/* 10Mb link speed */
8506 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB	UINT32_C(0xffff)
8507 	uint8_t auto_mode;
8508 	/*
8509 	 * This value is used to identify what autoneg mode is used when the
8510 	 * link speed is not being forced.
8511 	 */
8512 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
8513 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE		UINT32_C(0x0)
8514 	/* Select all possible speeds for autoneg mode. */
8515 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS	UINT32_C(0x1)
8516 	/*
8517 	 * Select only the auto_link_speed speed for autoneg mode. This
8518 	 * mode has been DEPRECATED. An HWRM client should not use this
8519 	 * mode.
8520 	 */
8521 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
8522 	/*
8523 	 * Select the auto_link_speed or any speed below that speed for
8524 	 * autoneg. This mode has been DEPRECATED. An HWRM client should
8525 	 * not use this mode.
8526 	 */
8527 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW	UINT32_C(0x3)
8528 	/*
8529 	 * Select the speeds based on the corresponding link speed mask
8530 	 * value that is provided.
8531 	 */
8532 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK	UINT32_C(0x4)
8533 	uint8_t auto_duplex;
8534 	/*
8535 	 * This is the duplex setting that will be used if the autoneg_mode is
8536 	 * "one_speed" or "one_or_below".
8537 	 */
8538 	/* Half Duplex will be requested. */
8539 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF	UINT32_C(0x0)
8540 	/* Full duplex will be requested. */
8541 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL	UINT32_C(0x1)
8542 	/* Both Half and Full dupex will be requested. */
8543 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH	UINT32_C(0x2)
8544 	uint8_t auto_pause;
8545 	/*
8546 	 * This value is used to configure the pause that will be used for
8547 	 * autonegotiation. Add text on the usage of auto_pause and force_pause.
8548 	 */
8549 	/*
8550 	 * When this bit is '1', Generation of tx pause messages has been
8551 	 * requested. Disabled otherwise.
8552 	 */
8553 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
8554 	/*
8555 	 * When this bit is '1', Reception of rx pause messages has been
8556 	 * requested. Disabled otherwise.
8557 	 */
8558 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
8559 	/*
8560 	 * When set to 1, the advertisement of pause is enabled. # When the
8561 	 * auto_mode is not set to none and this flag is set to 1, then the
8562 	 * auto_pause bits on this port are being advertised and autoneg pause
8563 	 * results are being interpreted. # When the auto_mode is not set to
8564 	 * none and this flag is set to 0, the pause is forced as indicated in
8565 	 * force_pause, and also advertised as auto_pause bits, but the autoneg
8566 	 * results are not interpreted since the pause configuration is being
8567 	 * forced. # When the auto_mode is set to none and this flag is set to
8568 	 * 1, auto_pause bits should be ignored and should be set to 0.
8569 	 */
8570 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE   UINT32_C(0x4)
8571 	uint8_t unused_0;
8572 	uint16_t auto_link_speed;
8573 	/*
8574 	 * This is the speed that will be used if the autoneg_mode is
8575 	 * "one_speed" or "one_or_below". If an unsupported speed is selected,
8576 	 * an error will be generated.
8577 	 */
8578 	/* 100Mb link speed */
8579 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB	UINT32_C(0x1)
8580 	/* 1Gb link speed */
8581 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB	UINT32_C(0xa)
8582 	/* 2Gb link speed */
8583 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB	UINT32_C(0x14)
8584 	/* 2.5Gb link speed */
8585 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB	UINT32_C(0x19)
8586 	/* 10Gb link speed */
8587 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB	UINT32_C(0x64)
8588 	/* 20Mb link speed */
8589 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB	UINT32_C(0xc8)
8590 	/* 25Gb link speed */
8591 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB	UINT32_C(0xfa)
8592 	/* 40Gb link speed */
8593 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB	UINT32_C(0x190)
8594 	/* 50Gb link speed */
8595 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB	UINT32_C(0x1f4)
8596 	/* 100Gb link speed */
8597 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB	UINT32_C(0x3e8)
8598 	/* 10Mb link speed */
8599 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB	UINT32_C(0xffff)
8600 	uint16_t auto_link_speed_mask;
8601 	/*
8602 	 * This is a mask of link speeds that will be used if autoneg_mode is
8603 	 * "mask". If unsupported speed is enabled an error will be generated.
8604 	 */
8605 	/* 100Mb link speed (Half-duplex) */
8606 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD UINT32_C(0x1)
8607 	/* 100Mb link speed (Full-duplex) */
8608 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB UINT32_C(0x2)
8609 	/* 1Gb link speed (Half-duplex) */
8610 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD UINT32_C(0x4)
8611 	/* 1Gb link speed (Full-duplex) */
8612 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB   UINT32_C(0x8)
8613 	/* 2Gb link speed */
8614 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB   UINT32_C(0x10)
8615 	/* 2.5Gb link speed */
8616 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB UINT32_C(0x20)
8617 	/* 10Gb link speed */
8618 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB  UINT32_C(0x40)
8619 	/* 20Gb link speed */
8620 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB  UINT32_C(0x80)
8621 	/* 25Gb link speed */
8622 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB  UINT32_C(0x100)
8623 	/* 40Gb link speed */
8624 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB  UINT32_C(0x200)
8625 	/* 50Gb link speed */
8626 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB  UINT32_C(0x400)
8627 	/* 100Gb link speed */
8628 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB UINT32_C(0x800)
8629 	/* 10Mb link speed (Half-duplex) */
8630 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD UINT32_C(0x1000)
8631 	/* 10Mb link speed (Full-duplex) */
8632 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB  UINT32_C(0x2000)
8633 	uint8_t wirespeed;
8634 	/* This value controls the wirespeed feature. */
8635 	/* Wirespeed feature is disabled. */
8636 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF		UINT32_C(0x0)
8637 	/* Wirespeed feature is enabled. */
8638 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON		UINT32_C(0x1)
8639 	uint8_t lpbk;
8640 	/* This value controls the loopback setting for the PHY. */
8641 	/* No loopback is selected. Normal operation. */
8642 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE		UINT32_C(0x0)
8643 	/*
8644 	 * The HW will be configured with local loopback such that host
8645 	 * data is sent back to the host without modification.
8646 	 */
8647 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL		UINT32_C(0x1)
8648 	/*
8649 	 * The HW will be configured with remote loopback such that port
8650 	 * logic will send packets back out the transmitter that are
8651 	 * received.
8652 	 */
8653 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE		UINT32_C(0x2)
8654 	uint8_t force_pause;
8655 	/*
8656 	 * This value is used to configure the pause that will be used for force
8657 	 * mode.
8658 	 */
8659 	/*
8660 	 * When this bit is '1', Generation of tx pause messages is supported.
8661 	 * Disabled otherwise.
8662 	 */
8663 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX		UINT32_C(0x1)
8664 	/*
8665 	 * When this bit is '1', Reception of rx pause messages is supported.
8666 	 * Disabled otherwise.
8667 	 */
8668 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX		UINT32_C(0x2)
8669 	uint8_t unused_1;
8670 	uint32_t preemphasis;
8671 	/*
8672 	 * This value controls the pre-emphasis to be used for the link. Driver
8673 	 * should not set this value (use enable.preemphasis = 0) unless driver
8674 	 * is sure of setting. Normally HWRM FW will determine proper pre-
8675 	 * emphasis.
8676 	 */
8677 	uint16_t eee_link_speed_mask;
8678 	/*
8679 	 * Setting for link speed mask that is used to advertise speeds during
8680 	 * autonegotiation when EEE is enabled. This field is valid only when
8681 	 * EEE is enabled. The speeds specified in this field shall be a subset
8682 	 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
8683 	 * at least one speed shall be provided in this mask.
8684 	 */
8685 	/* Reserved */
8686 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1  UINT32_C(0x1)
8687 	/* 100Mb link speed (Full-duplex) */
8688 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB  UINT32_C(0x2)
8689 	/* Reserved */
8690 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2  UINT32_C(0x4)
8691 	/* 1Gb link speed (Full-duplex) */
8692 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
8693 	/* Reserved */
8694 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3  UINT32_C(0x10)
8695 	/* Reserved */
8696 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4  UINT32_C(0x20)
8697 	/* 10Gb link speed */
8698 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB   UINT32_C(0x40)
8699 	uint8_t unused_2;
8700 	uint8_t unused_3;
8701 	uint32_t tx_lpi_timer;
8702 	uint32_t unused_4;
8703 	/*
8704 	 * Reuested setting of TX LPI timer in microseconds. This field is valid
8705 	 * only when EEE is enabled and TX LPI is enabled.
8706 	 */
8707 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK	UINT32_C(0xffffff)
8708 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT	0
8709 } __attribute__((packed));
8710 
8711 /* Output (16 bytes) */
8712 
8713 struct hwrm_port_phy_cfg_output {
8714 	uint16_t error_code;
8715 	/*
8716 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
8717 	 * and fail the call with an error when appropriate
8718 	 */
8719 	uint16_t req_type;
8720 	/* This field returns the type of original request. */
8721 	uint16_t seq_id;
8722 	/* This field provides original sequence number of the command. */
8723 	uint16_t resp_len;
8724 	/*
8725 	 * This field is the length of the response in bytes. The last byte of
8726 	 * the response is a valid flag that will read as '1' when the command
8727 	 * has been completely written to memory.
8728 	 */
8729 	uint32_t unused_0;
8730 	uint8_t unused_1;
8731 	uint8_t unused_2;
8732 	uint8_t unused_3;
8733 	uint8_t valid;
8734 	/*
8735 	 * This field is used in Output records to indicate that the output is
8736 	 * completely written to RAM. This field should be read as '1' to
8737 	 * indicate that the output has been completely written. When writing a
8738 	 * command completion or response to an internal processor, the order of
8739 	 * writes has to be such that this field is written last.
8740 	 */
8741 } __attribute__((packed));
8742 
8743 /* hwrm_port_phy_qcfg */
8744 /* Description: This command queries the PHY configuration for the port. */
8745 /* Input (24 bytes) */
8746 
8747 struct hwrm_port_phy_qcfg_input {
8748 	uint16_t req_type;
8749 	/*
8750 	 * This value indicates what type of request this is. The format for the
8751 	 * rest of the command is determined by this field.
8752 	 */
8753 	uint16_t cmpl_ring;
8754 	/*
8755 	 * This value indicates the what completion ring the request will be
8756 	 * optionally completed on. If the value is -1, then no CR completion
8757 	 * will be generated. Any other value must be a valid CR ring_id value
8758 	 * for this function.
8759 	 */
8760 	uint16_t seq_id;
8761 	/* This value indicates the command sequence number. */
8762 	uint16_t target_id;
8763 	/*
8764 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
8765 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
8766 	 */
8767 	uint64_t resp_addr;
8768 	/*
8769 	 * This is the host address where the response will be written when the
8770 	 * request is complete. This area must be 16B aligned and must be
8771 	 * cleared to zero before the request is made.
8772 	 */
8773 	uint16_t port_id;
8774 	/* Port ID of port that is to be queried. */
8775 	uint16_t unused_0[3];
8776 } __attribute__((packed));
8777 
8778 /* Output (96 bytes) */
8779 
8780 struct hwrm_port_phy_qcfg_output {
8781 	uint16_t error_code;
8782 	/*
8783 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
8784 	 * and fail the call with an error when appropriate
8785 	 */
8786 	uint16_t req_type;
8787 	/* This field returns the type of original request. */
8788 	uint16_t seq_id;
8789 	/* This field provides original sequence number of the command. */
8790 	uint16_t resp_len;
8791 	/*
8792 	 * This field is the length of the response in bytes. The last byte of
8793 	 * the response is a valid flag that will read as '1' when the command
8794 	 * has been completely written to memory.
8795 	 */
8796 	uint8_t link;
8797 	/* This value indicates the current link status. */
8798 	/* There is no link or cable detected. */
8799 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK		UINT32_C(0x0)
8800 	/* There is no link, but a cable has been detected. */
8801 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL		UINT32_C(0x1)
8802 	/* There is a link. */
8803 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK		UINT32_C(0x2)
8804 	uint8_t unused_0;
8805 	uint16_t link_speed;
8806 	/* This value indicates the current link speed of the connection. */
8807 	/* 100Mb link speed */
8808 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB	UINT32_C(0x1)
8809 	/* 1Gb link speed */
8810 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB	UINT32_C(0xa)
8811 	/* 2Gb link speed */
8812 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB	UINT32_C(0x14)
8813 	/* 2.5Gb link speed */
8814 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB	UINT32_C(0x19)
8815 	/* 10Gb link speed */
8816 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB	UINT32_C(0x64)
8817 	/* 20Mb link speed */
8818 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB	UINT32_C(0xc8)
8819 	/* 25Gb link speed */
8820 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB	UINT32_C(0xfa)
8821 	/* 40Gb link speed */
8822 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB	UINT32_C(0x190)
8823 	/* 50Gb link speed */
8824 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB	UINT32_C(0x1f4)
8825 	/* 100Gb link speed */
8826 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB	UINT32_C(0x3e8)
8827 	/* 10Mb link speed */
8828 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB	UINT32_C(0xffff)
8829 	uint8_t duplex_cfg;
8830 	/* This value is indicates the duplex of the current configuration. */
8831 	/* Half Duplex connection. */
8832 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF	UINT32_C(0x0)
8833 	/* Full duplex connection. */
8834 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL	UINT32_C(0x1)
8835 	uint8_t pause;
8836 	/*
8837 	 * This value is used to indicate the current pause configuration. When
8838 	 * autoneg is enabled, this value represents the autoneg results of
8839 	 * pause configuration.
8840 	 */
8841 	/*
8842 	 * When this bit is '1', Generation of tx pause messages is supported.
8843 	 * Disabled otherwise.
8844 	 */
8845 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX		UINT32_C(0x1)
8846 	/*
8847 	 * When this bit is '1', Reception of rx pause messages is supported.
8848 	 * Disabled otherwise.
8849 	 */
8850 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX		UINT32_C(0x2)
8851 	uint16_t support_speeds;
8852 	/*
8853 	 * The supported speeds for the port. This is a bit mask. For each speed
8854 	 * that is supported, the corrresponding bit will be set to '1'.
8855 	 */
8856 	/* 100Mb link speed (Half-duplex) */
8857 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD   UINT32_C(0x1)
8858 	/* 100Mb link speed (Full-duplex) */
8859 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB	UINT32_C(0x2)
8860 	/* 1Gb link speed (Half-duplex) */
8861 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD	UINT32_C(0x4)
8862 	/* 1Gb link speed (Full-duplex) */
8863 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB	UINT32_C(0x8)
8864 	/* 2Gb link speed */
8865 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB	UINT32_C(0x10)
8866 	/* 2.5Gb link speed */
8867 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB	UINT32_C(0x20)
8868 	/* 10Gb link speed */
8869 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB	UINT32_C(0x40)
8870 	/* 20Gb link speed */
8871 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB	UINT32_C(0x80)
8872 	/* 25Gb link speed */
8873 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB	UINT32_C(0x100)
8874 	/* 40Gb link speed */
8875 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB	UINT32_C(0x200)
8876 	/* 50Gb link speed */
8877 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB	UINT32_C(0x400)
8878 	/* 100Gb link speed */
8879 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB	UINT32_C(0x800)
8880 	/* 10Mb link speed (Half-duplex) */
8881 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD	UINT32_C(0x1000)
8882 	/* 10Mb link speed (Full-duplex) */
8883 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB	UINT32_C(0x2000)
8884 	uint16_t force_link_speed;
8885 	/*
8886 	 * Current setting of forced link speed. When the link speed is not
8887 	 * being forced, this value shall be set to 0.
8888 	 */
8889 	/* 100Mb link speed */
8890 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB  UINT32_C(0x1)
8891 	/* 1Gb link speed */
8892 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB	UINT32_C(0xa)
8893 	/* 2Gb link speed */
8894 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB	UINT32_C(0x14)
8895 	/* 2.5Gb link speed */
8896 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB  UINT32_C(0x19)
8897 	/* 10Gb link speed */
8898 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB   UINT32_C(0x64)
8899 	/* 20Mb link speed */
8900 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB   UINT32_C(0xc8)
8901 	/* 25Gb link speed */
8902 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB   UINT32_C(0xfa)
8903 	/* 40Gb link speed */
8904 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB   UINT32_C(0x190)
8905 	/* 50Gb link speed */
8906 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB   UINT32_C(0x1f4)
8907 	/* 100Gb link speed */
8908 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB  UINT32_C(0x3e8)
8909 	/* 10Mb link speed */
8910 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB   UINT32_C(0xffff)
8911 	uint8_t auto_mode;
8912 	/* Current setting of auto negotiation mode. */
8913 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
8914 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE	UINT32_C(0x0)
8915 	/* Select all possible speeds for autoneg mode. */
8916 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS	UINT32_C(0x1)
8917 	/*
8918 	 * Select only the auto_link_speed speed for autoneg mode. This
8919 	 * mode has been DEPRECATED. An HWRM client should not use this
8920 	 * mode.
8921 	 */
8922 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
8923 	/*
8924 	 * Select the auto_link_speed or any speed below that speed for
8925 	 * autoneg. This mode has been DEPRECATED. An HWRM client should
8926 	 * not use this mode.
8927 	 */
8928 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW  UINT32_C(0x3)
8929 	/*
8930 	 * Select the speeds based on the corresponding link speed mask
8931 	 * value that is provided.
8932 	 */
8933 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK	UINT32_C(0x4)
8934 	uint8_t auto_pause;
8935 	/*
8936 	 * Current setting of pause autonegotiation. Move autoneg_pause flag
8937 	 * here.
8938 	 */
8939 	/*
8940 	 * When this bit is '1', Generation of tx pause messages has been
8941 	 * requested. Disabled otherwise.
8942 	 */
8943 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
8944 	/*
8945 	 * When this bit is '1', Reception of rx pause messages has been
8946 	 * requested. Disabled otherwise.
8947 	 */
8948 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
8949 	/*
8950 	 * When set to 1, the advertisement of pause is enabled. # When the
8951 	 * auto_mode is not set to none and this flag is set to 1, then the
8952 	 * auto_pause bits on this port are being advertised and autoneg pause
8953 	 * results are being interpreted. # When the auto_mode is not set to
8954 	 * none and this flag is set to 0, the pause is forced as indicated in
8955 	 * force_pause, and also advertised as auto_pause bits, but the autoneg
8956 	 * results are not interpreted since the pause configuration is being
8957 	 * forced. # When the auto_mode is set to none and this flag is set to
8958 	 * 1, auto_pause bits should be ignored and should be set to 0.
8959 	 */
8960 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
8961 	uint16_t auto_link_speed;
8962 	/*
8963 	 * Current setting for auto_link_speed. This field is only valid when
8964 	 * auto_mode is set to "one_speed" or "one_or_below".
8965 	 */
8966 	/* 100Mb link speed */
8967 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB   UINT32_C(0x1)
8968 	/* 1Gb link speed */
8969 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB	UINT32_C(0xa)
8970 	/* 2Gb link speed */
8971 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB	UINT32_C(0x14)
8972 	/* 2.5Gb link speed */
8973 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB   UINT32_C(0x19)
8974 	/* 10Gb link speed */
8975 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB	UINT32_C(0x64)
8976 	/* 20Mb link speed */
8977 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB	UINT32_C(0xc8)
8978 	/* 25Gb link speed */
8979 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB	UINT32_C(0xfa)
8980 	/* 40Gb link speed */
8981 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB	UINT32_C(0x190)
8982 	/* 50Gb link speed */
8983 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB	UINT32_C(0x1f4)
8984 	/* 100Gb link speed */
8985 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB   UINT32_C(0x3e8)
8986 	/* 10Mb link speed */
8987 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB	UINT32_C(0xffff)
8988 	uint16_t auto_link_speed_mask;
8989 	/*
8990 	 * Current setting for auto_link_speed_mask that is used to advertise
8991 	 * speeds during autonegotiation. This field is only valid when
8992 	 * auto_mode is set to "mask". The speeds specified in this field shall
8993 	 * be a subset of supported speeds on this port.
8994 	 */
8995 	/* 100Mb link speed (Half-duplex) */
8996 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD UINT32_C(0x1)
8997 	/* 100Mb link speed (Full-duplex) */
8998 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB UINT32_C(0x2)
8999 	/* 1Gb link speed (Half-duplex) */
9000 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD UINT32_C(0x4)
9001 	/* 1Gb link speed (Full-duplex) */
9002 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
9003 	/* 2Gb link speed */
9004 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB UINT32_C(0x10)
9005 	/* 2.5Gb link speed */
9006 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB UINT32_C(0x20)
9007 	/* 10Gb link speed */
9008 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
9009 	/* 20Gb link speed */
9010 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
9011 	/* 25Gb link speed */
9012 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB UINT32_C(0x100)
9013 	/* 40Gb link speed */
9014 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB UINT32_C(0x200)
9015 	/* 50Gb link speed */
9016 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB UINT32_C(0x400)
9017 	/* 100Gb link speed */
9018 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB UINT32_C(0x800)
9019 	/* 10Mb link speed (Half-duplex) */
9020 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD UINT32_C(0x1000)
9021 	/* 10Mb link speed (Full-duplex) */
9022 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB UINT32_C(0x2000)
9023 	uint8_t wirespeed;
9024 	/* Current setting for wirespeed. */
9025 	/* Wirespeed feature is disabled. */
9026 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF	UINT32_C(0x0)
9027 	/* Wirespeed feature is enabled. */
9028 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON		UINT32_C(0x1)
9029 	uint8_t lpbk;
9030 	/* Current setting for loopback. */
9031 	/* No loopback is selected. Normal operation. */
9032 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE		UINT32_C(0x0)
9033 	/*
9034 	 * The HW will be configured with local loopback such that host
9035 	 * data is sent back to the host without modification.
9036 	 */
9037 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL		UINT32_C(0x1)
9038 	/*
9039 	 * The HW will be configured with remote loopback such that port
9040 	 * logic will send packets back out the transmitter that are
9041 	 * received.
9042 	 */
9043 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE		UINT32_C(0x2)
9044 	uint8_t force_pause;
9045 	/*
9046 	 * Current setting of forced pause. When the pause configuration is not
9047 	 * being forced, then this value shall be set to 0.
9048 	 */
9049 	/*
9050 	 * When this bit is '1', Generation of tx pause messages is supported.
9051 	 * Disabled otherwise.
9052 	 */
9053 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX	UINT32_C(0x1)
9054 	/*
9055 	 * When this bit is '1', Reception of rx pause messages is supported.
9056 	 * Disabled otherwise.
9057 	 */
9058 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX	UINT32_C(0x2)
9059 	uint8_t module_status;
9060 	/*
9061 	 * This value indicates the current status of the optics module on this
9062 	 * port.
9063 	 */
9064 	/* Module is inserted and accepted */
9065 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE	UINT32_C(0x0)
9066 	/* Module is rejected and transmit side Laser is disabled. */
9067 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX UINT32_C(0x1)
9068 	/* Module mismatch warning. */
9069 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG UINT32_C(0x2)
9070 	/* Module is rejected and powered down. */
9071 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN   UINT32_C(0x3)
9072 	/* Module is not inserted. */
9073 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED UINT32_C(0x4)
9074 	/* Module status is not applicable. */
9075 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE UINT32_C(0xff)
9076 	uint32_t preemphasis;
9077 	/* Current setting for preemphasis. */
9078 	uint8_t phy_maj;
9079 	/* This field represents the major version of the PHY. */
9080 	uint8_t phy_min;
9081 	/* This field represents the minor version of the PHY. */
9082 	uint8_t phy_bld;
9083 	/* This field represents the build version of the PHY. */
9084 	uint8_t phy_type;
9085 	/* This value represents a PHY type. */
9086 	/* Unknown */
9087 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN	UINT32_C(0x0)
9088 	/* BASE-CR */
9089 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR	UINT32_C(0x1)
9090 	/* BASE-KR4 (Deprecated) */
9091 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4	UINT32_C(0x2)
9092 	/* BASE-LR */
9093 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR	UINT32_C(0x3)
9094 	/* BASE-SR */
9095 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR	UINT32_C(0x4)
9096 	/* BASE-KR2 (Deprecated) */
9097 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2	UINT32_C(0x5)
9098 	/* BASE-KX */
9099 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX	UINT32_C(0x6)
9100 	/* BASE-KR */
9101 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR	UINT32_C(0x7)
9102 	/* BASE-T */
9103 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET	UINT32_C(0x8)
9104 	/* EEE capable BASE-T */
9105 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE	UINT32_C(0x9)
9106 	/* SGMII connected external PHY */
9107 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY	UINT32_C(0xa)
9108 	/* 25G_BASECR_CA_L */
9109 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L UINT32_C(0xb)
9110 	/* 25G_BASECR_CA_S */
9111 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S UINT32_C(0xc)
9112 	/* 25G_BASECR_CA_N */
9113 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N UINT32_C(0xd)
9114 	/* 25G_BASESR */
9115 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR	UINT32_C(0xe)
9116 	/* 100G_BASECR4 */
9117 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4   UINT32_C(0xf)
9118 	/* 100G_BASESR4 */
9119 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4   UINT32_C(0x10)
9120 	/* 100G_BASELR4 */
9121 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4   UINT32_C(0x11)
9122 	/* 100G_BASEER4 */
9123 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4   UINT32_C(0x12)
9124 	/* 100G_BASESR10 */
9125 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10  UINT32_C(0x13)
9126 	/* 40G_BASECR4 */
9127 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4	UINT32_C(0x14)
9128 	/* 40G_BASESR4 */
9129 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4	UINT32_C(0x15)
9130 	/* 40G_BASELR4 */
9131 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4	UINT32_C(0x16)
9132 	/* 40G_BASEER4 */
9133 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4	UINT32_C(0x17)
9134 	/* 40G_ACTIVE_CABLE */
9135 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE UINT32_C(0x18)
9136 	/* 1G_baseT */
9137 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET	UINT32_C(0x19)
9138 	/* 1G_baseSX */
9139 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX	UINT32_C(0x1a)
9140 	/* 1G_baseCX */
9141 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX	UINT32_C(0x1b)
9142 	uint8_t media_type;
9143 	/* This value represents a media type. */
9144 	/* Unknown */
9145 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN	UINT32_C(0x0)
9146 	/* Twisted Pair */
9147 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP	UINT32_C(0x1)
9148 	/* Direct Attached Copper */
9149 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC	UINT32_C(0x2)
9150 	/* Fiber */
9151 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE	UINT32_C(0x3)
9152 	uint8_t xcvr_pkg_type;
9153 	/* This value represents a transceiver type. */
9154 	/* PHY and MAC are in the same package */
9155 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL UINT32_C(0x1)
9156 	/* PHY and MAC are in different packages */
9157 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL UINT32_C(0x2)
9158 	uint8_t eee_config_phy_addr;
9159 	/*
9160 	 * This field represents flags related to EEE configuration. These EEE
9161 	 * configuration flags are valid only when the auto_mode is not set to
9162 	 * none (in other words autonegotiation is enabled).
9163 	 */
9164 	/* This field represents PHY address. */
9165 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK		UINT32_C(0x1f)
9166 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT		0
9167 	/*
9168 	 * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
9169 	 * Speeds for autoneg with EEE mode enabled are based on
9170 	 * eee_link_speed_mask.
9171 	 */
9172 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED   UINT32_C(0x20)
9173 	/*
9174 	 * This flag is valid only when eee_enabled is set to 1. # If
9175 	 * eee_enabled is set to 0, then EEE mode is disabled and this flag
9176 	 * shall be ignored. # If eee_enabled is set to 1 and this flag is set
9177 	 * to 1, then Energy Efficient Ethernet (EEE) mode is enabled and in
9178 	 * use. # If eee_enabled is set to 1 and this flag is set to 0, then
9179 	 * Energy Efficient Ethernet (EEE) mode is enabled but is currently not
9180 	 * in use.
9181 	 */
9182 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE	UINT32_C(0x40)
9183 	/*
9184 	 * This flag is valid only when eee_enabled is set to 1. # If
9185 	 * eee_enabled is set to 0, then EEE mode is disabled and this flag
9186 	 * shall be ignored. # If eee_enabled is set to 1 and this flag is set
9187 	 * to 1, then Energy Efficient Ethernet (EEE) mode is enabled and TX LPI
9188 	 * is enabled. # If eee_enabled is set to 1 and this flag is set to 0,
9189 	 * then Energy Efficient Ethernet (EEE) mode is enabled but TX LPI is
9190 	 * disabled.
9191 	 */
9192 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI	UINT32_C(0x80)
9193 	/*
9194 	 * This field represents flags related to EEE configuration. These EEE
9195 	 * configuration flags are valid only when the auto_mode is not set to
9196 	 * none (in other words autonegotiation is enabled).
9197 	 */
9198 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK	UINT32_C(0xe0)
9199 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT	5
9200 	uint8_t parallel_detect;
9201 	/* Reserved field, set to 0 */
9202 	/*
9203 	 * When set to 1, the parallel detection is used to determine the speed
9204 	 * of the link partner. Parallel detection is used when a
9205 	 * autonegotiation capable device is connected to a link parter that is
9206 	 * not capable of autonegotiation.
9207 	 */
9208 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT	UINT32_C(0x1)
9209 	/* Reserved field, set to 0 */
9210 	#define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_MASK		UINT32_C(0xfe)
9211 	#define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_SFT		1
9212 	uint16_t link_partner_adv_speeds;
9213 	/*
9214 	 * The advertised speeds for the port by the link partner. Each
9215 	 * advertised speed will be set to '1'.
9216 	 */
9217 	/* 100Mb link speed (Half-duplex) */
9218 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD UINT32_C(0x1)
9219 	/* 100Mb link speed (Full-duplex) */
9220 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB UINT32_C(0x2)
9221 	/* 1Gb link speed (Half-duplex) */
9222 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD UINT32_C(0x4)
9223 	/* 1Gb link speed (Full-duplex) */
9224 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB UINT32_C(0x8)
9225 	/* 2Gb link speed */
9226 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB UINT32_C(0x10)
9227 	/* 2.5Gb link speed */
9228 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB UINT32_C(0x20)
9229 	/* 10Gb link speed */
9230 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB UINT32_C(0x40)
9231 	/* 20Gb link speed */
9232 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB UINT32_C(0x80)
9233 	/* 25Gb link speed */
9234 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB UINT32_C(0x100)
9235 	/* 40Gb link speed */
9236 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB UINT32_C(0x200)
9237 	/* 50Gb link speed */
9238 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB UINT32_C(0x400)
9239 	/* 100Gb link speed */
9240 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB UINT32_C(0x800)
9241 	/* 10Mb link speed (Half-duplex) */
9242 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD UINT32_C(0x1000)
9243 	/* 10Mb link speed (Full-duplex) */
9244 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB UINT32_C(0x2000)
9245 	uint8_t link_partner_adv_auto_mode;
9246 	/*
9247 	 * The advertised autoneg for the port by the link partner. This field
9248 	 * is deprecated and should be set to 0.
9249 	 */
9250 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
9251 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE UINT32_C(0x0)
9252 	/* Select all possible speeds for autoneg mode. */
9253 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
9254 	/*
9255 	 * Select only the auto_link_speed speed for autoneg mode. This
9256 	 * mode has been DEPRECATED. An HWRM client should not use this
9257 	 * mode.
9258 	 */
9259 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
9260 	/*
9261 	 * Select the auto_link_speed or any speed below that speed for
9262 	 * autoneg. This mode has been DEPRECATED. An HWRM client should
9263 	 * not use this mode.
9264 	 */
9265 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
9266 	/*
9267 	 * Select the speeds based on the corresponding link speed mask
9268 	 * value that is provided.
9269 	 */
9270 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
9271 	uint8_t link_partner_adv_pause;
9272 	/* The advertised pause settings on the port by the link partner. */
9273 	/*
9274 	 * When this bit is '1', Generation of tx pause messages is supported.
9275 	 * Disabled otherwise.
9276 	 */
9277 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX UINT32_C(0x1)
9278 	/*
9279 	 * When this bit is '1', Reception of rx pause messages is supported.
9280 	 * Disabled otherwise.
9281 	 */
9282 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX UINT32_C(0x2)
9283 	uint16_t adv_eee_link_speed_mask;
9284 	/*
9285 	 * Current setting for link speed mask that is used to advertise speeds
9286 	 * during autonegotiation when EEE is enabled. This field is valid only
9287 	 * when eee_enabled flags is set to 1. The speeds specified in this
9288 	 * field shall be a subset of speeds specified in auto_link_speed_mask.
9289 	 */
9290 	/* Reserved */
9291 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
9292 	/* 100Mb link speed (Full-duplex) */
9293 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
9294 	/* Reserved */
9295 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
9296 	/* 1Gb link speed (Full-duplex) */
9297 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
9298 	/* Reserved */
9299 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
9300 	/* Reserved */
9301 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
9302 	/* 10Gb link speed */
9303 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
9304 	uint16_t link_partner_adv_eee_link_speed_mask;
9305 	/*
9306 	 * Current setting for link speed mask that is advertised by the link
9307 	 * partner when EEE is enabled. This field is valid only when
9308 	 * eee_enabled flags is set to 1.
9309 	 */
9310 	/* Reserved */
9311 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
9312 	/* 100Mb link speed (Full-duplex) */
9313 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
9314 	/* Reserved */
9315 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
9316 	/* 1Gb link speed (Full-duplex) */
9317 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
9318 	/* Reserved */
9319 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
9320 	/* Reserved */
9321 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
9322 	/* 10Gb link speed */
9323 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
9324 	uint32_t xcvr_identifier_type_tx_lpi_timer;
9325 	/* This value represents transceiver identifier type. */
9326 	/*
9327 	 * Current setting of TX LPI timer in microseconds. This field is valid
9328 	 * only when_eee_enabled flag is set to 1 and tx_lpi_enabled is set to
9329 	 * 1.
9330 	 */
9331 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK	UINT32_C(0xffffff)
9332 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT	0
9333 	/* This value represents transceiver identifier type. */
9334 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK UINT32_C(0xff000000)
9335 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24
9336 	/* Unknown */
9337 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN (UINT32_C(0x0) << 24)
9338 	/* SFP/SFP+/SFP28 */
9339 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP (UINT32_C(0x3) << 24)
9340 	/* QSFP */
9341 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP (UINT32_C(0xc) << 24)
9342 	/* QSFP+ */
9343 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS (UINT32_C(0xd) << 24)
9344 	/* QSFP28 */
9345 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 (UINT32_C(0x11) << 24)
9346 	uint16_t fec_cfg;
9347 	/*
9348 	 * This value represents the current configuration of Forward Error
9349 	 * Correction (FEC) on the port.
9350 	 */
9351 	/*
9352 	 * When set to 1, then FEC is not supported on this port. If this flag
9353 	 * is set to 1, then all other FEC configuration flags shall be ignored.
9354 	 * When set to 0, then FEC is supported as indicated by other
9355 	 * configuration flags. If no cable is attached and the HWRM does not
9356 	 * yet know the FEC capability, then the HWRM shall set this flag to 1
9357 	 * when reporting FEC capability.
9358 	 */
9359 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED UINT32_C(0x1)
9360 	/*
9361 	 * When set to 1, then FEC autonegotiation is supported on this port.
9362 	 * When set to 0, then FEC autonegotiation is not supported on this
9363 	 * port.
9364 	 */
9365 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED UINT32_C(0x2)
9366 	/*
9367 	 * When set to 1, then FEC autonegotiation is enabled on this port. When
9368 	 * set to 0, then FEC autonegotiation is disabled if supported. This
9369 	 * flag should be ignored if FEC autonegotiation is not supported on
9370 	 * this port.
9371 	 */
9372 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED UINT32_C(0x4)
9373 	/*
9374 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this
9375 	 * port. When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported
9376 	 * on this port.
9377 	 */
9378 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED UINT32_C(0x8)
9379 	/*
9380 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
9381 	 * port. When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if
9382 	 * supported. This flag should be ignored if FEC CLAUSE 74 is not
9383 	 * supported on this port.
9384 	 */
9385 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED UINT32_C(0x10)
9386 	/*
9387 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this
9388 	 * port. When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not
9389 	 * supported on this port.
9390 	 */
9391 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED UINT32_C(0x20)
9392 	/*
9393 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this
9394 	 * port. When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if
9395 	 * supported. This flag should be ignored if FEC CLAUSE 91 is not
9396 	 * supported on this port.
9397 	 */
9398 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED UINT32_C(0x40)
9399 	uint8_t duplex_state;
9400 	/* This value is indicates the duplex of the current connection state. */
9401 	/* Half Duplex connection. */
9402 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF	UINT32_C(0x0)
9403 	/* Full duplex connection. */
9404 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL	UINT32_C(0x1)
9405 	uint8_t unused_1;
9406 	char phy_vendor_name[16];
9407 	/*
9408 	 * Up to 16 bytes of null padded ASCII string representing PHY vendor.
9409 	 * If the string is set to null, then the vendor name is not available.
9410 	 */
9411 	char phy_vendor_partnumber[16];
9412 	/*
9413 	 * Up to 16 bytes of null padded ASCII string that identifies vendor
9414 	 * specific part number of the PHY. If the string is set to null, then
9415 	 * the vendor specific part number is not available.
9416 	 */
9417 	uint32_t unused_2;
9418 	uint8_t unused_3;
9419 	uint8_t unused_4;
9420 	uint8_t unused_5;
9421 	uint8_t valid;
9422 	/*
9423 	 * This field is used in Output records to indicate that the output is
9424 	 * completely written to RAM. This field should be read as '1' to
9425 	 * indicate that the output has been completely written. When writing a
9426 	 * command completion or response to an internal processor, the order of
9427 	 * writes has to be such that this field is written last.
9428 	 */
9429 } __attribute__((packed));
9430 
9431 /* hwrm_port_mac_cfg */
9432 /*
9433  * Description: This command configures the MAC block for the port. # Only PF
9434  * drivers shall be allowed to configure MAC. # A VF driver should not be
9435  * allowed to configure MAC using this command. # In a network partition mode, a
9436  * PF driver should not be allowed to configure MAC using this command. The QoS
9437  * settings in port_mac_cfg() are global for all ports/functions. If multiple PF
9438  * drivers on different ports are configuring QoS settings, then the HWRM is not
9439  * responsible for maintaining consistency between them. A PF driver changing
9440  * global QoS settings using this command may impact other PF drivers on
9441  * different ports.
9442  */
9443 /* Input (40 bytes) */
9444 
9445 struct hwrm_port_mac_cfg_input {
9446 	uint16_t req_type;
9447 	/*
9448 	 * This value indicates what type of request this is. The format for the
9449 	 * rest of the command is determined by this field.
9450 	 */
9451 	uint16_t cmpl_ring;
9452 	/*
9453 	 * This value indicates the what completion ring the request will be
9454 	 * optionally completed on. If the value is -1, then no CR completion
9455 	 * will be generated. Any other value must be a valid CR ring_id value
9456 	 * for this function.
9457 	 */
9458 	uint16_t seq_id;
9459 	/* This value indicates the command sequence number. */
9460 	uint16_t target_id;
9461 	/*
9462 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
9463 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
9464 	 */
9465 	uint64_t resp_addr;
9466 	/*
9467 	 * This is the host address where the response will be written when the
9468 	 * request is complete. This area must be 16B aligned and must be
9469 	 * cleared to zero before the request is made.
9470 	 */
9471 	uint32_t flags;
9472 	/*
9473 	 * In this field, there are a number of CoS mappings related flags that
9474 	 * are used to configure CoS mappings and their corresponding priorities
9475 	 * in the hardware. For the priorities of CoS mappings, the HWRM uses
9476 	 * the following priority order (high to low) by default: # vlan pri #
9477 	 * ip_dscp # tunnel_vlan_pri # default cos A subset of CoS mappings can
9478 	 * be enabled. If a priority is not specified for an enabled CoS
9479 	 * mapping, the priority will be assigned in the above order for the
9480 	 * enabled CoS mappings. For example, if vlan_pri and ip_dscp CoS
9481 	 * mappings are enabled and their priorities are not specified, the
9482 	 * following priority order (high to low) will be used by the HWRM: #
9483 	 * vlan_pri # ip_dscp # default cos vlan_pri CoS mapping together with
9484 	 * default CoS with lower priority are enabled by default by the HWRM.
9485 	 */
9486 	/*
9487 	 * When this bit is '1', this command will configure the MAC to match
9488 	 * the current link state of the PHY. If the link is not established on
9489 	 * the PHY, then this bit has no effect.
9490 	 */
9491 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK	UINT32_C(0x1)
9492 	/*
9493 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping is
9494 	 * requested to be enabled.
9495 	 */
9496 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE  UINT32_C(0x2)
9497 	/*
9498 	 * When this bit is set to '1', tunnel VLAN PRI field to CoS mapping is
9499 	 * requested to be enabled.
9500 	 */
9501 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE UINT32_C(0x4)
9502 	/*
9503 	 * When this bit is set to '1', the IP DSCP to CoS mapping is requested
9504 	 * to be enabled.
9505 	 */
9506 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE   UINT32_C(0x8)
9507 	/*
9508 	 * When this bit is '1', the HWRM is requested to enable timestamp
9509 	 * capture capability on the receive side of this port.
9510 	 */
9511 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE UINT32_C(0x10)
9512 	/*
9513 	 * When this bit is '1', the HWRM is requested to disable timestamp
9514 	 * capture capability on the receive side of this port.
9515 	 */
9516 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE UINT32_C(0x20)
9517 	/*
9518 	 * When this bit is '1', the HWRM is requested to enable timestamp
9519 	 * capture capability on the transmit side of this port.
9520 	 */
9521 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE UINT32_C(0x40)
9522 	/*
9523 	 * When this bit is '1', the HWRM is requested to disable timestamp
9524 	 * capture capability on the transmit side of this port.
9525 	 */
9526 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE UINT32_C(0x80)
9527 	/*
9528 	 * When this bit is '1', the Out-Of-Box WoL is requested to be enabled
9529 	 * on this port.
9530 	 */
9531 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE	UINT32_C(0x100)
9532 	/*
9533 	 * When this bit is '1', the the Out-Of-Box WoL is requested to be
9534 	 * disabled on this port.
9535 	 */
9536 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE	UINT32_C(0x200)
9537 	/*
9538 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping is
9539 	 * requested to be disabled.
9540 	 */
9541 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE UINT32_C(0x400)
9542 	/*
9543 	 * When this bit is set to '1', tunnel VLAN PRI field to CoS mapping is
9544 	 * requested to be disabled.
9545 	 */
9546 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE UINT32_C(0x800)
9547 	/*
9548 	 * When this bit is set to '1', the IP DSCP to CoS mapping is requested
9549 	 * to be disabled.
9550 	 */
9551 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE  UINT32_C(0x1000)
9552 	uint32_t enables;
9553 	/* This bit must be '1' for the ipg field to be configured. */
9554 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG		UINT32_C(0x1)
9555 	/* This bit must be '1' for the lpbk field to be configured. */
9556 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK		UINT32_C(0x2)
9557 	/*
9558 	 * This bit must be '1' for the vlan_pri2cos_map_pri field to be
9559 	 * configured.
9560 	 */
9561 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI UINT32_C(0x4)
9562 	/* This bit must be '1' for the Reserved1 field to be configured. */
9563 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RESERVED1	UINT32_C(0x8)
9564 	/*
9565 	 * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
9566 	 * configured.
9567 	 */
9568 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI UINT32_C(0x10)
9569 	/* This bit must be '1' for the dscp2cos_map_pri field to be configured. */
9570 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI   UINT32_C(0x20)
9571 	/*
9572 	 * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
9573 	 * configured.
9574 	 */
9575 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE UINT32_C(0x40)
9576 	/*
9577 	 * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
9578 	 * configured.
9579 	 */
9580 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE UINT32_C(0x80)
9581 	/* This bit must be '1' for the cos_field_cfg field to be configured. */
9582 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG	UINT32_C(0x100)
9583 	uint16_t port_id;
9584 	/* Port ID of port that is to be configured. */
9585 	uint8_t ipg;
9586 	/*
9587 	 * This value is used to configure the minimum IPG that will be sent
9588 	 * between packets by this port.
9589 	 */
9590 	uint8_t lpbk;
9591 	/* This value controls the loopback setting for the MAC. */
9592 	/* No loopback is selected. Normal operation. */
9593 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE		UINT32_C(0x0)
9594 	/*
9595 	 * The HW will be configured with local loopback such that host
9596 	 * data is sent back to the host without modification.
9597 	 */
9598 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL		UINT32_C(0x1)
9599 	/*
9600 	 * The HW will be configured with remote loopback such that port
9601 	 * logic will send packets back out the transmitter that are
9602 	 * received.
9603 	 */
9604 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE		UINT32_C(0x2)
9605 	uint8_t vlan_pri2cos_map_pri;
9606 	/*
9607 	 * This value controls the priority setting of VLAN PRI to CoS mapping
9608 	 * based on VLAN Tags of inner packet headers of tunneled packets or
9609 	 * packet headers of non-tunneled packets. # Each XXX_pri variable shall
9610 	 * have a unique priority value when it is being specified. # When
9611 	 * comparing priorities of mappings, higher value indicates higher
9612 	 * priority. For example, a value of 0-3 is returned where 0 is being
9613 	 * the lowest priority and 3 is being the highest priority.
9614 	 */
9615 	uint8_t reserved1;
9616 	/* Reserved field */
9617 	uint8_t tunnel_pri2cos_map_pri;
9618 	/*
9619 	 * This value controls the priority setting of VLAN PRI to CoS mapping
9620 	 * based on VLAN Tags of tunneled header. This mapping only applies when
9621 	 * tunneled headers are present. # Each XXX_pri variable shall have a
9622 	 * unique priority value when it is being specified. # When comparing
9623 	 * priorities of mappings, higher value indicates higher priority. For
9624 	 * example, a value of 0-3 is returned where 0 is being the lowest
9625 	 * priority and 3 is being the highest priority.
9626 	 */
9627 	uint8_t dscp2pri_map_pri;
9628 	/*
9629 	 * This value controls the priority setting of IP DSCP to CoS mapping
9630 	 * based on inner IP header of tunneled packets or IP header of non-
9631 	 * tunneled packets. # Each XXX_pri variable shall have a unique
9632 	 * priority value when it is being specified. # When comparing
9633 	 * priorities of mappings, higher value indicates higher priority. For
9634 	 * example, a value of 0-3 is returned where 0 is being the lowest
9635 	 * priority and 3 is being the highest priority.
9636 	 */
9637 	uint16_t rx_ts_capture_ptp_msg_type;
9638 	/*
9639 	 * This is a 16-bit bit mask that is used to request a specific
9640 	 * configuration of time stamp capture of PTP messages on the receive
9641 	 * side of this port. This field shall be ignored if the
9642 	 * ptp_rx_ts_capture_enable flag is not set in this command. Otherwise,
9643 	 * if bit 'i' is set, then the HWRM is being requested to configure the
9644 	 * receive side of the port to capture the time stamp of every received
9645 	 * PTP message with messageType field value set to i.
9646 	 */
9647 	uint16_t tx_ts_capture_ptp_msg_type;
9648 	/*
9649 	 * This is a 16-bit bit mask that is used to request a specific
9650 	 * configuration of time stamp capture of PTP messages on the transmit
9651 	 * side of this port. This field shall be ignored if the
9652 	 * ptp_tx_ts_capture_enable flag is not set in this command. Otherwise,
9653 	 * if bit 'i' is set, then the HWRM is being requested to configure the
9654 	 * transmit sied of the port to capture the time stamp of every
9655 	 * transmitted PTP message with messageType field value set to i.
9656 	 */
9657 	uint8_t cos_field_cfg;
9658 	/* Configuration of CoS fields. */
9659 	/* Reserved. */
9660 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1	UINT32_C(0x1)
9661 	/*
9662 	 * This field is used to specify selection of VLAN PRI value based on
9663 	 * whether one or two VLAN Tags are present in the inner packet headers
9664 	 * of tunneled packets or non-tunneled packets. This field is valid only
9665 	 * if inner VLAN PRI to CoS mapping is enabled. If VLAN PRI to CoS
9666 	 * mapping is not enabled, then this field shall be ignored.
9667 	 */
9668 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK UINT32_C(0x6)
9669 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
9670 	/*
9671 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are present in
9672 	 * the inner packet headers
9673 	 */
9674 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 1)
9675 	/*
9676 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are present in the
9677 	 * inner packet headers. No VLAN PRI shall be selected for this
9678 	 * configuration if only one VLAN Tag is present in the inner
9679 	 * packet headers.
9680 	 */
9681 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 1)
9682 	/*
9683 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags are present
9684 	 * in the inner packet headers
9685 	 */
9686 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 1)
9687 	/* Unspecified */
9688 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 1)
9689 	#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
9690 	/*
9691 	 * This field is used to specify selection of tunnel VLAN PRI value
9692 	 * based on whether one or two VLAN Tags are present in tunnel headers.
9693 	 * This field is valid only if tunnel VLAN PRI to CoS mapping is
9694 	 * enabled. If tunnel VLAN PRI to CoS mapping is not enabled, then this
9695 	 * field shall be ignored.
9696 	 */
9697 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK UINT32_C(0x18)
9698 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
9699 	/*
9700 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are present in
9701 	 * the tunnel packet headers
9702 	 */
9703 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 3)
9704 	/*
9705 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are present in the
9706 	 * tunnel packet headers. No tunnel VLAN PRI shall be selected
9707 	 * for this configuration if only one VLAN Tag is present in the
9708 	 * tunnel packet headers.
9709 	 */
9710 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 3)
9711 	/*
9712 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags are present
9713 	 * in the tunnel packet headers
9714 	 */
9715 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 3)
9716 	/* Unspecified */
9717 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 3)
9718 	#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
9719 	/*
9720 	 * This field shall be used to provide default CoS value that has been
9721 	 * configured on this port. This field is valid only if default CoS
9722 	 * mapping is enabled. If default CoS mapping is not enabled, then this
9723 	 * field shall be ignored.
9724 	 */
9725 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK UINT32_C(0xe0)
9726 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT 5
9727 	uint8_t unused_0[3];
9728 } __attribute__((packed));
9729 
9730 /* Output (16 bytes) */
9731 
9732 struct hwrm_port_mac_cfg_output {
9733 	uint16_t error_code;
9734 	/*
9735 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
9736 	 * and fail the call with an error when appropriate
9737 	 */
9738 	uint16_t req_type;
9739 	/* This field returns the type of original request. */
9740 	uint16_t seq_id;
9741 	/* This field provides original sequence number of the command. */
9742 	uint16_t resp_len;
9743 	/*
9744 	 * This field is the length of the response in bytes. The last byte of
9745 	 * the response is a valid flag that will read as '1' when the command
9746 	 * has been completely written to memory.
9747 	 */
9748 	uint16_t mru;
9749 	/*
9750 	 * This is the configured maximum length of Ethernet packet payload that
9751 	 * is allowed to be received on the port. This value does not include
9752 	 * the number of bytes used by Ethernet header and trailer (CRC).
9753 	 */
9754 	uint16_t mtu;
9755 	/*
9756 	 * This is the configured maximum length of Ethernet packet payload that
9757 	 * is allowed to be transmitted on the port. This value does not include
9758 	 * the number of bytes used by Ethernet header and trailer (CRC).
9759 	 */
9760 	uint8_t ipg;
9761 	/* Current configuration of the IPG value. */
9762 	uint8_t lpbk;
9763 	/* Current value of the loopback value. */
9764 	/* No loopback is selected. Normal operation. */
9765 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE		UINT32_C(0x0)
9766 	/*
9767 	 * The HW will be configured with local loopback such that host
9768 	 * data is sent back to the host without modification.
9769 	 */
9770 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL		UINT32_C(0x1)
9771 	/*
9772 	 * The HW will be configured with remote loopback such that port
9773 	 * logic will send packets back out the transmitter that are
9774 	 * received.
9775 	 */
9776 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE		UINT32_C(0x2)
9777 	uint8_t unused_0;
9778 	uint8_t valid;
9779 	/*
9780 	 * This field is used in Output records to indicate that the output is
9781 	 * completely written to RAM. This field should be read as '1' to
9782 	 * indicate that the output has been completely written. When writing a
9783 	 * command completion or response to an internal processor, the order of
9784 	 * writes has to be such that this field is written last.
9785 	 */
9786 } __attribute__((packed));
9787 
9788 /* hwrm_port_mac_qcfg */
9789 /* Description: This command queries the MAC block for the port. */
9790 /* Input (24 bytes) */
9791 
9792 struct hwrm_port_mac_qcfg_input {
9793 	uint16_t req_type;
9794 	/*
9795 	 * This value indicates what type of request this is. The format for the
9796 	 * rest of the command is determined by this field.
9797 	 */
9798 	uint16_t cmpl_ring;
9799 	/*
9800 	 * This value indicates the what completion ring the request will be
9801 	 * optionally completed on. If the value is -1, then no CR completion
9802 	 * will be generated. Any other value must be a valid CR ring_id value
9803 	 * for this function.
9804 	 */
9805 	uint16_t seq_id;
9806 	/* This value indicates the command sequence number. */
9807 	uint16_t target_id;
9808 	/*
9809 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
9810 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
9811 	 */
9812 	uint64_t resp_addr;
9813 	/*
9814 	 * This is the host address where the response will be written when the
9815 	 * request is complete. This area must be 16B aligned and must be
9816 	 * cleared to zero before the request is made.
9817 	 */
9818 	uint16_t port_id;
9819 	/* Port ID of port that is to be configured. */
9820 	uint16_t unused_0[3];
9821 } __attribute__((packed));
9822 
9823 /* Output (24 bytes) */
9824 
9825 struct hwrm_port_mac_qcfg_output {
9826 	uint16_t error_code;
9827 	/*
9828 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
9829 	 * and fail the call with an error when appropriate
9830 	 */
9831 	uint16_t req_type;
9832 	/* This field returns the type of original request. */
9833 	uint16_t seq_id;
9834 	/* This field provides original sequence number of the command. */
9835 	uint16_t resp_len;
9836 	/*
9837 	 * This field is the length of the response in bytes. The last byte of
9838 	 * the response is a valid flag that will read as '1' when the command
9839 	 * has been completely written to memory.
9840 	 */
9841 	uint16_t mru;
9842 	/*
9843 	 * This is the configured maximum length of Ethernet packet payload that
9844 	 * is allowed to be received on the port. This value does not include
9845 	 * the number of bytes used by the Ethernet header and trailer (CRC).
9846 	 */
9847 	uint16_t mtu;
9848 	/*
9849 	 * This is the configured maximum length of Ethernet packet payload that
9850 	 * is allowed to be transmitted on the port. This value does not include
9851 	 * the number of bytes used by the Ethernet header and trailer (CRC).
9852 	 */
9853 	uint8_t ipg;
9854 	/* The minimum IPG that will be sent between packets by this port. */
9855 	uint8_t lpbk;
9856 	/* The loopback setting for the MAC. */
9857 	/* No loopback is selected. Normal operation. */
9858 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE		UINT32_C(0x0)
9859 	/*
9860 	 * The HW will be configured with local loopback such that host
9861 	 * data is sent back to the host without modification.
9862 	 */
9863 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL		UINT32_C(0x1)
9864 	/*
9865 	 * The HW will be configured with remote loopback such that port
9866 	 * logic will send packets back out the transmitter that are
9867 	 * received.
9868 	 */
9869 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE		UINT32_C(0x2)
9870 	uint8_t vlan_pri2cos_map_pri;
9871 	/*
9872 	 * Priority setting for VLAN PRI to CoS mapping. # Each XXX_pri variable
9873 	 * shall have a unique priority value when it is being used. # When
9874 	 * comparing priorities of mappings, higher value indicates higher
9875 	 * priority. For example, a value of 0-3 is returned where 0 is being
9876 	 * the lowest priority and 3 is being the highest priority. # If the
9877 	 * correspoding CoS mapping is not enabled, then this field should be
9878 	 * ignored. # This value indicates the normalized priority value
9879 	 * retained in the HWRM.
9880 	 */
9881 	uint8_t flags;
9882 	/*
9883 	 * In this field, a number of CoS mappings related flags are used to
9884 	 * indicate configured CoS mappings.
9885 	 */
9886 	/*
9887 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping is
9888 	 * enabled.
9889 	 */
9890 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE UINT32_C(0x1)
9891 	/*
9892 	 * When this bit is set to '1', tunnel VLAN PRI field to CoS mapping is
9893 	 * enabled.
9894 	 */
9895 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE UINT32_C(0x2)
9896 	/* When this bit is set to '1', the IP DSCP to CoS mapping is enabled. */
9897 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE UINT32_C(0x4)
9898 	/* When this bit is '1', the Out-Of-Box WoL is enabled on this port. */
9899 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE	UINT32_C(0x8)
9900 	/* When this bit is '1', PTP is enabled for RX on this port. */
9901 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE UINT32_C(0x10)
9902 	/* When this bit is '1', PTP is enabled for TX on this port. */
9903 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE UINT32_C(0x20)
9904 	uint8_t tunnel_pri2cos_map_pri;
9905 	/*
9906 	 * Priority setting for tunnel VLAN PRI to CoS mapping. # Each XXX_pri
9907 	 * variable shall have a unique priority value when it is being used. #
9908 	 * When comparing priorities of mappings, higher value indicates higher
9909 	 * priority. For example, a value of 0-3 is returned where 0 is being
9910 	 * the lowest priority and 3 is being the highest priority. # If the
9911 	 * correspoding CoS mapping is not enabled, then this field should be
9912 	 * ignored. # This value indicates the normalized priority value
9913 	 * retained in the HWRM.
9914 	 */
9915 	uint8_t dscp2pri_map_pri;
9916 	/*
9917 	 * Priority setting for DSCP to PRI mapping. # Each XXX_pri variable
9918 	 * shall have a unique priority value when it is being used. # When
9919 	 * comparing priorities of mappings, higher value indicates higher
9920 	 * priority. For example, a value of 0-3 is returned where 0 is being
9921 	 * the lowest priority and 3 is being the highest priority. # If the
9922 	 * correspoding CoS mapping is not enabled, then this field should be
9923 	 * ignored. # This value indicates the normalized priority value
9924 	 * retained in the HWRM.
9925 	 */
9926 	uint16_t rx_ts_capture_ptp_msg_type;
9927 	/*
9928 	 * This is a 16-bit bit mask that represents the current configuration
9929 	 * of time stamp capture of PTP messages on the receive side of this
9930 	 * port. If bit 'i' is set, then the receive side of the port is
9931 	 * configured to capture the time stamp of every received PTP message
9932 	 * with messageType field value set to i. If all bits are set to 0 (i.e.
9933 	 * field value set 0), then the receive side of the port is not
9934 	 * configured to capture timestamp for PTP messages. If all bits are set
9935 	 * to 1, then the receive side of the port is configured to capture
9936 	 * timestamp for all PTP messages.
9937 	 */
9938 	uint16_t tx_ts_capture_ptp_msg_type;
9939 	/*
9940 	 * This is a 16-bit bit mask that represents the current configuration
9941 	 * of time stamp capture of PTP messages on the transmit side of this
9942 	 * port. If bit 'i' is set, then the transmit side of the port is
9943 	 * configured to capture the time stamp of every received PTP message
9944 	 * with messageType field value set to i. If all bits are set to 0 (i.e.
9945 	 * field value set 0), then the transmit side of the port is not
9946 	 * configured to capture timestamp for PTP messages. If all bits are set
9947 	 * to 1, then the transmit side of the port is configured to capture
9948 	 * timestamp for all PTP messages.
9949 	 */
9950 	uint8_t cos_field_cfg;
9951 	/* Configuration of CoS fields. */
9952 	/* Reserved */
9953 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD	UINT32_C(0x1)
9954 	/*
9955 	 * This field is used for selecting VLAN PRI value based on whether one
9956 	 * or two VLAN Tags are present in the inner packet headers of tunneled
9957 	 * packets or non-tunneled packets.
9958 	 */
9959 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK UINT32_C(0x6)
9960 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT 1
9961 	/*
9962 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are present in
9963 	 * the inner packet headers
9964 	 */
9965 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 1)
9966 	/*
9967 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are present in the
9968 	 * inner packet headers. No VLAN PRI is selected for this
9969 	 * configuration if only one VLAN Tag is present in the inner
9970 	 * packet headers.
9971 	 */
9972 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 1)
9973 	/*
9974 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags are present
9975 	 * in the inner packet headers
9976 	 */
9977 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 1)
9978 	/* Unspecified */
9979 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 1)
9980 	#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
9981 	/*
9982 	 * This field is used for selecting tunnel VLAN PRI value based on
9983 	 * whether one or two VLAN Tags are present in the tunnel headers of
9984 	 * tunneled packets. This selection does not apply to non-tunneled
9985 	 * packets.
9986 	 */
9987 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK UINT32_C(0x18)
9988 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT 3
9989 	/*
9990 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are present in
9991 	 * the tunnel packet headers
9992 	 */
9993 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST (UINT32_C(0x0) << 3)
9994 	/*
9995 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are present in the
9996 	 * tunnel packet headers. No VLAN PRI is selected for this
9997 	 * configuration if only one VLAN Tag is present in the tunnel
9998 	 * packet headers.
9999 	 */
10000 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER (UINT32_C(0x1) << 3)
10001 	/*
10002 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags are present
10003 	 * in the tunnel packet headers
10004 	 */
10005 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST (UINT32_C(0x2) << 3)
10006 	/* Unspecified */
10007 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED (UINT32_C(0x3) << 3)
10008 	#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
10009 	/*
10010 	 * This field is used to provide default CoS value that has been
10011 	 * configured on this port.
10012 	 */
10013 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK UINT32_C(0xe0)
10014 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT 5
10015 	uint8_t valid;
10016 	/*
10017 	 * This field is used in Output records to indicate that the output is
10018 	 * completely written to RAM. This field should be read as '1' to
10019 	 * indicate that the output has been completely written. When writing a
10020 	 * command completion or response to an internal processor, the order of
10021 	 * writes has to be such that this field is written last.
10022 	 */
10023 } __attribute__((packed));
10024 
10025 /* hwrm_port_mac_ptp_qcfg */
10026 /* Description: This command queries the PTP information for the port. */
10027 /* Input (24 bytes) */
10028 
10029 struct hwrm_port_mac_ptp_qcfg_input {
10030 	uint16_t req_type;
10031 	/*
10032 	 * This value indicates what type of request this is. The format for the
10033 	 * rest of the command is determined by this field.
10034 	 */
10035 	uint16_t cmpl_ring;
10036 	/*
10037 	 * This value indicates the what completion ring the request will be
10038 	 * optionally completed on. If the value is -1, then no CR completion
10039 	 * will be generated. Any other value must be a valid CR ring_id value
10040 	 * for this function.
10041 	 */
10042 	uint16_t seq_id;
10043 	/* This value indicates the command sequence number. */
10044 	uint16_t target_id;
10045 	/*
10046 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10047 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10048 	 */
10049 	uint64_t resp_addr;
10050 	/*
10051 	 * This is the host address where the response will be written when the
10052 	 * request is complete. This area must be 16B aligned and must be
10053 	 * cleared to zero before the request is made.
10054 	 */
10055 	uint16_t port_id;
10056 	/* Port ID of port that is being queried. */
10057 	uint16_t unused_0[3];
10058 } __attribute__((packed));
10059 
10060 /* Output (80 bytes) */
10061 
10062 struct hwrm_port_mac_ptp_qcfg_output {
10063 	uint16_t error_code;
10064 	/*
10065 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10066 	 * and fail the call with an error when appropriate
10067 	 */
10068 	uint16_t req_type;
10069 	/* This field returns the type of original request. */
10070 	uint16_t seq_id;
10071 	/* This field provides original sequence number of the command. */
10072 	uint16_t resp_len;
10073 	/*
10074 	 * This field is the length of the response in bytes. The last byte of
10075 	 * the response is a valid flag that will read as '1' when the command
10076 	 * has been completely written to memory.
10077 	 */
10078 	uint8_t flags;
10079 	/*
10080 	 * In this field, a number of PTP related flags are used to indicate
10081 	 * configured PTP capabilities.
10082 	 */
10083 	/*
10084 	 * When this bit is set to '1', the PTP related registers are directly
10085 	 * accessible by the host.
10086 	 */
10087 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS  UINT32_C(0x1)
10088 	/*
10089 	 * When this bit is set to '1', the PTP information is accessible via
10090 	 * HWRM commands.
10091 	 */
10092 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS	UINT32_C(0x2)
10093 	uint8_t unused_0;
10094 	uint16_t unused_1;
10095 	uint32_t rx_ts_reg_off_lower;
10096 	/* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
10097 	uint32_t rx_ts_reg_off_upper;
10098 	/* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
10099 	uint32_t rx_ts_reg_off_seq_id;
10100 	/* Offset of the PTP register for the sequence ID for RX. */
10101 	uint32_t rx_ts_reg_off_src_id_0;
10102 	/* Offset of the first PTP source ID for RX. */
10103 	uint32_t rx_ts_reg_off_src_id_1;
10104 	/* Offset of the second PTP source ID for RX. */
10105 	uint32_t rx_ts_reg_off_src_id_2;
10106 	/* Offset of the third PTP source ID for RX. */
10107 	uint32_t rx_ts_reg_off_domain_id;
10108 	/* Offset of the domain ID for RX. */
10109 	uint32_t rx_ts_reg_off_fifo;
10110 	/* Offset of the PTP FIFO register for RX. */
10111 	uint32_t rx_ts_reg_off_fifo_adv;
10112 	/* Offset of the PTP advance FIFO register for RX. */
10113 	uint32_t rx_ts_reg_off_granularity;
10114 	/* PTP timestamp granularity for RX. */
10115 	uint32_t tx_ts_reg_off_lower;
10116 	/* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
10117 	uint32_t tx_ts_reg_off_upper;
10118 	/* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
10119 	uint32_t tx_ts_reg_off_seq_id;
10120 	/* Offset of the PTP register for the sequence ID for TX. */
10121 	uint32_t tx_ts_reg_off_fifo;
10122 	/* Offset of the PTP FIFO register for TX. */
10123 	uint32_t tx_ts_reg_off_granularity;
10124 	/* PTP timestamp granularity for TX. */
10125 	uint32_t unused_2;
10126 	uint8_t unused_3;
10127 	uint8_t unused_4;
10128 	uint8_t unused_5;
10129 	uint8_t valid;
10130 	/*
10131 	 * This field is used in Output records to indicate that the output is
10132 	 * completely written to RAM. This field should be read as '1' to
10133 	 * indicate that the output has been completely written. When writing a
10134 	 * command completion or response to an internal processor, the order of
10135 	 * writes has to be such that this field is written last.
10136 	 */
10137 } __attribute__((packed));
10138 
10139 /* hwrm_port_qstats */
10140 /* Description: This function returns per port Ethernet statistics. */
10141 /* Input (40 bytes) */
10142 
10143 struct hwrm_port_qstats_input {
10144 	uint16_t req_type;
10145 	/*
10146 	 * This value indicates what type of request this is. The format for the
10147 	 * rest of the command is determined by this field.
10148 	 */
10149 	uint16_t cmpl_ring;
10150 	/*
10151 	 * This value indicates the what completion ring the request will be
10152 	 * optionally completed on. If the value is -1, then no CR completion
10153 	 * will be generated. Any other value must be a valid CR ring_id value
10154 	 * for this function.
10155 	 */
10156 	uint16_t seq_id;
10157 	/* This value indicates the command sequence number. */
10158 	uint16_t target_id;
10159 	/*
10160 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10161 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10162 	 */
10163 	uint64_t resp_addr;
10164 	/*
10165 	 * This is the host address where the response will be written when the
10166 	 * request is complete. This area must be 16B aligned and must be
10167 	 * cleared to zero before the request is made.
10168 	 */
10169 	uint16_t port_id;
10170 	/* Port ID of port that is being queried. */
10171 	uint8_t unused_0;
10172 	uint8_t unused_1;
10173 	uint8_t unused_2[3];
10174 	uint8_t unused_3;
10175 	uint64_t tx_stat_host_addr;
10176 	/* This is the host address where Tx port statistics will be stored */
10177 	uint64_t rx_stat_host_addr;
10178 	/* This is the host address where Rx port statistics will be stored */
10179 } __attribute__((packed));
10180 
10181 /* Output (16 bytes) */
10182 
10183 struct hwrm_port_qstats_output {
10184 	uint16_t error_code;
10185 	/*
10186 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10187 	 * and fail the call with an error when appropriate
10188 	 */
10189 	uint16_t req_type;
10190 	/* This field returns the type of original request. */
10191 	uint16_t seq_id;
10192 	/* This field provides original sequence number of the command. */
10193 	uint16_t resp_len;
10194 	/*
10195 	 * This field is the length of the response in bytes. The last byte of
10196 	 * the response is a valid flag that will read as '1' when the command
10197 	 * has been completely written to memory.
10198 	 */
10199 	uint16_t tx_stat_size;
10200 	/* The size of TX port statistics block in bytes. */
10201 	uint16_t rx_stat_size;
10202 	/* The size of RX port statistics block in bytes. */
10203 	uint8_t unused_0;
10204 	uint8_t unused_1;
10205 	uint8_t unused_2;
10206 	uint8_t valid;
10207 	/*
10208 	 * This field is used in Output records to indicate that the output is
10209 	 * completely written to RAM. This field should be read as '1' to
10210 	 * indicate that the output has been completely written. When writing a
10211 	 * command completion or response to an internal processor, the order of
10212 	 * writes has to be such that this field is written last.
10213 	 */
10214 } __attribute__((packed));
10215 
10216 /* hwrm_port_lpbk_qstats */
10217 /* Description: This function returns loopback statistics. */
10218 /* Input (16 bytes) */
10219 
10220 struct hwrm_port_lpbk_qstats_input {
10221 	uint16_t req_type;
10222 	/*
10223 	 * This value indicates what type of request this is. The format for the
10224 	 * rest of the command is determined by this field.
10225 	 */
10226 	uint16_t cmpl_ring;
10227 	/*
10228 	 * This value indicates the what completion ring the request will be
10229 	 * optionally completed on. If the value is -1, then no CR completion
10230 	 * will be generated. Any other value must be a valid CR ring_id value
10231 	 * for this function.
10232 	 */
10233 	uint16_t seq_id;
10234 	/* This value indicates the command sequence number. */
10235 	uint16_t target_id;
10236 	/*
10237 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10238 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10239 	 */
10240 	uint64_t resp_addr;
10241 	/*
10242 	 * This is the host address where the response will be written when the
10243 	 * request is complete. This area must be 16B aligned and must be
10244 	 * cleared to zero before the request is made.
10245 	 */
10246 } __attribute__((packed));
10247 
10248 /* Output (96 bytes) */
10249 
10250 struct hwrm_port_lpbk_qstats_output {
10251 	uint16_t error_code;
10252 	/*
10253 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10254 	 * and fail the call with an error when appropriate
10255 	 */
10256 	uint16_t req_type;
10257 	/* This field returns the type of original request. */
10258 	uint16_t seq_id;
10259 	/* This field provides original sequence number of the command. */
10260 	uint16_t resp_len;
10261 	/*
10262 	 * This field is the length of the response in bytes. The last byte of
10263 	 * the response is a valid flag that will read as '1' when the command
10264 	 * has been completely written to memory.
10265 	 */
10266 	uint64_t lpbk_ucast_frames;
10267 	/* Number of transmitted unicast frames */
10268 	uint64_t lpbk_mcast_frames;
10269 	/* Number of transmitted multicast frames */
10270 	uint64_t lpbk_bcast_frames;
10271 	/* Number of transmitted broadcast frames */
10272 	uint64_t lpbk_ucast_bytes;
10273 	/* Number of transmitted bytes for unicast traffic */
10274 	uint64_t lpbk_mcast_bytes;
10275 	/* Number of transmitted bytes for multicast traffic */
10276 	uint64_t lpbk_bcast_bytes;
10277 	/* Number of transmitted bytes for broadcast traffic */
10278 	uint64_t tx_stat_discard;
10279 	/* Total Tx Drops for loopback traffic reported by STATS block */
10280 	uint64_t tx_stat_error;
10281 	/* Total Tx Error Drops for loopback traffic reported by STATS block */
10282 	uint64_t rx_stat_discard;
10283 	/* Total Rx Drops for loopback traffic reported by STATS block */
10284 	uint64_t rx_stat_error;
10285 	/* Total Rx Error Drops for loopback traffic reported by STATS block */
10286 	uint32_t unused_0;
10287 	uint8_t unused_1;
10288 	uint8_t unused_2;
10289 	uint8_t unused_3;
10290 	uint8_t valid;
10291 	/*
10292 	 * This field is used in Output records to indicate that the output is
10293 	 * completely written to RAM. This field should be read as '1' to
10294 	 * indicate that the output has been completely written. When writing a
10295 	 * command completion or response to an internal processor, the order of
10296 	 * writes has to be such that this field is written last.
10297 	 */
10298 } __attribute__((packed));
10299 
10300 /* hwrm_port_clr_stats */
10301 /*
10302  * Description: This function clears per port statistics. The HWRM shall not
10303  * allow a VF driver to clear port statistics. The HWRM shall not allow a PF
10304  * driver to clear port statistics in a partitioning mode. The HWRM may allow a
10305  * PF driver to clear port statistics in the non-partitioning mode.
10306  */
10307 /* Input (24 bytes) */
10308 
10309 struct hwrm_port_clr_stats_input {
10310 	uint16_t req_type;
10311 	/*
10312 	 * This value indicates what type of request this is. The format for the
10313 	 * rest of the command is determined by this field.
10314 	 */
10315 	uint16_t cmpl_ring;
10316 	/*
10317 	 * This value indicates the what completion ring the request will be
10318 	 * optionally completed on. If the value is -1, then no CR completion
10319 	 * will be generated. Any other value must be a valid CR ring_id value
10320 	 * for this function.
10321 	 */
10322 	uint16_t seq_id;
10323 	/* This value indicates the command sequence number. */
10324 	uint16_t target_id;
10325 	/*
10326 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10327 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10328 	 */
10329 	uint64_t resp_addr;
10330 	/*
10331 	 * This is the host address where the response will be written when the
10332 	 * request is complete. This area must be 16B aligned and must be
10333 	 * cleared to zero before the request is made.
10334 	 */
10335 	uint16_t port_id;
10336 	/* Port ID of port that is being queried. */
10337 	uint16_t unused_0[3];
10338 } __attribute__((packed));
10339 
10340 /* Output (16 bytes) */
10341 
10342 struct hwrm_port_clr_stats_output {
10343 	uint16_t error_code;
10344 	/*
10345 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10346 	 * and fail the call with an error when appropriate
10347 	 */
10348 	uint16_t req_type;
10349 	/* This field returns the type of original request. */
10350 	uint16_t seq_id;
10351 	/* This field provides original sequence number of the command. */
10352 	uint16_t resp_len;
10353 	/*
10354 	 * This field is the length of the response in bytes. The last byte of
10355 	 * the response is a valid flag that will read as '1' when the command
10356 	 * has been completely written to memory.
10357 	 */
10358 	uint32_t unused_0;
10359 	uint8_t unused_1;
10360 	uint8_t unused_2;
10361 	uint8_t unused_3;
10362 	uint8_t valid;
10363 	/*
10364 	 * This field is used in Output records to indicate that the output is
10365 	 * completely written to RAM. This field should be read as '1' to
10366 	 * indicate that the output has been completely written. When writing a
10367 	 * command completion or response to an internal processor, the order of
10368 	 * writes has to be such that this field is written last.
10369 	 */
10370 } __attribute__((packed));
10371 
10372 /* hwrm_port_lpbk_clr_stats */
10373 /*
10374  * Description: This function clears loopback statistics. The HWRM shall not
10375  * allow a VF driver to clear loopback statistics. The HWRM shall not allow a PF
10376  * driver to clear loopback statistics in a partitioning mode. The HWRM may
10377  * allow a PF driver to clear loopback statistics in the non-partitioning mode.
10378  */
10379 /* Input (16 bytes) */
10380 
10381 struct hwrm_port_lpbk_clr_stats_input {
10382 	uint16_t req_type;
10383 	/*
10384 	 * This value indicates what type of request this is. The format for the
10385 	 * rest of the command is determined by this field.
10386 	 */
10387 	uint16_t cmpl_ring;
10388 	/*
10389 	 * This value indicates the what completion ring the request will be
10390 	 * optionally completed on. If the value is -1, then no CR completion
10391 	 * will be generated. Any other value must be a valid CR ring_id value
10392 	 * for this function.
10393 	 */
10394 	uint16_t seq_id;
10395 	/* This value indicates the command sequence number. */
10396 	uint16_t target_id;
10397 	/*
10398 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10399 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10400 	 */
10401 	uint64_t resp_addr;
10402 	/*
10403 	 * This is the host address where the response will be written when the
10404 	 * request is complete. This area must be 16B aligned and must be
10405 	 * cleared to zero before the request is made.
10406 	 */
10407 } __attribute__((packed));
10408 
10409 /* Output (16 bytes) */
10410 
10411 struct hwrm_port_lpbk_clr_stats_output {
10412 	uint16_t error_code;
10413 	/*
10414 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10415 	 * and fail the call with an error when appropriate
10416 	 */
10417 	uint16_t req_type;
10418 	/* This field returns the type of original request. */
10419 	uint16_t seq_id;
10420 	/* This field provides original sequence number of the command. */
10421 	uint16_t resp_len;
10422 	/*
10423 	 * This field is the length of the response in bytes. The last byte of
10424 	 * the response is a valid flag that will read as '1' when the command
10425 	 * has been completely written to memory.
10426 	 */
10427 	uint32_t unused_0;
10428 	uint8_t unused_1;
10429 	uint8_t unused_2;
10430 	uint8_t unused_3;
10431 	uint8_t valid;
10432 	/*
10433 	 * This field is used in Output records to indicate that the output is
10434 	 * completely written to RAM. This field should be read as '1' to
10435 	 * indicate that the output has been completely written. When writing a
10436 	 * command completion or response to an internal processor, the order of
10437 	 * writes has to be such that this field is written last.
10438 	 */
10439 } __attribute__((packed));
10440 
10441 /* hwrm_port_ts_query */
10442 /*
10443  * Description: This function is used to read timestamp information captured for
10444  * PTP messages on this port.
10445  */
10446 /* Input (24 bytes) */
10447 
10448 struct hwrm_port_ts_query_input {
10449 	uint16_t req_type;
10450 	/*
10451 	 * This value indicates what type of request this is. The format for the
10452 	 * rest of the command is determined by this field.
10453 	 */
10454 	uint16_t cmpl_ring;
10455 	/*
10456 	 * This value indicates the what completion ring the request will be
10457 	 * optionally completed on. If the value is -1, then no CR completion
10458 	 * will be generated. Any other value must be a valid CR ring_id value
10459 	 * for this function.
10460 	 */
10461 	uint16_t seq_id;
10462 	/* This value indicates the command sequence number. */
10463 	uint16_t target_id;
10464 	/*
10465 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10466 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10467 	 */
10468 	uint64_t resp_addr;
10469 	/*
10470 	 * This is the host address where the response will be written when the
10471 	 * request is complete. This area must be 16B aligned and must be
10472 	 * cleared to zero before the request is made.
10473 	 */
10474 	uint32_t flags;
10475 	/*
10476 	 * Enumeration denoting the RX, TX type of the resource. This
10477 	 * enumeration is used for resources that are similar for both TX and RX
10478 	 * paths of the chip.
10479 	 */
10480 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH		UINT32_C(0x1)
10481 	/* tx path */
10482 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
10483 	/* rx path */
10484 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
10485 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST	HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
10486 	uint16_t port_id;
10487 	/* Port ID of port that is being queried. */
10488 	uint16_t unused_0;
10489 } __attribute__((packed));
10490 
10491 /* Output (24 bytes) */
10492 
10493 struct hwrm_port_ts_query_output {
10494 	uint16_t error_code;
10495 	/*
10496 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10497 	 * and fail the call with an error when appropriate
10498 	 */
10499 	uint16_t req_type;
10500 	/* This field returns the type of original request. */
10501 	uint16_t seq_id;
10502 	/* This field provides original sequence number of the command. */
10503 	uint16_t resp_len;
10504 	/*
10505 	 * This field is the length of the response in bytes. The last byte of
10506 	 * the response is a valid flag that will read as '1' when the command
10507 	 * has been completely written to memory.
10508 	 */
10509 	uint64_t ptp_msg_ts;
10510 	/* Timestamp value of PTP message captured. */
10511 	uint16_t ptp_msg_seqid;
10512 	/* Sequence ID of the PTP message captured. */
10513 	uint8_t unused_0;
10514 	uint8_t unused_1;
10515 	uint8_t unused_2;
10516 	uint8_t unused_3;
10517 	uint8_t unused_4;
10518 	uint8_t valid;
10519 	/*
10520 	 * This field is used in Output records to indicate that the output is
10521 	 * completely written to RAM. This field should be read as '1' to
10522 	 * indicate that the output has been completely written. When writing a
10523 	 * command completion or response to an internal processor, the order of
10524 	 * writes has to be such that this field is written last.
10525 	 */
10526 } __attribute__((packed));
10527 
10528 /* hwrm_port_phy_qcaps */
10529 /*
10530  * Description: This function is used to query the current capabilities of PHY
10531  * on this link.
10532  */
10533 /* Input (24 bytes) */
10534 
10535 struct hwrm_port_phy_qcaps_input {
10536 	uint16_t req_type;
10537 	/*
10538 	 * This value indicates what type of request this is. The format for the
10539 	 * rest of the command is determined by this field.
10540 	 */
10541 	uint16_t cmpl_ring;
10542 	/*
10543 	 * This value indicates the what completion ring the request will be
10544 	 * optionally completed on. If the value is -1, then no CR completion
10545 	 * will be generated. Any other value must be a valid CR ring_id value
10546 	 * for this function.
10547 	 */
10548 	uint16_t seq_id;
10549 	/* This value indicates the command sequence number. */
10550 	uint16_t target_id;
10551 	/*
10552 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10553 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10554 	 */
10555 	uint64_t resp_addr;
10556 	/*
10557 	 * This is the host address where the response will be written when the
10558 	 * request is complete. This area must be 16B aligned and must be
10559 	 * cleared to zero before the request is made.
10560 	 */
10561 	uint16_t port_id;
10562 	/* Port ID of port that is being queried. */
10563 	uint16_t unused_0[3];
10564 } __attribute__((packed));
10565 
10566 /* Output (24 bytes) */
10567 
10568 struct hwrm_port_phy_qcaps_output {
10569 	uint16_t error_code;
10570 	/*
10571 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10572 	 * and fail the call with an error when appropriate
10573 	 */
10574 	uint16_t req_type;
10575 	/* This field returns the type of original request. */
10576 	uint16_t seq_id;
10577 	/* This field provides original sequence number of the command. */
10578 	uint16_t resp_len;
10579 	/*
10580 	 * This field is the length of the response in bytes. The last byte of
10581 	 * the response is a valid flag that will read as '1' when the command
10582 	 * has been completely written to memory.
10583 	 */
10584 	uint8_t flags;
10585 	/* PHY capability flags */
10586 	/*
10587 	 * If set to 1, then this field indicates that the link is capable of
10588 	 * supporting EEE.
10589 	 */
10590 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED	UINT32_C(0x1)
10591 	/*
10592 	 * Reserved field. The HWRM shall set this field to 0. An HWRM client
10593 	 * shall ignore this field.
10594 	 */
10595 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK	UINT32_C(0xfe)
10596 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT	1
10597 	uint8_t port_cnt;
10598 	/* Number of front panel ports for this device. */
10599 	/* Not supported or unknown */
10600 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN	UINT32_C(0x0)
10601 	/* single port device */
10602 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1		UINT32_C(0x1)
10603 	/* 2-port device */
10604 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2		UINT32_C(0x2)
10605 	/* 3-port device */
10606 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3		UINT32_C(0x3)
10607 	/* 4-port device */
10608 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4		UINT32_C(0x4)
10609 	uint16_t supported_speeds_force_mode;
10610 	/*
10611 	 * This is a bit mask to indicate what speeds are supported as forced
10612 	 * speeds on this link. For each speed that can be forced on this link,
10613 	 * the corresponding mask bit shall be set to '1'.
10614 	 */
10615 	/* 100Mb link speed (Half-duplex) */
10616 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD UINT32_C(0x1)
10617 	/* 100Mb link speed (Full-duplex) */
10618 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB UINT32_C(0x2)
10619 	/* 1Gb link speed (Half-duplex) */
10620 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD UINT32_C(0x4)
10621 	/* 1Gb link speed (Full-duplex) */
10622 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB UINT32_C(0x8)
10623 	/* 2Gb link speed */
10624 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB UINT32_C(0x10)
10625 	/* 2.5Gb link speed */
10626 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB UINT32_C(0x20)
10627 	/* 10Gb link speed */
10628 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB UINT32_C(0x40)
10629 	/* 20Gb link speed */
10630 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB UINT32_C(0x80)
10631 	/* 25Gb link speed */
10632 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB UINT32_C(0x100)
10633 	/* 40Gb link speed */
10634 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB UINT32_C(0x200)
10635 	/* 50Gb link speed */
10636 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB UINT32_C(0x400)
10637 	/* 100Gb link speed */
10638 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB UINT32_C(0x800)
10639 	/* 10Mb link speed (Half-duplex) */
10640 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD UINT32_C(0x1000)
10641 	/* 10Mb link speed (Full-duplex) */
10642 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB UINT32_C(0x2000)
10643 	uint16_t supported_speeds_auto_mode;
10644 	/*
10645 	 * This is a bit mask to indicate what speeds are supported for
10646 	 * autonegotiation on this link. For each speed that can be
10647 	 * autonegotiated on this link, the corresponding mask bit shall be set
10648 	 * to '1'.
10649 	 */
10650 	/* 100Mb link speed (Half-duplex) */
10651 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD UINT32_C(0x1)
10652 	/* 100Mb link speed (Full-duplex) */
10653 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB UINT32_C(0x2)
10654 	/* 1Gb link speed (Half-duplex) */
10655 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD UINT32_C(0x4)
10656 	/* 1Gb link speed (Full-duplex) */
10657 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB UINT32_C(0x8)
10658 	/* 2Gb link speed */
10659 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB UINT32_C(0x10)
10660 	/* 2.5Gb link speed */
10661 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB UINT32_C(0x20)
10662 	/* 10Gb link speed */
10663 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB UINT32_C(0x40)
10664 	/* 20Gb link speed */
10665 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB UINT32_C(0x80)
10666 	/* 25Gb link speed */
10667 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB UINT32_C(0x100)
10668 	/* 40Gb link speed */
10669 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB UINT32_C(0x200)
10670 	/* 50Gb link speed */
10671 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB UINT32_C(0x400)
10672 	/* 100Gb link speed */
10673 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB UINT32_C(0x800)
10674 	/* 10Mb link speed (Half-duplex) */
10675 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD UINT32_C(0x1000)
10676 	/* 10Mb link speed (Full-duplex) */
10677 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB UINT32_C(0x2000)
10678 	uint16_t supported_speeds_eee_mode;
10679 	/*
10680 	 * This is a bit mask to indicate what speeds are supported for EEE on
10681 	 * this link. For each speed that can be autonegotiated when EEE is
10682 	 * enabled on this link, the corresponding mask bit shall be set to '1'.
10683 	 * This field is only valid when the eee_suppotred is set to '1'.
10684 	 */
10685 	/* Reserved */
10686 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 UINT32_C(0x1)
10687 	/* 100Mb link speed (Full-duplex) */
10688 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB UINT32_C(0x2)
10689 	/* Reserved */
10690 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 UINT32_C(0x4)
10691 	/* 1Gb link speed (Full-duplex) */
10692 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB UINT32_C(0x8)
10693 	/* Reserved */
10694 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 UINT32_C(0x10)
10695 	/* Reserved */
10696 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 UINT32_C(0x20)
10697 	/* 10Gb link speed */
10698 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB UINT32_C(0x40)
10699 	uint32_t tx_lpi_timer_low;
10700 	/*
10701 	 * Reserved field. The HWRM shall set this field to 0. An HWRM client
10702 	 * shall ignore this field.
10703 	 */
10704 	/*
10705 	 * The lowest value of TX LPI timer that can be set on this link when
10706 	 * EEE is enabled. This value is in microseconds. This field is valid
10707 	 * only when_eee_supported is set to '1'.
10708 	 */
10709 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK   UINT32_C(0xffffff)
10710 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT	0
10711 	/*
10712 	 * Reserved field. The HWRM shall set this field to 0. An HWRM client
10713 	 * shall ignore this field.
10714 	 */
10715 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK		UINT32_C(0xff000000)
10716 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT		24
10717 	uint32_t valid_tx_lpi_timer_high;
10718 	/*
10719 	 * This field is used in Output records to indicate that the output is
10720 	 * completely written to RAM. This field should be read as '1' to
10721 	 * indicate that the output has been completely written. When writing a
10722 	 * command completion or response to an internal processor, the order of
10723 	 * writes has to be such that this field is written last.
10724 	 */
10725 	/*
10726 	 * The highest value of TX LPI timer that can be set on this link when
10727 	 * EEE is enabled. This value is in microseconds. This field is valid
10728 	 * only when_eee_supported is set to '1'.
10729 	 */
10730 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK  UINT32_C(0xffffff)
10731 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT   0
10732 	/*
10733 	 * This field is used in Output records to indicate that the output is
10734 	 * completely written to RAM. This field should be read as '1' to
10735 	 * indicate that the output has been completely written. When writing a
10736 	 * command completion or response to an internal processor, the order of
10737 	 * writes has to be such that this field is written last.
10738 	 */
10739 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK		UINT32_C(0xff000000)
10740 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT		24
10741 } __attribute__((packed));
10742 
10743 /* hwrm_port_phy_i2c_read (40 bytes) */
10744 struct hwrm_port_phy_i2c_read_input {
10745 	/*
10746 	 * This value indicates what type of request this is. The format for the
10747 	 * rest of the command is determined by this field.
10748 	 */
10749 	uint16_t req_type;
10750 	/*
10751 	 * This value indicates the what completion ring the request will be
10752 	 * optionally completed on. If the value is -1, then no CR completion
10753 	 * will be generated. Any other value must be a valid CR ring_id value
10754 	 * for this function.
10755 	 */
10756 	uint16_t cmpl_ring;
10757 	/* This value indicates the command sequence number. */
10758 	uint16_t seq_id;
10759 	/*
10760 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10761 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10762 	 */
10763 	uint16_t target_id;
10764 	/*
10765 	 * This is the host address where the response will be written when the
10766 	 * request is complete. This area must be 16B aligned and must be
10767 	 * cleared to zero before the request is made.
10768 	 */
10769 	uint64_t resp_addr;
10770 	uint32_t flags;
10771 	uint32_t enables;
10772 #define HWRM_PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET     0x1UL
10773 
10774 	uint16_t port_id;
10775 	uint8_t i2c_slave_addr;
10776 	uint8_t unused_0;
10777 	uint16_t page_number;
10778 	uint16_t page_offset;
10779 	uint8_t data_length;
10780 	uint8_t unused_1[7];
10781 } __attribute__((packed));
10782 
10783 /* hwrm_port_phy_i2c_read_output (80 bytes)*/
10784 struct hwrm_port_phy_i2c_read_output {
10785 	/*
10786 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
10787 	 * and fail the call with an error when appropriate
10788 	 */
10789 	uint16_t error_code;
10790 	/* This field returns the type of original request. */
10791 	uint16_t req_type;
10792 	/* This field provides original sequence number of the command. */
10793 	uint16_t seq_id;
10794 	/*
10795 	 * This field is the length of the response in bytes. The last byte of
10796 	 * the response is a valid flag that will read as '1' when the command
10797 	 * has been completely written to memory.
10798 	 */
10799 	uint16_t resp_len;
10800 	uint32_t data[16];
10801 	uint8_t unused_0[7];
10802 	uint8_t valid;
10803 } __attribute__((packed));
10804 
10805 /* hwrm_port_led_cfg */
10806 /*
10807  * Description: This function is used to configure LEDs on a given port. Each
10808  * port has individual set of LEDs associated with it. These LEDs are used for
10809  * speed/link configuration as well as activity indicator configuration. Up to
10810  * three LEDs can be configured, one for activity and two for speeds.
10811  */
10812 /* Input (64 bytes) */
10813 
10814 struct hwrm_port_led_cfg_input {
10815 	uint16_t req_type;
10816 	/*
10817 	 * This value indicates what type of request this is. The format for the
10818 	 * rest of the command is determined by this field.
10819 	 */
10820 	uint16_t cmpl_ring;
10821 	/*
10822 	 * This value indicates the what completion ring the request will be
10823 	 * optionally completed on. If the value is -1, then no CR completion
10824 	 * will be generated. Any other value must be a valid CR ring_id value
10825 	 * for this function.
10826 	 */
10827 	uint16_t seq_id;
10828 	/* This value indicates the command sequence number. */
10829 	uint16_t target_id;
10830 	/*
10831 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10832 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10833 	 */
10834 	uint64_t resp_addr;
10835 	/*
10836 	 * This is the host address where the response will be written when the
10837 	 * request is complete. This area must be 16B aligned and must be
10838 	 * cleared to zero before the request is made.
10839 	 */
10840 	uint32_t enables;
10841 	/* This bit must be '1' for the led0_id field to be configured. */
10842 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID		UINT32_C(0x1)
10843 	/* This bit must be '1' for the led0_state field to be configured. */
10844 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE	UINT32_C(0x2)
10845 	/* This bit must be '1' for the led0_color field to be configured. */
10846 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR	UINT32_C(0x4)
10847 	/* This bit must be '1' for the led0_blink_on field to be configured. */
10848 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON	UINT32_C(0x8)
10849 	/* This bit must be '1' for the led0_blink_off field to be configured. */
10850 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF	UINT32_C(0x10)
10851 	/* This bit must be '1' for the led0_group_id field to be configured. */
10852 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID	UINT32_C(0x20)
10853 	/* This bit must be '1' for the led1_id field to be configured. */
10854 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID		UINT32_C(0x40)
10855 	/* This bit must be '1' for the led1_state field to be configured. */
10856 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE	UINT32_C(0x80)
10857 	/* This bit must be '1' for the led1_color field to be configured. */
10858 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR	UINT32_C(0x100)
10859 	/* This bit must be '1' for the led1_blink_on field to be configured. */
10860 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON	UINT32_C(0x200)
10861 	/* This bit must be '1' for the led1_blink_off field to be configured. */
10862 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF	UINT32_C(0x400)
10863 	/* This bit must be '1' for the led1_group_id field to be configured. */
10864 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID	UINT32_C(0x800)
10865 	/* This bit must be '1' for the led2_id field to be configured. */
10866 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID		UINT32_C(0x1000)
10867 	/* This bit must be '1' for the led2_state field to be configured. */
10868 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE	UINT32_C(0x2000)
10869 	/* This bit must be '1' for the led2_color field to be configured. */
10870 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR	UINT32_C(0x4000)
10871 	/* This bit must be '1' for the led2_blink_on field to be configured. */
10872 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON	UINT32_C(0x8000)
10873 	/* This bit must be '1' for the led2_blink_off field to be configured. */
10874 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF	UINT32_C(0x10000)
10875 	/* This bit must be '1' for the led2_group_id field to be configured. */
10876 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID	UINT32_C(0x20000)
10877 	/* This bit must be '1' for the led3_id field to be configured. */
10878 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID		UINT32_C(0x40000)
10879 	/* This bit must be '1' for the led3_state field to be configured. */
10880 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE	UINT32_C(0x80000)
10881 	/* This bit must be '1' for the led3_color field to be configured. */
10882 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR	UINT32_C(0x100000)
10883 	/* This bit must be '1' for the led3_blink_on field to be configured. */
10884 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON	UINT32_C(0x200000)
10885 	/* This bit must be '1' for the led3_blink_off field to be configured. */
10886 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF	UINT32_C(0x400000)
10887 	/* This bit must be '1' for the led3_group_id field to be configured. */
10888 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID	UINT32_C(0x800000)
10889 	uint16_t port_id;
10890 	/* Port ID of port whose LEDs are configured. */
10891 	uint8_t num_leds;
10892 	/*
10893 	 * The number of LEDs that are being configured. Up to 4 LEDs can be
10894 	 * configured with this command.
10895 	 */
10896 	uint8_t rsvd;
10897 	/* Reserved field. */
10898 	uint8_t led0_id;
10899 	/* An identifier for the LED #0. */
10900 	uint8_t led0_state;
10901 	/* The requested state of the LED #0. */
10902 	/* Default state of the LED */
10903 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT	UINT32_C(0x0)
10904 	/* Off */
10905 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF		UINT32_C(0x1)
10906 	/* On */
10907 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON		UINT32_C(0x2)
10908 	/* Blink */
10909 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK	UINT32_C(0x3)
10910 	/* Blink Alternately */
10911 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT	UINT32_C(0x4)
10912 	uint8_t led0_color;
10913 	/* The requested color of LED #0. */
10914 	/* Default */
10915 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
10916 	/* Amber */
10917 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
10918 	/* Green */
10919 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
10920 	/* Green or Amber */
10921 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER	UINT32_C(0x3)
10922 	uint8_t unused_0;
10923 	uint16_t led0_blink_on;
10924 	/*
10925 	 * If the LED #0 state is "blink" or "blinkalt", then this field
10926 	 * represents the requested time in milliseconds to keep LED on between
10927 	 * cycles.
10928 	 */
10929 	uint16_t led0_blink_off;
10930 	/*
10931 	 * If the LED #0 state is "blink" or "blinkalt", then this field
10932 	 * represents the requested time in milliseconds to keep LED off between
10933 	 * cycles.
10934 	 */
10935 	uint8_t led0_group_id;
10936 	/*
10937 	 * An identifier for the group of LEDs that LED #0 belongs to. If set to
10938 	 * 0, then the LED #0 shall not be grouped and shall be treated as an
10939 	 * individual resource. For all other non-zero values of this field, LED
10940 	 * #0 shall be grouped together with the LEDs with the same group ID
10941 	 * value.
10942 	 */
10943 	uint8_t rsvd0;
10944 	/* Reserved field. */
10945 	uint8_t led1_id;
10946 	/* An identifier for the LED #1. */
10947 	uint8_t led1_state;
10948 	/* The requested state of the LED #1. */
10949 	/* Default state of the LED */
10950 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT	UINT32_C(0x0)
10951 	/* Off */
10952 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF		UINT32_C(0x1)
10953 	/* On */
10954 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON		UINT32_C(0x2)
10955 	/* Blink */
10956 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK	UINT32_C(0x3)
10957 	/* Blink Alternately */
10958 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT	UINT32_C(0x4)
10959 	uint8_t led1_color;
10960 	/* The requested color of LED #1. */
10961 	/* Default */
10962 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
10963 	/* Amber */
10964 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
10965 	/* Green */
10966 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
10967 	/* Green or Amber */
10968 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER	UINT32_C(0x3)
10969 	uint8_t unused_1;
10970 	uint16_t led1_blink_on;
10971 	/*
10972 	 * If the LED #1 state is "blink" or "blinkalt", then this field
10973 	 * represents the requested time in milliseconds to keep LED on between
10974 	 * cycles.
10975 	 */
10976 	uint16_t led1_blink_off;
10977 	/*
10978 	 * If the LED #1 state is "blink" or "blinkalt", then this field
10979 	 * represents the requested time in milliseconds to keep LED off between
10980 	 * cycles.
10981 	 */
10982 	uint8_t led1_group_id;
10983 	/*
10984 	 * An identifier for the group of LEDs that LED #1 belongs to. If set to
10985 	 * 0, then the LED #1 shall not be grouped and shall be treated as an
10986 	 * individual resource. For all other non-zero values of this field, LED
10987 	 * #1 shall be grouped together with the LEDs with the same group ID
10988 	 * value.
10989 	 */
10990 	uint8_t rsvd1;
10991 	/* Reserved field. */
10992 	uint8_t led2_id;
10993 	/* An identifier for the LED #2. */
10994 	uint8_t led2_state;
10995 	/* The requested state of the LED #2. */
10996 	/* Default state of the LED */
10997 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT	UINT32_C(0x0)
10998 	/* Off */
10999 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF		UINT32_C(0x1)
11000 	/* On */
11001 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON		UINT32_C(0x2)
11002 	/* Blink */
11003 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK	UINT32_C(0x3)
11004 	/* Blink Alternately */
11005 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT	UINT32_C(0x4)
11006 	uint8_t led2_color;
11007 	/* The requested color of LED #2. */
11008 	/* Default */
11009 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
11010 	/* Amber */
11011 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
11012 	/* Green */
11013 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
11014 	/* Green or Amber */
11015 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER	UINT32_C(0x3)
11016 	uint8_t unused_2;
11017 	uint16_t led2_blink_on;
11018 	/*
11019 	 * If the LED #2 state is "blink" or "blinkalt", then this field
11020 	 * represents the requested time in milliseconds to keep LED on between
11021 	 * cycles.
11022 	 */
11023 	uint16_t led2_blink_off;
11024 	/*
11025 	 * If the LED #2 state is "blink" or "blinkalt", then this field
11026 	 * represents the requested time in milliseconds to keep LED off between
11027 	 * cycles.
11028 	 */
11029 	uint8_t led2_group_id;
11030 	/*
11031 	 * An identifier for the group of LEDs that LED #2 belongs to. If set to
11032 	 * 0, then the LED #2 shall not be grouped and shall be treated as an
11033 	 * individual resource. For all other non-zero values of this field, LED
11034 	 * #2 shall be grouped together with the LEDs with the same group ID
11035 	 * value.
11036 	 */
11037 	uint8_t rsvd2;
11038 	/* Reserved field. */
11039 	uint8_t led3_id;
11040 	/* An identifier for the LED #3. */
11041 	uint8_t led3_state;
11042 	/* The requested state of the LED #3. */
11043 	/* Default state of the LED */
11044 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT	UINT32_C(0x0)
11045 	/* Off */
11046 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF		UINT32_C(0x1)
11047 	/* On */
11048 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON		UINT32_C(0x2)
11049 	/* Blink */
11050 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK	UINT32_C(0x3)
11051 	/* Blink Alternately */
11052 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT	UINT32_C(0x4)
11053 	uint8_t led3_color;
11054 	/* The requested color of LED #3. */
11055 	/* Default */
11056 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
11057 	/* Amber */
11058 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
11059 	/* Green */
11060 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
11061 	/* Green or Amber */
11062 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER	UINT32_C(0x3)
11063 	uint8_t unused_3;
11064 	uint16_t led3_blink_on;
11065 	/*
11066 	 * If the LED #3 state is "blink" or "blinkalt", then this field
11067 	 * represents the requested time in milliseconds to keep LED on between
11068 	 * cycles.
11069 	 */
11070 	uint16_t led3_blink_off;
11071 	/*
11072 	 * If the LED #3 state is "blink" or "blinkalt", then this field
11073 	 * represents the requested time in milliseconds to keep LED off between
11074 	 * cycles.
11075 	 */
11076 	uint8_t led3_group_id;
11077 	/*
11078 	 * An identifier for the group of LEDs that LED #3 belongs to. If set to
11079 	 * 0, then the LED #3 shall not be grouped and shall be treated as an
11080 	 * individual resource. For all other non-zero values of this field, LED
11081 	 * #3 shall be grouped together with the LEDs with the same group ID
11082 	 * value.
11083 	 */
11084 	uint8_t rsvd3;
11085 	/* Reserved field. */
11086 } __attribute__((packed));
11087 
11088 /* Output (16 bytes) */
11089 
11090 struct hwrm_port_led_cfg_output {
11091 	uint16_t error_code;
11092 	/*
11093 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
11094 	 * and fail the call with an error when appropriate
11095 	 */
11096 	uint16_t req_type;
11097 	/* This field returns the type of original request. */
11098 	uint16_t seq_id;
11099 	/* This field provides original sequence number of the command. */
11100 	uint16_t resp_len;
11101 	/*
11102 	 * This field is the length of the response in bytes. The last byte of
11103 	 * the response is a valid flag that will read as '1' when the command
11104 	 * has been completely written to memory.
11105 	 */
11106 	uint32_t unused_0;
11107 	uint8_t unused_1;
11108 	uint8_t unused_2;
11109 	uint8_t unused_3;
11110 	uint8_t valid;
11111 	/*
11112 	 * This field is used in Output records to indicate that the output is
11113 	 * completely written to RAM. This field should be read as '1' to
11114 	 * indicate that the output has been completely written. When writing a
11115 	 * command completion or response to an internal processor, the order of
11116 	 * writes has to be such that this field is written last.
11117 	 */
11118 } __attribute__((packed));
11119 
11120 /* hwrm_port_led_qcfg */
11121 /*
11122  * Description: This function is used to query configuration of LEDs on a given
11123  * port. Each port has individual set of LEDs associated with it. These LEDs are
11124  * used for speed/link configuration as well as activity indicator
11125  * configuration. Up to three LEDs can be configured, one for activity and two
11126  * for speeds.
11127  */
11128 /* Input (24 bytes) */
11129 
11130 struct hwrm_port_led_qcfg_input {
11131 	uint16_t req_type;
11132 	/*
11133 	 * This value indicates what type of request this is. The format for the
11134 	 * rest of the command is determined by this field.
11135 	 */
11136 	uint16_t cmpl_ring;
11137 	/*
11138 	 * This value indicates the what completion ring the request will be
11139 	 * optionally completed on. If the value is -1, then no CR completion
11140 	 * will be generated. Any other value must be a valid CR ring_id value
11141 	 * for this function.
11142 	 */
11143 	uint16_t seq_id;
11144 	/* This value indicates the command sequence number. */
11145 	uint16_t target_id;
11146 	/*
11147 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
11148 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
11149 	 */
11150 	uint64_t resp_addr;
11151 	/*
11152 	 * This is the host address where the response will be written when the
11153 	 * request is complete. This area must be 16B aligned and must be
11154 	 * cleared to zero before the request is made.
11155 	 */
11156 	uint16_t port_id;
11157 	/* Port ID of port whose LED configuration is being queried. */
11158 	uint16_t unused_0[3];
11159 } __attribute__((packed));
11160 
11161 /* Output (56 bytes) */
11162 
11163 struct hwrm_port_led_qcfg_output {
11164 	uint16_t error_code;
11165 	/*
11166 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
11167 	 * and fail the call with an error when appropriate
11168 	 */
11169 	uint16_t req_type;
11170 	/* This field returns the type of original request. */
11171 	uint16_t seq_id;
11172 	/* This field provides original sequence number of the command. */
11173 	uint16_t resp_len;
11174 	/*
11175 	 * This field is the length of the response in bytes. The last byte of
11176 	 * the response is a valid flag that will read as '1' when the command
11177 	 * has been completely written to memory.
11178 	 */
11179 	uint8_t num_leds;
11180 	/*
11181 	 * The number of LEDs that are configured on this port. Up to 4 LEDs can
11182 	 * be returned in the response.
11183 	 */
11184 	uint8_t led0_id;
11185 	/* An identifier for the LED #0. */
11186 	uint8_t led0_type;
11187 	/* The type of LED #0. */
11188 	/* Speed LED */
11189 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
11190 	/* Activity LED */
11191 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY	UINT32_C(0x1)
11192 	/* Invalid */
11193 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID	UINT32_C(0xff)
11194 	uint8_t led0_state;
11195 	/* The current state of the LED #0. */
11196 	/* Default state of the LED */
11197 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT	UINT32_C(0x0)
11198 	/* Off */
11199 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF	UINT32_C(0x1)
11200 	/* On */
11201 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON	UINT32_C(0x2)
11202 	/* Blink */
11203 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK	UINT32_C(0x3)
11204 	/* Blink Alternately */
11205 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT	UINT32_C(0x4)
11206 	uint8_t led0_color;
11207 	/* The color of LED #0. */
11208 	/* Default */
11209 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
11210 	/* Amber */
11211 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
11212 	/* Green */
11213 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
11214 	/* Green or Amber */
11215 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER   UINT32_C(0x3)
11216 	uint8_t unused_0;
11217 	uint16_t led0_blink_on;
11218 	/*
11219 	 * If the LED #0 state is "blink" or "blinkalt", then this field
11220 	 * represents the requested time in milliseconds to keep LED on between
11221 	 * cycles.
11222 	 */
11223 	uint16_t led0_blink_off;
11224 	/*
11225 	 * If the LED #0 state is "blink" or "blinkalt", then this field
11226 	 * represents the requested time in milliseconds to keep LED off between
11227 	 * cycles.
11228 	 */
11229 	uint8_t led0_group_id;
11230 	/*
11231 	 * An identifier for the group of LEDs that LED #0 belongs to. If set to
11232 	 * 0, then the LED #0 is not grouped. For all other non-zero values of
11233 	 * this field, LED #0 is grouped together with the LEDs with the same
11234 	 * group ID value.
11235 	 */
11236 	uint8_t led1_id;
11237 	/* An identifier for the LED #1. */
11238 	uint8_t led1_type;
11239 	/* The type of LED #1. */
11240 	/* Speed LED */
11241 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
11242 	/* Activity LED */
11243 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY	UINT32_C(0x1)
11244 	/* Invalid */
11245 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID	UINT32_C(0xff)
11246 	uint8_t led1_state;
11247 	/* The current state of the LED #1. */
11248 	/* Default state of the LED */
11249 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT	UINT32_C(0x0)
11250 	/* Off */
11251 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF	UINT32_C(0x1)
11252 	/* On */
11253 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON	UINT32_C(0x2)
11254 	/* Blink */
11255 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK	UINT32_C(0x3)
11256 	/* Blink Alternately */
11257 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT	UINT32_C(0x4)
11258 	uint8_t led1_color;
11259 	/* The color of LED #1. */
11260 	/* Default */
11261 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
11262 	/* Amber */
11263 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
11264 	/* Green */
11265 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
11266 	/* Green or Amber */
11267 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER   UINT32_C(0x3)
11268 	uint8_t unused_1;
11269 	uint16_t led1_blink_on;
11270 	/*
11271 	 * If the LED #1 state is "blink" or "blinkalt", then this field
11272 	 * represents the requested time in milliseconds to keep LED on between
11273 	 * cycles.
11274 	 */
11275 	uint16_t led1_blink_off;
11276 	/*
11277 	 * If the LED #1 state is "blink" or "blinkalt", then this field
11278 	 * represents the requested time in milliseconds to keep LED off between
11279 	 * cycles.
11280 	 */
11281 	uint8_t led1_group_id;
11282 	/*
11283 	 * An identifier for the group of LEDs that LED #1 belongs to. If set to
11284 	 * 0, then the LED #1 is not grouped. For all other non-zero values of
11285 	 * this field, LED #1 is grouped together with the LEDs with the same
11286 	 * group ID value.
11287 	 */
11288 	uint8_t led2_id;
11289 	/* An identifier for the LED #2. */
11290 	uint8_t led2_type;
11291 	/* The type of LED #2. */
11292 	/* Speed LED */
11293 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
11294 	/* Activity LED */
11295 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY	UINT32_C(0x1)
11296 	/* Invalid */
11297 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID	UINT32_C(0xff)
11298 	uint8_t led2_state;
11299 	/* The current state of the LED #2. */
11300 	/* Default state of the LED */
11301 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT	UINT32_C(0x0)
11302 	/* Off */
11303 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF	UINT32_C(0x1)
11304 	/* On */
11305 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON	UINT32_C(0x2)
11306 	/* Blink */
11307 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK	UINT32_C(0x3)
11308 	/* Blink Alternately */
11309 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT	UINT32_C(0x4)
11310 	uint8_t led2_color;
11311 	/* The color of LED #2. */
11312 	/* Default */
11313 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
11314 	/* Amber */
11315 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
11316 	/* Green */
11317 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
11318 	/* Green or Amber */
11319 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER   UINT32_C(0x3)
11320 	uint8_t unused_2;
11321 	uint16_t led2_blink_on;
11322 	/*
11323 	 * If the LED #2 state is "blink" or "blinkalt", then this field
11324 	 * represents the requested time in milliseconds to keep LED on between
11325 	 * cycles.
11326 	 */
11327 	uint16_t led2_blink_off;
11328 	/*
11329 	 * If the LED #2 state is "blink" or "blinkalt", then this field
11330 	 * represents the requested time in milliseconds to keep LED off between
11331 	 * cycles.
11332 	 */
11333 	uint8_t led2_group_id;
11334 	/*
11335 	 * An identifier for the group of LEDs that LED #2 belongs to. If set to
11336 	 * 0, then the LED #2 is not grouped. For all other non-zero values of
11337 	 * this field, LED #2 is grouped together with the LEDs with the same
11338 	 * group ID value.
11339 	 */
11340 	uint8_t led3_id;
11341 	/* An identifier for the LED #3. */
11342 	uint8_t led3_type;
11343 	/* The type of LED #3. */
11344 	/* Speed LED */
11345 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
11346 	/* Activity LED */
11347 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY	UINT32_C(0x1)
11348 	/* Invalid */
11349 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID	UINT32_C(0xff)
11350 	uint8_t led3_state;
11351 	/* The current state of the LED #3. */
11352 	/* Default state of the LED */
11353 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT	UINT32_C(0x0)
11354 	/* Off */
11355 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF	UINT32_C(0x1)
11356 	/* On */
11357 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON	UINT32_C(0x2)
11358 	/* Blink */
11359 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK	UINT32_C(0x3)
11360 	/* Blink Alternately */
11361 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT	UINT32_C(0x4)
11362 	uint8_t led3_color;
11363 	/* The color of LED #3. */
11364 	/* Default */
11365 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
11366 	/* Amber */
11367 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
11368 	/* Green */
11369 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
11370 	/* Green or Amber */
11371 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER   UINT32_C(0x3)
11372 	uint8_t unused_3;
11373 	uint16_t led3_blink_on;
11374 	/*
11375 	 * If the LED #3 state is "blink" or "blinkalt", then this field
11376 	 * represents the requested time in milliseconds to keep LED on between
11377 	 * cycles.
11378 	 */
11379 	uint16_t led3_blink_off;
11380 	/*
11381 	 * If the LED #3 state is "blink" or "blinkalt", then this field
11382 	 * represents the requested time in milliseconds to keep LED off between
11383 	 * cycles.
11384 	 */
11385 	uint8_t led3_group_id;
11386 	/*
11387 	 * An identifier for the group of LEDs that LED #3 belongs to. If set to
11388 	 * 0, then the LED #3 is not grouped. For all other non-zero values of
11389 	 * this field, LED #3 is grouped together with the LEDs with the same
11390 	 * group ID value.
11391 	 */
11392 	uint8_t unused_4;
11393 	uint16_t unused_5;
11394 	uint8_t unused_6;
11395 	uint8_t unused_7;
11396 	uint8_t unused_8;
11397 	uint8_t valid;
11398 	/*
11399 	 * This field is used in Output records to indicate that the output is
11400 	 * completely written to RAM. This field should be read as '1' to
11401 	 * indicate that the output has been completely written. When writing a
11402 	 * command completion or response to an internal processor, the order of
11403 	 * writes has to be such that this field is written last.
11404 	 */
11405 } __attribute__((packed));
11406 
11407 /* hwrm_port_led_qcaps */
11408 /*
11409  * Description: This function is used to query capabilities of LEDs on a given
11410  * port. Each port has individual set of LEDs associated with it. These LEDs are
11411  * used for speed/link configuration as well as activity indicator
11412  * configuration.
11413  */
11414 /* Input (24 bytes) */
11415 
11416 struct hwrm_port_led_qcaps_input {
11417 	uint16_t req_type;
11418 	/*
11419 	 * This value indicates what type of request this is. The format for the
11420 	 * rest of the command is determined by this field.
11421 	 */
11422 	uint16_t cmpl_ring;
11423 	/*
11424 	 * This value indicates the what completion ring the request will be
11425 	 * optionally completed on. If the value is -1, then no CR completion
11426 	 * will be generated. Any other value must be a valid CR ring_id value
11427 	 * for this function.
11428 	 */
11429 	uint16_t seq_id;
11430 	/* This value indicates the command sequence number. */
11431 	uint16_t target_id;
11432 	/*
11433 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
11434 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
11435 	 */
11436 	uint64_t resp_addr;
11437 	/*
11438 	 * This is the host address where the response will be written when the
11439 	 * request is complete. This area must be 16B aligned and must be
11440 	 * cleared to zero before the request is made.
11441 	 */
11442 	uint16_t port_id;
11443 	/* Port ID of port whose LED configuration is being queried. */
11444 	uint16_t unused_0[3];
11445 } __attribute__((packed));
11446 
11447 /* Output (48 bytes) */
11448 
11449 struct hwrm_port_led_qcaps_output {
11450 	uint16_t error_code;
11451 	/*
11452 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
11453 	 * and fail the call with an error when appropriate
11454 	 */
11455 	uint16_t req_type;
11456 	/* This field returns the type of original request. */
11457 	uint16_t seq_id;
11458 	/* This field provides original sequence number of the command. */
11459 	uint16_t resp_len;
11460 	/*
11461 	 * This field is the length of the response in bytes. The last byte of
11462 	 * the response is a valid flag that will read as '1' when the command
11463 	 * has been completely written to memory.
11464 	 */
11465 	uint8_t num_leds;
11466 	/*
11467 	 * The number of LEDs that are configured on this port. Up to 4 LEDs can
11468 	 * be returned in the response.
11469 	 */
11470 	uint8_t unused_0[3];
11471 	/* Reserved for future use. */
11472 	uint8_t led0_id;
11473 	/* An identifier for the LED #0. */
11474 	uint8_t led0_type;
11475 	/* The type of LED #0. */
11476 	/* Speed LED */
11477 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
11478 	/* Activity LED */
11479 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY	UINT32_C(0x1)
11480 	/* Invalid */
11481 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID	UINT32_C(0xff)
11482 	uint8_t led0_group_id;
11483 	/*
11484 	 * An identifier for the group of LEDs that LED #0 belongs to. If set to
11485 	 * 0, then the LED #0 cannot be grouped. For all other non-zero values
11486 	 * of this field, LED #0 is grouped together with the LEDs with the same
11487 	 * group ID value.
11488 	 */
11489 	uint8_t unused_1;
11490 	uint16_t led0_state_caps;
11491 	/* The states supported by LED #0. */
11492 	/* If set to 1, this LED is enabled. If set to 0, this LED is disabled. */
11493 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED UINT32_C(0x1)
11494 	/*
11495 	 * If set to 1, off state is supported on this LED. If set to 0, off
11496 	 * state is not supported on this LED.
11497 	 */
11498 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
11499 	/*
11500 	 * If set to 1, on state is supported on this LED. If set to 0, on state
11501 	 * is not supported on this LED.
11502 	 */
11503 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
11504 	/*
11505 	 * If set to 1, blink state is supported on this LED. If set to 0, blink
11506 	 * state is not supported on this LED.
11507 	 */
11508 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
11509 	/*
11510 	 * If set to 1, blink_alt state is supported on this LED. If set to 0,
11511 	 * blink_alt state is not supported on this LED.
11512 	 */
11513 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
11514 	uint16_t led0_color_caps;
11515 	/* The colors supported by LED #0. */
11516 	/* reserved */
11517 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD	UINT32_C(0x1)
11518 	/*
11519 	 * If set to 1, Amber color is supported on this LED. If set to 0, Amber
11520 	 * color is not supported on this LED.
11521 	 */
11522 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
11523 	/*
11524 	 * If set to 1, Green color is supported on this LED. If set to 0, Green
11525 	 * color is not supported on this LED.
11526 	 */
11527 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
11528 	uint8_t led1_id;
11529 	/* An identifier for the LED #1. */
11530 	uint8_t led1_type;
11531 	/* The type of LED #1. */
11532 	/* Speed LED */
11533 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
11534 	/* Activity LED */
11535 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY	UINT32_C(0x1)
11536 	/* Invalid */
11537 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID	UINT32_C(0xff)
11538 	uint8_t led1_group_id;
11539 	/*
11540 	 * An identifier for the group of LEDs that LED #1 belongs to. If set to
11541 	 * 0, then the LED #0 cannot be grouped. For all other non-zero values
11542 	 * of this field, LED #0 is grouped together with the LEDs with the same
11543 	 * group ID value.
11544 	 */
11545 	uint8_t unused_2;
11546 	uint16_t led1_state_caps;
11547 	/* The states supported by LED #1. */
11548 	/* If set to 1, this LED is enabled. If set to 0, this LED is disabled. */
11549 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED UINT32_C(0x1)
11550 	/*
11551 	 * If set to 1, off state is supported on this LED. If set to 0, off
11552 	 * state is not supported on this LED.
11553 	 */
11554 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
11555 	/*
11556 	 * If set to 1, on state is supported on this LED. If set to 0, on state
11557 	 * is not supported on this LED.
11558 	 */
11559 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
11560 	/*
11561 	 * If set to 1, blink state is supported on this LED. If set to 0, blink
11562 	 * state is not supported on this LED.
11563 	 */
11564 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
11565 	/*
11566 	 * If set to 1, blink_alt state is supported on this LED. If set to 0,
11567 	 * blink_alt state is not supported on this LED.
11568 	 */
11569 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
11570 	uint16_t led1_color_caps;
11571 	/* The colors supported by LED #1. */
11572 	/* reserved */
11573 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD	UINT32_C(0x1)
11574 	/*
11575 	 * If set to 1, Amber color is supported on this LED. If set to 0, Amber
11576 	 * color is not supported on this LED.
11577 	 */
11578 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
11579 	/*
11580 	 * If set to 1, Green color is supported on this LED. If set to 0, Green
11581 	 * color is not supported on this LED.
11582 	 */
11583 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
11584 	uint8_t led2_id;
11585 	/* An identifier for the LED #2. */
11586 	uint8_t led2_type;
11587 	/* The type of LED #2. */
11588 	/* Speed LED */
11589 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
11590 	/* Activity LED */
11591 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY	UINT32_C(0x1)
11592 	/* Invalid */
11593 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID	UINT32_C(0xff)
11594 	uint8_t led2_group_id;
11595 	/*
11596 	 * An identifier for the group of LEDs that LED #0 belongs to. If set to
11597 	 * 0, then the LED #0 cannot be grouped. For all other non-zero values
11598 	 * of this field, LED #0 is grouped together with the LEDs with the same
11599 	 * group ID value.
11600 	 */
11601 	uint8_t unused_3;
11602 	uint16_t led2_state_caps;
11603 	/* The states supported by LED #2. */
11604 	/* If set to 1, this LED is enabled. If set to 0, this LED is disabled. */
11605 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED UINT32_C(0x1)
11606 	/*
11607 	 * If set to 1, off state is supported on this LED. If set to 0, off
11608 	 * state is not supported on this LED.
11609 	 */
11610 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
11611 	/*
11612 	 * If set to 1, on state is supported on this LED. If set to 0, on state
11613 	 * is not supported on this LED.
11614 	 */
11615 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
11616 	/*
11617 	 * If set to 1, blink state is supported on this LED. If set to 0, blink
11618 	 * state is not supported on this LED.
11619 	 */
11620 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
11621 	/*
11622 	 * If set to 1, blink_alt state is supported on this LED. If set to 0,
11623 	 * blink_alt state is not supported on this LED.
11624 	 */
11625 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
11626 	uint16_t led2_color_caps;
11627 	/* The colors supported by LED #2. */
11628 	/* reserved */
11629 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD	UINT32_C(0x1)
11630 	/*
11631 	 * If set to 1, Amber color is supported on this LED. If set to 0, Amber
11632 	 * color is not supported on this LED.
11633 	 */
11634 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
11635 	/*
11636 	 * If set to 1, Green color is supported on this LED. If set to 0, Green
11637 	 * color is not supported on this LED.
11638 	 */
11639 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
11640 	uint8_t led3_id;
11641 	/* An identifier for the LED #3. */
11642 	uint8_t led3_type;
11643 	/* The type of LED #3. */
11644 	/* Speed LED */
11645 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
11646 	/* Activity LED */
11647 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY	UINT32_C(0x1)
11648 	/* Invalid */
11649 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID	UINT32_C(0xff)
11650 	uint8_t led3_group_id;
11651 	/*
11652 	 * An identifier for the group of LEDs that LED #3 belongs to. If set to
11653 	 * 0, then the LED #0 cannot be grouped. For all other non-zero values
11654 	 * of this field, LED #0 is grouped together with the LEDs with the same
11655 	 * group ID value.
11656 	 */
11657 	uint8_t unused_4;
11658 	uint16_t led3_state_caps;
11659 	/* The states supported by LED #3. */
11660 	/* If set to 1, this LED is enabled. If set to 0, this LED is disabled. */
11661 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED UINT32_C(0x1)
11662 	/*
11663 	 * If set to 1, off state is supported on this LED. If set to 0, off
11664 	 * state is not supported on this LED.
11665 	 */
11666 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED UINT32_C(0x2)
11667 	/*
11668 	 * If set to 1, on state is supported on this LED. If set to 0, on state
11669 	 * is not supported on this LED.
11670 	 */
11671 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED UINT32_C(0x4)
11672 	/*
11673 	 * If set to 1, blink state is supported on this LED. If set to 0, blink
11674 	 * state is not supported on this LED.
11675 	 */
11676 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED UINT32_C(0x8)
11677 	/*
11678 	 * If set to 1, blink_alt state is supported on this LED. If set to 0,
11679 	 * blink_alt state is not supported on this LED.
11680 	 */
11681 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED UINT32_C(0x10)
11682 	uint16_t led3_color_caps;
11683 	/* The colors supported by LED #3. */
11684 	/* reserved */
11685 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD	UINT32_C(0x1)
11686 	/*
11687 	 * If set to 1, Amber color is supported on this LED. If set to 0, Amber
11688 	 * color is not supported on this LED.
11689 	 */
11690 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED UINT32_C(0x2)
11691 	/*
11692 	 * If set to 1, Green color is supported on this LED. If set to 0, Green
11693 	 * color is not supported on this LED.
11694 	 */
11695 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED UINT32_C(0x4)
11696 	uint8_t unused_5;
11697 	uint8_t unused_6;
11698 	uint8_t unused_7;
11699 	uint8_t valid;
11700 	/*
11701 	 * This field is used in Output records to indicate that the output is
11702 	 * completely written to RAM. This field should be read as '1' to
11703 	 * indicate that the output has been completely written. When writing a
11704 	 * command completion or response to an internal processor, the order of
11705 	 * writes has to be such that this field is written last.
11706 	 */
11707 } __attribute__((packed));
11708 
11709 /* hwrm_queue_qportcfg */
11710 /*
11711  * Description: This function is called by a driver to query queue configuration
11712  * of a port. # The HWRM shall at least advertise one queue with lossy service
11713  * profile. # The driver shall use this command to query queue ids before
11714  * configuring or using any queues. # If a service profile is not set for a
11715  * queue, then the driver shall not use that queue without configuring a service
11716  * profile for it. # If the driver is not allowed to configure service profiles,
11717  * then the driver shall only use queues for which service profiles are pre-
11718  * configured.
11719  */
11720 /* Input (24 bytes) */
11721 
11722 struct hwrm_queue_qportcfg_input {
11723 	uint16_t req_type;
11724 	/*
11725 	 * This value indicates what type of request this is. The format for the
11726 	 * rest of the command is determined by this field.
11727 	 */
11728 	uint16_t cmpl_ring;
11729 	/*
11730 	 * This value indicates the what completion ring the request will be
11731 	 * optionally completed on. If the value is -1, then no CR completion
11732 	 * will be generated. Any other value must be a valid CR ring_id value
11733 	 * for this function.
11734 	 */
11735 	uint16_t seq_id;
11736 	/* This value indicates the command sequence number. */
11737 	uint16_t target_id;
11738 	/*
11739 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
11740 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
11741 	 */
11742 	uint64_t resp_addr;
11743 	/*
11744 	 * This is the host address where the response will be written when the
11745 	 * request is complete. This area must be 16B aligned and must be
11746 	 * cleared to zero before the request is made.
11747 	 */
11748 	uint32_t flags;
11749 	/*
11750 	 * Enumeration denoting the RX, TX type of the resource. This
11751 	 * enumeration is used for resources that are similar for both TX and RX
11752 	 * paths of the chip.
11753 	 */
11754 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH		UINT32_C(0x1)
11755 	/* tx path */
11756 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
11757 	/* rx path */
11758 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
11759 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST	HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
11760 	uint16_t port_id;
11761 	/*
11762 	 * Port ID of port for which the queue configuration is being queried.
11763 	 * This field is only required when sent by IPC.
11764 	 */
11765 	uint16_t unused_0;
11766 } __attribute__((packed));
11767 
11768 /* Output (32 bytes) */
11769 
11770 struct hwrm_queue_qportcfg_output {
11771 	uint16_t error_code;
11772 	/*
11773 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
11774 	 * and fail the call with an error when appropriate
11775 	 */
11776 	uint16_t req_type;
11777 	/* This field returns the type of original request. */
11778 	uint16_t seq_id;
11779 	/* This field provides original sequence number of the command. */
11780 	uint16_t resp_len;
11781 	/*
11782 	 * This field is the length of the response in bytes. The last byte of
11783 	 * the response is a valid flag that will read as '1' when the command
11784 	 * has been completely written to memory.
11785 	 */
11786 	uint8_t max_configurable_queues;
11787 	/*
11788 	 * The maximum number of queues that can be configured on this port.
11789 	 * Valid values range from 1 through 8.
11790 	 */
11791 	uint8_t max_configurable_lossless_queues;
11792 	/*
11793 	 * The maximum number of lossless queues that can be configured on this
11794 	 * port. Valid values range from 0 through 8.
11795 	 */
11796 	uint8_t queue_cfg_allowed;
11797 	/*
11798 	 * Bitmask indicating which queues can be configured by the
11799 	 * hwrm_queue_cfg command. Each bit represents a specific queue where
11800 	 * bit 0 represents queue 0 and bit 7 represents queue 7. # A value of 0
11801 	 * indicates that the queue is not configurable by the hwrm_queue_cfg
11802 	 * command. # A value of 1 indicates that the queue is configurable. # A
11803 	 * hwrm_queue_cfg command shall return error when trying to configure a
11804 	 * queue not configurable.
11805 	 */
11806 	uint8_t queue_cfg_info;
11807 	/* Information about queue configuration. */
11808 	/*
11809 	 * If this flag is set to '1', then the queues are configured
11810 	 * asymmetrically on TX and RX sides. If this flag is set to '0', then
11811 	 * the queues are configured symmetrically on TX and RX sides. For
11812 	 * symmetric configuration, the queue configuration including queue ids
11813 	 * and service profiles on the TX side is the same as the corresponding
11814 	 * queue configuration on the RX side.
11815 	 */
11816 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
11817 	uint8_t queue_pfcenable_cfg_allowed;
11818 	/*
11819 	 * Bitmask indicating which queues can be configured by the
11820 	 * hwrm_queue_pfcenable_cfg command. Each bit represents a specific
11821 	 * priority where bit 0 represents priority 0 and bit 7 represents
11822 	 * priority 7. # A value of 0 indicates that the priority is not
11823 	 * configurable by the hwrm_queue_pfcenable_cfg command. # A value of 1
11824 	 * indicates that the priority is configurable. # A
11825 	 * hwrm_queue_pfcenable_cfg command shall return error when trying to
11826 	 * configure a priority that is not configurable.
11827 	 */
11828 	uint8_t queue_pri2cos_cfg_allowed;
11829 	/*
11830 	 * Bitmask indicating which queues can be configured by the
11831 	 * hwrm_queue_pri2cos_cfg command. Each bit represents a specific queue
11832 	 * where bit 0 represents queue 0 and bit 7 represents queue 7. # A
11833 	 * value of 0 indicates that the queue is not configurable by the
11834 	 * hwrm_queue_pri2cos_cfg command. # A value of 1 indicates that the
11835 	 * queue is configurable. # A hwrm_queue_pri2cos_cfg command shall
11836 	 * return error when trying to configure a queue that is not
11837 	 * configurable.
11838 	 */
11839 	uint8_t queue_cos2bw_cfg_allowed;
11840 	/*
11841 	 * Bitmask indicating which queues can be configured by the
11842 	 * hwrm_queue_pri2cos_cfg command. Each bit represents a specific queue
11843 	 * where bit 0 represents queue 0 and bit 7 represents queue 7. # A
11844 	 * value of 0 indicates that the queue is not configurable by the
11845 	 * hwrm_queue_pri2cos_cfg command. # A value of 1 indicates that the
11846 	 * queue is configurable. # A hwrm_queue_pri2cos_cfg command shall
11847 	 * return error when trying to configure a queue not configurable.
11848 	 */
11849 	uint8_t queue_id0;
11850 	/*
11851 	 * ID of CoS Queue 0. FF - Invalid id # This ID can be used on any
11852 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11853 	 * always be queried by this command before any use by the driver or
11854 	 * software. # Any driver or software should not make any assumptions
11855 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11856 	 * available. # Available queues may not be in sequential order.
11857 	 */
11858 	uint8_t queue_id0_service_profile;
11859 	/* This value is applicable to CoS queues only. */
11860 	/* Lossy (best-effort) */
11861 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11862 	/* Lossless */
11863 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11864 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11865 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11866 	uint8_t queue_id1;
11867 	/*
11868 	 * ID of CoS Queue 1. FF - Invalid id # This ID can be used on any
11869 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11870 	 * always be queried by this command before any use by the driver or
11871 	 * software. # Any driver or software should not make any assumptions
11872 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11873 	 * available. # Available queues may not be in sequential order.
11874 	 */
11875 	uint8_t queue_id1_service_profile;
11876 	/* This value is applicable to CoS queues only. */
11877 	/* Lossy (best-effort) */
11878 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11879 	/* Lossless */
11880 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11881 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11882 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11883 	uint8_t queue_id2;
11884 	/*
11885 	 * ID of CoS Queue 2. FF - Invalid id # This ID can be used on any
11886 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11887 	 * always be queried by this command before any use by the driver or
11888 	 * software. # Any driver or software should not make any assumptions
11889 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11890 	 * available. # Available queues may not be in sequential order.
11891 	 */
11892 	uint8_t queue_id2_service_profile;
11893 	/* This value is applicable to CoS queues only. */
11894 	/* Lossy (best-effort) */
11895 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11896 	/* Lossless */
11897 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11898 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11899 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11900 	uint8_t queue_id3;
11901 	/*
11902 	 * ID of CoS Queue 3. FF - Invalid id # This ID can be used on any
11903 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11904 	 * always be queried by this command before any use by the driver or
11905 	 * software. # Any driver or software should not make any assumptions
11906 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11907 	 * available. # Available queues may not be in sequential order.
11908 	 */
11909 	uint8_t queue_id3_service_profile;
11910 	/* This value is applicable to CoS queues only. */
11911 	/* Lossy (best-effort) */
11912 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11913 	/* Lossless */
11914 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11915 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11916 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11917 	uint8_t queue_id4;
11918 	/*
11919 	 * ID of CoS Queue 4. FF - Invalid id # This ID can be used on any
11920 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11921 	 * always be queried by this command before any use by the driver or
11922 	 * software. # Any driver or software should not make any assumptions
11923 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11924 	 * available. # Available queues may not be in sequential order.
11925 	 */
11926 	uint8_t queue_id4_service_profile;
11927 	/* This value is applicable to CoS queues only. */
11928 	/* Lossy (best-effort) */
11929 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11930 	/* Lossless */
11931 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11932 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11933 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11934 	uint8_t queue_id5;
11935 	/*
11936 	 * ID of CoS Queue 5. FF - Invalid id # This ID can be used on any
11937 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11938 	 * always be queried by this command before any use by the driver or
11939 	 * software. # Any driver or software should not make any assumptions
11940 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11941 	 * available. # Available queues may not be in sequential order.
11942 	 */
11943 	uint8_t queue_id5_service_profile;
11944 	/* This value is applicable to CoS queues only. */
11945 	/* Lossy (best-effort) */
11946 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11947 	/* Lossless */
11948 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11949 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11950 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11951 	uint8_t queue_id6;
11952 	/*
11953 	 * ID of CoS Queue 6. FF - Invalid id # This ID can be used on any
11954 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11955 	 * always be queried by this command before any use by the driver or
11956 	 * software. # Any driver or software should not make any assumptions
11957 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11958 	 * available. # Available queues may not be in sequential order.
11959 	 */
11960 	uint8_t queue_id6_service_profile;
11961 	/* This value is applicable to CoS queues only. */
11962 	/* Lossy (best-effort) */
11963 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11964 	/* Lossless */
11965 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11966 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11967 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11968 	uint8_t queue_id7;
11969 	/*
11970 	 * ID of CoS Queue 7. FF - Invalid id # This ID can be used on any
11971 	 * subsequent call to an hwrm command that takes a queue id. # IDs must
11972 	 * always be queried by this command before any use by the driver or
11973 	 * software. # Any driver or software should not make any assumptions
11974 	 * about queue IDs. # A value of 0xff indicates that the queue is not
11975 	 * available. # Available queues may not be in sequential order.
11976 	 */
11977 	uint8_t queue_id7_service_profile;
11978 	/* This value is applicable to CoS queues only. */
11979 	/* Lossy (best-effort) */
11980 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY UINT32_C(0x0)
11981 	/* Lossless */
11982 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
11983 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
11984 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff)
11985 	uint8_t valid;
11986 	/*
11987 	 * This field is used in Output records to indicate that the output is
11988 	 * completely written to RAM. This field should be read as '1' to
11989 	 * indicate that the output has been completely written. When writing a
11990 	 * command completion or response to an internal processor, the order of
11991 	 * writes has to be such that this field is written last.
11992 	 */
11993 } __attribute__((packed));
11994 
11995 /* hwrm_queue_qcfg */
11996 /*
11997  * Description: This function is called by a driver to query a queue
11998  * configuration.
11999  */
12000 /* Input (24 bytes) */
12001 
12002 struct hwrm_queue_qcfg_input {
12003 	uint16_t req_type;
12004 	/*
12005 	 * This value indicates what type of request this is. The format for the
12006 	 * rest of the command is determined by this field.
12007 	 */
12008 	uint16_t cmpl_ring;
12009 	/*
12010 	 * This value indicates the what completion ring the request will be
12011 	 * optionally completed on. If the value is -1, then no CR completion
12012 	 * will be generated. Any other value must be a valid CR ring_id value
12013 	 * for this function.
12014 	 */
12015 	uint16_t seq_id;
12016 	/* This value indicates the command sequence number. */
12017 	uint16_t target_id;
12018 	/*
12019 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12020 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12021 	 */
12022 	uint64_t resp_addr;
12023 	/*
12024 	 * This is the host address where the response will be written when the
12025 	 * request is complete. This area must be 16B aligned and must be
12026 	 * cleared to zero before the request is made.
12027 	 */
12028 	uint32_t flags;
12029 	/*
12030 	 * Enumeration denoting the RX, TX type of the resource. This
12031 	 * enumeration is used for resources that are similar for both TX and RX
12032 	 * paths of the chip.
12033 	 */
12034 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH		UINT32_C(0x1)
12035 	/* tx path */
12036 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
12037 	/* rx path */
12038 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
12039 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST	HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
12040 	uint32_t queue_id;
12041 	/* Queue ID of the queue. */
12042 } __attribute__((packed));
12043 
12044 /* Output (16 bytes) */
12045 
12046 struct hwrm_queue_qcfg_output {
12047 	uint16_t error_code;
12048 	/*
12049 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12050 	 * and fail the call with an error when appropriate
12051 	 */
12052 	uint16_t req_type;
12053 	/* This field returns the type of original request. */
12054 	uint16_t seq_id;
12055 	/* This field provides original sequence number of the command. */
12056 	uint16_t resp_len;
12057 	/*
12058 	 * This field is the length of the response in bytes. The last byte of
12059 	 * the response is a valid flag that will read as '1' when the command
12060 	 * has been completely written to memory.
12061 	 */
12062 	uint32_t queue_len;
12063 	/* This value is a the estimate packet length used in the TX arbiter. */
12064 	uint8_t service_profile;
12065 	/* This value is applicable to CoS queues only. */
12066 	/* Lossy (best-effort) */
12067 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
12068 	/* Lossless */
12069 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS   UINT32_C(0x1)
12070 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
12071 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
12072 	uint8_t queue_cfg_info;
12073 	/* Information about queue configuration. */
12074 	/*
12075 	 * If this flag is set to '1', then the queue is configured
12076 	 * asymmetrically on TX and RX sides. If this flag is set to '0', then
12077 	 * this queue is configured symmetrically on TX and RX sides.
12078 	 */
12079 	#define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG	UINT32_C(0x1)
12080 	uint8_t unused_0;
12081 	uint8_t valid;
12082 	/*
12083 	 * This field is used in Output records to indicate that the output is
12084 	 * completely written to RAM. This field should be read as '1' to
12085 	 * indicate that the output has been completely written. When writing a
12086 	 * command completion or response to an internal processor, the order of
12087 	 * writes has to be such that this field is written last.
12088 	 */
12089 } __attribute__((packed));
12090 
12091 /* hwrm_queue_cfg */
12092 /* Description: This function is called by a driver to configure a queue. */
12093 /* Input (40 bytes) */
12094 
12095 struct hwrm_queue_cfg_input {
12096 	uint16_t req_type;
12097 	/*
12098 	 * This value indicates what type of request this is. The format for the
12099 	 * rest of the command is determined by this field.
12100 	 */
12101 	uint16_t cmpl_ring;
12102 	/*
12103 	 * This value indicates the what completion ring the request will be
12104 	 * optionally completed on. If the value is -1, then no CR completion
12105 	 * will be generated. Any other value must be a valid CR ring_id value
12106 	 * for this function.
12107 	 */
12108 	uint16_t seq_id;
12109 	/* This value indicates the command sequence number. */
12110 	uint16_t target_id;
12111 	/*
12112 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12113 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12114 	 */
12115 	uint64_t resp_addr;
12116 	/*
12117 	 * This is the host address where the response will be written when the
12118 	 * request is complete. This area must be 16B aligned and must be
12119 	 * cleared to zero before the request is made.
12120 	 */
12121 	uint32_t flags;
12122 	/*
12123 	 * Enumeration denoting the RX, TX, or both directions applicable to the
12124 	 * resource. This enumeration is used for resources that are similar for
12125 	 * both TX and RX paths of the chip.
12126 	 */
12127 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK		UINT32_C(0x3)
12128 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT		0
12129 	/* tx path */
12130 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
12131 	/* rx path */
12132 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
12133 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
12134 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR		UINT32_C(0x2)
12135 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST	HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
12136 	uint32_t enables;
12137 	/* This bit must be '1' for the dflt_len field to be configured. */
12138 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN		UINT32_C(0x1)
12139 	/* This bit must be '1' for the service_profile field to be configured. */
12140 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE	UINT32_C(0x2)
12141 	uint32_t queue_id;
12142 	/* Queue ID of queue that is to be configured by this function. */
12143 	uint32_t dflt_len;
12144 	/*
12145 	 * This value is a the estimate packet length used in the TX arbiter.
12146 	 * Set to 0xFF... (All Fs) to not adjust this value.
12147 	 */
12148 	uint8_t service_profile;
12149 	/* This value is applicable to CoS queues only. */
12150 	/* Lossy (best-effort) */
12151 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
12152 	/* Lossless */
12153 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
12154 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
12155 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
12156 	uint8_t unused_0[7];
12157 } __attribute__((packed));
12158 
12159 /* Output (16 bytes) */
12160 
12161 struct hwrm_queue_cfg_output {
12162 	uint16_t error_code;
12163 	/*
12164 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12165 	 * and fail the call with an error when appropriate
12166 	 */
12167 	uint16_t req_type;
12168 	/* This field returns the type of original request. */
12169 	uint16_t seq_id;
12170 	/* This field provides original sequence number of the command. */
12171 	uint16_t resp_len;
12172 	/*
12173 	 * This field is the length of the response in bytes. The last byte of
12174 	 * the response is a valid flag that will read as '1' when the command
12175 	 * has been completely written to memory.
12176 	 */
12177 	uint32_t unused_0;
12178 	uint8_t unused_1;
12179 	uint8_t unused_2;
12180 	uint8_t unused_3;
12181 	uint8_t valid;
12182 	/*
12183 	 * This field is used in Output records to indicate that the output is
12184 	 * completely written to RAM. This field should be read as '1' to
12185 	 * indicate that the output has been completely written. When writing a
12186 	 * command completion or response to an internal processor, the order of
12187 	 * writes has to be such that this field is written last.
12188 	 */
12189 } __attribute__((packed));
12190 
12191 /* hwrm_queue_pfcenable_qcfg */
12192 /*
12193  * Description: This function is called by a driver to query PFC configuration
12194  * for different priorities on that port. This mapping can be different on
12195  * different ports.
12196  */
12197 /* Input (24 bytes) */
12198 
12199 struct hwrm_queue_pfcenable_qcfg_input {
12200 	uint16_t req_type;
12201 	/*
12202 	 * This value indicates what type of request this is. The format for the
12203 	 * rest of the command is determined by this field.
12204 	 */
12205 	uint16_t cmpl_ring;
12206 	/*
12207 	 * This value indicates the what completion ring the request will be
12208 	 * optionally completed on. If the value is -1, then no CR completion
12209 	 * will be generated. Any other value must be a valid CR ring_id value
12210 	 * for this function.
12211 	 */
12212 	uint16_t seq_id;
12213 	/* This value indicates the command sequence number. */
12214 	uint16_t target_id;
12215 	/*
12216 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12217 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12218 	 */
12219 	uint64_t resp_addr;
12220 	/*
12221 	 * This is the host address where the response will be written when the
12222 	 * request is complete. This area must be 16B aligned and must be
12223 	 * cleared to zero before the request is made.
12224 	 */
12225 	uint16_t port_id;
12226 	/*
12227 	 * Port ID of port for which the table is being configured. The HWRM
12228 	 * needs to check whether this function is allowed to configure pri2cos
12229 	 * mapping on this port.
12230 	 */
12231 	uint16_t unused_0[3];
12232 } __attribute__((packed));
12233 
12234 /* Output (16 bytes) */
12235 
12236 struct hwrm_queue_pfcenable_qcfg_output {
12237 	uint16_t error_code;
12238 	/*
12239 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12240 	 * and fail the call with an error when appropriate
12241 	 */
12242 	uint16_t req_type;
12243 	/* This field returns the type of original request. */
12244 	uint16_t seq_id;
12245 	/* This field provides original sequence number of the command. */
12246 	uint16_t resp_len;
12247 	/*
12248 	 * This field is the length of the response in bytes. The last byte of
12249 	 * the response is a valid flag that will read as '1' when the command
12250 	 * has been completely written to memory.
12251 	 */
12252 	uint32_t flags;
12253 	/* If set to 1, then PFC is enabled on PRI 0. */
12254 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED UINT32_C(0x1)
12255 	/* If set to 1, then PFC is enabled on PRI 1. */
12256 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED UINT32_C(0x2)
12257 	/* If set to 1, then PFC is enabled on PRI 2. */
12258 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED UINT32_C(0x4)
12259 	/* If set to 1, then PFC is enabled on PRI 3. */
12260 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED UINT32_C(0x8)
12261 	/* If set to 1, then PFC is enabled on PRI 4. */
12262 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED UINT32_C(0x10)
12263 	/* If set to 1, then PFC is enabled on PRI 5. */
12264 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED UINT32_C(0x20)
12265 	/* If set to 1, then PFC is enabled on PRI 6. */
12266 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED UINT32_C(0x40)
12267 	/* If set to 1, then PFC is enabled on PRI 7. */
12268 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED UINT32_C(0x80)
12269 	uint8_t unused_0;
12270 	uint8_t unused_1;
12271 	uint8_t unused_2;
12272 	uint8_t valid;
12273 	/*
12274 	 * This field is used in Output records to indicate that the output is
12275 	 * completely written to RAM. This field should be read as '1' to
12276 	 * indicate that the output has been completely written. When writing a
12277 	 * command completion or response to an internal processor, the order of
12278 	 * writes has to be such that this field is written last.
12279 	 */
12280 } __attribute__((packed));
12281 
12282 /* hwrm_queue_pfcenable_cfg */
12283 /*
12284  * Description: This function is called by a driver to configure the PFC enabled
12285  * for different priorities on that port. This mapping can be different on
12286  * different ports.
12287  */
12288 /* Input (24 bytes) */
12289 
12290 struct hwrm_queue_pfcenable_cfg_input {
12291 	uint16_t req_type;
12292 	/*
12293 	 * This value indicates what type of request this is. The format for the
12294 	 * rest of the command is determined by this field.
12295 	 */
12296 	uint16_t cmpl_ring;
12297 	/*
12298 	 * This value indicates the what completion ring the request will be
12299 	 * optionally completed on. If the value is -1, then no CR completion
12300 	 * will be generated. Any other value must be a valid CR ring_id value
12301 	 * for this function.
12302 	 */
12303 	uint16_t seq_id;
12304 	/* This value indicates the command sequence number. */
12305 	uint16_t target_id;
12306 	/*
12307 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12308 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12309 	 */
12310 	uint64_t resp_addr;
12311 	/*
12312 	 * This is the host address where the response will be written when the
12313 	 * request is complete. This area must be 16B aligned and must be
12314 	 * cleared to zero before the request is made.
12315 	 */
12316 	uint32_t flags;
12317 	/* If set to 1, then PFC is requested to be enabled on PRI 0. */
12318 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED UINT32_C(0x1)
12319 	/* If set to 1, then PFC is requested to be enabled on PRI 1. */
12320 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED UINT32_C(0x2)
12321 	/* If set to 1, then PFC is requested to be enabled on PRI 2. */
12322 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED UINT32_C(0x4)
12323 	/* If set to 1, then PFC is requested to be enabled on PRI 3. */
12324 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED UINT32_C(0x8)
12325 	/* If set to 1, then PFC is requested to be enabled on PRI 4. */
12326 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED UINT32_C(0x10)
12327 	/* If set to 1, then PFC is requested to be enabled on PRI 5. */
12328 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED UINT32_C(0x20)
12329 	/* If set to 1, then PFC is requested to be enabled on PRI 6. */
12330 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED UINT32_C(0x40)
12331 	/* If set to 1, then PFC is requested to be enabled on PRI 7. */
12332 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED UINT32_C(0x80)
12333 	uint16_t port_id;
12334 	/*
12335 	 * Port ID of port for which the table is being configured. The HWRM
12336 	 * needs to check whether this function is allowed to configure pri2cos
12337 	 * mapping on this port.
12338 	 */
12339 	uint16_t unused_0;
12340 } __attribute__((packed));
12341 
12342 /* Output (16 bytes) */
12343 
12344 struct hwrm_queue_pfcenable_cfg_output {
12345 	uint16_t error_code;
12346 	/*
12347 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12348 	 * and fail the call with an error when appropriate
12349 	 */
12350 	uint16_t req_type;
12351 	/* This field returns the type of original request. */
12352 	uint16_t seq_id;
12353 	/* This field provides original sequence number of the command. */
12354 	uint16_t resp_len;
12355 	/*
12356 	 * This field is the length of the response in bytes. The last byte of
12357 	 * the response is a valid flag that will read as '1' when the command
12358 	 * has been completely written to memory.
12359 	 */
12360 	uint32_t unused_0;
12361 	uint8_t unused_1;
12362 	uint8_t unused_2;
12363 	uint8_t unused_3;
12364 	uint8_t valid;
12365 	/*
12366 	 * This field is used in Output records to indicate that the output is
12367 	 * completely written to RAM. This field should be read as '1' to
12368 	 * indicate that the output has been completely written. When writing a
12369 	 * command completion or response to an internal processor, the order of
12370 	 * writes has to be such that this field is written last.
12371 	 */
12372 } __attribute__((packed));
12373 
12374 /* hwrm_queue_pri2cos_qcfg */
12375 /*
12376  * Description: This function is called by a driver to query configuration of
12377  * the priority to CoS queue mapping on the transmit side and receive side. This
12378  * mapping can be different in each direction (TX or RX). This mapping can be
12379  * different on different ports. Each CoS queue represents a Traffic Class (TC)
12380  * on that port.
12381  */
12382 /* Input (24 bytes) */
12383 
12384 struct hwrm_queue_pri2cos_qcfg_input {
12385 	uint16_t req_type;
12386 	/*
12387 	 * This value indicates what type of request this is. The format for the
12388 	 * rest of the command is determined by this field.
12389 	 */
12390 	uint16_t cmpl_ring;
12391 	/*
12392 	 * This value indicates the what completion ring the request will be
12393 	 * optionally completed on. If the value is -1, then no CR completion
12394 	 * will be generated. Any other value must be a valid CR ring_id value
12395 	 * for this function.
12396 	 */
12397 	uint16_t seq_id;
12398 	/* This value indicates the command sequence number. */
12399 	uint16_t target_id;
12400 	/*
12401 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12402 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12403 	 */
12404 	uint64_t resp_addr;
12405 	/*
12406 	 * This is the host address where the response will be written when the
12407 	 * request is complete. This area must be 16B aligned and must be
12408 	 * cleared to zero before the request is made.
12409 	 */
12410 	uint32_t flags;
12411 	/*
12412 	 * Enumeration denoting the RX, TX type of the resource. This
12413 	 * enumeration is used for resources that are similar for both TX and RX
12414 	 * paths of the chip.
12415 	 */
12416 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
12417 	/* tx path */
12418 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX	(UINT32_C(0x0) << 0)
12419 	/* rx path */
12420 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX	(UINT32_C(0x1) << 0)
12421 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST	HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
12422 	/*
12423 	 * When this bit is set to '0', the query is for VLAN PRI field in
12424 	 * tunnel headers. When this bit is set to '1', the query is for VLAN
12425 	 * PRI field in inner packet headers.
12426 	 */
12427 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN	UINT32_C(0x2)
12428 	uint8_t port_id;
12429 	/*
12430 	 * Port ID of port for which the table is being configured. The HWRM
12431 	 * needs to check whether this function is allowed to configure pri2cos
12432 	 * mapping on this port.
12433 	 */
12434 	uint8_t unused_0[3];
12435 } __attribute__((packed));
12436 
12437 /* Output (24 bytes) */
12438 
12439 struct hwrm_queue_pri2cos_qcfg_output {
12440 	uint16_t error_code;
12441 	/*
12442 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12443 	 * and fail the call with an error when appropriate
12444 	 */
12445 	uint16_t req_type;
12446 	/* This field returns the type of original request. */
12447 	uint16_t seq_id;
12448 	/* This field provides original sequence number of the command. */
12449 	uint16_t resp_len;
12450 	/*
12451 	 * This field is the length of the response in bytes. The last byte of
12452 	 * the response is a valid flag that will read as '1' when the command
12453 	 * has been completely written to memory.
12454 	 */
12455 	uint8_t pri0_cos_queue_id;
12456 	/*
12457 	 * CoS Queue assigned to priority 0. This value can only be changed
12458 	 * before traffic has started. A value of 0xff indicates that no CoS
12459 	 * queue is assigned to the specified priority.
12460 	 */
12461 	uint8_t pri1_cos_queue_id;
12462 	/*
12463 	 * CoS Queue assigned to priority 1. This value can only be changed
12464 	 * before traffic has started. A value of 0xff indicates that no CoS
12465 	 * queue is assigned to the specified priority.
12466 	 */
12467 	uint8_t pri2_cos_queue_id;
12468 	/*
12469 	 * CoS Queue assigned to priority 2 This value can only be changed
12470 	 * before traffic has started. A value of 0xff indicates that no CoS
12471 	 * queue is assigned to the specified priority.
12472 	 */
12473 	uint8_t pri3_cos_queue_id;
12474 	/*
12475 	 * CoS Queue assigned to priority 3. This value can only be changed
12476 	 * before traffic has started. A value of 0xff indicates that no CoS
12477 	 * queue is assigned to the specified priority.
12478 	 */
12479 	uint8_t pri4_cos_queue_id;
12480 	/*
12481 	 * CoS Queue assigned to priority 4. This value can only be changed
12482 	 * before traffic has started. A value of 0xff indicates that no CoS
12483 	 * queue is assigned to the specified priority.
12484 	 */
12485 	uint8_t pri5_cos_queue_id;
12486 	/*
12487 	 * CoS Queue assigned to priority 5. This value can only be changed
12488 	 * before traffic has started. A value of 0xff indicates that no CoS
12489 	 * queue is assigned to the specified priority.
12490 	 */
12491 	uint8_t pri6_cos_queue_id;
12492 	/*
12493 	 * CoS Queue assigned to priority 6. This value can only be changed
12494 	 * before traffic has started. A value of 0xff indicates that no CoS
12495 	 * queue is assigned to the specified priority.
12496 	 */
12497 	uint8_t pri7_cos_queue_id;
12498 	/*
12499 	 * CoS Queue assigned to priority 7. This value can only be changed
12500 	 * before traffic has started. A value of 0xff indicates that no CoS
12501 	 * queue is assigned to the specified priority.
12502 	 */
12503 	uint8_t queue_cfg_info;
12504 	/* Information about queue configuration. */
12505 	/*
12506 	 * If this flag is set to '1', then the PRI to CoS configuration is
12507 	 * asymmetric on TX and RX sides. If this flag is set to '0', then PRI
12508 	 * to CoS configuration is symmetric on TX and RX sides.
12509 	 */
12510 	#define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
12511 	uint8_t unused_0;
12512 	uint16_t unused_1;
12513 	uint8_t unused_2;
12514 	uint8_t unused_3;
12515 	uint8_t unused_4;
12516 	uint8_t valid;
12517 	/*
12518 	 * This field is used in Output records to indicate that the output is
12519 	 * completely written to RAM. This field should be read as '1' to
12520 	 * indicate that the output has been completely written. When writing a
12521 	 * command completion or response to an internal processor, the order of
12522 	 * writes has to be such that this field is written last.
12523 	 */
12524 } __attribute__((packed));
12525 
12526 /* hwrm_queue_pri2cos_cfg */
12527 /*
12528  * Description: This function is called by a driver to configure the priority to
12529  * CoS queue mapping on the transmit side and receive side. This mapping can be
12530  * different in each direction (TX or RX). This mapping can be different on
12531  * different ports. Each CoS queue represents a Traffic Class (TC) on that port.
12532  * This command configures the VLAN PRI-to-TC mapping for a specific port in
12533  * specific direction.
12534  */
12535 /* Input (40 bytes) */
12536 
12537 struct hwrm_queue_pri2cos_cfg_input {
12538 	uint16_t req_type;
12539 	/*
12540 	 * This value indicates what type of request this is. The format for the
12541 	 * rest of the command is determined by this field.
12542 	 */
12543 	uint16_t cmpl_ring;
12544 	/*
12545 	 * This value indicates the what completion ring the request will be
12546 	 * optionally completed on. If the value is -1, then no CR completion
12547 	 * will be generated. Any other value must be a valid CR ring_id value
12548 	 * for this function.
12549 	 */
12550 	uint16_t seq_id;
12551 	/* This value indicates the command sequence number. */
12552 	uint16_t target_id;
12553 	/*
12554 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12555 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12556 	 */
12557 	uint64_t resp_addr;
12558 	/*
12559 	 * This is the host address where the response will be written when the
12560 	 * request is complete. This area must be 16B aligned and must be
12561 	 * cleared to zero before the request is made.
12562 	 */
12563 	uint32_t flags;
12564 	/*
12565 	 * Enumeration denoting the RX, TX, or both directions applicable to the
12566 	 * resource. This enumeration is used for resources that are similar for
12567 	 * both TX and RX paths of the chip.
12568 	 */
12569 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK	UINT32_C(0x3)
12570 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT	0
12571 	/* tx path */
12572 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX	(UINT32_C(0x0) << 0)
12573 	/* rx path */
12574 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX	(UINT32_C(0x1) << 0)
12575 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
12576 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR	(UINT32_C(0x2) << 0)
12577 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST	HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
12578 	/*
12579 	 * When this bit is set to '0', the mapping is requested for VLAN PRI
12580 	 * field in tunnel headers. When this bit is set to '1', the mapping is
12581 	 * requested for VLAN PRI field in inner packet headers.
12582 	 */
12583 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN	UINT32_C(0x4)
12584 	uint32_t enables;
12585 	/*
12586 	 * This bit must be '1' for the pri0_cos_queue_id field to be
12587 	 * configured.
12588 	 */
12589 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID UINT32_C(0x1)
12590 	/*
12591 	 * This bit must be '1' for the pri1_cos_queue_id field to be
12592 	 * configured.
12593 	 */
12594 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID UINT32_C(0x2)
12595 	/*
12596 	 * This bit must be '1' for the pri2_cos_queue_id field to be
12597 	 * configured.
12598 	 */
12599 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID UINT32_C(0x4)
12600 	/*
12601 	 * This bit must be '1' for the pri3_cos_queue_id field to be
12602 	 * configured.
12603 	 */
12604 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID UINT32_C(0x8)
12605 	/*
12606 	 * This bit must be '1' for the pri4_cos_queue_id field to be
12607 	 * configured.
12608 	 */
12609 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID UINT32_C(0x10)
12610 	/*
12611 	 * This bit must be '1' for the pri5_cos_queue_id field to be
12612 	 * configured.
12613 	 */
12614 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID UINT32_C(0x20)
12615 	/*
12616 	 * This bit must be '1' for the pri6_cos_queue_id field to be
12617 	 * configured.
12618 	 */
12619 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID UINT32_C(0x40)
12620 	/*
12621 	 * This bit must be '1' for the pri7_cos_queue_id field to be
12622 	 * configured.
12623 	 */
12624 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID UINT32_C(0x80)
12625 	uint8_t port_id;
12626 	/*
12627 	 * Port ID of port for which the table is being configured. The HWRM
12628 	 * needs to check whether this function is allowed to configure pri2cos
12629 	 * mapping on this port.
12630 	 */
12631 	uint8_t pri0_cos_queue_id;
12632 	/*
12633 	 * CoS Queue assigned to priority 0. This value can only be changed
12634 	 * before traffic has started.
12635 	 */
12636 	uint8_t pri1_cos_queue_id;
12637 	/*
12638 	 * CoS Queue assigned to priority 1. This value can only be changed
12639 	 * before traffic has started.
12640 	 */
12641 	uint8_t pri2_cos_queue_id;
12642 	/*
12643 	 * CoS Queue assigned to priority 2 This value can only be changed
12644 	 * before traffic has started.
12645 	 */
12646 	uint8_t pri3_cos_queue_id;
12647 	/*
12648 	 * CoS Queue assigned to priority 3. This value can only be changed
12649 	 * before traffic has started.
12650 	 */
12651 	uint8_t pri4_cos_queue_id;
12652 	/*
12653 	 * CoS Queue assigned to priority 4. This value can only be changed
12654 	 * before traffic has started.
12655 	 */
12656 	uint8_t pri5_cos_queue_id;
12657 	/*
12658 	 * CoS Queue assigned to priority 5. This value can only be changed
12659 	 * before traffic has started.
12660 	 */
12661 	uint8_t pri6_cos_queue_id;
12662 	/*
12663 	 * CoS Queue assigned to priority 6. This value can only be changed
12664 	 * before traffic has started.
12665 	 */
12666 	uint8_t pri7_cos_queue_id;
12667 	/*
12668 	 * CoS Queue assigned to priority 7. This value can only be changed
12669 	 * before traffic has started.
12670 	 */
12671 	uint8_t unused_0[7];
12672 } __attribute__((packed));
12673 
12674 /* Output (16 bytes) */
12675 
12676 struct hwrm_queue_pri2cos_cfg_output {
12677 	uint16_t error_code;
12678 	/*
12679 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12680 	 * and fail the call with an error when appropriate
12681 	 */
12682 	uint16_t req_type;
12683 	/* This field returns the type of original request. */
12684 	uint16_t seq_id;
12685 	/* This field provides original sequence number of the command. */
12686 	uint16_t resp_len;
12687 	/*
12688 	 * This field is the length of the response in bytes. The last byte of
12689 	 * the response is a valid flag that will read as '1' when the command
12690 	 * has been completely written to memory.
12691 	 */
12692 	uint32_t unused_0;
12693 	uint8_t unused_1;
12694 	uint8_t unused_2;
12695 	uint8_t unused_3;
12696 	uint8_t valid;
12697 	/*
12698 	 * This field is used in Output records to indicate that the output is
12699 	 * completely written to RAM. This field should be read as '1' to
12700 	 * indicate that the output has been completely written. When writing a
12701 	 * command completion or response to an internal processor, the order of
12702 	 * writes has to be such that this field is written last.
12703 	 */
12704 } __attribute__((packed));
12705 
12706 /* hwrm_queue_cos2bw_qcfg */
12707 /*
12708  * Description: This function is called by a driver to query the BW to CoS queue
12709  * mapping on the transmit side of a specific port. This mapping can be
12710  * different on different ports. Each CoS queue represents a Traffic Class (TC)
12711  * on that port. Each traffic class can be assigned a valid combination of the
12712  * following: - Minimum bandwidth - Maximum bandwidth - Transmission selection
12713  * algorithm (TSA) - Priority Level (only applies to strict priority COS) -
12714  * Bandwidth weight # A CoS can be SP or non-SP: A SP CoS always gets the strict
12715  * priority. Is an COS min BW is set to 0x0 then it is considered to be non-SP;
12716  * this is a valid configuration. Note: SP provides lower latency in addition to
12717  * reserved bandwidth # For both SP CoS and non-SP CoS, min BW can be specified
12718  * to reserve specific amount of the port BW. # The min BW specified for a CoS
12719  * shall not exceed max port bandwidth. # The total of min BWs specified for all
12720  * CoS shall not exceed max port bandwidth. # For any non-SP CoS, the minimum
12721  * bandwidth guarantees are subject to round-robin scheduling. This allows BW
12722  * reservation with anti-starvation; one CoS will not block another CoS using
12723  * RR. Note: The bandwidth guarantees for any non-SP CoS are met after servicing
12724  * all SP CoS. # An SP CoS can potentially starve other lower priority SP CoS
12725  * and non-SP CoS queues. This can occur to the extent the SP min exceeds the
12726  * available port BW. # For any CoS, max BW can be specified to limit the BW
12727  * consumed by the CoS. # The max BW specified for a CoS shall not exceed the
12728  * max port bandwidth. # The WFQ provides a mechanism for sharing available
12729  * bandwidth beyond the reserved minimums configured for each CoS. The WFQ
12730  * scheduler is used to provide the percentages of remaining bandwidth after: *
12731  * first servicing the reserved bandwidth for all SP CoS, * followed by the
12732  * reserved bandwidth for all non-SP CoS * All CoS may participate in the WFQ #
12733  * If a CoS does not have a configured max BW it may use all available bandwidth
12734  * up to the max port bandwidth Minimum Bandwidth (min BW): # This is the
12735  * guaranteed bandwidth for the COS. # A value of 0x0 is valid and it means that
12736  * this COS is not guaranteed any bandwidth. A value of 0xFF.. (all Fs) means
12737  * min BW is not specified. When the min BW is not specified, the HWRM can set
12738  * it to any value it considers appropriate. Note: For a non-SP COS, the HWRM
12739  * should set min BW to 0 when the min BW is not specified. For an SP COS, the
12740  * HWRM should set min BW to some small value when the min BW is not specified.
12741  * Maximum Bandwidth: # This is the bandwidth limit of the COS. # Values 0x0 and
12742  * 0xFF.. (all Fs) are considered unspecified and the HWRM will set the maximum
12743  * bandwidth to maximum port bandwidth. Priority Level: # It applies only to SP.
12744  * # This parameter is ignored for non-SP. # 0-7 are valid values (higher value
12745  * means higher priority) # A priority level can be assigned to at most one SP.
12746  * # Invalid priority levels assignment for SPs shall result in failure.
12747  * Additional notes: # The HWRM may have to use min and (max - min) to set
12748  * appropriate counters of hardware rate limiters. # The bandwidth percentage as
12749  * specified in the DCB TC BW assignment should be used by the driver to specify
12750  * maximum bandwidth and bandwidth weight for a COS. For example, the driver
12751  * should set max BW to 20 Gbps and weight to 50 for two COSs when these two
12752  * COSs are assigned 50% share of 40 Gbps max port bandwidth.
12753  */
12754 /* Input (24 bytes) */
12755 
12756 struct hwrm_queue_cos2bw_qcfg_input {
12757 	uint16_t req_type;
12758 	/*
12759 	 * This value indicates what type of request this is. The format for the
12760 	 * rest of the command is determined by this field.
12761 	 */
12762 	uint16_t cmpl_ring;
12763 	/*
12764 	 * This value indicates the what completion ring the request will be
12765 	 * optionally completed on. If the value is -1, then no CR completion
12766 	 * will be generated. Any other value must be a valid CR ring_id value
12767 	 * for this function.
12768 	 */
12769 	uint16_t seq_id;
12770 	/* This value indicates the command sequence number. */
12771 	uint16_t target_id;
12772 	/*
12773 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
12774 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
12775 	 */
12776 	uint64_t resp_addr;
12777 	/*
12778 	 * This is the host address where the response will be written when the
12779 	 * request is complete. This area must be 16B aligned and must be
12780 	 * cleared to zero before the request is made.
12781 	 */
12782 	uint16_t port_id;
12783 	/*
12784 	 * Port ID of port for which the table is being configured. The HWRM
12785 	 * needs to check whether this function is allowed to configure TC BW
12786 	 * assignment on this port.
12787 	 */
12788 	uint16_t unused_0[3];
12789 } __attribute__((packed));
12790 
12791 /* Output (112 bytes) */
12792 
12793 struct hwrm_queue_cos2bw_qcfg_output {
12794 	uint16_t error_code;
12795 	/*
12796 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
12797 	 * and fail the call with an error when appropriate
12798 	 */
12799 	uint16_t req_type;
12800 	/* This field returns the type of original request. */
12801 	uint16_t seq_id;
12802 	/* This field provides original sequence number of the command. */
12803 	uint16_t resp_len;
12804 	/*
12805 	 * This field is the length of the response in bytes. The last byte of
12806 	 * the response is a valid flag that will read as '1' when the command
12807 	 * has been completely written to memory.
12808 	 */
12809 	uint8_t queue_id0;
12810 	/* ID of CoS Queue 0. */
12811 	uint8_t unused_0;
12812 	uint16_t unused_1;
12813 	uint32_t queue_id0_min_bw;
12814 	/*
12815 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
12816 	 * into byte counter and time interval used for this COS inside the
12817 	 * device.
12818 	 */
12819 	/* The bandwidth value. */
12820 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12821 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT 0
12822 	/* The granularity of the value (bits or bytes). */
12823 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE UINT32_C(0x10000000)
12824 	/* Value is in bits. */
12825 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12826 	/* Value is in bytes. */
12827 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12828 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
12829 	/* bw_value_unit is 3 b */
12830 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12831 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT 29
12832 	/* Value is in Mb or MB (base 10). */
12833 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12834 	/* Value is in Kb or KB (base 10). */
12835 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12836 	/* Value is in bits or bytes. */
12837 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12838 	/* Value is in Gb or GB (base 10). */
12839 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12840 	/* Value is in 1/100th of a percentage of total bandwidth. */
12841 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12842 	/* Invalid unit */
12843 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12844 	#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
12845 	uint32_t queue_id0_max_bw;
12846 	/*
12847 	 * Maximum BW allocated to CoS Queue. The HWRM will translate this value
12848 	 * into byte counter and time interval used for this COS inside the
12849 	 * device.
12850 	 */
12851 	/* The bandwidth value. */
12852 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12853 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT 0
12854 	/* The granularity of the value (bits or bytes). */
12855 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE UINT32_C(0x10000000)
12856 	/* Value is in bits. */
12857 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12858 	/* Value is in bytes. */
12859 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12860 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
12861 	/* bw_value_unit is 3 b */
12862 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12863 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT 29
12864 	/* Value is in Mb or MB (base 10). */
12865 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12866 	/* Value is in Kb or KB (base 10). */
12867 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12868 	/* Value is in bits or bytes. */
12869 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12870 	/* Value is in Gb or GB (base 10). */
12871 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12872 	/* Value is in 1/100th of a percentage of total bandwidth. */
12873 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12874 	/* Invalid unit */
12875 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12876 	#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
12877 	uint8_t queue_id0_tsa_assign;
12878 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
12879 	/* Strict Priority */
12880 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP UINT32_C(0x0)
12881 	/* Enhanced Transmission Selection */
12882 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS UINT32_C(0x1)
12883 	/* reserved */
12884 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
12885 	/* reserved */
12886 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
12887 	uint8_t queue_id0_pri_lvl;
12888 	/*
12889 	 * Priority level for strict priority. Valid only when the tsa_assign is
12890 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
12891 	 */
12892 	uint8_t queue_id0_bw_weight;
12893 	/*
12894 	 * Weight used to allocate remaining BW for this COS after servicing
12895 	 * guaranteed bandwidths for all COS.
12896 	 */
12897 	uint8_t queue_id1;
12898 	/* ID of CoS Queue 1. */
12899 	uint32_t queue_id1_min_bw;
12900 	/*
12901 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
12902 	 * into byte counter and time interval used for this COS inside the
12903 	 * device.
12904 	 */
12905 	/* The bandwidth value. */
12906 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12907 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT 0
12908 	/* The granularity of the value (bits or bytes). */
12909 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE UINT32_C(0x10000000)
12910 	/* Value is in bits. */
12911 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12912 	/* Value is in bytes. */
12913 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12914 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
12915 	/* bw_value_unit is 3 b */
12916 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12917 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT 29
12918 	/* Value is in Mb or MB (base 10). */
12919 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12920 	/* Value is in Kb or KB (base 10). */
12921 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12922 	/* Value is in bits or bytes. */
12923 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12924 	/* Value is in Gb or GB (base 10). */
12925 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12926 	/* Value is in 1/100th of a percentage of total bandwidth. */
12927 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12928 	/* Invalid unit */
12929 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12930 	#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
12931 	uint32_t queue_id1_max_bw;
12932 	/*
12933 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
12934 	 * into byte counter and time interval used for this COS inside the
12935 	 * device.
12936 	 */
12937 	/* The bandwidth value. */
12938 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12939 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT 0
12940 	/* The granularity of the value (bits or bytes). */
12941 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE UINT32_C(0x10000000)
12942 	/* Value is in bits. */
12943 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12944 	/* Value is in bytes. */
12945 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
12946 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
12947 	/* bw_value_unit is 3 b */
12948 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
12949 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT 29
12950 	/* Value is in Mb or MB (base 10). */
12951 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
12952 	/* Value is in Kb or KB (base 10). */
12953 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
12954 	/* Value is in bits or bytes. */
12955 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
12956 	/* Value is in Gb or GB (base 10). */
12957 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
12958 	/* Value is in 1/100th of a percentage of total bandwidth. */
12959 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
12960 	/* Invalid unit */
12961 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
12962 	#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
12963 	uint8_t queue_id1_tsa_assign;
12964 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
12965 	/* Strict Priority */
12966 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP UINT32_C(0x0)
12967 	/* Enhanced Transmission Selection */
12968 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS UINT32_C(0x1)
12969 	/* reserved */
12970 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
12971 	/* reserved */
12972 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
12973 	uint8_t queue_id1_pri_lvl;
12974 	/*
12975 	 * Priority level for strict priority. Valid only when the tsa_assign is
12976 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
12977 	 */
12978 	uint8_t queue_id1_bw_weight;
12979 	/*
12980 	 * Weight used to allocate remaining BW for this COS after servicing
12981 	 * guaranteed bandwidths for all COS.
12982 	 */
12983 	uint8_t queue_id2;
12984 	/* ID of CoS Queue 2. */
12985 	uint32_t queue_id2_min_bw;
12986 	/*
12987 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
12988 	 * into byte counter and time interval used for this COS inside the
12989 	 * device.
12990 	 */
12991 	/* The bandwidth value. */
12992 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
12993 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT 0
12994 	/* The granularity of the value (bits or bytes). */
12995 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE UINT32_C(0x10000000)
12996 	/* Value is in bits. */
12997 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
12998 	/* Value is in bytes. */
12999 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13000 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
13001 	/* bw_value_unit is 3 b */
13002 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13003 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT 29
13004 	/* Value is in Mb or MB (base 10). */
13005 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13006 	/* Value is in Kb or KB (base 10). */
13007 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13008 	/* Value is in bits or bytes. */
13009 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13010 	/* Value is in Gb or GB (base 10). */
13011 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13012 	/* Value is in 1/100th of a percentage of total bandwidth. */
13013 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13014 	/* Invalid unit */
13015 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13016 	#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
13017 	uint32_t queue_id2_max_bw;
13018 	/*
13019 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13020 	 * into byte counter and time interval used for this COS inside the
13021 	 * device.
13022 	 */
13023 	/* The bandwidth value. */
13024 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13025 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT 0
13026 	/* The granularity of the value (bits or bytes). */
13027 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE UINT32_C(0x10000000)
13028 	/* Value is in bits. */
13029 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13030 	/* Value is in bytes. */
13031 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13032 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
13033 	/* bw_value_unit is 3 b */
13034 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13035 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT 29
13036 	/* Value is in Mb or MB (base 10). */
13037 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13038 	/* Value is in Kb or KB (base 10). */
13039 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13040 	/* Value is in bits or bytes. */
13041 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13042 	/* Value is in Gb or GB (base 10). */
13043 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13044 	/* Value is in 1/100th of a percentage of total bandwidth. */
13045 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13046 	/* Invalid unit */
13047 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13048 	#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
13049 	uint8_t queue_id2_tsa_assign;
13050 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13051 	/* Strict Priority */
13052 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP UINT32_C(0x0)
13053 	/* Enhanced Transmission Selection */
13054 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS UINT32_C(0x1)
13055 	/* reserved */
13056 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13057 	/* reserved */
13058 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13059 	uint8_t queue_id2_pri_lvl;
13060 	/*
13061 	 * Priority level for strict priority. Valid only when the tsa_assign is
13062 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13063 	 */
13064 	uint8_t queue_id2_bw_weight;
13065 	/*
13066 	 * Weight used to allocate remaining BW for this COS after servicing
13067 	 * guaranteed bandwidths for all COS.
13068 	 */
13069 	uint8_t queue_id3;
13070 	/* ID of CoS Queue 3. */
13071 	uint32_t queue_id3_min_bw;
13072 	/*
13073 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13074 	 * into byte counter and time interval used for this COS inside the
13075 	 * device.
13076 	 */
13077 	/* The bandwidth value. */
13078 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13079 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT 0
13080 	/* The granularity of the value (bits or bytes). */
13081 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE UINT32_C(0x10000000)
13082 	/* Value is in bits. */
13083 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13084 	/* Value is in bytes. */
13085 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13086 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
13087 	/* bw_value_unit is 3 b */
13088 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13089 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT 29
13090 	/* Value is in Mb or MB (base 10). */
13091 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13092 	/* Value is in Kb or KB (base 10). */
13093 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13094 	/* Value is in bits or bytes. */
13095 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13096 	/* Value is in Gb or GB (base 10). */
13097 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13098 	/* Value is in 1/100th of a percentage of total bandwidth. */
13099 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13100 	/* Invalid unit */
13101 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13102 	#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
13103 	uint32_t queue_id3_max_bw;
13104 	/*
13105 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13106 	 * into byte counter and time interval used for this COS inside the
13107 	 * device.
13108 	 */
13109 	/* The bandwidth value. */
13110 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13111 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT 0
13112 	/* The granularity of the value (bits or bytes). */
13113 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE UINT32_C(0x10000000)
13114 	/* Value is in bits. */
13115 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13116 	/* Value is in bytes. */
13117 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13118 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
13119 	/* bw_value_unit is 3 b */
13120 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13121 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT 29
13122 	/* Value is in Mb or MB (base 10). */
13123 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13124 	/* Value is in Kb or KB (base 10). */
13125 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13126 	/* Value is in bits or bytes. */
13127 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13128 	/* Value is in Gb or GB (base 10). */
13129 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13130 	/* Value is in 1/100th of a percentage of total bandwidth. */
13131 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13132 	/* Invalid unit */
13133 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13134 	#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
13135 	uint8_t queue_id3_tsa_assign;
13136 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13137 	/* Strict Priority */
13138 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP UINT32_C(0x0)
13139 	/* Enhanced Transmission Selection */
13140 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS UINT32_C(0x1)
13141 	/* reserved */
13142 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13143 	/* reserved */
13144 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13145 	uint8_t queue_id3_pri_lvl;
13146 	/*
13147 	 * Priority level for strict priority. Valid only when the tsa_assign is
13148 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13149 	 */
13150 	uint8_t queue_id3_bw_weight;
13151 	/*
13152 	 * Weight used to allocate remaining BW for this COS after servicing
13153 	 * guaranteed bandwidths for all COS.
13154 	 */
13155 	uint8_t queue_id4;
13156 	/* ID of CoS Queue 4. */
13157 	uint32_t queue_id4_min_bw;
13158 	/*
13159 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13160 	 * into byte counter and time interval used for this COS inside the
13161 	 * device.
13162 	 */
13163 	/* The bandwidth value. */
13164 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13165 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT 0
13166 	/* The granularity of the value (bits or bytes). */
13167 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE UINT32_C(0x10000000)
13168 	/* Value is in bits. */
13169 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13170 	/* Value is in bytes. */
13171 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13172 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
13173 	/* bw_value_unit is 3 b */
13174 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13175 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT 29
13176 	/* Value is in Mb or MB (base 10). */
13177 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13178 	/* Value is in Kb or KB (base 10). */
13179 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13180 	/* Value is in bits or bytes. */
13181 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13182 	/* Value is in Gb or GB (base 10). */
13183 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13184 	/* Value is in 1/100th of a percentage of total bandwidth. */
13185 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13186 	/* Invalid unit */
13187 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13188 	#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
13189 	uint32_t queue_id4_max_bw;
13190 	/*
13191 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13192 	 * into byte counter and time interval used for this COS inside the
13193 	 * device.
13194 	 */
13195 	/* The bandwidth value. */
13196 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13197 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT 0
13198 	/* The granularity of the value (bits or bytes). */
13199 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE UINT32_C(0x10000000)
13200 	/* Value is in bits. */
13201 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13202 	/* Value is in bytes. */
13203 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13204 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
13205 	/* bw_value_unit is 3 b */
13206 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13207 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT 29
13208 	/* Value is in Mb or MB (base 10). */
13209 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13210 	/* Value is in Kb or KB (base 10). */
13211 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13212 	/* Value is in bits or bytes. */
13213 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13214 	/* Value is in Gb or GB (base 10). */
13215 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13216 	/* Value is in 1/100th of a percentage of total bandwidth. */
13217 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13218 	/* Invalid unit */
13219 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13220 	#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
13221 	uint8_t queue_id4_tsa_assign;
13222 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13223 	/* Strict Priority */
13224 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP UINT32_C(0x0)
13225 	/* Enhanced Transmission Selection */
13226 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS UINT32_C(0x1)
13227 	/* reserved */
13228 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13229 	/* reserved */
13230 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13231 	uint8_t queue_id4_pri_lvl;
13232 	/*
13233 	 * Priority level for strict priority. Valid only when the tsa_assign is
13234 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13235 	 */
13236 	uint8_t queue_id4_bw_weight;
13237 	/*
13238 	 * Weight used to allocate remaining BW for this COS after servicing
13239 	 * guaranteed bandwidths for all COS.
13240 	 */
13241 	uint8_t queue_id5;
13242 	/* ID of CoS Queue 5. */
13243 	uint32_t queue_id5_min_bw;
13244 	/*
13245 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13246 	 * into byte counter and time interval used for this COS inside the
13247 	 * device.
13248 	 */
13249 	/* The bandwidth value. */
13250 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13251 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT 0
13252 	/* The granularity of the value (bits or bytes). */
13253 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE UINT32_C(0x10000000)
13254 	/* Value is in bits. */
13255 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13256 	/* Value is in bytes. */
13257 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13258 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
13259 	/* bw_value_unit is 3 b */
13260 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13261 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT 29
13262 	/* Value is in Mb or MB (base 10). */
13263 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13264 	/* Value is in Kb or KB (base 10). */
13265 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13266 	/* Value is in bits or bytes. */
13267 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13268 	/* Value is in Gb or GB (base 10). */
13269 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13270 	/* Value is in 1/100th of a percentage of total bandwidth. */
13271 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13272 	/* Invalid unit */
13273 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13274 	#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
13275 	uint32_t queue_id5_max_bw;
13276 	/*
13277 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13278 	 * into byte counter and time interval used for this COS inside the
13279 	 * device.
13280 	 */
13281 	/* The bandwidth value. */
13282 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13283 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT 0
13284 	/* The granularity of the value (bits or bytes). */
13285 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE UINT32_C(0x10000000)
13286 	/* Value is in bits. */
13287 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13288 	/* Value is in bytes. */
13289 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13290 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
13291 	/* bw_value_unit is 3 b */
13292 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13293 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT 29
13294 	/* Value is in Mb or MB (base 10). */
13295 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13296 	/* Value is in Kb or KB (base 10). */
13297 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13298 	/* Value is in bits or bytes. */
13299 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13300 	/* Value is in Gb or GB (base 10). */
13301 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13302 	/* Value is in 1/100th of a percentage of total bandwidth. */
13303 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13304 	/* Invalid unit */
13305 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13306 	#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
13307 	uint8_t queue_id5_tsa_assign;
13308 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13309 	/* Strict Priority */
13310 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP UINT32_C(0x0)
13311 	/* Enhanced Transmission Selection */
13312 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS UINT32_C(0x1)
13313 	/* reserved */
13314 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13315 	/* reserved */
13316 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13317 	uint8_t queue_id5_pri_lvl;
13318 	/*
13319 	 * Priority level for strict priority. Valid only when the tsa_assign is
13320 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13321 	 */
13322 	uint8_t queue_id5_bw_weight;
13323 	/*
13324 	 * Weight used to allocate remaining BW for this COS after servicing
13325 	 * guaranteed bandwidths for all COS.
13326 	 */
13327 	uint8_t queue_id6;
13328 	/* ID of CoS Queue 6. */
13329 	uint32_t queue_id6_min_bw;
13330 	/*
13331 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13332 	 * into byte counter and time interval used for this COS inside the
13333 	 * device.
13334 	 */
13335 	/* The bandwidth value. */
13336 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13337 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT 0
13338 	/* The granularity of the value (bits or bytes). */
13339 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE UINT32_C(0x10000000)
13340 	/* Value is in bits. */
13341 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13342 	/* Value is in bytes. */
13343 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13344 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
13345 	/* bw_value_unit is 3 b */
13346 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13347 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT 29
13348 	/* Value is in Mb or MB (base 10). */
13349 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13350 	/* Value is in Kb or KB (base 10). */
13351 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13352 	/* Value is in bits or bytes. */
13353 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13354 	/* Value is in Gb or GB (base 10). */
13355 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13356 	/* Value is in 1/100th of a percentage of total bandwidth. */
13357 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13358 	/* Invalid unit */
13359 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13360 	#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
13361 	uint32_t queue_id6_max_bw;
13362 	/*
13363 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13364 	 * into byte counter and time interval used for this COS inside the
13365 	 * device.
13366 	 */
13367 	/* The bandwidth value. */
13368 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13369 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT 0
13370 	/* The granularity of the value (bits or bytes). */
13371 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE UINT32_C(0x10000000)
13372 	/* Value is in bits. */
13373 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13374 	/* Value is in bytes. */
13375 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13376 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
13377 	/* bw_value_unit is 3 b */
13378 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13379 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT 29
13380 	/* Value is in Mb or MB (base 10). */
13381 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13382 	/* Value is in Kb or KB (base 10). */
13383 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13384 	/* Value is in bits or bytes. */
13385 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13386 	/* Value is in Gb or GB (base 10). */
13387 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13388 	/* Value is in 1/100th of a percentage of total bandwidth. */
13389 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13390 	/* Invalid unit */
13391 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13392 	#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
13393 	uint8_t queue_id6_tsa_assign;
13394 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13395 	/* Strict Priority */
13396 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP UINT32_C(0x0)
13397 	/* Enhanced Transmission Selection */
13398 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS UINT32_C(0x1)
13399 	/* reserved */
13400 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13401 	/* reserved */
13402 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13403 	uint8_t queue_id6_pri_lvl;
13404 	/*
13405 	 * Priority level for strict priority. Valid only when the tsa_assign is
13406 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13407 	 */
13408 	uint8_t queue_id6_bw_weight;
13409 	/*
13410 	 * Weight used to allocate remaining BW for this COS after servicing
13411 	 * guaranteed bandwidths for all COS.
13412 	 */
13413 	uint8_t queue_id7;
13414 	/* ID of CoS Queue 7. */
13415 	uint32_t queue_id7_min_bw;
13416 	/*
13417 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13418 	 * into byte counter and time interval used for this COS inside the
13419 	 * device.
13420 	 */
13421 	/* The bandwidth value. */
13422 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13423 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT 0
13424 	/* The granularity of the value (bits or bytes). */
13425 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE UINT32_C(0x10000000)
13426 	/* Value is in bits. */
13427 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13428 	/* Value is in bytes. */
13429 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13430 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
13431 	/* bw_value_unit is 3 b */
13432 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13433 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT 29
13434 	/* Value is in Mb or MB (base 10). */
13435 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13436 	/* Value is in Kb or KB (base 10). */
13437 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13438 	/* Value is in bits or bytes. */
13439 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13440 	/* Value is in Gb or GB (base 10). */
13441 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13442 	/* Value is in 1/100th of a percentage of total bandwidth. */
13443 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13444 	/* Invalid unit */
13445 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13446 	#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
13447 	uint32_t queue_id7_max_bw;
13448 	/*
13449 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13450 	 * into byte counter and time interval used for this COS inside the
13451 	 * device.
13452 	 */
13453 	/* The bandwidth value. */
13454 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13455 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT 0
13456 	/* The granularity of the value (bits or bytes). */
13457 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE UINT32_C(0x10000000)
13458 	/* Value is in bits. */
13459 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13460 	/* Value is in bytes. */
13461 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13462 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
13463 	/* bw_value_unit is 3 b */
13464 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13465 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT 29
13466 	/* Value is in Mb or MB (base 10). */
13467 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13468 	/* Value is in Kb or KB (base 10). */
13469 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13470 	/* Value is in bits or bytes. */
13471 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13472 	/* Value is in Gb or GB (base 10). */
13473 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13474 	/* Value is in 1/100th of a percentage of total bandwidth. */
13475 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13476 	/* Invalid unit */
13477 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13478 	#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
13479 	uint8_t queue_id7_tsa_assign;
13480 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13481 	/* Strict Priority */
13482 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP UINT32_C(0x0)
13483 	/* Enhanced Transmission Selection */
13484 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS UINT32_C(0x1)
13485 	/* reserved */
13486 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13487 	/* reserved */
13488 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13489 	uint8_t queue_id7_pri_lvl;
13490 	/*
13491 	 * Priority level for strict priority. Valid only when the tsa_assign is
13492 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13493 	 */
13494 	uint8_t queue_id7_bw_weight;
13495 	/*
13496 	 * Weight used to allocate remaining BW for this COS after servicing
13497 	 * guaranteed bandwidths for all COS.
13498 	 */
13499 	uint8_t unused_2;
13500 	uint8_t unused_3;
13501 	uint8_t unused_4;
13502 	uint8_t unused_5;
13503 	uint8_t valid;
13504 	/*
13505 	 * This field is used in Output records to indicate that the output is
13506 	 * completely written to RAM. This field should be read as '1' to
13507 	 * indicate that the output has been completely written. When writing a
13508 	 * command completion or response to an internal processor, the order of
13509 	 * writes has to be such that this field is written last.
13510 	 */
13511 } __attribute__((packed));
13512 
13513 /* hwrm_queue_cos2bw_cfg */
13514 /*
13515  * Description: This function is called by a driver to configure the BW to CoS
13516  * queue mapping on the transmit side of a specific port. This mapping can be
13517  * different on different ports. Each CoS queue represents a Traffic Class (TC)
13518  * on that port. Each traffic class can be assigned a valid combination of the
13519  * following: - Minimum bandwidth - Maximum bandwidth - Transmission selection
13520  * algorithm (TSA) - Priority Level (only applies to strict priority COS) -
13521  * Bandwidth weight # A CoS can be SP or non-SP: A SP CoS always gets the strict
13522  * priority. Note: SP provides lower latency in addition to reserved bandwidth #
13523  * For non-SP CoS, min BW can be specified to reserve specific amount of the
13524  * port BW. # The min BW specified for a CoS shall not exceed max port
13525  * bandwidth. # The total of min BWs specified for all CoS shall not exceed max
13526  * port bandwidth. # For any non-SP CoS, the minimum bandwidth guarantees are
13527  * subject to round-robin scheduling. This allows BW reservation with anti-
13528  * starvation; one CoS will not block another CoS using RR. Note: The bandwidth
13529  * guarantees for any non-SP CoS are met after servicing all SP CoS. # An SP CoS
13530  * can potentially starve other lower priority SP CoS and non-SP CoS queues.
13531  * This can occur to the extent the SP min exceeds the available port BW. # For
13532  * any CoS, max BW can be specified to limit the BW consumed by the CoS. # A max
13533  * BW can be used for a SP CoS to limit the starvation of other CoS, but using
13534  * this will cause some characteristics of any ETS CoS to be violated. # The max
13535  * BW specified for a CoS shall not exceed the max port bandwidth. # For SP CoS,
13536  * it is recommended to set min and max BW to 0. This instructs the adapter to
13537  * use default values. # The WFQ provides a mechanism for sharing available
13538  * bandwidth beyond the reserved minimums configured for each CoS. The WFQ
13539  * scheduler is used to provide the percentages of remaining bandwidth after: -
13540  * first servicing the reserved bandwidth for all SP CoS, - followed by the
13541  * reserved bandwidth for all non-SP CoS - All CoS may participate in the WFQ #
13542  * If a CoS does not have a configured max BW it may use all available bandwidth
13543  * up to the max port bandwidth Minimum Bandwidth (min BW): # This is the
13544  * guaranteed bandwidth for the COS. # A value of 0x0 is valid and it means that
13545  * this COS is not guaranteed any bandwidth. A value of 0xFF.. (all Fs) means
13546  * min BW is not specified. When the min BW is not specified, the HWRM can set
13547  * it to any value it considers appropriate. Note: For a non-SP COS, the HWRM
13548  * should set min BW to 0 when the min BW is not specified. For an SP COS, min
13549  * BW value is ignored. Maximum Bandwidth: # This is the bandwidth limit of the
13550  * COS. # Values 0x0 and 0xFF.. (all Fs) are considered unspecified and the HWRM
13551  * will set the maximum bandwidth to maximum port bandwidth. Priority Level: #
13552  * It applies only to SP. # This parameter is ignored for non-SP. # 0-7 are
13553  * valid values (higher value means higher priority) # A priority level can be
13554  * assigned to at most one SP. # Invalid priority levels assignment for SPs
13555  * shall result in failure. Additional notes: # The HWRM may have to use min and
13556  * (max - min) to set appropriate counters of hardware rate limiters. # The
13557  * bandwidth percentage as specified in the DCB TC BW assignment should be used
13558  * by the driver to specify minimum bandwidth and bandwidth weight for a COS.
13559  * For example, the driver should set max BW to 20 Gbps and weight to 50 for two
13560  * COSs when these two COSs are assigned 50% share of 40 Gbps max port
13561  * bandwidth. DCBX use cases should always use max BW of 100% for all ETS CoS
13562  * queues.
13563  */
13564 /* Input (128 bytes) */
13565 
13566 struct hwrm_queue_cos2bw_cfg_input {
13567 	uint16_t req_type;
13568 	/*
13569 	 * This value indicates what type of request this is. The format for the
13570 	 * rest of the command is determined by this field.
13571 	 */
13572 	uint16_t cmpl_ring;
13573 	/*
13574 	 * This value indicates the what completion ring the request will be
13575 	 * optionally completed on. If the value is -1, then no CR completion
13576 	 * will be generated. Any other value must be a valid CR ring_id value
13577 	 * for this function.
13578 	 */
13579 	uint16_t seq_id;
13580 	/* This value indicates the command sequence number. */
13581 	uint16_t target_id;
13582 	/*
13583 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
13584 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
13585 	 */
13586 	uint64_t resp_addr;
13587 	/*
13588 	 * This is the host address where the response will be written when the
13589 	 * request is complete. This area must be 16B aligned and must be
13590 	 * cleared to zero before the request is made.
13591 	 */
13592 	uint32_t flags;
13593 	uint32_t enables;
13594 	/*
13595 	 * If this bit is set to 1, then all queue_id0 related parameters in
13596 	 * this command are valid.
13597 	 */
13598 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID UINT32_C(0x1)
13599 	/*
13600 	 * If this bit is set to 1, then all queue_id1 related parameters in
13601 	 * this command are valid.
13602 	 */
13603 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID UINT32_C(0x2)
13604 	/*
13605 	 * If this bit is set to 1, then all queue_id2 related parameters in
13606 	 * this command are valid.
13607 	 */
13608 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID UINT32_C(0x4)
13609 	/*
13610 	 * If this bit is set to 1, then all queue_id3 related parameters in
13611 	 * this command are valid.
13612 	 */
13613 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID UINT32_C(0x8)
13614 	/*
13615 	 * If this bit is set to 1, then all queue_id4 related parameters in
13616 	 * this command are valid.
13617 	 */
13618 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID UINT32_C(0x10)
13619 	/*
13620 	 * If this bit is set to 1, then all queue_id5 related parameters in
13621 	 * this command are valid.
13622 	 */
13623 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID UINT32_C(0x20)
13624 	/*
13625 	 * If this bit is set to 1, then all queue_id6 related parameters in
13626 	 * this command are valid.
13627 	 */
13628 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID UINT32_C(0x40)
13629 	/*
13630 	 * If this bit is set to 1, then all queue_id7 related parameters in
13631 	 * this command are valid.
13632 	 */
13633 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID UINT32_C(0x80)
13634 	uint16_t port_id;
13635 	/*
13636 	 * Port ID of port for which the table is being configured. The HWRM
13637 	 * needs to check whether this function is allowed to configure TC BW
13638 	 * assignment on this port.
13639 	 */
13640 	uint8_t queue_id0;
13641 	/* ID of CoS Queue 0. */
13642 	uint8_t unused_0;
13643 	uint32_t queue_id0_min_bw;
13644 	/*
13645 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13646 	 * into byte counter and time interval used for this COS inside the
13647 	 * device.
13648 	 */
13649 	/* The bandwidth value. */
13650 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13651 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT 0
13652 	/* The granularity of the value (bits or bytes). */
13653 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE UINT32_C(0x10000000)
13654 	/* Value is in bits. */
13655 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13656 	/* Value is in bytes. */
13657 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13658 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
13659 	/* bw_value_unit is 3 b */
13660 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13661 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT 29
13662 	/* Value is in Mb or MB (base 10). */
13663 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13664 	/* Value is in Kb or KB (base 10). */
13665 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13666 	/* Value is in bits or bytes. */
13667 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13668 	/* Value is in Gb or GB (base 10). */
13669 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13670 	/* Value is in 1/100th of a percentage of total bandwidth. */
13671 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13672 	/* Invalid unit */
13673 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13674 	#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
13675 	uint32_t queue_id0_max_bw;
13676 	/*
13677 	 * Maximum BW allocated to CoS Queue. The HWRM will translate this value
13678 	 * into byte counter and time interval used for this COS inside the
13679 	 * device.
13680 	 */
13681 	/* The bandwidth value. */
13682 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13683 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT 0
13684 	/* The granularity of the value (bits or bytes). */
13685 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE UINT32_C(0x10000000)
13686 	/* Value is in bits. */
13687 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13688 	/* Value is in bytes. */
13689 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13690 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
13691 	/* bw_value_unit is 3 b */
13692 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13693 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT 29
13694 	/* Value is in Mb or MB (base 10). */
13695 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13696 	/* Value is in Kb or KB (base 10). */
13697 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13698 	/* Value is in bits or bytes. */
13699 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13700 	/* Value is in Gb or GB (base 10). */
13701 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13702 	/* Value is in 1/100th of a percentage of total bandwidth. */
13703 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13704 	/* Invalid unit */
13705 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13706 	#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
13707 	uint8_t queue_id0_tsa_assign;
13708 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13709 	/* Strict Priority */
13710 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP UINT32_C(0x0)
13711 	/* Enhanced Transmission Selection */
13712 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS UINT32_C(0x1)
13713 	/* reserved */
13714 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13715 	/* reserved */
13716 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13717 	uint8_t queue_id0_pri_lvl;
13718 	/*
13719 	 * Priority level for strict priority. Valid only when the tsa_assign is
13720 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13721 	 */
13722 	uint8_t queue_id0_bw_weight;
13723 	/*
13724 	 * Weight used to allocate remaining BW for this COS after servicing
13725 	 * guaranteed bandwidths for all COS.
13726 	 */
13727 	uint8_t queue_id1;
13728 	/* ID of CoS Queue 1. */
13729 	uint32_t queue_id1_min_bw;
13730 	/*
13731 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13732 	 * into byte counter and time interval used for this COS inside the
13733 	 * device.
13734 	 */
13735 	/* The bandwidth value. */
13736 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13737 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT 0
13738 	/* The granularity of the value (bits or bytes). */
13739 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE UINT32_C(0x10000000)
13740 	/* Value is in bits. */
13741 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13742 	/* Value is in bytes. */
13743 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13744 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
13745 	/* bw_value_unit is 3 b */
13746 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13747 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT 29
13748 	/* Value is in Mb or MB (base 10). */
13749 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13750 	/* Value is in Kb or KB (base 10). */
13751 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13752 	/* Value is in bits or bytes. */
13753 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13754 	/* Value is in Gb or GB (base 10). */
13755 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13756 	/* Value is in 1/100th of a percentage of total bandwidth. */
13757 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13758 	/* Invalid unit */
13759 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13760 	#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
13761 	uint32_t queue_id1_max_bw;
13762 	/*
13763 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13764 	 * into byte counter and time interval used for this COS inside the
13765 	 * device.
13766 	 */
13767 	/* The bandwidth value. */
13768 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13769 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT 0
13770 	/* The granularity of the value (bits or bytes). */
13771 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE UINT32_C(0x10000000)
13772 	/* Value is in bits. */
13773 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13774 	/* Value is in bytes. */
13775 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13776 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
13777 	/* bw_value_unit is 3 b */
13778 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13779 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT 29
13780 	/* Value is in Mb or MB (base 10). */
13781 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13782 	/* Value is in Kb or KB (base 10). */
13783 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13784 	/* Value is in bits or bytes. */
13785 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13786 	/* Value is in Gb or GB (base 10). */
13787 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13788 	/* Value is in 1/100th of a percentage of total bandwidth. */
13789 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13790 	/* Invalid unit */
13791 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13792 	#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
13793 	uint8_t queue_id1_tsa_assign;
13794 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13795 	/* Strict Priority */
13796 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP UINT32_C(0x0)
13797 	/* Enhanced Transmission Selection */
13798 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS UINT32_C(0x1)
13799 	/* reserved */
13800 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13801 	/* reserved */
13802 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13803 	uint8_t queue_id1_pri_lvl;
13804 	/*
13805 	 * Priority level for strict priority. Valid only when the tsa_assign is
13806 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13807 	 */
13808 	uint8_t queue_id1_bw_weight;
13809 	/*
13810 	 * Weight used to allocate remaining BW for this COS after servicing
13811 	 * guaranteed bandwidths for all COS.
13812 	 */
13813 	uint8_t queue_id2;
13814 	/* ID of CoS Queue 2. */
13815 	uint32_t queue_id2_min_bw;
13816 	/*
13817 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13818 	 * into byte counter and time interval used for this COS inside the
13819 	 * device.
13820 	 */
13821 	/* The bandwidth value. */
13822 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13823 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT 0
13824 	/* The granularity of the value (bits or bytes). */
13825 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE UINT32_C(0x10000000)
13826 	/* Value is in bits. */
13827 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13828 	/* Value is in bytes. */
13829 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13830 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
13831 	/* bw_value_unit is 3 b */
13832 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13833 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT 29
13834 	/* Value is in Mb or MB (base 10). */
13835 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13836 	/* Value is in Kb or KB (base 10). */
13837 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13838 	/* Value is in bits or bytes. */
13839 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13840 	/* Value is in Gb or GB (base 10). */
13841 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13842 	/* Value is in 1/100th of a percentage of total bandwidth. */
13843 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13844 	/* Invalid unit */
13845 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13846 	#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
13847 	uint32_t queue_id2_max_bw;
13848 	/*
13849 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13850 	 * into byte counter and time interval used for this COS inside the
13851 	 * device.
13852 	 */
13853 	/* The bandwidth value. */
13854 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13855 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT 0
13856 	/* The granularity of the value (bits or bytes). */
13857 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE UINT32_C(0x10000000)
13858 	/* Value is in bits. */
13859 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13860 	/* Value is in bytes. */
13861 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13862 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
13863 	/* bw_value_unit is 3 b */
13864 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13865 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT 29
13866 	/* Value is in Mb or MB (base 10). */
13867 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13868 	/* Value is in Kb or KB (base 10). */
13869 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13870 	/* Value is in bits or bytes. */
13871 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13872 	/* Value is in Gb or GB (base 10). */
13873 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13874 	/* Value is in 1/100th of a percentage of total bandwidth. */
13875 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13876 	/* Invalid unit */
13877 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13878 	#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
13879 	uint8_t queue_id2_tsa_assign;
13880 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13881 	/* Strict Priority */
13882 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP UINT32_C(0x0)
13883 	/* Enhanced Transmission Selection */
13884 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS UINT32_C(0x1)
13885 	/* reserved */
13886 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13887 	/* reserved */
13888 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13889 	uint8_t queue_id2_pri_lvl;
13890 	/*
13891 	 * Priority level for strict priority. Valid only when the tsa_assign is
13892 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13893 	 */
13894 	uint8_t queue_id2_bw_weight;
13895 	/*
13896 	 * Weight used to allocate remaining BW for this COS after servicing
13897 	 * guaranteed bandwidths for all COS.
13898 	 */
13899 	uint8_t queue_id3;
13900 	/* ID of CoS Queue 3. */
13901 	uint32_t queue_id3_min_bw;
13902 	/*
13903 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13904 	 * into byte counter and time interval used for this COS inside the
13905 	 * device.
13906 	 */
13907 	/* The bandwidth value. */
13908 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13909 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT 0
13910 	/* The granularity of the value (bits or bytes). */
13911 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE UINT32_C(0x10000000)
13912 	/* Value is in bits. */
13913 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13914 	/* Value is in bytes. */
13915 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13916 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
13917 	/* bw_value_unit is 3 b */
13918 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13919 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT 29
13920 	/* Value is in Mb or MB (base 10). */
13921 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13922 	/* Value is in Kb or KB (base 10). */
13923 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13924 	/* Value is in bits or bytes. */
13925 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13926 	/* Value is in Gb or GB (base 10). */
13927 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13928 	/* Value is in 1/100th of a percentage of total bandwidth. */
13929 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13930 	/* Invalid unit */
13931 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13932 	#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
13933 	uint32_t queue_id3_max_bw;
13934 	/*
13935 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
13936 	 * into byte counter and time interval used for this COS inside the
13937 	 * device.
13938 	 */
13939 	/* The bandwidth value. */
13940 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13941 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT 0
13942 	/* The granularity of the value (bits or bytes). */
13943 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE UINT32_C(0x10000000)
13944 	/* Value is in bits. */
13945 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
13946 	/* Value is in bytes. */
13947 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
13948 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
13949 	/* bw_value_unit is 3 b */
13950 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
13951 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT 29
13952 	/* Value is in Mb or MB (base 10). */
13953 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
13954 	/* Value is in Kb or KB (base 10). */
13955 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
13956 	/* Value is in bits or bytes. */
13957 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
13958 	/* Value is in Gb or GB (base 10). */
13959 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
13960 	/* Value is in 1/100th of a percentage of total bandwidth. */
13961 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
13962 	/* Invalid unit */
13963 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
13964 	#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
13965 	uint8_t queue_id3_tsa_assign;
13966 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
13967 	/* Strict Priority */
13968 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP UINT32_C(0x0)
13969 	/* Enhanced Transmission Selection */
13970 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS UINT32_C(0x1)
13971 	/* reserved */
13972 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
13973 	/* reserved */
13974 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
13975 	uint8_t queue_id3_pri_lvl;
13976 	/*
13977 	 * Priority level for strict priority. Valid only when the tsa_assign is
13978 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
13979 	 */
13980 	uint8_t queue_id3_bw_weight;
13981 	/*
13982 	 * Weight used to allocate remaining BW for this COS after servicing
13983 	 * guaranteed bandwidths for all COS.
13984 	 */
13985 	uint8_t queue_id4;
13986 	/* ID of CoS Queue 4. */
13987 	uint32_t queue_id4_min_bw;
13988 	/*
13989 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
13990 	 * into byte counter and time interval used for this COS inside the
13991 	 * device.
13992 	 */
13993 	/* The bandwidth value. */
13994 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
13995 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT 0
13996 	/* The granularity of the value (bits or bytes). */
13997 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE UINT32_C(0x10000000)
13998 	/* Value is in bits. */
13999 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14000 	/* Value is in bytes. */
14001 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14002 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
14003 	/* bw_value_unit is 3 b */
14004 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14005 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT 29
14006 	/* Value is in Mb or MB (base 10). */
14007 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14008 	/* Value is in Kb or KB (base 10). */
14009 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14010 	/* Value is in bits or bytes. */
14011 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14012 	/* Value is in Gb or GB (base 10). */
14013 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14014 	/* Value is in 1/100th of a percentage of total bandwidth. */
14015 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14016 	/* Invalid unit */
14017 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14018 	#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
14019 	uint32_t queue_id4_max_bw;
14020 	/*
14021 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
14022 	 * into byte counter and time interval used for this COS inside the
14023 	 * device.
14024 	 */
14025 	/* The bandwidth value. */
14026 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14027 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT 0
14028 	/* The granularity of the value (bits or bytes). */
14029 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE UINT32_C(0x10000000)
14030 	/* Value is in bits. */
14031 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14032 	/* Value is in bytes. */
14033 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14034 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
14035 	/* bw_value_unit is 3 b */
14036 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14037 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT 29
14038 	/* Value is in Mb or MB (base 10). */
14039 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14040 	/* Value is in Kb or KB (base 10). */
14041 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14042 	/* Value is in bits or bytes. */
14043 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14044 	/* Value is in Gb or GB (base 10). */
14045 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14046 	/* Value is in 1/100th of a percentage of total bandwidth. */
14047 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14048 	/* Invalid unit */
14049 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14050 	#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
14051 	uint8_t queue_id4_tsa_assign;
14052 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
14053 	/* Strict Priority */
14054 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP UINT32_C(0x0)
14055 	/* Enhanced Transmission Selection */
14056 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS UINT32_C(0x1)
14057 	/* reserved */
14058 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
14059 	/* reserved */
14060 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
14061 	uint8_t queue_id4_pri_lvl;
14062 	/*
14063 	 * Priority level for strict priority. Valid only when the tsa_assign is
14064 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
14065 	 */
14066 	uint8_t queue_id4_bw_weight;
14067 	/*
14068 	 * Weight used to allocate remaining BW for this COS after servicing
14069 	 * guaranteed bandwidths for all COS.
14070 	 */
14071 	uint8_t queue_id5;
14072 	/* ID of CoS Queue 5. */
14073 	uint32_t queue_id5_min_bw;
14074 	/*
14075 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
14076 	 * into byte counter and time interval used for this COS inside the
14077 	 * device.
14078 	 */
14079 	/* The bandwidth value. */
14080 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14081 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT 0
14082 	/* The granularity of the value (bits or bytes). */
14083 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE UINT32_C(0x10000000)
14084 	/* Value is in bits. */
14085 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14086 	/* Value is in bytes. */
14087 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14088 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
14089 	/* bw_value_unit is 3 b */
14090 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14091 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT 29
14092 	/* Value is in Mb or MB (base 10). */
14093 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14094 	/* Value is in Kb or KB (base 10). */
14095 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14096 	/* Value is in bits or bytes. */
14097 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14098 	/* Value is in Gb or GB (base 10). */
14099 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14100 	/* Value is in 1/100th of a percentage of total bandwidth. */
14101 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14102 	/* Invalid unit */
14103 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14104 	#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
14105 	uint32_t queue_id5_max_bw;
14106 	/*
14107 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
14108 	 * into byte counter and time interval used for this COS inside the
14109 	 * device.
14110 	 */
14111 	/* The bandwidth value. */
14112 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14113 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT 0
14114 	/* The granularity of the value (bits or bytes). */
14115 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE UINT32_C(0x10000000)
14116 	/* Value is in bits. */
14117 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14118 	/* Value is in bytes. */
14119 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14120 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
14121 	/* bw_value_unit is 3 b */
14122 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14123 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT 29
14124 	/* Value is in Mb or MB (base 10). */
14125 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14126 	/* Value is in Kb or KB (base 10). */
14127 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14128 	/* Value is in bits or bytes. */
14129 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14130 	/* Value is in Gb or GB (base 10). */
14131 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14132 	/* Value is in 1/100th of a percentage of total bandwidth. */
14133 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14134 	/* Invalid unit */
14135 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14136 	#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
14137 	uint8_t queue_id5_tsa_assign;
14138 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
14139 	/* Strict Priority */
14140 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP UINT32_C(0x0)
14141 	/* Enhanced Transmission Selection */
14142 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS UINT32_C(0x1)
14143 	/* reserved */
14144 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
14145 	/* reserved */
14146 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
14147 	uint8_t queue_id5_pri_lvl;
14148 	/*
14149 	 * Priority level for strict priority. Valid only when the tsa_assign is
14150 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
14151 	 */
14152 	uint8_t queue_id5_bw_weight;
14153 	/*
14154 	 * Weight used to allocate remaining BW for this COS after servicing
14155 	 * guaranteed bandwidths for all COS.
14156 	 */
14157 	uint8_t queue_id6;
14158 	/* ID of CoS Queue 6. */
14159 	uint32_t queue_id6_min_bw;
14160 	/*
14161 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
14162 	 * into byte counter and time interval used for this COS inside the
14163 	 * device.
14164 	 */
14165 	/* The bandwidth value. */
14166 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14167 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT 0
14168 	/* The granularity of the value (bits or bytes). */
14169 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE UINT32_C(0x10000000)
14170 	/* Value is in bits. */
14171 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14172 	/* Value is in bytes. */
14173 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14174 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
14175 	/* bw_value_unit is 3 b */
14176 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14177 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT 29
14178 	/* Value is in Mb or MB (base 10). */
14179 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14180 	/* Value is in Kb or KB (base 10). */
14181 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14182 	/* Value is in bits or bytes. */
14183 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14184 	/* Value is in Gb or GB (base 10). */
14185 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14186 	/* Value is in 1/100th of a percentage of total bandwidth. */
14187 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14188 	/* Invalid unit */
14189 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14190 	#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
14191 	uint32_t queue_id6_max_bw;
14192 	/*
14193 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
14194 	 * into byte counter and time interval used for this COS inside the
14195 	 * device.
14196 	 */
14197 	/* The bandwidth value. */
14198 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14199 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT 0
14200 	/* The granularity of the value (bits or bytes). */
14201 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE UINT32_C(0x10000000)
14202 	/* Value is in bits. */
14203 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14204 	/* Value is in bytes. */
14205 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14206 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
14207 	/* bw_value_unit is 3 b */
14208 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14209 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT 29
14210 	/* Value is in Mb or MB (base 10). */
14211 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14212 	/* Value is in Kb or KB (base 10). */
14213 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14214 	/* Value is in bits or bytes. */
14215 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14216 	/* Value is in Gb or GB (base 10). */
14217 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14218 	/* Value is in 1/100th of a percentage of total bandwidth. */
14219 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14220 	/* Invalid unit */
14221 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14222 	#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
14223 	uint8_t queue_id6_tsa_assign;
14224 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
14225 	/* Strict Priority */
14226 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP UINT32_C(0x0)
14227 	/* Enhanced Transmission Selection */
14228 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS UINT32_C(0x1)
14229 	/* reserved */
14230 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
14231 	/* reserved */
14232 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
14233 	uint8_t queue_id6_pri_lvl;
14234 	/*
14235 	 * Priority level for strict priority. Valid only when the tsa_assign is
14236 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
14237 	 */
14238 	uint8_t queue_id6_bw_weight;
14239 	/*
14240 	 * Weight used to allocate remaining BW for this COS after servicing
14241 	 * guaranteed bandwidths for all COS.
14242 	 */
14243 	uint8_t queue_id7;
14244 	/* ID of CoS Queue 7. */
14245 	uint32_t queue_id7_min_bw;
14246 	/*
14247 	 * Minimum BW allocated to CoS Queue. The HWRM will translate this value
14248 	 * into byte counter and time interval used for this COS inside the
14249 	 * device.
14250 	 */
14251 	/* The bandwidth value. */
14252 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14253 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT 0
14254 	/* The granularity of the value (bits or bytes). */
14255 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE UINT32_C(0x10000000)
14256 	/* Value is in bits. */
14257 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14258 	/* Value is in bytes. */
14259 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14260 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
14261 	/* bw_value_unit is 3 b */
14262 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14263 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT 29
14264 	/* Value is in Mb or MB (base 10). */
14265 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14266 	/* Value is in Kb or KB (base 10). */
14267 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14268 	/* Value is in bits or bytes. */
14269 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14270 	/* Value is in Gb or GB (base 10). */
14271 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14272 	/* Value is in 1/100th of a percentage of total bandwidth. */
14273 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14274 	/* Invalid unit */
14275 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14276 	#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
14277 	uint32_t queue_id7_max_bw;
14278 	/*
14279 	 * Maximum BW allocated to CoS queue. The HWRM will translate this value
14280 	 * into byte counter and time interval used for this COS inside the
14281 	 * device.
14282 	 */
14283 	/* The bandwidth value. */
14284 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
14285 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT 0
14286 	/* The granularity of the value (bits or bytes). */
14287 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE UINT32_C(0x10000000)
14288 	/* Value is in bits. */
14289 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
14290 	/* Value is in bytes. */
14291 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
14292 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
14293 	/* bw_value_unit is 3 b */
14294 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
14295 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT 29
14296 	/* Value is in Mb or MB (base 10). */
14297 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
14298 	/* Value is in Kb or KB (base 10). */
14299 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
14300 	/* Value is in bits or bytes. */
14301 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
14302 	/* Value is in Gb or GB (base 10). */
14303 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
14304 	/* Value is in 1/100th of a percentage of total bandwidth. */
14305 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
14306 	/* Invalid unit */
14307 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
14308 	#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
14309 	uint8_t queue_id7_tsa_assign;
14310 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
14311 	/* Strict Priority */
14312 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP UINT32_C(0x0)
14313 	/* Enhanced Transmission Selection */
14314 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS UINT32_C(0x1)
14315 	/* reserved */
14316 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
14317 	/* reserved */
14318 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST UINT32_C(0xff)
14319 	uint8_t queue_id7_pri_lvl;
14320 	/*
14321 	 * Priority level for strict priority. Valid only when the tsa_assign is
14322 	 * 0 - Strict Priority (SP) 0..7 - Valid values. 8..255 - Reserved.
14323 	 */
14324 	uint8_t queue_id7_bw_weight;
14325 	/*
14326 	 * Weight used to allocate remaining BW for this COS after servicing
14327 	 * guaranteed bandwidths for all COS.
14328 	 */
14329 	uint8_t unused_1[5];
14330 } __attribute__((packed));
14331 
14332 /* Output (16 bytes) */
14333 
14334 struct hwrm_queue_cos2bw_cfg_output {
14335 	uint16_t error_code;
14336 	/*
14337 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14338 	 * and fail the call with an error when appropriate
14339 	 */
14340 	uint16_t req_type;
14341 	/* This field returns the type of original request. */
14342 	uint16_t seq_id;
14343 	/* This field provides original sequence number of the command. */
14344 	uint16_t resp_len;
14345 	/*
14346 	 * This field is the length of the response in bytes. The last byte of
14347 	 * the response is a valid flag that will read as '1' when the command
14348 	 * has been completely written to memory.
14349 	 */
14350 	uint32_t unused_0;
14351 	uint8_t unused_1;
14352 	uint8_t unused_2;
14353 	uint8_t unused_3;
14354 	uint8_t valid;
14355 	/*
14356 	 * This field is used in Output records to indicate that the output is
14357 	 * completely written to RAM. This field should be read as '1' to
14358 	 * indicate that the output has been completely written. When writing a
14359 	 * command completion or response to an internal processor, the order of
14360 	 * writes has to be such that this field is written last.
14361 	 */
14362 } __attribute__((packed));
14363 
14364 /* hwrm_queue_dscp_qcaps */
14365 /*
14366  * Description: This command is called by a driver to query the DSCP
14367  * capabilities for a port.
14368  */
14369 /* Input (24 bytes) */
14370 
14371 struct hwrm_queue_dscp_qcaps_input {
14372 	uint16_t req_type;
14373 	/*
14374 	 * This value indicates what type of request this is. The format for the
14375 	 * rest of the command is determined by this field.
14376 	 */
14377 	uint16_t cmpl_ring;
14378 	/*
14379 	 * This value indicates the what completion ring the request will be
14380 	 * optionally completed on. If the value is -1, then no CR completion
14381 	 * will be generated. Any other value must be a valid CR ring_id value
14382 	 * for this function.
14383 	 */
14384 	uint16_t seq_id;
14385 	/* This value indicates the command sequence number. */
14386 	uint16_t target_id;
14387 	/*
14388 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14389 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14390 	 */
14391 	uint64_t resp_addr;
14392 	/*
14393 	 * This is the host address where the response will be written when the
14394 	 * request is complete. This area must be 16B aligned and must be
14395 	 * cleared to zero before the request is made.
14396 	 */
14397 	uint8_t port_id;
14398 	/*
14399 	 * Port ID of port for which the table is being configured. The HWRM
14400 	 * needs to check whether this function is allowed to configure pri2cos
14401 	 * mapping on this port.
14402 	 */
14403 	uint8_t unused_0[7];
14404 } __attribute__((packed));
14405 
14406 /* Output (16 bytes) */
14407 
14408 struct hwrm_queue_dscp_qcaps_output {
14409 	uint16_t error_code;
14410 	/*
14411 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14412 	 * and fail the call with an error when appropriate
14413 	 */
14414 	uint16_t req_type;
14415 	/* This field returns the type of original request. */
14416 	uint16_t seq_id;
14417 	/* This field provides original sequence number of the command. */
14418 	uint16_t resp_len;
14419 	/*
14420 	 * This field is the length of the response in bytes. The last byte of
14421 	 * the response is a valid flag that will read as '1' when the command
14422 	 * has been completely written to memory.
14423 	 */
14424 	uint8_t num_dscp_bits;
14425 	/* The number of bits provided by the hardware for the DSCP value. */
14426 	uint8_t unused_0;
14427 	uint16_t max_entries;
14428 	/* Max number of DSCP-MASK-PRI entries supported. */
14429 	uint8_t unused_1;
14430 	uint8_t unused_2;
14431 	uint8_t unused_3;
14432 	uint8_t valid;
14433 	/*
14434 	 * This field is used in Output records to indicate that the output is
14435 	 * completely written to RAM. This field should be read as '1' to
14436 	 * indicate that the output has been completely written. When writing a
14437 	 * command completion or response to an internal processor, the order of
14438 	 * writes has to be such that this field is written last.
14439 	 */
14440 } __attribute__((packed));
14441 
14442 /* hwrm_queue_dscp2pri_qcfg */
14443 /*
14444  * Description: This command is called by a driver to query configuration of the
14445  * DSCP to PRI mapping on the receive side. This mapping can be different on
14446  * different ports.
14447  */
14448 /* Input (32 bytes) */
14449 
14450 struct hwrm_queue_dscp2pri_qcfg_input {
14451 	uint16_t req_type;
14452 	/*
14453 	 * This value indicates what type of request this is. The format for the
14454 	 * rest of the command is determined by this field.
14455 	 */
14456 	uint16_t cmpl_ring;
14457 	/*
14458 	 * This value indicates the what completion ring the request will be
14459 	 * optionally completed on. If the value is -1, then no CR completion
14460 	 * will be generated. Any other value must be a valid CR ring_id value
14461 	 * for this function.
14462 	 */
14463 	uint16_t seq_id;
14464 	/* This value indicates the command sequence number. */
14465 	uint16_t target_id;
14466 	/*
14467 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14468 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14469 	 */
14470 	uint64_t resp_addr;
14471 	/*
14472 	 * This is the host address where the response will be written when the
14473 	 * request is complete. This area must be 16B aligned and must be
14474 	 * cleared to zero before the request is made.
14475 	 */
14476 	uint64_t dest_data_addr;
14477 	/*
14478 	 * This is the host address where the 24-bits DSCP-MASK-PRI tuple(s)
14479 	 * will be copied to.
14480 	 */
14481 	uint8_t port_id;
14482 	/*
14483 	 * Port ID of port for which the table is being configured. The HWRM
14484 	 * needs to check whether this function is allowed to configure pri2cos
14485 	 * mapping on this port.
14486 	 */
14487 	uint8_t unused_0;
14488 	uint16_t dest_data_buffer_size;
14489 	/* Size of the buffer pointed to by dest_data_addr. */
14490 	uint32_t unused_1;
14491 } __attribute__((packed));
14492 
14493 /* Output (16 bytes) */
14494 
14495 struct hwrm_queue_dscp2pri_qcfg_output {
14496 	uint16_t error_code;
14497 	/*
14498 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14499 	 * and fail the call with an error when appropriate
14500 	 */
14501 	uint16_t req_type;
14502 	/* This field returns the type of original request. */
14503 	uint16_t seq_id;
14504 	/* This field provides original sequence number of the command. */
14505 	uint16_t resp_len;
14506 	/*
14507 	 * This field is the length of the response in bytes. The last byte of
14508 	 * the response is a valid flag that will read as '1' when the command
14509 	 * has been completely written to memory.
14510 	 */
14511 	uint16_t entry_cnt;
14512 	/*
14513 	 * A count of the number of DSCP-MASK-PRI tuple(s) pointed to by the
14514 	 * dest_data_addr.
14515 	 */
14516 	uint8_t default_pri;
14517 	/*
14518 	 * This is the default PRI which un-initialized DSCP values are mapped
14519 	 * to.
14520 	 */
14521 	uint8_t unused_0;
14522 	uint8_t unused_1;
14523 	uint8_t unused_2;
14524 	uint8_t unused_3;
14525 	uint8_t valid;
14526 	/*
14527 	 * This field is used in Output records to indicate that the output is
14528 	 * completely written to RAM. This field should be read as '1' to
14529 	 * indicate that the output has been completely written. When writing a
14530 	 * command completion or response to an internal processor, the order of
14531 	 * writes has to be such that this field is written last.
14532 	 */
14533 } __attribute__((packed));
14534 
14535 /* hwrm_queue_dscp2pri_cfg */
14536 /*
14537  * Description: This command is called by a driver to configure the DSCP to PRI
14538  * mapping on the receive side. This mapping can be different on different
14539  * ports.
14540  */
14541 /* Input (40 bytes) */
14542 
14543 struct hwrm_queue_dscp2pri_cfg_input {
14544 	uint16_t req_type;
14545 	/*
14546 	 * This value indicates what type of request this is. The format for the
14547 	 * rest of the command is determined by this field.
14548 	 */
14549 	uint16_t cmpl_ring;
14550 	/*
14551 	 * This value indicates the what completion ring the request will be
14552 	 * optionally completed on. If the value is -1, then no CR completion
14553 	 * will be generated. Any other value must be a valid CR ring_id value
14554 	 * for this function.
14555 	 */
14556 	uint16_t seq_id;
14557 	/* This value indicates the command sequence number. */
14558 	uint16_t target_id;
14559 	/*
14560 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14561 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14562 	 */
14563 	uint64_t resp_addr;
14564 	/*
14565 	 * This is the host address where the response will be written when the
14566 	 * request is complete. This area must be 16B aligned and must be
14567 	 * cleared to zero before the request is made.
14568 	 */
14569 	uint64_t src_data_addr;
14570 	/*
14571 	 * This is the host address where the 24-bits DSCP-MASK-PRI tuple will
14572 	 * be copied from.
14573 	 */
14574 	uint32_t flags;
14575 	/* use_hw_default_pri is 1 b */
14576 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI UINT32_C(0x1)
14577 	uint32_t enables;
14578 	/* This bit must be '1' for the default_pri field to be configured. */
14579 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI  UINT32_C(0x1)
14580 	uint8_t port_id;
14581 	/*
14582 	 * Port ID of port for which the table is being configured. The HWRM
14583 	 * needs to check whether this function is allowed to configure pri2cos
14584 	 * mapping on this port.
14585 	 */
14586 	uint8_t default_pri;
14587 	/*
14588 	 * This is the default PRI which un-initialized DSCP values will be
14589 	 * mapped to.
14590 	 */
14591 	uint16_t entry_cnt;
14592 	/*
14593 	 * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
14594 	 * to by src_data_addr.
14595 	 */
14596 	uint32_t unused_0;
14597 } __attribute__((packed));
14598 
14599 /* Output (16 bytes) */
14600 
14601 struct hwrm_queue_dscp2pri_cfg_output {
14602 	uint16_t error_code;
14603 	/*
14604 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14605 	 * and fail the call with an error when appropriate
14606 	 */
14607 	uint16_t req_type;
14608 	/* This field returns the type of original request. */
14609 	uint16_t seq_id;
14610 	/* This field provides original sequence number of the command. */
14611 	uint16_t resp_len;
14612 	/*
14613 	 * This field is the length of the response in bytes. The last byte of
14614 	 * the response is a valid flag that will read as '1' when the command
14615 	 * has been completely written to memory.
14616 	 */
14617 	uint32_t unused_0;
14618 	uint8_t unused_1;
14619 	uint8_t unused_2;
14620 	uint8_t unused_3;
14621 	uint8_t valid;
14622 	/*
14623 	 * This field is used in Output records to indicate that the output is
14624 	 * completely written to RAM. This field should be read as '1' to
14625 	 * indicate that the output has been completely written. When writing a
14626 	 * command completion or response to an internal processor, the order of
14627 	 * writes has to be such that this field is written last.
14628 	 */
14629 } __attribute__((packed));
14630 
14631 /* hwrm_vnic_alloc */
14632 /*
14633  * Description: This VNIC is a resource in the RX side of the chip that is used
14634  * to represent a virtual host "interface". # At the time of VNIC allocation or
14635  * configuration, the function can specify whether it wants the requested VNIC
14636  * to be the default VNIC for the function or not. # If a function requests
14637  * allocation of a VNIC for the first time and a VNIC is successfully allocated
14638  * by the HWRM, then the HWRM shall make the allocated VNIC as the default VNIC
14639  * for that function. # The default VNIC shall be used for the default action
14640  * for a partition or function. # For each VNIC allocated on a function, a
14641  * mapping on the RX side to map the allocated VNIC to source virtual interface
14642  * shall be performed by the HWRM. This should be hidden to the function driver
14643  * requesting the VNIC allocation. This enables broadcast/multicast replication
14644  * with source knockout. # If multicast replication with source knockout is
14645  * enabled, then the internal VNIC to SVIF mapping data structures shall be
14646  * programmed at the time of VNIC allocation.
14647  */
14648 /* Input (24 bytes) */
14649 
14650 struct hwrm_vnic_alloc_input {
14651 	uint16_t req_type;
14652 	/*
14653 	 * This value indicates what type of request this is. The format for the
14654 	 * rest of the command is determined by this field.
14655 	 */
14656 	uint16_t cmpl_ring;
14657 	/*
14658 	 * This value indicates the what completion ring the request will be
14659 	 * optionally completed on. If the value is -1, then no CR completion
14660 	 * will be generated. Any other value must be a valid CR ring_id value
14661 	 * for this function.
14662 	 */
14663 	uint16_t seq_id;
14664 	/* This value indicates the command sequence number. */
14665 	uint16_t target_id;
14666 	/*
14667 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14668 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14669 	 */
14670 	uint64_t resp_addr;
14671 	/*
14672 	 * This is the host address where the response will be written when the
14673 	 * request is complete. This area must be 16B aligned and must be
14674 	 * cleared to zero before the request is made.
14675 	 */
14676 	uint32_t flags;
14677 	/*
14678 	 * When this bit is '1', this VNIC is requested to be the default VNIC
14679 	 * for this function.
14680 	 */
14681 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT		UINT32_C(0x1)
14682 	uint32_t unused_0;
14683 } __attribute__((packed));
14684 
14685 /* Output (16 bytes) */
14686 
14687 struct hwrm_vnic_alloc_output {
14688 	uint16_t error_code;
14689 	/*
14690 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14691 	 * and fail the call with an error when appropriate
14692 	 */
14693 	uint16_t req_type;
14694 	/* This field returns the type of original request. */
14695 	uint16_t seq_id;
14696 	/* This field provides original sequence number of the command. */
14697 	uint16_t resp_len;
14698 	/*
14699 	 * This field is the length of the response in bytes. The last byte of
14700 	 * the response is a valid flag that will read as '1' when the command
14701 	 * has been completely written to memory.
14702 	 */
14703 	uint32_t vnic_id;
14704 	/* Logical vnic ID */
14705 	uint8_t unused_0;
14706 	uint8_t unused_1;
14707 	uint8_t unused_2;
14708 	uint8_t valid;
14709 	/*
14710 	 * This field is used in Output records to indicate that the output is
14711 	 * completely written to RAM. This field should be read as '1' to
14712 	 * indicate that the output has been completely written. When writing a
14713 	 * command completion or response to an internal processor, the order of
14714 	 * writes has to be such that this field is written last.
14715 	 */
14716 } __attribute__((packed));
14717 
14718 /* hwrm_vnic_free */
14719 /*
14720  * Description: Free a VNIC resource. Idle any resources associated with the
14721  * VNIC as well as the VNIC. Reset and release all resources associated with the
14722  * VNIC.
14723  */
14724 /* Input (24 bytes) */
14725 
14726 struct hwrm_vnic_free_input {
14727 	uint16_t req_type;
14728 	/*
14729 	 * This value indicates what type of request this is. The format for the
14730 	 * rest of the command is determined by this field.
14731 	 */
14732 	uint16_t cmpl_ring;
14733 	/*
14734 	 * This value indicates the what completion ring the request will be
14735 	 * optionally completed on. If the value is -1, then no CR completion
14736 	 * will be generated. Any other value must be a valid CR ring_id value
14737 	 * for this function.
14738 	 */
14739 	uint16_t seq_id;
14740 	/* This value indicates the command sequence number. */
14741 	uint16_t target_id;
14742 	/*
14743 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14744 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14745 	 */
14746 	uint64_t resp_addr;
14747 	/*
14748 	 * This is the host address where the response will be written when the
14749 	 * request is complete. This area must be 16B aligned and must be
14750 	 * cleared to zero before the request is made.
14751 	 */
14752 	uint32_t vnic_id;
14753 	/* Logical vnic ID */
14754 	uint32_t unused_0;
14755 } __attribute__((packed));
14756 
14757 /* Output (16 bytes) */
14758 
14759 struct hwrm_vnic_free_output {
14760 	uint16_t error_code;
14761 	/*
14762 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14763 	 * and fail the call with an error when appropriate
14764 	 */
14765 	uint16_t req_type;
14766 	/* This field returns the type of original request. */
14767 	uint16_t seq_id;
14768 	/* This field provides original sequence number of the command. */
14769 	uint16_t resp_len;
14770 	/*
14771 	 * This field is the length of the response in bytes. The last byte of
14772 	 * the response is a valid flag that will read as '1' when the command
14773 	 * has been completely written to memory.
14774 	 */
14775 	uint32_t unused_0;
14776 	uint8_t unused_1;
14777 	uint8_t unused_2;
14778 	uint8_t unused_3;
14779 	uint8_t valid;
14780 	/*
14781 	 * This field is used in Output records to indicate that the output is
14782 	 * completely written to RAM. This field should be read as '1' to
14783 	 * indicate that the output has been completely written. When writing a
14784 	 * command completion or response to an internal processor, the order of
14785 	 * writes has to be such that this field is written last.
14786 	 */
14787 } __attribute__((packed));
14788 
14789 /* hwrm_vnic_cfg */
14790 /* Description: Configure the RX VNIC structure. */
14791 /* Input (40 bytes) */
14792 
14793 struct hwrm_vnic_cfg_input {
14794 	uint16_t req_type;
14795 	/*
14796 	 * This value indicates what type of request this is. The format for the
14797 	 * rest of the command is determined by this field.
14798 	 */
14799 	uint16_t cmpl_ring;
14800 	/*
14801 	 * This value indicates the what completion ring the request will be
14802 	 * optionally completed on. If the value is -1, then no CR completion
14803 	 * will be generated. Any other value must be a valid CR ring_id value
14804 	 * for this function.
14805 	 */
14806 	uint16_t seq_id;
14807 	/* This value indicates the command sequence number. */
14808 	uint16_t target_id;
14809 	/*
14810 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14811 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14812 	 */
14813 	uint64_t resp_addr;
14814 	/*
14815 	 * This is the host address where the response will be written when the
14816 	 * request is complete. This area must be 16B aligned and must be
14817 	 * cleared to zero before the request is made.
14818 	 */
14819 	uint32_t flags;
14820 	/*
14821 	 * When this bit is '1', the VNIC is requested to be the default VNIC
14822 	 * for the function.
14823 	 */
14824 	#define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT		UINT32_C(0x1)
14825 	/*
14826 	 * When this bit is '1', the VNIC is being configured to strip VLAN in
14827 	 * the RX path. If set to '0', then VLAN stripping is disabled on this
14828 	 * VNIC.
14829 	 */
14830 	#define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE	UINT32_C(0x2)
14831 	/*
14832 	 * When this bit is '1', the VNIC is being configured to buffer receive
14833 	 * packets in the hardware until the host posts new receive buffers. If
14834 	 * set to '0', then bd_stall is being configured to be disabled on this
14835 	 * VNIC.
14836 	 */
14837 	#define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE		UINT32_C(0x4)
14838 	/*
14839 	 * When this bit is '1', the VNIC is being configured to receive both
14840 	 * RoCE and non-RoCE traffic. If set to '0', then this VNIC is not
14841 	 * configured to be operating in dual VNIC mode.
14842 	 */
14843 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE	UINT32_C(0x8)
14844 	/*
14845 	 * When this flag is set to '1', the VNIC is requested to be configured
14846 	 * to receive only RoCE traffic. If this flag is set to '0', then this
14847 	 * flag shall be ignored by the HWRM. If roce_dual_vnic_mode flag is set
14848 	 * to '1', then the HWRM client shall not set this flag to '1'.
14849 	 */
14850 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE	UINT32_C(0x10)
14851 	/*
14852 	 * When a VNIC uses one destination ring group for certain application
14853 	 * (e.g. Receive Flow Steering) where exact match is used to direct
14854 	 * packets to a VNIC with one destination ring group only, there is no
14855 	 * need to configure RSS indirection table for that VNIC as only one
14856 	 * destination ring group is used. This flag is used to enable a mode
14857 	 * where RSS is enabled in the VNIC using a RSS context for computing
14858 	 * RSS hash but the RSS indirection table is not configured using
14859 	 * hwrm_vnic_rss_cfg. If this mode is enabled, then the driver should
14860 	 * not program RSS indirection table for the RSS context that is used
14861 	 * for computing RSS hash only.
14862 	 */
14863 	#define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE	UINT32_C(0x20)
14864 	uint32_t enables;
14865 	/* This bit must be '1' for the dflt_ring_grp field to be configured. */
14866 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP	UINT32_C(0x1)
14867 	/* This bit must be '1' for the rss_rule field to be configured. */
14868 	#define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE		UINT32_C(0x2)
14869 	/* This bit must be '1' for the cos_rule field to be configured. */
14870 	#define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE		UINT32_C(0x4)
14871 	/* This bit must be '1' for the lb_rule field to be configured. */
14872 	#define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE		UINT32_C(0x8)
14873 	/* This bit must be '1' for the mru field to be configured. */
14874 	#define HWRM_VNIC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x10)
14875 	uint16_t vnic_id;
14876 	/* Logical vnic ID */
14877 	uint16_t dflt_ring_grp;
14878 	/*
14879 	 * Default Completion ring for the VNIC. This ring will be chosen if
14880 	 * packet does not match any RSS rules and if there is no COS rule.
14881 	 */
14882 	uint16_t rss_rule;
14883 	/*
14884 	 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if there is no
14885 	 * RSS rule.
14886 	 */
14887 	uint16_t cos_rule;
14888 	/*
14889 	 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if there is no
14890 	 * COS rule.
14891 	 */
14892 	uint16_t lb_rule;
14893 	/*
14894 	 * RSS ID for load balancing rule/table structure. 0xFF... (All Fs) if
14895 	 * there is no LB rule.
14896 	 */
14897 	uint16_t mru;
14898 	/*
14899 	 * The maximum receive unit of the vnic. Each vnic is associated with a
14900 	 * function. The vnic mru value overwrites the mru setting of the
14901 	 * associated function. The HWRM shall make sure that vnic mru does not
14902 	 * exceed the mru of the port the function is associated with.
14903 	 */
14904 	uint32_t unused_0;
14905 } __attribute__((packed));
14906 
14907 /* Output (16 bytes) */
14908 
14909 struct hwrm_vnic_cfg_output {
14910 	uint16_t error_code;
14911 	/*
14912 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14913 	 * and fail the call with an error when appropriate
14914 	 */
14915 	uint16_t req_type;
14916 	/* This field returns the type of original request. */
14917 	uint16_t seq_id;
14918 	/* This field provides original sequence number of the command. */
14919 	uint16_t resp_len;
14920 	/*
14921 	 * This field is the length of the response in bytes. The last byte of
14922 	 * the response is a valid flag that will read as '1' when the command
14923 	 * has been completely written to memory.
14924 	 */
14925 	uint32_t unused_0;
14926 	uint8_t unused_1;
14927 	uint8_t unused_2;
14928 	uint8_t unused_3;
14929 	uint8_t valid;
14930 	/*
14931 	 * This field is used in Output records to indicate that the output is
14932 	 * completely written to RAM. This field should be read as '1' to
14933 	 * indicate that the output has been completely written. When writing a
14934 	 * command completion or response to an internal processor, the order of
14935 	 * writes has to be such that this field is written last.
14936 	 */
14937 } __attribute__((packed));
14938 
14939 /* hwrm_vnic_qcfg */
14940 /*
14941  * Description: Query the RX VNIC structure. This function can be used by a PF
14942  * driver to query its own VNIC resource or VNIC resource of its child VF. This
14943  * function can also be used by a VF driver to query its own VNIC resource.
14944  */
14945 /* Input (32 bytes) */
14946 
14947 struct hwrm_vnic_qcfg_input {
14948 	uint16_t req_type;
14949 	/*
14950 	 * This value indicates what type of request this is. The format for the
14951 	 * rest of the command is determined by this field.
14952 	 */
14953 	uint16_t cmpl_ring;
14954 	/*
14955 	 * This value indicates the what completion ring the request will be
14956 	 * optionally completed on. If the value is -1, then no CR completion
14957 	 * will be generated. Any other value must be a valid CR ring_id value
14958 	 * for this function.
14959 	 */
14960 	uint16_t seq_id;
14961 	/* This value indicates the command sequence number. */
14962 	uint16_t target_id;
14963 	/*
14964 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
14965 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
14966 	 */
14967 	uint64_t resp_addr;
14968 	/*
14969 	 * This is the host address where the response will be written when the
14970 	 * request is complete. This area must be 16B aligned and must be
14971 	 * cleared to zero before the request is made.
14972 	 */
14973 	uint32_t enables;
14974 	/* This bit must be '1' for the vf_id_valid field to be configured. */
14975 	#define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
14976 	uint32_t vnic_id;
14977 	/* Logical vnic ID */
14978 	uint16_t vf_id;
14979 	/* ID of Virtual Function whose VNIC resource is being queried. */
14980 	uint16_t unused_0[3];
14981 } __attribute__((packed));
14982 
14983 /* Output (32 bytes) */
14984 
14985 struct hwrm_vnic_qcfg_output {
14986 	uint16_t error_code;
14987 	/*
14988 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
14989 	 * and fail the call with an error when appropriate
14990 	 */
14991 	uint16_t req_type;
14992 	/* This field returns the type of original request. */
14993 	uint16_t seq_id;
14994 	/* This field provides original sequence number of the command. */
14995 	uint16_t resp_len;
14996 	/*
14997 	 * This field is the length of the response in bytes. The last byte of
14998 	 * the response is a valid flag that will read as '1' when the command
14999 	 * has been completely written to memory.
15000 	 */
15001 	uint16_t dflt_ring_grp;
15002 	/* Default Completion ring for the VNIC. */
15003 	uint16_t rss_rule;
15004 	/*
15005 	 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if there is no
15006 	 * RSS rule.
15007 	 */
15008 	uint16_t cos_rule;
15009 	/*
15010 	 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if there is no
15011 	 * COS rule.
15012 	 */
15013 	uint16_t lb_rule;
15014 	/*
15015 	 * RSS ID for load balancing rule/table structure. 0xFF... (All Fs) if
15016 	 * there is no LB rule.
15017 	 */
15018 	uint16_t mru;
15019 	/* The maximum receive unit of the vnic. */
15020 	uint8_t unused_0;
15021 	uint8_t unused_1;
15022 	uint32_t flags;
15023 	/* When this bit is '1', the VNIC is the default VNIC for the function. */
15024 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT		UINT32_C(0x1)
15025 	/*
15026 	 * When this bit is '1', the VNIC is configured to strip VLAN in the RX
15027 	 * path. If set to '0', then VLAN stripping is disabled on this VNIC.
15028 	 */
15029 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE	UINT32_C(0x2)
15030 	/*
15031 	 * When this bit is '1', the VNIC is configured to buffer receive
15032 	 * packets in the hardware until the host posts new receive buffers. If
15033 	 * set to '0', then bd_stall is disabled on this VNIC.
15034 	 */
15035 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE	UINT32_C(0x4)
15036 	/*
15037 	 * When this bit is '1', the VNIC is configured to receive both RoCE and
15038 	 * non-RoCE traffic. If set to '0', then this VNIC is not configured to
15039 	 * operate in dual VNIC mode.
15040 	 */
15041 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE	UINT32_C(0x8)
15042 	/*
15043 	 * When this flag is set to '1', the VNIC is configured to receive only
15044 	 * RoCE traffic. When this flag is set to '0', the VNIC is not
15045 	 * configured to receive only RoCE traffic. If roce_dual_vnic_mode flag
15046 	 * and this flag both are set to '1', then it is an invalid
15047 	 * configuration of the VNIC. The HWRM should not allow that type of
15048 	 * mis-configuration by HWRM clients.
15049 	 */
15050 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE	UINT32_C(0x10)
15051 	/*
15052 	 * When a VNIC uses one destination ring group for certain application
15053 	 * (e.g. Receive Flow Steering) where exact match is used to direct
15054 	 * packets to a VNIC with one destination ring group only, there is no
15055 	 * need to configure RSS indirection table for that VNIC as only one
15056 	 * destination ring group is used. When this bit is set to '1', then the
15057 	 * VNIC is enabled in a mode where RSS is enabled in the VNIC using a
15058 	 * RSS context for computing RSS hash but the RSS indirection table is
15059 	 * not configured.
15060 	 */
15061 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE	UINT32_C(0x20)
15062 	uint32_t unused_2;
15063 	uint8_t unused_3;
15064 	uint8_t unused_4;
15065 	uint8_t unused_5;
15066 	uint8_t valid;
15067 	/*
15068 	 * This field is used in Output records to indicate that the output is
15069 	 * completely written to RAM. This field should be read as '1' to
15070 	 * indicate that the output has been completely written. When writing a
15071 	 * command completion or response to an internal processor, the order of
15072 	 * writes has to be such that this field is written last.
15073 	 */
15074 } __attribute__((packed));
15075 
15076 /* hwrm_vnic_qcaps */
15077 /*
15078  * Description: This function is used to query the capabilities of VNIC
15079  * resources.
15080  */
15081 /* Input (24 bytes) */
15082 
15083 struct hwrm_vnic_qcaps_input {
15084 	uint16_t req_type;
15085 	/*
15086 	 * This value indicates what type of request this is. The format for the
15087 	 * rest of the command is determined by this field.
15088 	 */
15089 	uint16_t cmpl_ring;
15090 	/*
15091 	 * This value indicates the what completion ring the request will be
15092 	 * optionally completed on. If the value is -1, then no CR completion
15093 	 * will be generated. Any other value must be a valid CR ring_id value
15094 	 * for this function.
15095 	 */
15096 	uint16_t seq_id;
15097 	/* This value indicates the command sequence number. */
15098 	uint16_t target_id;
15099 	/*
15100 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15101 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15102 	 */
15103 	uint64_t resp_addr;
15104 	/*
15105 	 * This is the host address where the response will be written when the
15106 	 * request is complete. This area must be 16B aligned and must be
15107 	 * cleared to zero before the request is made.
15108 	 */
15109 	uint32_t enables;
15110 	uint32_t unused_0;
15111 } __attribute__((packed));
15112 
15113 /* Output (24 bytes) */
15114 
15115 struct hwrm_vnic_qcaps_output {
15116 	uint16_t error_code;
15117 	/*
15118 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15119 	 * and fail the call with an error when appropriate
15120 	 */
15121 	uint16_t req_type;
15122 	/* This field returns the type of original request. */
15123 	uint16_t seq_id;
15124 	/* This field provides original sequence number of the command. */
15125 	uint16_t resp_len;
15126 	/*
15127 	 * This field is the length of the response in bytes. The last byte of
15128 	 * the response is a valid flag that will read as '1' when the command
15129 	 * has been completely written to memory.
15130 	 */
15131 	uint16_t mru;
15132 	/* The maximum receive unit that is settable on a vnic. */
15133 	uint8_t unused_0;
15134 	uint8_t unused_1;
15135 	uint32_t flags;
15136 	/* Unused. */
15137 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED		UINT32_C(0x1)
15138 	/*
15139 	 * When this bit is '1', the capability of stripping VLAN in the RX path
15140 	 * is supported on VNIC(s). If set to '0', then VLAN stripping
15141 	 * capability is not supported on VNIC(s).
15142 	 */
15143 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP	UINT32_C(0x2)
15144 	/*
15145 	 * When this bit is '1', the capability to buffer receive packets in the
15146 	 * hardware until the host posts new receive buffers is supported on
15147 	 * VNIC(s). If set to '0', then bd_stall capability is not supported on
15148 	 * VNIC(s).
15149 	 */
15150 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP	UINT32_C(0x4)
15151 	/*
15152 	 * When this bit is '1', the capability to receive both RoCE and non-
15153 	 * RoCE traffic on VNIC(s) is supported. If set to '0', then the
15154 	 * capability to receive both RoCE and non-RoCE traffic on VNIC(s) is
15155 	 * not supported.
15156 	 */
15157 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP	UINT32_C(0x8)
15158 	/*
15159 	 * When this bit is set to '1', the capability to configure a VNIC to
15160 	 * receive only RoCE traffic is supported. When this flag is set to '0',
15161 	 * the VNIC capability to configure to receive only RoCE traffic is not
15162 	 * supported.
15163 	 */
15164 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP	UINT32_C(0x10)
15165 	/*
15166 	 * When this bit is set to '1', then the capability to enable a VNIC in
15167 	 * a mode where RSS context without configuring RSS indirection table is
15168 	 * supported (for RSS hash computation). When this bit is set to '0',
15169 	 * then a VNIC can not be configured with a mode to enable RSS context
15170 	 * without configuring RSS indirection table.
15171 	 */
15172 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP	UINT32_C(0x20)
15173 	uint32_t unused_2;
15174 	uint8_t unused_3;
15175 	uint8_t unused_4;
15176 	uint8_t unused_5;
15177 	uint8_t valid;
15178 	/*
15179 	 * This field is used in Output records to indicate that the output is
15180 	 * completely written to RAM. This field should be read as '1' to
15181 	 * indicate that the output has been completely written. When writing a
15182 	 * command completion or response to an internal processor, the order of
15183 	 * writes has to be such that this field is written last.
15184 	 */
15185 } __attribute__((packed));
15186 
15187 /* hwrm_vnic_tpa_cfg */
15188 /* Description: This function is used to enable/configure TPA on the VNIC. */
15189 /* Input (40 bytes) */
15190 
15191 struct hwrm_vnic_tpa_cfg_input {
15192 	uint16_t req_type;
15193 	/*
15194 	 * This value indicates what type of request this is. The format for the
15195 	 * rest of the command is determined by this field.
15196 	 */
15197 	uint16_t cmpl_ring;
15198 	/*
15199 	 * This value indicates the what completion ring the request will be
15200 	 * optionally completed on. If the value is -1, then no CR completion
15201 	 * will be generated. Any other value must be a valid CR ring_id value
15202 	 * for this function.
15203 	 */
15204 	uint16_t seq_id;
15205 	/* This value indicates the command sequence number. */
15206 	uint16_t target_id;
15207 	/*
15208 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15209 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15210 	 */
15211 	uint64_t resp_addr;
15212 	/*
15213 	 * This is the host address where the response will be written when the
15214 	 * request is complete. This area must be 16B aligned and must be
15215 	 * cleared to zero before the request is made.
15216 	 */
15217 	uint32_t flags;
15218 	/*
15219 	 * When this bit is '1', the VNIC shall be configured to perform
15220 	 * transparent packet aggregation (TPA) of non-tunneled TCP packets.
15221 	 */
15222 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA		UINT32_C(0x1)
15223 	/*
15224 	 * When this bit is '1', the VNIC shall be configured to perform
15225 	 * transparent packet aggregation (TPA) of tunneled TCP packets.
15226 	 */
15227 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA		UINT32_C(0x2)
15228 	/*
15229 	 * When this bit is '1', the VNIC shall be configured to perform
15230 	 * transparent packet aggregation (TPA) according to Windows Receive
15231 	 * Segment Coalescing (RSC) rules.
15232 	 */
15233 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE	UINT32_C(0x4)
15234 	/*
15235 	 * When this bit is '1', the VNIC shall be configured to perform
15236 	 * transparent packet aggregation (TPA) according to Linux Generic
15237 	 * Receive Offload (GRO) rules.
15238 	 */
15239 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO		UINT32_C(0x8)
15240 	/*
15241 	 * When this bit is '1', the VNIC shall be configured to perform
15242 	 * transparent packet aggregation (TPA) for TCP packets with IP ECN set
15243 	 * to non-zero.
15244 	 */
15245 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN	UINT32_C(0x10)
15246 	/*
15247 	 * When this bit is '1', the VNIC shall be configured to perform
15248 	 * transparent packet aggregation (TPA) for GRE tunneled TCP packets
15249 	 * only if all packets have the same GRE sequence.
15250 	 */
15251 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ UINT32_C(0x20)
15252 	/*
15253 	 * When this bit is '1' and the GRO mode is enabled, the VNIC shall be
15254 	 * configured to perform transparent packet aggregation (TPA) for
15255 	 * TCP/IPv4 packets with consecutively increasing IPIDs. In other words,
15256 	 * the last packet that is being aggregated to an already existing
15257 	 * aggregation context shall have IPID 1 more than the IPID of the last
15258 	 * packet that was aggregated in that aggregation context.
15259 	 */
15260 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK	UINT32_C(0x40)
15261 	/*
15262 	 * When this bit is '1' and the GRO mode is enabled, the VNIC shall be
15263 	 * configured to perform transparent packet aggregation (TPA) for TCP
15264 	 * packets with the same TTL (IPv4) or Hop limit (IPv6) value.
15265 	 */
15266 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK	UINT32_C(0x80)
15267 	uint32_t enables;
15268 	/* This bit must be '1' for the max_agg_segs field to be configured. */
15269 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS	UINT32_C(0x1)
15270 	/* This bit must be '1' for the max_aggs field to be configured. */
15271 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS	UINT32_C(0x2)
15272 	/* This bit must be '1' for the max_agg_timer field to be configured. */
15273 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER	UINT32_C(0x4)
15274 	/* This bit must be '1' for the min_agg_len field to be configured. */
15275 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN	UINT32_C(0x8)
15276 	uint16_t vnic_id;
15277 	/* Logical vnic ID */
15278 	uint16_t max_agg_segs;
15279 	/*
15280 	 * This is the maximum number of TCP segments that can be aggregated
15281 	 * (unit is Log2). Max value is 31.
15282 	 */
15283 	/* 1 segment */
15284 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1		UINT32_C(0x0)
15285 	/* 2 segments */
15286 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2		UINT32_C(0x1)
15287 	/* 4 segments */
15288 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4		UINT32_C(0x2)
15289 	/* 8 segments */
15290 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8		UINT32_C(0x3)
15291 	/* Any segment size larger than this is not valid */
15292 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX	UINT32_C(0x1f)
15293 	uint16_t max_aggs;
15294 	/*
15295 	 * This is the maximum number of aggregations this VNIC is allowed (unit
15296 	 * is Log2). Max value is 7
15297 	 */
15298 	/* 1 aggregation */
15299 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1		UINT32_C(0x0)
15300 	/* 2 aggregations */
15301 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2		UINT32_C(0x1)
15302 	/* 4 aggregations */
15303 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4		UINT32_C(0x2)
15304 	/* 8 aggregations */
15305 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8		UINT32_C(0x3)
15306 	/* 16 aggregations */
15307 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16		UINT32_C(0x4)
15308 	/* Any aggregation size larger than this is not valid */
15309 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX		UINT32_C(0x7)
15310 	uint8_t unused_0;
15311 	uint8_t unused_1;
15312 	uint32_t max_agg_timer;
15313 	/*
15314 	 * This is the maximum amount of time allowed for an aggregation context
15315 	 * to complete after it was initiated.
15316 	 */
15317 	uint32_t min_agg_len;
15318 	/*
15319 	 * This is the minimum amount of payload length required to start an
15320 	 * aggregation context.
15321 	 */
15322 } __attribute__((packed));
15323 
15324 /* Output (16 bytes) */
15325 
15326 struct hwrm_vnic_tpa_cfg_output {
15327 	uint16_t error_code;
15328 	/*
15329 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15330 	 * and fail the call with an error when appropriate
15331 	 */
15332 	uint16_t req_type;
15333 	/* This field returns the type of original request. */
15334 	uint16_t seq_id;
15335 	/* This field provides original sequence number of the command. */
15336 	uint16_t resp_len;
15337 	/*
15338 	 * This field is the length of the response in bytes. The last byte of
15339 	 * the response is a valid flag that will read as '1' when the command
15340 	 * has been completely written to memory.
15341 	 */
15342 	uint32_t unused_0;
15343 	uint8_t unused_1;
15344 	uint8_t unused_2;
15345 	uint8_t unused_3;
15346 	uint8_t valid;
15347 	/*
15348 	 * This field is used in Output records to indicate that the output is
15349 	 * completely written to RAM. This field should be read as '1' to
15350 	 * indicate that the output has been completely written. When writing a
15351 	 * command completion or response to an internal processor, the order of
15352 	 * writes has to be such that this field is written last.
15353 	 */
15354 } __attribute__((packed));
15355 
15356 /* hwrm_vnic_tpa_qcfg */
15357 /*
15358  * Description: This function can be used to query TPA configuration on the
15359  * VNIC.
15360  */
15361 /* Input (24 bytes) */
15362 
15363 struct hwrm_vnic_tpa_qcfg_input {
15364 	uint16_t req_type;
15365 	/*
15366 	 * This value indicates what type of request this is. The format for the
15367 	 * rest of the command is determined by this field.
15368 	 */
15369 	uint16_t cmpl_ring;
15370 	/*
15371 	 * This value indicates the what completion ring the request will be
15372 	 * optionally completed on. If the value is -1, then no CR completion
15373 	 * will be generated. Any other value must be a valid CR ring_id value
15374 	 * for this function.
15375 	 */
15376 	uint16_t seq_id;
15377 	/* This value indicates the command sequence number. */
15378 	uint16_t target_id;
15379 	/*
15380 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15381 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15382 	 */
15383 	uint64_t resp_addr;
15384 	/*
15385 	 * This is the host address where the response will be written when the
15386 	 * request is complete. This area must be 16B aligned and must be
15387 	 * cleared to zero before the request is made.
15388 	 */
15389 	uint16_t vnic_id;
15390 	/* Logical vnic ID */
15391 	uint16_t unused_0[3];
15392 } __attribute__((packed));
15393 
15394 /* Output (32 bytes) */
15395 
15396 struct hwrm_vnic_tpa_qcfg_output {
15397 	uint16_t error_code;
15398 	/*
15399 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15400 	 * and fail the call with an error when appropriate
15401 	 */
15402 	uint16_t req_type;
15403 	/* This field returns the type of original request. */
15404 	uint16_t seq_id;
15405 	/* This field provides original sequence number of the command. */
15406 	uint16_t resp_len;
15407 	/*
15408 	 * This field is the length of the response in bytes. The last byte of
15409 	 * the response is a valid flag that will read as '1' when the command
15410 	 * has been completely written to memory.
15411 	 */
15412 	uint32_t flags;
15413 	/*
15414 	 * When this bit is '1', the VNIC is configured to perform transparent
15415 	 * packet aggregation (TPA) of non-tunneled TCP packets.
15416 	 */
15417 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_TPA		UINT32_C(0x1)
15418 	/*
15419 	 * When this bit is '1', the VNIC is configured to perform transparent
15420 	 * packet aggregation (TPA) of tunneled TCP packets.
15421 	 */
15422 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_ENCAP_TPA	UINT32_C(0x2)
15423 	/*
15424 	 * When this bit is '1', the VNIC is configured to perform transparent
15425 	 * packet aggregation (TPA) according to Windows Receive Segment
15426 	 * Coalescing (RSC) rules.
15427 	 */
15428 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_RSC_WND_UPDATE	UINT32_C(0x4)
15429 	/*
15430 	 * When this bit is '1', the VNIC is configured to perform transparent
15431 	 * packet aggregation (TPA) according to Linux Generic Receive Offload
15432 	 * (GRO) rules.
15433 	 */
15434 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO		UINT32_C(0x8)
15435 	/*
15436 	 * When this bit is '1', the VNIC is configured to perform transparent
15437 	 * packet aggregation (TPA) for TCP packets with IP ECN set to non-zero.
15438 	 */
15439 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_ECN	UINT32_C(0x10)
15440 	/*
15441 	 * When this bit is '1', the VNIC is configured to perform transparent
15442 	 * packet aggregation (TPA) for GRE tunneled TCP packets only if all
15443 	 * packets have the same GRE sequence.
15444 	 */
15445 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ UINT32_C(0x20)
15446 	/*
15447 	 * When this bit is '1' and the GRO mode is enabled, the VNIC is
15448 	 * configured to perform transparent packet aggregation (TPA) for
15449 	 * TCP/IPv4 packets with consecutively increasing IPIDs. In other words,
15450 	 * the last packet that is being aggregated to an already existing
15451 	 * aggregation context shall have IPID 1 more than the IPID of the last
15452 	 * packet that was aggregated in that aggregation context.
15453 	 */
15454 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_IPID_CHECK	UINT32_C(0x40)
15455 	/*
15456 	 * When this bit is '1' and the GRO mode is enabled, the VNIC is
15457 	 * configured to perform transparent packet aggregation (TPA) for TCP
15458 	 * packets with the same TTL (IPv4) or Hop limit (IPv6) value.
15459 	 */
15460 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_TTL_CHECK	UINT32_C(0x80)
15461 	uint16_t max_agg_segs;
15462 	/*
15463 	 * This is the maximum number of TCP segments that can be aggregated
15464 	 * (unit is Log2). Max value is 31.
15465 	 */
15466 	/* 1 segment */
15467 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_1	UINT32_C(0x0)
15468 	/* 2 segments */
15469 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_2	UINT32_C(0x1)
15470 	/* 4 segments */
15471 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_4	UINT32_C(0x2)
15472 	/* 8 segments */
15473 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_8	UINT32_C(0x3)
15474 	/* Any segment size larger than this is not valid */
15475 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX	UINT32_C(0x1f)
15476 	uint16_t max_aggs;
15477 	/*
15478 	 * This is the maximum number of aggregations this VNIC is allowed (unit
15479 	 * is Log2). Max value is 7
15480 	 */
15481 	/* 1 aggregation */
15482 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_1		UINT32_C(0x0)
15483 	/* 2 aggregations */
15484 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_2		UINT32_C(0x1)
15485 	/* 4 aggregations */
15486 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_4		UINT32_C(0x2)
15487 	/* 8 aggregations */
15488 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_8		UINT32_C(0x3)
15489 	/* 16 aggregations */
15490 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_16		UINT32_C(0x4)
15491 	/* Any aggregation size larger than this is not valid */
15492 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX		UINT32_C(0x7)
15493 	uint32_t max_agg_timer;
15494 	/*
15495 	 * This is the maximum amount of time allowed for an aggregation context
15496 	 * to complete after it was initiated.
15497 	 */
15498 	uint32_t min_agg_len;
15499 	/*
15500 	 * This is the minimum amount of payload length required to start an
15501 	 * aggregation context.
15502 	 */
15503 	uint32_t unused_0;
15504 	uint8_t unused_1;
15505 	uint8_t unused_2;
15506 	uint8_t unused_3;
15507 	uint8_t valid;
15508 	/*
15509 	 * This field is used in Output records to indicate that the output is
15510 	 * completely written to RAM. This field should be read as '1' to
15511 	 * indicate that the output has been completely written. When writing a
15512 	 * command completion or response to an internal processor, the order of
15513 	 * writes has to be such that this field is written last.
15514 	 */
15515 } __attribute__((packed));
15516 
15517 /* hwrm_vnic_rss_cfg */
15518 /* Description: This function is used to enable RSS configuration. */
15519 /* Input (48 bytes) */
15520 
15521 struct hwrm_vnic_rss_cfg_input {
15522 	uint16_t req_type;
15523 	/*
15524 	 * This value indicates what type of request this is. The format for the
15525 	 * rest of the command is determined by this field.
15526 	 */
15527 	uint16_t cmpl_ring;
15528 	/*
15529 	 * This value indicates the what completion ring the request will be
15530 	 * optionally completed on. If the value is -1, then no CR completion
15531 	 * will be generated. Any other value must be a valid CR ring_id value
15532 	 * for this function.
15533 	 */
15534 	uint16_t seq_id;
15535 	/* This value indicates the command sequence number. */
15536 	uint16_t target_id;
15537 	/*
15538 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15539 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15540 	 */
15541 	uint64_t resp_addr;
15542 	/*
15543 	 * This is the host address where the response will be written when the
15544 	 * request is complete. This area must be 16B aligned and must be
15545 	 * cleared to zero before the request is made.
15546 	 */
15547 	uint32_t hash_type;
15548 	/*
15549 	 * When this bit is '1', the RSS hash shall be computed over source and
15550 	 * destination IPv4 addresses of IPv4 packets.
15551 	 */
15552 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4		UINT32_C(0x1)
15553 	/*
15554 	 * When this bit is '1', the RSS hash shall be computed over
15555 	 * source/destination IPv4 addresses and source/destination ports of
15556 	 * TCP/IPv4 packets.
15557 	 */
15558 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
15559 	/*
15560 	 * When this bit is '1', the RSS hash shall be computed over
15561 	 * source/destination IPv4 addresses and source/destination ports of
15562 	 * UDP/IPv4 packets.
15563 	 */
15564 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
15565 	/*
15566 	 * When this bit is '1', the RSS hash shall be computed over source and
15567 	 * destination IPv4 addresses of IPv6 packets.
15568 	 */
15569 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6		UINT32_C(0x8)
15570 	/*
15571 	 * When this bit is '1', the RSS hash shall be computed over
15572 	 * source/destination IPv6 addresses and source/destination ports of
15573 	 * TCP/IPv6 packets.
15574 	 */
15575 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
15576 	/*
15577 	 * When this bit is '1', the RSS hash shall be computed over
15578 	 * source/destination IPv6 addresses and source/destination ports of
15579 	 * UDP/IPv6 packets.
15580 	 */
15581 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
15582 	uint32_t unused_0;
15583 	uint64_t ring_grp_tbl_addr;
15584 	/* This is the address for rss ring group table */
15585 	uint64_t hash_key_tbl_addr;
15586 	/* This is the address for rss hash key table */
15587 	uint16_t rss_ctx_idx;
15588 	/* Index to the rss indirection table. */
15589 	uint16_t unused_1[3];
15590 } __attribute__((packed));
15591 
15592 /* Output (16 bytes) */
15593 
15594 struct hwrm_vnic_rss_cfg_output {
15595 	uint16_t error_code;
15596 	/*
15597 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15598 	 * and fail the call with an error when appropriate
15599 	 */
15600 	uint16_t req_type;
15601 	/* This field returns the type of original request. */
15602 	uint16_t seq_id;
15603 	/* This field provides original sequence number of the command. */
15604 	uint16_t resp_len;
15605 	/*
15606 	 * This field is the length of the response in bytes. The last byte of
15607 	 * the response is a valid flag that will read as '1' when the command
15608 	 * has been completely written to memory.
15609 	 */
15610 	uint32_t unused_0;
15611 	uint8_t unused_1;
15612 	uint8_t unused_2;
15613 	uint8_t unused_3;
15614 	uint8_t valid;
15615 	/*
15616 	 * This field is used in Output records to indicate that the output is
15617 	 * completely written to RAM. This field should be read as '1' to
15618 	 * indicate that the output has been completely written. When writing a
15619 	 * command completion or response to an internal processor, the order of
15620 	 * writes has to be such that this field is written last.
15621 	 */
15622 } __attribute__((packed));
15623 
15624 /* hwrm_vnic_rss_qcfg */
15625 /* Description: This function is used to query RSS context configuration. */
15626 /* Input (24 bytes) */
15627 
15628 struct hwrm_vnic_rss_qcfg_input {
15629 	uint16_t req_type;
15630 	/*
15631 	 * This value indicates what type of request this is. The format for the
15632 	 * rest of the command is determined by this field.
15633 	 */
15634 	uint16_t cmpl_ring;
15635 	/*
15636 	 * This value indicates the what completion ring the request will be
15637 	 * optionally completed on. If the value is -1, then no CR completion
15638 	 * will be generated. Any other value must be a valid CR ring_id value
15639 	 * for this function.
15640 	 */
15641 	uint16_t seq_id;
15642 	/* This value indicates the command sequence number. */
15643 	uint16_t target_id;
15644 	/*
15645 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15646 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15647 	 */
15648 	uint64_t resp_addr;
15649 	/*
15650 	 * This is the host address where the response will be written when the
15651 	 * request is complete. This area must be 16B aligned and must be
15652 	 * cleared to zero before the request is made.
15653 	 */
15654 	uint16_t rss_ctx_idx;
15655 	/* Index to the rss indirection table. */
15656 	uint16_t unused_0[3];
15657 } __attribute__((packed));
15658 
15659 /* Output (64 bytes) */
15660 
15661 struct hwrm_vnic_rss_qcfg_output {
15662 	uint16_t error_code;
15663 	/*
15664 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15665 	 * and fail the call with an error when appropriate
15666 	 */
15667 	uint16_t req_type;
15668 	/* This field returns the type of original request. */
15669 	uint16_t seq_id;
15670 	/* This field provides original sequence number of the command. */
15671 	uint16_t resp_len;
15672 	/*
15673 	 * This field is the length of the response in bytes. The last byte of
15674 	 * the response is a valid flag that will read as '1' when the command
15675 	 * has been completely written to memory.
15676 	 */
15677 	uint32_t hash_type;
15678 	/*
15679 	 * When this bit is '1', the RSS hash shall be computed over source and
15680 	 * destination IPv4 addresses of IPv4 packets.
15681 	 */
15682 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4	UINT32_C(0x1)
15683 	/*
15684 	 * When this bit is '1', the RSS hash shall be computed over
15685 	 * source/destination IPv4 addresses and source/destination ports of
15686 	 * TCP/IPv4 packets.
15687 	 */
15688 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
15689 	/*
15690 	 * When this bit is '1', the RSS hash shall be computed over
15691 	 * source/destination IPv4 addresses and source/destination ports of
15692 	 * UDP/IPv4 packets.
15693 	 */
15694 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
15695 	/*
15696 	 * When this bit is '1', the RSS hash shall be computed over source and
15697 	 * destination IPv4 addresses of IPv6 packets.
15698 	 */
15699 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6	UINT32_C(0x8)
15700 	/*
15701 	 * When this bit is '1', the RSS hash shall be computed over
15702 	 * source/destination IPv6 addresses and source/destination ports of
15703 	 * TCP/IPv6 packets.
15704 	 */
15705 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
15706 	/*
15707 	 * When this bit is '1', the RSS hash shall be computed over
15708 	 * source/destination IPv6 addresses and source/destination ports of
15709 	 * UDP/IPv6 packets.
15710 	 */
15711 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
15712 	uint32_t unused_0;
15713 	uint32_t hash_key[10];
15714 	/* This is the value of rss hash key */
15715 	uint32_t unused_1;
15716 	uint8_t unused_2;
15717 	uint8_t unused_3;
15718 	uint8_t unused_4;
15719 	uint8_t valid;
15720 	/*
15721 	 * This field is used in Output records to indicate that the output is
15722 	 * completely written to RAM. This field should be read as '1' to
15723 	 * indicate that the output has been completely written. When writing a
15724 	 * command completion or response to an internal processor, the order of
15725 	 * writes has to be such that this field is written last.
15726 	 */
15727 } __attribute__((packed));
15728 
15729 /* hwrm_vnic_plcmodes_cfg */
15730 /*
15731  * Description: This function can be used to set placement mode configuration of
15732  * the VNIC.
15733  */
15734 /* Input (40 bytes) */
15735 
15736 struct hwrm_vnic_plcmodes_cfg_input {
15737 	uint16_t req_type;
15738 	/*
15739 	 * This value indicates what type of request this is. The format for the
15740 	 * rest of the command is determined by this field.
15741 	 */
15742 	uint16_t cmpl_ring;
15743 	/*
15744 	 * This value indicates the what completion ring the request will be
15745 	 * optionally completed on. If the value is -1, then no CR completion
15746 	 * will be generated. Any other value must be a valid CR ring_id value
15747 	 * for this function.
15748 	 */
15749 	uint16_t seq_id;
15750 	/* This value indicates the command sequence number. */
15751 	uint16_t target_id;
15752 	/*
15753 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15754 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15755 	 */
15756 	uint64_t resp_addr;
15757 	/*
15758 	 * This is the host address where the response will be written when the
15759 	 * request is complete. This area must be 16B aligned and must be
15760 	 * cleared to zero before the request is made.
15761 	 */
15762 	uint32_t flags;
15763 	/*
15764 	 * When this bit is '1', the VNIC shall be configured to use regular
15765 	 * placement algorithm. By default, the regular placement algorithm
15766 	 * shall be enabled on the VNIC.
15767 	 */
15768 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT UINT32_C(0x1)
15769 	/*
15770 	 * When this bit is '1', the VNIC shall be configured use the jumbo
15771 	 * placement algorithm.
15772 	 */
15773 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT UINT32_C(0x2)
15774 	/*
15775 	 * When this bit is '1', the VNIC shall be configured to enable Header-
15776 	 * Data split for IPv4 packets according to the following rules: # If
15777 	 * the packet is identified as TCP/IPv4, then the packet is split at the
15778 	 * beginning of the TCP payload. # If the packet is identified as
15779 	 * UDP/IPv4, then the packet is split at the beginning of UDP payload. #
15780 	 * If the packet is identified as non-TCP and non-UDP IPv4 packet, then
15781 	 * the packet is split at the beginning of the upper layer protocol
15782 	 * header carried in the IPv4 packet.
15783 	 */
15784 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4	UINT32_C(0x4)
15785 	/*
15786 	 * When this bit is '1', the VNIC shall be configured to enable Header-
15787 	 * Data split for IPv6 packets according to the following rules: # If
15788 	 * the packet is identified as TCP/IPv6, then the packet is split at the
15789 	 * beginning of the TCP payload. # If the packet is identified as
15790 	 * UDP/IPv6, then the packet is split at the beginning of UDP payload. #
15791 	 * If the packet is identified as non-TCP and non-UDP IPv6 packet, then
15792 	 * the packet is split at the beginning of the upper layer protocol
15793 	 * header carried in the IPv6 packet.
15794 	 */
15795 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6	UINT32_C(0x8)
15796 	/*
15797 	 * When this bit is '1', the VNIC shall be configured to enable Header-
15798 	 * Data split for FCoE packets at the beginning of FC payload.
15799 	 */
15800 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE	UINT32_C(0x10)
15801 	/*
15802 	 * When this bit is '1', the VNIC shall be configured to enable Header-
15803 	 * Data split for RoCE packets at the beginning of RoCE payload (after
15804 	 * BTH/GRH headers).
15805 	 */
15806 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE	UINT32_C(0x20)
15807 	uint32_t enables;
15808 	/*
15809 	 * This bit must be '1' for the jumbo_thresh_valid field to be
15810 	 * configured.
15811 	 */
15812 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID UINT32_C(0x1)
15813 	/* This bit must be '1' for the hds_offset_valid field to be configured. */
15814 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID UINT32_C(0x2)
15815 	/*
15816 	 * This bit must be '1' for the hds_threshold_valid field to be
15817 	 * configured.
15818 	 */
15819 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID UINT32_C(0x4)
15820 	uint32_t vnic_id;
15821 	/* Logical vnic ID */
15822 	uint16_t jumbo_thresh;
15823 	/*
15824 	 * When jumbo placement algorithm is enabled, this value is used to
15825 	 * determine the threshold for jumbo placement. Packets with length
15826 	 * larger than this value will be placed according to the jumbo
15827 	 * placement algorithm.
15828 	 */
15829 	uint16_t hds_offset;
15830 	/*
15831 	 * This value is used to determine the offset into packet buffer where
15832 	 * the split data (payload) will be placed according to one of of HDS
15833 	 * placement algorithm. The lengths of packet buffers provided for split
15834 	 * data shall be larger than this value.
15835 	 */
15836 	uint16_t hds_threshold;
15837 	/*
15838 	 * When one of the HDS placement algorithm is enabled, this value is
15839 	 * used to determine the threshold for HDS placement. Packets with
15840 	 * length larger than this value will be placed according to the HDS
15841 	 * placement algorithm. This value shall be in multiple of 4 bytes.
15842 	 */
15843 	uint16_t unused_0[3];
15844 } __attribute__((packed));
15845 
15846 /* Output (16 bytes) */
15847 
15848 struct hwrm_vnic_plcmodes_cfg_output {
15849 	uint16_t error_code;
15850 	/*
15851 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15852 	 * and fail the call with an error when appropriate
15853 	 */
15854 	uint16_t req_type;
15855 	/* This field returns the type of original request. */
15856 	uint16_t seq_id;
15857 	/* This field provides original sequence number of the command. */
15858 	uint16_t resp_len;
15859 	/*
15860 	 * This field is the length of the response in bytes. The last byte of
15861 	 * the response is a valid flag that will read as '1' when the command
15862 	 * has been completely written to memory.
15863 	 */
15864 	uint32_t unused_0;
15865 	uint8_t unused_1;
15866 	uint8_t unused_2;
15867 	uint8_t unused_3;
15868 	uint8_t valid;
15869 	/*
15870 	 * This field is used in Output records to indicate that the output is
15871 	 * completely written to RAM. This field should be read as '1' to
15872 	 * indicate that the output has been completely written. When writing a
15873 	 * command completion or response to an internal processor, the order of
15874 	 * writes has to be such that this field is written last.
15875 	 */
15876 } __attribute__((packed));
15877 
15878 /* hwrm_vnic_plcmodes_qcfg */
15879 /*
15880  * Description: This function can be used to query placement mode configuration
15881  * of the VNIC.
15882  */
15883 /* Input (24 bytes) */
15884 
15885 struct hwrm_vnic_plcmodes_qcfg_input {
15886 	uint16_t req_type;
15887 	/*
15888 	 * This value indicates what type of request this is. The format for the
15889 	 * rest of the command is determined by this field.
15890 	 */
15891 	uint16_t cmpl_ring;
15892 	/*
15893 	 * This value indicates the what completion ring the request will be
15894 	 * optionally completed on. If the value is -1, then no CR completion
15895 	 * will be generated. Any other value must be a valid CR ring_id value
15896 	 * for this function.
15897 	 */
15898 	uint16_t seq_id;
15899 	/* This value indicates the command sequence number. */
15900 	uint16_t target_id;
15901 	/*
15902 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
15903 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
15904 	 */
15905 	uint64_t resp_addr;
15906 	/*
15907 	 * This is the host address where the response will be written when the
15908 	 * request is complete. This area must be 16B aligned and must be
15909 	 * cleared to zero before the request is made.
15910 	 */
15911 	uint32_t vnic_id;
15912 	/* Logical vnic ID */
15913 	uint32_t unused_0;
15914 } __attribute__((packed));
15915 
15916 /* Output (24 bytes) */
15917 
15918 struct hwrm_vnic_plcmodes_qcfg_output {
15919 	uint16_t error_code;
15920 	/*
15921 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
15922 	 * and fail the call with an error when appropriate
15923 	 */
15924 	uint16_t req_type;
15925 	/* This field returns the type of original request. */
15926 	uint16_t seq_id;
15927 	/* This field provides original sequence number of the command. */
15928 	uint16_t resp_len;
15929 	/*
15930 	 * This field is the length of the response in bytes. The last byte of
15931 	 * the response is a valid flag that will read as '1' when the command
15932 	 * has been completely written to memory.
15933 	 */
15934 	uint32_t flags;
15935 	/*
15936 	 * When this bit is '1', the VNIC is configured to use regular placement
15937 	 * algorithm.
15938 	 */
15939 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT UINT32_C(0x1)
15940 	/*
15941 	 * When this bit is '1', the VNIC is configured to use the jumbo
15942 	 * placement algorithm.
15943 	 */
15944 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT UINT32_C(0x2)
15945 	/*
15946 	 * When this bit is '1', the VNIC is configured to enable Header-Data
15947 	 * split for IPv4 packets.
15948 	 */
15949 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4	UINT32_C(0x4)
15950 	/*
15951 	 * When this bit is '1', the VNIC is configured to enable Header-Data
15952 	 * split for IPv6 packets.
15953 	 */
15954 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6	UINT32_C(0x8)
15955 	/*
15956 	 * When this bit is '1', the VNIC is configured to enable Header-Data
15957 	 * split for FCoE packets.
15958 	 */
15959 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE	UINT32_C(0x10)
15960 	/*
15961 	 * When this bit is '1', the VNIC is configured to enable Header-Data
15962 	 * split for RoCE packets.
15963 	 */
15964 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE	UINT32_C(0x20)
15965 	/*
15966 	 * When this bit is '1', the VNIC is configured to be the default VNIC
15967 	 * of the requesting function.
15968 	 */
15969 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC	UINT32_C(0x40)
15970 	uint16_t jumbo_thresh;
15971 	/*
15972 	 * When jumbo placement algorithm is enabled, this value is used to
15973 	 * determine the threshold for jumbo placement. Packets with length
15974 	 * larger than this value will be placed according to the jumbo
15975 	 * placement algorithm.
15976 	 */
15977 	uint16_t hds_offset;
15978 	/*
15979 	 * This value is used to determine the offset into packet buffer where
15980 	 * the split data (payload) will be placed according to one of of HDS
15981 	 * placement algorithm. The lengths of packet buffers provided for split
15982 	 * data shall be larger than this value.
15983 	 */
15984 	uint16_t hds_threshold;
15985 	/*
15986 	 * When one of the HDS placement algorithm is enabled, this value is
15987 	 * used to determine the threshold for HDS placement. Packets with
15988 	 * length larger than this value will be placed according to the HDS
15989 	 * placement algorithm. This value shall be in multiple of 4 bytes.
15990 	 */
15991 	uint8_t unused_0;
15992 	uint8_t unused_1;
15993 	uint8_t unused_2;
15994 	uint8_t unused_3;
15995 	uint8_t unused_4;
15996 	uint8_t valid;
15997 	/*
15998 	 * This field is used in Output records to indicate that the output is
15999 	 * completely written to RAM. This field should be read as '1' to
16000 	 * indicate that the output has been completely written. When writing a
16001 	 * command completion or response to an internal processor, the order of
16002 	 * writes has to be such that this field is written last.
16003 	 */
16004 } __attribute__((packed));
16005 
16006 /* hwrm_vnic_rss_cos_lb_ctx_alloc */
16007 /* Description: This function is used to allocate COS/Load Balance context. */
16008 /* Input (16 bytes) */
16009 
16010 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
16011 	uint16_t req_type;
16012 	/*
16013 	 * This value indicates what type of request this is. The format for the
16014 	 * rest of the command is determined by this field.
16015 	 */
16016 	uint16_t cmpl_ring;
16017 	/*
16018 	 * This value indicates the what completion ring the request will be
16019 	 * optionally completed on. If the value is -1, then no CR completion
16020 	 * will be generated. Any other value must be a valid CR ring_id value
16021 	 * for this function.
16022 	 */
16023 	uint16_t seq_id;
16024 	/* This value indicates the command sequence number. */
16025 	uint16_t target_id;
16026 	/*
16027 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16028 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16029 	 */
16030 	uint64_t resp_addr;
16031 	/*
16032 	 * This is the host address where the response will be written when the
16033 	 * request is complete. This area must be 16B aligned and must be
16034 	 * cleared to zero before the request is made.
16035 	 */
16036 } __attribute__((packed));
16037 
16038 /* Output (16 bytes) */
16039 
16040 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
16041 	uint16_t error_code;
16042 	/*
16043 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16044 	 * and fail the call with an error when appropriate
16045 	 */
16046 	uint16_t req_type;
16047 	/* This field returns the type of original request. */
16048 	uint16_t seq_id;
16049 	/* This field provides original sequence number of the command. */
16050 	uint16_t resp_len;
16051 	/*
16052 	 * This field is the length of the response in bytes. The last byte of
16053 	 * the response is a valid flag that will read as '1' when the command
16054 	 * has been completely written to memory.
16055 	 */
16056 	uint16_t rss_cos_lb_ctx_id;
16057 	/* rss_cos_lb_ctx_id is 16 b */
16058 	uint8_t unused_0;
16059 	uint8_t unused_1;
16060 	uint8_t unused_2;
16061 	uint8_t unused_3;
16062 	uint8_t unused_4;
16063 	uint8_t valid;
16064 	/*
16065 	 * This field is used in Output records to indicate that the output is
16066 	 * completely written to RAM. This field should be read as '1' to
16067 	 * indicate that the output has been completely written. When writing a
16068 	 * command completion or response to an internal processor, the order of
16069 	 * writes has to be such that this field is written last.
16070 	 */
16071 } __attribute__((packed));
16072 
16073 /* hwrm_vnic_rss_cos_lb_ctx_free */
16074 /* Description: This function can be used to free COS/Load Balance context. */
16075 /* Input (24 bytes) */
16076 
16077 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
16078 	uint16_t req_type;
16079 	/*
16080 	 * This value indicates what type of request this is. The format for the
16081 	 * rest of the command is determined by this field.
16082 	 */
16083 	uint16_t cmpl_ring;
16084 	/*
16085 	 * This value indicates the what completion ring the request will be
16086 	 * optionally completed on. If the value is -1, then no CR completion
16087 	 * will be generated. Any other value must be a valid CR ring_id value
16088 	 * for this function.
16089 	 */
16090 	uint16_t seq_id;
16091 	/* This value indicates the command sequence number. */
16092 	uint16_t target_id;
16093 	/*
16094 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16095 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16096 	 */
16097 	uint64_t resp_addr;
16098 	/*
16099 	 * This is the host address where the response will be written when the
16100 	 * request is complete. This area must be 16B aligned and must be
16101 	 * cleared to zero before the request is made.
16102 	 */
16103 	uint16_t rss_cos_lb_ctx_id;
16104 	/* rss_cos_lb_ctx_id is 16 b */
16105 	uint16_t unused_0[3];
16106 } __attribute__((packed));
16107 
16108 /* Output (16 bytes) */
16109 
16110 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
16111 	uint16_t error_code;
16112 	/*
16113 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16114 	 * and fail the call with an error when appropriate
16115 	 */
16116 	uint16_t req_type;
16117 	/* This field returns the type of original request. */
16118 	uint16_t seq_id;
16119 	/* This field provides original sequence number of the command. */
16120 	uint16_t resp_len;
16121 	/*
16122 	 * This field is the length of the response in bytes. The last byte of
16123 	 * the response is a valid flag that will read as '1' when the command
16124 	 * has been completely written to memory.
16125 	 */
16126 	uint32_t unused_0;
16127 	uint8_t unused_1;
16128 	uint8_t unused_2;
16129 	uint8_t unused_3;
16130 	uint8_t valid;
16131 	/*
16132 	 * This field is used in Output records to indicate that the output is
16133 	 * completely written to RAM. This field should be read as '1' to
16134 	 * indicate that the output has been completely written. When writing a
16135 	 * command completion or response to an internal processor, the order of
16136 	 * writes has to be such that this field is written last.
16137 	 */
16138 } __attribute__((packed));
16139 
16140 /* hwrm_ring_alloc */
16141 /*
16142  * Description: This command allocates and does basic preparation for a ring.
16143  */
16144 /* Input (80 bytes) */
16145 
16146 struct hwrm_ring_alloc_input {
16147 	uint16_t req_type;
16148 	/*
16149 	 * This value indicates what type of request this is. The format for the
16150 	 * rest of the command is determined by this field.
16151 	 */
16152 	uint16_t cmpl_ring;
16153 	/*
16154 	 * This value indicates the what completion ring the request will be
16155 	 * optionally completed on. If the value is -1, then no CR completion
16156 	 * will be generated. Any other value must be a valid CR ring_id value
16157 	 * for this function.
16158 	 */
16159 	uint16_t seq_id;
16160 	/* This value indicates the command sequence number. */
16161 	uint16_t target_id;
16162 	/*
16163 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16164 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16165 	 */
16166 	uint64_t resp_addr;
16167 	/*
16168 	 * This is the host address where the response will be written when the
16169 	 * request is complete. This area must be 16B aligned and must be
16170 	 * cleared to zero before the request is made.
16171 	 */
16172 	uint32_t enables;
16173 	/* This bit must be '1' for the Reserved1 field to be configured. */
16174 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED1		UINT32_C(0x1)
16175 	/* This bit must be '1' for the ring_arb_cfg field to be configured. */
16176 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG	UINT32_C(0x2)
16177 	/* This bit must be '1' for the Reserved3 field to be configured. */
16178 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED3		UINT32_C(0x4)
16179 	/*
16180 	 * This bit must be '1' for the stat_ctx_id_valid field to be
16181 	 * configured.
16182 	 */
16183 	#define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID	UINT32_C(0x8)
16184 	/* This bit must be '1' for the Reserved4 field to be configured. */
16185 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED4		UINT32_C(0x10)
16186 	/* This bit must be '1' for the max_bw_valid field to be configured. */
16187 	#define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID	UINT32_C(0x20)
16188 	uint8_t ring_type;
16189 	/* Ring Type. */
16190 	/* L2 Completion Ring (CR) */
16191 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL	UINT32_C(0x0)
16192 	/* TX Ring (TR) */
16193 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX		UINT32_C(0x1)
16194 	/* RX Ring (RR) */
16195 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX		UINT32_C(0x2)
16196 	/* RoCE Notification Completion Ring (ROCE_CR) */
16197 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL	UINT32_C(0x3)
16198 	uint8_t unused_0;
16199 	uint16_t unused_1;
16200 	uint64_t page_tbl_addr;
16201 	/* This value is a pointer to the page table for the Ring. */
16202 	uint32_t fbo;
16203 	/* First Byte Offset of the first entry in the first page. */
16204 	uint8_t page_size;
16205 	/*
16206 	 * Actual page size in 2^page_size. The supported range is increments in
16207 	 * powers of 2 from 16 bytes to 1GB. - 4 = 16 B Page size is 16 B. - 12
16208 	 * = 4 KB Page size is 4 KB. - 13 = 8 KB Page size is 8 KB. - 16 = 64 KB
16209 	 * Page size is 64 KB. - 21 = 2 MB Page size is 2 MB. - 22 = 4 MB Page
16210 	 * size is 4 MB. - 30 = 1 GB Page size is 1 GB.
16211 	 */
16212 	uint8_t page_tbl_depth;
16213 	/*
16214 	 * This value indicates the depth of page table. For this version of the
16215 	 * specification, value other than 0 or 1 shall be considered as an
16216 	 * invalid value. When the page_tbl_depth = 0, then it is treated as a
16217 	 * special case with the following. 1. FBO and page size fields are not
16218 	 * valid. 2. page_tbl_addr is the physical address of the first element
16219 	 * of the ring.
16220 	 */
16221 	uint8_t unused_2;
16222 	uint8_t unused_3;
16223 	uint32_t length;
16224 	/*
16225 	 * Number of 16B units in the ring. Minimum size for a ring is 16 16B
16226 	 * entries.
16227 	 */
16228 	uint16_t logical_id;
16229 	/*
16230 	 * Logical ring number for the ring to be allocated. This value
16231 	 * determines the position in the doorbell area where the update to the
16232 	 * ring will be made. For completion rings, this value is also the MSI-X
16233 	 * vector number for the function the completion ring is associated
16234 	 * with.
16235 	 */
16236 	uint16_t cmpl_ring_id;
16237 	/*
16238 	 * This field is used only when ring_type is a TX ring. This value
16239 	 * indicates what completion ring the TX ring is associated with.
16240 	 */
16241 	uint16_t queue_id;
16242 	/*
16243 	 * This field is used only when ring_type is a TX ring. This value
16244 	 * indicates what CoS queue the TX ring is associated with.
16245 	 */
16246 	uint8_t unused_4;
16247 	uint8_t unused_5;
16248 	uint32_t reserved1;
16249 	/* This field is reserved for the future use. It shall be set to 0. */
16250 	uint16_t ring_arb_cfg;
16251 	/*
16252 	 * This field is used only when ring_type is a TX ring. This field is
16253 	 * used to configure arbitration related parameters for a TX ring.
16254 	 */
16255 	/* Arbitration policy used for the ring. */
16256 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK UINT32_C(0xf)
16257 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT  0
16258 	/*
16259 	 * Use strict priority for the TX ring. Priority value is
16260 	 * specified in arb_policy_param
16261 	 */
16262 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP  (UINT32_C(0x1) << 0)
16263 	/*
16264 	 * Use weighted fair queue arbitration for the TX ring. Weight
16265 	 * is specified in arb_policy_param
16266 	 */
16267 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ (UINT32_C(0x2) << 0)
16268 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST	HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
16269 	/* Reserved field. */
16270 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK	UINT32_C(0xf0)
16271 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT	4
16272 	/*
16273 	 * Arbitration policy specific parameter. # For strict priority
16274 	 * arbitration policy, this field represents a priority value. If set to
16275 	 * 0, then the priority is not specified and the HWRM is allowed to
16276 	 * select any priority for this TX ring. # For weighted fair queue
16277 	 * arbitration policy, this field represents a weight value. If set to
16278 	 * 0, then the weight is not specified and the HWRM is allowed to select
16279 	 * any weight for this TX ring.
16280 	 */
16281 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK UINT32_C(0xff00)
16282 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
16283 	uint8_t unused_6;
16284 	uint8_t unused_7;
16285 	uint32_t reserved3;
16286 	/* This field is reserved for the future use. It shall be set to 0. */
16287 	uint32_t stat_ctx_id;
16288 	/*
16289 	 * This field is used only when ring_type is a TX ring. This input
16290 	 * indicates what statistics context this ring should be associated
16291 	 * with.
16292 	 */
16293 	uint32_t reserved4;
16294 	/* This field is reserved for the future use. It shall be set to 0. */
16295 	uint32_t max_bw;
16296 	/*
16297 	 * This field is used only when ring_type is a TX ring to specify
16298 	 * maximum BW allocated to the TX ring. The HWRM will translate this
16299 	 * value into byte counter and time interval used for this ring inside
16300 	 * the device.
16301 	 */
16302 	/* The bandwidth value. */
16303 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK	UINT32_C(0xfffffff)
16304 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT	0
16305 	/* The granularity of the value (bits or bytes). */
16306 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE		UINT32_C(0x10000000)
16307 	/* Value is in bits. */
16308 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS	(UINT32_C(0x0) << 28)
16309 	/* Value is in bytes. */
16310 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES	(UINT32_C(0x1) << 28)
16311 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST	HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
16312 	/* bw_value_unit is 3 b */
16313 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16314 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
16315 	/* Value is in Mb or MB (base 10). */
16316 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA   (UINT32_C(0x0) << 29)
16317 	/* Value is in Kb or KB (base 10). */
16318 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO   (UINT32_C(0x2) << 29)
16319 	/* Value is in bits or bytes. */
16320 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE   (UINT32_C(0x4) << 29)
16321 	/* Value is in Gb or GB (base 10). */
16322 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA   (UINT32_C(0x6) << 29)
16323 	/* Value is in 1/100th of a percentage of total bandwidth. */
16324 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
16325 	/* Invalid unit */
16326 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
16327 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
16328 	uint8_t int_mode;
16329 	/*
16330 	 * This field is used only when ring_type is a Completion ring. This
16331 	 * value indicates what interrupt mode should be used on this completion
16332 	 * ring. Note: In the legacy interrupt mode, no more than 16 completion
16333 	 * rings are allowed.
16334 	 */
16335 	/* Legacy INTA */
16336 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY		UINT32_C(0x0)
16337 	/* Reserved */
16338 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD		UINT32_C(0x1)
16339 	/* MSI-X */
16340 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX		UINT32_C(0x2)
16341 	/* No Interrupt - Polled mode */
16342 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL		UINT32_C(0x3)
16343 	uint8_t unused_8[3];
16344 } __attribute__((packed));
16345 
16346 /* Output (16 bytes) */
16347 
16348 struct hwrm_ring_alloc_output {
16349 	uint16_t error_code;
16350 	/*
16351 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16352 	 * and fail the call with an error when appropriate
16353 	 */
16354 	uint16_t req_type;
16355 	/* This field returns the type of original request. */
16356 	uint16_t seq_id;
16357 	/* This field provides original sequence number of the command. */
16358 	uint16_t resp_len;
16359 	/*
16360 	 * This field is the length of the response in bytes. The last byte of
16361 	 * the response is a valid flag that will read as '1' when the command
16362 	 * has been completely written to memory.
16363 	 */
16364 	uint16_t ring_id;
16365 	/*
16366 	 * Physical number of ring allocated. This value shall be unique for a
16367 	 * ring type.
16368 	 */
16369 	uint16_t logical_ring_id;
16370 	/* Logical number of ring allocated. */
16371 	uint8_t unused_0;
16372 	uint8_t unused_1;
16373 	uint8_t unused_2;
16374 	uint8_t valid;
16375 	/*
16376 	 * This field is used in Output records to indicate that the output is
16377 	 * completely written to RAM. This field should be read as '1' to
16378 	 * indicate that the output has been completely written. When writing a
16379 	 * command completion or response to an internal processor, the order of
16380 	 * writes has to be such that this field is written last.
16381 	 */
16382 } __attribute__((packed));
16383 
16384 /* hwrm_ring_free */
16385 /*
16386  * Description: This command is used to free a ring and associated resources.
16387  * With QoS and DCBx agents, it is possible the traffic classes will be moved
16388  * from one CoS queue to another. When this occurs, the driver shall call
16389  * 'hwrm_ring_free' to free the allocated rings and then call 'hwrm_ring_alloc'
16390  * to re-allocate each ring and assign it to a new CoS queue. hwrm_ring_free
16391  * shall be called on a ring only after it has been idle for 500ms or more and
16392  * no frames have been posted to the ring during this time. All frames queued
16393  * for transmission shall be completed and at least 500ms time elapsed from the
16394  * last completion before calling this command.
16395  */
16396 /* Input (24 bytes) */
16397 
16398 struct hwrm_ring_free_input {
16399 	uint16_t req_type;
16400 	/*
16401 	 * This value indicates what type of request this is. The format for the
16402 	 * rest of the command is determined by this field.
16403 	 */
16404 	uint16_t cmpl_ring;
16405 	/*
16406 	 * This value indicates the what completion ring the request will be
16407 	 * optionally completed on. If the value is -1, then no CR completion
16408 	 * will be generated. Any other value must be a valid CR ring_id value
16409 	 * for this function.
16410 	 */
16411 	uint16_t seq_id;
16412 	/* This value indicates the command sequence number. */
16413 	uint16_t target_id;
16414 	/*
16415 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16416 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16417 	 */
16418 	uint64_t resp_addr;
16419 	/*
16420 	 * This is the host address where the response will be written when the
16421 	 * request is complete. This area must be 16B aligned and must be
16422 	 * cleared to zero before the request is made.
16423 	 */
16424 	uint8_t ring_type;
16425 	/* Ring Type. */
16426 	/* L2 Completion Ring (CR) */
16427 	#define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL		UINT32_C(0x0)
16428 	/* TX Ring (TR) */
16429 	#define HWRM_RING_FREE_INPUT_RING_TYPE_TX		UINT32_C(0x1)
16430 	/* RX Ring (RR) */
16431 	#define HWRM_RING_FREE_INPUT_RING_TYPE_RX		UINT32_C(0x2)
16432 	/* RoCE Notification Completion Ring (ROCE_CR) */
16433 	#define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL	UINT32_C(0x3)
16434 	uint8_t unused_0;
16435 	uint16_t ring_id;
16436 	/* Physical number of ring allocated. */
16437 	uint32_t unused_1;
16438 } __attribute__((packed));
16439 
16440 /* Output (16 bytes) */
16441 
16442 struct hwrm_ring_free_output {
16443 	uint16_t error_code;
16444 	/*
16445 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16446 	 * and fail the call with an error when appropriate
16447 	 */
16448 	uint16_t req_type;
16449 	/* This field returns the type of original request. */
16450 	uint16_t seq_id;
16451 	/* This field provides original sequence number of the command. */
16452 	uint16_t resp_len;
16453 	/*
16454 	 * This field is the length of the response in bytes. The last byte of
16455 	 * the response is a valid flag that will read as '1' when the command
16456 	 * has been completely written to memory.
16457 	 */
16458 	uint32_t unused_0;
16459 	uint8_t unused_1;
16460 	uint8_t unused_2;
16461 	uint8_t unused_3;
16462 	uint8_t valid;
16463 	/*
16464 	 * This field is used in Output records to indicate that the output is
16465 	 * completely written to RAM. This field should be read as '1' to
16466 	 * indicate that the output has been completely written. When writing a
16467 	 * command completion or response to an internal processor, the order of
16468 	 * writes has to be such that this field is written last.
16469 	 */
16470 } __attribute__((packed));
16471 
16472 /* hwrm_ring_cmpl_ring_qaggint_params */
16473 /*
16474  * Description: This command is used to query aggregation and interrupt related
16475  * parameters specified on a given completion ring.
16476  */
16477 /* Input (24 bytes) */
16478 
16479 struct hwrm_ring_cmpl_ring_qaggint_params_input {
16480 	uint16_t req_type;
16481 	/*
16482 	 * This value indicates what type of request this is. The format for the
16483 	 * rest of the command is determined by this field.
16484 	 */
16485 	uint16_t cmpl_ring;
16486 	/*
16487 	 * This value indicates the what completion ring the request will be
16488 	 * optionally completed on. If the value is -1, then no CR completion
16489 	 * will be generated. Any other value must be a valid CR ring_id value
16490 	 * for this function.
16491 	 */
16492 	uint16_t seq_id;
16493 	/* This value indicates the command sequence number. */
16494 	uint16_t target_id;
16495 	/*
16496 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16497 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16498 	 */
16499 	uint64_t resp_addr;
16500 	/*
16501 	 * This is the host address where the response will be written when the
16502 	 * request is complete. This area must be 16B aligned and must be
16503 	 * cleared to zero before the request is made.
16504 	 */
16505 	uint16_t ring_id;
16506 	/* Physical number of completion ring. */
16507 	uint16_t unused_0[3];
16508 } __attribute__((packed));
16509 
16510 /* Output (32 bytes) */
16511 
16512 struct hwrm_ring_cmpl_ring_qaggint_params_output {
16513 	uint16_t error_code;
16514 	/*
16515 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16516 	 * and fail the call with an error when appropriate
16517 	 */
16518 	uint16_t req_type;
16519 	/* This field returns the type of original request. */
16520 	uint16_t seq_id;
16521 	/* This field provides original sequence number of the command. */
16522 	uint16_t resp_len;
16523 	/*
16524 	 * This field is the length of the response in bytes. The last byte of
16525 	 * the response is a valid flag that will read as '1' when the command
16526 	 * has been completely written to memory.
16527 	 */
16528 	uint16_t flags;
16529 	/*
16530 	 * When this bit is set to '1', interrupt max timer is reset whenever a
16531 	 * completion is received.
16532 	 */
16533 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET UINT32_C(0x1)
16534 	/*
16535 	 * When this bit is set to '1', ring idle mode aggregation will be
16536 	 * enabled.
16537 	 */
16538 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE UINT32_C(0x2)
16539 	uint16_t num_cmpl_dma_aggr;
16540 	/* Number of completions to aggregate before DMA during the normal mode. */
16541 	uint16_t num_cmpl_dma_aggr_during_int;
16542 	/*
16543 	 * Number of completions to aggregate before DMA during the interrupt
16544 	 * mode.
16545 	 */
16546 	uint16_t cmpl_aggr_dma_tmr;
16547 	/*
16548 	 * Timer in unit of 80-nsec used to aggregate completions before DMA
16549 	 * during the normal mode (not in interrupt mode).
16550 	 */
16551 	uint16_t cmpl_aggr_dma_tmr_during_int;
16552 	/*
16553 	 * Timer in unit of 80-nsec used to aggregate completions before DMA
16554 	 * during the interrupt mode.
16555 	 */
16556 	uint16_t int_lat_tmr_min;
16557 	/* Minimum time (in unit of 80-nsec) between two interrupts. */
16558 	uint16_t int_lat_tmr_max;
16559 	/*
16560 	 * Maximum wait time (in unit of 80-nsec) spent aggregating completions
16561 	 * before signaling the interrupt after the interrupt is enabled.
16562 	 */
16563 	uint16_t num_cmpl_aggr_int;
16564 	/*
16565 	 * Minimum number of completions aggregated before signaling an
16566 	 * interrupt.
16567 	 */
16568 	uint32_t unused_0;
16569 	uint8_t unused_1;
16570 	uint8_t unused_2;
16571 	uint8_t unused_3;
16572 	uint8_t valid;
16573 	/*
16574 	 * This field is used in Output records to indicate that the output is
16575 	 * completely written to RAM. This field should be read as '1' to
16576 	 * indicate that the output has been completely written. When writing a
16577 	 * command completion or response to an internal processor, the order of
16578 	 * writes has to be such that this field is written last.
16579 	 */
16580 } __attribute__((packed));
16581 
16582 /* hwrm_ring_cmpl_ring_cfg_aggint_params */
16583 /*
16584  * Description: This command is used to configure aggregation and interrupt
16585  * related parameters specified on a given completion ring.
16586  */
16587 /* Input (40 bytes) */
16588 
16589 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
16590 	uint16_t req_type;
16591 	/*
16592 	 * This value indicates what type of request this is. The format for the
16593 	 * rest of the command is determined by this field.
16594 	 */
16595 	uint16_t cmpl_ring;
16596 	/*
16597 	 * This value indicates the what completion ring the request will be
16598 	 * optionally completed on. If the value is -1, then no CR completion
16599 	 * will be generated. Any other value must be a valid CR ring_id value
16600 	 * for this function.
16601 	 */
16602 	uint16_t seq_id;
16603 	/* This value indicates the command sequence number. */
16604 	uint16_t target_id;
16605 	/*
16606 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16607 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16608 	 */
16609 	uint64_t resp_addr;
16610 	/*
16611 	 * This is the host address where the response will be written when the
16612 	 * request is complete. This area must be 16B aligned and must be
16613 	 * cleared to zero before the request is made.
16614 	 */
16615 	uint16_t ring_id;
16616 	/* Physical number of completion ring. */
16617 	uint16_t flags;
16618 	/*
16619 	 * When this bit is set to '1', interrupt latency max timer is reset
16620 	 * whenever a completion is received.
16621 	 */
16622 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET UINT32_C(0x1)
16623 	/*
16624 	 * When this bit is set to '1', ring idle mode aggregation will be
16625 	 * enabled.
16626 	 */
16627 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE UINT32_C(0x2)
16628 	uint16_t num_cmpl_dma_aggr;
16629 	/* Number of completions to aggregate before DMA during the normal mode. */
16630 	uint16_t num_cmpl_dma_aggr_during_int;
16631 	/*
16632 	 * Number of completions to aggregate before DMA during the interrupt
16633 	 * mode.
16634 	 */
16635 	uint16_t cmpl_aggr_dma_tmr;
16636 	/*
16637 	 * Timer in unit of 80-nsec used to aggregate completions before DMA
16638 	 * during the normal mode (not in interrupt mode).
16639 	 */
16640 	uint16_t cmpl_aggr_dma_tmr_during_int;
16641 	/*
16642 	 * Timer in unit of 80-nsec used to aggregate completions before DMA
16643 	 * during the interrupt mode.
16644 	 */
16645 	uint16_t int_lat_tmr_min;
16646 	/* Minimum time (in unit of 80-nsec) between two interrupts. */
16647 	uint16_t int_lat_tmr_max;
16648 	/*
16649 	 * Maximum wait time (in unit of 80-nsec) spent aggregating cmpls before
16650 	 * signaling the interrupt after the interrupt is enabled.
16651 	 */
16652 	uint16_t num_cmpl_aggr_int;
16653 	/*
16654 	 * Minimum number of completions aggregated before signaling an
16655 	 * interrupt.
16656 	 */
16657 	uint16_t unused_0[3];
16658 } __attribute__((packed));
16659 
16660 /* Output (16 bytes) */
16661 
16662 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
16663 	uint16_t error_code;
16664 	/*
16665 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16666 	 * and fail the call with an error when appropriate
16667 	 */
16668 	uint16_t req_type;
16669 	/* This field returns the type of original request. */
16670 	uint16_t seq_id;
16671 	/* This field provides original sequence number of the command. */
16672 	uint16_t resp_len;
16673 	/*
16674 	 * This field is the length of the response in bytes. The last byte of
16675 	 * the response is a valid flag that will read as '1' when the command
16676 	 * has been completely written to memory.
16677 	 */
16678 	uint32_t unused_0;
16679 	uint8_t unused_1;
16680 	uint8_t unused_2;
16681 	uint8_t unused_3;
16682 	uint8_t valid;
16683 	/*
16684 	 * This field is used in Output records to indicate that the output is
16685 	 * completely written to RAM. This field should be read as '1' to
16686 	 * indicate that the output has been completely written. When writing a
16687 	 * command completion or response to an internal processor, the order of
16688 	 * writes has to be such that this field is written last.
16689 	 */
16690 } __attribute__((packed));
16691 
16692 /* hwrm_ring_reset */
16693 /*
16694  * Description: This command is used to reset a given ring. When an RX ring is
16695  * being reset, the HWRM shall perform TPA flush on all VNICs associated with
16696  * the RX ring that is being reset.
16697  */
16698 /* Input (24 bytes) */
16699 
16700 struct hwrm_ring_reset_input {
16701 	uint16_t req_type;
16702 	/*
16703 	 * This value indicates what type of request this is. The format for the
16704 	 * rest of the command is determined by this field.
16705 	 */
16706 	uint16_t cmpl_ring;
16707 	/*
16708 	 * This value indicates the what completion ring the request will be
16709 	 * optionally completed on. If the value is -1, then no CR completion
16710 	 * will be generated. Any other value must be a valid CR ring_id value
16711 	 * for this function.
16712 	 */
16713 	uint16_t seq_id;
16714 	/* This value indicates the command sequence number. */
16715 	uint16_t target_id;
16716 	/*
16717 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16718 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16719 	 */
16720 	uint64_t resp_addr;
16721 	/*
16722 	 * This is the host address where the response will be written when the
16723 	 * request is complete. This area must be 16B aligned and must be
16724 	 * cleared to zero before the request is made.
16725 	 */
16726 	uint8_t ring_type;
16727 	/* Ring Type. */
16728 	/* L2 Completion Ring (CR) */
16729 	#define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL	UINT32_C(0x0)
16730 	/* TX Ring (TR) */
16731 	#define HWRM_RING_RESET_INPUT_RING_TYPE_TX		UINT32_C(0x1)
16732 	/* RX Ring (RR) */
16733 	#define HWRM_RING_RESET_INPUT_RING_TYPE_RX		UINT32_C(0x2)
16734 	/* RoCE Notification Completion Ring (ROCE_CR) */
16735 	#define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL	UINT32_C(0x3)
16736 	uint8_t unused_0;
16737 	uint16_t ring_id;
16738 	/* Physical number of the ring. */
16739 	uint32_t unused_1;
16740 } __attribute__((packed));
16741 
16742 /* Output (16 bytes) */
16743 
16744 struct hwrm_ring_reset_output {
16745 	uint16_t error_code;
16746 	/*
16747 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16748 	 * and fail the call with an error when appropriate
16749 	 */
16750 	uint16_t req_type;
16751 	/* This field returns the type of original request. */
16752 	uint16_t seq_id;
16753 	/* This field provides original sequence number of the command. */
16754 	uint16_t resp_len;
16755 	/*
16756 	 * This field is the length of the response in bytes. The last byte of
16757 	 * the response is a valid flag that will read as '1' when the command
16758 	 * has been completely written to memory.
16759 	 */
16760 	uint32_t unused_0;
16761 	uint8_t unused_1;
16762 	uint8_t unused_2;
16763 	uint8_t unused_3;
16764 	uint8_t valid;
16765 	/*
16766 	 * This field is used in Output records to indicate that the output is
16767 	 * completely written to RAM. This field should be read as '1' to
16768 	 * indicate that the output has been completely written. When writing a
16769 	 * command completion or response to an internal processor, the order of
16770 	 * writes has to be such that this field is written last.
16771 	 */
16772 } __attribute__((packed));
16773 
16774 /* hwrm_ring_grp_alloc */
16775 /*
16776  * Description: This API allocates and does basic preparation for a ring group.
16777  */
16778 /* Input (24 bytes) */
16779 
16780 struct hwrm_ring_grp_alloc_input {
16781 	uint16_t req_type;
16782 	/*
16783 	 * This value indicates what type of request this is. The format for the
16784 	 * rest of the command is determined by this field.
16785 	 */
16786 	uint16_t cmpl_ring;
16787 	/*
16788 	 * This value indicates the what completion ring the request will be
16789 	 * optionally completed on. If the value is -1, then no CR completion
16790 	 * will be generated. Any other value must be a valid CR ring_id value
16791 	 * for this function.
16792 	 */
16793 	uint16_t seq_id;
16794 	/* This value indicates the command sequence number. */
16795 	uint16_t target_id;
16796 	/*
16797 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16798 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16799 	 */
16800 	uint64_t resp_addr;
16801 	/*
16802 	 * This is the host address where the response will be written when the
16803 	 * request is complete. This area must be 16B aligned and must be
16804 	 * cleared to zero before the request is made.
16805 	 */
16806 	uint16_t cr;
16807 	/* This value identifies the CR associated with the ring group. */
16808 	uint16_t rr;
16809 	/* This value identifies the main RR associated with the ring group. */
16810 	uint16_t ar;
16811 	/*
16812 	 * This value identifies the aggregation RR associated with the ring
16813 	 * group. If this value is 0xFF... (All Fs), then no Aggregation ring
16814 	 * will be set.
16815 	 */
16816 	uint16_t sc;
16817 	/*
16818 	 * This value identifies the statistics context associated with the ring
16819 	 * group.
16820 	 */
16821 } __attribute__((packed));
16822 
16823 /* Output (16 bytes) */
16824 
16825 struct hwrm_ring_grp_alloc_output {
16826 	uint16_t error_code;
16827 	/*
16828 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16829 	 * and fail the call with an error when appropriate
16830 	 */
16831 	uint16_t req_type;
16832 	/* This field returns the type of original request. */
16833 	uint16_t seq_id;
16834 	/* This field provides original sequence number of the command. */
16835 	uint16_t resp_len;
16836 	/*
16837 	 * This field is the length of the response in bytes. The last byte of
16838 	 * the response is a valid flag that will read as '1' when the command
16839 	 * has been completely written to memory.
16840 	 */
16841 	uint32_t ring_group_id;
16842 	/*
16843 	 * This is the ring group ID value. Use this value to program the
16844 	 * default ring group for the VNIC or as table entries in an RSS/COS
16845 	 * context.
16846 	 */
16847 	uint8_t unused_0;
16848 	uint8_t unused_1;
16849 	uint8_t unused_2;
16850 	uint8_t valid;
16851 	/*
16852 	 * This field is used in Output records to indicate that the output is
16853 	 * completely written to RAM. This field should be read as '1' to
16854 	 * indicate that the output has been completely written. When writing a
16855 	 * command completion or response to an internal processor, the order of
16856 	 * writes has to be such that this field is written last.
16857 	 */
16858 } __attribute__((packed));
16859 
16860 /* hwrm_ring_grp_free */
16861 /*
16862  * Description: This API frees a ring group and associated resources. # If a
16863  * ring in the ring group is reset or free, then the associated rings in the
16864  * ring group shall also be reset/free using hwrm_ring_free. # A function driver
16865  * shall always use hwrm_ring_grp_free after freeing all rings in a group. # As
16866  * a part of executing this command, the HWRM shall reset all associated ring
16867  * group resources.
16868  */
16869 /* Input (24 bytes) */
16870 
16871 struct hwrm_ring_grp_free_input {
16872 	uint16_t req_type;
16873 	/*
16874 	 * This value indicates what type of request this is. The format for the
16875 	 * rest of the command is determined by this field.
16876 	 */
16877 	uint16_t cmpl_ring;
16878 	/*
16879 	 * This value indicates the what completion ring the request will be
16880 	 * optionally completed on. If the value is -1, then no CR completion
16881 	 * will be generated. Any other value must be a valid CR ring_id value
16882 	 * for this function.
16883 	 */
16884 	uint16_t seq_id;
16885 	/* This value indicates the command sequence number. */
16886 	uint16_t target_id;
16887 	/*
16888 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
16889 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
16890 	 */
16891 	uint64_t resp_addr;
16892 	/*
16893 	 * This is the host address where the response will be written when the
16894 	 * request is complete. This area must be 16B aligned and must be
16895 	 * cleared to zero before the request is made.
16896 	 */
16897 	uint32_t ring_group_id;
16898 	/* This is the ring group ID value. */
16899 	uint32_t unused_0;
16900 } __attribute__((packed));
16901 
16902 /* Output (16 bytes) */
16903 
16904 struct hwrm_ring_grp_free_output {
16905 	uint16_t error_code;
16906 	/*
16907 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
16908 	 * and fail the call with an error when appropriate
16909 	 */
16910 	uint16_t req_type;
16911 	/* This field returns the type of original request. */
16912 	uint16_t seq_id;
16913 	/* This field provides original sequence number of the command. */
16914 	uint16_t resp_len;
16915 	/*
16916 	 * This field is the length of the response in bytes. The last byte of
16917 	 * the response is a valid flag that will read as '1' when the command
16918 	 * has been completely written to memory.
16919 	 */
16920 	uint32_t unused_0;
16921 	uint8_t unused_1;
16922 	uint8_t unused_2;
16923 	uint8_t unused_3;
16924 	uint8_t valid;
16925 	/*
16926 	 * This field is used in Output records to indicate that the output is
16927 	 * completely written to RAM. This field should be read as '1' to
16928 	 * indicate that the output has been completely written. When writing a
16929 	 * command completion or response to an internal processor, the order of
16930 	 * writes has to be such that this field is written last.
16931 	 */
16932 } __attribute__((packed));
16933 
16934 /* hwrm_cfa_l2_filter_alloc */
16935 /*
16936  * Description: An L2 filter is a filter resource that is used to identify a
16937  * vnic or ring for a packet based on layer 2 fields. Layer 2 fields for
16938  * encapsulated packets include both outer L2 header and/or inner l2 header of
16939  * encapsulated packet. The L2 filter resource covers the following OS specific
16940  * L2 filters. Linux/FreeBSD (per function): # Broadcast enable/disable # List
16941  * of individual multicast filters # All multicast enable/disable filter #
16942  * Unicast filters # Promiscuous mode VMware: # Broadcast enable/disable (per
16943  * physical function) # All multicast enable/disable (per function) # Unicast
16944  * filters per ring or vnic # Promiscuous mode per PF Windows: # Broadcast
16945  * enable/disable (per physical function) # List of individual multicast filters
16946  * (Driver needs to advertise the maximum number of filters supported) # All
16947  * multicast enable/disable per physical function # Unicast filters per vnic #
16948  * Promiscuous mode per PF Implementation notes on the use of VNIC in this
16949  * command: # By default, these filters belong to default vnic for the function.
16950  * # Once these filters are set up, only destination VNIC can be modified. # If
16951  * the destination VNIC is not specified in this command, then the HWRM shall
16952  * only create an l2 context id. HWRM Implementation notes for multicast
16953  * filters: # The hwrm_filter_alloc command can be used to set up multicast
16954  * filters (perfect match or partial match). Each individual function driver can
16955  * set up multicast filters independently. # The HWRM needs to keep track of
16956  * multicast filters set up by function drivers and maintain multicast group
16957  * replication records to enable a subset of functions to receive traffic for a
16958  * specific multicast address. # When a specific multicast filter cannot be set,
16959  * the HWRM shall return an error. In this error case, the driver should fall
16960  * back to using one general filter (rather than specific) for all multicast
16961  * traffic. # When the SR-IOV is enabled, the HWRM needs to additionally track
16962  * source knockout per multicast group record. Examples of setting unicast
16963  * filters: For a unicast MAC based filter, one can use a combination of the
16964  * fields and masks provided in this command to set up the filter. Below are
16965  * some examples: # MAC + no VLAN filter: This filter is used to identify
16966  * traffic that does not contain any VLAN tags and matches destination (or
16967  * source) MAC address. This filter can be set up by setting only l2_addr field
16968  * to be a valid field. All other fields are not valid. The following value is
16969  * set for l2_addr. l2_addr = MAC # MAC + Any VLAN filter: This filter is used
16970  * to identify traffic that carries single VLAN tag and matches (destination or
16971  * source) MAC address. This filter can be set up by setting only l2_addr and
16972  * l2_ovlan_mask fields to be valid fields. All other fields are not valid. The
16973  * following values are set for those two valid fields. l2_addr = MAC,
16974  * l2_ovlan_mask = 0xFFFF # MAC + no VLAN or VLAN ID=0: This filter is used to
16975  * identify untagged traffic that does not contain any VLAN tags or a VLAN tag
16976  * with VLAN ID = 0 and matches destination (or source) MAC address. This filter
16977  * can be set up by setting only l2_addr and l2_ovlan fields to be valid fields.
16978  * All other fields are not valid. The following value are set for l2_addr and
16979  * l2_ovlan. l2_addr = MAC, l2_ovlan = 0x0 # MAC + no VLAN or any VLAN: This
16980  * filter is used to identify traffic that contains zero or 1 VLAN tag and
16981  * matches destination (or source) MAC address. This filter can be set up by
16982  * setting only l2_addr, l2_ovlan, and l2_mask fields to be valid fields. All
16983  * other fields are not valid. The following value are set for l2_addr,
16984  * l2_ovlan, and l2_mask fields. l2_addr = MAC, l2_ovlan = 0x0, l2_ovlan_mask =
16985  * 0xFFFF # MAC + VLAN ID filter: This filter can be set up by setting only
16986  * l2_addr, l2_ovlan, and l2_ovlan_mask fields to be valid fields. All other
16987  * fields are not valid. The following values are set for those three valid
16988  * fields. l2_addr = MAC, l2_ovlan = VLAN ID, l2_ovlan_mask = 0xF000
16989  */
16990 /* Input (96 bytes) */
16991 
16992 struct hwrm_cfa_l2_filter_alloc_input {
16993 	uint16_t req_type;
16994 	/*
16995 	 * This value indicates what type of request this is. The format for the
16996 	 * rest of the command is determined by this field.
16997 	 */
16998 	uint16_t cmpl_ring;
16999 	/*
17000 	 * This value indicates the what completion ring the request will be
17001 	 * optionally completed on. If the value is -1, then no CR completion
17002 	 * will be generated. Any other value must be a valid CR ring_id value
17003 	 * for this function.
17004 	 */
17005 	uint16_t seq_id;
17006 	/* This value indicates the command sequence number. */
17007 	uint16_t target_id;
17008 	/*
17009 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17010 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17011 	 */
17012 	uint64_t resp_addr;
17013 	/*
17014 	 * This is the host address where the response will be written when the
17015 	 * request is complete. This area must be 16B aligned and must be
17016 	 * cleared to zero before the request is made.
17017 	 */
17018 	uint32_t flags;
17019 	/*
17020 	 * Enumeration denoting the RX, TX type of the resource. This
17021 	 * enumeration is used for resources that are similar for both TX and RX
17022 	 * paths of the chip.
17023 	 */
17024 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
17025 	/* tx path */
17026 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX	(UINT32_C(0x0) << 0)
17027 	/* rx path */
17028 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX	(UINT32_C(0x1) << 0)
17029 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
17030 	/*
17031 	 * Setting of this flag indicates the applicability to the loopback
17032 	 * path.
17033 	 */
17034 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x2)
17035 	/*
17036 	 * Setting of this flag indicates drop action. If this flag is not set,
17037 	 * then it should be considered accept action.
17038 	 */
17039 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP	UINT32_C(0x4)
17040 	/*
17041 	 * If this flag is set, all t_l2_* fields are invalid and they should
17042 	 * not be specified. If this flag is set, then l2_* fields refer to
17043 	 * fields of outermost L2 header.
17044 	 */
17045 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST	UINT32_C(0x8)
17046 	uint32_t enables;
17047 	/* This bit must be '1' for the l2_addr field to be configured. */
17048 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR	UINT32_C(0x1)
17049 	/* This bit must be '1' for the l2_addr_mask field to be configured. */
17050 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK UINT32_C(0x2)
17051 	/* This bit must be '1' for the l2_ovlan field to be configured. */
17052 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN	UINT32_C(0x4)
17053 	/* This bit must be '1' for the l2_ovlan_mask field to be configured. */
17054 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK UINT32_C(0x8)
17055 	/* This bit must be '1' for the l2_ivlan field to be configured. */
17056 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN	UINT32_C(0x10)
17057 	/* This bit must be '1' for the l2_ivlan_mask field to be configured. */
17058 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK UINT32_C(0x20)
17059 	/* This bit must be '1' for the t_l2_addr field to be configured. */
17060 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR   UINT32_C(0x40)
17061 	/* This bit must be '1' for the t_l2_addr_mask field to be configured. */
17062 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK UINT32_C(0x80)
17063 	/* This bit must be '1' for the t_l2_ovlan field to be configured. */
17064 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN  UINT32_C(0x100)
17065 	/* This bit must be '1' for the t_l2_ovlan_mask field to be configured. */
17066 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK UINT32_C(0x200)
17067 	/* This bit must be '1' for the t_l2_ivlan field to be configured. */
17068 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN  UINT32_C(0x400)
17069 	/* This bit must be '1' for the t_l2_ivlan_mask field to be configured. */
17070 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK UINT32_C(0x800)
17071 	/* This bit must be '1' for the src_type field to be configured. */
17072 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE	UINT32_C(0x1000)
17073 	/* This bit must be '1' for the src_id field to be configured. */
17074 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID	UINT32_C(0x2000)
17075 	/* This bit must be '1' for the tunnel_type field to be configured. */
17076 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x4000)
17077 	/* This bit must be '1' for the dst_id field to be configured. */
17078 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID	UINT32_C(0x8000)
17079 	/* This bit must be '1' for the mirror_vnic_id field to be configured. */
17080 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x10000)
17081 	uint8_t l2_addr[6];
17082 	/*
17083 	 * This value sets the match value for the L2 MAC address. Destination
17084 	 * MAC address for RX path. Source MAC address for TX path.
17085 	 */
17086 	uint8_t unused_0;
17087 	uint8_t unused_1;
17088 	uint8_t l2_addr_mask[6];
17089 	/*
17090 	 * This value sets the mask value for the L2 address. A value of 0 will
17091 	 * mask the corresponding bit from compare.
17092 	 */
17093 	uint16_t l2_ovlan;
17094 	/* This value sets VLAN ID value for outer VLAN. */
17095 	uint16_t l2_ovlan_mask;
17096 	/*
17097 	 * This value sets the mask value for the ovlan id. A value of 0 will
17098 	 * mask the corresponding bit from compare.
17099 	 */
17100 	uint16_t l2_ivlan;
17101 	/* This value sets VLAN ID value for inner VLAN. */
17102 	uint16_t l2_ivlan_mask;
17103 	/*
17104 	 * This value sets the mask value for the ivlan id. A value of 0 will
17105 	 * mask the corresponding bit from compare.
17106 	 */
17107 	uint8_t unused_2;
17108 	uint8_t unused_3;
17109 	uint8_t t_l2_addr[6];
17110 	/*
17111 	 * This value sets the match value for the tunnel L2 MAC address.
17112 	 * Destination MAC address for RX path. Source MAC address for TX path.
17113 	 */
17114 	uint8_t unused_4;
17115 	uint8_t unused_5;
17116 	uint8_t t_l2_addr_mask[6];
17117 	/*
17118 	 * This value sets the mask value for the tunnel L2 address. A value of
17119 	 * 0 will mask the corresponding bit from compare.
17120 	 */
17121 	uint16_t t_l2_ovlan;
17122 	/* This value sets VLAN ID value for tunnel outer VLAN. */
17123 	uint16_t t_l2_ovlan_mask;
17124 	/*
17125 	 * This value sets the mask value for the tunnel ovlan id. A value of 0
17126 	 * will mask the corresponding bit from compare.
17127 	 */
17128 	uint16_t t_l2_ivlan;
17129 	/* This value sets VLAN ID value for tunnel inner VLAN. */
17130 	uint16_t t_l2_ivlan_mask;
17131 	/*
17132 	 * This value sets the mask value for the tunnel ivlan id. A value of 0
17133 	 * will mask the corresponding bit from compare.
17134 	 */
17135 	uint8_t src_type;
17136 	/* This value identifies the type of source of the packet. */
17137 	/* Network port */
17138 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT	UINT32_C(0x0)
17139 	/* Physical function */
17140 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF	UINT32_C(0x1)
17141 	/* Virtual function */
17142 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF	UINT32_C(0x2)
17143 	/* Virtual NIC of a function */
17144 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC	UINT32_C(0x3)
17145 	/* Embedded processor for CFA management */
17146 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG	UINT32_C(0x4)
17147 	/* Embedded processor for OOB management */
17148 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE	UINT32_C(0x5)
17149 	/* Embedded processor for RoCE */
17150 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO	UINT32_C(0x6)
17151 	/* Embedded processor for network proxy functions */
17152 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG	UINT32_C(0x7)
17153 	uint8_t unused_6;
17154 	uint32_t src_id;
17155 	/*
17156 	 * This value is the id of the source. For a network port, it represents
17157 	 * port_id. For a physical function, it represents fid. For a virtual
17158 	 * function, it represents vf_id. For a vnic, it represents vnic_id. For
17159 	 * embedded processors, this id is not valid. Notes: 1. The function ID
17160 	 * is implied if it src_id is not provided for a src_type that is either
17161 	 */
17162 	uint8_t tunnel_type;
17163 	/* Tunnel Type. */
17164 	/* Non-tunnel */
17165 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
17166 	/* Virtual eXtensible Local Area Network (VXLAN) */
17167 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN  UINT32_C(0x1)
17168 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
17169 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE  UINT32_C(0x2)
17170 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
17171 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE  UINT32_C(0x3)
17172 	/* IP in IP */
17173 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP   UINT32_C(0x4)
17174 	/* Generic Network Virtualization Encapsulation (Geneve) */
17175 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
17176 	/* Multi-Protocol Lable Switching (MPLS) */
17177 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS   UINT32_C(0x6)
17178 	/* Stateless Transport Tunnel (STT) */
17179 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
17180 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
17181 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE  UINT32_C(0x8)
17182 	/* Any tunneled traffic */
17183 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
17184 	uint8_t unused_7;
17185 	uint16_t dst_id;
17186 	/*
17187 	 * If set, this value shall represent the Logical VNIC ID of the
17188 	 * destination VNIC for the RX path and network port id of the
17189 	 * destination port for the TX path.
17190 	 */
17191 	uint16_t mirror_vnic_id;
17192 	/* Logical VNIC ID of the VNIC where traffic is mirrored. */
17193 	uint8_t pri_hint;
17194 	/*
17195 	 * This hint is provided to help in placing the filter in the filter
17196 	 * table.
17197 	 */
17198 	/* No preference */
17199 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
17200 	/* Above the given filter */
17201 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER UINT32_C(0x1)
17202 	/* Below the given filter */
17203 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER UINT32_C(0x2)
17204 	/* As high as possible */
17205 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX	UINT32_C(0x3)
17206 	/* As low as possible */
17207 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN	UINT32_C(0x4)
17208 	uint8_t unused_8;
17209 	uint32_t unused_9;
17210 	uint64_t l2_filter_id_hint;
17211 	/*
17212 	 * This is the ID of the filter that goes along with the pri_hint. This
17213 	 * field is valid only for the following values. 1 - Above the given
17214 	 * filter 2 - Below the given filter
17215 	 */
17216 } __attribute__((packed));
17217 
17218 /* Output (24 bytes) */
17219 
17220 struct hwrm_cfa_l2_filter_alloc_output {
17221 	uint16_t error_code;
17222 	/*
17223 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17224 	 * and fail the call with an error when appropriate
17225 	 */
17226 	uint16_t req_type;
17227 	/* This field returns the type of original request. */
17228 	uint16_t seq_id;
17229 	/* This field provides original sequence number of the command. */
17230 	uint16_t resp_len;
17231 	/*
17232 	 * This field is the length of the response in bytes. The last byte of
17233 	 * the response is a valid flag that will read as '1' when the command
17234 	 * has been completely written to memory.
17235 	 */
17236 	uint64_t l2_filter_id;
17237 	/*
17238 	 * This value identifies a set of CFA data structures used for an L2
17239 	 * context.
17240 	 */
17241 	uint32_t flow_id;
17242 	/*
17243 	 * This is the ID of the flow associated with this filter. This value
17244 	 * shall be used to match and associate the flow identifier returned in
17245 	 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
17246 	 */
17247 	uint8_t unused_0;
17248 	uint8_t unused_1;
17249 	uint8_t unused_2;
17250 	uint8_t valid;
17251 	/*
17252 	 * This field is used in Output records to indicate that the output is
17253 	 * completely written to RAM. This field should be read as '1' to
17254 	 * indicate that the output has been completely written. When writing a
17255 	 * command completion or response to an internal processor, the order of
17256 	 * writes has to be such that this field is written last.
17257 	 */
17258 } __attribute__((packed));
17259 
17260 /* hwrm_cfa_l2_filter_free */
17261 /*
17262  * Description: Free a L2 filter. The HWRM shall free all associated filter
17263  * resources with the L2 filter.
17264  */
17265 /* Input (24 bytes) */
17266 
17267 struct hwrm_cfa_l2_filter_free_input {
17268 	uint16_t req_type;
17269 	/*
17270 	 * This value indicates what type of request this is. The format for the
17271 	 * rest of the command is determined by this field.
17272 	 */
17273 	uint16_t cmpl_ring;
17274 	/*
17275 	 * This value indicates the what completion ring the request will be
17276 	 * optionally completed on. If the value is -1, then no CR completion
17277 	 * will be generated. Any other value must be a valid CR ring_id value
17278 	 * for this function.
17279 	 */
17280 	uint16_t seq_id;
17281 	/* This value indicates the command sequence number. */
17282 	uint16_t target_id;
17283 	/*
17284 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17285 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17286 	 */
17287 	uint64_t resp_addr;
17288 	/*
17289 	 * This is the host address where the response will be written when the
17290 	 * request is complete. This area must be 16B aligned and must be
17291 	 * cleared to zero before the request is made.
17292 	 */
17293 	uint64_t l2_filter_id;
17294 	/*
17295 	 * This value identifies a set of CFA data structures used for an L2
17296 	 * context.
17297 	 */
17298 } __attribute__((packed));
17299 
17300 /* Output (16 bytes) */
17301 
17302 struct hwrm_cfa_l2_filter_free_output {
17303 	uint16_t error_code;
17304 	/*
17305 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17306 	 * and fail the call with an error when appropriate
17307 	 */
17308 	uint16_t req_type;
17309 	/* This field returns the type of original request. */
17310 	uint16_t seq_id;
17311 	/* This field provides original sequence number of the command. */
17312 	uint16_t resp_len;
17313 	/*
17314 	 * This field is the length of the response in bytes. The last byte of
17315 	 * the response is a valid flag that will read as '1' when the command
17316 	 * has been completely written to memory.
17317 	 */
17318 	uint32_t unused_0;
17319 	uint8_t unused_1;
17320 	uint8_t unused_2;
17321 	uint8_t unused_3;
17322 	uint8_t valid;
17323 	/*
17324 	 * This field is used in Output records to indicate that the output is
17325 	 * completely written to RAM. This field should be read as '1' to
17326 	 * indicate that the output has been completely written. When writing a
17327 	 * command completion or response to an internal processor, the order of
17328 	 * writes has to be such that this field is written last.
17329 	 */
17330 } __attribute__((packed));
17331 
17332 /* hwrm_cfa_l2_filter_cfg */
17333 /* Description: Change the configuration of an existing L2 filter */
17334 /* Input (40 bytes) */
17335 
17336 struct hwrm_cfa_l2_filter_cfg_input {
17337 	uint16_t req_type;
17338 	/*
17339 	 * This value indicates what type of request this is. The format for the
17340 	 * rest of the command is determined by this field.
17341 	 */
17342 	uint16_t cmpl_ring;
17343 	/*
17344 	 * This value indicates the what completion ring the request will be
17345 	 * optionally completed on. If the value is -1, then no CR completion
17346 	 * will be generated. Any other value must be a valid CR ring_id value
17347 	 * for this function.
17348 	 */
17349 	uint16_t seq_id;
17350 	/* This value indicates the command sequence number. */
17351 	uint16_t target_id;
17352 	/*
17353 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17354 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17355 	 */
17356 	uint64_t resp_addr;
17357 	/*
17358 	 * This is the host address where the response will be written when the
17359 	 * request is complete. This area must be 16B aligned and must be
17360 	 * cleared to zero before the request is made.
17361 	 */
17362 	uint32_t flags;
17363 	/*
17364 	 * Enumeration denoting the RX, TX type of the resource. This
17365 	 * enumeration is used for resources that are similar for both TX and RX
17366 	 * paths of the chip.
17367 	 */
17368 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH		UINT32_C(0x1)
17369 	/* tx path */
17370 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX	(UINT32_C(0x0) << 0)
17371 	/* rx path */
17372 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX	(UINT32_C(0x1) << 0)
17373 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST	HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
17374 	/*
17375 	 * Setting of this flag indicates drop action. If this flag is not set,
17376 	 * then it should be considered accept action.
17377 	 */
17378 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP		UINT32_C(0x2)
17379 	uint32_t enables;
17380 	/* This bit must be '1' for the dst_id field to be configured. */
17381 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID	UINT32_C(0x1)
17382 	/*
17383 	 * This bit must be '1' for the new_mirror_vnic_id field to be
17384 	 * configured.
17385 	 */
17386 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID UINT32_C(0x2)
17387 	uint64_t l2_filter_id;
17388 	/*
17389 	 * This value identifies a set of CFA data structures used for an L2
17390 	 * context.
17391 	 */
17392 	uint32_t dst_id;
17393 	/*
17394 	 * If set, this value shall represent the Logical VNIC ID of the
17395 	 * destination VNIC for the RX path and network port id of the
17396 	 * destination port for the TX path.
17397 	 */
17398 	uint32_t new_mirror_vnic_id;
17399 	/* New Logical VNIC ID of the VNIC where traffic is mirrored. */
17400 } __attribute__((packed));
17401 
17402 /* Output (16 bytes) */
17403 
17404 struct hwrm_cfa_l2_filter_cfg_output {
17405 	uint16_t error_code;
17406 	/*
17407 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17408 	 * and fail the call with an error when appropriate
17409 	 */
17410 	uint16_t req_type;
17411 	/* This field returns the type of original request. */
17412 	uint16_t seq_id;
17413 	/* This field provides original sequence number of the command. */
17414 	uint16_t resp_len;
17415 	/*
17416 	 * This field is the length of the response in bytes. The last byte of
17417 	 * the response is a valid flag that will read as '1' when the command
17418 	 * has been completely written to memory.
17419 	 */
17420 	uint32_t unused_0;
17421 	uint8_t unused_1;
17422 	uint8_t unused_2;
17423 	uint8_t unused_3;
17424 	uint8_t valid;
17425 	/*
17426 	 * This field is used in Output records to indicate that the output is
17427 	 * completely written to RAM. This field should be read as '1' to
17428 	 * indicate that the output has been completely written. When writing a
17429 	 * command completion or response to an internal processor, the order of
17430 	 * writes has to be such that this field is written last.
17431 	 */
17432 } __attribute__((packed));
17433 
17434 /* hwrm_cfa_l2_set_rx_mask */
17435 /* Description: This command will set rx mask of the function. */
17436 /* Input (56 bytes) */
17437 
17438 struct hwrm_cfa_l2_set_rx_mask_input {
17439 	uint16_t req_type;
17440 	/*
17441 	 * This value indicates what type of request this is. The format for the
17442 	 * rest of the command is determined by this field.
17443 	 */
17444 	uint16_t cmpl_ring;
17445 	/*
17446 	 * This value indicates the what completion ring the request will be
17447 	 * optionally completed on. If the value is -1, then no CR completion
17448 	 * will be generated. Any other value must be a valid CR ring_id value
17449 	 * for this function.
17450 	 */
17451 	uint16_t seq_id;
17452 	/* This value indicates the command sequence number. */
17453 	uint16_t target_id;
17454 	/*
17455 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17456 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17457 	 */
17458 	uint64_t resp_addr;
17459 	/*
17460 	 * This is the host address where the response will be written when the
17461 	 * request is complete. This area must be 16B aligned and must be
17462 	 * cleared to zero before the request is made.
17463 	 */
17464 	uint32_t vnic_id;
17465 	/* VNIC ID */
17466 	uint32_t mask;
17467 	/* Reserved for future use. */
17468 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_RESERVED	UINT32_C(0x1)
17469 	/*
17470 	 * When this bit is '1', the function is requested to accept multi-cast
17471 	 * packets specified by the multicast addr table.
17472 	 */
17473 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST	UINT32_C(0x2)
17474 	/*
17475 	 * When this bit is '1', the function is requested to accept all multi-
17476 	 * cast packets.
17477 	 */
17478 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST	UINT32_C(0x4)
17479 	/*
17480 	 * When this bit is '1', the function is requested to accept broadcast
17481 	 * packets.
17482 	 */
17483 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST	UINT32_C(0x8)
17484 	/*
17485 	 * When this bit is '1', the function is requested to be put in the
17486 	 * promiscuous mode. The HWRM should accept any function to set up
17487 	 * promiscuous mode. The HWRM shall follow the semantics below for the
17488 	 * promiscuous mode support. # When partitioning is not enabled on a
17489 	 * port (i.e. single PF on the port), then the PF shall be allowed to be
17490 	 * in the promiscuous mode. When the PF is in the promiscuous mode, then
17491 	 * it shall receive all host bound traffic on that port. # When
17492 	 * partitioning is enabled on a port (i.e. multiple PFs per port) and a
17493 	 * PF on that port is in the promiscuous mode, then the PF receives all
17494 	 * traffic within that partition as identified by a unique identifier
17495 	 * for the PF (e.g. S-Tag). If a unique outer VLAN for the PF is
17496 	 * specified, then the setting of promiscuous mode on that PF shall
17497 	 * result in the PF receiving all host bound traffic with matching outer
17498 	 * VLAN. # A VF shall can be set in the promiscuous mode. In the
17499 	 * promiscuous mode, the VF does not receive any traffic unless a unique
17500 	 * outer VLAN for the VF is specified. If a unique outer VLAN for the VF
17501 	 * is specified, then the setting of promiscuous mode on that VF shall
17502 	 * result in the VF receiving all host bound traffic with the matching
17503 	 * outer VLAN. # The HWRM shall allow the setting of promiscuous mode on
17504 	 * a function independently from the promiscuous mode settings on other
17505 	 * functions.
17506 	 */
17507 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS	UINT32_C(0x10)
17508 	/*
17509 	 * If this flag is set, the corresponding RX filters shall be set up to
17510 	 * cover multicast/broadcast filters for the outermost Layer 2
17511 	 * destination MAC address field.
17512 	 */
17513 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST	UINT32_C(0x20)
17514 	/*
17515 	 * If this flag is set, the corresponding RX filters shall be set up to
17516 	 * cover multicast/broadcast filters for the VLAN-tagged packets that
17517 	 * match the TPID and VID fields of VLAN tags in the VLAN tag table
17518 	 * specified in this command.
17519 	 */
17520 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY	UINT32_C(0x40)
17521 	/*
17522 	 * If this flag is set, the corresponding RX filters shall be set up to
17523 	 * cover multicast/broadcast filters for non-VLAN tagged packets and
17524 	 * VLAN-tagged packets that match the TPID and VID fields of VLAN tags
17525 	 * in the VLAN tag table specified in this command.
17526 	 */
17527 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN	UINT32_C(0x80)
17528 	/*
17529 	 * If this flag is set, the corresponding RX filters shall be set up to
17530 	 * cover multicast/broadcast filters for non-VLAN tagged packets and
17531 	 * VLAN-tagged packets matching any VLAN tag. If this flag is set, then
17532 	 * the HWRM shall ignore VLAN tags specified in vlan_tag_tbl. If none of
17533 	 * vlanonly, vlan_nonvlan, and anyvlan_nonvlan flags is set, then the
17534 	 * HWRM shall ignore VLAN tags specified in vlan_tag_tbl. The HWRM
17535 	 * client shall set at most one flag out of vlanonly, vlan_nonvlan, and
17536 	 * anyvlan_nonvlan.
17537 	 */
17538 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN UINT32_C(0x100)
17539 	uint64_t mc_tbl_addr;
17540 	/* This is the address for mcast address tbl. */
17541 	uint32_t num_mc_entries;
17542 	/*
17543 	 * This value indicates how many entries in mc_tbl are valid. Each entry
17544 	 * is 6 bytes.
17545 	 */
17546 	uint32_t unused_0;
17547 	uint64_t vlan_tag_tbl_addr;
17548 	/*
17549 	 * This is the address for VLAN tag table. Each VLAN entry in the table
17550 	 * is 4 bytes of a VLAN tag including TPID, PCP, DEI, and VID fields in
17551 	 * network byte order.
17552 	 */
17553 	uint32_t num_vlan_tags;
17554 	/*
17555 	 * This value indicates how many entries in vlan_tag_tbl are valid. Each
17556 	 * entry is 4 bytes.
17557 	 */
17558 	uint32_t unused_1;
17559 } __attribute__((packed));
17560 
17561 /* Output (16 bytes) */
17562 
17563 struct hwrm_cfa_l2_set_rx_mask_output {
17564 	uint16_t error_code;
17565 	/*
17566 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17567 	 * and fail the call with an error when appropriate
17568 	 */
17569 	uint16_t req_type;
17570 	/* This field returns the type of original request. */
17571 	uint16_t seq_id;
17572 	/* This field provides original sequence number of the command. */
17573 	uint16_t resp_len;
17574 	/*
17575 	 * This field is the length of the response in bytes. The last byte of
17576 	 * the response is a valid flag that will read as '1' when the command
17577 	 * has been completely written to memory.
17578 	 */
17579 	uint32_t unused_0;
17580 	uint8_t unused_1;
17581 	uint8_t unused_2;
17582 	uint8_t unused_3;
17583 	uint8_t valid;
17584 	/*
17585 	 * This field is used in Output records to indicate that the output is
17586 	 * completely written to RAM. This field should be read as '1' to
17587 	 * indicate that the output has been completely written. When writing a
17588 	 * command completion or response to an internal processor, the order of
17589 	 * writes has to be such that this field is written last.
17590 	 */
17591 } __attribute__((packed));
17592 
17593 /* Command specific Error Codes (8 bytes) */
17594 
17595 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
17596 	uint8_t code;
17597 	/*
17598 	 * command specific error codes that goes to the cmd_err field in Common
17599 	 * HWRM Error Response.
17600 	 */
17601 	/* Unknown error */
17602 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
17603 	/* Unable to complete operation due to conflict with Ntuple Filter */
17604 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR UINT32_C(0x1)
17605 	uint8_t unused_0[7];
17606 } __attribute__((packed));
17607 
17608 /* hwrm_cfa_vlan_antispoof_cfg */
17609 /* Description: Configures vlan anti-spoof filters for VF. */
17610 /* Input (32 bytes) */
17611 
17612 struct hwrm_cfa_vlan_antispoof_cfg_input {
17613 	uint16_t req_type;
17614 	/*
17615 	 * This value indicates what type of request this is. The format for the
17616 	 * rest of the command is determined by this field.
17617 	 */
17618 	uint16_t cmpl_ring;
17619 	/*
17620 	 * This value indicates the what completion ring the request will be
17621 	 * optionally completed on. If the value is -1, then no CR completion
17622 	 * will be generated. Any other value must be a valid CR ring_id value
17623 	 * for this function.
17624 	 */
17625 	uint16_t seq_id;
17626 	/* This value indicates the command sequence number. */
17627 	uint16_t target_id;
17628 	/*
17629 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17630 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17631 	 */
17632 	uint64_t resp_addr;
17633 	/*
17634 	 * This is the host address where the response will be written when the
17635 	 * request is complete. This area must be 16B aligned and must be
17636 	 * cleared to zero before the request is made.
17637 	 */
17638 	uint16_t fid;
17639 	/*
17640 	 * Function ID of the function that is being configured. Only valid for
17641 	 * a VF FID configured by the PF.
17642 	 */
17643 	uint8_t unused_0;
17644 	uint8_t unused_1;
17645 	uint32_t num_vlan_entries;
17646 	/* Number of VLAN entries in the vlan_tag_mask_tbl. */
17647 	uint64_t vlan_tag_mask_tbl_addr;
17648 	/*
17649 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN antispoof
17650 	 * table. Each table entry contains the 16-bit TPID (0x8100 or 0x88a8
17651 	 * only), 16-bit VLAN ID, and a 16-bit mask, all in network order to
17652 	 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry, the mask
17653 	 * value should be 0xfff for the 12-bit VLAN ID.
17654 	 */
17655 } __attribute__((packed));
17656 
17657 /* Output (16 bytes) */
17658 
17659 struct hwrm_cfa_vlan_antispoof_cfg_output {
17660 	uint16_t error_code;
17661 	/*
17662 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17663 	 * and fail the call with an error when appropriate
17664 	 */
17665 	uint16_t req_type;
17666 	/* This field returns the type of original request. */
17667 	uint16_t seq_id;
17668 	/* This field provides original sequence number of the command. */
17669 	uint16_t resp_len;
17670 	/*
17671 	 * This field is the length of the response in bytes. The last byte of
17672 	 * the response is a valid flag that will read as '1' when the command
17673 	 * has been completely written to memory.
17674 	 */
17675 	uint32_t unused_0;
17676 	uint8_t unused_1;
17677 	uint8_t unused_2;
17678 	uint8_t unused_3;
17679 	uint8_t valid;
17680 	/*
17681 	 * This field is used in Output records to indicate that the output is
17682 	 * completely written to RAM. This field should be read as '1' to
17683 	 * indicate that the output has been completely written. When writing a
17684 	 * command completion or response to an internal processor, the order of
17685 	 * writes has to be such that this field is written last.
17686 	 */
17687 } __attribute__((packed));
17688 
17689 /* hwrm_cfa_vlan_antispoof_qcfg */
17690 /*
17691  * Description: Returns the current configuration of the vlan anti-spoof filters
17692  * for VF.
17693  */
17694 /* Input (32 bytes) */
17695 
17696 struct hwrm_cfa_vlan_antispoof_qcfg_input {
17697 	uint16_t req_type;
17698 	/*
17699 	 * This value indicates what type of request this is. The format for the
17700 	 * rest of the command is determined by this field.
17701 	 */
17702 	uint16_t cmpl_ring;
17703 	/*
17704 	 * This value indicates the what completion ring the request will be
17705 	 * optionally completed on. If the value is -1, then no CR completion
17706 	 * will be generated. Any other value must be a valid CR ring_id value
17707 	 * for this function.
17708 	 */
17709 	uint16_t seq_id;
17710 	/* This value indicates the command sequence number. */
17711 	uint16_t target_id;
17712 	/*
17713 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17714 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17715 	 */
17716 	uint64_t resp_addr;
17717 	/*
17718 	 * This is the host address where the response will be written when the
17719 	 * request is complete. This area must be 16B aligned and must be
17720 	 * cleared to zero before the request is made.
17721 	 */
17722 	uint16_t fid;
17723 	/*
17724 	 * Function ID of the function that is being queried. Only valid for a
17725 	 * VF FID queried by the PF.
17726 	 */
17727 	uint8_t unused_0;
17728 	uint8_t unused_1;
17729 	uint32_t max_vlan_entries;
17730 	/*
17731 	 * Maximum number of VLAN entries the firmware is allowed to DMA to
17732 	 * vlan_tag_mask_tbl.
17733 	 */
17734 	uint64_t vlan_tag_mask_tbl_addr;
17735 	/*
17736 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN antispoof
17737 	 * table to which firmware will DMA to. Each table entry will contain
17738 	 * the 16-bit TPID (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit
17739 	 * mask, all in network order to match hwrm_cfa_l2_set_rx_mask. For an
17740 	 * individual VLAN entry, the mask value should be 0xfff for the 12-bit
17741 	 * VLAN ID.
17742 	 */
17743 } __attribute__((packed));
17744 
17745 /* Output (16 bytes) */
17746 
17747 struct hwrm_cfa_vlan_antispoof_qcfg_output {
17748 	uint16_t error_code;
17749 	/*
17750 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17751 	 * and fail the call with an error when appropriate
17752 	 */
17753 	uint16_t req_type;
17754 	/* This field returns the type of original request. */
17755 	uint16_t seq_id;
17756 	/* This field provides original sequence number of the command. */
17757 	uint16_t resp_len;
17758 	/*
17759 	 * This field is the length of the response in bytes. The last byte of
17760 	 * the response is a valid flag that will read as '1' when the command
17761 	 * has been completely written to memory.
17762 	 */
17763 	uint32_t num_vlan_entries;
17764 	/* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
17765 	uint8_t unused_0;
17766 	uint8_t unused_1;
17767 	uint8_t unused_2;
17768 	uint8_t valid;
17769 	/*
17770 	 * This field is used in Output records to indicate that the output is
17771 	 * completely written to RAM. This field should be read as '1' to
17772 	 * indicate that the output has been completely written. When writing a
17773 	 * command completion or response to an internal processor, the order of
17774 	 * writes has to be such that this field is written last.
17775 	 */
17776 } __attribute__((packed));
17777 
17778 /* hwrm_cfa_tunnel_filter_alloc */
17779 /*
17780  * Description: This is a tunnel filter that uses fields from tunnel header in
17781  * addition to l2 context. The tunnel filter applies to receive side only. The
17782  * l2_* fields in this command represent fields of inner L2 header. They are
17783  * optional to be specified. It allows l2_filter_id to be created with outer L2
17784  * header fields that can be shared with multiple tunnel filters specified as
17785  * combinations of inner L2 header fields, tunnel type, and VNI.
17786  */
17787 /* Input (88 bytes) */
17788 
17789 struct hwrm_cfa_tunnel_filter_alloc_input {
17790 	uint16_t req_type;
17791 	/*
17792 	 * This value indicates what type of request this is. The format for the
17793 	 * rest of the command is determined by this field.
17794 	 */
17795 	uint16_t cmpl_ring;
17796 	/*
17797 	 * This value indicates the what completion ring the request will be
17798 	 * optionally completed on. If the value is -1, then no CR completion
17799 	 * will be generated. Any other value must be a valid CR ring_id value
17800 	 * for this function.
17801 	 */
17802 	uint16_t seq_id;
17803 	/* This value indicates the command sequence number. */
17804 	uint16_t target_id;
17805 	/*
17806 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17807 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17808 	 */
17809 	uint64_t resp_addr;
17810 	/*
17811 	 * This is the host address where the response will be written when the
17812 	 * request is complete. This area must be 16B aligned and must be
17813 	 * cleared to zero before the request is made.
17814 	 */
17815 	uint32_t flags;
17816 	/*
17817 	 * Setting of this flag indicates the applicability to the loopback
17818 	 * path.
17819 	 */
17820 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK  UINT32_C(0x1)
17821 	uint32_t enables;
17822 	/* This bit must be '1' for the l2_filter_id field to be configured. */
17823 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
17824 	/* This bit must be '1' for the l2_addr field to be configured. */
17825 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x2)
17826 	/* This bit must be '1' for the l2_ivlan field to be configured. */
17827 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x4)
17828 	/* This bit must be '1' for the l3_addr field to be configured. */
17829 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR UINT32_C(0x8)
17830 	/* This bit must be '1' for the l3_addr_type field to be configured. */
17831 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE UINT32_C(0x10)
17832 	/* This bit must be '1' for the t_l3_addr_type field to be configured. */
17833 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE UINT32_C(0x20)
17834 	/* This bit must be '1' for the t_l3_addr field to be configured. */
17835 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR UINT32_C(0x40)
17836 	/* This bit must be '1' for the tunnel_type field to be configured. */
17837 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x80)
17838 	/* This bit must be '1' for the vni field to be configured. */
17839 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI	UINT32_C(0x100)
17840 	/* This bit must be '1' for the dst_vnic_id field to be configured. */
17841 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID UINT32_C(0x200)
17842 	/* This bit must be '1' for the mirror_vnic_id field to be configured. */
17843 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x400)
17844 	uint64_t l2_filter_id;
17845 	/*
17846 	 * This value identifies a set of CFA data structures used for an L2
17847 	 * context.
17848 	 */
17849 	uint8_t l2_addr[6];
17850 	/*
17851 	 * This value sets the match value for the inner L2 MAC address.
17852 	 * Destination MAC address for RX path. Source MAC address for TX path.
17853 	 */
17854 	uint16_t l2_ivlan;
17855 	/*
17856 	 * This value sets VLAN ID value for inner VLAN. Only 12-bits of VLAN ID
17857 	 * are used in setting the filter.
17858 	 */
17859 	uint32_t l3_addr[4];
17860 	/*
17861 	 * The value of inner destination IP address to be used in filtering.
17862 	 * For IPv4, first four bytes represent the IP address.
17863 	 */
17864 	uint32_t t_l3_addr[4];
17865 	/*
17866 	 * The value of tunnel destination IP address to be used in filtering.
17867 	 * For IPv4, first four bytes represent the IP address.
17868 	 */
17869 	uint8_t l3_addr_type;
17870 	/*
17871 	 * This value indicates the type of inner IP address. 4 - IPv4 6 - IPv6
17872 	 * All others are invalid.
17873 	 */
17874 	uint8_t t_l3_addr_type;
17875 	/*
17876 	 * This value indicates the type of tunnel IP address. 4 - IPv4 6 - IPv6
17877 	 * All others are invalid.
17878 	 */
17879 	uint8_t tunnel_type;
17880 	/* Tunnel Type. */
17881 	/* Non-tunnel */
17882 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
17883 	/* Virtual eXtensible Local Area Network (VXLAN) */
17884 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
17885 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
17886 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
17887 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
17888 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
17889 	/* IP in IP */
17890 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
17891 	/* Generic Network Virtualization Encapsulation (Geneve) */
17892 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
17893 	/* Multi-Protocol Lable Switching (MPLS) */
17894 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
17895 	/* Stateless Transport Tunnel (STT) */
17896 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
17897 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
17898 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
17899 	/* Any tunneled traffic */
17900 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
17901 	uint8_t unused_0;
17902 	uint32_t vni;
17903 	/*
17904 	 * Virtual Network Identifier (VNI). Only valid with tunnel_types VXLAN,
17905 	 * NVGRE, and Geneve. Only lower 24-bits of VNI field are used in
17906 	 * setting up the filter.
17907 	 */
17908 	uint32_t dst_vnic_id;
17909 	/* Logical VNIC ID of the destination VNIC. */
17910 	uint32_t mirror_vnic_id;
17911 	/* Logical VNIC ID of the VNIC where traffic is mirrored. */
17912 } __attribute__((packed));
17913 
17914 /* Output (24 bytes) */
17915 
17916 struct hwrm_cfa_tunnel_filter_alloc_output {
17917 	uint16_t error_code;
17918 	/*
17919 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17920 	 * and fail the call with an error when appropriate
17921 	 */
17922 	uint16_t req_type;
17923 	/* This field returns the type of original request. */
17924 	uint16_t seq_id;
17925 	/* This field provides original sequence number of the command. */
17926 	uint16_t resp_len;
17927 	/*
17928 	 * This field is the length of the response in bytes. The last byte of
17929 	 * the response is a valid flag that will read as '1' when the command
17930 	 * has been completely written to memory.
17931 	 */
17932 	uint64_t tunnel_filter_id;
17933 	/* This value is an opaque id into CFA data structures. */
17934 	uint32_t flow_id;
17935 	/*
17936 	 * This is the ID of the flow associated with this filter. This value
17937 	 * shall be used to match and associate the flow identifier returned in
17938 	 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
17939 	 */
17940 	uint8_t unused_0;
17941 	uint8_t unused_1;
17942 	uint8_t unused_2;
17943 	uint8_t valid;
17944 	/*
17945 	 * This field is used in Output records to indicate that the output is
17946 	 * completely written to RAM. This field should be read as '1' to
17947 	 * indicate that the output has been completely written. When writing a
17948 	 * command completion or response to an internal processor, the order of
17949 	 * writes has to be such that this field is written last.
17950 	 */
17951 } __attribute__((packed));
17952 
17953 /* hwrm_cfa_tunnel_filter_free */
17954 /* Description: Free a tunnel filter */
17955 /* Input (24 bytes) */
17956 
17957 struct hwrm_cfa_tunnel_filter_free_input {
17958 	uint16_t req_type;
17959 	/*
17960 	 * This value indicates what type of request this is. The format for the
17961 	 * rest of the command is determined by this field.
17962 	 */
17963 	uint16_t cmpl_ring;
17964 	/*
17965 	 * This value indicates the what completion ring the request will be
17966 	 * optionally completed on. If the value is -1, then no CR completion
17967 	 * will be generated. Any other value must be a valid CR ring_id value
17968 	 * for this function.
17969 	 */
17970 	uint16_t seq_id;
17971 	/* This value indicates the command sequence number. */
17972 	uint16_t target_id;
17973 	/*
17974 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
17975 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
17976 	 */
17977 	uint64_t resp_addr;
17978 	/*
17979 	 * This is the host address where the response will be written when the
17980 	 * request is complete. This area must be 16B aligned and must be
17981 	 * cleared to zero before the request is made.
17982 	 */
17983 	uint64_t tunnel_filter_id;
17984 	/* This value is an opaque id into CFA data structures. */
17985 } __attribute__((packed));
17986 
17987 /* Output (16 bytes) */
17988 
17989 struct hwrm_cfa_tunnel_filter_free_output {
17990 	uint16_t error_code;
17991 	/*
17992 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
17993 	 * and fail the call with an error when appropriate
17994 	 */
17995 	uint16_t req_type;
17996 	/* This field returns the type of original request. */
17997 	uint16_t seq_id;
17998 	/* This field provides original sequence number of the command. */
17999 	uint16_t resp_len;
18000 	/*
18001 	 * This field is the length of the response in bytes. The last byte of
18002 	 * the response is a valid flag that will read as '1' when the command
18003 	 * has been completely written to memory.
18004 	 */
18005 	uint32_t unused_0;
18006 	uint8_t unused_1;
18007 	uint8_t unused_2;
18008 	uint8_t unused_3;
18009 	uint8_t valid;
18010 	/*
18011 	 * This field is used in Output records to indicate that the output is
18012 	 * completely written to RAM. This field should be read as '1' to
18013 	 * indicate that the output has been completely written. When writing a
18014 	 * command completion or response to an internal processor, the order of
18015 	 * writes has to be such that this field is written last.
18016 	 */
18017 } __attribute__((packed));
18018 
18019 /* hwrm_cfa_encap_record_alloc */
18020 /*
18021  * Description: This command is used to create an encapsulation record. The
18022  * source MAC address and source IP address specified for the source property
18023  * checks shall be used in the encapsulation where applicable.
18024  */
18025 /* Input (32 bytes) */
18026 
18027 struct hwrm_cfa_encap_record_alloc_input {
18028 	uint16_t req_type;
18029 	/*
18030 	 * This value indicates what type of request this is. The format for the
18031 	 * rest of the command is determined by this field.
18032 	 */
18033 	uint16_t cmpl_ring;
18034 	/*
18035 	 * This value indicates the what completion ring the request will be
18036 	 * optionally completed on. If the value is -1, then no CR completion
18037 	 * will be generated. Any other value must be a valid CR ring_id value
18038 	 * for this function.
18039 	 */
18040 	uint16_t seq_id;
18041 	/* This value indicates the command sequence number. */
18042 	uint16_t target_id;
18043 	/*
18044 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18045 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18046 	 */
18047 	uint64_t resp_addr;
18048 	/*
18049 	 * This is the host address where the response will be written when the
18050 	 * request is complete. This area must be 16B aligned and must be
18051 	 * cleared to zero before the request is made.
18052 	 */
18053 	uint32_t flags;
18054 	/*
18055 	 * Setting of this flag indicates the applicability to the loopback
18056 	 * path.
18057 	 */
18058 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK   UINT32_C(0x1)
18059 	uint8_t encap_type;
18060 	/* Encapsulation Type. */
18061 	/* Virtual eXtensible Local Area Network (VXLAN) */
18062 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN UINT32_C(0x1)
18063 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
18064 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE UINT32_C(0x2)
18065 	/* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
18066 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE UINT32_C(0x3)
18067 	/* IP in IP */
18068 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP UINT32_C(0x4)
18069 	/* Generic Network Virtualization Encapsulation (Geneve) */
18070 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE UINT32_C(0x5)
18071 	/* Multi-Protocol Lable Switching (MPLS) */
18072 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS UINT32_C(0x6)
18073 	/* VLAN */
18074 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN UINT32_C(0x7)
18075 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
18076 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE UINT32_C(0x8)
18077 	uint8_t unused_0;
18078 	uint16_t unused_1;
18079 	uint32_t encap_data[20];
18080 	/* This value is encap data used for the given encap type. */
18081 } __attribute__((packed));
18082 
18083 /* Output (16 bytes) */
18084 
18085 struct hwrm_cfa_encap_record_alloc_output {
18086 	uint16_t error_code;
18087 	/*
18088 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18089 	 * and fail the call with an error when appropriate
18090 	 */
18091 	uint16_t req_type;
18092 	/* This field returns the type of original request. */
18093 	uint16_t seq_id;
18094 	/* This field provides original sequence number of the command. */
18095 	uint16_t resp_len;
18096 	/*
18097 	 * This field is the length of the response in bytes. The last byte of
18098 	 * the response is a valid flag that will read as '1' when the command
18099 	 * has been completely written to memory.
18100 	 */
18101 	uint32_t encap_record_id;
18102 	/* This value is an opaque id into CFA data structures. */
18103 	uint8_t unused_0;
18104 	uint8_t unused_1;
18105 	uint8_t unused_2;
18106 	uint8_t valid;
18107 	/*
18108 	 * This field is used in Output records to indicate that the output is
18109 	 * completely written to RAM. This field should be read as '1' to
18110 	 * indicate that the output has been completely written. When writing a
18111 	 * command completion or response to an internal processor, the order of
18112 	 * writes has to be such that this field is written last.
18113 	 */
18114 } __attribute__((packed));
18115 
18116 /* hwrm_cfa_encap_record_free */
18117 /* Description: Free an encap record */
18118 /* Input (24 bytes) */
18119 
18120 struct hwrm_cfa_encap_record_free_input {
18121 	uint16_t req_type;
18122 	/*
18123 	 * This value indicates what type of request this is. The format for the
18124 	 * rest of the command is determined by this field.
18125 	 */
18126 	uint16_t cmpl_ring;
18127 	/*
18128 	 * This value indicates the what completion ring the request will be
18129 	 * optionally completed on. If the value is -1, then no CR completion
18130 	 * will be generated. Any other value must be a valid CR ring_id value
18131 	 * for this function.
18132 	 */
18133 	uint16_t seq_id;
18134 	/* This value indicates the command sequence number. */
18135 	uint16_t target_id;
18136 	/*
18137 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18138 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18139 	 */
18140 	uint64_t resp_addr;
18141 	/*
18142 	 * This is the host address where the response will be written when the
18143 	 * request is complete. This area must be 16B aligned and must be
18144 	 * cleared to zero before the request is made.
18145 	 */
18146 	uint32_t encap_record_id;
18147 	/* This value is an opaque id into CFA data structures. */
18148 	uint32_t unused_0;
18149 } __attribute__((packed));
18150 
18151 /* Output (16 bytes) */
18152 
18153 struct hwrm_cfa_encap_record_free_output {
18154 	uint16_t error_code;
18155 	/*
18156 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18157 	 * and fail the call with an error when appropriate
18158 	 */
18159 	uint16_t req_type;
18160 	/* This field returns the type of original request. */
18161 	uint16_t seq_id;
18162 	/* This field provides original sequence number of the command. */
18163 	uint16_t resp_len;
18164 	/*
18165 	 * This field is the length of the response in bytes. The last byte of
18166 	 * the response is a valid flag that will read as '1' when the command
18167 	 * has been completely written to memory.
18168 	 */
18169 	uint32_t unused_0;
18170 	uint8_t unused_1;
18171 	uint8_t unused_2;
18172 	uint8_t unused_3;
18173 	uint8_t valid;
18174 	/*
18175 	 * This field is used in Output records to indicate that the output is
18176 	 * completely written to RAM. This field should be read as '1' to
18177 	 * indicate that the output has been completely written. When writing a
18178 	 * command completion or response to an internal processor, the order of
18179 	 * writes has to be such that this field is written last.
18180 	 */
18181 } __attribute__((packed));
18182 
18183 /* hwrm_cfa_ntuple_filter_alloc */
18184 /*
18185  * Description: This is a ntuple filter that uses fields from L4/L3 header and
18186  * optionally fields from L2. The ntuple filters apply to receive traffic only.
18187  * All L2/L3/L4 header fields are specified in network byte order. These filters
18188  * can be used for Receive Flow Steering (RFS). # For ethertype value, only
18189  * 0x0800 (IPv4) and 0x86dd (IPv6) shall be supported for ntuple filters. # If a
18190  * field specified in this command is not enabled as a valid field, then that
18191  * field shall not be used in matching packet header fields against this filter.
18192  */
18193 /* Input (128 bytes) */
18194 
18195 struct hwrm_cfa_ntuple_filter_alloc_input {
18196 	uint16_t req_type;
18197 	/*
18198 	 * This value indicates what type of request this is. The format for the
18199 	 * rest of the command is determined by this field.
18200 	 */
18201 	uint16_t cmpl_ring;
18202 	/*
18203 	 * This value indicates the what completion ring the request will be
18204 	 * optionally completed on. If the value is -1, then no CR completion
18205 	 * will be generated. Any other value must be a valid CR ring_id value
18206 	 * for this function.
18207 	 */
18208 	uint16_t seq_id;
18209 	/* This value indicates the command sequence number. */
18210 	uint16_t target_id;
18211 	/*
18212 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18213 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18214 	 */
18215 	uint64_t resp_addr;
18216 	/*
18217 	 * This is the host address where the response will be written when the
18218 	 * request is complete. This area must be 16B aligned and must be
18219 	 * cleared to zero before the request is made.
18220 	 */
18221 	uint32_t flags;
18222 	/*
18223 	 * Setting of this flag indicates the applicability to the loopback
18224 	 * path.
18225 	 */
18226 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK  UINT32_C(0x1)
18227 	/*
18228 	 * Setting of this flag indicates drop action. If this flag is not set,
18229 	 * then it should be considered accept action.
18230 	 */
18231 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP	UINT32_C(0x2)
18232 	/*
18233 	 * Setting of this flag indicates that a meter is expected to be
18234 	 * attached to this flow. This hint can be used when choosing the action
18235 	 * record format required for the flow.
18236 	 */
18237 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER	UINT32_C(0x4)
18238 	uint32_t enables;
18239 	/* This bit must be '1' for the l2_filter_id field to be configured. */
18240 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID UINT32_C(0x1)
18241 	/* This bit must be '1' for the ethertype field to be configured. */
18242 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x2)
18243 	/* This bit must be '1' for the tunnel_type field to be configured. */
18244 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x4)
18245 	/* This bit must be '1' for the src_macaddr field to be configured. */
18246 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x8)
18247 	/* This bit must be '1' for the ipaddr_type field to be configured. */
18248 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x10)
18249 	/* This bit must be '1' for the src_ipaddr field to be configured. */
18250 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x20)
18251 	/* This bit must be '1' for the src_ipaddr_mask field to be configured. */
18252 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK UINT32_C(0x40)
18253 	/* This bit must be '1' for the dst_ipaddr field to be configured. */
18254 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x80)
18255 	/* This bit must be '1' for the dst_ipaddr_mask field to be configured. */
18256 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK UINT32_C(0x100)
18257 	/* This bit must be '1' for the ip_protocol field to be configured. */
18258 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x200)
18259 	/* This bit must be '1' for the src_port field to be configured. */
18260 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x400)
18261 	/* This bit must be '1' for the src_port_mask field to be configured. */
18262 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK UINT32_C(0x800)
18263 	/* This bit must be '1' for the dst_port field to be configured. */
18264 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x1000)
18265 	/* This bit must be '1' for the dst_port_mask field to be configured. */
18266 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK UINT32_C(0x2000)
18267 	/* This bit must be '1' for the pri_hint field to be configured. */
18268 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT UINT32_C(0x4000)
18269 	/* This bit must be '1' for the ntuple_filter_id field to be configured. */
18270 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID UINT32_C(0x8000)
18271 	/* This bit must be '1' for the dst_id field to be configured. */
18272 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID  UINT32_C(0x10000)
18273 	/* This bit must be '1' for the mirror_vnic_id field to be configured. */
18274 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x20000)
18275 	/* This bit must be '1' for the dst_macaddr field to be configured. */
18276 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x40000)
18277 	uint64_t l2_filter_id;
18278 	/*
18279 	 * This value identifies a set of CFA data structures used for an L2
18280 	 * context.
18281 	 */
18282 	uint8_t src_macaddr[6];
18283 	/* This value indicates the source MAC address in the Ethernet header. */
18284 	uint16_t ethertype; /* big endian */
18285 	/* This value indicates the ethertype in the Ethernet header. */
18286 	uint8_t ip_addr_type;
18287 	/*
18288 	 * This value indicates the type of IP address. 4 - IPv4 6 - IPv6 All
18289 	 * others are invalid.
18290 	 */
18291 	/* invalid */
18292 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
18293 	/* IPv4 */
18294 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
18295 	/* IPv6 */
18296 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
18297 	uint8_t ip_protocol;
18298 	/*
18299 	 * The value of protocol filed in IP header. Applies to UDP and TCP
18300 	 * traffic. 6 - TCP 17 - UDP
18301 	 */
18302 	/* invalid */
18303 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
18304 	/* TCP */
18305 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
18306 	/* UDP */
18307 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
18308 	uint16_t dst_id;
18309 	/*
18310 	 * If set, this value shall represent the Logical VNIC ID of the
18311 	 * destination VNIC for the RX path and network port id of the
18312 	 * destination port for the TX path.
18313 	 */
18314 	uint16_t mirror_vnic_id;
18315 	/* Logical VNIC ID of the VNIC where traffic is mirrored. */
18316 	uint8_t tunnel_type;
18317 	/*
18318 	 * This value indicates the tunnel type for this filter. If this field
18319 	 * is not specified, then the filter shall apply to both non-tunneled
18320 	 * and tunneled packets. If this field conflicts with the tunnel_type
18321 	 * specified in the l2_filter_id, then the HWRM shall return an error
18322 	 * for this command.
18323 	 */
18324 	/* Non-tunnel */
18325 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
18326 	/* Virtual eXtensible Local Area Network (VXLAN) */
18327 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
18328 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
18329 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
18330 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
18331 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
18332 	/* IP in IP */
18333 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
18334 	/* Generic Network Virtualization Encapsulation (Geneve) */
18335 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
18336 	/* Multi-Protocol Lable Switching (MPLS) */
18337 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
18338 	/* Stateless Transport Tunnel (STT) */
18339 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
18340 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
18341 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
18342 	/* Any tunneled traffic */
18343 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
18344 	uint8_t pri_hint;
18345 	/*
18346 	 * This hint is provided to help in placing the filter in the filter
18347 	 * table.
18348 	 */
18349 	/* No preference */
18350 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
18351 	/* Above the given filter */
18352 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE UINT32_C(0x1)
18353 	/* Below the given filter */
18354 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW UINT32_C(0x2)
18355 	/* As high as possible */
18356 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST UINT32_C(0x3)
18357 	/* As low as possible */
18358 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST UINT32_C(0x4)
18359 	uint32_t src_ipaddr[4]; /* big endian */
18360 	/*
18361 	 * The value of source IP address to be used in filtering. For IPv4,
18362 	 * first four bytes represent the IP address.
18363 	 */
18364 	uint32_t src_ipaddr_mask[4]; /* big endian */
18365 	/*
18366 	 * The value of source IP address mask to be used in filtering. For
18367 	 * IPv4, first four bytes represent the IP address mask.
18368 	 */
18369 	uint32_t dst_ipaddr[4]; /* big endian */
18370 	/*
18371 	 * The value of destination IP address to be used in filtering. For
18372 	 * IPv4, first four bytes represent the IP address.
18373 	 */
18374 	uint32_t dst_ipaddr_mask[4]; /* big endian */
18375 	/*
18376 	 * The value of destination IP address mask to be used in filtering. For
18377 	 * IPv4, first four bytes represent the IP address mask.
18378 	 */
18379 	uint16_t src_port; /* big endian */
18380 	/*
18381 	 * The value of source port to be used in filtering. Applies to UDP and
18382 	 * TCP traffic.
18383 	 */
18384 	uint16_t src_port_mask; /* big endian */
18385 	/*
18386 	 * The value of source port mask to be used in filtering. Applies to UDP
18387 	 * and TCP traffic.
18388 	 */
18389 	uint16_t dst_port; /* big endian */
18390 	/*
18391 	 * The value of destination port to be used in filtering. Applies to UDP
18392 	 * and TCP traffic.
18393 	 */
18394 	uint16_t dst_port_mask; /* big endian */
18395 	/*
18396 	 * The value of destination port mask to be used in filtering. Applies
18397 	 * to UDP and TCP traffic.
18398 	 */
18399 	uint64_t ntuple_filter_id_hint;
18400 	/* This is the ID of the filter that goes along with the pri_hint. */
18401 } __attribute__((packed));
18402 
18403 /* Output (24 bytes) */
18404 
18405 struct hwrm_cfa_ntuple_filter_alloc_output {
18406 	uint16_t error_code;
18407 	/*
18408 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18409 	 * and fail the call with an error when appropriate
18410 	 */
18411 	uint16_t req_type;
18412 	/* This field returns the type of original request. */
18413 	uint16_t seq_id;
18414 	/* This field provides original sequence number of the command. */
18415 	uint16_t resp_len;
18416 	/*
18417 	 * This field is the length of the response in bytes. The last byte of
18418 	 * the response is a valid flag that will read as '1' when the command
18419 	 * has been completely written to memory.
18420 	 */
18421 	uint64_t ntuple_filter_id;
18422 	/* This value is an opaque id into CFA data structures. */
18423 	uint32_t flow_id;
18424 	/*
18425 	 * This is the ID of the flow associated with this filter. This value
18426 	 * shall be used to match and associate the flow identifier returned in
18427 	 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
18428 	 */
18429 	uint8_t unused_0;
18430 	uint8_t unused_1;
18431 	uint8_t unused_2;
18432 	uint8_t valid;
18433 	/*
18434 	 * This field is used in Output records to indicate that the output is
18435 	 * completely written to RAM. This field should be read as '1' to
18436 	 * indicate that the output has been completely written. When writing a
18437 	 * command completion or response to an internal processor, the order of
18438 	 * writes has to be such that this field is written last.
18439 	 */
18440 } __attribute__((packed));
18441 
18442 /* Command specific Error Codes (8 bytes) */
18443 
18444 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
18445 	uint8_t code;
18446 	/*
18447 	 * command specific error codes that goes to the cmd_err field in Common
18448 	 * HWRM Error Response.
18449 	 */
18450 	/* Unknown error */
18451 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
18452 	/* Unable to complete operation due to conflict with Rx Mask VLAN */
18453 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR UINT32_C(0x1)
18454 	uint8_t unused_0[7];
18455 } __attribute__((packed));
18456 
18457 /* hwrm_cfa_ntuple_filter_free */
18458 /* Description: Free an ntuple filter */
18459 /* Input (24 bytes) */
18460 
18461 struct hwrm_cfa_ntuple_filter_free_input {
18462 	uint16_t req_type;
18463 	/*
18464 	 * This value indicates what type of request this is. The format for the
18465 	 * rest of the command is determined by this field.
18466 	 */
18467 	uint16_t cmpl_ring;
18468 	/*
18469 	 * This value indicates the what completion ring the request will be
18470 	 * optionally completed on. If the value is -1, then no CR completion
18471 	 * will be generated. Any other value must be a valid CR ring_id value
18472 	 * for this function.
18473 	 */
18474 	uint16_t seq_id;
18475 	/* This value indicates the command sequence number. */
18476 	uint16_t target_id;
18477 	/*
18478 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18479 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18480 	 */
18481 	uint64_t resp_addr;
18482 	/*
18483 	 * This is the host address where the response will be written when the
18484 	 * request is complete. This area must be 16B aligned and must be
18485 	 * cleared to zero before the request is made.
18486 	 */
18487 	uint64_t ntuple_filter_id;
18488 	/* This value is an opaque id into CFA data structures. */
18489 } __attribute__((packed));
18490 
18491 /* Output (16 bytes) */
18492 
18493 struct hwrm_cfa_ntuple_filter_free_output {
18494 	uint16_t error_code;
18495 	/*
18496 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18497 	 * and fail the call with an error when appropriate
18498 	 */
18499 	uint16_t req_type;
18500 	/* This field returns the type of original request. */
18501 	uint16_t seq_id;
18502 	/* This field provides original sequence number of the command. */
18503 	uint16_t resp_len;
18504 	/*
18505 	 * This field is the length of the response in bytes. The last byte of
18506 	 * the response is a valid flag that will read as '1' when the command
18507 	 * has been completely written to memory.
18508 	 */
18509 	uint32_t unused_0;
18510 	uint8_t unused_1;
18511 	uint8_t unused_2;
18512 	uint8_t unused_3;
18513 	uint8_t valid;
18514 	/*
18515 	 * This field is used in Output records to indicate that the output is
18516 	 * completely written to RAM. This field should be read as '1' to
18517 	 * indicate that the output has been completely written. When writing a
18518 	 * command completion or response to an internal processor, the order of
18519 	 * writes has to be such that this field is written last.
18520 	 */
18521 } __attribute__((packed));
18522 
18523 /* hwrm_cfa_ntuple_filter_cfg */
18524 /*
18525  * Description: Configure an ntuple filter with a new destination VNIC and/or
18526  * meter.
18527  */
18528 /* Input (48 bytes) */
18529 
18530 struct hwrm_cfa_ntuple_filter_cfg_input {
18531 	uint16_t req_type;
18532 	/*
18533 	 * This value indicates what type of request this is. The format for the
18534 	 * rest of the command is determined by this field.
18535 	 */
18536 	uint16_t cmpl_ring;
18537 	/*
18538 	 * This value indicates the what completion ring the request will be
18539 	 * optionally completed on. If the value is -1, then no CR completion
18540 	 * will be generated. Any other value must be a valid CR ring_id value
18541 	 * for this function.
18542 	 */
18543 	uint16_t seq_id;
18544 	/* This value indicates the command sequence number. */
18545 	uint16_t target_id;
18546 	/*
18547 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18548 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18549 	 */
18550 	uint64_t resp_addr;
18551 	/*
18552 	 * This is the host address where the response will be written when the
18553 	 * request is complete. This area must be 16B aligned and must be
18554 	 * cleared to zero before the request is made.
18555 	 */
18556 	uint32_t enables;
18557 	/* This bit must be '1' for the new_dst_id field to be configured. */
18558 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID UINT32_C(0x1)
18559 	/*
18560 	 * This bit must be '1' for the new_mirror_vnic_id field to be
18561 	 * configured.
18562 	 */
18563 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID UINT32_C(0x2)
18564 	/*
18565 	 * This bit must be '1' for the new_meter_instance_id field to be
18566 	 * configured.
18567 	 */
18568 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID UINT32_C(0x4)
18569 	uint32_t unused_0;
18570 	uint64_t ntuple_filter_id;
18571 	/* This value is an opaque id into CFA data structures. */
18572 	uint32_t new_dst_id;
18573 	/*
18574 	 * If set, this value shall represent the new Logical VNIC ID of the
18575 	 * destination VNIC for the RX path and new network port id of the
18576 	 * destination port for the TX path.
18577 	 */
18578 	uint32_t new_mirror_vnic_id;
18579 	/* New Logical VNIC ID of the VNIC where traffic is mirrored. */
18580 	uint16_t new_meter_instance_id;
18581 	/*
18582 	 * New meter to attach to the flow. Specifying the invalid instance ID
18583 	 * is used to remove any existing meter from the flow.
18584 	 */
18585 	/*
18586 	 * A value of 0xfff is considered invalid and implies the
18587 	 * instance is not configured.
18588 	 */
18589 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
18590 	uint16_t unused_1[3];
18591 } __attribute__((packed));
18592 
18593 /* Output (16 bytes) */
18594 
18595 struct hwrm_cfa_ntuple_filter_cfg_output {
18596 	uint16_t error_code;
18597 	/*
18598 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18599 	 * and fail the call with an error when appropriate
18600 	 */
18601 	uint16_t req_type;
18602 	/* This field returns the type of original request. */
18603 	uint16_t seq_id;
18604 	/* This field provides original sequence number of the command. */
18605 	uint16_t resp_len;
18606 	/*
18607 	 * This field is the length of the response in bytes. The last byte of
18608 	 * the response is a valid flag that will read as '1' when the command
18609 	 * has been completely written to memory.
18610 	 */
18611 	uint32_t unused_0;
18612 	uint8_t unused_1;
18613 	uint8_t unused_2;
18614 	uint8_t unused_3;
18615 	uint8_t valid;
18616 	/*
18617 	 * This field is used in Output records to indicate that the output is
18618 	 * completely written to RAM. This field should be read as '1' to
18619 	 * indicate that the output has been completely written. When writing a
18620 	 * command completion or response to an internal processor, the order of
18621 	 * writes has to be such that this field is written last.
18622 	 */
18623 } __attribute__((packed));
18624 
18625 /* hwrm_cfa_em_flow_alloc */
18626 /*
18627  * Description: This is a generic Exact Match (EM) flow that uses fields from
18628  * L4/L3/L2 headers. The EM flows apply to transmit and receive traffic. All
18629  * L2/L3/L4 header fields are specified in network byte order. For each EM flow,
18630  * there is an associated set of actions specified. For tunneled packets, all
18631  * L2/L3/L4 fields specified are fields of inner headers unless otherwise
18632  * specified. # If a field specified in this command is not enabled as a valid
18633  * field, then that field shall not be used in matching packet header fields
18634  * against this EM flow entry.
18635  */
18636 /* Input (112 bytes) */
18637 
18638 struct hwrm_cfa_em_flow_alloc_input {
18639 	uint16_t req_type;
18640 	/*
18641 	 * This value indicates what type of request this is. The format for the
18642 	 * rest of the command is determined by this field.
18643 	 */
18644 	uint16_t cmpl_ring;
18645 	/*
18646 	 * This value indicates the what completion ring the request will be
18647 	 * optionally completed on. If the value is -1, then no CR completion
18648 	 * will be generated. Any other value must be a valid CR ring_id value
18649 	 * for this function.
18650 	 */
18651 	uint16_t seq_id;
18652 	/* This value indicates the command sequence number. */
18653 	uint16_t target_id;
18654 	/*
18655 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18656 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18657 	 */
18658 	uint64_t resp_addr;
18659 	/*
18660 	 * This is the host address where the response will be written when the
18661 	 * request is complete. This area must be 16B aligned and must be
18662 	 * cleared to zero before the request is made.
18663 	 */
18664 	uint32_t flags;
18665 	/*
18666 	 * Enumeration denoting the RX, TX type of the resource. This
18667 	 * enumeration is used for resources that are similar for both TX and RX
18668 	 * paths of the chip.
18669 	 */
18670 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH		UINT32_C(0x1)
18671 	/* tx path */
18672 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX	(UINT32_C(0x0) << 0)
18673 	/* rx path */
18674 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX	(UINT32_C(0x1) << 0)
18675 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
18676 	/*
18677 	 * Setting of this flag indicates enabling of a byte counter for a given
18678 	 * flow.
18679 	 */
18680 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR	UINT32_C(0x2)
18681 	/*
18682 	 * Setting of this flag indicates enabling of a packet counter for a
18683 	 * given flow.
18684 	 */
18685 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR	UINT32_C(0x4)
18686 	/*
18687 	 * Setting of this flag indicates de-capsulation action for the given
18688 	 * flow.
18689 	 */
18690 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP	UINT32_C(0x8)
18691 	/*
18692 	 * Setting of this flag indicates encapsulation action for the given
18693 	 * flow.
18694 	 */
18695 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP	UINT32_C(0x10)
18696 	/*
18697 	 * Setting of this flag indicates drop action. If this flag is not set,
18698 	 * then it should be considered accept action.
18699 	 */
18700 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP		UINT32_C(0x20)
18701 	/*
18702 	 * Setting of this flag indicates that a meter is expected to be
18703 	 * attached to this flow. This hint can be used when choosing the action
18704 	 * record format required for the flow.
18705 	 */
18706 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER	UINT32_C(0x40)
18707 	uint32_t enables;
18708 	/* This bit must be '1' for the l2_filter_id field to be configured. */
18709 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID  UINT32_C(0x1)
18710 	/* This bit must be '1' for the tunnel_type field to be configured. */
18711 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE   UINT32_C(0x2)
18712 	/* This bit must be '1' for the tunnel_id field to be configured. */
18713 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID	UINT32_C(0x4)
18714 	/* This bit must be '1' for the src_macaddr field to be configured. */
18715 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR   UINT32_C(0x8)
18716 	/* This bit must be '1' for the dst_macaddr field to be configured. */
18717 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR   UINT32_C(0x10)
18718 	/* This bit must be '1' for the ovlan_vid field to be configured. */
18719 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID	UINT32_C(0x20)
18720 	/* This bit must be '1' for the ivlan_vid field to be configured. */
18721 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID	UINT32_C(0x40)
18722 	/* This bit must be '1' for the ethertype field to be configured. */
18723 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE	UINT32_C(0x80)
18724 	/* This bit must be '1' for the src_ipaddr field to be configured. */
18725 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x100)
18726 	/* This bit must be '1' for the dst_ipaddr field to be configured. */
18727 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x200)
18728 	/* This bit must be '1' for the ipaddr_type field to be configured. */
18729 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE   UINT32_C(0x400)
18730 	/* This bit must be '1' for the ip_protocol field to be configured. */
18731 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL   UINT32_C(0x800)
18732 	/* This bit must be '1' for the src_port field to be configured. */
18733 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT	UINT32_C(0x1000)
18734 	/* This bit must be '1' for the dst_port field to be configured. */
18735 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT	UINT32_C(0x2000)
18736 	/* This bit must be '1' for the dst_id field to be configured. */
18737 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID	UINT32_C(0x4000)
18738 	/* This bit must be '1' for the mirror_vnic_id field to be configured. */
18739 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x8000)
18740 	/* This bit must be '1' for the encap_record_id field to be configured. */
18741 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID UINT32_C(0x10000)
18742 	/*
18743 	 * This bit must be '1' for the meter_instance_id field to be
18744 	 * configured.
18745 	 */
18746 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID UINT32_C(0x20000)
18747 	uint64_t l2_filter_id;
18748 	/*
18749 	 * This value identifies a set of CFA data structures used for an L2
18750 	 * context.
18751 	 */
18752 	uint8_t tunnel_type;
18753 	/* Tunnel Type. */
18754 	/* Non-tunnel */
18755 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
18756 	/* Virtual eXtensible Local Area Network (VXLAN) */
18757 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
18758 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
18759 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
18760 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
18761 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
18762 	/* IP in IP */
18763 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
18764 	/* Generic Network Virtualization Encapsulation (Geneve) */
18765 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE   UINT32_C(0x5)
18766 	/* Multi-Protocol Lable Switching (MPLS) */
18767 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
18768 	/* Stateless Transport Tunnel (STT) */
18769 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
18770 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
18771 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
18772 	/* Any tunneled traffic */
18773 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
18774 	uint8_t unused_0;
18775 	uint16_t unused_1;
18776 	uint32_t tunnel_id;
18777 	/*
18778 	 * Tunnel identifier. Virtual Network Identifier (VNI). Only valid with
18779 	 * tunnel_types VXLAN, NVGRE, and Geneve. Only lower 24-bits of VNI
18780 	 * field are used in setting up the filter.
18781 	 */
18782 	uint8_t src_macaddr[6];
18783 	/* This value indicates the source MAC address in the Ethernet header. */
18784 	uint16_t meter_instance_id;
18785 	/* The meter instance to attach to the flow. */
18786 	/*
18787 	 * A value of 0xfff is considered invalid and implies the
18788 	 * instance is not configured.
18789 	 */
18790 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
18791 	uint8_t dst_macaddr[6];
18792 	/*
18793 	 * This value indicates the destination MAC address in the Ethernet
18794 	 * header.
18795 	 */
18796 	uint16_t ovlan_vid;
18797 	/*
18798 	 * This value indicates the VLAN ID of the outer VLAN tag in the
18799 	 * Ethernet header.
18800 	 */
18801 	uint16_t ivlan_vid;
18802 	/*
18803 	 * This value indicates the VLAN ID of the inner VLAN tag in the
18804 	 * Ethernet header.
18805 	 */
18806 	uint16_t ethertype; /* big endian */
18807 	/* This value indicates the ethertype in the Ethernet header. */
18808 	uint8_t ip_addr_type;
18809 	/*
18810 	 * This value indicates the type of IP address. 4 - IPv4 6 - IPv6 All
18811 	 * others are invalid.
18812 	 */
18813 	/* invalid */
18814 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
18815 	/* IPv4 */
18816 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
18817 	/* IPv6 */
18818 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
18819 	uint8_t ip_protocol;
18820 	/*
18821 	 * The value of protocol filed in IP header. Applies to UDP and TCP
18822 	 * traffic. 6 - TCP 17 - UDP
18823 	 */
18824 	/* invalid */
18825 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN  UINT32_C(0x0)
18826 	/* TCP */
18827 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
18828 	/* UDP */
18829 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
18830 	uint8_t unused_2;
18831 	uint8_t unused_3;
18832 	uint32_t src_ipaddr[4]; /* big endian */
18833 	/*
18834 	 * The value of source IP address to be used in filtering. For IPv4,
18835 	 * first four bytes represent the IP address.
18836 	 */
18837 	uint32_t dst_ipaddr[4]; /* big endian */
18838 	/*
18839 	 * big_endian = True The value of destination IP address to be used in
18840 	 * filtering. For IPv4, first four bytes represent the IP address.
18841 	 */
18842 	uint16_t src_port; /* big endian */
18843 	/*
18844 	 * The value of source port to be used in filtering. Applies to UDP and
18845 	 * TCP traffic.
18846 	 */
18847 	uint16_t dst_port; /* big endian */
18848 	/*
18849 	 * The value of destination port to be used in filtering. Applies to UDP
18850 	 * and TCP traffic.
18851 	 */
18852 	uint16_t dst_id;
18853 	/*
18854 	 * If set, this value shall represent the Logical VNIC ID of the
18855 	 * destination VNIC for the RX path and network port id of the
18856 	 * destination port for the TX path.
18857 	 */
18858 	uint16_t mirror_vnic_id;
18859 	/* Logical VNIC ID of the VNIC where traffic is mirrored. */
18860 	uint32_t encap_record_id;
18861 	/* Logical ID of the encapsulation record. */
18862 	uint32_t unused_4;
18863 } __attribute__((packed));
18864 
18865 /* Output (24 bytes) */
18866 
18867 struct hwrm_cfa_em_flow_alloc_output {
18868 	uint16_t error_code;
18869 	/*
18870 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18871 	 * and fail the call with an error when appropriate
18872 	 */
18873 	uint16_t req_type;
18874 	/* This field returns the type of original request. */
18875 	uint16_t seq_id;
18876 	/* This field provides original sequence number of the command. */
18877 	uint16_t resp_len;
18878 	/*
18879 	 * This field is the length of the response in bytes. The last byte of
18880 	 * the response is a valid flag that will read as '1' when the command
18881 	 * has been completely written to memory.
18882 	 */
18883 	uint64_t em_filter_id;
18884 	/* This value is an opaque id into CFA data structures. */
18885 	uint32_t flow_id;
18886 	/*
18887 	 * This is the ID of the flow associated with this filter. This value
18888 	 * shall be used to match and associate the flow identifier returned in
18889 	 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
18890 	 */
18891 	uint8_t unused_0;
18892 	uint8_t unused_1;
18893 	uint8_t unused_2;
18894 	uint8_t valid;
18895 	/*
18896 	 * This field is used in Output records to indicate that the output is
18897 	 * completely written to RAM. This field should be read as '1' to
18898 	 * indicate that the output has been completely written. When writing a
18899 	 * command completion or response to an internal processor, the order of
18900 	 * writes has to be such that this field is written last.
18901 	 */
18902 } __attribute__((packed));
18903 
18904 /* hwrm_cfa_em_flow_free */
18905 /* Description: Free an EM flow table entry */
18906 /* Input (24 bytes) */
18907 
18908 struct hwrm_cfa_em_flow_free_input {
18909 	uint16_t req_type;
18910 	/*
18911 	 * This value indicates what type of request this is. The format for the
18912 	 * rest of the command is determined by this field.
18913 	 */
18914 	uint16_t cmpl_ring;
18915 	/*
18916 	 * This value indicates the what completion ring the request will be
18917 	 * optionally completed on. If the value is -1, then no CR completion
18918 	 * will be generated. Any other value must be a valid CR ring_id value
18919 	 * for this function.
18920 	 */
18921 	uint16_t seq_id;
18922 	/* This value indicates the command sequence number. */
18923 	uint16_t target_id;
18924 	/*
18925 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18926 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18927 	 */
18928 	uint64_t resp_addr;
18929 	/*
18930 	 * This is the host address where the response will be written when the
18931 	 * request is complete. This area must be 16B aligned and must be
18932 	 * cleared to zero before the request is made.
18933 	 */
18934 	uint64_t em_filter_id;
18935 	/* This value is an opaque id into CFA data structures. */
18936 } __attribute__((packed));
18937 
18938 /* Output (16 bytes) */
18939 
18940 struct hwrm_cfa_em_flow_free_output {
18941 	uint16_t error_code;
18942 	/*
18943 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
18944 	 * and fail the call with an error when appropriate
18945 	 */
18946 	uint16_t req_type;
18947 	/* This field returns the type of original request. */
18948 	uint16_t seq_id;
18949 	/* This field provides original sequence number of the command. */
18950 	uint16_t resp_len;
18951 	/*
18952 	 * This field is the length of the response in bytes. The last byte of
18953 	 * the response is a valid flag that will read as '1' when the command
18954 	 * has been completely written to memory.
18955 	 */
18956 	uint32_t unused_0;
18957 	uint8_t unused_1;
18958 	uint8_t unused_2;
18959 	uint8_t unused_3;
18960 	uint8_t valid;
18961 	/*
18962 	 * This field is used in Output records to indicate that the output is
18963 	 * completely written to RAM. This field should be read as '1' to
18964 	 * indicate that the output has been completely written. When writing a
18965 	 * command completion or response to an internal processor, the order of
18966 	 * writes has to be such that this field is written last.
18967 	 */
18968 } __attribute__((packed));
18969 
18970 /* hwrm_cfa_em_flow_cfg */
18971 /*
18972  * Description: Configure an EM flow with a new destination VNIC and/or meter.
18973  */
18974 /* Input (48 bytes) */
18975 
18976 struct hwrm_cfa_em_flow_cfg_input {
18977 	uint16_t req_type;
18978 	/*
18979 	 * This value indicates what type of request this is. The format for the
18980 	 * rest of the command is determined by this field.
18981 	 */
18982 	uint16_t cmpl_ring;
18983 	/*
18984 	 * This value indicates the what completion ring the request will be
18985 	 * optionally completed on. If the value is -1, then no CR completion
18986 	 * will be generated. Any other value must be a valid CR ring_id value
18987 	 * for this function.
18988 	 */
18989 	uint16_t seq_id;
18990 	/* This value indicates the command sequence number. */
18991 	uint16_t target_id;
18992 	/*
18993 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
18994 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
18995 	 */
18996 	uint64_t resp_addr;
18997 	/*
18998 	 * This is the host address where the response will be written when the
18999 	 * request is complete. This area must be 16B aligned and must be
19000 	 * cleared to zero before the request is made.
19001 	 */
19002 	uint32_t enables;
19003 	/* This bit must be '1' for the new_dst_id field to be configured. */
19004 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_DST_ID	UINT32_C(0x1)
19005 	/*
19006 	 * This bit must be '1' for the new_mirror_vnic_id field to be
19007 	 * configured.
19008 	 */
19009 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID UINT32_C(0x2)
19010 	/*
19011 	 * This bit must be '1' for the new_meter_instance_id field to be
19012 	 * configured.
19013 	 */
19014 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID UINT32_C(0x4)
19015 	uint32_t unused_0;
19016 	uint64_t em_filter_id;
19017 	/* This value is an opaque id into CFA data structures. */
19018 	uint32_t new_dst_id;
19019 	/*
19020 	 * If set, this value shall represent the new Logical VNIC ID of the
19021 	 * destination VNIC for the RX path and network port id of the
19022 	 * destination port for the TX path.
19023 	 */
19024 	uint32_t new_mirror_vnic_id;
19025 	/* New Logical VNIC ID of the VNIC where traffic is mirrored. */
19026 	uint16_t new_meter_instance_id;
19027 	/*
19028 	 * New meter to attach to the flow. Specifying the invalid instance ID
19029 	 * is used to remove any existing meter from the flow.
19030 	 */
19031 	/*
19032 	 * A value of 0xfff is considered invalid and implies the
19033 	 * instance is not configured.
19034 	 */
19035 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
19036 	uint16_t unused_1[3];
19037 } __attribute__((packed));
19038 
19039 /* Output (16 bytes) */
19040 
19041 struct hwrm_cfa_em_flow_cfg_output {
19042 	uint16_t error_code;
19043 	/*
19044 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19045 	 * and fail the call with an error when appropriate
19046 	 */
19047 	uint16_t req_type;
19048 	/* This field returns the type of original request. */
19049 	uint16_t seq_id;
19050 	/* This field provides original sequence number of the command. */
19051 	uint16_t resp_len;
19052 	/*
19053 	 * This field is the length of the response in bytes. The last byte of
19054 	 * the response is a valid flag that will read as '1' when the command
19055 	 * has been completely written to memory.
19056 	 */
19057 	uint32_t unused_0;
19058 	uint8_t unused_1;
19059 	uint8_t unused_2;
19060 	uint8_t unused_3;
19061 	uint8_t valid;
19062 	/*
19063 	 * This field is used in Output records to indicate that the output is
19064 	 * completely written to RAM. This field should be read as '1' to
19065 	 * indicate that the output has been completely written. When writing a
19066 	 * command completion or response to an internal processor, the order of
19067 	 * writes has to be such that this field is written last.
19068 	 */
19069 } __attribute__((packed));
19070 
19071 /* hwrm_cfa_meter_profile_alloc */
19072 /*
19073  * Description: This is a meter profile that defines the characteristics of the
19074  * meter. This includes the algorithm, information rates, and burst sizes. No
19075  * running state is kept in a profile and instead meter instances are allocated
19076  * that reference a profile.
19077  */
19078 /* Input (40 bytes) */
19079 
19080 struct hwrm_cfa_meter_profile_alloc_input {
19081 	uint16_t req_type;
19082 	/*
19083 	 * This value indicates what type of request this is. The format for the
19084 	 * rest of the command is determined by this field.
19085 	 */
19086 	uint16_t cmpl_ring;
19087 	/*
19088 	 * This value indicates the what completion ring the request will be
19089 	 * optionally completed on. If the value is -1, then no CR completion
19090 	 * will be generated. Any other value must be a valid CR ring_id value
19091 	 * for this function.
19092 	 */
19093 	uint16_t seq_id;
19094 	/* This value indicates the command sequence number. */
19095 	uint16_t target_id;
19096 	/*
19097 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19098 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19099 	 */
19100 	uint64_t resp_addr;
19101 	/*
19102 	 * This is the host address where the response will be written when the
19103 	 * request is complete. This area must be 16B aligned and must be
19104 	 * cleared to zero before the request is made.
19105 	 */
19106 	uint8_t flags;
19107 	/*
19108 	 * Enumeration denoting the RX, TX type of the resource. This
19109 	 * enumeration is used for resources that are similar for both TX and RX
19110 	 * paths of the chip.
19111 	 */
19112 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
19113 	/* tx path */
19114 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX  UINT32_C(0x0)
19115 	/* rx path */
19116 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX  UINT32_C(0x1)
19117 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
19118 	uint8_t meter_type;
19119 	/* The meter algorithm type. */
19120 	/* RFC 2697 (srTCM) */
19121 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
19122 	/* RFC 2698 (trTCM) */
19123 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
19124 	/* RFC 4115 (trTCM) */
19125 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
19126 	uint16_t reserved1;
19127 	/* This field is reserved for the future use. It shall be set to 0. */
19128 	uint32_t reserved2;
19129 	/* This field is reserved for the future use. It shall be set to 0. */
19130 	uint32_t commit_rate;
19131 	/* A meter rate specified in bytes-per-second. */
19132 	/* The bandwidth value. */
19133 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
19134 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT 0
19135 	/* The granularity of the value (bits or bytes). */
19136 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE UINT32_C(0x10000000)
19137 	/* Value is in bits. */
19138 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
19139 	/* Value is in bytes. */
19140 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
19141 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
19142 	/* bw_value_unit is 3 b */
19143 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19144 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT 29
19145 	/* Value is in Mb or MB (base 10). */
19146 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19147 	/* Value is in Kb or KB (base 10). */
19148 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19149 	/* Value is in bits or bytes. */
19150 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19151 	/* Value is in Gb or GB (base 10). */
19152 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19153 	/* Value is in 1/100th of a percentage of total bandwidth. */
19154 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19155 	/* Invalid unit */
19156 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19157 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID
19158 	uint32_t commit_burst;
19159 	/* A meter burst size specified in bytes. */
19160 	/* The bandwidth value. */
19161 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
19162 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT 0
19163 	/* The granularity of the value (bits or bytes). */
19164 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE UINT32_C(0x10000000)
19165 	/* Value is in bits. */
19166 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
19167 	/* Value is in bytes. */
19168 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
19169 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
19170 	/* bw_value_unit is 3 b */
19171 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19172 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT 29
19173 	/* Value is in Mb or MB (base 10). */
19174 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19175 	/* Value is in Kb or KB (base 10). */
19176 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19177 	/* Value is in bits or bytes. */
19178 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19179 	/* Value is in Gb or GB (base 10). */
19180 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19181 	/* Value is in 1/100th of a percentage of total bandwidth. */
19182 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19183 	/* Invalid unit */
19184 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19185 	#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
19186 	uint32_t excess_peak_rate;
19187 	/* A meter rate specified in bytes-per-second. */
19188 	/* The bandwidth value. */
19189 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
19190 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT 0
19191 	/* The granularity of the value (bits or bytes). */
19192 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE UINT32_C(0x10000000)
19193 	/* Value is in bits. */
19194 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
19195 	/* Value is in bytes. */
19196 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
19197 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
19198 	/* bw_value_unit is 3 b */
19199 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19200 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT 29
19201 	/* Value is in Mb or MB (base 10). */
19202 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19203 	/* Value is in Kb or KB (base 10). */
19204 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19205 	/* Value is in bits or bytes. */
19206 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19207 	/* Value is in Gb or GB (base 10). */
19208 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19209 	/* Value is in 1/100th of a percentage of total bandwidth. */
19210 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19211 	/* Invalid unit */
19212 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19213 	#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_INVALID
19214 	uint32_t excess_peak_burst;
19215 	/* A meter burst size specified in bytes. */
19216 	/* The bandwidth value. */
19217 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
19218 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT 0
19219 	/* The granularity of the value (bits or bytes). */
19220 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE UINT32_C(0x10000000)
19221 	/* Value is in bits. */
19222 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
19223 	/* Value is in bytes. */
19224 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
19225 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
19226 	/* bw_value_unit is 3 b */
19227 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19228 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT 29
19229 	/* Value is in Mb or MB (base 10). */
19230 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19231 	/* Value is in Kb or KB (base 10). */
19232 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19233 	/* Value is in bits or bytes. */
19234 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19235 	/* Value is in Gb or GB (base 10). */
19236 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19237 	/* Value is in 1/100th of a percentage of total bandwidth. */
19238 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19239 	/* Invalid unit */
19240 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19241 	#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
19242 } __attribute__((packed));
19243 
19244 /* Output (16 bytes) */
19245 
19246 struct hwrm_cfa_meter_profile_alloc_output {
19247 	uint16_t error_code;
19248 	/*
19249 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19250 	 * and fail the call with an error when appropriate
19251 	 */
19252 	uint16_t req_type;
19253 	/* This field returns the type of original request. */
19254 	uint16_t seq_id;
19255 	/* This field provides original sequence number of the command. */
19256 	uint16_t resp_len;
19257 	/*
19258 	 * This field is the length of the response in bytes. The last byte of
19259 	 * the response is a valid flag that will read as '1' when the command
19260 	 * has been completely written to memory.
19261 	 */
19262 	uint16_t meter_profile_id;
19263 	/* This value identifies a meter profile in CFA. */
19264 	/*
19265 	 * A value of 0xfff is considered invalid and implies the
19266 	 * profile is not configured.
19267 	 */
19268 	#define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
19269 	uint8_t unused_0;
19270 	uint8_t unused_1;
19271 	uint8_t unused_2;
19272 	uint8_t unused_3;
19273 	uint8_t unused_4;
19274 	uint8_t valid;
19275 	/*
19276 	 * This field is used in Output records to indicate that the output is
19277 	 * completely written to RAM. This field should be read as '1' to
19278 	 * indicate that the output has been completely written. When writing a
19279 	 * command completion or response to an internal processor, the order of
19280 	 * writes has to be such that this field is written last.
19281 	 */
19282 } __attribute__((packed));
19283 
19284 /* hwrm_cfa_meter_profile_free */
19285 /* Description: Free a meter profile. */
19286 /* Input (24 bytes) */
19287 
19288 struct hwrm_cfa_meter_profile_free_input {
19289 	uint16_t req_type;
19290 	/*
19291 	 * This value indicates what type of request this is. The format for the
19292 	 * rest of the command is determined by this field.
19293 	 */
19294 	uint16_t cmpl_ring;
19295 	/*
19296 	 * This value indicates the what completion ring the request will be
19297 	 * optionally completed on. If the value is -1, then no CR completion
19298 	 * will be generated. Any other value must be a valid CR ring_id value
19299 	 * for this function.
19300 	 */
19301 	uint16_t seq_id;
19302 	/* This value indicates the command sequence number. */
19303 	uint16_t target_id;
19304 	/*
19305 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19306 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19307 	 */
19308 	uint64_t resp_addr;
19309 	/*
19310 	 * This is the host address where the response will be written when the
19311 	 * request is complete. This area must be 16B aligned and must be
19312 	 * cleared to zero before the request is made.
19313 	 */
19314 	uint8_t flags;
19315 	/*
19316 	 * Enumeration denoting the RX, TX type of the resource. This
19317 	 * enumeration is used for resources that are similar for both TX and RX
19318 	 * paths of the chip.
19319 	 */
19320 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
19321 	/* tx path */
19322 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX   UINT32_C(0x0)
19323 	/* rx path */
19324 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX   UINT32_C(0x1)
19325 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST	HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
19326 	uint8_t unused_0;
19327 	uint16_t meter_profile_id;
19328 	/* This value identifies a meter profile in CFA. */
19329 	/*
19330 	 * A value of 0xfff is considered invalid and implies the
19331 	 * profile is not configured.
19332 	 */
19333 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
19334 	uint32_t unused_1;
19335 } __attribute__((packed));
19336 
19337 /* Output (16 bytes) */
19338 
19339 struct hwrm_cfa_meter_profile_free_output {
19340 	uint16_t error_code;
19341 	/*
19342 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19343 	 * and fail the call with an error when appropriate
19344 	 */
19345 	uint16_t req_type;
19346 	/* This field returns the type of original request. */
19347 	uint16_t seq_id;
19348 	/* This field provides original sequence number of the command. */
19349 	uint16_t resp_len;
19350 	/*
19351 	 * This field is the length of the response in bytes. The last byte of
19352 	 * the response is a valid flag that will read as '1' when the command
19353 	 * has been completely written to memory.
19354 	 */
19355 	uint32_t unused_0;
19356 	uint8_t unused_1;
19357 	uint8_t unused_2;
19358 	uint8_t unused_3;
19359 	uint8_t valid;
19360 	/*
19361 	 * This field is used in Output records to indicate that the output is
19362 	 * completely written to RAM. This field should be read as '1' to
19363 	 * indicate that the output has been completely written. When writing a
19364 	 * command completion or response to an internal processor, the order of
19365 	 * writes has to be such that this field is written last.
19366 	 */
19367 } __attribute__((packed));
19368 
19369 /* hwrm_cfa_meter_profile_cfg */
19370 /* Description: Reconfigure a meter profile. */
19371 /* Input (40 bytes) */
19372 
19373 struct hwrm_cfa_meter_profile_cfg_input {
19374 	uint16_t req_type;
19375 	/*
19376 	 * This value indicates what type of request this is. The format for the
19377 	 * rest of the command is determined by this field.
19378 	 */
19379 	uint16_t cmpl_ring;
19380 	/*
19381 	 * This value indicates the what completion ring the request will be
19382 	 * optionally completed on. If the value is -1, then no CR completion
19383 	 * will be generated. Any other value must be a valid CR ring_id value
19384 	 * for this function.
19385 	 */
19386 	uint16_t seq_id;
19387 	/* This value indicates the command sequence number. */
19388 	uint16_t target_id;
19389 	/*
19390 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19391 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19392 	 */
19393 	uint64_t resp_addr;
19394 	/*
19395 	 * This is the host address where the response will be written when the
19396 	 * request is complete. This area must be 16B aligned and must be
19397 	 * cleared to zero before the request is made.
19398 	 */
19399 	uint8_t flags;
19400 	/*
19401 	 * Enumeration denoting the RX, TX type of the resource. This
19402 	 * enumeration is used for resources that are similar for both TX and RX
19403 	 * paths of the chip.
19404 	 */
19405 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
19406 	/* tx path */
19407 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
19408 	/* rx path */
19409 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
19410 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
19411 	uint8_t meter_type;
19412 	/* The meter algorithm type. */
19413 	/* RFC 2697 (srTCM) */
19414 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
19415 	/* RFC 2698 (trTCM) */
19416 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
19417 	/* RFC 4115 (trTCM) */
19418 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
19419 	uint16_t meter_profile_id;
19420 	/* This value identifies a meter profile in CFA. */
19421 	/*
19422 	 * A value of 0xfff is considered invalid and implies the
19423 	 * profile is not configured.
19424 	 */
19425 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
19426 	uint32_t reserved;
19427 	/* This field is reserved for the future use. It shall be set to 0. */
19428 	uint32_t commit_rate;
19429 	/* A meter rate specified in bytes-per-second. */
19430 	/* The bandwidth value. */
19431 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
19432 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT 0
19433 	/* The granularity of the value (bits or bytes). */
19434 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE UINT32_C(0x10000000)
19435 	/* Value is in bits. */
19436 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
19437 	/* Value is in bytes. */
19438 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
19439 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
19440 	/* bw_value_unit is 3 b */
19441 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19442 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT 29
19443 	/* Value is in Mb or MB (base 10). */
19444 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19445 	/* Value is in Kb or KB (base 10). */
19446 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19447 	/* Value is in bits or bytes. */
19448 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19449 	/* Value is in Gb or GB (base 10). */
19450 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19451 	/* Value is in 1/100th of a percentage of total bandwidth. */
19452 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19453 	/* Invalid unit */
19454 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19455 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID
19456 	uint32_t commit_burst;
19457 	/* A meter burst size specified in bytes. */
19458 	/* The bandwidth value. */
19459 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
19460 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT 0
19461 	/* The granularity of the value (bits or bytes). */
19462 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE UINT32_C(0x10000000)
19463 	/* Value is in bits. */
19464 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
19465 	/* Value is in bytes. */
19466 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
19467 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
19468 	/* bw_value_unit is 3 b */
19469 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19470 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT 29
19471 	/* Value is in Mb or MB (base 10). */
19472 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19473 	/* Value is in Kb or KB (base 10). */
19474 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19475 	/* Value is in bits or bytes. */
19476 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19477 	/* Value is in Gb or GB (base 10). */
19478 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19479 	/* Value is in 1/100th of a percentage of total bandwidth. */
19480 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19481 	/* Invalid unit */
19482 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19483 	#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
19484 	uint32_t excess_peak_rate;
19485 	/* A meter rate specified in bytes-per-second. */
19486 	/* The bandwidth value. */
19487 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK UINT32_C(0xfffffff)
19488 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT 0
19489 	/* The granularity of the value (bits or bytes). */
19490 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE UINT32_C(0x10000000)
19491 	/* Value is in bits. */
19492 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS (UINT32_C(0x0) << 28)
19493 	/* Value is in bytes. */
19494 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES (UINT32_C(0x1) << 28)
19495 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
19496 	/* bw_value_unit is 3 b */
19497 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19498 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT 29
19499 	/* Value is in Mb or MB (base 10). */
19500 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19501 	/* Value is in Kb or KB (base 10). */
19502 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19503 	/* Value is in bits or bytes. */
19504 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19505 	/* Value is in Gb or GB (base 10). */
19506 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19507 	/* Value is in 1/100th of a percentage of total bandwidth. */
19508 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19509 	/* Invalid unit */
19510 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19511 	#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_INVALID
19512 	uint32_t excess_peak_burst;
19513 	/* A meter burst size specified in bytes. */
19514 	/* The bandwidth value. */
19515 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK UINT32_C(0xfffffff)
19516 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT 0
19517 	/* The granularity of the value (bits or bytes). */
19518 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE UINT32_C(0x10000000)
19519 	/* Value is in bits. */
19520 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS (UINT32_C(0x0) << 28)
19521 	/* Value is in bytes. */
19522 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES (UINT32_C(0x1) << 28)
19523 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
19524 	/* bw_value_unit is 3 b */
19525 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK UINT32_C(0xe0000000)
19526 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT 29
19527 	/* Value is in Mb or MB (base 10). */
19528 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA (UINT32_C(0x0) << 29)
19529 	/* Value is in Kb or KB (base 10). */
19530 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO (UINT32_C(0x2) << 29)
19531 	/* Value is in bits or bytes. */
19532 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE (UINT32_C(0x4) << 29)
19533 	/* Value is in Gb or GB (base 10). */
19534 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA (UINT32_C(0x6) << 29)
19535 	/* Value is in 1/100th of a percentage of total bandwidth. */
19536 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 (UINT32_C(0x1) << 29)
19537 	/* Invalid unit */
19538 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID (UINT32_C(0x7) << 29)
19539 	#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
19540 } __attribute__((packed));
19541 
19542 /* Output (16 bytes) */
19543 
19544 struct hwrm_cfa_meter_profile_cfg_output {
19545 	uint16_t error_code;
19546 	/*
19547 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19548 	 * and fail the call with an error when appropriate
19549 	 */
19550 	uint16_t req_type;
19551 	/* This field returns the type of original request. */
19552 	uint16_t seq_id;
19553 	/* This field provides original sequence number of the command. */
19554 	uint16_t resp_len;
19555 	/*
19556 	 * This field is the length of the response in bytes. The last byte of
19557 	 * the response is a valid flag that will read as '1' when the command
19558 	 * has been completely written to memory.
19559 	 */
19560 	uint32_t unused_0;
19561 	uint8_t unused_1;
19562 	uint8_t unused_2;
19563 	uint8_t unused_3;
19564 	uint8_t valid;
19565 	/*
19566 	 * This field is used in Output records to indicate that the output is
19567 	 * completely written to RAM. This field should be read as '1' to
19568 	 * indicate that the output has been completely written. When writing a
19569 	 * command completion or response to an internal processor, the order of
19570 	 * writes has to be such that this field is written last.
19571 	 */
19572 } __attribute__((packed));
19573 
19574 /* hwrm_cfa_meter_instance_alloc */
19575 /*
19576  * Description: This is a meter instance which is used to track a meter's bucket
19577  * fill values for a flow. Each meter instance references a meter profile that
19578  * defines the meter algorithm in use.
19579  */
19580 /* Input (24 bytes) */
19581 
19582 struct hwrm_cfa_meter_instance_alloc_input {
19583 	uint16_t req_type;
19584 	/*
19585 	 * This value indicates what type of request this is. The format for the
19586 	 * rest of the command is determined by this field.
19587 	 */
19588 	uint16_t cmpl_ring;
19589 	/*
19590 	 * This value indicates the what completion ring the request will be
19591 	 * optionally completed on. If the value is -1, then no CR completion
19592 	 * will be generated. Any other value must be a valid CR ring_id value
19593 	 * for this function.
19594 	 */
19595 	uint16_t seq_id;
19596 	/* This value indicates the command sequence number. */
19597 	uint16_t target_id;
19598 	/*
19599 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19600 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19601 	 */
19602 	uint64_t resp_addr;
19603 	/*
19604 	 * This is the host address where the response will be written when the
19605 	 * request is complete. This area must be 16B aligned and must be
19606 	 * cleared to zero before the request is made.
19607 	 */
19608 	uint8_t flags;
19609 	/*
19610 	 * Enumeration denoting the RX, TX type of the resource. This
19611 	 * enumeration is used for resources that are similar for both TX and RX
19612 	 * paths of the chip.
19613 	 */
19614 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
19615 	/* tx path */
19616 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
19617 	/* rx path */
19618 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
19619 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
19620 	uint8_t unused_0;
19621 	uint16_t meter_profile_id;
19622 	/* This value identifies a meter profile in CFA. */
19623 	/*
19624 	 * A value of 0xfff is considered invalid and implies the
19625 	 * profile is not configured.
19626 	 */
19627 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
19628 	uint32_t unused_1;
19629 } __attribute__((packed));
19630 
19631 /* Output (16 bytes) */
19632 
19633 struct hwrm_cfa_meter_instance_alloc_output {
19634 	uint16_t error_code;
19635 	/*
19636 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19637 	 * and fail the call with an error when appropriate
19638 	 */
19639 	uint16_t req_type;
19640 	/* This field returns the type of original request. */
19641 	uint16_t seq_id;
19642 	/* This field provides original sequence number of the command. */
19643 	uint16_t resp_len;
19644 	/*
19645 	 * This field is the length of the response in bytes. The last byte of
19646 	 * the response is a valid flag that will read as '1' when the command
19647 	 * has been completely written to memory.
19648 	 */
19649 	uint16_t meter_instance_id;
19650 	/* This value identifies a meter instance in CFA. */
19651 	/*
19652 	 * A value of 0xfff is considered invalid and implies the
19653 	 * instance is not configured.
19654 	 */
19655 	#define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
19656 	uint8_t unused_0;
19657 	uint8_t unused_1;
19658 	uint8_t unused_2;
19659 	uint8_t unused_3;
19660 	uint8_t unused_4;
19661 	uint8_t valid;
19662 	/*
19663 	 * This field is used in Output records to indicate that the output is
19664 	 * completely written to RAM. This field should be read as '1' to
19665 	 * indicate that the output has been completely written. When writing a
19666 	 * command completion or response to an internal processor, the order of
19667 	 * writes has to be such that this field is written last.
19668 	 */
19669 } __attribute__((packed));
19670 
19671 /* hwrm_cfa_meter_instance_free */
19672 /* Description: Free a meter instance. */
19673 /* Input (24 bytes) */
19674 
19675 struct hwrm_cfa_meter_instance_free_input {
19676 	uint16_t req_type;
19677 	/*
19678 	 * This value indicates what type of request this is. The format for the
19679 	 * rest of the command is determined by this field.
19680 	 */
19681 	uint16_t cmpl_ring;
19682 	/*
19683 	 * This value indicates the what completion ring the request will be
19684 	 * optionally completed on. If the value is -1, then no CR completion
19685 	 * will be generated. Any other value must be a valid CR ring_id value
19686 	 * for this function.
19687 	 */
19688 	uint16_t seq_id;
19689 	/* This value indicates the command sequence number. */
19690 	uint16_t target_id;
19691 	/*
19692 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19693 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19694 	 */
19695 	uint64_t resp_addr;
19696 	/*
19697 	 * This is the host address where the response will be written when the
19698 	 * request is complete. This area must be 16B aligned and must be
19699 	 * cleared to zero before the request is made.
19700 	 */
19701 	uint8_t flags;
19702 	/*
19703 	 * Enumeration denoting the RX, TX type of the resource. This
19704 	 * enumeration is used for resources that are similar for both TX and RX
19705 	 * paths of the chip.
19706 	 */
19707 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
19708 	/* tx path */
19709 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX  UINT32_C(0x0)
19710 	/* rx path */
19711 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX  UINT32_C(0x1)
19712 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST	HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
19713 	uint8_t unused_0;
19714 	uint16_t meter_instance_id;
19715 	/* This value identifies a meter instance in CFA. */
19716 	/*
19717 	 * A value of 0xfff is considered invalid and implies the
19718 	 * instance is not configured.
19719 	 */
19720 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
19721 	uint32_t unused_1;
19722 } __attribute__((packed));
19723 
19724 /* Output (16 bytes) */
19725 
19726 struct hwrm_cfa_meter_instance_free_output {
19727 	uint16_t error_code;
19728 	/*
19729 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19730 	 * and fail the call with an error when appropriate
19731 	 */
19732 	uint16_t req_type;
19733 	/* This field returns the type of original request. */
19734 	uint16_t seq_id;
19735 	/* This field provides original sequence number of the command. */
19736 	uint16_t resp_len;
19737 	/*
19738 	 * This field is the length of the response in bytes. The last byte of
19739 	 * the response is a valid flag that will read as '1' when the command
19740 	 * has been completely written to memory.
19741 	 */
19742 	uint32_t unused_0;
19743 	uint8_t unused_1;
19744 	uint8_t unused_2;
19745 	uint8_t unused_3;
19746 	uint8_t valid;
19747 	/*
19748 	 * This field is used in Output records to indicate that the output is
19749 	 * completely written to RAM. This field should be read as '1' to
19750 	 * indicate that the output has been completely written. When writing a
19751 	 * command completion or response to an internal processor, the order of
19752 	 * writes has to be such that this field is written last.
19753 	 */
19754 } __attribute__((packed));
19755 
19756 /* hwrm_cfa_decap_filter_alloc */
19757 /*
19758  * Description: This command uses fields from L4/L3/L2 headers. All L2/L3/L4
19759  * header fields are specified in network byte order.
19760  */
19761 /* Input (104 bytes) */
19762 
19763 struct hwrm_cfa_decap_filter_alloc_input {
19764 	uint16_t req_type;
19765 	/*
19766 	 * This value indicates what type of request this is. The format for the
19767 	 * rest of the command is determined by this field.
19768 	 */
19769 	uint16_t cmpl_ring;
19770 	/*
19771 	 * This value indicates the what completion ring the request will be
19772 	 * optionally completed on. If the value is -1, then no CR completion
19773 	 * will be generated. Any other value must be a valid CR ring_id value
19774 	 * for this function.
19775 	 */
19776 	uint16_t seq_id;
19777 	/* This value indicates the command sequence number. */
19778 	uint16_t target_id;
19779 	/*
19780 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
19781 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
19782 	 */
19783 	uint64_t resp_addr;
19784 	/*
19785 	 * This is the host address where the response will be written when the
19786 	 * request is complete. This area must be 16B aligned and must be
19787 	 * cleared to zero before the request is made.
19788 	 */
19789 	uint32_t flags;
19790 	/* ovs_tunnel is 1 b */
19791 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL UINT32_C(0x1)
19792 	uint32_t enables;
19793 	/* This bit must be '1' for the tunnel_type field to be configured. */
19794 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE UINT32_C(0x1)
19795 	/* This bit must be '1' for the tunnel_id field to be configured. */
19796 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID UINT32_C(0x2)
19797 	/* This bit must be '1' for the src_macaddr field to be configured. */
19798 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR UINT32_C(0x4)
19799 	/* This bit must be '1' for the dst_macaddr field to be configured. */
19800 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR UINT32_C(0x8)
19801 	/* This bit must be '1' for the ovlan_vid field to be configured. */
19802 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID UINT32_C(0x10)
19803 	/* This bit must be '1' for the ivlan_vid field to be configured. */
19804 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID UINT32_C(0x20)
19805 	/* This bit must be '1' for the t_ovlan_vid field to be configured. */
19806 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID UINT32_C(0x40)
19807 	/* This bit must be '1' for the t_ivlan_vid field to be configured. */
19808 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID UINT32_C(0x80)
19809 	/* This bit must be '1' for the ethertype field to be configured. */
19810 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE UINT32_C(0x100)
19811 	/* This bit must be '1' for the src_ipaddr field to be configured. */
19812 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR UINT32_C(0x200)
19813 	/* This bit must be '1' for the dst_ipaddr field to be configured. */
19814 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR UINT32_C(0x400)
19815 	/* This bit must be '1' for the ipaddr_type field to be configured. */
19816 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE UINT32_C(0x800)
19817 	/* This bit must be '1' for the ip_protocol field to be configured. */
19818 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL UINT32_C(0x1000)
19819 	/* This bit must be '1' for the src_port field to be configured. */
19820 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT UINT32_C(0x2000)
19821 	/* This bit must be '1' for the dst_port field to be configured. */
19822 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT UINT32_C(0x4000)
19823 	/* This bit must be '1' for the dst_id field to be configured. */
19824 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID   UINT32_C(0x8000)
19825 	/* This bit must be '1' for the mirror_vnic_id field to be configured. */
19826 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID UINT32_C(0x10000)
19827 	uint32_t tunnel_id;
19828 	/*
19829 	 * Tunnel identifier. Virtual Network Identifier (VNI). Only valid with
19830 	 * tunnel_types VXLAN, NVGRE, and Geneve. Only lower 24-bits of VNI
19831 	 * field are used in setting up the filter.
19832 	 */
19833 	uint8_t tunnel_type;
19834 	/* Tunnel Type. */
19835 	/* Non-tunnel */
19836 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0)
19837 	/* Virtual eXtensible Local Area Network (VXLAN) */
19838 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
19839 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
19840 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2)
19841 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
19842 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
19843 	/* IP in IP */
19844 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
19845 	/* Generic Network Virtualization Encapsulation (Geneve) */
19846 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
19847 	/* Multi-Protocol Lable Switching (MPLS) */
19848 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
19849 	/* Stateless Transport Tunnel (STT) */
19850 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
19851 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
19852 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
19853 	/* Any tunneled traffic */
19854 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff)
19855 	uint8_t unused_0;
19856 	uint16_t unused_1;
19857 	uint8_t src_macaddr[6];
19858 	/* This value indicates the source MAC address in the Ethernet header. */
19859 	uint8_t unused_2;
19860 	uint8_t unused_3;
19861 	uint8_t dst_macaddr[6];
19862 	/*
19863 	 * This value indicates the destination MAC address in the Ethernet
19864 	 * header.
19865 	 */
19866 	uint16_t ovlan_vid;
19867 	/*
19868 	 * This value indicates the VLAN ID of the outer VLAN tag in the
19869 	 * Ethernet header.
19870 	 */
19871 	uint16_t ivlan_vid;
19872 	/*
19873 	 * This value indicates the VLAN ID of the inner VLAN tag in the
19874 	 * Ethernet header.
19875 	 */
19876 	uint16_t t_ovlan_vid;
19877 	/*
19878 	 * This value indicates the VLAN ID of the outer VLAN tag in the tunnel
19879 	 * Ethernet header.
19880 	 */
19881 	uint16_t t_ivlan_vid;
19882 	/*
19883 	 * This value indicates the VLAN ID of the inner VLAN tag in the tunnel
19884 	 * Ethernet header.
19885 	 */
19886 	uint16_t ethertype; /* big endian */
19887 	/* This value indicates the ethertype in the Ethernet header. */
19888 	uint8_t ip_addr_type;
19889 	/*
19890 	 * This value indicates the type of IP address. 4 - IPv4 6 - IPv6 All
19891 	 * others are invalid.
19892 	 */
19893 	/* invalid */
19894 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
19895 	/* IPv4 */
19896 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4)
19897 	/* IPv6 */
19898 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6)
19899 	uint8_t ip_protocol;
19900 	/*
19901 	 * The value of protocol filed in IP header. Applies to UDP and TCP
19902 	 * traffic. 6 - TCP 17 - UDP
19903 	 */
19904 	/* invalid */
19905 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
19906 	/* TCP */
19907 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6)
19908 	/* UDP */
19909 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11)
19910 	uint8_t unused_4;
19911 	uint8_t unused_5;
19912 	uint8_t unused_6[3];
19913 	uint8_t unused_7;
19914 	uint32_t src_ipaddr[4]; /* big endian */
19915 	/*
19916 	 * The value of source IP address to be used in filtering. For IPv4,
19917 	 * first four bytes represent the IP address.
19918 	 */
19919 	uint32_t dst_ipaddr[4]; /* big endian */
19920 	/*
19921 	 * The value of destination IP address to be used in filtering. For
19922 	 * IPv4, first four bytes represent the IP address.
19923 	 */
19924 	uint16_t src_port; /* big endian */
19925 	/*
19926 	 * The value of source port to be used in filtering. Applies to UDP and
19927 	 * TCP traffic.
19928 	 */
19929 	uint16_t dst_port; /* big endian */
19930 	/*
19931 	 * The value of destination port to be used in filtering. Applies to UDP
19932 	 * and TCP traffic.
19933 	 */
19934 	uint16_t dst_id;
19935 	/*
19936 	 * If set, this value shall represent the Logical VNIC ID of the
19937 	 * destination VNIC for the RX path.
19938 	 */
19939 	uint16_t l2_ctxt_ref_id;
19940 	/*
19941 	 * If set, this value shall represent the L2 context that matches the L2
19942 	 * information of the decap filter.
19943 	 */
19944 } __attribute__((packed));
19945 
19946 /* Output (16 bytes) */
19947 
19948 struct hwrm_cfa_decap_filter_alloc_output {
19949 	uint16_t error_code;
19950 	/*
19951 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
19952 	 * and fail the call with an error when appropriate
19953 	 */
19954 	uint16_t req_type;
19955 	/* This field returns the type of original request. */
19956 	uint16_t seq_id;
19957 	/* This field provides original sequence number of the command. */
19958 	uint16_t resp_len;
19959 	/*
19960 	 * This field is the length of the response in bytes. The last byte of
19961 	 * the response is a valid flag that will read as '1' when the command
19962 	 * has been completely written to memory.
19963 	 */
19964 	uint32_t decap_filter_id;
19965 	/* This value is an opaque id into CFA data structures. */
19966 	uint8_t unused_0;
19967 	uint8_t unused_1;
19968 	uint8_t unused_2;
19969 	uint8_t valid;
19970 	/*
19971 	 * This field is used in Output records to indicate that the output is
19972 	 * completely written to RAM. This field should be read as '1' to
19973 	 * indicate that the output has been completely written. When writing a
19974 	 * command completion or response to an internal processor, the order of
19975 	 * writes has to be such that this field is written last.
19976 	 */
19977 } __attribute__((packed));
19978 
19979 /* hwrm_cfa_decap_filter_free */
19980 /* Description: Free an decap filter table entry */
19981 /* Input (24 bytes) */
19982 
19983 struct hwrm_cfa_decap_filter_free_input {
19984 	uint16_t req_type;
19985 	/*
19986 	 * This value indicates what type of request this is. The format for the
19987 	 * rest of the command is determined by this field.
19988 	 */
19989 	uint16_t cmpl_ring;
19990 	/*
19991 	 * This value indicates the what completion ring the request will be
19992 	 * optionally completed on. If the value is -1, then no CR completion
19993 	 * will be generated. Any other value must be a valid CR ring_id value
19994 	 * for this function.
19995 	 */
19996 	uint16_t seq_id;
19997 	/* This value indicates the command sequence number. */
19998 	uint16_t target_id;
19999 	/*
20000 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20001 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20002 	 */
20003 	uint64_t resp_addr;
20004 	/*
20005 	 * This is the host address where the response will be written when the
20006 	 * request is complete. This area must be 16B aligned and must be
20007 	 * cleared to zero before the request is made.
20008 	 */
20009 	uint32_t decap_filter_id;
20010 	/* This value is an opaque id into CFA data structures. */
20011 	uint32_t unused_0;
20012 } __attribute__((packed));
20013 
20014 /* Output (16 bytes) */
20015 
20016 struct hwrm_cfa_decap_filter_free_output {
20017 	uint16_t error_code;
20018 	/*
20019 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20020 	 * and fail the call with an error when appropriate
20021 	 */
20022 	uint16_t req_type;
20023 	/* This field returns the type of original request. */
20024 	uint16_t seq_id;
20025 	/* This field provides original sequence number of the command. */
20026 	uint16_t resp_len;
20027 	/*
20028 	 * This field is the length of the response in bytes. The last byte of
20029 	 * the response is a valid flag that will read as '1' when the command
20030 	 * has been completely written to memory.
20031 	 */
20032 	uint32_t unused_0;
20033 	uint8_t unused_1;
20034 	uint8_t unused_2;
20035 	uint8_t unused_3;
20036 	uint8_t valid;
20037 	/*
20038 	 * This field is used in Output records to indicate that the output is
20039 	 * completely written to RAM. This field should be read as '1' to
20040 	 * indicate that the output has been completely written. When writing a
20041 	 * command completion or response to an internal processor, the order of
20042 	 * writes has to be such that this field is written last.
20043 	 */
20044 } __attribute__((packed));
20045 
20046 /* hwrm_cfa_flow_alloc */
20047 /* Description: Flow is added to table and resources are allocated. */
20048 /* Input (128 bytes) */
20049 
20050 struct hwrm_cfa_flow_alloc_input {
20051 	uint16_t req_type;
20052 	/*
20053 	 * This value indicates what type of request this is. The format for the
20054 	 * rest of the command is determined by this field.
20055 	 */
20056 	uint16_t cmpl_ring;
20057 	/*
20058 	 * This value indicates the what completion ring the request will be
20059 	 * optionally completed on. If the value is -1, then no CR completion
20060 	 * will be generated. Any other value must be a valid CR ring_id value
20061 	 * for this function.
20062 	 */
20063 	uint16_t seq_id;
20064 	/* This value indicates the command sequence number. */
20065 	uint16_t target_id;
20066 	/*
20067 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20068 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20069 	 */
20070 	uint64_t resp_addr;
20071 	/*
20072 	 * This is the host address where the response will be written when the
20073 	 * request is complete. This area must be 16B aligned and must be
20074 	 * cleared to zero before the request is made.
20075 	 */
20076 	uint16_t flags;
20077 	/* tunnel is 1 b */
20078 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL		UINT32_C(0x1)
20079 	/* num_vlan is 2 b */
20080 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK	UINT32_C(0x6)
20081 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT	1
20082 	/* no tags */
20083 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE	(UINT32_C(0x0) << 1)
20084 	/* 1 tag */
20085 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE	(UINT32_C(0x1) << 1)
20086 	/* 2 tags */
20087 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO	(UINT32_C(0x2) << 1)
20088 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
20089 	/* Enumeration denoting the Flow Type. */
20090 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK	UINT32_C(0x38)
20091 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT	3
20092 	/* L2 flow */
20093 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2	(UINT32_C(0x0) << 3)
20094 	/* IPV4 flow */
20095 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4	(UINT32_C(0x1) << 3)
20096 	/* IPV6 flow */
20097 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6	(UINT32_C(0x2) << 3)
20098 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
20099 	uint16_t src_fid;
20100 	/* Tx Flow: vf fid. Rx Flow: pf fid. */
20101 	uint32_t tunnel_handle;
20102 	/* Tunnel handle valid when tunnel flag is set. */
20103 	uint16_t action_flags;
20104 	/*
20105 	 * Setting of this flag indicates drop action. If this flag is not set,
20106 	 * then it should be considered accept action.
20107 	 */
20108 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD	UINT32_C(0x1)
20109 	/* recycle is 1 b */
20110 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE	UINT32_C(0x2)
20111 	/*
20112 	 * Setting of this flag indicates drop action. If this flag is not set,
20113 	 * then it should be considered accept action.
20114 	 */
20115 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP	UINT32_C(0x4)
20116 	/* meter is 1 b */
20117 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER	UINT32_C(0x8)
20118 	/* tunnel is 1 b */
20119 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL	UINT32_C(0x10)
20120 	/* nat_src is 1 b */
20121 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC	UINT32_C(0x20)
20122 	/* nat_dest is 1 b */
20123 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST	UINT32_C(0x40)
20124 	/* nat_ipv4_address is 1 b */
20125 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS UINT32_C(0x80)
20126 	/* l2_header_rewrite is 1 b */
20127 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE UINT32_C(0x100)
20128 	/* ttl_decrement is 1 b */
20129 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT UINT32_C(0x200)
20130 	uint16_t dst_fid;
20131 	/* Tx Flow: pf or vf fid. Rx Flow: vf fid. */
20132 	uint16_t l2_rewrite_vlan_tpid; /* big endian */
20133 	/* VLAN tpid, valid when push_vlan flag is set. */
20134 	uint16_t l2_rewrite_vlan_tci; /* big endian */
20135 	/* VLAN tci, valid when push_vlan flag is set. */
20136 	uint16_t act_meter_id;
20137 	/* Meter id, valid when meter flag is set. */
20138 	uint16_t ref_flow_handle;
20139 	/* Flow with the same l2 context tcam key. */
20140 	uint16_t ethertype; /* big endian */
20141 	/* This value sets the match value for the ethertype. */
20142 	uint16_t outer_vlan_tci; /* big endian */
20143 	/* valid when num tags is 1 or 2. */
20144 	uint16_t dmac[3]; /* big endian */
20145 	/* This value sets the match value for the Destination MAC address. */
20146 	uint16_t inner_vlan_tci; /* big endian */
20147 	/* valid when num tags is 2. */
20148 	uint16_t smac[3]; /* big endian */
20149 	/* This value sets the match value for the Source MAC address. */
20150 	uint8_t ip_dst_mask_len;
20151 	/* The bit length of destination IP address mask. */
20152 	uint8_t ip_src_mask_len;
20153 	/* The bit length of source IP address mask. */
20154 	uint32_t ip_dst[4]; /* big endian */
20155 	/* The value of destination IPv4/IPv6 address. */
20156 	uint32_t ip_src[4]; /* big endian */
20157 	/* The source IPv4/IPv6 address. */
20158 	uint16_t l4_src_port; /* big endian */
20159 	/* The value of source port. Applies to UDP and TCP traffic. */
20160 	uint16_t l4_src_port_mask; /* big endian */
20161 	/* The value of source port mask. Applies to UDP and TCP traffic. */
20162 	uint16_t l4_dst_port; /* big endian */
20163 	/* The value of destination port. Applies to UDP and TCP traffic. */
20164 	uint16_t l4_dst_port_mask; /* big endian */
20165 	/* The value of destination port mask. Applies to UDP and TCP traffic. */
20166 	uint32_t nat_ip_address[4]; /* big endian */
20167 	/* NAT IPv4/6 address based on address type flag. 0 values are ignored. */
20168 	uint16_t l2_rewrite_dmac[3]; /* big endian */
20169 	/* L2 header re-write Destination MAC address. */
20170 	uint16_t nat_port; /* big endian */
20171 	/*
20172 	 * The NAT source/destination port based on direction flag. Applies to
20173 	 * UDP and TCP traffic. 0 values are ignored.
20174 	 */
20175 	uint16_t l2_rewrite_smac[3]; /* big endian */
20176 	/* L2 header re-write Source MAC address. */
20177 	uint8_t ip_proto;
20178 	/* The value of ip protocol. */
20179 	uint8_t unused_0;
20180 } __attribute__((packed));
20181 
20182 /* Output (16 bytes) */
20183 
20184 struct hwrm_cfa_flow_alloc_output {
20185 	uint16_t error_code;
20186 	/*
20187 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20188 	 * and fail the call with an error when appropriate
20189 	 */
20190 	uint16_t req_type;
20191 	/* This field returns the type of original request. */
20192 	uint16_t seq_id;
20193 	/* This field provides original sequence number of the command. */
20194 	uint16_t resp_len;
20195 	/*
20196 	 * This field is the length of the response in bytes. The last byte of
20197 	 * the response is a valid flag that will read as '1' when the command
20198 	 * has been completely written to memory.
20199 	 */
20200 	uint16_t flow_handle;
20201 	/* Flow record index. */
20202 	uint8_t unused_0;
20203 	uint8_t unused_1;
20204 	uint8_t unused_2;
20205 	uint8_t unused_3;
20206 	uint8_t unused_4;
20207 	uint8_t valid;
20208 	/*
20209 	 * This field is used in Output records to indicate that the output is
20210 	 * completely written to RAM. This field should be read as '1' to
20211 	 * indicate that the output has been completely written. When writing a
20212 	 * command completion or response to an internal processor, the order of
20213 	 * writes has to be such that this field is written last.
20214 	 */
20215 } __attribute__((packed));
20216 
20217 /* hwrm_cfa_flow_free */
20218 /* Description: Flow is removed from table and resources are released. */
20219 /* Input (24 bytes) */
20220 
20221 struct hwrm_cfa_flow_free_input {
20222 	uint16_t req_type;
20223 	/*
20224 	 * This value indicates what type of request this is. The format for the
20225 	 * rest of the command is determined by this field.
20226 	 */
20227 	uint16_t cmpl_ring;
20228 	/*
20229 	 * This value indicates the what completion ring the request will be
20230 	 * optionally completed on. If the value is -1, then no CR completion
20231 	 * will be generated. Any other value must be a valid CR ring_id value
20232 	 * for this function.
20233 	 */
20234 	uint16_t seq_id;
20235 	/* This value indicates the command sequence number. */
20236 	uint16_t target_id;
20237 	/*
20238 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20239 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20240 	 */
20241 	uint64_t resp_addr;
20242 	/*
20243 	 * This is the host address where the response will be written when the
20244 	 * request is complete. This area must be 16B aligned and must be
20245 	 * cleared to zero before the request is made.
20246 	 */
20247 	uint16_t flow_handle;
20248 	/* Flow record index. */
20249 	uint16_t unused_0[3];
20250 } __attribute__((packed));
20251 
20252 /* Output (32 bytes) */
20253 
20254 struct hwrm_cfa_flow_free_output {
20255 	uint16_t error_code;
20256 	/*
20257 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20258 	 * and fail the call with an error when appropriate
20259 	 */
20260 	uint16_t req_type;
20261 	/* This field returns the type of original request. */
20262 	uint16_t seq_id;
20263 	/* This field provides original sequence number of the command. */
20264 	uint16_t resp_len;
20265 	/*
20266 	 * This field is the length of the response in bytes. The last byte of
20267 	 * the response is a valid flag that will read as '1' when the command
20268 	 * has been completely written to memory.
20269 	 */
20270 	uint64_t packet;
20271 	/* packet is 64 b */
20272 	uint64_t byte;
20273 	/* byte is 64 b */
20274 	uint32_t unused_0;
20275 	uint8_t unused_1;
20276 	uint8_t unused_2;
20277 	uint8_t unused_3;
20278 	uint8_t valid;
20279 	/*
20280 	 * This field is used in Output records to indicate that the output is
20281 	 * completely written to RAM. This field should be read as '1' to
20282 	 * indicate that the output has been completely written. When writing a
20283 	 * command completion or response to an internal processor, the order of
20284 	 * writes has to be such that this field is written last.
20285 	 */
20286 } __attribute__((packed));
20287 
20288 /* hwrm_cfa_flow_info */
20289 /* Description: Flow record content for specified flow is returned. */
20290 /* Input (24 bytes) */
20291 
20292 struct hwrm_cfa_flow_info_input {
20293 	uint16_t req_type;
20294 	/*
20295 	 * This value indicates what type of request this is. The format for the
20296 	 * rest of the command is determined by this field.
20297 	 */
20298 	uint16_t cmpl_ring;
20299 	/*
20300 	 * This value indicates the what completion ring the request will be
20301 	 * optionally completed on. If the value is -1, then no CR completion
20302 	 * will be generated. Any other value must be a valid CR ring_id value
20303 	 * for this function.
20304 	 */
20305 	uint16_t seq_id;
20306 	/* This value indicates the command sequence number. */
20307 	uint16_t target_id;
20308 	/*
20309 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20310 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20311 	 */
20312 	uint64_t resp_addr;
20313 	/*
20314 	 * This is the host address where the response will be written when the
20315 	 * request is complete. This area must be 16B aligned and must be
20316 	 * cleared to zero before the request is made.
20317 	 */
20318 	uint16_t flow_handle;
20319 	/* Flow record index. */
20320 	/* Max flow handle */
20321 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK	UINT32_C(0xfff)
20322 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT	0
20323 	/* CNP flow handle */
20324 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT	UINT32_C(0x1000)
20325 	/* Reserved */
20326 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_RESERVED_MASK UINT32_C(0x6000)
20327 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_RESERVED_SFT  13
20328 	/* Direction rx = 1 */
20329 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX	UINT32_C(0x8000)
20330 	uint16_t unused_0[3];
20331 } __attribute__((packed));
20332 
20333 /* Output (56 bytes) */
20334 
20335 struct hwrm_cfa_flow_info_output {
20336 	uint16_t error_code;
20337 	/*
20338 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20339 	 * and fail the call with an error when appropriate
20340 	 */
20341 	uint16_t req_type;
20342 	/* This field returns the type of original request. */
20343 	uint16_t seq_id;
20344 	/* This field provides original sequence number of the command. */
20345 	uint16_t resp_len;
20346 	/*
20347 	 * This field is the length of the response in bytes. The last byte of
20348 	 * the response is a valid flag that will read as '1' when the command
20349 	 * has been completely written to memory.
20350 	 */
20351 	uint8_t flags;
20352 	/* flags is 8 b */
20353 	uint8_t profile;
20354 	/* profile is 8 b */
20355 	uint16_t src_fid;
20356 	/* src_fid is 16 b */
20357 	uint16_t dst_fid;
20358 	/* dst_fid is 16 b */
20359 	uint16_t l2_ctxt_id;
20360 	/* l2_ctxt_id is 16 b */
20361 	uint64_t em_info;
20362 	/* em_info is 64 b */
20363 	uint64_t tcam_info;
20364 	/* tcam_info is 64 b */
20365 	uint64_t vfp_tcam_info;
20366 	/* vfp_tcam_info is 64 b */
20367 	uint16_t ar_id;
20368 	/* ar_id is 16 b */
20369 	uint16_t flow_handle;
20370 	/* flow_handle is 16 b */
20371 	uint32_t tunnel_handle;
20372 	/* tunnel_handle is 32 b */
20373 	uint32_t unused_0;
20374 	uint8_t unused_1;
20375 	uint8_t unused_2;
20376 	uint8_t unused_3;
20377 	uint8_t valid;
20378 	/*
20379 	 * This field is used in Output records to indicate that the output is
20380 	 * completely written to RAM. This field should be read as '1' to
20381 	 * indicate that the output has been completely written. When writing a
20382 	 * command completion or response to an internal processor, the order of
20383 	 * writes has to be such that this field is written last.
20384 	 */
20385 } __attribute__((packed));
20386 
20387 /* hwrm_cfa_flow_flush */
20388 /* Description: All flows are removed from table and resources are released. */
20389 /* Input (24 bytes) */
20390 
20391 struct hwrm_cfa_flow_flush_input {
20392 	uint16_t req_type;
20393 	/*
20394 	 * This value indicates what type of request this is. The format for the
20395 	 * rest of the command is determined by this field.
20396 	 */
20397 	uint16_t cmpl_ring;
20398 	/*
20399 	 * This value indicates the what completion ring the request will be
20400 	 * optionally completed on. If the value is -1, then no CR completion
20401 	 * will be generated. Any other value must be a valid CR ring_id value
20402 	 * for this function.
20403 	 */
20404 	uint16_t seq_id;
20405 	/* This value indicates the command sequence number. */
20406 	uint16_t target_id;
20407 	/*
20408 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20409 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20410 	 */
20411 	uint64_t resp_addr;
20412 	/*
20413 	 * This is the host address where the response will be written when the
20414 	 * request is complete. This area must be 16B aligned and must be
20415 	 * cleared to zero before the request is made.
20416 	 */
20417 	uint32_t flags;
20418 	uint32_t unused_0;
20419 } __attribute__((packed));
20420 
20421 /* Output (16 bytes) */
20422 
20423 struct hwrm_cfa_flow_flush_output {
20424 	uint16_t error_code;
20425 	/*
20426 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20427 	 * and fail the call with an error when appropriate
20428 	 */
20429 	uint16_t req_type;
20430 	/* This field returns the type of original request. */
20431 	uint16_t seq_id;
20432 	/* This field provides original sequence number of the command. */
20433 	uint16_t resp_len;
20434 	/*
20435 	 * This field is the length of the response in bytes. The last byte of
20436 	 * the response is a valid flag that will read as '1' when the command
20437 	 * has been completely written to memory.
20438 	 */
20439 	uint32_t unused_0;
20440 	uint8_t unused_1;
20441 	uint8_t unused_2;
20442 	uint8_t unused_3;
20443 	uint8_t valid;
20444 	/*
20445 	 * This field is used in Output records to indicate that the output is
20446 	 * completely written to RAM. This field should be read as '1' to
20447 	 * indicate that the output has been completely written. When writing a
20448 	 * command completion or response to an internal processor, the order of
20449 	 * writes has to be such that this field is written last.
20450 	 */
20451 } __attribute__((packed));
20452 
20453 /* hwrm_cfa_flow_stats */
20454 /* Description: Flow is removed from table and resources are released. */
20455 /* Input (40 bytes) */
20456 
20457 struct hwrm_cfa_flow_stats_input {
20458 	uint16_t req_type;
20459 	/*
20460 	 * This value indicates what type of request this is. The format for the
20461 	 * rest of the command is determined by this field.
20462 	 */
20463 	uint16_t cmpl_ring;
20464 	/*
20465 	 * This value indicates the what completion ring the request will be
20466 	 * optionally completed on. If the value is -1, then no CR completion
20467 	 * will be generated. Any other value must be a valid CR ring_id value
20468 	 * for this function.
20469 	 */
20470 	uint16_t seq_id;
20471 	/* This value indicates the command sequence number. */
20472 	uint16_t target_id;
20473 	/*
20474 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20475 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20476 	 */
20477 	uint64_t resp_addr;
20478 	/*
20479 	 * This is the host address where the response will be written when the
20480 	 * request is complete. This area must be 16B aligned and must be
20481 	 * cleared to zero before the request is made.
20482 	 */
20483 	uint16_t num_flows;
20484 	/* Flow handle. */
20485 	uint16_t flow_handle_0;
20486 	/* Flow handle. */
20487 	uint16_t flow_handle_1;
20488 	/* Flow handle. */
20489 	uint16_t flow_handle_2;
20490 	/* Flow handle. */
20491 	uint16_t flow_handle_3;
20492 	/* Flow handle. */
20493 	uint16_t flow_handle_4;
20494 	/* Flow handle. */
20495 	uint16_t flow_handle_5;
20496 	/* Flow handle. */
20497 	uint16_t flow_handle_6;
20498 	/* Flow handle. */
20499 	uint16_t flow_handle_7;
20500 	/* Flow handle. */
20501 	uint16_t flow_handle_8;
20502 	/* Flow handle. */
20503 	uint16_t flow_handle_9;
20504 	/* Flow handle. */
20505 	uint16_t unused_0;
20506 } __attribute__((packed));
20507 
20508 /* Output (176 bytes) */
20509 
20510 struct hwrm_cfa_flow_stats_output {
20511 	uint16_t error_code;
20512 	/*
20513 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20514 	 * and fail the call with an error when appropriate
20515 	 */
20516 	uint16_t req_type;
20517 	/* This field returns the type of original request. */
20518 	uint16_t seq_id;
20519 	/* This field provides original sequence number of the command. */
20520 	uint16_t resp_len;
20521 	/*
20522 	 * This field is the length of the response in bytes. The last byte of
20523 	 * the response is a valid flag that will read as '1' when the command
20524 	 * has been completely written to memory.
20525 	 */
20526 	uint64_t packet_0;
20527 	/* packet_0 is 64 b */
20528 	uint64_t packet_1;
20529 	/* packet_1 is 64 b */
20530 	uint64_t packet_2;
20531 	/* packet_2 is 64 b */
20532 	uint64_t packet_3;
20533 	/* packet_3 is 64 b */
20534 	uint64_t packet_4;
20535 	/* packet_4 is 64 b */
20536 	uint64_t packet_5;
20537 	/* packet_5 is 64 b */
20538 	uint64_t packet_6;
20539 	/* packet_6 is 64 b */
20540 	uint64_t packet_7;
20541 	/* packet_7 is 64 b */
20542 	uint64_t packet_8;
20543 	/* packet_8 is 64 b */
20544 	uint64_t packet_9;
20545 	/* packet_9 is 64 b */
20546 	uint64_t byte_0;
20547 	/* byte_0 is 64 b */
20548 	uint64_t byte_1;
20549 	/* byte_1 is 64 b */
20550 	uint64_t byte_2;
20551 	/* byte_2 is 64 b */
20552 	uint64_t byte_3;
20553 	/* byte_3 is 64 b */
20554 	uint64_t byte_4;
20555 	/* byte_4 is 64 b */
20556 	uint64_t byte_5;
20557 	/* byte_5 is 64 b */
20558 	uint64_t byte_6;
20559 	/* byte_6 is 64 b */
20560 	uint64_t byte_7;
20561 	/* byte_7 is 64 b */
20562 	uint64_t byte_8;
20563 	/* byte_8 is 64 b */
20564 	uint64_t byte_9;
20565 	/* byte_9 is 64 b */
20566 	uint32_t unused_0;
20567 	uint8_t unused_1;
20568 	uint8_t unused_2;
20569 	uint8_t unused_3;
20570 	uint8_t valid;
20571 	/*
20572 	 * This field is used in Output records to indicate that the output is
20573 	 * completely written to RAM. This field should be read as '1' to
20574 	 * indicate that the output has been completely written. When writing a
20575 	 * command completion or response to an internal processor, the order of
20576 	 * writes has to be such that this field is written last.
20577 	 */
20578 } __attribute__((packed));
20579 
20580 /* hwrm_cfa_vf_pair_alloc */
20581 /* Description: VF pair is added to table and resources are allocated. */
20582 /* Input (32 bytes) */
20583 
20584 struct hwrm_cfa_vf_pair_alloc_input {
20585 	uint16_t req_type;
20586 	/*
20587 	 * This value indicates what type of request this is. The format for the
20588 	 * rest of the command is determined by this field.
20589 	 */
20590 	uint16_t cmpl_ring;
20591 	/*
20592 	 * This value indicates the what completion ring the request will be
20593 	 * optionally completed on. If the value is -1, then no CR completion
20594 	 * will be generated. Any other value must be a valid CR ring_id value
20595 	 * for this function.
20596 	 */
20597 	uint16_t seq_id;
20598 	/* This value indicates the command sequence number. */
20599 	uint16_t target_id;
20600 	/*
20601 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20602 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20603 	 */
20604 	uint64_t resp_addr;
20605 	/*
20606 	 * This is the host address where the response will be written when the
20607 	 * request is complete. This area must be 16B aligned and must be
20608 	 * cleared to zero before the request is made.
20609 	 */
20610 	uint16_t vf_a_id;
20611 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
20612 	uint16_t vf_b_id;
20613 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
20614 	uint32_t unused_0;
20615 	char pair_name[32];
20616 	/* VF Pair name (32 byte string). */
20617 } __attribute__((packed));
20618 
20619 /* Output (16 bytes) */
20620 
20621 struct hwrm_cfa_vf_pair_alloc_output {
20622 	uint16_t error_code;
20623 	/*
20624 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20625 	 * and fail the call with an error when appropriate
20626 	 */
20627 	uint16_t req_type;
20628 	/* This field returns the type of original request. */
20629 	uint16_t seq_id;
20630 	/* This field provides original sequence number of the command. */
20631 	uint16_t resp_len;
20632 	/*
20633 	 * This field is the length of the response in bytes. The last byte of
20634 	 * the response is a valid flag that will read as '1' when the command
20635 	 * has been completely written to memory.
20636 	 */
20637 	uint32_t unused_0;
20638 	uint8_t unused_1;
20639 	uint8_t unused_2;
20640 	uint8_t unused_3;
20641 	uint8_t valid;
20642 	/*
20643 	 * This field is used in Output records to indicate that the output is
20644 	 * completely written to RAM. This field should be read as '1' to
20645 	 * indicate that the output has been completely written. When writing a
20646 	 * command completion or response to an internal processor, the order of
20647 	 * writes has to be such that this field is written last.
20648 	 */
20649 } __attribute__((packed));
20650 
20651 /* hwrm_cfa_vf_pair_free */
20652 /* Description: VF Pair is removed from table and resources are released. */
20653 /* Input (24 bytes) */
20654 
20655 struct hwrm_cfa_vf_pair_free_input {
20656 	uint16_t req_type;
20657 	/*
20658 	 * This value indicates what type of request this is. The format for the
20659 	 * rest of the command is determined by this field.
20660 	 */
20661 	uint16_t cmpl_ring;
20662 	/*
20663 	 * This value indicates the what completion ring the request will be
20664 	 * optionally completed on. If the value is -1, then no CR completion
20665 	 * will be generated. Any other value must be a valid CR ring_id value
20666 	 * for this function.
20667 	 */
20668 	uint16_t seq_id;
20669 	/* This value indicates the command sequence number. */
20670 	uint16_t target_id;
20671 	/*
20672 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20673 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20674 	 */
20675 	uint64_t resp_addr;
20676 	/*
20677 	 * This is the host address where the response will be written when the
20678 	 * request is complete. This area must be 16B aligned and must be
20679 	 * cleared to zero before the request is made.
20680 	 */
20681 	char pair_name[32];
20682 	/* VF Pair name (32 byte string). */
20683 } __attribute__((packed));
20684 
20685 /* Output (16 bytes) */
20686 
20687 struct hwrm_cfa_vf_pair_free_output {
20688 	uint16_t error_code;
20689 	/*
20690 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20691 	 * and fail the call with an error when appropriate
20692 	 */
20693 	uint16_t req_type;
20694 	/* This field returns the type of original request. */
20695 	uint16_t seq_id;
20696 	/* This field provides original sequence number of the command. */
20697 	uint16_t resp_len;
20698 	/*
20699 	 * This field is the length of the response in bytes. The last byte of
20700 	 * the response is a valid flag that will read as '1' when the command
20701 	 * has been completely written to memory.
20702 	 */
20703 	uint32_t unused_0;
20704 	uint8_t unused_1;
20705 	uint8_t unused_2;
20706 	uint8_t unused_3;
20707 	uint8_t valid;
20708 	/*
20709 	 * This field is used in Output records to indicate that the output is
20710 	 * completely written to RAM. This field should be read as '1' to
20711 	 * indicate that the output has been completely written. When writing a
20712 	 * command completion or response to an internal processor, the order of
20713 	 * writes has to be such that this field is written last.
20714 	 */
20715 } __attribute__((packed));
20716 
20717 /* hwrm_cfa_vf_pair_info */
20718 /* Description: VF pair information is returned. */
20719 /* Input (32 bytes) */
20720 
20721 struct hwrm_cfa_vf_pair_info_input {
20722 	uint16_t req_type;
20723 	/*
20724 	 * This value indicates what type of request this is. The format for the
20725 	 * rest of the command is determined by this field.
20726 	 */
20727 	uint16_t cmpl_ring;
20728 	/*
20729 	 * This value indicates the what completion ring the request will be
20730 	 * optionally completed on. If the value is -1, then no CR completion
20731 	 * will be generated. Any other value must be a valid CR ring_id value
20732 	 * for this function.
20733 	 */
20734 	uint16_t seq_id;
20735 	/* This value indicates the command sequence number. */
20736 	uint16_t target_id;
20737 	/*
20738 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20739 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20740 	 */
20741 	uint64_t resp_addr;
20742 	/*
20743 	 * This is the host address where the response will be written when the
20744 	 * request is complete. This area must be 16B aligned and must be
20745 	 * cleared to zero before the request is made.
20746 	 */
20747 	uint32_t flags;
20748 	/* If this flag is set, lookup by name else lookup by index. */
20749 	#define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE	UINT32_C(0x1)
20750 	uint16_t vf_pair_index;
20751 	/* vf pair table index. */
20752 	uint8_t unused_0;
20753 	uint8_t unused_1;
20754 	char vf_pair_name[32];
20755 	/* VF Pair name (32 byte string). */
20756 } __attribute__((packed));
20757 
20758 /* Output (64 bytes) */
20759 
20760 struct hwrm_cfa_vf_pair_info_output {
20761 	uint16_t error_code;
20762 	/*
20763 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20764 	 * and fail the call with an error when appropriate
20765 	 */
20766 	uint16_t req_type;
20767 	/* This field returns the type of original request. */
20768 	uint16_t seq_id;
20769 	/* This field provides original sequence number of the command. */
20770 	uint16_t resp_len;
20771 	/*
20772 	 * This field is the length of the response in bytes. The last byte of
20773 	 * the response is a valid flag that will read as '1' when the command
20774 	 * has been completely written to memory.
20775 	 */
20776 	uint16_t next_vf_pair_index;
20777 	/* vf pair table index. */
20778 	uint16_t vf_a_fid;
20779 	/* vf pair member a's vf_fid. */
20780 	uint16_t vf_a_index;
20781 	/* vf pair member a's Linux logical VF number. */
20782 	uint16_t vf_b_fid;
20783 	/* vf pair member b's vf_fid. */
20784 	uint16_t vf_b_index;
20785 	/* vf pair member a's Linux logical VF number. */
20786 	uint8_t pair_state;
20787 	/* vf pair state. */
20788 	/* Pair has been allocated */
20789 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
20790 	/* Both pair members are active */
20791 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE	UINT32_C(0x2)
20792 	uint8_t unused_0;
20793 	uint32_t unused_1;
20794 	char pair_name[32];
20795 	/* VF Pair name (32 byte string). */
20796 	uint32_t unused_2;
20797 	uint8_t unused_3;
20798 	uint8_t unused_4;
20799 	uint8_t unused_5;
20800 	uint8_t valid;
20801 	/*
20802 	 * This field is used in Output records to indicate that the output is
20803 	 * completely written to RAM. This field should be read as '1' to
20804 	 * indicate that the output has been completely written. When writing a
20805 	 * command completion or response to an internal processor, the order of
20806 	 * writes has to be such that this field is written last.
20807 	 */
20808 } __attribute__((packed));
20809 
20810 /* hwrm_cfa_vfr_alloc */
20811 /* Description: VF-R is added to table and resources are allocated. */
20812 /* Input (32 bytes) */
20813 
20814 struct hwrm_cfa_vfr_alloc_input {
20815 	uint16_t req_type;
20816 	/*
20817 	 * This value indicates what type of request this is. The format for the
20818 	 * rest of the command is determined by this field.
20819 	 */
20820 	uint16_t cmpl_ring;
20821 	/*
20822 	 * This value indicates the what completion ring the request will be
20823 	 * optionally completed on. If the value is -1, then no CR completion
20824 	 * will be generated. Any other value must be a valid CR ring_id value
20825 	 * for this function.
20826 	 */
20827 	uint16_t seq_id;
20828 	/* This value indicates the command sequence number. */
20829 	uint16_t target_id;
20830 	/*
20831 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20832 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20833 	 */
20834 	uint64_t resp_addr;
20835 	/*
20836 	 * This is the host address where the response will be written when the
20837 	 * request is complete. This area must be 16B aligned and must be
20838 	 * cleared to zero before the request is made.
20839 	 */
20840 	uint16_t vf_id;
20841 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
20842 	uint16_t reserved;
20843 	/* This field is reserved for the future use. It shall be set to 0. */
20844 	uint32_t unused_0;
20845 	char vfr_name[32];
20846 	/* VF Representor name (32 byte string). */
20847 } __attribute__((packed));
20848 
20849 /* Output (16 bytes) */
20850 
20851 struct hwrm_cfa_vfr_alloc_output {
20852 	uint16_t error_code;
20853 	/*
20854 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20855 	 * and fail the call with an error when appropriate
20856 	 */
20857 	uint16_t req_type;
20858 	/* This field returns the type of original request. */
20859 	uint16_t seq_id;
20860 	/* This field provides original sequence number of the command. */
20861 	uint16_t resp_len;
20862 	/*
20863 	 * This field is the length of the response in bytes. The last byte of
20864 	 * the response is a valid flag that will read as '1' when the command
20865 	 * has been completely written to memory.
20866 	 */
20867 	uint16_t rx_cfa_code;
20868 	/* Rx CFA code. */
20869 	uint16_t tx_cfa_action;
20870 	/* Tx CFA action. */
20871 	uint8_t unused_0;
20872 	uint8_t unused_1;
20873 	uint8_t unused_2;
20874 	uint8_t valid;
20875 	/*
20876 	 * This field is used in Output records to indicate that the output is
20877 	 * completely written to RAM. This field should be read as '1' to
20878 	 * indicate that the output has been completely written. When writing a
20879 	 * command completion or response to an internal processor, the order of
20880 	 * writes has to be such that this field is written last.
20881 	 */
20882 } __attribute__((packed));
20883 
20884 /* hwrm_cfa_vfr_free */
20885 /* Description: VF-R is removed from table and resources are released. */
20886 /* Input (24 bytes) */
20887 
20888 struct hwrm_cfa_vfr_free_input {
20889 	uint16_t req_type;
20890 	/*
20891 	 * This value indicates what type of request this is. The format for the
20892 	 * rest of the command is determined by this field.
20893 	 */
20894 	uint16_t cmpl_ring;
20895 	/*
20896 	 * This value indicates the what completion ring the request will be
20897 	 * optionally completed on. If the value is -1, then no CR completion
20898 	 * will be generated. Any other value must be a valid CR ring_id value
20899 	 * for this function.
20900 	 */
20901 	uint16_t seq_id;
20902 	/* This value indicates the command sequence number. */
20903 	uint16_t target_id;
20904 	/*
20905 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20906 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20907 	 */
20908 	uint64_t resp_addr;
20909 	/*
20910 	 * This is the host address where the response will be written when the
20911 	 * request is complete. This area must be 16B aligned and must be
20912 	 * cleared to zero before the request is made.
20913 	 */
20914 	char vfr_name[32];
20915 	/* VF Representor name (32 byte string). */
20916 } __attribute__((packed));
20917 
20918 /* Output (16 bytes) */
20919 
20920 struct hwrm_cfa_vfr_free_output {
20921 	uint16_t error_code;
20922 	/*
20923 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20924 	 * and fail the call with an error when appropriate
20925 	 */
20926 	uint16_t req_type;
20927 	/* This field returns the type of original request. */
20928 	uint16_t seq_id;
20929 	/* This field provides original sequence number of the command. */
20930 	uint16_t resp_len;
20931 	/*
20932 	 * This field is the length of the response in bytes. The last byte of
20933 	 * the response is a valid flag that will read as '1' when the command
20934 	 * has been completely written to memory.
20935 	 */
20936 	uint32_t unused_0;
20937 	uint8_t unused_1;
20938 	uint8_t unused_2;
20939 	uint8_t unused_3;
20940 	uint8_t valid;
20941 	/*
20942 	 * This field is used in Output records to indicate that the output is
20943 	 * completely written to RAM. This field should be read as '1' to
20944 	 * indicate that the output has been completely written. When writing a
20945 	 * command completion or response to an internal processor, the order of
20946 	 * writes has to be such that this field is written last.
20947 	 */
20948 } __attribute__((packed));
20949 
20950 /* hwrm_tunnel_dst_port_query */
20951 /*
20952  * Description: This function is called by a driver to query tunnel type
20953  * specific destination port configuration.
20954  */
20955 /* Input (24 bytes) */
20956 
20957 struct hwrm_tunnel_dst_port_query_input {
20958 	uint16_t req_type;
20959 	/*
20960 	 * This value indicates what type of request this is. The format for the
20961 	 * rest of the command is determined by this field.
20962 	 */
20963 	uint16_t cmpl_ring;
20964 	/*
20965 	 * This value indicates the what completion ring the request will be
20966 	 * optionally completed on. If the value is -1, then no CR completion
20967 	 * will be generated. Any other value must be a valid CR ring_id value
20968 	 * for this function.
20969 	 */
20970 	uint16_t seq_id;
20971 	/* This value indicates the command sequence number. */
20972 	uint16_t target_id;
20973 	/*
20974 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
20975 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
20976 	 */
20977 	uint64_t resp_addr;
20978 	/*
20979 	 * This is the host address where the response will be written when the
20980 	 * request is complete. This area must be 16B aligned and must be
20981 	 * cleared to zero before the request is made.
20982 	 */
20983 	uint8_t tunnel_type;
20984 	/* Tunnel Type. */
20985 	/* Virtual eXtensible Local Area Network (VXLAN) */
20986 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
20987 	/* Generic Network Virtualization Encapsulation (Geneve) */
20988 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
20989 	uint8_t unused_0[7];
20990 } __attribute__((packed));
20991 
20992 /* Output (16 bytes) */
20993 
20994 struct hwrm_tunnel_dst_port_query_output {
20995 	uint16_t error_code;
20996 	/*
20997 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
20998 	 * and fail the call with an error when appropriate
20999 	 */
21000 	uint16_t req_type;
21001 	/* This field returns the type of original request. */
21002 	uint16_t seq_id;
21003 	/* This field provides original sequence number of the command. */
21004 	uint16_t resp_len;
21005 	/*
21006 	 * This field is the length of the response in bytes. The last byte of
21007 	 * the response is a valid flag that will read as '1' when the command
21008 	 * has been completely written to memory.
21009 	 */
21010 	uint16_t tunnel_dst_port_id;
21011 	/*
21012 	 * This field represents the identifier of L4 destination port used for
21013 	 * the given tunnel type. This field is valid for specific tunnel types
21014 	 * that use layer 4 (e.g. UDP) transports for tunneling.
21015 	 */
21016 	uint16_t tunnel_dst_port_val; /* big endian */
21017 	/*
21018 	 * This field represents the value of L4 destination port identified by
21019 	 * tunnel_dst_port_id. This field is valid for specific tunnel types
21020 	 * that use layer 4 (e.g. UDP) transports for tunneling. This field is
21021 	 * in network byte order. A value of 0 means that the destination port
21022 	 * is not configured.
21023 	 */
21024 	uint8_t unused_0;
21025 	uint8_t unused_1;
21026 	uint8_t unused_2;
21027 	uint8_t valid;
21028 	/*
21029 	 * This field is used in Output records to indicate that the output is
21030 	 * completely written to RAM. This field should be read as '1' to
21031 	 * indicate that the output has been completely written. When writing a
21032 	 * command completion or response to an internal processor, the order of
21033 	 * writes has to be such that this field is written last.
21034 	 */
21035 } __attribute__((packed));
21036 
21037 /* hwrm_tunnel_dst_port_alloc */
21038 /*
21039  * Description: This function is called by a driver to allocate l4 destination
21040  * port for a specific tunnel type. The destination port value is provided in
21041  * the input. If the HWRM supports only one global destination port for a tunnel
21042  * type, then the HWRM shall keep track of its usage as described below. # The
21043  * first caller that allocates a destination port shall always succeed and the
21044  * HWRM shall save the destination port configuration for that tunnel type and
21045  * increment the usage count to 1. # Subsequent callers allocating the same
21046  * destination port for that tunnel type shall succeed and the HWRM shall
21047  * increment the usage count for that port for each subsequent caller that
21048  * succeeds. # Any subsequent caller trying to allocate a different destination
21049  * port for that tunnel type shall fail until the usage count for the original
21050  * destination port goes to zero. # A caller that frees a port will cause the
21051  * usage count for that port to decrement.
21052  */
21053 /* Input (24 bytes) */
21054 
21055 struct hwrm_tunnel_dst_port_alloc_input {
21056 	uint16_t req_type;
21057 	/*
21058 	 * This value indicates what type of request this is. The format for the
21059 	 * rest of the command is determined by this field.
21060 	 */
21061 	uint16_t cmpl_ring;
21062 	/*
21063 	 * This value indicates the what completion ring the request will be
21064 	 * optionally completed on. If the value is -1, then no CR completion
21065 	 * will be generated. Any other value must be a valid CR ring_id value
21066 	 * for this function.
21067 	 */
21068 	uint16_t seq_id;
21069 	/* This value indicates the command sequence number. */
21070 	uint16_t target_id;
21071 	/*
21072 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21073 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21074 	 */
21075 	uint64_t resp_addr;
21076 	/*
21077 	 * This is the host address where the response will be written when the
21078 	 * request is complete. This area must be 16B aligned and must be
21079 	 * cleared to zero before the request is made.
21080 	 */
21081 	uint8_t tunnel_type;
21082 	/* Tunnel Type. */
21083 	/* Virtual eXtensible Local Area Network (VXLAN) */
21084 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
21085 	/* Generic Network Virtualization Encapsulation (Geneve) */
21086 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
21087 	uint8_t unused_0;
21088 	uint16_t tunnel_dst_port_val; /* big endian */
21089 	/*
21090 	 * This field represents the value of L4 destination port used for the
21091 	 * given tunnel type. This field is valid for specific tunnel types that
21092 	 * use layer 4 (e.g. UDP) transports for tunneling. This field is in
21093 	 * network byte order. A value of 0 shall fail the command.
21094 	 */
21095 	uint32_t unused_1;
21096 } __attribute__((packed));
21097 
21098 /* Output (16 bytes) */
21099 
21100 struct hwrm_tunnel_dst_port_alloc_output {
21101 	uint16_t error_code;
21102 	/*
21103 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21104 	 * and fail the call with an error when appropriate
21105 	 */
21106 	uint16_t req_type;
21107 	/* This field returns the type of original request. */
21108 	uint16_t seq_id;
21109 	/* This field provides original sequence number of the command. */
21110 	uint16_t resp_len;
21111 	/*
21112 	 * This field is the length of the response in bytes. The last byte of
21113 	 * the response is a valid flag that will read as '1' when the command
21114 	 * has been completely written to memory.
21115 	 */
21116 	uint16_t tunnel_dst_port_id;
21117 	/*
21118 	 * Identifier of a tunnel L4 destination port value. Only applies to
21119 	 * tunnel types that has l4 destination port parameters.
21120 	 */
21121 	uint8_t unused_0;
21122 	uint8_t unused_1;
21123 	uint8_t unused_2;
21124 	uint8_t unused_3;
21125 	uint8_t unused_4;
21126 	uint8_t valid;
21127 	/*
21128 	 * This field is used in Output records to indicate that the output is
21129 	 * completely written to RAM. This field should be read as '1' to
21130 	 * indicate that the output has been completely written. When writing a
21131 	 * command completion or response to an internal processor, the order of
21132 	 * writes has to be such that this field is written last.
21133 	 */
21134 } __attribute__((packed));
21135 
21136 /* hwrm_tunnel_dst_port_free */
21137 /*
21138  * Description: This function is called by a driver to free l4 destination port
21139  * for a specific tunnel type.
21140  */
21141 /* Input (24 bytes) */
21142 
21143 struct hwrm_tunnel_dst_port_free_input {
21144 	uint16_t req_type;
21145 	/*
21146 	 * This value indicates what type of request this is. The format for the
21147 	 * rest of the command is determined by this field.
21148 	 */
21149 	uint16_t cmpl_ring;
21150 	/*
21151 	 * This value indicates the what completion ring the request will be
21152 	 * optionally completed on. If the value is -1, then no CR completion
21153 	 * will be generated. Any other value must be a valid CR ring_id value
21154 	 * for this function.
21155 	 */
21156 	uint16_t seq_id;
21157 	/* This value indicates the command sequence number. */
21158 	uint16_t target_id;
21159 	/*
21160 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21161 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21162 	 */
21163 	uint64_t resp_addr;
21164 	/*
21165 	 * This is the host address where the response will be written when the
21166 	 * request is complete. This area must be 16B aligned and must be
21167 	 * cleared to zero before the request is made.
21168 	 */
21169 	uint8_t tunnel_type;
21170 	/* Tunnel Type. */
21171 	/* Virtual eXtensible Local Area Network (VXLAN) */
21172 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
21173 	/* Generic Network Virtualization Encapsulation (Geneve) */
21174 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
21175 	uint8_t unused_0;
21176 	uint16_t tunnel_dst_port_id;
21177 	/*
21178 	 * Identifier of a tunnel L4 destination port value. Only applies to
21179 	 * tunnel types that has l4 destination port parameters.
21180 	 */
21181 	uint32_t unused_1;
21182 } __attribute__((packed));
21183 
21184 /* Output (16 bytes) */
21185 
21186 struct hwrm_tunnel_dst_port_free_output {
21187 	uint16_t error_code;
21188 	/*
21189 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21190 	 * and fail the call with an error when appropriate
21191 	 */
21192 	uint16_t req_type;
21193 	/* This field returns the type of original request. */
21194 	uint16_t seq_id;
21195 	/* This field provides original sequence number of the command. */
21196 	uint16_t resp_len;
21197 	/*
21198 	 * This field is the length of the response in bytes. The last byte of
21199 	 * the response is a valid flag that will read as '1' when the command
21200 	 * has been completely written to memory.
21201 	 */
21202 	uint32_t unused_0;
21203 	uint8_t unused_1;
21204 	uint8_t unused_2;
21205 	uint8_t unused_3;
21206 	uint8_t valid;
21207 	/*
21208 	 * This field is used in Output records to indicate that the output is
21209 	 * completely written to RAM. This field should be read as '1' to
21210 	 * indicate that the output has been completely written. When writing a
21211 	 * command completion or response to an internal processor, the order of
21212 	 * writes has to be such that this field is written last.
21213 	 */
21214 } __attribute__((packed));
21215 
21216 /* hwrm_stat_ctx_alloc */
21217 /*
21218  * Description: This command allocates and does basic preparation for a stat
21219  * context.
21220  */
21221 /* Input (32 bytes) */
21222 
21223 struct hwrm_stat_ctx_alloc_input {
21224 	uint16_t req_type;
21225 	/*
21226 	 * This value indicates what type of request this is. The format for the
21227 	 * rest of the command is determined by this field.
21228 	 */
21229 	uint16_t cmpl_ring;
21230 	/*
21231 	 * This value indicates the what completion ring the request will be
21232 	 * optionally completed on. If the value is -1, then no CR completion
21233 	 * will be generated. Any other value must be a valid CR ring_id value
21234 	 * for this function.
21235 	 */
21236 	uint16_t seq_id;
21237 	/* This value indicates the command sequence number. */
21238 	uint16_t target_id;
21239 	/*
21240 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21241 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21242 	 */
21243 	uint64_t resp_addr;
21244 	/*
21245 	 * This is the host address where the response will be written when the
21246 	 * request is complete. This area must be 16B aligned and must be
21247 	 * cleared to zero before the request is made.
21248 	 */
21249 	uint64_t stats_dma_addr;
21250 	/* This is the address for statistic block. */
21251 	uint32_t update_period_ms;
21252 	/*
21253 	 * The statistic block update period in ms. e.g. 250ms, 500ms, 750ms,
21254 	 * 1000ms. If update_period_ms is 0, then the stats update shall be
21255 	 * never done and the DMA address shall not be used. In this case, the
21256 	 * stat block can only be read by hwrm_stat_ctx_query command.
21257 	 */
21258 	uint8_t stat_ctx_flags;
21259 	/*
21260 	 * This field is used to specify statistics context specific
21261 	 * configuration flags.
21262 	 */
21263 	/*
21264 	 * When this bit is set to '1', the statistics context shall be
21265 	 * allocated for RoCE traffic only. In this case, traffic other than
21266 	 * offloaded RoCE traffic shall not be included in this statistic
21267 	 * context. When this bit is set to '0', the statistics context shall be
21268 	 * used for the network traffic other than offloaded RoCE traffic.
21269 	 */
21270 	#define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE	UINT32_C(0x1)
21271 	uint8_t unused_0[3];
21272 } __attribute__((packed));
21273 
21274 /* Output (16 bytes) */
21275 
21276 struct hwrm_stat_ctx_alloc_output {
21277 	uint16_t error_code;
21278 	/*
21279 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21280 	 * and fail the call with an error when appropriate
21281 	 */
21282 	uint16_t req_type;
21283 	/* This field returns the type of original request. */
21284 	uint16_t seq_id;
21285 	/* This field provides original sequence number of the command. */
21286 	uint16_t resp_len;
21287 	/*
21288 	 * This field is the length of the response in bytes. The last byte of
21289 	 * the response is a valid flag that will read as '1' when the command
21290 	 * has been completely written to memory.
21291 	 */
21292 	uint32_t stat_ctx_id;
21293 	/* This is the statistics context ID value. */
21294 	uint8_t unused_0;
21295 	uint8_t unused_1;
21296 	uint8_t unused_2;
21297 	uint8_t valid;
21298 	/*
21299 	 * This field is used in Output records to indicate that the output is
21300 	 * completely written to RAM. This field should be read as '1' to
21301 	 * indicate that the output has been completely written. When writing a
21302 	 * command completion or response to an internal processor, the order of
21303 	 * writes has to be such that this field is written last.
21304 	 */
21305 } __attribute__((packed));
21306 
21307 /* hwrm_stat_ctx_free */
21308 /* Description: This command is used to free a stat context. */
21309 /* Input (24 bytes) */
21310 
21311 struct hwrm_stat_ctx_free_input {
21312 	uint16_t req_type;
21313 	/*
21314 	 * This value indicates what type of request this is. The format for the
21315 	 * rest of the command is determined by this field.
21316 	 */
21317 	uint16_t cmpl_ring;
21318 	/*
21319 	 * This value indicates the what completion ring the request will be
21320 	 * optionally completed on. If the value is -1, then no CR completion
21321 	 * will be generated. Any other value must be a valid CR ring_id value
21322 	 * for this function.
21323 	 */
21324 	uint16_t seq_id;
21325 	/* This value indicates the command sequence number. */
21326 	uint16_t target_id;
21327 	/*
21328 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21329 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21330 	 */
21331 	uint64_t resp_addr;
21332 	/*
21333 	 * This is the host address where the response will be written when the
21334 	 * request is complete. This area must be 16B aligned and must be
21335 	 * cleared to zero before the request is made.
21336 	 */
21337 	uint32_t stat_ctx_id;
21338 	/* ID of the statistics context that is being queried. */
21339 	uint32_t unused_0;
21340 } __attribute__((packed));
21341 
21342 /* Output (16 bytes) */
21343 
21344 struct hwrm_stat_ctx_free_output {
21345 	uint16_t error_code;
21346 	/*
21347 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21348 	 * and fail the call with an error when appropriate
21349 	 */
21350 	uint16_t req_type;
21351 	/* This field returns the type of original request. */
21352 	uint16_t seq_id;
21353 	/* This field provides original sequence number of the command. */
21354 	uint16_t resp_len;
21355 	/*
21356 	 * This field is the length of the response in bytes. The last byte of
21357 	 * the response is a valid flag that will read as '1' when the command
21358 	 * has been completely written to memory.
21359 	 */
21360 	uint32_t stat_ctx_id;
21361 	/* This is the statistics context ID value. */
21362 	uint8_t unused_0;
21363 	uint8_t unused_1;
21364 	uint8_t unused_2;
21365 	uint8_t valid;
21366 	/*
21367 	 * This field is used in Output records to indicate that the output is
21368 	 * completely written to RAM. This field should be read as '1' to
21369 	 * indicate that the output has been completely written. When writing a
21370 	 * command completion or response to an internal processor, the order of
21371 	 * writes has to be such that this field is written last.
21372 	 */
21373 } __attribute__((packed));
21374 
21375 /* hwrm_stat_ctx_query */
21376 /* Description: This command returns statistics of a context. */
21377 /* Input (24 bytes) */
21378 
21379 struct hwrm_stat_ctx_query_input {
21380 	uint16_t req_type;
21381 	/*
21382 	 * This value indicates what type of request this is. The format for the
21383 	 * rest of the command is determined by this field.
21384 	 */
21385 	uint16_t cmpl_ring;
21386 	/*
21387 	 * This value indicates the what completion ring the request will be
21388 	 * optionally completed on. If the value is -1, then no CR completion
21389 	 * will be generated. Any other value must be a valid CR ring_id value
21390 	 * for this function.
21391 	 */
21392 	uint16_t seq_id;
21393 	/* This value indicates the command sequence number. */
21394 	uint16_t target_id;
21395 	/*
21396 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21397 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21398 	 */
21399 	uint64_t resp_addr;
21400 	/*
21401 	 * This is the host address where the response will be written when the
21402 	 * request is complete. This area must be 16B aligned and must be
21403 	 * cleared to zero before the request is made.
21404 	 */
21405 	uint32_t stat_ctx_id;
21406 	/* ID of the statistics context that is being queried. */
21407 	uint32_t unused_0;
21408 } __attribute__((packed));
21409 
21410 /* Output (176 bytes) */
21411 
21412 struct hwrm_stat_ctx_query_output {
21413 	uint16_t error_code;
21414 	/*
21415 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21416 	 * and fail the call with an error when appropriate
21417 	 */
21418 	uint16_t req_type;
21419 	/* This field returns the type of original request. */
21420 	uint16_t seq_id;
21421 	/* This field provides original sequence number of the command. */
21422 	uint16_t resp_len;
21423 	/*
21424 	 * This field is the length of the response in bytes. The last byte of
21425 	 * the response is a valid flag that will read as '1' when the command
21426 	 * has been completely written to memory.
21427 	 */
21428 	uint64_t tx_ucast_pkts;
21429 	/* Number of transmitted unicast packets */
21430 	uint64_t tx_mcast_pkts;
21431 	/* Number of transmitted multicast packets */
21432 	uint64_t tx_bcast_pkts;
21433 	/* Number of transmitted broadcast packets */
21434 	uint64_t tx_err_pkts;
21435 	/* Number of transmitted packets with error */
21436 	uint64_t tx_drop_pkts;
21437 	/* Number of dropped packets on transmit path */
21438 	uint64_t tx_ucast_bytes;
21439 	/* Number of transmitted bytes for unicast traffic */
21440 	uint64_t tx_mcast_bytes;
21441 	/* Number of transmitted bytes for multicast traffic */
21442 	uint64_t tx_bcast_bytes;
21443 	/* Number of transmitted bytes for broadcast traffic */
21444 	uint64_t rx_ucast_pkts;
21445 	/* Number of received unicast packets */
21446 	uint64_t rx_mcast_pkts;
21447 	/* Number of received multicast packets */
21448 	uint64_t rx_bcast_pkts;
21449 	/* Number of received broadcast packets */
21450 	uint64_t rx_err_pkts;
21451 	/* Number of received packets with error */
21452 	uint64_t rx_drop_pkts;
21453 	/* Number of dropped packets on received path */
21454 	uint64_t rx_ucast_bytes;
21455 	/* Number of received bytes for unicast traffic */
21456 	uint64_t rx_mcast_bytes;
21457 	/* Number of received bytes for multicast traffic */
21458 	uint64_t rx_bcast_bytes;
21459 	/* Number of received bytes for broadcast traffic */
21460 	uint64_t rx_agg_pkts;
21461 	/* Number of aggregated unicast packets */
21462 	uint64_t rx_agg_bytes;
21463 	/* Number of aggregated unicast bytes */
21464 	uint64_t rx_agg_events;
21465 	/* Number of aggregation events */
21466 	uint64_t rx_agg_aborts;
21467 	/* Number of aborted aggregations */
21468 	uint32_t unused_0;
21469 	uint8_t unused_1;
21470 	uint8_t unused_2;
21471 	uint8_t unused_3;
21472 	uint8_t valid;
21473 	/*
21474 	 * This field is used in Output records to indicate that the output is
21475 	 * completely written to RAM. This field should be read as '1' to
21476 	 * indicate that the output has been completely written. When writing a
21477 	 * command completion or response to an internal processor, the order of
21478 	 * writes has to be such that this field is written last.
21479 	 */
21480 } __attribute__((packed));
21481 
21482 /* hwrm_stat_ctx_clr_stats */
21483 /* Description: This command clears statistics of a context. */
21484 /* Input (24 bytes) */
21485 
21486 struct hwrm_stat_ctx_clr_stats_input {
21487 	uint16_t req_type;
21488 	/*
21489 	 * This value indicates what type of request this is. The format for the
21490 	 * rest of the command is determined by this field.
21491 	 */
21492 	uint16_t cmpl_ring;
21493 	/*
21494 	 * This value indicates the what completion ring the request will be
21495 	 * optionally completed on. If the value is -1, then no CR completion
21496 	 * will be generated. Any other value must be a valid CR ring_id value
21497 	 * for this function.
21498 	 */
21499 	uint16_t seq_id;
21500 	/* This value indicates the command sequence number. */
21501 	uint16_t target_id;
21502 	/*
21503 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21504 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21505 	 */
21506 	uint64_t resp_addr;
21507 	/*
21508 	 * This is the host address where the response will be written when the
21509 	 * request is complete. This area must be 16B aligned and must be
21510 	 * cleared to zero before the request is made.
21511 	 */
21512 	uint32_t stat_ctx_id;
21513 	/* ID of the statistics context that is being queried. */
21514 	uint32_t unused_0;
21515 } __attribute__((packed));
21516 
21517 /* Output (16 bytes) */
21518 
21519 struct hwrm_stat_ctx_clr_stats_output {
21520 	uint16_t error_code;
21521 	/*
21522 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21523 	 * and fail the call with an error when appropriate
21524 	 */
21525 	uint16_t req_type;
21526 	/* This field returns the type of original request. */
21527 	uint16_t seq_id;
21528 	/* This field provides original sequence number of the command. */
21529 	uint16_t resp_len;
21530 	/*
21531 	 * This field is the length of the response in bytes. The last byte of
21532 	 * the response is a valid flag that will read as '1' when the command
21533 	 * has been completely written to memory.
21534 	 */
21535 	uint32_t unused_0;
21536 	uint8_t unused_1;
21537 	uint8_t unused_2;
21538 	uint8_t unused_3;
21539 	uint8_t valid;
21540 	/*
21541 	 * This field is used in Output records to indicate that the output is
21542 	 * completely written to RAM. This field should be read as '1' to
21543 	 * indicate that the output has been completely written. When writing a
21544 	 * command completion or response to an internal processor, the order of
21545 	 * writes has to be such that this field is written last.
21546 	 */
21547 } __attribute__((packed));
21548 
21549 /* hwrm_fw_reset */
21550 /*
21551  * Description: This function is called by a driver to self reset the firmware
21552  * running on the processor indicated by the embedded_proc_type.
21553  */
21554 /* Input (24 bytes) */
21555 
21556 struct hwrm_fw_reset_input {
21557 	uint16_t req_type;
21558 	/*
21559 	 * This value indicates what type of request this is. The format for the
21560 	 * rest of the command is determined by this field.
21561 	 */
21562 	uint16_t cmpl_ring;
21563 	/*
21564 	 * This value indicates the what completion ring the request will be
21565 	 * optionally completed on. If the value is -1, then no CR completion
21566 	 * will be generated. Any other value must be a valid CR ring_id value
21567 	 * for this function.
21568 	 */
21569 	uint16_t seq_id;
21570 	/* This value indicates the command sequence number. */
21571 	uint16_t target_id;
21572 	/*
21573 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21574 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21575 	 */
21576 	uint64_t resp_addr;
21577 	/*
21578 	 * This is the host address where the response will be written when the
21579 	 * request is complete. This area must be 16B aligned and must be
21580 	 * cleared to zero before the request is made.
21581 	 */
21582 	uint8_t embedded_proc_type;
21583 	/* Type of embedded processor. */
21584 	/* Boot Processor */
21585 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT	UINT32_C(0x0)
21586 	/* Management Processor */
21587 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT	UINT32_C(0x1)
21588 	/* Network control processor */
21589 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL	UINT32_C(0x2)
21590 	/* RoCE control processor */
21591 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE	UINT32_C(0x3)
21592 	/*
21593 	 * Host (in multi-host environment): This is only valid if
21594 	 * requester is IPC
21595 	 */
21596 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST	UINT32_C(0x4)
21597 	uint8_t selfrst_status;
21598 	/* Type of self reset. */
21599 	/* No Self Reset */
21600 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
21601 	/* Self Reset as soon as possible to do so safely */
21602 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
21603 	/* Self Reset on PCIe Reset */
21604 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
21605 	uint8_t host_idx;
21606 	/*
21607 	 * Indicate which host is being reset. 0 means first host. Only valid
21608 	 * when embedded_proc_type is host in multihost environment
21609 	 */
21610 	uint8_t unused_0[5];
21611 } __attribute__((packed));
21612 
21613 /* Output (16 bytes) */
21614 
21615 struct hwrm_fw_reset_output {
21616 	uint16_t error_code;
21617 	/*
21618 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21619 	 * and fail the call with an error when appropriate
21620 	 */
21621 	uint16_t req_type;
21622 	/* This field returns the type of original request. */
21623 	uint16_t seq_id;
21624 	/* This field provides original sequence number of the command. */
21625 	uint16_t resp_len;
21626 	/*
21627 	 * This field is the length of the response in bytes. The last byte of
21628 	 * the response is a valid flag that will read as '1' when the command
21629 	 * has been completely written to memory.
21630 	 */
21631 	uint8_t selfrst_status;
21632 	/* Type of self reset. */
21633 	/* No Self Reset */
21634 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE   UINT32_C(0x0)
21635 	/* Self Reset as soon as possible to do so safely */
21636 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP   UINT32_C(0x1)
21637 	/* Self Reset on PCIe Reset */
21638 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
21639 	uint8_t unused_0;
21640 	uint16_t unused_1;
21641 	uint8_t unused_2;
21642 	uint8_t unused_3;
21643 	uint8_t unused_4;
21644 	uint8_t valid;
21645 	/*
21646 	 * This field is used in Output records to indicate that the output is
21647 	 * completely written to RAM. This field should be read as '1' to
21648 	 * indicate that the output has been completely written. When writing a
21649 	 * command completion or response to an internal processor, the order of
21650 	 * writes has to be such that this field is written last.
21651 	 */
21652 } __attribute__((packed));
21653 
21654 /* hwrm_fw_qstatus */
21655 /*
21656  * Description: This function is called by a driver to query the status of the
21657  * firmware running on the processor indicated by the embedded_proc_type.
21658  */
21659 /* Input (24 bytes) */
21660 
21661 struct hwrm_fw_qstatus_input {
21662 	uint16_t req_type;
21663 	/*
21664 	 * This value indicates what type of request this is. The format for the
21665 	 * rest of the command is determined by this field.
21666 	 */
21667 	uint16_t cmpl_ring;
21668 	/*
21669 	 * This value indicates the what completion ring the request will be
21670 	 * optionally completed on. If the value is -1, then no CR completion
21671 	 * will be generated. Any other value must be a valid CR ring_id value
21672 	 * for this function.
21673 	 */
21674 	uint16_t seq_id;
21675 	/* This value indicates the command sequence number. */
21676 	uint16_t target_id;
21677 	/*
21678 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21679 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21680 	 */
21681 	uint64_t resp_addr;
21682 	/*
21683 	 * This is the host address where the response will be written when the
21684 	 * request is complete. This area must be 16B aligned and must be
21685 	 * cleared to zero before the request is made.
21686 	 */
21687 	uint8_t embedded_proc_type;
21688 	/* Type of embedded processor. */
21689 	/* Boot Processor */
21690 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_BOOT	UINT32_C(0x0)
21691 	/* Management Processor */
21692 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_MGMT	UINT32_C(0x1)
21693 	/* Network control processor */
21694 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_NETCTRL  UINT32_C(0x2)
21695 	/* RoCE control processor */
21696 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_ROCE	UINT32_C(0x3)
21697 	/*
21698 	 * Host (in multi-host environment): This is only valid if
21699 	 * requester is IPC
21700 	 */
21701 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_HOST	UINT32_C(0x4)
21702 	uint8_t unused_0[7];
21703 } __attribute__((packed));
21704 
21705 /* Output (16 bytes) */
21706 
21707 struct hwrm_fw_qstatus_output {
21708 	uint16_t error_code;
21709 	/*
21710 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21711 	 * and fail the call with an error when appropriate
21712 	 */
21713 	uint16_t req_type;
21714 	/* This field returns the type of original request. */
21715 	uint16_t seq_id;
21716 	/* This field provides original sequence number of the command. */
21717 	uint16_t resp_len;
21718 	/*
21719 	 * This field is the length of the response in bytes. The last byte of
21720 	 * the response is a valid flag that will read as '1' when the command
21721 	 * has been completely written to memory.
21722 	 */
21723 	uint8_t selfrst_status;
21724 	/* Type of self reset. */
21725 	/* No Self Reset */
21726 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTNONE UINT32_C(0x0)
21727 	/* Self Reset as soon as possible to do so safely */
21728 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTASAP UINT32_C(0x1)
21729 	/* Self Reset on PCIe Reset */
21730 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
21731 	uint8_t unused_0;
21732 	uint16_t unused_1;
21733 	uint8_t unused_2;
21734 	uint8_t unused_3;
21735 	uint8_t unused_4;
21736 	uint8_t valid;
21737 	/*
21738 	 * This field is used in Output records to indicate that the output is
21739 	 * completely written to RAM. This field should be read as '1' to
21740 	 * indicate that the output has been completely written. When writing a
21741 	 * command completion or response to an internal processor, the order of
21742 	 * writes has to be such that this field is written last.
21743 	 */
21744 } __attribute__((packed));
21745 
21746 /* hwrm_fw_set_time */
21747 /*
21748  * Description: Inform the HWRM firmware of the current date/time. Ideally, the
21749  * date/time will be current time in GMT/UTC and the zone value will be 0
21750  * (indicating UTC). If the time zone is not known, the zone value shall be
21751  * 0xffff. Other values for zone are discouraged, but if specified, they
21752  * indicate the number of minutes east of UTC, while zones west of UTC are
21753  * represented with a 2's complement negative value (e.g. PST would be -480
21754  * while PDT would be -420).
21755  */
21756 /* Input (32 bytes) */
21757 
21758 struct hwrm_fw_set_time_input {
21759 	uint16_t req_type;
21760 	/*
21761 	 * This value indicates what type of request this is. The format for the
21762 	 * rest of the command is determined by this field.
21763 	 */
21764 	uint16_t cmpl_ring;
21765 	/*
21766 	 * This value indicates the what completion ring the request will be
21767 	 * optionally completed on. If the value is -1, then no CR completion
21768 	 * will be generated. Any other value must be a valid CR ring_id value
21769 	 * for this function.
21770 	 */
21771 	uint16_t seq_id;
21772 	/* This value indicates the command sequence number. */
21773 	uint16_t target_id;
21774 	/*
21775 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21776 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21777 	 */
21778 	uint64_t resp_addr;
21779 	/*
21780 	 * This is the host address where the response will be written when the
21781 	 * request is complete. This area must be 16B aligned and must be
21782 	 * cleared to zero before the request is made.
21783 	 */
21784 	uint16_t year;
21785 	/* Current year */
21786 	/* Date/time is not known */
21787 	#define HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN		UINT32_C(0x0)
21788 	uint8_t month;
21789 	/* Current month of year (1-12) */
21790 	uint8_t day;
21791 	/* Current day of month (1-31) */
21792 	uint8_t hour;
21793 	/* Current hour (0-23) */
21794 	uint8_t minute;
21795 	/* Current minute (0-59) */
21796 	uint8_t second;
21797 	/* Current second (0-59) */
21798 	uint8_t unused_0;
21799 	uint16_t millisecond;
21800 	/* Current millisecond (0-999) */
21801 	uint16_t zone;
21802 	/* Minutes east of UTC, 0xffff if TZ is not known */
21803 	/* Time zone is Coordinated Universal Time (UTC) */
21804 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UTC		UINT32_C(0x0)
21805 	/* Time zone is not known */
21806 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN		UINT32_C(0xffff)
21807 	uint32_t unused_1;
21808 } __attribute__((packed));
21809 
21810 /* Output (16 bytes) */
21811 
21812 struct hwrm_fw_set_time_output {
21813 	uint16_t error_code;
21814 	/*
21815 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21816 	 * and fail the call with an error when appropriate
21817 	 */
21818 	uint16_t req_type;
21819 	/* This field returns the type of original request. */
21820 	uint16_t seq_id;
21821 	/* This field provides original sequence number of the command. */
21822 	uint16_t resp_len;
21823 	/*
21824 	 * This field is the length of the response in bytes. The last byte of
21825 	 * the response is a valid flag that will read as '1' when the command
21826 	 * has been completely written to memory.
21827 	 */
21828 	uint32_t unused_0;
21829 	uint8_t unused_1;
21830 	uint8_t unused_2;
21831 	uint8_t unused_3;
21832 	uint8_t valid;
21833 	/*
21834 	 * This field is used in Output records to indicate that the output is
21835 	 * completely written to RAM. This field should be read as '1' to
21836 	 * indicate that the output has been completely written. When writing a
21837 	 * command completion or response to an internal processor, the order of
21838 	 * writes has to be such that this field is written last.
21839 	 */
21840 } __attribute__((packed));
21841 
21842 /* hwrm_fw_get_time */
21843 /* Description: Query the HWRM firmware's notion of the current date/time. */
21844 /* Input (16 bytes) */
21845 
21846 struct hwrm_fw_get_time_input {
21847 	uint16_t req_type;
21848 	/*
21849 	 * This value indicates what type of request this is. The format for the
21850 	 * rest of the command is determined by this field.
21851 	 */
21852 	uint16_t cmpl_ring;
21853 	/*
21854 	 * This value indicates the what completion ring the request will be
21855 	 * optionally completed on. If the value is -1, then no CR completion
21856 	 * will be generated. Any other value must be a valid CR ring_id value
21857 	 * for this function.
21858 	 */
21859 	uint16_t seq_id;
21860 	/* This value indicates the command sequence number. */
21861 	uint16_t target_id;
21862 	/*
21863 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21864 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21865 	 */
21866 	uint64_t resp_addr;
21867 	/*
21868 	 * This is the host address where the response will be written when the
21869 	 * request is complete. This area must be 16B aligned and must be
21870 	 * cleared to zero before the request is made.
21871 	 */
21872 } __attribute__((packed));
21873 
21874 /* Output (24 bytes) */
21875 
21876 struct hwrm_fw_get_time_output {
21877 	uint16_t error_code;
21878 	/*
21879 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21880 	 * and fail the call with an error when appropriate
21881 	 */
21882 	uint16_t req_type;
21883 	/* This field returns the type of original request. */
21884 	uint16_t seq_id;
21885 	/* This field provides original sequence number of the command. */
21886 	uint16_t resp_len;
21887 	/*
21888 	 * This field is the length of the response in bytes. The last byte of
21889 	 * the response is a valid flag that will read as '1' when the command
21890 	 * has been completely written to memory.
21891 	 */
21892 	uint16_t year;
21893 	/* Current year */
21894 	/* Date/time is not known */
21895 	#define HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN		UINT32_C(0x0)
21896 	uint8_t month;
21897 	/* Current month of year (1-12) */
21898 	uint8_t day;
21899 	/* Current day of month (1-31) */
21900 	uint8_t hour;
21901 	/* Current hour (0-23) */
21902 	uint8_t minute;
21903 	/* Current minute (0-59) */
21904 	uint8_t second;
21905 	/* Current second (0-59) */
21906 	uint8_t unused_0;
21907 	uint16_t millisecond;
21908 	/* Current millisecond (0-999) */
21909 	uint16_t zone;
21910 	/* Minutes east of UTC, 0xffff if TZ is not known */
21911 	/* Time zone is Coordinated Universal Time (UTC) */
21912 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UTC		UINT32_C(0x0)
21913 	/* Time zone is not known */
21914 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN		UINT32_C(0xffff)
21915 	uint8_t unused_1;
21916 	uint8_t unused_2;
21917 	uint8_t unused_3;
21918 	uint8_t valid;
21919 	/*
21920 	 * This field is used in Output records to indicate that the output is
21921 	 * completely written to RAM. This field should be read as '1' to
21922 	 * indicate that the output has been completely written. When writing a
21923 	 * command completion or response to an internal processor, the order of
21924 	 * writes has to be such that this field is written last.
21925 	 */
21926 } __attribute__((packed));
21927 
21928 /* hwrm_fw_set_structured_data */
21929 /*
21930  * Description: There can be a variable number of Structure Data Headers (SDH)
21931  * between offset 0x0 and the 'valid' field to handle customizable return
21932  * values. Each Structure Data Header will include one defined structure. The
21933  * number of returned structures can be 0, in which case the 'valid' field
21934  * starts at offset 0x8. The 'valid' field offset is adjusted based on the
21935  * Structure Data Header length and the length of the structured data it
21936  * contains.
21937  */
21938 /* Input (32 bytes) */
21939 
21940 struct hwrm_fw_set_structured_data_input {
21941 	uint16_t req_type;
21942 	/*
21943 	 * This value indicates what type of request this is. The format for the
21944 	 * rest of the command is determined by this field.
21945 	 */
21946 	uint16_t cmpl_ring;
21947 	/*
21948 	 * This value indicates the what completion ring the request will be
21949 	 * optionally completed on. If the value is -1, then no CR completion
21950 	 * will be generated. Any other value must be a valid CR ring_id value
21951 	 * for this function.
21952 	 */
21953 	uint16_t seq_id;
21954 	/* This value indicates the command sequence number. */
21955 	uint16_t target_id;
21956 	/*
21957 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
21958 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
21959 	 */
21960 	uint64_t resp_addr;
21961 	/*
21962 	 * This is the host address where the response will be written when the
21963 	 * request is complete. This area must be 16B aligned and must be
21964 	 * cleared to zero before the request is made.
21965 	 */
21966 	uint64_t src_data_addr;
21967 	/* This is the host address where structured data will be copied from */
21968 	uint16_t data_len;
21969 	/* size of data in bytes */
21970 	uint8_t hdr_cnt;
21971 	/*
21972 	 * a count of the number of Structured Data Headers in the data pointed
21973 	 * by src_data_addr.
21974 	 */
21975 	uint8_t unused_0[5];
21976 } __attribute__((packed));
21977 
21978 /* Output (16 bytes) */
21979 
21980 struct hwrm_fw_set_structured_data_output {
21981 	uint16_t error_code;
21982 	/*
21983 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
21984 	 * and fail the call with an error when appropriate
21985 	 */
21986 	uint16_t req_type;
21987 	/* This field returns the type of original request. */
21988 	uint16_t seq_id;
21989 	/* This field provides original sequence number of the command. */
21990 	uint16_t resp_len;
21991 	/*
21992 	 * This field is the length of the response in bytes. The last byte of
21993 	 * the response is a valid flag that will read as '1' when the command
21994 	 * has been completely written to memory.
21995 	 */
21996 	uint32_t unused_0;
21997 	uint8_t unused_1;
21998 	uint8_t unused_2;
21999 	uint8_t unused_3;
22000 	uint8_t valid;
22001 	/*
22002 	 * This field is used in Output records to indicate that the output is
22003 	 * completely written to RAM. This field should be read as '1' to
22004 	 * indicate that the output has been completely written. When writing a
22005 	 * command completion or response to an internal processor, the order of
22006 	 * writes has to be such that this field is written last.
22007 	 */
22008 } __attribute__((packed));
22009 
22010 /* Command specific Error Codes (8 bytes) */
22011 
22012 struct hwrm_fw_set_structured_data_cmd_err {
22013 	uint8_t code;
22014 	/*
22015 	 * command specific error codes that goes to the cmd_err field in Common
22016 	 * HWRM Error Response.
22017 	 */
22018 	/* Unknown error */
22019 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
22020 	/* count_of_headers is incorrect */
22021 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_HDR_CNT UINT32_C(0x1)
22022 	/* data improperly formatted */
22023 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_FMT  UINT32_C(0x2)
22024 	/* unknown structure ID(s) */
22025 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID   UINT32_C(0x3)
22026 	uint8_t unused_0[7];
22027 } __attribute__((packed));
22028 
22029 /* hwrm_fw_get_structured_data */
22030 /* Input (32 bytes) */
22031 
22032 struct hwrm_fw_get_structured_data_input {
22033 	uint16_t req_type;
22034 	/*
22035 	 * This value indicates what type of request this is. The format for the
22036 	 * rest of the command is determined by this field.
22037 	 */
22038 	uint16_t cmpl_ring;
22039 	/*
22040 	 * This value indicates the what completion ring the request will be
22041 	 * optionally completed on. If the value is -1, then no CR completion
22042 	 * will be generated. Any other value must be a valid CR ring_id value
22043 	 * for this function.
22044 	 */
22045 	uint16_t seq_id;
22046 	/* This value indicates the command sequence number. */
22047 	uint16_t target_id;
22048 	/*
22049 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22050 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22051 	 */
22052 	uint64_t resp_addr;
22053 	/*
22054 	 * This is the host address where the response will be written when the
22055 	 * request is complete. This area must be 16B aligned and must be
22056 	 * cleared to zero before the request is made.
22057 	 */
22058 	uint64_t dest_data_addr;
22059 	/* This is the host address where structured data will be copied to */
22060 	uint16_t data_len;
22061 	/* size of data in bytes */
22062 	uint16_t structure_id;
22063 	/*
22064 	 * Structure_id is the id of the structure data requesting and count is
22065 	 * a requested number of instances of this data requested. The actual
22066 	 * number will be returned in count_of_headers
22067 	 */
22068 	uint16_t subtype;
22069 	/*
22070 	 * Subtype is an optional field used to specify additional information
22071 	 * of the data being retrieved. For example, if data can be categorized
22072 	 * as "live" vs "saved" then this field can be used to provide an
22073 	 * indication of "saved" vs "live" data. Not all structured data
22074 	 * supports subtypes and if they are supported then the structured data
22075 	 * will specify the valid values. If structured data is requested that
22076 	 * supports subtypes but no subtype is given then it is implementation
22077 	 * specific what will be returned. Some structure data can support a
22078 	 * subtype of "All" which would cause a list of structures to be
22079 	 * returned for all supported subtypes. "All" is only used on the
22080 	 * hwrm_get_structured_data command.
22081 	 */
22082 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_ALL	UINT32_C(0xffff)
22083 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_ADMIN UINT32_C(0x100)
22084 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_PEER UINT32_C(0x101)
22085 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_OPERATIONAL UINT32_C(0x102)
22086 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_ADMIN UINT32_C(0x200)
22087 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_PEER UINT32_C(0x201)
22088 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_OPERATIONAL UINT32_C(0x202)
22089 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_HOST_OPERATIONAL UINT32_C(0x300)
22090 	uint8_t count;
22091 	/* Number of elements. This allows support of arrayed data */
22092 	uint8_t unused_0;
22093 } __attribute__((packed));
22094 
22095 /* Output (16 bytes) */
22096 
22097 struct hwrm_fw_get_structured_data_output {
22098 	uint16_t error_code;
22099 	/*
22100 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22101 	 * and fail the call with an error when appropriate
22102 	 */
22103 	uint16_t req_type;
22104 	/* This field returns the type of original request. */
22105 	uint16_t seq_id;
22106 	/* This field provides original sequence number of the command. */
22107 	uint16_t resp_len;
22108 	/*
22109 	 * This field is the length of the response in bytes. The last byte of
22110 	 * the response is a valid flag that will read as '1' when the command
22111 	 * has been completely written to memory.
22112 	 */
22113 	uint8_t hdr_cnt;
22114 	/*
22115 	 * a count of the number of Structured Data Headers in the data pointed
22116 	 * by dest_data_addr.
22117 	 */
22118 	uint8_t unused_0;
22119 	uint16_t unused_1;
22120 	uint8_t unused_2;
22121 	uint8_t unused_3;
22122 	uint8_t unused_4;
22123 	uint8_t valid;
22124 	/*
22125 	 * This field is used in Output records to indicate that the output is
22126 	 * completely written to RAM. This field should be read as '1' to
22127 	 * indicate that the output has been completely written. When writing a
22128 	 * command completion or response to an internal processor, the order of
22129 	 * writes has to be such that this field is written last.
22130 	 */
22131 } __attribute__((packed));
22132 
22133 /* Command specific Error Codes (8 bytes) */
22134 
22135 struct hwrm_fw_get_structured_data_cmd_err {
22136 	uint8_t code;
22137 	/*
22138 	 * command specific error codes that goes to the cmd_err field in Common
22139 	 * HWRM Error Response.
22140 	 */
22141 	/* Unknown error */
22142 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
22143 	/* unknown structure ID(s) */
22144 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID   UINT32_C(0x3)
22145 	uint8_t unused_0[7];
22146 } __attribute__((packed));
22147 
22148 /* hwrm_fw_ipc_mailbox */
22149 /* Input (32 bytes) */
22150 
22151 struct hwrm_fw_ipc_mailbox_input {
22152 	uint16_t req_type;
22153 	/*
22154 	 * This value indicates what type of request this is. The format for the
22155 	 * rest of the command is determined by this field.
22156 	 */
22157 	uint16_t cmpl_ring;
22158 	/*
22159 	 * This value indicates the what completion ring the request will be
22160 	 * optionally completed on. If the value is -1, then no CR completion
22161 	 * will be generated. Any other value must be a valid CR ring_id value
22162 	 * for this function.
22163 	 */
22164 	uint16_t seq_id;
22165 	/* This value indicates the command sequence number. */
22166 	uint16_t target_id;
22167 	/*
22168 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22169 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22170 	 */
22171 	uint64_t resp_addr;
22172 	/*
22173 	 * This is the host address where the response will be written when the
22174 	 * request is complete. This area must be 16B aligned and must be
22175 	 * cleared to zero before the request is made.
22176 	 */
22177 	uint8_t flags;
22178 	uint8_t unused_0;
22179 	/* unused is 8 b */
22180 	uint8_t event_id;
22181 	/* asynchronous event to hosts. */
22182 	uint8_t port_id;
22183 	/* PORT ID */
22184 	uint32_t event_data1;
22185 	/* event data1 of asynchronous event */
22186 	uint32_t event_data2;
22187 	/* event data2 of asynchronous event */
22188 	uint32_t unused_1;
22189 } __attribute__((packed));
22190 
22191 /* Output (16 bytes) */
22192 
22193 struct hwrm_fw_ipc_mailbox_output {
22194 	uint16_t error_code;
22195 	/*
22196 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22197 	 * and fail the call with an error when appropriate
22198 	 */
22199 	uint16_t req_type;
22200 	/* This field returns the type of original request. */
22201 	uint16_t seq_id;
22202 	/* This field provides original sequence number of the command. */
22203 	uint16_t resp_len;
22204 	/*
22205 	 * This field is the length of the response in bytes. The last byte of
22206 	 * the response is a valid flag that will read as '1' when the command
22207 	 * has been completely written to memory.
22208 	 */
22209 	uint32_t unused_0;
22210 	uint8_t unused_1;
22211 	uint8_t unused_2;
22212 	uint8_t unused_3;
22213 	uint8_t valid;
22214 	/*
22215 	 * This field is used in Output records to indicate that the output is
22216 	 * completely written to RAM. This field should be read as '1' to
22217 	 * indicate that the output has been completely written. When writing a
22218 	 * command completion or response to an internal processor, the order of
22219 	 * writes has to be such that this field is written last.
22220 	 */
22221 } __attribute__((packed));
22222 
22223 /* Command specific Error Codes (8 bytes) */
22224 
22225 struct hwrm_fw_ipc_mailbox_cmd_err {
22226 	uint8_t code;
22227 	/*
22228 	 * command specific error codes that goes to the cmd_err field in Common
22229 	 * HWRM Error Response.
22230 	 */
22231 	/* Unknown error */
22232 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
22233 	/* invalid event */
22234 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_BAD_ID	UINT32_C(0x3)
22235 	uint8_t unused_0[7];
22236 } __attribute__((packed));
22237 
22238 /* hwrm_exec_fwd_resp */
22239 /*
22240  * Description: This command is used to send an encapsulated request to the
22241  * HWRM. This command instructs the HWRM to execute the request and forward the
22242  * response of the encapsulated request to the location specified in the
22243  * original request that is encapsulated. The target id of this command shall be
22244  * set to 0xFFFF (HWRM). The response location in this command shall be used to
22245  * acknowledge the receipt of the encapsulated request and forwarding of the
22246  * response.
22247  */
22248 /* Input (128 bytes) */
22249 
22250 struct hwrm_exec_fwd_resp_input {
22251 	uint16_t req_type;
22252 	/*
22253 	 * This value indicates what type of request this is. The format for the
22254 	 * rest of the command is determined by this field.
22255 	 */
22256 	uint16_t cmpl_ring;
22257 	/*
22258 	 * This value indicates the what completion ring the request will be
22259 	 * optionally completed on. If the value is -1, then no CR completion
22260 	 * will be generated. Any other value must be a valid CR ring_id value
22261 	 * for this function.
22262 	 */
22263 	uint16_t seq_id;
22264 	/* This value indicates the command sequence number. */
22265 	uint16_t target_id;
22266 	/*
22267 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22268 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22269 	 */
22270 	uint64_t resp_addr;
22271 	/*
22272 	 * This is the host address where the response will be written when the
22273 	 * request is complete. This area must be 16B aligned and must be
22274 	 * cleared to zero before the request is made.
22275 	 */
22276 	uint32_t encap_request[26];
22277 	/*
22278 	 * This is an encapsulated request. This request should be executed by
22279 	 * the HWRM and the response should be provided in the response buffer
22280 	 * inside the encapsulated request.
22281 	 */
22282 	uint16_t encap_resp_target_id;
22283 	/*
22284 	 * This value indicates the target id of the response to the
22285 	 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
22286 	 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22287 	 */
22288 	uint16_t unused_0[3];
22289 } __attribute__((packed));
22290 
22291 /* Output (16 bytes) */
22292 
22293 struct hwrm_exec_fwd_resp_output {
22294 	uint16_t error_code;
22295 	/*
22296 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22297 	 * and fail the call with an error when appropriate
22298 	 */
22299 	uint16_t req_type;
22300 	/* This field returns the type of original request. */
22301 	uint16_t seq_id;
22302 	/* This field provides original sequence number of the command. */
22303 	uint16_t resp_len;
22304 	/*
22305 	 * This field is the length of the response in bytes. The last byte of
22306 	 * the response is a valid flag that will read as '1' when the command
22307 	 * has been completely written to memory.
22308 	 */
22309 	uint32_t unused_0;
22310 	uint8_t unused_1;
22311 	uint8_t unused_2;
22312 	uint8_t unused_3;
22313 	uint8_t valid;
22314 	/*
22315 	 * This field is used in Output records to indicate that the output is
22316 	 * completely written to RAM. This field should be read as '1' to
22317 	 * indicate that the output has been completely written. When writing a
22318 	 * command completion or response to an internal processor, the order of
22319 	 * writes has to be such that this field is written last.
22320 	 */
22321 } __attribute__((packed));
22322 
22323 /* hwrm_reject_fwd_resp */
22324 /*
22325  * Description: This command is used to send an encapsulated request to the
22326  * HWRM. This command instructs the HWRM to reject the request and forward the
22327  * error response of the encapsulated request to the location specified in the
22328  * original request that is encapsulated. The target id of this command shall be
22329  * set to 0xFFFF (HWRM). The response location in this command shall be used to
22330  * acknowledge the receipt of the encapsulated request and forwarding of the
22331  * response.
22332  */
22333 /* Input (128 bytes) */
22334 
22335 struct hwrm_reject_fwd_resp_input {
22336 	uint16_t req_type;
22337 	/*
22338 	 * This value indicates what type of request this is. The format for the
22339 	 * rest of the command is determined by this field.
22340 	 */
22341 	uint16_t cmpl_ring;
22342 	/*
22343 	 * This value indicates the what completion ring the request will be
22344 	 * optionally completed on. If the value is -1, then no CR completion
22345 	 * will be generated. Any other value must be a valid CR ring_id value
22346 	 * for this function.
22347 	 */
22348 	uint16_t seq_id;
22349 	/* This value indicates the command sequence number. */
22350 	uint16_t target_id;
22351 	/*
22352 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22353 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22354 	 */
22355 	uint64_t resp_addr;
22356 	/*
22357 	 * This is the host address where the response will be written when the
22358 	 * request is complete. This area must be 16B aligned and must be
22359 	 * cleared to zero before the request is made.
22360 	 */
22361 	uint32_t encap_request[26];
22362 	/*
22363 	 * This is an encapsulated request. This request should be rejected by
22364 	 * the HWRM and the error response should be provided in the response
22365 	 * buffer inside the encapsulated request.
22366 	 */
22367 	uint16_t encap_resp_target_id;
22368 	/*
22369 	 * This value indicates the target id of the response to the
22370 	 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
22371 	 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22372 	 */
22373 	uint16_t unused_0[3];
22374 } __attribute__((packed));
22375 
22376 /* Output (16 bytes) */
22377 
22378 struct hwrm_reject_fwd_resp_output {
22379 	uint16_t error_code;
22380 	/*
22381 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22382 	 * and fail the call with an error when appropriate
22383 	 */
22384 	uint16_t req_type;
22385 	/* This field returns the type of original request. */
22386 	uint16_t seq_id;
22387 	/* This field provides original sequence number of the command. */
22388 	uint16_t resp_len;
22389 	/*
22390 	 * This field is the length of the response in bytes. The last byte of
22391 	 * the response is a valid flag that will read as '1' when the command
22392 	 * has been completely written to memory.
22393 	 */
22394 	uint32_t unused_0;
22395 	uint8_t unused_1;
22396 	uint8_t unused_2;
22397 	uint8_t unused_3;
22398 	uint8_t valid;
22399 	/*
22400 	 * This field is used in Output records to indicate that the output is
22401 	 * completely written to RAM. This field should be read as '1' to
22402 	 * indicate that the output has been completely written. When writing a
22403 	 * command completion or response to an internal processor, the order of
22404 	 * writes has to be such that this field is written last.
22405 	 */
22406 } __attribute__((packed));
22407 
22408 /* hwrm_fwd_resp */
22409 /*
22410  * Description: This command is used to send an encapsulated response to the
22411  * HWRM. The HWRM shall forward this response based on the target id. The
22412  * response address provided in this command shall be used to acknowledge the
22413  * receipt of the encapsulated response. The encapsulated response address
22414  * provided in this command shall be used to provide the encapsulated response.
22415  */
22416 /* Input (40 bytes) */
22417 
22418 struct hwrm_fwd_resp_input {
22419 	uint16_t req_type;
22420 	/*
22421 	 * This value indicates what type of request this is. The format for the
22422 	 * rest of the command is determined by this field.
22423 	 */
22424 	uint16_t cmpl_ring;
22425 	/*
22426 	 * This value indicates the what completion ring the request will be
22427 	 * optionally completed on. If the value is -1, then no CR completion
22428 	 * will be generated. Any other value must be a valid CR ring_id value
22429 	 * for this function.
22430 	 */
22431 	uint16_t seq_id;
22432 	/* This value indicates the command sequence number. */
22433 	uint16_t target_id;
22434 	/*
22435 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22436 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22437 	 */
22438 	uint64_t resp_addr;
22439 	/*
22440 	 * This is the host address where the response will be written when the
22441 	 * request is complete. This area must be 16B aligned and must be
22442 	 * cleared to zero before the request is made.
22443 	 */
22444 	uint16_t encap_resp_target_id;
22445 	/*
22446 	 * This value indicates the target id of the encapsulated response. 0x0
22447 	 * - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE - Reserved for
22448 	 * internal processors 0xFFFF - HWRM
22449 	 */
22450 	uint16_t encap_resp_cmpl_ring;
22451 	/*
22452 	 * This value indicates the completion ring the encapsulated response
22453 	 * will be optionally completed on. If the value is -1, then no CR
22454 	 * completion shall be generated for the encapsulated response. Any
22455 	 * other value must be a valid CR ring_id value. If a valid
22456 	 * encap_resp_cmpl_ring is provided, then a CR completion shall be
22457 	 * generated for the encapsulated response.
22458 	 */
22459 	uint16_t encap_resp_len;
22460 	/* This field indicates the length of encapsulated response. */
22461 	uint8_t unused_0;
22462 	uint8_t unused_1;
22463 	uint64_t encap_resp_addr;
22464 	/*
22465 	 * This is the host address where the encapsulated response will be
22466 	 * written. This area must be 16B aligned and must be cleared to zero
22467 	 * before the original request is made.
22468 	 */
22469 	uint32_t encap_resp[24];
22470 	/* This is an encapsulated response. */
22471 } __attribute__((packed));
22472 
22473 /* Output (16 bytes) */
22474 
22475 struct hwrm_fwd_resp_output {
22476 	uint16_t error_code;
22477 	/*
22478 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22479 	 * and fail the call with an error when appropriate
22480 	 */
22481 	uint16_t req_type;
22482 	/* This field returns the type of original request. */
22483 	uint16_t seq_id;
22484 	/* This field provides original sequence number of the command. */
22485 	uint16_t resp_len;
22486 	/*
22487 	 * This field is the length of the response in bytes. The last byte of
22488 	 * the response is a valid flag that will read as '1' when the command
22489 	 * has been completely written to memory.
22490 	 */
22491 	uint32_t unused_0;
22492 	uint8_t unused_1;
22493 	uint8_t unused_2;
22494 	uint8_t unused_3;
22495 	uint8_t valid;
22496 	/*
22497 	 * This field is used in Output records to indicate that the output is
22498 	 * completely written to RAM. This field should be read as '1' to
22499 	 * indicate that the output has been completely written. When writing a
22500 	 * command completion or response to an internal processor, the order of
22501 	 * writes has to be such that this field is written last.
22502 	 */
22503 } __attribute__((packed));
22504 
22505 /* hwrm_fwd_async_event_cmpl */
22506 /*
22507  * Description: This command is used to send an encapsulated asynchronous event
22508  * completion to the HWRM. The HWRM shall forward this asynchronous event
22509  * completion to target(s) specified in the command. The HWRM shall complete
22510  * this command only after forwarding asynchronous event completion to specified
22511  * targets.
22512  */
22513 /* Input (32 bytes) */
22514 
22515 struct hwrm_fwd_async_event_cmpl_input {
22516 	uint16_t req_type;
22517 	/*
22518 	 * This value indicates what type of request this is. The format for the
22519 	 * rest of the command is determined by this field.
22520 	 */
22521 	uint16_t cmpl_ring;
22522 	/*
22523 	 * This value indicates the what completion ring the request will be
22524 	 * optionally completed on. If the value is -1, then no CR completion
22525 	 * will be generated. Any other value must be a valid CR ring_id value
22526 	 * for this function.
22527 	 */
22528 	uint16_t seq_id;
22529 	/* This value indicates the command sequence number. */
22530 	uint16_t target_id;
22531 	/*
22532 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22533 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22534 	 */
22535 	uint64_t resp_addr;
22536 	/*
22537 	 * This is the host address where the response will be written when the
22538 	 * request is complete. This area must be 16B aligned and must be
22539 	 * cleared to zero before the request is made.
22540 	 */
22541 	uint16_t encap_async_event_target_id;
22542 	/*
22543 	 * This value indicates the target id of the encapsulated asynchronous
22544 	 * event. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
22545 	 * Reserved for internal processors 0xFFFF - Broadcast to all children
22546 	 * VFs (only applicable when a PF is the requester)
22547 	 */
22548 	uint8_t unused_0;
22549 	uint8_t unused_1;
22550 	uint8_t unused_2[3];
22551 	uint8_t unused_3;
22552 	uint32_t encap_async_event_cmpl[4];
22553 	/* This is an encapsulated asynchronous event completion. */
22554 } __attribute__((packed));
22555 
22556 /* Output (16 bytes) */
22557 
22558 struct hwrm_fwd_async_event_cmpl_output {
22559 	uint16_t error_code;
22560 	/*
22561 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22562 	 * and fail the call with an error when appropriate
22563 	 */
22564 	uint16_t req_type;
22565 	/* This field returns the type of original request. */
22566 	uint16_t seq_id;
22567 	/* This field provides original sequence number of the command. */
22568 	uint16_t resp_len;
22569 	/*
22570 	 * This field is the length of the response in bytes. The last byte of
22571 	 * the response is a valid flag that will read as '1' when the command
22572 	 * has been completely written to memory.
22573 	 */
22574 	uint32_t unused_0;
22575 	uint8_t unused_1;
22576 	uint8_t unused_2;
22577 	uint8_t unused_3;
22578 	uint8_t valid;
22579 	/*
22580 	 * This field is used in Output records to indicate that the output is
22581 	 * completely written to RAM. This field should be read as '1' to
22582 	 * indicate that the output has been completely written. When writing a
22583 	 * command completion or response to an internal processor, the order of
22584 	 * writes has to be such that this field is written last.
22585 	 */
22586 } __attribute__((packed));
22587 
22588 /* hwrm_temp_monitor_query */
22589 /*
22590  * Description: A temperature monitor is used to query the device temperature.
22591  */
22592 /* Input (16 bytes) */
22593 
22594 struct hwrm_temp_monitor_query_input {
22595 	uint16_t req_type;
22596 	/*
22597 	 * This value indicates what type of request this is. The format for the
22598 	 * rest of the command is determined by this field.
22599 	 */
22600 	uint16_t cmpl_ring;
22601 	/*
22602 	 * This value indicates the what completion ring the request will be
22603 	 * optionally completed on. If the value is -1, then no CR completion
22604 	 * will be generated. Any other value must be a valid CR ring_id value
22605 	 * for this function.
22606 	 */
22607 	uint16_t seq_id;
22608 	/* This value indicates the command sequence number. */
22609 	uint16_t target_id;
22610 	/*
22611 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22612 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22613 	 */
22614 	uint64_t resp_addr;
22615 	/*
22616 	 * This is the host address where the response will be written when the
22617 	 * request is complete. This area must be 16B aligned and must be
22618 	 * cleared to zero before the request is made.
22619 	 */
22620 } __attribute__((packed));
22621 
22622 /* Output (16 bytes) */
22623 
22624 struct hwrm_temp_monitor_query_output {
22625 	uint16_t error_code;
22626 	/*
22627 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22628 	 * and fail the call with an error when appropriate
22629 	 */
22630 	uint16_t req_type;
22631 	/* This field returns the type of original request. */
22632 	uint16_t seq_id;
22633 	/* This field provides original sequence number of the command. */
22634 	uint16_t resp_len;
22635 	/*
22636 	 * This field is the length of the response in bytes. The last byte of
22637 	 * the response is a valid flag that will read as '1' when the command
22638 	 * has been completely written to memory.
22639 	 */
22640 	uint8_t temp;
22641 	/* The HWRM shall provide the current temperature of device in Celsius. */
22642 	uint8_t unused_0;
22643 	uint16_t unused_1;
22644 	uint8_t unused_2;
22645 	uint8_t unused_3;
22646 	uint8_t unused_4;
22647 	uint8_t valid;
22648 	/*
22649 	 * This field is used in Output records to indicate that the output is
22650 	 * completely written to RAM. This field should be read as '1' to
22651 	 * indicate that the output has been completely written. When writing a
22652 	 * command completion or response to an internal processor, the order of
22653 	 * writes has to be such that this field is written last.
22654 	 */
22655 } __attribute__((packed));
22656 
22657 /* hwrm_wol_filter_alloc */
22658 /*
22659  * Description: A Wake-On-LAN (WoL) filter is a filter resource that is used to
22660  * identify a WoL packet. # Among all function drivers, the HWRM shall only
22661  * allow PF drivers to allocate WoL filters. # The HWRM shall not allow VF
22662  * drivers to allocate any WoL filters. # When partitioning is enabled and WoL
22663  * is supported, the HWRM shall support at least one WoL filter per partition. #
22664  * The HWRM shall retain a WoL filter setting until the filter is freed. # If
22665  * the HWRM client is a function driver, then the HWRM shall not allow the HWRM
22666  * client to set up WoL filters on the port that the function is not associated
22667  * with. # If the HWRM client is one of the trusted embedded services (e.g.
22668  * management service), the the HWRM shall allow the HWRM client to set up WoL
22669  * filters on any port of the device.
22670  */
22671 /* Input (64 bytes) */
22672 
22673 struct hwrm_wol_filter_alloc_input {
22674 	uint16_t req_type;
22675 	/*
22676 	 * This value indicates what type of request this is. The format for the
22677 	 * rest of the command is determined by this field.
22678 	 */
22679 	uint16_t cmpl_ring;
22680 	/*
22681 	 * This value indicates the what completion ring the request will be
22682 	 * optionally completed on. If the value is -1, then no CR completion
22683 	 * will be generated. Any other value must be a valid CR ring_id value
22684 	 * for this function.
22685 	 */
22686 	uint16_t seq_id;
22687 	/* This value indicates the command sequence number. */
22688 	uint16_t target_id;
22689 	/*
22690 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22691 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22692 	 */
22693 	uint64_t resp_addr;
22694 	/*
22695 	 * This is the host address where the response will be written when the
22696 	 * request is complete. This area must be 16B aligned and must be
22697 	 * cleared to zero before the request is made.
22698 	 */
22699 	uint32_t flags;
22700 	uint32_t enables;
22701 	/* This bit must be '1' for the mac_address field to be configured. */
22702 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS	UINT32_C(0x1)
22703 	/* This bit must be '1' for the pattern_offset field to be configured. */
22704 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_OFFSET UINT32_C(0x2)
22705 	/* This bit must be '1' for the pattern_buf_size field to be configured. */
22706 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_SIZE UINT32_C(0x4)
22707 	/* This bit must be '1' for the pattern_buf_addr field to be configured. */
22708 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_ADDR UINT32_C(0x8)
22709 	/*
22710 	 * This bit must be '1' for the pattern_mask_addr field to be
22711 	 * configured.
22712 	 */
22713 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_ADDR UINT32_C(0x10)
22714 	/*
22715 	 * This bit must be '1' for the pattern_mask_size field to be
22716 	 * configured.
22717 	 */
22718 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_SIZE UINT32_C(0x20)
22719 	uint16_t port_id;
22720 	/* Port ID of port on which WoL filter is configured. */
22721 	uint8_t wol_type;
22722 	/* This value represents a Wake-on-LAN type. */
22723 	/* Magic Paket */
22724 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT	UINT32_C(0x0)
22725 	/* Bitmap */
22726 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_BMP	UINT32_C(0x1)
22727 	/* Invalid */
22728 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID	UINT32_C(0xff)
22729 	uint8_t unused_0;
22730 	uint32_t unused_1;
22731 	uint8_t mac_address[6];
22732 	/*
22733 	 * # If this field is enabled and magic packet WoL filter type is
22734 	 * specified in this command, the value set in this field shall be used
22735 	 * in setting the magic packet based WoL filter. # If this field is not
22736 	 * enabled and magic packet WoL filter type is specified and port id is
22737 	 * specified to 0xFF in this command, then the HWRM shall use default
22738 	 * MAC address configured on the function associated with the HWRM
22739 	 * client. # If this field is not enabled and magic packet WoL filter
22740 	 * type is specified and port id is not specified to 0xFF in this
22741 	 * command, then the HWRM shall use default MAC address configured on
22742 	 * the port.
22743 	 */
22744 	uint16_t pattern_offset;
22745 	/*
22746 	 * The offset from the beginning of MAC header where pattern should be
22747 	 * matched. Applies to bitmap WoL.
22748 	 */
22749 	uint16_t pattern_buf_size;
22750 	/* The size of the pattern that is being matched. Applies to bitmap WoL. */
22751 	uint16_t pattern_mask_size;
22752 	/* The size of the pattern mask. Applies to bitmap WoL. */
22753 	uint32_t unused_2;
22754 	uint64_t pattern_buf_addr;
22755 	/* Physical address of the pattern buffer. Applies to bitmap WoL. */
22756 	uint64_t pattern_mask_addr;
22757 	/* Physical address of the pattern mask. Applies to bitmap WoL. */
22758 } __attribute__((packed));
22759 
22760 /* Output (16 bytes) */
22761 
22762 struct hwrm_wol_filter_alloc_output {
22763 	uint16_t error_code;
22764 	/*
22765 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22766 	 * and fail the call with an error when appropriate
22767 	 */
22768 	uint16_t req_type;
22769 	/* This field returns the type of original request. */
22770 	uint16_t seq_id;
22771 	/* This field provides original sequence number of the command. */
22772 	uint16_t resp_len;
22773 	/*
22774 	 * This field is the length of the response in bytes. The last byte of
22775 	 * the response is a valid flag that will read as '1' when the command
22776 	 * has been completely written to memory.
22777 	 */
22778 	uint8_t wol_filter_id;
22779 	/* This value identifies a Wake-on-LAN (WoL) filter. */
22780 	uint8_t unused_0;
22781 	uint16_t unused_1;
22782 	uint8_t unused_2;
22783 	uint8_t unused_3;
22784 	uint8_t unused_4;
22785 	uint8_t valid;
22786 	/*
22787 	 * This field is used in Output records to indicate that the output is
22788 	 * completely written to RAM. This field should be read as '1' to
22789 	 * indicate that the output has been completely written. When writing a
22790 	 * command completion or response to an internal processor, the order of
22791 	 * writes has to be such that this field is written last.
22792 	 */
22793 } __attribute__((packed));
22794 
22795 /* hwrm_wol_filter_free */
22796 /*
22797  * Description: Free a WoL filter. # Among all function drivers, the HWRM shall
22798  * only allow PF drivers to free WoL filters. # The HWRM shall not allow VF
22799  * drivers to free any WoL filters. # The HWRM shall not allow a function driver
22800  * to free an Out-Of-Box WoL filter. # The HWRM shall not allow a function
22801  * driver to free a WoL filter on a port that the corresponding function is not
22802  * associated with. # The HWRM shall not allow a function driver to free a WoL
22803  * filter on a function that the function driver is not associated with.
22804  */
22805 /* Input (32 bytes) */
22806 
22807 struct hwrm_wol_filter_free_input {
22808 	uint16_t req_type;
22809 	/*
22810 	 * This value indicates what type of request this is. The format for the
22811 	 * rest of the command is determined by this field.
22812 	 */
22813 	uint16_t cmpl_ring;
22814 	/*
22815 	 * This value indicates the what completion ring the request will be
22816 	 * optionally completed on. If the value is -1, then no CR completion
22817 	 * will be generated. Any other value must be a valid CR ring_id value
22818 	 * for this function.
22819 	 */
22820 	uint16_t seq_id;
22821 	/* This value indicates the command sequence number. */
22822 	uint16_t target_id;
22823 	/*
22824 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22825 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22826 	 */
22827 	uint64_t resp_addr;
22828 	/*
22829 	 * This is the host address where the response will be written when the
22830 	 * request is complete. This area must be 16B aligned and must be
22831 	 * cleared to zero before the request is made.
22832 	 */
22833 	uint32_t flags;
22834 	/*
22835 	 * # When this bit is set to '1', then all active WoL filters on the
22836 	 * port are requested to be freed. # If the a function driver sets this
22837 	 * flag to '1', then the HWRM shall free all active WoL filters that are
22838 	 * not set by other function drivers on that port.
22839 	 */
22840 	#define HWRM_WOL_FILTER_FREE_INPUT_FLAGS_FREE_ALL_WOL_FILTERS UINT32_C(0x1)
22841 	uint32_t enables;
22842 	/* This bit must be '1' for the wol_filter_id field to be configured. */
22843 	#define HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID   UINT32_C(0x1)
22844 	uint16_t port_id;
22845 	/* Port ID of the port on which WoL filter(s) is (are) being freed. */
22846 	uint8_t wol_filter_id;
22847 	/* The HWRM shall ignore this field if free_all_wol_filters flag is set. */
22848 	uint8_t unused_0[5];
22849 } __attribute__((packed));
22850 
22851 /* Output (16 bytes) */
22852 
22853 struct hwrm_wol_filter_free_output {
22854 	uint16_t error_code;
22855 	/*
22856 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22857 	 * and fail the call with an error when appropriate
22858 	 */
22859 	uint16_t req_type;
22860 	/* This field returns the type of original request. */
22861 	uint16_t seq_id;
22862 	/* This field provides original sequence number of the command. */
22863 	uint16_t resp_len;
22864 	/*
22865 	 * This field is the length of the response in bytes. The last byte of
22866 	 * the response is a valid flag that will read as '1' when the command
22867 	 * has been completely written to memory.
22868 	 */
22869 	uint32_t unused_0;
22870 	uint8_t unused_1;
22871 	uint8_t unused_2;
22872 	uint8_t unused_3;
22873 	uint8_t valid;
22874 	/*
22875 	 * This field is used in Output records to indicate that the output is
22876 	 * completely written to RAM. This field should be read as '1' to
22877 	 * indicate that the output has been completely written. When writing a
22878 	 * command completion or response to an internal processor, the order of
22879 	 * writes has to be such that this field is written last.
22880 	 */
22881 } __attribute__((packed));
22882 
22883 /* hwrm_wol_filter_qcfg */
22884 /*
22885  * Description: Query WoL filter configuration. # Among all function drivers,
22886  * the HWRM shall only allow PF drivers to query WoL filters. # The HWRM shall
22887  * not allow VF drivers to query any WoL filters. # The HWRM shall return WoL
22888  * filters that are active on the associated port for which this query is being
22889  * performed. # If the HWRM client is a function driver, then the HWRM shall not
22890  * allow the HWRM client to query WoL filters that are set up by other function
22891  * drivers. # If the HWRM client is a function driver, then the HWRM shall not
22892  * allow the HWRM client to query WoL filters on the port that the function is
22893  * not associated with. # If the HWRM client is one of the trusted embedded
22894  * service (e.g. management service), the the HWRM shall allow the HWRM client
22895  * to query WoL filters on any port of the device.
22896  */
22897 /* Input (56 bytes) */
22898 
22899 struct hwrm_wol_filter_qcfg_input {
22900 	uint16_t req_type;
22901 	/*
22902 	 * This value indicates what type of request this is. The format for the
22903 	 * rest of the command is determined by this field.
22904 	 */
22905 	uint16_t cmpl_ring;
22906 	/*
22907 	 * This value indicates the what completion ring the request will be
22908 	 * optionally completed on. If the value is -1, then no CR completion
22909 	 * will be generated. Any other value must be a valid CR ring_id value
22910 	 * for this function.
22911 	 */
22912 	uint16_t seq_id;
22913 	/* This value indicates the command sequence number. */
22914 	uint16_t target_id;
22915 	/*
22916 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
22917 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
22918 	 */
22919 	uint64_t resp_addr;
22920 	/*
22921 	 * This is the host address where the response will be written when the
22922 	 * request is complete. This area must be 16B aligned and must be
22923 	 * cleared to zero before the request is made.
22924 	 */
22925 	uint16_t port_id;
22926 	/* Port ID of port on which WoL filter that is being queried. */
22927 	uint16_t handle;
22928 	/*
22929 	 * This is an opaque handle used to access filters. # The HWRM client
22930 	 * shall set this field to 0x0000 to begin the query. # After the first
22931 	 * query, the HWRM client shall retrieve next filters (if they exist)
22932 	 * using the HWRM provided handle in the response.
22933 	 */
22934 	uint32_t unused_0;
22935 	uint64_t pattern_buf_addr;
22936 	/*
22937 	 * Physical address of the pattern buffer. Applies to bitmap WoL filter
22938 	 * only. # Value of 0 indicates an invalid buffer address. If this field
22939 	 * is set to 0, then HWRM shall ignore pattern_buf_size. # If the HWRM
22940 	 * client provides an invalid buffer address for the pattern, then the
22941 	 * HWRM is not required to provide pattern when the response contains a
22942 	 * bitmap WoL filter.
22943 	 */
22944 	uint16_t pattern_buf_size;
22945 	/* The size of the pattern buffer. Applies to bitmap WoL filter only. */
22946 	uint8_t unused_1;
22947 	uint8_t unused_2;
22948 	uint8_t unused_3[3];
22949 	uint8_t unused_4;
22950 	uint64_t pattern_mask_addr;
22951 	/*
22952 	 * Physical address of the pattern mask. Applies to bitmap WoL filter
22953 	 * only. # Value of 0 indicates an invalid pattern mask address. If this
22954 	 * field is set to 0, then HWRM shall ignore pattern_mask_size. # If the
22955 	 * HWRM client provides an invalid mask address for the pattern, then
22956 	 * the HWRM is not required to provide mask when the response contains a
22957 	 * bitmap WoL filter.
22958 	 */
22959 	uint16_t pattern_mask_size;
22960 	/*
22961 	 * The size of the buffer for pattern mask. Applies to bitmap WoL filter
22962 	 * only.
22963 	 */
22964 	uint16_t unused_5[3];
22965 } __attribute__((packed));
22966 
22967 /* Output (32 bytes) */
22968 
22969 struct hwrm_wol_filter_qcfg_output {
22970 	uint16_t error_code;
22971 	/*
22972 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
22973 	 * and fail the call with an error when appropriate
22974 	 */
22975 	uint16_t req_type;
22976 	/* This field returns the type of original request. */
22977 	uint16_t seq_id;
22978 	/* This field provides original sequence number of the command. */
22979 	uint16_t resp_len;
22980 	/*
22981 	 * This field is the length of the response in bytes. The last byte of
22982 	 * the response is a valid flag that will read as '1' when the command
22983 	 * has been completely written to memory.
22984 	 */
22985 	uint16_t next_handle;
22986 	/*
22987 	 * This is the next handle that is used to access filters. # If this
22988 	 * field is set to 0x0000, then no WoL filters are currently configured
22989 	 * on this port and all other fields in the output shall be ignored by
22990 	 * the HWRM client. # If this field is set to neither 0x0000 nor 0xFFFF,
22991 	 * then the wol_filter_id is valid and the parameters provided in the
22992 	 * response are based on the wol_type. # If this field is set to 0xFFFF,
22993 	 * then there are no remaining configured WoL filters to be queried for
22994 	 * the queried function after this response, wol_filter_id is valid and
22995 	 * the parameters provided in the response are based on the wol_type.
22996 	 */
22997 	uint8_t wol_filter_id;
22998 	/* This value identifies the filter returned in this response. */
22999 	uint8_t wol_type;
23000 	/*
23001 	 * This value identifies the type of WoL filter returned in this
23002 	 * response.
23003 	 */
23004 	/* Magic Paket */
23005 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_MAGICPKT	UINT32_C(0x0)
23006 	/* Bitmap */
23007 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_BMP	UINT32_C(0x1)
23008 	/* Invalid */
23009 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID	UINT32_C(0xff)
23010 	uint32_t unused_0;
23011 	uint8_t mac_address[6];
23012 	/*
23013 	 * The MAC address value used by the WoL filter. Applies to magic packet
23014 	 * based WoL.
23015 	 */
23016 	uint16_t pattern_offset;
23017 	/*
23018 	 * The offset from the beginning of MAC header where pattern should be
23019 	 * matched. Applies to bitmap WoL.
23020 	 */
23021 	uint16_t pattern_size;
23022 	/*
23023 	 * The actual size of the pattern that is being returned. Applies to
23024 	 * bitmap WoL.
23025 	 */
23026 	uint16_t pattern_mask_size;
23027 	/*
23028 	 * The actual size of the pattern mask that is being returned. Applies
23029 	 * to bitmap WoL.
23030 	 */
23031 	uint8_t unused_1;
23032 	uint8_t unused_2;
23033 	uint8_t unused_3;
23034 	uint8_t valid;
23035 	/*
23036 	 * This field is used in Output records to indicate that the output is
23037 	 * completely written to RAM. This field should be read as '1' to
23038 	 * indicate that the output has been completely written. When writing a
23039 	 * command completion or response to an internal processor, the order of
23040 	 * writes has to be such that this field is written last.
23041 	 */
23042 } __attribute__((packed));
23043 
23044 /* hwrm_wol_reason_qcfg */
23045 /* Description: Query WoL reason for the last system wake up. */
23046 /* Input (40 bytes) */
23047 
23048 struct hwrm_wol_reason_qcfg_input {
23049 	uint16_t req_type;
23050 	/*
23051 	 * This value indicates what type of request this is. The format for the
23052 	 * rest of the command is determined by this field.
23053 	 */
23054 	uint16_t cmpl_ring;
23055 	/*
23056 	 * This value indicates the what completion ring the request will be
23057 	 * optionally completed on. If the value is -1, then no CR completion
23058 	 * will be generated. Any other value must be a valid CR ring_id value
23059 	 * for this function.
23060 	 */
23061 	uint16_t seq_id;
23062 	/* This value indicates the command sequence number. */
23063 	uint16_t target_id;
23064 	/*
23065 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23066 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23067 	 */
23068 	uint64_t resp_addr;
23069 	/*
23070 	 * This is the host address where the response will be written when the
23071 	 * request is complete. This area must be 16B aligned and must be
23072 	 * cleared to zero before the request is made.
23073 	 */
23074 	uint16_t port_id;
23075 	/* Port ID of port for which this query is for. */
23076 	uint8_t unused_0;
23077 	uint8_t unused_1;
23078 	uint8_t unused_2[3];
23079 	uint8_t unused_3;
23080 	uint64_t wol_pkt_buf_addr;
23081 	/* Physical address of the packet buffer for querying WoL packet. */
23082 	uint16_t wol_pkt_buf_size;
23083 	/* The size of the buffer for the WoL packet. */
23084 	uint16_t unused_4[3];
23085 } __attribute__((packed));
23086 
23087 /* Output (16 bytes) */
23088 
23089 struct hwrm_wol_reason_qcfg_output {
23090 	uint16_t error_code;
23091 	/*
23092 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23093 	 * and fail the call with an error when appropriate
23094 	 */
23095 	uint16_t req_type;
23096 	/* This field returns the type of original request. */
23097 	uint16_t seq_id;
23098 	/* This field provides original sequence number of the command. */
23099 	uint16_t resp_len;
23100 	/*
23101 	 * This field is the length of the response in bytes. The last byte of
23102 	 * the response is a valid flag that will read as '1' when the command
23103 	 * has been completely written to memory.
23104 	 */
23105 	uint8_t wol_filter_id;
23106 	/*
23107 	 * This value identifies the filter that matched the last WoL packet.
23108 	 * This id is only valid with valid WoL reason.
23109 	 */
23110 	uint8_t wol_reason;
23111 	/*
23112 	 * This value identifies the type of WoL reason returned in this
23113 	 * response. When the wol_type is set to invalid, then there is no WoL
23114 	 * event that happened during last system wake-up.
23115 	 */
23116 	/* Magic Paket */
23117 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_MAGICPKT   UINT32_C(0x0)
23118 	/* Bitmap */
23119 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_BMP	UINT32_C(0x1)
23120 	/* Invalid */
23121 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID	UINT32_C(0xff)
23122 	uint8_t wol_pkt_len;
23123 	/* The value identifies the length of the WoL packet in bytes. */
23124 	uint8_t unused_0;
23125 	uint8_t unused_1;
23126 	uint8_t unused_2;
23127 	uint8_t unused_3;
23128 	uint8_t valid;
23129 	/*
23130 	 * This field is used in Output records to indicate that the output is
23131 	 * completely written to RAM. This field should be read as '1' to
23132 	 * indicate that the output has been completely written. When writing a
23133 	 * command completion or response to an internal processor, the order of
23134 	 * writes has to be such that this field is written last.
23135 	 */
23136 } __attribute__((packed));
23137 
23138 /* hwrm_dbg_dump */
23139 /*
23140  * Description: This command is used by to initiate the dump of debug
23141  * information to a driver specified address.
23142  */
23143 /* Input (40 bytes) */
23144 
23145 struct hwrm_dbg_dump_input {
23146 	uint16_t req_type;
23147 	/*
23148 	 * This value indicates what type of request this is. The format for the
23149 	 * rest of the command is determined by this field.
23150 	 */
23151 	uint16_t cmpl_ring;
23152 	/*
23153 	 * This value indicates the what completion ring the request will be
23154 	 * optionally completed on. If the value is -1, then no CR completion
23155 	 * will be generated. Any other value must be a valid CR ring_id value
23156 	 * for this function.
23157 	 */
23158 	uint16_t seq_id;
23159 	/* This value indicates the command sequence number. */
23160 	uint16_t target_id;
23161 	/*
23162 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23163 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23164 	 */
23165 	uint64_t resp_addr;
23166 	/*
23167 	 * This is the host address where the response will be written when the
23168 	 * request is complete. This area must be 16B aligned and must be
23169 	 * cleared to zero before the request is made.
23170 	 */
23171 	uint32_t handle;
23172 	/*
23173 	 * Handle used to dump debug data. handle = 0 indicates the beginning of
23174 	 * the dump. handle != 0 indicates the request to dump the next part.
23175 	 */
23176 	uint32_t unused_0;
23177 	uint64_t host_dbg_dump_addr;
23178 	/*
23179 	 * Address of the host buffer where the debug data is requested to be
23180 	 * dumped.
23181 	 */
23182 	uint64_t host_dbg_dump_addr_len;
23183 	/* Length of host buffer used for transferring debug data. */
23184 } __attribute__((packed));
23185 
23186 /* Output (24 bytes) */
23187 
23188 struct hwrm_dbg_dump_output {
23189 	uint16_t error_code;
23190 	/*
23191 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23192 	 * and fail the call with an error when appropriate
23193 	 */
23194 	uint16_t req_type;
23195 	/* This field returns the type of original request. */
23196 	uint16_t seq_id;
23197 	/* This field provides original sequence number of the command. */
23198 	uint16_t resp_len;
23199 	/*
23200 	 * This field is the length of the response in bytes. The last byte of
23201 	 * the response is a valid flag that will read as '1' when the command
23202 	 * has been completely written to memory.
23203 	 */
23204 	uint32_t nexthandle;
23205 	/*
23206 	 * Handle used to indicate availability of additional debug data.
23207 	 * nexthandle = 0 indicates that there is no more debug data available.
23208 	 * nexthandle != 0 indicates the handle value that should be used to
23209 	 * request the next part of debug data.
23210 	 */
23211 	uint32_t dbg_data_len;
23212 	/* The number of bytes of debug data written to debug dump buffer. */
23213 	uint32_t unused_0;
23214 	uint8_t unused_1;
23215 	uint8_t unused_2;
23216 	uint8_t unused_3;
23217 	uint8_t valid;
23218 	/*
23219 	 * This field is used in Output records to indicate that the output is
23220 	 * completely written to RAM. This field should be read as '1' to
23221 	 * indicate that the output has been completely written. When writing a
23222 	 * command completion or response to an internal processor, the order of
23223 	 * writes has to be such that this field is written last.
23224 	 */
23225 } __attribute__((packed));
23226 
23227 /* hwrm_nvm_raw_write_blk */
23228 /*
23229  * Note: Write an unmanaged block of data at any physical offset within the
23230  * NVRAM. Used for initial provisioning/manufacturing purposes only. Implemented
23231  * in the ChiMP boot-strap firmware (fwutil.bin) only.
23232  */
23233 /* Input (32 bytes) */
23234 
23235 struct hwrm_nvm_raw_write_blk_input {
23236 	uint16_t req_type;
23237 	/*
23238 	 * This value indicates what type of request this is. The format for the
23239 	 * rest of the command is determined by this field.
23240 	 */
23241 	uint16_t cmpl_ring;
23242 	/*
23243 	 * This value indicates the what completion ring the request will be
23244 	 * optionally completed on. If the value is -1, then no CR completion
23245 	 * will be generated. Any other value must be a valid CR ring_id value
23246 	 * for this function.
23247 	 */
23248 	uint16_t seq_id;
23249 	/* This value indicates the command sequence number. */
23250 	uint16_t target_id;
23251 	/*
23252 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23253 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23254 	 */
23255 	uint64_t resp_addr;
23256 	/*
23257 	 * This is the host address where the response will be written when the
23258 	 * request is complete. This area must be 16B aligned and must be
23259 	 * cleared to zero before the request is made.
23260 	 */
23261 	uint64_t host_src_addr;
23262 	/*
23263 	 * 64-bit Host Source Address. This is the loation of the source data to
23264 	 * be written.
23265 	 */
23266 	uint32_t dest_addr;
23267 	/*
23268 	 * 32-bit Destination Address. This is the NVRAM byte-offset where the
23269 	 * source data will be written to.
23270 	 */
23271 	uint32_t len;
23272 	/* Length of data to be written, in bytes. */
23273 } __attribute__((packed));
23274 
23275 /* Output (16 bytes) */
23276 
23277 struct hwrm_nvm_raw_write_blk_output {
23278 	uint16_t error_code;
23279 	/*
23280 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23281 	 * and fail the call with an error when appropriate
23282 	 */
23283 	uint16_t req_type;
23284 	/* This field returns the type of original request. */
23285 	uint16_t seq_id;
23286 	/* This field provides original sequence number of the command. */
23287 	uint16_t resp_len;
23288 	/*
23289 	 * This field is the length of the response in bytes. The last byte of
23290 	 * the response is a valid flag that will read as '1' when the command
23291 	 * has been completely written to memory.
23292 	 */
23293 	uint32_t unused_0;
23294 	uint8_t unused_1;
23295 	uint8_t unused_2;
23296 	uint8_t unused_3;
23297 	uint8_t valid;
23298 	/*
23299 	 * This field is used in Output records to indicate that the output is
23300 	 * completely written to RAM. This field should be read as '1' to
23301 	 * indicate that the output has been completely written. When writing a
23302 	 * command completion or response to an internal processor, the order of
23303 	 * writes has to be such that this field is written last.
23304 	 */
23305 } __attribute__((packed));
23306 
23307 /* hwrm_nvm_read */
23308 /*
23309  * Note: Read the contents of an NVRAM item as referenced (indexed) by an
23310  * existing directory entry.
23311  */
23312 /* Input (40 bytes) */
23313 
23314 struct hwrm_nvm_read_input {
23315 	uint16_t req_type;
23316 	/*
23317 	 * This value indicates what type of request this is. The format for the
23318 	 * rest of the command is determined by this field.
23319 	 */
23320 	uint16_t cmpl_ring;
23321 	/*
23322 	 * This value indicates the what completion ring the request will be
23323 	 * optionally completed on. If the value is -1, then no CR completion
23324 	 * will be generated. Any other value must be a valid CR ring_id value
23325 	 * for this function.
23326 	 */
23327 	uint16_t seq_id;
23328 	/* This value indicates the command sequence number. */
23329 	uint16_t target_id;
23330 	/*
23331 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23332 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23333 	 */
23334 	uint64_t resp_addr;
23335 	/*
23336 	 * This is the host address where the response will be written when the
23337 	 * request is complete. This area must be 16B aligned and must be
23338 	 * cleared to zero before the request is made.
23339 	 */
23340 	uint64_t host_dest_addr;
23341 	/*
23342 	 * 64-bit Host Destination Address. This is the host address where the
23343 	 * data will be written to.
23344 	 */
23345 	uint16_t dir_idx;
23346 	/* The 0-based index of the directory entry. */
23347 	uint8_t unused_0;
23348 	uint8_t unused_1;
23349 	uint32_t offset;
23350 	/* The NVRAM byte-offset to read from. */
23351 	uint32_t len;
23352 	/* The length of the data to be read, in bytes. */
23353 	uint32_t unused_2;
23354 } __attribute__((packed));
23355 
23356 /* Output (16 bytes) */
23357 
23358 struct hwrm_nvm_read_output {
23359 	uint16_t error_code;
23360 	/*
23361 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23362 	 * and fail the call with an error when appropriate
23363 	 */
23364 	uint16_t req_type;
23365 	/* This field returns the type of original request. */
23366 	uint16_t seq_id;
23367 	/* This field provides original sequence number of the command. */
23368 	uint16_t resp_len;
23369 	/*
23370 	 * This field is the length of the response in bytes. The last byte of
23371 	 * the response is a valid flag that will read as '1' when the command
23372 	 * has been completely written to memory.
23373 	 */
23374 	uint32_t unused_0;
23375 	uint8_t unused_1;
23376 	uint8_t unused_2;
23377 	uint8_t unused_3;
23378 	uint8_t valid;
23379 	/*
23380 	 * This field is used in Output records to indicate that the output is
23381 	 * completely written to RAM. This field should be read as '1' to
23382 	 * indicate that the output has been completely written. When writing a
23383 	 * command completion or response to an internal processor, the order of
23384 	 * writes has to be such that this field is written last.
23385 	 */
23386 } __attribute__((packed));
23387 
23388 /* hwrm_nvm_raw_dump */
23389 /* Note: Dump a raw block of data from NVRAM. */
23390 /* Input (32 bytes) */
23391 
23392 struct hwrm_nvm_raw_dump_input {
23393 	uint16_t req_type;
23394 	/*
23395 	 * This value indicates what type of request this is. The format for the
23396 	 * rest of the command is determined by this field.
23397 	 */
23398 	uint16_t cmpl_ring;
23399 	/*
23400 	 * This value indicates the what completion ring the request will be
23401 	 * optionally completed on. If the value is -1, then no CR completion
23402 	 * will be generated. Any other value must be a valid CR ring_id value
23403 	 * for this function.
23404 	 */
23405 	uint16_t seq_id;
23406 	/* This value indicates the command sequence number. */
23407 	uint16_t target_id;
23408 	/*
23409 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23410 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23411 	 */
23412 	uint64_t resp_addr;
23413 	/*
23414 	 * This is the host address where the response will be written when the
23415 	 * request is complete. This area must be 16B aligned and must be
23416 	 * cleared to zero before the request is made.
23417 	 */
23418 	uint64_t host_dest_addr;
23419 	/*
23420 	 * 64-bit Host Destination Address. This is the host address where the
23421 	 * data will be written to.
23422 	 */
23423 	uint32_t offset;
23424 	/* 32-bit NVRAM byte-offset to read from. */
23425 	uint32_t len;
23426 	/* Total length of NVRAM contents to be read, in bytes. */
23427 } __attribute__((packed));
23428 
23429 /* Output (16 bytes) */
23430 
23431 struct hwrm_nvm_raw_dump_output {
23432 	uint16_t error_code;
23433 	/*
23434 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23435 	 * and fail the call with an error when appropriate
23436 	 */
23437 	uint16_t req_type;
23438 	/* This field returns the type of original request. */
23439 	uint16_t seq_id;
23440 	/* This field provides original sequence number of the command. */
23441 	uint16_t resp_len;
23442 	/*
23443 	 * This field is the length of the response in bytes. The last byte of
23444 	 * the response is a valid flag that will read as '1' when the command
23445 	 * has been completely written to memory.
23446 	 */
23447 	uint32_t unused_0;
23448 	uint8_t unused_1;
23449 	uint8_t unused_2;
23450 	uint8_t unused_3;
23451 	uint8_t valid;
23452 	/*
23453 	 * This field is used in Output records to indicate that the output is
23454 	 * completely written to RAM. This field should be read as '1' to
23455 	 * indicate that the output has been completely written. When writing a
23456 	 * command completion or response to an internal processor, the order of
23457 	 * writes has to be such that this field is written last.
23458 	 */
23459 } __attribute__((packed));
23460 
23461 /* hwrm_nvm_get_dir_entries */
23462 /*
23463  * Description: Read the NVRAM directory. Each directory entry is at least 24
23464  * bytes in length and contains the: - 16-bit directory entry type
23465  * (BNX_DIR_TYPE_* value) - 16-bit ordinal (instance of this directory entry
23466  * type) - 16-bit extension flags (identifies inactive entries and entries for
23467  * firmware update) - 16-bit attribute flags (identifies entries with a
23468  * purposely invalid chksum value) - 32-bit byte-offset into NVRAM where this
23469  * item data is located - 32-bit length of allocated NVRAM for item, in bytes
23470  * (multiple of block size) - 32-bit length of data (excluding padding), in
23471  * bytes (may be 0) - 32-bit data checksum (CRC-32) See the
23472  * bnxnvm_directory_entry_t definition in the file bnxnvm_defs.h.
23473  */
23474 /* Input (24 bytes) */
23475 
23476 struct hwrm_nvm_get_dir_entries_input {
23477 	uint16_t req_type;
23478 	/*
23479 	 * This value indicates what type of request this is. The format for the
23480 	 * rest of the command is determined by this field.
23481 	 */
23482 	uint16_t cmpl_ring;
23483 	/*
23484 	 * This value indicates the what completion ring the request will be
23485 	 * optionally completed on. If the value is -1, then no CR completion
23486 	 * will be generated. Any other value must be a valid CR ring_id value
23487 	 * for this function.
23488 	 */
23489 	uint16_t seq_id;
23490 	/* This value indicates the command sequence number. */
23491 	uint16_t target_id;
23492 	/*
23493 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23494 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23495 	 */
23496 	uint64_t resp_addr;
23497 	/*
23498 	 * This is the host address where the response will be written when the
23499 	 * request is complete. This area must be 16B aligned and must be
23500 	 * cleared to zero before the request is made.
23501 	 */
23502 	uint64_t host_dest_addr;
23503 	/*
23504 	 * 64-bit Host Destination Address. This is the host address where the
23505 	 * directory will be written.
23506 	 */
23507 } __attribute__((packed));
23508 
23509 /* Output (16 bytes) */
23510 
23511 struct hwrm_nvm_get_dir_entries_output {
23512 	uint16_t error_code;
23513 	/*
23514 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23515 	 * and fail the call with an error when appropriate
23516 	 */
23517 	uint16_t req_type;
23518 	/* This field returns the type of original request. */
23519 	uint16_t seq_id;
23520 	/* This field provides original sequence number of the command. */
23521 	uint16_t resp_len;
23522 	/*
23523 	 * This field is the length of the response in bytes. The last byte of
23524 	 * the response is a valid flag that will read as '1' when the command
23525 	 * has been completely written to memory.
23526 	 */
23527 	uint32_t unused_0;
23528 	uint8_t unused_1;
23529 	uint8_t unused_2;
23530 	uint8_t unused_3;
23531 	uint8_t valid;
23532 	/*
23533 	 * This field is used in Output records to indicate that the output is
23534 	 * completely written to RAM. This field should be read as '1' to
23535 	 * indicate that the output has been completely written. When writing a
23536 	 * command completion or response to an internal processor, the order of
23537 	 * writes has to be such that this field is written last.
23538 	 */
23539 } __attribute__((packed));
23540 
23541 /* hwrm_nvm_get_dir_info */
23542 /* Note: Get Directory Header info. */
23543 /* Input (16 bytes) */
23544 
23545 struct hwrm_nvm_get_dir_info_input {
23546 	uint16_t req_type;
23547 	/*
23548 	 * This value indicates what type of request this is. The format for the
23549 	 * rest of the command is determined by this field.
23550 	 */
23551 	uint16_t cmpl_ring;
23552 	/*
23553 	 * This value indicates the what completion ring the request will be
23554 	 * optionally completed on. If the value is -1, then no CR completion
23555 	 * will be generated. Any other value must be a valid CR ring_id value
23556 	 * for this function.
23557 	 */
23558 	uint16_t seq_id;
23559 	/* This value indicates the command sequence number. */
23560 	uint16_t target_id;
23561 	/*
23562 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23563 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23564 	 */
23565 	uint64_t resp_addr;
23566 	/*
23567 	 * This is the host address where the response will be written when the
23568 	 * request is complete. This area must be 16B aligned and must be
23569 	 * cleared to zero before the request is made.
23570 	 */
23571 } __attribute__((packed));
23572 
23573 /* Output (24 bytes) */
23574 
23575 struct hwrm_nvm_get_dir_info_output {
23576 	uint16_t error_code;
23577 	/*
23578 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23579 	 * and fail the call with an error when appropriate
23580 	 */
23581 	uint16_t req_type;
23582 	/* This field returns the type of original request. */
23583 	uint16_t seq_id;
23584 	/* This field provides original sequence number of the command. */
23585 	uint16_t resp_len;
23586 	/*
23587 	 * This field is the length of the response in bytes. The last byte of
23588 	 * the response is a valid flag that will read as '1' when the command
23589 	 * has been completely written to memory.
23590 	 */
23591 	uint32_t entries;
23592 	/* Number of directory entries in the directory. */
23593 	uint32_t entry_length;
23594 	/* Size of each directory entry, in bytes. */
23595 	uint32_t unused_0;
23596 	uint8_t unused_1;
23597 	uint8_t unused_2;
23598 	uint8_t unused_3;
23599 	uint8_t valid;
23600 	/*
23601 	 * This field is used in Output records to indicate that the output is
23602 	 * completely written to RAM. This field should be read as '1' to
23603 	 * indicate that the output has been completely written. When writing a
23604 	 * command completion or response to an internal processor, the order of
23605 	 * writes has to be such that this field is written last.
23606 	 */
23607 } __attribute__((packed));
23608 
23609 /* hwrm_nvm_write */
23610 /*
23611  * Note: Write to the allocated NVRAM of an item referenced by an existing
23612  * directory entry.
23613  */
23614 /* Input (48 bytes) */
23615 
23616 struct hwrm_nvm_write_input {
23617 	uint16_t req_type;
23618 	/*
23619 	 * This value indicates what type of request this is. The format for the
23620 	 * rest of the command is determined by this field.
23621 	 */
23622 	uint16_t cmpl_ring;
23623 	/*
23624 	 * This value indicates the what completion ring the request will be
23625 	 * optionally completed on. If the value is -1, then no CR completion
23626 	 * will be generated. Any other value must be a valid CR ring_id value
23627 	 * for this function.
23628 	 */
23629 	uint16_t seq_id;
23630 	/* This value indicates the command sequence number. */
23631 	uint16_t target_id;
23632 	/*
23633 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23634 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23635 	 */
23636 	uint64_t resp_addr;
23637 	/*
23638 	 * This is the host address where the response will be written when the
23639 	 * request is complete. This area must be 16B aligned and must be
23640 	 * cleared to zero before the request is made.
23641 	 */
23642 	uint64_t host_src_addr;
23643 	/* 64-bit Host Source Address. This is where the source data is. */
23644 	uint16_t dir_type;
23645 	/*
23646 	 * The Directory Entry Type (valid values are defined in the
23647 	 * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
23648 	 */
23649 	uint16_t dir_ordinal;
23650 	/*
23651 	 * Directory ordinal. The 0-based instance of the combined Directory
23652 	 * Entry Type and Extension.
23653 	 */
23654 	uint16_t dir_ext;
23655 	/*
23656 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file
23657 	 * bnxnvm_defs.h).
23658 	 */
23659 	uint16_t dir_attr;
23660 	/*
23661 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file
23662 	 * bnxnvm_defs.h).
23663 	 */
23664 	uint32_t dir_data_length;
23665 	/*
23666 	 * Length of data to write, in bytes. May be less than or equal to the
23667 	 * allocated size for the directory entry. The data length stored in the
23668 	 * directory entry will be updated to reflect this value once the write
23669 	 * is complete.
23670 	 */
23671 	uint16_t option;
23672 	/* Option. */
23673 	uint16_t flags;
23674 	/*
23675 	 * When this bit is '1', the original active image will not be removed.
23676 	 * TBD: what purpose is this?
23677 	 */
23678 	#define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG	UINT32_C(0x1)
23679 	uint32_t dir_item_length;
23680 	/*
23681 	 * The requested length of the allocated NVM for the item, in bytes.
23682 	 * This value may be greater than or equal to the specified data length
23683 	 * (dir_data_length). If this value is less than the specified data
23684 	 * length, it will be ignored. The response will contain the actual
23685 	 * allocated item length, which may be greater than the requested item
23686 	 * length. The purpose for allocating more than the required number of
23687 	 * bytes for an item's data is to pre-allocate extra storage (padding)
23688 	 * to accomodate the potential future growth of an item (e.g. upgraded
23689 	 * firmware with a size increase, log growth, expanded configuration
23690 	 * data).
23691 	 */
23692 	uint32_t unused_0;
23693 } __attribute__((packed));
23694 
23695 /* Output (16 bytes) */
23696 
23697 struct hwrm_nvm_write_output {
23698 	uint16_t error_code;
23699 	/*
23700 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23701 	 * and fail the call with an error when appropriate
23702 	 */
23703 	uint16_t req_type;
23704 	/* This field returns the type of original request. */
23705 	uint16_t seq_id;
23706 	/* This field provides original sequence number of the command. */
23707 	uint16_t resp_len;
23708 	/*
23709 	 * This field is the length of the response in bytes. The last byte of
23710 	 * the response is a valid flag that will read as '1' when the command
23711 	 * has been completely written to memory.
23712 	 */
23713 	uint32_t dir_item_length;
23714 	/*
23715 	 * Length of the allocated NVM for the item, in bytes. The value may be
23716 	 * greater than or equal to the specified data length or the requested
23717 	 * item length. The actual item length used when creating a new
23718 	 * directory entry will be a multiple of an NVM block size.
23719 	 */
23720 	uint16_t dir_idx;
23721 	/* The directory index of the created or modified item. */
23722 	uint8_t unused_0;
23723 	uint8_t valid;
23724 	/*
23725 	 * This field is used in Output records to indicate that the output is
23726 	 * completely written to RAM. This field should be read as '1' to
23727 	 * indicate that the output has been completely written. When writing a
23728 	 * command completion or response to an internal processor, the order of
23729 	 * writes has to be such that this field is written last.
23730 	 */
23731 } __attribute__((packed));
23732 
23733 /* Command specific Error Codes (8 bytes) */
23734 
23735 struct hwrm_nvm_write_cmd_err {
23736 	uint8_t code;
23737 	/*
23738 	 * command specific error codes that goes to the cmd_err field in Common
23739 	 * HWRM Error Response.
23740 	 */
23741 	/* Unknown error */
23742 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
23743 	/* Unable to complete operation due to fragmentation */
23744 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR		UINT32_C(0x1)
23745 	/* nvm is completely full. */
23746 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE		UINT32_C(0x2)
23747 	uint8_t unused_0[7];
23748 } __attribute__((packed));
23749 
23750 /* hwrm_nvm_modify */
23751 /*
23752  * Note: Modify the contents of an NVRAM item as referenced (indexed) by an
23753  * existing directory entry.
23754  */
23755 /* Input (40 bytes) */
23756 
23757 struct hwrm_nvm_modify_input {
23758 	uint16_t req_type;
23759 	/*
23760 	 * This value indicates what type of request this is. The format for the
23761 	 * rest of the command is determined by this field.
23762 	 */
23763 	uint16_t cmpl_ring;
23764 	/*
23765 	 * This value indicates the what completion ring the request will be
23766 	 * optionally completed on. If the value is -1, then no CR completion
23767 	 * will be generated. Any other value must be a valid CR ring_id value
23768 	 * for this function.
23769 	 */
23770 	uint16_t seq_id;
23771 	/* This value indicates the command sequence number. */
23772 	uint16_t target_id;
23773 	/*
23774 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23775 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23776 	 */
23777 	uint64_t resp_addr;
23778 	/*
23779 	 * This is the host address where the response will be written when the
23780 	 * request is complete. This area must be 16B aligned and must be
23781 	 * cleared to zero before the request is made.
23782 	 */
23783 	uint64_t host_src_addr;
23784 	/* 64-bit Host Source Address. This is where the modified data is. */
23785 	uint16_t dir_idx;
23786 	/* 16-bit directory entry index. */
23787 	uint8_t unused_0;
23788 	uint8_t unused_1;
23789 	uint32_t offset;
23790 	/* 32-bit NVRAM byte-offset to modify content from. */
23791 	uint32_t len;
23792 	/*
23793 	 * Length of data to be modified, in bytes. The length shall be non-
23794 	 * zero.
23795 	 */
23796 	uint32_t unused_2;
23797 } __attribute__((packed));
23798 
23799 /* Output (16 bytes) */
23800 
23801 struct hwrm_nvm_modify_output {
23802 	uint16_t error_code;
23803 	/*
23804 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23805 	 * and fail the call with an error when appropriate
23806 	 */
23807 	uint16_t req_type;
23808 	/* This field returns the type of original request. */
23809 	uint16_t seq_id;
23810 	/* This field provides original sequence number of the command. */
23811 	uint16_t resp_len;
23812 	/*
23813 	 * This field is the length of the response in bytes. The last byte of
23814 	 * the response is a valid flag that will read as '1' when the command
23815 	 * has been completely written to memory.
23816 	 */
23817 	uint32_t unused_0;
23818 	uint8_t unused_1;
23819 	uint8_t unused_2;
23820 	uint8_t unused_3;
23821 	uint8_t valid;
23822 	/*
23823 	 * This field is used in Output records to indicate that the output is
23824 	 * completely written to RAM. This field should be read as '1' to
23825 	 * indicate that the output has been completely written. When writing a
23826 	 * command completion or response to an internal processor, the order of
23827 	 * writes has to be such that this field is written last.
23828 	 */
23829 } __attribute__((packed));
23830 
23831 /* hwrm_nvm_find_dir_entry */
23832 /*
23833  * Note: Search a directory entry in the directory by either directory entry
23834  * index or directory entry parameters.
23835  */
23836 /* Input (32 bytes) */
23837 
23838 struct hwrm_nvm_find_dir_entry_input {
23839 	uint16_t req_type;
23840 	/*
23841 	 * This value indicates what type of request this is. The format for the
23842 	 * rest of the command is determined by this field.
23843 	 */
23844 	uint16_t cmpl_ring;
23845 	/*
23846 	 * This value indicates the what completion ring the request will be
23847 	 * optionally completed on. If the value is -1, then no CR completion
23848 	 * will be generated. Any other value must be a valid CR ring_id value
23849 	 * for this function.
23850 	 */
23851 	uint16_t seq_id;
23852 	/* This value indicates the command sequence number. */
23853 	uint16_t target_id;
23854 	/*
23855 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23856 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23857 	 */
23858 	uint64_t resp_addr;
23859 	/*
23860 	 * This is the host address where the response will be written when the
23861 	 * request is complete. This area must be 16B aligned and must be
23862 	 * cleared to zero before the request is made.
23863 	 */
23864 	uint32_t enables;
23865 	/* This bit must be '1' for the dir_idx_valid field to be configured. */
23866 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID UINT32_C(0x1)
23867 	uint16_t dir_idx;
23868 	/* Directory Entry Index */
23869 	uint16_t dir_type;
23870 	/* Directory Entry (Image) Type */
23871 	uint16_t dir_ordinal;
23872 	/* Directory ordinal. The instance of this Directory Type */
23873 	uint16_t dir_ext;
23874 	/* The Directory Entry Extension flags. */
23875 	uint8_t opt_ordinal;
23876 	/* This value indicates the search option using dir_ordinal. */
23877 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK	UINT32_C(0x3)
23878 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT	0
23879 	/* Equal to specified ordinal value. */
23880 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ	UINT32_C(0x0)
23881 	/* Greater than or equal to specified ordinal value */
23882 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE	UINT32_C(0x1)
23883 	/* Greater than specified ordinal value */
23884 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT	UINT32_C(0x2)
23885 	uint8_t unused_1[3];
23886 } __attribute__((packed));
23887 
23888 /* Output (32 bytes) */
23889 
23890 struct hwrm_nvm_find_dir_entry_output {
23891 	uint16_t error_code;
23892 	/*
23893 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23894 	 * and fail the call with an error when appropriate
23895 	 */
23896 	uint16_t req_type;
23897 	/* This field returns the type of original request. */
23898 	uint16_t seq_id;
23899 	/* This field provides original sequence number of the command. */
23900 	uint16_t resp_len;
23901 	/*
23902 	 * This field is the length of the response in bytes. The last byte of
23903 	 * the response is a valid flag that will read as '1' when the command
23904 	 * has been completely written to memory.
23905 	 */
23906 	uint32_t dir_item_length;
23907 	/* Allocated NVRAM for this directory entry, in bytes. */
23908 	uint32_t dir_data_length;
23909 	/* Size of the stored data for this directory entry, in bytes. */
23910 	uint32_t fw_ver;
23911 	/*
23912 	 * Firmware version. Only valid if the directory entry is for embedded
23913 	 * firmware stored in APE_BIN Format.
23914 	 */
23915 	uint16_t dir_ordinal;
23916 	/* Directory ordinal. */
23917 	uint16_t dir_idx;
23918 	/* Directory Entry Index */
23919 	uint32_t unused_0;
23920 	uint8_t unused_1;
23921 	uint8_t unused_2;
23922 	uint8_t unused_3;
23923 	uint8_t valid;
23924 	/*
23925 	 * This field is used in Output records to indicate that the output is
23926 	 * completely written to RAM. This field should be read as '1' to
23927 	 * indicate that the output has been completely written. When writing a
23928 	 * command completion or response to an internal processor, the order of
23929 	 * writes has to be such that this field is written last.
23930 	 */
23931 } __attribute__((packed));
23932 
23933 /* hwrm_nvm_erase_dir_entry */
23934 /*
23935  * Note: Remove a directory entry specified by the directory entry index from
23936  * the directory.
23937  */
23938 /* Input (24 bytes) */
23939 
23940 struct hwrm_nvm_erase_dir_entry_input {
23941 	uint16_t req_type;
23942 	/*
23943 	 * This value indicates what type of request this is. The format for the
23944 	 * rest of the command is determined by this field.
23945 	 */
23946 	uint16_t cmpl_ring;
23947 	/*
23948 	 * This value indicates the what completion ring the request will be
23949 	 * optionally completed on. If the value is -1, then no CR completion
23950 	 * will be generated. Any other value must be a valid CR ring_id value
23951 	 * for this function.
23952 	 */
23953 	uint16_t seq_id;
23954 	/* This value indicates the command sequence number. */
23955 	uint16_t target_id;
23956 	/*
23957 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
23958 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
23959 	 */
23960 	uint64_t resp_addr;
23961 	/*
23962 	 * This is the host address where the response will be written when the
23963 	 * request is complete. This area must be 16B aligned and must be
23964 	 * cleared to zero before the request is made.
23965 	 */
23966 	uint16_t dir_idx;
23967 	/* Directory Entry Index */
23968 	uint16_t unused_0[3];
23969 } __attribute__((packed));
23970 
23971 /* Output (16 bytes) */
23972 
23973 struct hwrm_nvm_erase_dir_entry_output {
23974 	uint16_t error_code;
23975 	/*
23976 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
23977 	 * and fail the call with an error when appropriate
23978 	 */
23979 	uint16_t req_type;
23980 	/* This field returns the type of original request. */
23981 	uint16_t seq_id;
23982 	/* This field provides original sequence number of the command. */
23983 	uint16_t resp_len;
23984 	/*
23985 	 * This field is the length of the response in bytes. The last byte of
23986 	 * the response is a valid flag that will read as '1' when the command
23987 	 * has been completely written to memory.
23988 	 */
23989 	uint32_t unused_0;
23990 	uint8_t unused_1;
23991 	uint8_t unused_2;
23992 	uint8_t unused_3;
23993 	uint8_t valid;
23994 	/*
23995 	 * This field is used in Output records to indicate that the output is
23996 	 * completely written to RAM. This field should be read as '1' to
23997 	 * indicate that the output has been completely written. When writing a
23998 	 * command completion or response to an internal processor, the order of
23999 	 * writes has to be such that this field is written last.
24000 	 */
24001 } __attribute__((packed));
24002 
24003 /* hwrm_nvm_get_dev_info */
24004 /*
24005  * Note: Get device info. Return Manufacturer_ID, Device_ID, block_size,
24006  * nvram_size, reserved_size and available_size.
24007  */
24008 /* Input (16 bytes) */
24009 
24010 struct hwrm_nvm_get_dev_info_input {
24011 	uint16_t req_type;
24012 	/*
24013 	 * This value indicates what type of request this is. The format for the
24014 	 * rest of the command is determined by this field.
24015 	 */
24016 	uint16_t cmpl_ring;
24017 	/*
24018 	 * This value indicates the what completion ring the request will be
24019 	 * optionally completed on. If the value is -1, then no CR completion
24020 	 * will be generated. Any other value must be a valid CR ring_id value
24021 	 * for this function.
24022 	 */
24023 	uint16_t seq_id;
24024 	/* This value indicates the command sequence number. */
24025 	uint16_t target_id;
24026 	/*
24027 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24028 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24029 	 */
24030 	uint64_t resp_addr;
24031 	/*
24032 	 * This is the host address where the response will be written when the
24033 	 * request is complete. This area must be 16B aligned and must be
24034 	 * cleared to zero before the request is made.
24035 	 */
24036 } __attribute__((packed));
24037 
24038 /* Output (32 bytes) */
24039 
24040 struct hwrm_nvm_get_dev_info_output {
24041 	uint16_t error_code;
24042 	/*
24043 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24044 	 * and fail the call with an error when appropriate
24045 	 */
24046 	uint16_t req_type;
24047 	/* This field returns the type of original request. */
24048 	uint16_t seq_id;
24049 	/* This field provides original sequence number of the command. */
24050 	uint16_t resp_len;
24051 	/*
24052 	 * This field is the length of the response in bytes. The last byte of
24053 	 * the response is a valid flag that will read as '1' when the command
24054 	 * has been completely written to memory.
24055 	 */
24056 	uint16_t manufacturer_id;
24057 	/* Manufacturer ID. */
24058 	uint16_t device_id;
24059 	/* Device ID. */
24060 	uint32_t sector_size;
24061 	/* Sector size of the NVRAM device. */
24062 	uint32_t nvram_size;
24063 	/* Total size, in bytes of the NVRAM device. */
24064 	uint32_t reserved_size;
24065 	uint32_t available_size;
24066 	/*
24067 	 * Available size that can be used, in bytes. Available size is the
24068 	 * NVRAM size take away the used size and reserved size.
24069 	 */
24070 	uint8_t unused_0;
24071 	uint8_t unused_1;
24072 	uint8_t unused_2;
24073 	uint8_t valid;
24074 	/*
24075 	 * This field is used in Output records to indicate that the output is
24076 	 * completely written to RAM. This field should be read as '1' to
24077 	 * indicate that the output has been completely written. When writing a
24078 	 * command completion or response to an internal processor, the order of
24079 	 * writes has to be such that this field is written last.
24080 	 */
24081 } __attribute__((packed));
24082 
24083 /* hwrm_nvm_mod_dir_entry */
24084 /* Note: Modify a directory entry parameters in the directory. */
24085 /* Input (32 bytes) */
24086 
24087 struct hwrm_nvm_mod_dir_entry_input {
24088 	uint16_t req_type;
24089 	/*
24090 	 * This value indicates what type of request this is. The format for the
24091 	 * rest of the command is determined by this field.
24092 	 */
24093 	uint16_t cmpl_ring;
24094 	/*
24095 	 * This value indicates the what completion ring the request will be
24096 	 * optionally completed on. If the value is -1, then no CR completion
24097 	 * will be generated. Any other value must be a valid CR ring_id value
24098 	 * for this function.
24099 	 */
24100 	uint16_t seq_id;
24101 	/* This value indicates the command sequence number. */
24102 	uint16_t target_id;
24103 	/*
24104 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24105 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24106 	 */
24107 	uint64_t resp_addr;
24108 	/*
24109 	 * This is the host address where the response will be written when the
24110 	 * request is complete. This area must be 16B aligned and must be
24111 	 * cleared to zero before the request is made.
24112 	 */
24113 	uint32_t enables;
24114 	/* This bit must be '1' for the checksum field to be configured. */
24115 	#define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM	UINT32_C(0x1)
24116 	uint16_t dir_idx;
24117 	/* Directory Entry Index */
24118 	uint16_t dir_ordinal;
24119 	/* Directory ordinal. The (0-based) instance of this Directory Type. */
24120 	uint16_t dir_ext;
24121 	/*
24122 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension
24123 	 * flag definitions).
24124 	 */
24125 	uint16_t dir_attr;
24126 	/*
24127 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute
24128 	 * flag definitions).
24129 	 */
24130 	uint32_t checksum;
24131 	/*
24132 	 * If valid, then this field updates the checksum value of the content
24133 	 * in the directory entry.
24134 	 */
24135 } __attribute__((packed));
24136 
24137 /* Output (16 bytes) */
24138 
24139 struct hwrm_nvm_mod_dir_entry_output {
24140 	uint16_t error_code;
24141 	/*
24142 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24143 	 * and fail the call with an error when appropriate
24144 	 */
24145 	uint16_t req_type;
24146 	/* This field returns the type of original request. */
24147 	uint16_t seq_id;
24148 	/* This field provides original sequence number of the command. */
24149 	uint16_t resp_len;
24150 	/*
24151 	 * This field is the length of the response in bytes. The last byte of
24152 	 * the response is a valid flag that will read as '1' when the command
24153 	 * has been completely written to memory.
24154 	 */
24155 	uint32_t unused_0;
24156 	uint8_t unused_1;
24157 	uint8_t unused_2;
24158 	uint8_t unused_3;
24159 	uint8_t valid;
24160 	/*
24161 	 * This field is used in Output records to indicate that the output is
24162 	 * completely written to RAM. This field should be read as '1' to
24163 	 * indicate that the output has been completely written. When writing a
24164 	 * command completion or response to an internal processor, the order of
24165 	 * writes has to be such that this field is written last.
24166 	 */
24167 } __attribute__((packed));
24168 
24169 /* hwrm_nvm_verify_update */
24170 /*
24171  * Description: Verify updated content of a directory entry. Before this
24172  * verification, there should be two valid directory entries of the given
24173  * directory type (one with "UPDATE" directory extension flag and the current
24174  * one "ACTIVE"). Below are steps the HWRM performs for executing this command:
24175  * # The HWRM finds the directory entry with "UDPATE" extension flag based on
24176  * input parameters. The new directory entry should already have updated
24177  * contents. # The HWRM performs signature verification of the updated content.
24178  * # If the signature verification is successful, the two directory entries are
24179  * switched (the verified updated entry is made active and the current "ACTIVE"
24180  * entry is marked with "UPDATE" extension flag). Implementation notes: # The
24181  * HWRM shall allow this command to be requested against any dir_type value (and
24182  * not limit it to a subset). # In the case of an updated HWRM firmware, the new
24183  * firmware version shall not automatically take effect (i.e. be executed).
24184  */
24185 /* Input (24 bytes) */
24186 
24187 struct hwrm_nvm_verify_update_input {
24188 	uint16_t req_type;
24189 	/*
24190 	 * This value indicates what type of request this is. The format for the
24191 	 * rest of the command is determined by this field.
24192 	 */
24193 	uint16_t cmpl_ring;
24194 	/*
24195 	 * This value indicates the what completion ring the request will be
24196 	 * optionally completed on. If the value is -1, then no CR completion
24197 	 * will be generated. Any other value must be a valid CR ring_id value
24198 	 * for this function.
24199 	 */
24200 	uint16_t seq_id;
24201 	/* This value indicates the command sequence number. */
24202 	uint16_t target_id;
24203 	/*
24204 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24205 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24206 	 */
24207 	uint64_t resp_addr;
24208 	/*
24209 	 * This is the host address where the response will be written when the
24210 	 * request is complete. This area must be 16B aligned and must be
24211 	 * cleared to zero before the request is made.
24212 	 */
24213 	uint16_t dir_type;
24214 	/* Directory Entry Type, to be verified. */
24215 	uint16_t dir_ordinal;
24216 	/* Directory ordinal. The instance of the Directory Type to be verified. */
24217 	uint16_t dir_ext;
24218 	/*
24219 	 * The Directory Entry Extension flags. The "UPDATE" extension flag must
24220 	 * be set in this value. A corresponding directory entry with the same
24221 	 * type and ordinal values but *without* the "UPDATE" extension flag
24222 	 * must also exist. The other flags of the extension must be identical
24223 	 * between the active and update entries.
24224 	 */
24225 	uint16_t unused_0;
24226 } __attribute__((packed));
24227 
24228 /* Output (16 bytes) */
24229 
24230 struct hwrm_nvm_verify_update_output {
24231 	uint16_t error_code;
24232 	/*
24233 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24234 	 * and fail the call with an error when appropriate
24235 	 */
24236 	uint16_t req_type;
24237 	/* This field returns the type of original request. */
24238 	uint16_t seq_id;
24239 	/* This field provides original sequence number of the command. */
24240 	uint16_t resp_len;
24241 	/*
24242 	 * This field is the length of the response in bytes. The last byte of
24243 	 * the response is a valid flag that will read as '1' when the command
24244 	 * has been completely written to memory.
24245 	 */
24246 	uint32_t unused_0;
24247 	uint8_t unused_1;
24248 	uint8_t unused_2;
24249 	uint8_t unused_3;
24250 	uint8_t valid;
24251 	/*
24252 	 * This field is used in Output records to indicate that the output is
24253 	 * completely written to RAM. This field should be read as '1' to
24254 	 * indicate that the output has been completely written. When writing a
24255 	 * command completion or response to an internal processor, the order of
24256 	 * writes has to be such that this field is written last.
24257 	 */
24258 } __attribute__((packed));
24259 
24260 /* hwrm_nvm_install_update */
24261 /*
24262  * Description: Install a staged NVM package. A package file must first be
24263  * staged into the "UPDATE" NVM item. This staging is accomplished using the
24264  * nvm_write and/or nvm_modify HWRM commands.
24265  */
24266 /* Input (24 bytes) */
24267 
24268 struct hwrm_nvm_install_update_input {
24269 	uint16_t req_type;
24270 	/*
24271 	 * This value indicates what type of request this is. The format for the
24272 	 * rest of the command is determined by this field.
24273 	 */
24274 	uint16_t cmpl_ring;
24275 	/*
24276 	 * This value indicates the what completion ring the request will be
24277 	 * optionally completed on. If the value is -1, then no CR completion
24278 	 * will be generated. Any other value must be a valid CR ring_id value
24279 	 * for this function.
24280 	 */
24281 	uint16_t seq_id;
24282 	/* This value indicates the command sequence number. */
24283 	uint16_t target_id;
24284 	/*
24285 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24286 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24287 	 */
24288 	uint64_t resp_addr;
24289 	/*
24290 	 * This is the host address where the response will be written when the
24291 	 * request is complete. This area must be 16B aligned and must be
24292 	 * cleared to zero before the request is made.
24293 	 */
24294 	uint32_t install_type;
24295 	/*
24296 	 * Installation type. If the value 3 through 0xffff is used, only
24297 	 * packaged items with that type value will be installed and conditional
24298 	 * installation directives for those packaged items will be over-ridden
24299 	 * (i.e. 'create' or 'replace' will be treated as 'install').
24300 	 */
24301 	/*
24302 	 * Perform a normal package installation. Conditional
24303 	 * installation directives (e.g. 'create' and 'replace') of
24304 	 * packaged items will be followed.
24305 	 */
24306 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
24307 	/*
24308 	 * Install all packaged items regardless of installation
24309 	 * directive (i.e. treat all packaged items as though they have
24310 	 * an installation directive of 'install').
24311 	 */
24312 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL	UINT32_C(0xffffffff)
24313 	uint16_t flags;
24314 	/*
24315 	 * If set to 1, then securely erase all unused locations in persistent
24316 	 * storage.
24317 	 */
24318 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE UINT32_C(0x1)
24319 	/*
24320 	 * If set to 1, then unspecifed images, images not in the package file,
24321 	 * will be safely deleted. When combined with erase_unused_space then
24322 	 * unspecified images will be securely erased.
24323 	 */
24324 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG UINT32_C(0x2)
24325 	/*
24326 	 * If set to 1, FW will defragment the NVM if defragmentation is
24327 	 * required for the update. Allow additional time for this command to
24328 	 * complete if this bit is set to 1.
24329 	 */
24330 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG UINT32_C(0x4)
24331 	uint16_t unused_0;
24332 } __attribute__((packed));
24333 
24334 /* Output (24 bytes) */
24335 
24336 struct hwrm_nvm_install_update_output {
24337 	uint16_t error_code;
24338 	/*
24339 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24340 	 * and fail the call with an error when appropriate
24341 	 */
24342 	uint16_t req_type;
24343 	/* This field returns the type of original request. */
24344 	uint16_t seq_id;
24345 	/* This field provides original sequence number of the command. */
24346 	uint16_t resp_len;
24347 	/*
24348 	 * This field is the length of the response in bytes. The last byte of
24349 	 * the response is a valid flag that will read as '1' when the command
24350 	 * has been completely written to memory.
24351 	 */
24352 	uint64_t installed_items;
24353 	/*
24354 	 * Bit-mask of successfully installed items. Bit-0 corresponding to the
24355 	 * first packaged item, Bit-1 for the second item, etc. A value of 0
24356 	 * indicates that no items were successfully installed.
24357 	 */
24358 	uint8_t result;
24359 	/* result is 8 b */
24360 	/* There was no problem with the package installation. */
24361 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS	UINT32_C(0x0)
24362 	uint8_t problem_item;
24363 	/* problem_item is 8 b */
24364 	/* There was no problem with any packaged items. */
24365 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE  UINT32_C(0x0)
24366 	/* There was a problem with the NVM package itself. */
24367 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE UINT32_C(0xff)
24368 	uint8_t reset_required;
24369 	/* reset_required is 8 b */
24370 	/*
24371 	 * No reset is required for installed/updated firmware or
24372 	 * microcode to take effect.
24373 	 */
24374 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE UINT32_C(0x0)
24375 	/*
24376 	 * A PCIe reset (e.g. system reboot) is required for newly
24377 	 * installed/updated firmware or microcode to take effect.
24378 	 */
24379 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI UINT32_C(0x1)
24380 	/*
24381 	 * A controller power reset (e.g. system power-cycle) is
24382 	 * required for newly installed/updated firmware or microcode to
24383 	 * take effect. Some newly installed/updated firmware or
24384 	 * microcode may still take effect upon the next PCIe reset.
24385 	 */
24386 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER UINT32_C(0x2)
24387 	uint8_t unused_0;
24388 	uint8_t unused_1;
24389 	uint8_t unused_2;
24390 	uint8_t unused_3;
24391 	uint8_t valid;
24392 	/*
24393 	 * This field is used in Output records to indicate that the output is
24394 	 * completely written to RAM. This field should be read as '1' to
24395 	 * indicate that the output has been completely written. When writing a
24396 	 * command completion or response to an internal processor, the order of
24397 	 * writes has to be such that this field is written last.
24398 	 */
24399 } __attribute__((packed));
24400 
24401 /* Command specific Error Codes (8 bytes) */
24402 
24403 struct hwrm_nvm_install_update_cmd_err {
24404 	uint8_t code;
24405 	/*
24406 	 * command specific error codes that goes to the cmd_err field in Common
24407 	 * HWRM Error Response.
24408 	 */
24409 	/* Unknown error */
24410 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
24411 	/* Unable to complete operation due to fragmentation */
24412 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR	UINT32_C(0x1)
24413 	/* nvm is completely full. */
24414 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE	UINT32_C(0x2)
24415 	uint8_t unused_0[7];
24416 } __attribute__((packed));
24417 
24418 /* hwrm_nvm_flush */
24419 /* Input (16 bytes) */
24420 
24421 struct hwrm_nvm_flush_input {
24422 	uint16_t req_type;
24423 	/*
24424 	 * This value indicates what type of request this is. The format for the
24425 	 * rest of the command is determined by this field.
24426 	 */
24427 	uint16_t cmpl_ring;
24428 	/*
24429 	 * This value indicates the what completion ring the request will be
24430 	 * optionally completed on. If the value is -1, then no CR completion
24431 	 * will be generated. Any other value must be a valid CR ring_id value
24432 	 * for this function.
24433 	 */
24434 	uint16_t seq_id;
24435 	/* This value indicates the command sequence number. */
24436 	uint16_t target_id;
24437 	/*
24438 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24439 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24440 	 */
24441 	uint64_t resp_addr;
24442 	/*
24443 	 * This is the host address where the response will be written when the
24444 	 * request is complete. This area must be 16B aligned and must be
24445 	 * cleared to zero before the request is made.
24446 	 */
24447 } __attribute__((packed));
24448 
24449 /* Output (16 bytes) */
24450 
24451 struct hwrm_nvm_flush_output {
24452 	uint16_t error_code;
24453 	/*
24454 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24455 	 * and fail the call with an error when appropriate
24456 	 */
24457 	uint16_t req_type;
24458 	/* This field returns the type of original request. */
24459 	uint16_t seq_id;
24460 	/* This field provides original sequence number of the command. */
24461 	uint16_t resp_len;
24462 	/*
24463 	 * This field is the length of the response in bytes. The last byte of
24464 	 * the response is a valid flag that will read as '1' when the command
24465 	 * has been completely written to memory.
24466 	 */
24467 	uint32_t unused_0;
24468 	uint8_t unused_1;
24469 	uint8_t unused_2;
24470 	uint8_t unused_3;
24471 	uint8_t valid;
24472 	/*
24473 	 * This field is used in Output records to indicate that the output is
24474 	 * completely written to RAM. This field should be read as '1' to
24475 	 * indicate that the output has been completely written. When writing a
24476 	 * command completion or response to an internal processor, the order of
24477 	 * writes has to be such that this field is written last.
24478 	 */
24479 } __attribute__((packed));
24480 
24481 /* Command specific Error Codes (8 bytes) */
24482 
24483 struct hwrm_nvm_flush_cmd_err {
24484 	uint8_t code;
24485 	/*
24486 	 * command specific error codes that goes to the cmd_err field in Common
24487 	 * HWRM Error Response.
24488 	 */
24489 	/* Unknown error */
24490 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
24491 	/* flush could not be performed */
24492 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL		UINT32_C(0x1)
24493 	uint8_t unused_0[7];
24494 } __attribute__((packed));
24495 
24496 /* hwrm_nvm_get_variable */
24497 /* Input (40 bytes) */
24498 
24499 struct hwrm_nvm_get_variable_input {
24500 	uint16_t req_type;
24501 	/*
24502 	 * This value indicates what type of request this is. The format for the
24503 	 * rest of the command is determined by this field.
24504 	 */
24505 	uint16_t cmpl_ring;
24506 	/*
24507 	 * This value indicates the what completion ring the request will be
24508 	 * optionally completed on. If the value is -1, then no CR completion
24509 	 * will be generated. Any other value must be a valid CR ring_id value
24510 	 * for this function.
24511 	 */
24512 	uint16_t seq_id;
24513 	/* This value indicates the command sequence number. */
24514 	uint16_t target_id;
24515 	/*
24516 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24517 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24518 	 */
24519 	uint64_t resp_addr;
24520 	/*
24521 	 * This is the host address where the response will be written when the
24522 	 * request is complete. This area must be 16B aligned and must be
24523 	 * cleared to zero before the request is made.
24524 	 */
24525 	uint64_t dest_data_addr;
24526 	/* This is the host address where nvm variable will be stored */
24527 	uint16_t data_len;
24528 	/* size of data in bits */
24529 	uint16_t option_num;
24530 	/* nvm cfg option number */
24531 	/* reserved. */
24532 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
24533 	/* reserved. */
24534 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF  UINT32_C(0xffff)
24535 	uint16_t dimensions;
24536 	/*
24537 	 * Number of dimensions for this nvm configuration variable. This value
24538 	 * indicates how many of the indexN values to use. A value of 0 means
24539 	 * that none of the indexN values are valid. A value of 1 requires at
24540 	 * index0 is valued, a value of 2 requires that index0 and index1 are
24541 	 * valid, and so forth
24542 	 */
24543 	uint16_t index_0;
24544 	/* index for the 1st dimensions */
24545 	uint16_t index_1;
24546 	/* index for the 2nd dimensions */
24547 	uint16_t index_2;
24548 	/* index for the 3rd dimensions */
24549 	uint16_t index_3;
24550 	/* index for the 4th dimensions */
24551 	uint8_t flags;
24552 	/*
24553 	 * When this bit is set to 1, the factory default value will be
24554 	 * returned, 0 returns the operational value.
24555 	 */
24556 	#define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT	UINT32_C(0x1)
24557 	uint8_t unused_0;
24558 } __attribute__((packed));
24559 
24560 /* Output (16 bytes) */
24561 
24562 struct hwrm_nvm_get_variable_output {
24563 	uint16_t error_code;
24564 	/*
24565 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24566 	 * and fail the call with an error when appropriate
24567 	 */
24568 	uint16_t req_type;
24569 	/* This field returns the type of original request. */
24570 	uint16_t seq_id;
24571 	/* This field provides original sequence number of the command. */
24572 	uint16_t resp_len;
24573 	/*
24574 	 * This field is the length of the response in bytes. The last byte of
24575 	 * the response is a valid flag that will read as '1' when the command
24576 	 * has been completely written to memory.
24577 	 */
24578 	uint16_t data_len;
24579 	/* size of data of the actual variable retrieved in bits */
24580 	uint16_t option_num;
24581 	/*
24582 	 * option_num is the option number for the data retrieved. It is
24583 	 * possible in the future that the option number returned would be
24584 	 * different than requested. This condition could occur if an option is
24585 	 * deprecated and a new option id is defined with similar
24586 	 * characteristics, but has a slightly different definition. This also
24587 	 * makes it convenient for the caller to identify the variable result
24588 	 * with the option id from the response.
24589 	 */
24590 	/* reserved. */
24591 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
24592 	/* reserved. */
24593 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
24594 	uint8_t unused_0;
24595 	uint8_t unused_1;
24596 	uint8_t unused_2;
24597 	uint8_t valid;
24598 	/*
24599 	 * This field is used in Output records to indicate that the output is
24600 	 * completely written to RAM. This field should be read as '1' to
24601 	 * indicate that the output has been completely written. When writing a
24602 	 * command completion or response to an internal processor, the order of
24603 	 * writes has to be such that this field is written last.
24604 	 */
24605 } __attribute__((packed));
24606 
24607 /* Command specific Error Codes (8 bytes) */
24608 
24609 struct hwrm_nvm_get_variable_cmd_err {
24610 	uint8_t code;
24611 	/*
24612 	 * command specific error codes that goes to the cmd_err field in Common
24613 	 * HWRM Error Response.
24614 	 */
24615 	/* Unknown error */
24616 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
24617 	/* variable does not exist */
24618 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST  UINT32_C(0x1)
24619 	/* configuration is corrupted and the variable cannot be saved */
24620 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR	UINT32_C(0x2)
24621 	/* length specified is too small */
24622 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT  UINT32_C(0x3)
24623 	uint8_t unused_0[7];
24624 } __attribute__((packed));
24625 
24626 /* hwrm_nvm_set_variable */
24627 /* Input (40 bytes) */
24628 
24629 struct hwrm_nvm_set_variable_input {
24630 	uint16_t req_type;
24631 	/*
24632 	 * This value indicates what type of request this is. The format for the
24633 	 * rest of the command is determined by this field.
24634 	 */
24635 	uint16_t cmpl_ring;
24636 	/*
24637 	 * This value indicates the what completion ring the request will be
24638 	 * optionally completed on. If the value is -1, then no CR completion
24639 	 * will be generated. Any other value must be a valid CR ring_id value
24640 	 * for this function.
24641 	 */
24642 	uint16_t seq_id;
24643 	/* This value indicates the command sequence number. */
24644 	uint16_t target_id;
24645 	/*
24646 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24647 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24648 	 */
24649 	uint64_t resp_addr;
24650 	/*
24651 	 * This is the host address where the response will be written when the
24652 	 * request is complete. This area must be 16B aligned and must be
24653 	 * cleared to zero before the request is made.
24654 	 */
24655 	uint64_t src_data_addr;
24656 	/* This is the host address where nvm variable will be copied from */
24657 	uint16_t data_len;
24658 	/* size of data in bits */
24659 	uint16_t option_num;
24660 	/* nvm cfg option number */
24661 	/* reserved. */
24662 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
24663 	/* reserved. */
24664 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF  UINT32_C(0xffff)
24665 	uint16_t dimensions;
24666 	/*
24667 	 * Number of dimensions for this nvm configuration variable. This value
24668 	 * indicates how many of the indexN values to use. A value of 0 means
24669 	 * that none of the indexN values are valid. A value of 1 requires at
24670 	 * index0 is valued, a value of 2 requires that index0 and index1 are
24671 	 * valid, and so forth
24672 	 */
24673 	uint16_t index_0;
24674 	/* index for the 1st dimensions */
24675 	uint16_t index_1;
24676 	/* index for the 2nd dimensions */
24677 	uint16_t index_2;
24678 	/* index for the 3rd dimensions */
24679 	uint16_t index_3;
24680 	/* index for the 4th dimensions */
24681 	uint8_t flags;
24682 	/*
24683 	 * When this bit is 1, flush internal cache after this write operation
24684 	 * (see hwrm_nvm_flush command.)
24685 	 */
24686 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH	UINT32_C(0x1)
24687 	/* encryption method */
24688 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK UINT32_C(0xe)
24689 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT 1
24690 	/* No encryption. */
24691 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE (UINT32_C(0x0) << 1)
24692 	/* one-way encryption. */
24693 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 (UINT32_C(0x1) << 1)
24694 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST	HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1
24695 	uint8_t unused_0;
24696 } __attribute__((packed));
24697 
24698 /* Output (16 bytes) */
24699 
24700 struct hwrm_nvm_set_variable_output {
24701 	uint16_t error_code;
24702 	/*
24703 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24704 	 * and fail the call with an error when appropriate
24705 	 */
24706 	uint16_t req_type;
24707 	/* This field returns the type of original request. */
24708 	uint16_t seq_id;
24709 	/* This field provides original sequence number of the command. */
24710 	uint16_t resp_len;
24711 	/*
24712 	 * This field is the length of the response in bytes. The last byte of
24713 	 * the response is a valid flag that will read as '1' when the command
24714 	 * has been completely written to memory.
24715 	 */
24716 	uint32_t unused_0;
24717 	uint8_t unused_1;
24718 	uint8_t unused_2;
24719 	uint8_t unused_3;
24720 	uint8_t valid;
24721 	/*
24722 	 * This field is used in Output records to indicate that the output is
24723 	 * completely written to RAM. This field should be read as '1' to
24724 	 * indicate that the output has been completely written. When writing a
24725 	 * command completion or response to an internal processor, the order of
24726 	 * writes has to be such that this field is written last.
24727 	 */
24728 } __attribute__((packed));
24729 
24730 /* Command specific Error Codes (8 bytes) */
24731 
24732 struct hwrm_nvm_set_variable_cmd_err {
24733 	uint8_t code;
24734 	/*
24735 	 * command specific error codes that goes to the cmd_err field in Common
24736 	 * HWRM Error Response.
24737 	 */
24738 	/* Unknown error */
24739 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
24740 	/* variable does not exist */
24741 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST  UINT32_C(0x1)
24742 	/* configuration is corrupted and the variable cannot be saved */
24743 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR	UINT32_C(0x2)
24744 	uint8_t unused_0[7];
24745 } __attribute__((packed));
24746 
24747 /* hwrm_nvm_validate_option */
24748 /* Input (40 bytes) */
24749 
24750 struct hwrm_nvm_validate_option_input {
24751 	uint16_t req_type;
24752 	/*
24753 	 * This value indicates what type of request this is. The format for the
24754 	 * rest of the command is determined by this field.
24755 	 */
24756 	uint16_t cmpl_ring;
24757 	/*
24758 	 * This value indicates the what completion ring the request will be
24759 	 * optionally completed on. If the value is -1, then no CR completion
24760 	 * will be generated. Any other value must be a valid CR ring_id value
24761 	 * for this function.
24762 	 */
24763 	uint16_t seq_id;
24764 	/* This value indicates the command sequence number. */
24765 	uint16_t target_id;
24766 	/*
24767 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
24768 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
24769 	 */
24770 	uint64_t resp_addr;
24771 	/*
24772 	 * This is the host address where the response will be written when the
24773 	 * request is complete. This area must be 16B aligned and must be
24774 	 * cleared to zero before the request is made.
24775 	 */
24776 	uint64_t src_data_addr;
24777 	/* This is the host address where nvm variable will be copied from */
24778 	uint16_t data_len;
24779 	/* size of data in bits */
24780 	uint16_t option_num;
24781 	/* nvm cfg option number */
24782 	/* reserved. */
24783 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0  UINT32_C(0x0)
24784 	/* reserved. */
24785 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
24786 	uint16_t dimensions;
24787 	/*
24788 	 * Number of dimensions for this nvm configuration variable. This value
24789 	 * indicates how many of the indexN values to use. A value of 0 means
24790 	 * that none of the indexN values are valid. A value of 1 requires at
24791 	 * index0 is valued, a value of 2 requires that index0 and index1 are
24792 	 * valid, and so forth
24793 	 */
24794 	uint16_t index_0;
24795 	/* index for the 1st dimensions */
24796 	uint16_t index_1;
24797 	/* index for the 2nd dimensions */
24798 	uint16_t index_2;
24799 	/* index for the 3rd dimensions */
24800 	uint16_t index_3;
24801 	/* index for the 4th dimensions */
24802 	uint16_t unused_0;
24803 } __attribute__((packed));
24804 
24805 /* Output (16 bytes) */
24806 
24807 struct hwrm_nvm_validate_option_output {
24808 	uint16_t error_code;
24809 	/*
24810 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
24811 	 * and fail the call with an error when appropriate
24812 	 */
24813 	uint16_t req_type;
24814 	/* This field returns the type of original request. */
24815 	uint16_t seq_id;
24816 	/* This field provides original sequence number of the command. */
24817 	uint16_t resp_len;
24818 	/*
24819 	 * This field is the length of the response in bytes. The last byte of
24820 	 * the response is a valid flag that will read as '1' when the command
24821 	 * has been completely written to memory.
24822 	 */
24823 	uint8_t result;
24824 	/*
24825 	 * indicates that the value provided for the option is not
24826 	 * matching with the saved data.
24827 	 */
24828 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH  UINT32_C(0x0)
24829 	/*
24830 	 * indicates that the value provided for the option is matching
24831 	 * the saved data.
24832 	 */
24833 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH	UINT32_C(0x1)
24834 	uint8_t unused_0;
24835 	uint16_t unused_1;
24836 	uint8_t unused_2;
24837 	uint8_t unused_3;
24838 	uint8_t unused_4;
24839 	uint8_t valid;
24840 	/*
24841 	 * This field is used in Output records to indicate that the output is
24842 	 * completely written to RAM. This field should be read as '1' to
24843 	 * indicate that the output has been completely written. When writing a
24844 	 * command completion or response to an internal processor, the order of
24845 	 * writes has to be such that this field is written last.
24846 	 */
24847 } __attribute__((packed));
24848 
24849 /* Command specific Error Codes (8 bytes) */
24850 
24851 struct hwrm_nvm_validate_option_cmd_err {
24852 	uint8_t code;
24853 	/*
24854 	 * command specific error codes that goes to the cmd_err field in Common
24855 	 * HWRM Error Response.
24856 	 */
24857 	/* Unknown error */
24858 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
24859 	uint8_t unused_0[7];
24860 } __attribute__((packed));
24861 
24862 /* Command Queue (CMDQ) Interface */
24863 /* Description: This command queries congestion control settings. */
24864 /* Init CMDQ (16 bytes) */
24865 
24866 struct cmdq_init {
24867 	uint64_t cmdq_pbl;
24868 	/* CMDQ PBL physical address. */
24869 	uint16_t cmdq_size_cmdq_lvl;
24870 	/* CMDQ size. */
24871 	/* CMDQ PBL indirection levels. */
24872 	#define CMDQ_INIT_CMDQ_LVL_MASK				UINT32_C(0x3)
24873 	#define CMDQ_INIT_CMDQ_LVL_SFT				0
24874 	/* CMDQ size. */
24875 	#define CMDQ_INIT_CMDQ_SIZE_MASK			UINT32_C(0xfffc)
24876 	#define CMDQ_INIT_CMDQ_SIZE_SFT				2
24877 	uint16_t creq_ring_id;
24878 	/* CREQ completion ring id. */
24879 	uint32_t prod_idx;
24880 	/* Mailbox producer index. MSB must also be set. */
24881 } __attribute__((packed));
24882 
24883 /* Update CMDQ producer index (16 bytes) */
24884 
24885 struct cmdq_update {
24886 	uint64_t reserved64;
24887 	/* reserved64 is 64 b */
24888 	uint32_t reserved32;
24889 	/* reserved32 is 32 b */
24890 	uint32_t prod_idx;
24891 	/* Mailbox producer index. */
24892 } __attribute__((packed));
24893 
24894 /* CMDQ common header structure (16 bytes) */
24895 
24896 struct cmdq_base {
24897 	uint8_t opcode;
24898 	/* Command opcode. */
24899 	/*
24900 	 * Create QP command allocates QP context with the specified SQ,
24901 	 * RQ/SRQ, CQ and other parameters.
24902 	 */
24903 	#define CMDQ_BASE_OPCODE_CREATE_QP			UINT32_C(0x1)
24904 	/*
24905 	 * Destroy QP command deletes the QP context and ceases any
24906 	 * further reference.
24907 	 */
24908 	#define CMDQ_BASE_OPCODE_DESTROY_QP			UINT32_C(0x2)
24909 	/*
24910 	 * Modify QP command changes QP states and other QP specific
24911 	 * parameters.
24912 	 */
24913 	#define CMDQ_BASE_OPCODE_MODIFY_QP			UINT32_C(0x3)
24914 	/* Query QP command retrieves info about the specified QP. */
24915 	#define CMDQ_BASE_OPCODE_QUERY_QP			UINT32_C(0x4)
24916 	/* Create SRQ command allocates a SRQ with the specified parameters. */
24917 	#define CMDQ_BASE_OPCODE_CREATE_SRQ			UINT32_C(0x5)
24918 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
24919 	#define CMDQ_BASE_OPCODE_DESTROY_SRQ			UINT32_C(0x6)
24920 	/* Query SRP command retrieves info about the specified SRQ. */
24921 	#define CMDQ_BASE_OPCODE_QUERY_SRQ			UINT32_C(0x8)
24922 	/* Create CQ command allocates a CQ with the specified parameters. */
24923 	#define CMDQ_BASE_OPCODE_CREATE_CQ			UINT32_C(0x9)
24924 	/* Destroy CQ command deletes and flushes the specified CQ. */
24925 	#define CMDQ_BASE_OPCODE_DESTROY_CQ			UINT32_C(0xa)
24926 	/* Resize CQ command resizes the specified CQ. */
24927 	#define CMDQ_BASE_OPCODE_RESIZE_CQ			UINT32_C(0xc)
24928 	/*
24929 	 * Allocate MRW command allocates a MR/MW with the specified
24930 	 * parameters and returns the region's L_KEY/R_KEY
24931 	 */
24932 	#define CMDQ_BASE_OPCODE_ALLOCATE_MRW			UINT32_C(0xd)
24933 	/*
24934 	 * De-allocate key command frees a MR/MW entry associated with
24935 	 * the specified key.
24936 	 */
24937 	#define CMDQ_BASE_OPCODE_DEALLOCATE_KEY		UINT32_C(0xe)
24938 	/* Register MR command registers memory to the specified MR. */
24939 	#define CMDQ_BASE_OPCODE_REGISTER_MR			UINT32_C(0xf)
24940 	/* Deregister MR command de-registers memory from the specified MR. */
24941 	#define CMDQ_BASE_OPCODE_DEREGISTER_MR			UINT32_C(0x10)
24942 	/* Add GID command adds a GID to the local address table. */
24943 	#define CMDQ_BASE_OPCODE_ADD_GID			UINT32_C(0x11)
24944 	/* Delete GID command deletes a GID from the local address table. */
24945 	#define CMDQ_BASE_OPCODE_DELETE_GID			UINT32_C(0x12)
24946 	/* Modify GID command modifies a GID in the local address table. */
24947 	#define CMDQ_BASE_OPCODE_MODIFY_GID			UINT32_C(0x17)
24948 	/* Query GID command queries a GID in the local address table. */
24949 	#define CMDQ_BASE_OPCODE_QUERY_GID			UINT32_C(0x18)
24950 	/* Create QP1 command allocates a QP1 only. */
24951 	#define CMDQ_BASE_OPCODE_CREATE_QP1			UINT32_C(0x13)
24952 	/* Destroy QP1 command deletes and flushes the specified QP1. */
24953 	#define CMDQ_BASE_OPCODE_DESTROY_QP1			UINT32_C(0x14)
24954 	/* Create AH command allocates an AH with the specified parameters. */
24955 	#define CMDQ_BASE_OPCODE_CREATE_AH			UINT32_C(0x15)
24956 	/* Destroy AH command deletes the specified AH. */
24957 	#define CMDQ_BASE_OPCODE_DESTROY_AH			UINT32_C(0x16)
24958 	/*
24959 	 * Initialize firmware command initializes the firmware with the
24960 	 * specified parameters.
24961 	 */
24962 	#define CMDQ_BASE_OPCODE_INITIALIZE_FW			UINT32_C(0x80)
24963 	/* De-initialize firmware command deinitializes the firmware. */
24964 	#define CMDQ_BASE_OPCODE_DEINITIALIZE_FW		UINT32_C(0x81)
24965 	/* Stop the function */
24966 	#define CMDQ_BASE_OPCODE_STOP_FUNC			UINT32_C(0x82)
24967 	/* Query the HW capabilities for the function. */
24968 	#define CMDQ_BASE_OPCODE_QUERY_FUNC			UINT32_C(0x83)
24969 	/*
24970 	 * Set the following resources for the function: - Max QP, CQ,
24971 	 * MR+MW, SRQ per PF - Max QP, CQ, MR+MW, SRQ per VF
24972 	 */
24973 	#define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES		UINT32_C(0x84)
24974 	/*
24975 	 * Read the current state of any internal resource context. Can
24976 	 * only be issued from a PF.
24977 	 */
24978 	#define CMDQ_BASE_OPCODE_READ_CONTEXT			UINT32_C(0x85)
24979 	/*
24980 	 * Send a request from VF to pass a command to the PF. VF HSI is
24981 	 * suspended until the PF returns the response
24982 	 */
24983 	#define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST	UINT32_C(0x86)
24984 	/*
24985 	 * Read VF memory (primarily to get the backchannel request
24986 	 * blob). Can only be issued from a PF.
24987 	 */
24988 	#define CMDQ_BASE_OPCODE_READ_VF_MEMORY		UINT32_C(0x87)
24989 	/*
24990 	 * Write VF memory (primarily to put the backchannel response
24991 	 * blob), and reenable VF HSI (post a CAG completion to it). Can
24992 	 * only be issued from a PF.
24993 	 */
24994 	#define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST		UINT32_C(0x88)
24995 	/*
24996 	 * Extend resource (QPC, MRW, CQ, SRQ) array, after the host
24997 	 * allocates more. Can only be issued from a PF.
24998 	 */
24999 	#define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY		UINT32_C(0x89)
25000 	/* Map TC to COS. Can only be issued from a PF. */
25001 	#define CMDQ_BASE_OPCODE_MAP_TC_TO_COS			UINT32_C(0x8a)
25002 	/* Query version. */
25003 	#define CMDQ_BASE_OPCODE_QUERY_VERSION			UINT32_C(0x8b)
25004 	/* Modify congestion control. Can only be issued from a PF. */
25005 	#define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC		UINT32_C(0x8c)
25006 	/* Query congestion control. */
25007 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_CC			UINT32_C(0x8d)
25008 	uint8_t cmd_size;
25009 	/* Size of the command in 16-byte units. */
25010 	uint16_t flags;
25011 	/* Flags and attribs of the command. */
25012 	uint16_t cookie;
25013 	/* Driver supplied handle to associate the command and the response. */
25014 	uint8_t resp_size;
25015 	/* Size of the response buffer in 16-byte units. */
25016 	uint8_t reserved8;
25017 	uint64_t resp_addr;
25018 	/* Host address of the response. */
25019 } __attribute__((packed));
25020 
25021 /* Create QP command (96 bytes) */
25022 
25023 struct cmdq_create_qp {
25024 	uint8_t opcode;
25025 	/* Command opcode. */
25026 	/*
25027 	 * Create QP command allocates QP context with the specified SQ,
25028 	 * RQ/SRQ, CQ and other parameters.
25029 	 */
25030 	#define CMDQ_CREATE_QP_OPCODE_CREATE_QP		UINT32_C(0x1)
25031 	uint8_t cmd_size;
25032 	/* Size of the command in 16-byte units. */
25033 	uint16_t flags;
25034 	/* Flags and attribs of the command. */
25035 	uint16_t cookie;
25036 	/* Driver supplied handle to associate the command and the response. */
25037 	uint8_t resp_size;
25038 	/* Size of the response buffer in 16-byte units. */
25039 	uint8_t reserved8;
25040 	uint64_t resp_addr;
25041 	/* Host address of the response. */
25042 	uint64_t qp_handle;
25043 	/* QP handle. */
25044 	uint32_t qp_flags;
25045 	/* Create QP flags. */
25046 	/* SRQ is used. */
25047 	#define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
25048 	/* post CQE for all SQ WQEs. */
25049 	#define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
25050 	/* This QP can use reserved L_Key */
25051 	#define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE	UINT32_C(0x4)
25052 	/* This QP can fast register physical memory */
25053 	#define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED		UINT32_C(0x8)
25054 	uint8_t type;
25055 	/* Supported QP types. */
25056 	/* Reliable Connection. */
25057 	#define CMDQ_CREATE_QP_TYPE_RC				UINT32_C(0x2)
25058 	/* Unreliable Datagram. */
25059 	#define CMDQ_CREATE_QP_TYPE_UD				UINT32_C(0x4)
25060 	/* Raw Ethertype. */
25061 	#define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE		UINT32_C(0x6)
25062 	uint8_t sq_pg_size_sq_lvl;
25063 	/* SQ page size. */
25064 	/* SQ PBL indirect levels. */
25065 	#define CMDQ_CREATE_QP_SQ_LVL_MASK			UINT32_C(0xf)
25066 	#define CMDQ_CREATE_QP_SQ_LVL_SFT			0
25067 	/* PBL pointer is physical start address. */
25068 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_0			UINT32_C(0x0)
25069 	/* PBL pointer points to PTE table. */
25070 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_1			UINT32_C(0x1)
25071 	/*
25072 	 * PBL pointer points to PDE table with each entry pointing to
25073 	 * PTE tables.
25074 	 */
25075 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_2			UINT32_C(0x2)
25076 	/* SQ page size. */
25077 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK			UINT32_C(0xf0)
25078 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT			4
25079 	/* 4KB. */
25080 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
25081 	/* 8KB. */
25082 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
25083 	/* 64KB. */
25084 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
25085 	/* 2MB. */
25086 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
25087 	/* 8MB. */
25088 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
25089 	/* 1GB. */
25090 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
25091 	uint8_t rq_pg_size_rq_lvl;
25092 	/* RQ page size. */
25093 	/* RQ PBL indirect levels. */
25094 	#define CMDQ_CREATE_QP_RQ_LVL_MASK			UINT32_C(0xf)
25095 	#define CMDQ_CREATE_QP_RQ_LVL_SFT			0
25096 	/* PBL pointer is physical start address. */
25097 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_0			UINT32_C(0x0)
25098 	/* PBL pointer points to PTE table. */
25099 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_1			UINT32_C(0x1)
25100 	/*
25101 	 * PBL pointer points to PDE table with each entry pointing to
25102 	 * PTE tables.
25103 	 */
25104 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_2			UINT32_C(0x2)
25105 	/* RQ page size. */
25106 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK			UINT32_C(0xf0)
25107 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT			4
25108 	/* 4KB. */
25109 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
25110 	/* 8KB. */
25111 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
25112 	/* 64KB. */
25113 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
25114 	/* 2MB. */
25115 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
25116 	/* 8MB. */
25117 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
25118 	/* 1GB. */
25119 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
25120 	uint8_t unused_0;
25121 	uint32_t dpi;
25122 	/* Doorbell page index. */
25123 	uint32_t sq_size;
25124 	/* Max number of SQ wqes. */
25125 	uint32_t rq_size;
25126 	/* Max number of RQ wqes. */
25127 	uint16_t sq_fwo_sq_sge;
25128 	/* Offset of First WQE in the first SQ page, in 128 byte units */
25129 	/* Max send SGEs per SWQE. */
25130 	#define CMDQ_CREATE_QP_SQ_SGE_MASK			UINT32_C(0xf)
25131 	#define CMDQ_CREATE_QP_SQ_SGE_SFT			0
25132 	/* Offset of First WQE in the first SQ page, in 128 byte units */
25133 	#define CMDQ_CREATE_QP_SQ_FWO_MASK			UINT32_C(0xfff0)
25134 	#define CMDQ_CREATE_QP_SQ_FWO_SFT			4
25135 	uint16_t rq_fwo_rq_sge;
25136 	/* Offset of First WQE in the first RQ page, in 128 byte units */
25137 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
25138 	#define CMDQ_CREATE_QP_RQ_SGE_MASK			UINT32_C(0xf)
25139 	#define CMDQ_CREATE_QP_RQ_SGE_SFT			0
25140 	/* Offset of First WQE in the first RQ page, in 128 byte units */
25141 	#define CMDQ_CREATE_QP_RQ_FWO_MASK			UINT32_C(0xfff0)
25142 	#define CMDQ_CREATE_QP_RQ_FWO_SFT			4
25143 	uint32_t scq_cid;
25144 	/* Send CQ context id. */
25145 	uint32_t rcq_cid;
25146 	/* Receive CQ context id. */
25147 	uint32_t srq_cid;
25148 	/* SRQ CQ context id. */
25149 	uint32_t pd_id;
25150 	/* Protection domain id. */
25151 	uint64_t sq_pbl;
25152 	/* SQ PBL physical address. */
25153 	uint64_t rq_pbl;
25154 	/* RQ PBL physical address. */
25155 	uint64_t irrq_addr;
25156 	/* IRRQ address. */
25157 	uint64_t orrq_addr;
25158 	/* ORRQ address. */
25159 } __attribute__((packed));
25160 
25161 /* Destroy QP command (24 bytes) */
25162 
25163 struct cmdq_destroy_qp {
25164 	uint8_t opcode;
25165 	/* Command opcode. */
25166 	/*
25167 	 * Destroy QP command deletes the QP context and ceases any
25168 	 * further reference.
25169 	 */
25170 	#define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP		UINT32_C(0x2)
25171 	uint8_t cmd_size;
25172 	/* Size of the command in 16-byte units. */
25173 	uint16_t flags;
25174 	/* Flags and attribs of the command. */
25175 	uint16_t cookie;
25176 	/* Driver supplied handle to associate the command and the response. */
25177 	uint8_t resp_size;
25178 	/* Size of the response buffer in 16-byte units. */
25179 	uint8_t reserved8;
25180 	uint64_t resp_addr;
25181 	/* Host address of the response. */
25182 	uint32_t qp_cid;
25183 	/* QP context id */
25184 	uint32_t unused_0;
25185 } __attribute__((packed));
25186 
25187 /* Modify QP command (112 bytes) */
25188 
25189 struct cmdq_modify_qp {
25190 	uint8_t opcode;
25191 	/* Command opcode. */
25192 	/*
25193 	 * Modify QP command changes QP states and other QP specific
25194 	 * parameters.
25195 	 */
25196 	#define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP		UINT32_C(0x3)
25197 	uint8_t cmd_size;
25198 	/* Size of the command in 16-byte units. */
25199 	uint16_t flags;
25200 	/* Flags and attribs of the command. */
25201 	uint16_t cookie;
25202 	/* Driver supplied handle to associate the command and the response. */
25203 	uint8_t resp_size;
25204 	/* Size of the response buffer in 16-byte units. */
25205 	uint8_t reserved8;
25206 	uint64_t resp_addr;
25207 	/* Host address of the response. */
25208 	uint32_t modify_mask;
25209 	/* Modify mask signifies the field that is requesting the change. */
25210 	/* QP state change. */
25211 	#define CMDQ_MODIFY_QP_MODIFY_MASK_STATE		UINT32_C(0x1)
25212 	/* Enable SQ drain asynchronous notification change. */
25213 	#define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x2)
25214 	/* Access change. */
25215 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS		UINT32_C(0x4)
25216 	/* P_KEY change. */
25217 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY			UINT32_C(0x8)
25218 	/* Q_KEY index change. */
25219 	#define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY			UINT32_C(0x10)
25220 	/* Destination GID change. */
25221 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DGID			UINT32_C(0x20)
25222 	/* Flow label change. */
25223 	#define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL		UINT32_C(0x40)
25224 	/* SGID change. */
25225 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX		UINT32_C(0x80)
25226 	/* Hop limit change. */
25227 	#define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT		UINT32_C(0x100)
25228 	/* Traffic class change. */
25229 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS	UINT32_C(0x200)
25230 	/* destination MAC change. */
25231 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC		UINT32_C(0x400)
25232 	/* unused is 1 b */
25233 	#define CMDQ_MODIFY_QP_MODIFY_MASK_UNUSED		UINT32_C(0x800)
25234 	/* Path MTU change. */
25235 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU		UINT32_C(0x1000)
25236 	/* Timeout change. */
25237 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT		UINT32_C(0x2000)
25238 	/* Retry count change. */
25239 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT		UINT32_C(0x4000)
25240 	/* RNR Retry change. */
25241 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY		UINT32_C(0x8000)
25242 	/* RQ start packet sequence number change. */
25243 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN		UINT32_C(0x10000)
25244 	/* Max outstanding RDMA read atomic change. */
25245 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC	UINT32_C(0x20000)
25246 	/* RNR minimum timer change. */
25247 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER	UINT32_C(0x40000)
25248 	/* SQ start packet sequence number change. */
25249 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN		UINT32_C(0x80000)
25250 	/* Max destination outstanding RDMA read atomic change. */
25251 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC	UINT32_C(0x100000)
25252 	/* Max send WQE change. */
25253 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE		UINT32_C(0x200000)
25254 	/* Max recv WQE change. */
25255 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE		UINT32_C(0x400000)
25256 	/* Max recv SGEs per SWQE change. */
25257 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE		UINT32_C(0x800000)
25258 	/* Max send SGEs per RWQE change. */
25259 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE		UINT32_C(0x1000000)
25260 	/* Max inline data length change. */
25261 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA	UINT32_C(0x2000000)
25262 	/* Destination QP id change. */
25263 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID		UINT32_C(0x4000000)
25264 	/* Source MAC change. */
25265 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC		UINT32_C(0x8000000)
25266 	/* Source VLAN id change. */
25267 	#define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID		UINT32_C(0x10000000)
25268 	/* Congestion control RoCE v2 change. */
25269 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC		UINT32_C(0x20000000)
25270 	/* IP TOS ECN change */
25271 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN		UINT32_C(0x40000000)
25272 	/* IP TOS DSCP change */
25273 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP		UINT32_C(0x80000000)
25274 	uint32_t qp_cid;
25275 	/* QP context id. */
25276 	uint8_t network_type_en_sqd_async_notify_new_state;
25277 	/* network type. */
25278 	/* New QP state. */
25279 	#define CMDQ_MODIFY_QP_NEW_STATE_MASK			UINT32_C(0xf)
25280 	#define CMDQ_MODIFY_QP_NEW_STATE_SFT			0
25281 	/* Reset. */
25282 	#define CMDQ_MODIFY_QP_NEW_STATE_RESET			UINT32_C(0x0)
25283 	/* Init. */
25284 	#define CMDQ_MODIFY_QP_NEW_STATE_INIT			UINT32_C(0x1)
25285 	/* Ready To Receive. */
25286 	#define CMDQ_MODIFY_QP_NEW_STATE_RTR			UINT32_C(0x2)
25287 	/* Ready To Send. */
25288 	#define CMDQ_MODIFY_QP_NEW_STATE_RTS			UINT32_C(0x3)
25289 	/* SQ Drain. */
25290 	#define CMDQ_MODIFY_QP_NEW_STATE_SQD			UINT32_C(0x4)
25291 	/* SQ Error. */
25292 	#define CMDQ_MODIFY_QP_NEW_STATE_SQE			UINT32_C(0x5)
25293 	/* Error. */
25294 	#define CMDQ_MODIFY_QP_NEW_STATE_ERR			UINT32_C(0x6)
25295 	/* Enable SQ drain asynchronous notification. */
25296 	#define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY		UINT32_C(0x10)
25297 	/* unused1 is 1 b */
25298 	/* network type. */
25299 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK		UINT32_C(0xc0)
25300 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT			6
25301 	/* RoCEv1. */
25302 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1		(UINT32_C(0x0) << 6)
25303 	/* RoCEv2 IPv4. */
25304 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4	(UINT32_C(0x2) << 6)
25305 	/* RoCEv2 IPv6. */
25306 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6	(UINT32_C(0x3) << 6)
25307 	uint8_t access;
25308 	/* Access flags. */
25309 	/* Local write access. */
25310 	#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE		UINT32_C(0x1)
25311 	/* Remote write access. */
25312 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE		UINT32_C(0x2)
25313 	/* Remote read access. */
25314 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ		UINT32_C(0x4)
25315 	/* Remote atomic access. */
25316 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC		UINT32_C(0x8)
25317 	uint16_t pkey;
25318 	/* P_KEY. */
25319 	uint32_t qkey;
25320 	/* Q_KEY. */
25321 	uint32_t dgid[4];
25322 	/* Destination GID. */
25323 	uint32_t flow_label;
25324 	/* Flow label. */
25325 	uint16_t sgid_index;
25326 	/* Source GID index. */
25327 	uint8_t hop_limit;
25328 	/* Hop limit. */
25329 	uint8_t traffic_class;
25330 	/* Traffic class. */
25331 	uint16_t dest_mac[3];
25332 	/* Destination MAC address. */
25333 	uint8_t tos_dscp_tos_ecn;
25334 	/* IP TOS DSCP. */
25335 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
25336 	#define CMDQ_MODIFY_QP_TOS_ECN_MASK			UINT32_C(0x3)
25337 	#define CMDQ_MODIFY_QP_TOS_ECN_SFT			0
25338 	/* IP TOS DSCP. */
25339 	#define CMDQ_MODIFY_QP_TOS_DSCP_MASK			UINT32_C(0xfc)
25340 	#define CMDQ_MODIFY_QP_TOS_DSCP_SFT			2
25341 	uint8_t path_mtu;
25342 	/* Path MTU. */
25343 	/* unused4 is 4 b */
25344 	/* Path MTU. */
25345 	#define CMDQ_MODIFY_QP_PATH_MTU_MASK			UINT32_C(0xf0)
25346 	#define CMDQ_MODIFY_QP_PATH_MTU_SFT			4
25347 	/* 256. */
25348 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_256		(UINT32_C(0x0) << 4)
25349 	/* 512. */
25350 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_512		(UINT32_C(0x1) << 4)
25351 	/* 1024. */
25352 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024		(UINT32_C(0x2) << 4)
25353 	/* 2048. */
25354 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048		(UINT32_C(0x3) << 4)
25355 	/* 4096. */
25356 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096		(UINT32_C(0x4) << 4)
25357 	/* 8192. */
25358 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192		(UINT32_C(0x5) << 4)
25359 	uint8_t timeout;
25360 	/* Timeout value for SWQEs. */
25361 	uint8_t retry_cnt;
25362 	/* Max retry count for WQEs. */
25363 	uint8_t rnr_retry;
25364 	/* Max RNR retry count for WQEs. */
25365 	uint8_t min_rnr_timer;
25366 	/* Min RNR timer that the QP will report to the remote. */
25367 	uint32_t rq_psn;
25368 	/* RQ start packet sequence number. */
25369 	uint32_t sq_psn;
25370 	/* SQ start packet sequence number. */
25371 	uint8_t max_rd_atomic;
25372 	/* Max outstanding RDMA read atomic. */
25373 	uint8_t max_dest_rd_atomic;
25374 	/* Max destination outstanding RDMA read atomic. */
25375 	uint16_t enable_cc;
25376 	/* unused15 is 15 b */
25377 	/* Enable congestion control. */
25378 	#define CMDQ_MODIFY_QP_ENABLE_CC			UINT32_C(0x1)
25379 	/* unused15 is 15 b */
25380 	uint32_t sq_size;
25381 	/* Max send WQE. */
25382 	uint32_t rq_size;
25383 	/* Max recv WQE. */
25384 	uint16_t sq_sge;
25385 	/* Max send SGEs per SWQE. */
25386 	uint16_t rq_sge;
25387 	/* Max recv SGEs per RWQE. */
25388 	uint32_t max_inline_data;
25389 	/* Max inline data length (upto 120 bytes). */
25390 	uint32_t dest_qp_id;
25391 	/* Destination QP id. */
25392 	uint32_t unused_3;
25393 	uint16_t src_mac[3];
25394 	/* Source MAC. (Unused. Comes from Source GID index) */
25395 	uint16_t vlan_pcp_vlan_dei_vlan_id;
25396 	/* VLAN PCP field - Priority Code Point. */
25397 	/* VLAN id. (Unused. Comes from Source GID index) */
25398 	#define CMDQ_MODIFY_QP_VLAN_ID_MASK			UINT32_C(0xfff)
25399 	#define CMDQ_MODIFY_QP_VLAN_ID_SFT			0
25400 	/* VLAN DEI field - Drop Eligibility Indicator. */
25401 	#define CMDQ_MODIFY_QP_VLAN_DEI				UINT32_C(0x1000)
25402 	/* VLAN PCP field - Priority Code Point. */
25403 	#define CMDQ_MODIFY_QP_VLAN_PCP_MASK			UINT32_C(0xe000)
25404 	#define CMDQ_MODIFY_QP_VLAN_PCP_SFT			13
25405 } __attribute__((packed));
25406 
25407 /* Query QP command (24 bytes) */
25408 
25409 struct cmdq_query_qp {
25410 	uint8_t opcode;
25411 	/* Command opcode. */
25412 	/* Query QP command retrieves info about the specified QP. */
25413 	#define CMDQ_QUERY_QP_OPCODE_QUERY_QP			UINT32_C(0x4)
25414 	uint8_t cmd_size;
25415 	/* Size of the command in 16-byte units. */
25416 	uint16_t flags;
25417 	/* Flags and attribs of the command. */
25418 	uint16_t cookie;
25419 	/* Driver supplied handle to associate the command and the response. */
25420 	uint8_t resp_size;
25421 	/* Size of the response buffer in 16-byte units. */
25422 	uint8_t reserved8;
25423 	uint64_t resp_addr;
25424 	/* Host address of the response. */
25425 	uint32_t qp_cid;
25426 	/* QP context id */
25427 	uint32_t unused_0;
25428 } __attribute__((packed));
25429 
25430 /* Create SRQ command (48 bytes) */
25431 
25432 struct cmdq_create_srq {
25433 	uint8_t opcode;
25434 	/* Command opcode. */
25435 	/* Create SRQ command allocates a SRQ with the specified parameters. */
25436 	#define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ		UINT32_C(0x5)
25437 	uint8_t cmd_size;
25438 	/* Size of the command in 16-byte units. */
25439 	uint16_t flags;
25440 	/* Flags and attribs of the command. */
25441 	uint16_t cookie;
25442 	/* Driver supplied handle to associate the command and the response. */
25443 	uint8_t resp_size;
25444 	/* Size of the response buffer in 16-byte units. */
25445 	uint8_t reserved8;
25446 	uint64_t resp_addr;
25447 	/* Host address of the response. */
25448 	uint64_t srq_handle;
25449 	/* SRQ handle. */
25450 	uint16_t pg_size_lvl;
25451 	/* unused11 is 11 b */
25452 	/* SRQ PBL indirect levels. */
25453 	#define CMDQ_CREATE_SRQ_LVL_MASK			UINT32_C(0x3)
25454 	#define CMDQ_CREATE_SRQ_LVL_SFT				0
25455 	/* PBL pointer is physical start address. */
25456 	#define CMDQ_CREATE_SRQ_LVL_LVL_0			UINT32_C(0x0)
25457 	/* PBL pointer points to PTE table. */
25458 	#define CMDQ_CREATE_SRQ_LVL_LVL_1			UINT32_C(0x1)
25459 	/*
25460 	 * PBL pointer points to PDE table with each entry pointing to
25461 	 * PTE tables.
25462 	 */
25463 	#define CMDQ_CREATE_SRQ_LVL_LVL_2			UINT32_C(0x2)
25464 	/* page size. */
25465 	#define CMDQ_CREATE_SRQ_PG_SIZE_MASK			UINT32_C(0x1c)
25466 	#define CMDQ_CREATE_SRQ_PG_SIZE_SFT			2
25467 	/* 4KB. */
25468 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K			(UINT32_C(0x0) << 2)
25469 	/* 8KB. */
25470 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K			(UINT32_C(0x1) << 2)
25471 	/* 64KB. */
25472 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K			(UINT32_C(0x2) << 2)
25473 	/* 2MB. */
25474 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M			(UINT32_C(0x3) << 2)
25475 	/* 8MB. */
25476 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M			(UINT32_C(0x4) << 2)
25477 	/* 1GB. */
25478 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G			(UINT32_C(0x5) << 2)
25479 	/* unused11 is 11 b */
25480 	uint16_t eventq_id;
25481 	/* unused4 is 4 b */
25482 	/* eventq_id is 12 b */
25483 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK			UINT32_C(0xfff)
25484 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT			0
25485 	/* unused4 is 4 b */
25486 	uint16_t srq_size;
25487 	/* Max number of SRQ wqes. */
25488 	uint16_t srq_fwo;
25489 	/* Offsetof first WQE in the first page of SRQ, in 128 byte units */
25490 	uint32_t dpi;
25491 	/* Doorbell page index. */
25492 	uint32_t pd_id;
25493 	/* Protection domain id. */
25494 	uint64_t pbl;
25495 	/* RQ PBL physical address. */
25496 } __attribute__((packed));
25497 
25498 /* Destroy SRQ command (24 bytes) */
25499 
25500 struct cmdq_destroy_srq {
25501 	uint8_t opcode;
25502 	/* Command opcode. */
25503 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
25504 	#define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ		UINT32_C(0x6)
25505 	uint8_t cmd_size;
25506 	/* Size of the command in 16-byte units. */
25507 	uint16_t flags;
25508 	/* Flags and attribs of the command. */
25509 	uint16_t cookie;
25510 	/* Driver supplied handle to associate the command and the response. */
25511 	uint8_t resp_size;
25512 	/* Size of the response buffer in 16-byte units. */
25513 	uint8_t reserved8;
25514 	uint64_t resp_addr;
25515 	/* Host address of the response. */
25516 	uint32_t srq_cid;
25517 	/* SRQ context id */
25518 	uint32_t unused_0;
25519 } __attribute__((packed));
25520 
25521 /* Query SRQ command (24 bytes) */
25522 
25523 struct cmdq_query_srq {
25524 	uint8_t opcode;
25525 	/* Command opcode. */
25526 	/* Query SRP command retrieves info about the specified SRQ. */
25527 	#define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ		UINT32_C(0x8)
25528 	uint8_t cmd_size;
25529 	/* Size of the command in 16-byte units. */
25530 	uint16_t flags;
25531 	/* Flags and attribs of the command. */
25532 	uint16_t cookie;
25533 	/* Driver supplied handle to associate the command and the response. */
25534 	uint8_t resp_size;
25535 	/* Size of the response buffer in 16-byte units. */
25536 	uint8_t reserved8;
25537 	uint64_t resp_addr;
25538 	/* Host address of the response. */
25539 	uint32_t srq_cid;
25540 	/* SRQ context id */
25541 	uint32_t unused_0;
25542 } __attribute__((packed));
25543 
25544 /* Create CQ command (48 bytes) */
25545 
25546 struct cmdq_create_cq {
25547 	uint8_t opcode;
25548 	/* Command opcode. */
25549 	/* Create CQ command allocates a CQ with the specified parameters. */
25550 	#define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ		UINT32_C(0x9)
25551 	uint8_t cmd_size;
25552 	/* Size of the command in 16-byte units. */
25553 	uint16_t flags;
25554 	/* Flags and attribs of the command. */
25555 	uint16_t cookie;
25556 	/* Driver supplied handle to associate the command and the response. */
25557 	uint8_t resp_size;
25558 	/* Size of the response buffer in 16-byte units. */
25559 	uint8_t reserved8;
25560 	uint64_t resp_addr;
25561 	/* Host address of the response. */
25562 	uint64_t cq_handle;
25563 	/* CQ handle. */
25564 	uint32_t pg_size_lvl;
25565 	/* unused27 is 27 b */
25566 	/* PBL indirect levels. */
25567 	#define CMDQ_CREATE_CQ_LVL_MASK				UINT32_C(0x3)
25568 	#define CMDQ_CREATE_CQ_LVL_SFT				0
25569 	/* PBL pointer is physical start address. */
25570 	#define CMDQ_CREATE_CQ_LVL_LVL_0			UINT32_C(0x0)
25571 	/* PBL pointer points to PTE table. */
25572 	#define CMDQ_CREATE_CQ_LVL_LVL_1			UINT32_C(0x1)
25573 	/*
25574 	 * PBL pointer points to PDE table with each entry pointing to
25575 	 * PTE tables.
25576 	 */
25577 	#define CMDQ_CREATE_CQ_LVL_LVL_2			UINT32_C(0x2)
25578 	/* page size. */
25579 	#define CMDQ_CREATE_CQ_PG_SIZE_MASK			UINT32_C(0x1c)
25580 	#define CMDQ_CREATE_CQ_PG_SIZE_SFT			2
25581 	/* 4KB. */
25582 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_4K			(UINT32_C(0x0) << 2)
25583 	/* 8KB. */
25584 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_8K			(UINT32_C(0x1) << 2)
25585 	/* 64KB. */
25586 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_64K			(UINT32_C(0x2) << 2)
25587 	/* 2MB. */
25588 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_2M			(UINT32_C(0x3) << 2)
25589 	/* 8MB. */
25590 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_8M			(UINT32_C(0x4) << 2)
25591 	/* 1GB. */
25592 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_1G			(UINT32_C(0x5) << 2)
25593 	/* unused27 is 27 b */
25594 	uint32_t cq_fco_cnq_id;
25595 	/* Offset of first CQE in the first Page, in 32 byte units */
25596 	/* cnq_id is 12 b */
25597 	#define CMDQ_CREATE_CQ_CNQ_ID_MASK			UINT32_C(0xfff)
25598 	#define CMDQ_CREATE_CQ_CNQ_ID_SFT			0
25599 	/* Offset of first CQE in the first Page, in 32 byte units */
25600 	#define CMDQ_CREATE_CQ_CQ_FCO_MASK			UINT32_C(0xfffff000)
25601 	#define CMDQ_CREATE_CQ_CQ_FCO_SFT			12
25602 	uint32_t dpi;
25603 	/* Doorbell page index. */
25604 	uint32_t cq_size;
25605 	/* Max number of CQ wqes. */
25606 	uint64_t pbl;
25607 	/* CQ PBL physical address. */
25608 } __attribute__((packed));
25609 
25610 /* Destroy CQ command (24 bytes) */
25611 
25612 struct cmdq_destroy_cq {
25613 	uint8_t opcode;
25614 	/* Command opcode. */
25615 	/* Destroy CQ command deletes and flushes the specified CQ. */
25616 	#define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ		UINT32_C(0xa)
25617 	uint8_t cmd_size;
25618 	/* Size of the command in 16-byte units. */
25619 	uint16_t flags;
25620 	/* Flags and attribs of the command. */
25621 	uint16_t cookie;
25622 	/* Driver supplied handle to associate the command and the response. */
25623 	uint8_t resp_size;
25624 	/* Size of the response buffer in 16-byte units. */
25625 	uint8_t reserved8;
25626 	uint64_t resp_addr;
25627 	/* Host address of the response. */
25628 	uint32_t cq_cid;
25629 	/* CQ context id */
25630 	uint32_t unused_0;
25631 } __attribute__((packed));
25632 
25633 /* Resize CQ command (40 bytes) */
25634 
25635 struct cmdq_resize_cq {
25636 	uint8_t opcode;
25637 	/* Command opcode. */
25638 	/* Resize CQ command resizes the specified CQ. */
25639 	#define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ		UINT32_C(0xc)
25640 	uint8_t cmd_size;
25641 	/* Size of the command in 16-byte units. */
25642 	uint16_t flags;
25643 	/* Flags and attribs of the command. */
25644 	uint16_t cookie;
25645 	/* Driver supplied handle to associate the command and the response. */
25646 	uint8_t resp_size;
25647 	/* Size of the response buffer in 16-byte units. */
25648 	uint8_t reserved8;
25649 	uint64_t resp_addr;
25650 	/* Host address of the response. */
25651 	uint32_t cq_cid;
25652 	/* CQ context id */
25653 	uint32_t new_cq_size_pg_size_lvl;
25654 	/* PBL indirect levels. */
25655 	#define CMDQ_RESIZE_CQ_LVL_MASK				UINT32_C(0x3)
25656 	#define CMDQ_RESIZE_CQ_LVL_SFT				0
25657 	/* PBL pointer is physical start address. */
25658 	#define CMDQ_RESIZE_CQ_LVL_LVL_0			UINT32_C(0x0)
25659 	/* PBL pointer points to PTE table. */
25660 	#define CMDQ_RESIZE_CQ_LVL_LVL_1			UINT32_C(0x1)
25661 	/*
25662 	 * PBL pointer points to PDE table with each entry pointing to
25663 	 * PTE tables.
25664 	 */
25665 	#define CMDQ_RESIZE_CQ_LVL_LVL_2			UINT32_C(0x2)
25666 	/* page size. */
25667 	#define CMDQ_RESIZE_CQ_PG_SIZE_MASK			UINT32_C(0x1c)
25668 	#define CMDQ_RESIZE_CQ_PG_SIZE_SFT			2
25669 	/* 4KB. */
25670 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K			(UINT32_C(0x0) << 2)
25671 	/* 8KB. */
25672 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K			(UINT32_C(0x1) << 2)
25673 	/* 64KB. */
25674 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K			(UINT32_C(0x2) << 2)
25675 	/* 2MB. */
25676 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M			(UINT32_C(0x3) << 2)
25677 	/* 8MB. */
25678 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M			(UINT32_C(0x4) << 2)
25679 	/* 1GB. */
25680 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G			(UINT32_C(0x5) << 2)
25681 	/* New max number of CQ wqes. */
25682 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK			UINT32_C(0x1fffe0)
25683 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT			5
25684 	uint64_t new_pbl;
25685 	/* CQ PBL physical address. */
25686 	uint32_t new_cq_fco;
25687 	/* Offset of first CQE in the first Page, in 32 byte units */
25688 	uint32_t unused_2;
25689 } __attribute__((packed));
25690 
25691 /* Allocate MRW command (32 bytes) */
25692 
25693 struct cmdq_allocate_mrw {
25694 	uint8_t opcode;
25695 	/* Command opcode. */
25696 	/*
25697 	 * Allocate MRW command allocates a MR/MW with the specified
25698 	 * parameters and returns the region's L_KEY/R_KEY
25699 	 */
25700 	#define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW		UINT32_C(0xd)
25701 	uint8_t cmd_size;
25702 	/* Size of the command in 16-byte units. */
25703 	uint16_t flags;
25704 	/* Flags and attribs of the command. */
25705 	uint16_t cookie;
25706 	/* Driver supplied handle to associate the command and the response. */
25707 	uint8_t resp_size;
25708 	/* Size of the response buffer in 16-byte units. */
25709 	uint8_t reserved8;
25710 	uint64_t resp_addr;
25711 	/* Host address of the response. */
25712 	uint64_t mrw_handle;
25713 	/* MRW handle. */
25714 	uint8_t mrw_flags;
25715 	/* unused4 is 4 b */
25716 	/* Allocate MRW flags. */
25717 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK		UINT32_C(0xf)
25718 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT			0
25719 	/* Allocate Memory Region */
25720 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR			UINT32_C(0x0)
25721 	/* Allocate Physical Memory Region */
25722 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR		UINT32_C(0x1)
25723 	/* Allocate Memory Window (type 1) */
25724 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1		UINT32_C(0x2)
25725 	/* Allocate Memory Window (type 2A) */
25726 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A		UINT32_C(0x3)
25727 	/* Allocate Memory Window (type 2B) */
25728 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B		UINT32_C(0x4)
25729 	/* unused4 is 4 b */
25730 	uint8_t access;
25731 	/* Access flags. */
25732 	#define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_MASK		UINT32_C(0x1f)
25733 	#define CMDQ_ALLOCATE_MRW_ACCESS_RESERVED_SFT		0
25734 	/* Consumer owns the key */
25735 	#define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY	UINT32_C(0x20)
25736 	uint16_t unused_1;
25737 	/* unused16 is 16 b */
25738 	uint32_t pd_id;
25739 	/* Protection domain id. */
25740 } __attribute__((packed));
25741 
25742 /* De-allocate key command (24 bytes) */
25743 
25744 struct cmdq_deallocate_key {
25745 	uint8_t opcode;
25746 	/* Command opcode. */
25747 	/*
25748 	 * De-allocate key command frees a MR/MW entry associated with
25749 	 * the specified key.
25750 	 */
25751 	#define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY	UINT32_C(0xe)
25752 	uint8_t cmd_size;
25753 	/* Size of the command in 16-byte units. */
25754 	uint16_t flags;
25755 	/* Flags and attribs of the command. */
25756 	uint16_t cookie;
25757 	/* Driver supplied handle to associate the command and the response. */
25758 	uint8_t resp_size;
25759 	/* Size of the response buffer in 16-byte units. */
25760 	uint8_t reserved8;
25761 	uint64_t resp_addr;
25762 	/* Host address of the response. */
25763 	uint8_t mrw_flags;
25764 	/* unused4 is 4 b */
25765 	/* Deallocate MRW flags. */
25766 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK		UINT32_C(0xf)
25767 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT		0
25768 	/* Deallocate Memory Region */
25769 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR		UINT32_C(0x0)
25770 	/* Deallocate Physical Memory Region */
25771 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR		UINT32_C(0x1)
25772 	/* Deallocate Memory Window (type 1) */
25773 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1		UINT32_C(0x2)
25774 	/* Deallocate Memory Window (type 2A) */
25775 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A	UINT32_C(0x3)
25776 	/* Deallocate Memory Window (type 2B) */
25777 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B	UINT32_C(0x4)
25778 	/* unused4 is 4 b */
25779 	uint8_t unused_1[3];
25780 	/* unused24 is 24 b */
25781 	uint32_t key;
25782 	/* key is 32 b */
25783 } __attribute__((packed));
25784 
25785 /* Register MR command (48 bytes) */
25786 
25787 struct cmdq_register_mr {
25788 	uint8_t opcode;
25789 	/* Command opcode. */
25790 	/* Register MR command registers memory to the specified MR. */
25791 	#define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR		UINT32_C(0xf)
25792 	uint8_t cmd_size;
25793 	/* Size of the command in 16-byte units. */
25794 	uint16_t flags;
25795 	/* Flags and attribs of the command. */
25796 	uint16_t cookie;
25797 	/* Driver supplied handle to associate the command and the response. */
25798 	uint8_t resp_size;
25799 	/* Size of the response buffer in 16-byte units. */
25800 	uint8_t reserved8;
25801 	uint64_t resp_addr;
25802 	/* Host address of the response. */
25803 	uint8_t log2_pg_size_lvl;
25804 	/* unused1 is 1 b */
25805 	/* PBL indirect levels. */
25806 	#define CMDQ_REGISTER_MR_LVL_MASK			UINT32_C(0x3)
25807 	#define CMDQ_REGISTER_MR_LVL_SFT			0
25808 	/* PBL pointer is physical start address. */
25809 	#define CMDQ_REGISTER_MR_LVL_LVL_0			UINT32_C(0x0)
25810 	/* PBL pointer points to PTE table. */
25811 	#define CMDQ_REGISTER_MR_LVL_LVL_1			UINT32_C(0x1)
25812 	/*
25813 	 * PBL pointer points to PDE table with each entry pointing to
25814 	 * PTE tables.
25815 	 */
25816 	#define CMDQ_REGISTER_MR_LVL_LVL_2			UINT32_C(0x2)
25817 	/*
25818 	 * Log base 2 of page size; 12 is the minimum for 4KB. HW supported
25819 	 * values are enumerated below.
25820 	 */
25821 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK		UINT32_C(0x7c)
25822 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT		2
25823 	/* 4KB. */
25824 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K		(UINT32_C(0xc) << 2)
25825 	/* 8KB. */
25826 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K		(UINT32_C(0xd) << 2)
25827 	/* 64KB. */
25828 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K		(UINT32_C(0x10) << 2)
25829 	/* 256KB. */
25830 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K		(UINT32_C(0x12) << 2)
25831 	/* 1MB. */
25832 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M		(UINT32_C(0x14) << 2)
25833 	/* 2MB. */
25834 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M		(UINT32_C(0x15) << 2)
25835 	/* 4MB. */
25836 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M		(UINT32_C(0x16) << 2)
25837 	/* 1GB. */
25838 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G		(UINT32_C(0x1e) << 2)
25839 	/* unused1 is 1 b */
25840 	uint8_t access;
25841 	/* Access flags. */
25842 	/* Local write access. */
25843 	#define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE		UINT32_C(0x1)
25844 	/* Remote read access. */
25845 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ		UINT32_C(0x2)
25846 	/* Remote write access. */
25847 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE		UINT32_C(0x4)
25848 	/* Remote atomic access. */
25849 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC		UINT32_C(0x8)
25850 	/* Bind access allowed. */
25851 	#define CMDQ_REGISTER_MR_ACCESS_MW_BIND			UINT32_C(0x10)
25852 	/* Indicate Zero Based Virtual Address (ZBVA). */
25853 	#define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED		UINT32_C(0x20)
25854 	uint16_t log2_pbl_pg_size;
25855 	/* unused11 is 11 b */
25856 	/*
25857 	 * Log base 2 of PBL page size; 12 is the minimum for 4KB. HW supported
25858 	 * values are enumerated below
25859 	 */
25860 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK		UINT32_C(0x1f)
25861 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT		0
25862 	/* 4KB. */
25863 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K	UINT32_C(0xc)
25864 	/* 8KB. */
25865 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K	UINT32_C(0xd)
25866 	/* 64KB. */
25867 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K	UINT32_C(0x10)
25868 	/* 256KB. */
25869 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K	UINT32_C(0x12)
25870 	/* 1MB. */
25871 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M	UINT32_C(0x14)
25872 	/* 2MB. */
25873 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M	UINT32_C(0x15)
25874 	/* 4MB. */
25875 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M	UINT32_C(0x16)
25876 	/* 1GB. */
25877 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G	UINT32_C(0x1e)
25878 	/* unused11 is 11 b */
25879 	uint32_t key;
25880 	/* KEY of the MR. */
25881 	uint64_t pbl;
25882 	/* Page table of the MR memory. */
25883 	uint64_t va;
25884 	/* Virtual address of the MR. */
25885 	uint64_t mr_size;
25886 	/* Size of the MR. */
25887 } __attribute__((packed));
25888 
25889 /* Deregister MR command (24 bytes) */
25890 
25891 struct cmdq_deregister_mr {
25892 	uint8_t opcode;
25893 	/* Command opcode. */
25894 	/* Deregister MR command de-registers memory from the specified MR. */
25895 	#define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR	UINT32_C(0x10)
25896 	uint8_t cmd_size;
25897 	/* Size of the command in 16-byte units. */
25898 	uint16_t flags;
25899 	/* Flags and attribs of the command. */
25900 	uint16_t cookie;
25901 	/* Driver supplied handle to associate the command and the response. */
25902 	uint8_t resp_size;
25903 	/* Size of the response buffer in 16-byte units. */
25904 	uint8_t reserved8;
25905 	uint64_t resp_addr;
25906 	/* Host address of the response. */
25907 	uint32_t lkey;
25908 	/* L_KEY of the MR. */
25909 	uint32_t unused_0;
25910 } __attribute__((packed));
25911 
25912 /* Add GID command (48 bytes) */
25913 
25914 struct cmdq_add_gid {
25915 	uint8_t opcode;
25916 	/* Command opcode. */
25917 	/* Add GID command adds a GID to the local address table. */
25918 	#define CMDQ_ADD_GID_OPCODE_ADD_GID			UINT32_C(0x11)
25919 	uint8_t cmd_size;
25920 	/* Size of the command in 16-byte units. */
25921 	uint16_t flags;
25922 	/* Flags and attribs of the command. */
25923 	uint16_t cookie;
25924 	/* Driver supplied handle to associate the command and the response. */
25925 	uint8_t resp_size;
25926 	/* Size of the response buffer in 16-byte units. */
25927 	uint8_t reserved8;
25928 	uint64_t resp_addr;
25929 	/* Host address of the response. */
25930 	uint32_t gid[4];
25931 	/* GID */
25932 	uint16_t src_mac[3];
25933 	/* Source MAC. */
25934 	uint16_t vlan;
25935 	/* flags. */
25936 	/* Source VLAN id. */
25937 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK			UINT32_C(0xfff)
25938 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT			0
25939 	/* This set of bits select the TPID of the VLAN Tag. */
25940 	#define CMDQ_ADD_GID_VLAN_TPID_MASK			UINT32_C(0x7000)
25941 	#define CMDQ_ADD_GID_VLAN_TPID_SFT			12
25942 	/* TPID = 0x88A8. */
25943 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8		(UINT32_C(0x0) << 12)
25944 	/* TPID = 0x8100. */
25945 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_8100		(UINT32_C(0x1) << 12)
25946 	/* TPID = 0x9100. */
25947 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9100		(UINT32_C(0x2) << 12)
25948 	/* TPID = 0x9200. */
25949 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9200		(UINT32_C(0x3) << 12)
25950 	/* TPID = 0x9300. */
25951 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9300		(UINT32_C(0x4) << 12)
25952 	/* TPID = Configurable 1. */
25953 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1		(UINT32_C(0x5) << 12)
25954 	/* TPID = Configurable 2. */
25955 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2		(UINT32_C(0x6) << 12)
25956 	/* TPID = Configurable 3. */
25957 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3		(UINT32_C(0x7) << 12)
25958 	#define CMDQ_ADD_GID_VLAN_TPID_LAST	CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
25959 	/*
25960 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
25961 	 * header.
25962 	 */
25963 	#define CMDQ_ADD_GID_VLAN_VLAN_EN			UINT32_C(0x8000)
25964 	uint16_t ipid;
25965 	/* Identifier field in the IP header. */
25966 	uint16_t stats_ctx;
25967 	/* Stats context ID to use with this SGID */
25968 	/* stats_ctx_id is 15 b */
25969 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK	UINT32_C(0x7fff)
25970 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT		0
25971 	/*
25972 	 * Setting this bit to 1 enables use of own stats context ID instead of
25973 	 * per-function
25974 	 */
25975 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID		UINT32_C(0x8000)
25976 	uint32_t unused_0;
25977 } __attribute__((packed));
25978 
25979 /* Delete GID command (24 bytes) */
25980 
25981 struct cmdq_delete_gid {
25982 	uint8_t opcode;
25983 	/* Command opcode. */
25984 	/* Delete GID command deletes a GID from the local address table. */
25985 	#define CMDQ_DELETE_GID_OPCODE_DELETE_GID		UINT32_C(0x12)
25986 	uint8_t cmd_size;
25987 	/* Size of the command in 16-byte units. */
25988 	uint16_t flags;
25989 	/* Flags and attribs of the command. */
25990 	uint16_t cookie;
25991 	/* Driver supplied handle to associate the command and the response. */
25992 	uint8_t resp_size;
25993 	/* Size of the response buffer in 16-byte units. */
25994 	uint8_t reserved8;
25995 	uint64_t resp_addr;
25996 	/* Host address of the response. */
25997 	uint16_t gid_index;
25998 	/* GID index */
25999 	uint16_t unused_0;
26000 	/* unused16 is 16 b */
26001 	uint32_t unused_1;
26002 } __attribute__((packed));
26003 
26004 /* Modify GID command (48 bytes) */
26005 
26006 struct cmdq_modify_gid {
26007 	uint8_t opcode;
26008 	/* Command opcode. */
26009 	/* Modify GID command modifies a GID in the local address table. */
26010 	#define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID		UINT32_C(0x17)
26011 	uint8_t cmd_size;
26012 	/* Size of the command in 16-byte units. */
26013 	uint16_t flags;
26014 	/* Flags and attribs of the command. */
26015 	uint16_t cookie;
26016 	/* Driver supplied handle to associate the command and the response. */
26017 	uint8_t resp_size;
26018 	/* Size of the response buffer in 16-byte units. */
26019 	uint8_t reserved8;
26020 	uint64_t resp_addr;
26021 	/* Host address of the response. */
26022 	uint32_t gid[4];
26023 	/* GID */
26024 	uint16_t src_mac[3];
26025 	/* Source MAC. */
26026 	uint16_t vlan;
26027 	/* flags. */
26028 	/* Source VLAN id. */
26029 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK		UINT32_C(0xfff)
26030 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT		0
26031 	/* This set of bits select the TPID of the VLAN Tag. */
26032 	#define CMDQ_MODIFY_GID_VLAN_TPID_MASK			UINT32_C(0x7000)
26033 	#define CMDQ_MODIFY_GID_VLAN_TPID_SFT			12
26034 	/* TPID = 0x88A8. */
26035 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8		(UINT32_C(0x0) << 12)
26036 	/* TPID = 0x8100. */
26037 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100		(UINT32_C(0x1) << 12)
26038 	/* TPID = 0x9100. */
26039 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100		(UINT32_C(0x2) << 12)
26040 	/* TPID = 0x9200. */
26041 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200		(UINT32_C(0x3) << 12)
26042 	/* TPID = 0x9300. */
26043 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300		(UINT32_C(0x4) << 12)
26044 	/* TPID = Configurable 1. */
26045 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1		(UINT32_C(0x5) << 12)
26046 	/* TPID = Configurable 2. */
26047 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2		(UINT32_C(0x6) << 12)
26048 	/* TPID = Configurable 3. */
26049 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3		(UINT32_C(0x7) << 12)
26050 	#define CMDQ_MODIFY_GID_VLAN_TPID_LAST	CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
26051 	/*
26052 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
26053 	 * header.
26054 	 */
26055 	#define CMDQ_MODIFY_GID_VLAN_VLAN_EN			UINT32_C(0x8000)
26056 	uint16_t ipid;
26057 	/* Identifier field in the IP header. */
26058 	uint16_t gid_index;
26059 	/* GID index */
26060 	uint16_t stats_ctx;
26061 	/* Stats context ID to use with this SGID */
26062 	/* stats_ctx_id is 15 b */
26063 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK	UINT32_C(0x7fff)
26064 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT	0
26065 	/*
26066 	 * Setting this bit to 1 enables use of own stats context ID instead of
26067 	 * per-function
26068 	 */
26069 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID	UINT32_C(0x8000)
26070 	uint16_t unused_0;
26071 } __attribute__((packed));
26072 
26073 /* Query GID command (24 bytes) */
26074 
26075 struct cmdq_query_gid {
26076 	uint8_t opcode;
26077 	/* Command opcode. */
26078 	/* Query GID command queries a GID in the local address table. */
26079 	#define CMDQ_QUERY_GID_OPCODE_QUERY_GID		UINT32_C(0x18)
26080 	uint8_t cmd_size;
26081 	/* Size of the command in 16-byte units. */
26082 	uint16_t flags;
26083 	/* Flags and attribs of the command. */
26084 	uint16_t cookie;
26085 	/* Driver supplied handle to associate the command and the response. */
26086 	uint8_t resp_size;
26087 	/* Size of the response buffer in 16-byte units. */
26088 	uint8_t reserved8;
26089 	uint64_t resp_addr;
26090 	/* Host address of the response. */
26091 	uint16_t gid_index;
26092 	/* GID index */
26093 	uint16_t unused_0;
26094 	/* unused16 is 16 b */
26095 	uint32_t unused_1;
26096 } __attribute__((packed));
26097 
26098 /* Create QP1 command (80 bytes) */
26099 
26100 struct cmdq_create_qp1 {
26101 	uint8_t opcode;
26102 	/* Command opcode. */
26103 	/* Create QP1 command allocates a QP1 only. */
26104 	#define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1		UINT32_C(0x13)
26105 	uint8_t cmd_size;
26106 	/* Size of the command in 16-byte units. */
26107 	uint16_t flags;
26108 	/* Flags and attribs of the command. */
26109 	uint16_t cookie;
26110 	/* Driver supplied handle to associate the command and the response. */
26111 	uint8_t resp_size;
26112 	/* Size of the response buffer in 16-byte units. */
26113 	uint8_t reserved8;
26114 	uint64_t resp_addr;
26115 	/* Host address of the response. */
26116 	uint64_t qp_handle;
26117 	/* QP1 handle. */
26118 	uint32_t qp_flags;
26119 	/* Create QP1 flags. */
26120 	/* SRQ is used. */
26121 	#define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
26122 	/* post CQE for all SQ WQEs. */
26123 	#define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
26124 	/* This QP can use reserved L_Key */
26125 	#define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE	UINT32_C(0x4)
26126 	uint8_t type;
26127 	/* Supported QP1 types. */
26128 	/* General Services Interface on QP 1. */
26129 	#define CMDQ_CREATE_QP1_TYPE_GSI			UINT32_C(0x1)
26130 	uint8_t sq_pg_size_sq_lvl;
26131 	/* SQ page size. */
26132 	/* SQ PBL indirect levels. */
26133 	#define CMDQ_CREATE_QP1_SQ_LVL_MASK			UINT32_C(0xf)
26134 	#define CMDQ_CREATE_QP1_SQ_LVL_SFT			0
26135 	/* PBL pointer is physical start address. */
26136 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_0			UINT32_C(0x0)
26137 	/* PBL pointer points to PTE table. */
26138 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_1			UINT32_C(0x1)
26139 	/*
26140 	 * PBL pointer points to PDE table with each entry pointing to
26141 	 * PTE tables.
26142 	 */
26143 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_2			UINT32_C(0x2)
26144 	/* SQ page size. */
26145 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK			UINT32_C(0xf0)
26146 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT			4
26147 	/* 4KB. */
26148 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26149 	/* 8KB. */
26150 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26151 	/* 64KB. */
26152 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26153 	/* 2MB. */
26154 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26155 	/* 8MB. */
26156 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26157 	/* 1GB. */
26158 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26159 	uint8_t rq_pg_size_rq_lvl;
26160 	/* RQ page size. */
26161 	/* RQ PBL indirect levels. */
26162 	#define CMDQ_CREATE_QP1_RQ_LVL_MASK			UINT32_C(0xf)
26163 	#define CMDQ_CREATE_QP1_RQ_LVL_SFT			0
26164 	/* PBL pointer is physical start address. */
26165 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_0			UINT32_C(0x0)
26166 	/* PBL pointer points to PTE table. */
26167 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_1			UINT32_C(0x1)
26168 	/*
26169 	 * PBL pointer points to PDE table with each entry pointing to
26170 	 * PTE tables.
26171 	 */
26172 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_2			UINT32_C(0x2)
26173 	/* RQ page size. */
26174 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK			UINT32_C(0xf0)
26175 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT			4
26176 	/* 4KB. */
26177 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26178 	/* 8KB. */
26179 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26180 	/* 64KB. */
26181 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26182 	/* 2MB. */
26183 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26184 	/* 8MB. */
26185 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26186 	/* 1GB. */
26187 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26188 	uint8_t unused_0;
26189 	uint32_t dpi;
26190 	/* Doorbell page index. */
26191 	uint32_t sq_size;
26192 	/* Max number of SQ wqes. */
26193 	uint32_t rq_size;
26194 	/* Max number of RQ wqes. */
26195 	uint16_t sq_fwo_sq_sge;
26196 	/* Offset of First WQE in the first SQ page, in 128 byte units */
26197 	/* Max send SGEs per SWQE. */
26198 	#define CMDQ_CREATE_QP1_SQ_SGE_MASK			UINT32_C(0xf)
26199 	#define CMDQ_CREATE_QP1_SQ_SGE_SFT			0
26200 	/* Offset of First WQE in the first SQ page, in 128 byte units */
26201 	#define CMDQ_CREATE_QP1_SQ_FWO_MASK			UINT32_C(0xfff0)
26202 	#define CMDQ_CREATE_QP1_SQ_FWO_SFT			4
26203 	uint16_t rq_fwo_rq_sge;
26204 	/* Offset of First WQE in the first RQ page, in 128 byte units */
26205 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
26206 	#define CMDQ_CREATE_QP1_RQ_SGE_MASK			UINT32_C(0xf)
26207 	#define CMDQ_CREATE_QP1_RQ_SGE_SFT			0
26208 	/* Offset of First WQE in the first RQ page, in 128 byte units */
26209 	#define CMDQ_CREATE_QP1_RQ_FWO_MASK			UINT32_C(0xfff0)
26210 	#define CMDQ_CREATE_QP1_RQ_FWO_SFT			4
26211 	uint32_t scq_cid;
26212 	/* Send CQ context id. */
26213 	uint32_t rcq_cid;
26214 	/* Receive CQ context id. */
26215 	uint32_t srq_cid;
26216 	/* SRQ CQ context id. */
26217 	uint32_t pd_id;
26218 	/* Protection domain id. */
26219 	uint64_t sq_pbl;
26220 	/* SQ PBL physical address. */
26221 	uint64_t rq_pbl;
26222 	/* RQ PBL physical address. */
26223 } __attribute__((packed));
26224 
26225 /* Destroy QP1 command (24 bytes) */
26226 
26227 struct cmdq_destroy_qp1 {
26228 	uint8_t opcode;
26229 	/* Command opcode. */
26230 	/* Destroy QP1 command deletes and flushes the specified QP1. */
26231 	#define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1		UINT32_C(0x14)
26232 	uint8_t cmd_size;
26233 	/* Size of the command in 16-byte units. */
26234 	uint16_t flags;
26235 	/* Flags and attribs of the command. */
26236 	uint16_t cookie;
26237 	/* Driver supplied handle to associate the command and the response. */
26238 	uint8_t resp_size;
26239 	/* Size of the response buffer in 16-byte units. */
26240 	uint8_t reserved8;
26241 	uint64_t resp_addr;
26242 	/* Host address of the response. */
26243 	uint32_t qp1_cid;
26244 	/* QP1 context id */
26245 	uint32_t unused_0;
26246 } __attribute__((packed));
26247 
26248 /* Create AH command (64 bytes) */
26249 
26250 struct cmdq_create_ah {
26251 	uint8_t opcode;
26252 	/* Command opcode. */
26253 	/* Create AH command allocates an AH with the specified parameters. */
26254 	#define CMDQ_CREATE_AH_OPCODE_CREATE_AH		UINT32_C(0x15)
26255 	uint8_t cmd_size;
26256 	/* Size of the command in 16-byte units. */
26257 	uint16_t flags;
26258 	/* Flags and attribs of the command. */
26259 	uint16_t cookie;
26260 	/* Driver supplied handle to associate the command and the response. */
26261 	uint8_t resp_size;
26262 	/* Size of the response buffer in 16-byte units. */
26263 	uint8_t reserved8;
26264 	uint64_t resp_addr;
26265 	/* Host address of the response. */
26266 	uint64_t ah_handle;
26267 	/* AH handle. */
26268 	uint32_t dgid[4];
26269 	/* Destination GID. */
26270 	uint8_t type;
26271 	/* V1, V2IPv4 or V2IPv6. */
26272 	/* V2IPv4. */
26273 	#define CMDQ_CREATE_AH_TYPE_V1				UINT32_C(0x0)
26274 	/* V2IPv4. */
26275 	#define CMDQ_CREATE_AH_TYPE_V2IPV4			UINT32_C(0x2)
26276 	/* V2IPv6. */
26277 	#define CMDQ_CREATE_AH_TYPE_V2IPV6			UINT32_C(0x3)
26278 	uint8_t hop_limit;
26279 	/* IPv6 Hop limit. */
26280 	uint16_t sgid_index;
26281 	/* SGID index. */
26282 	uint32_t dest_vlan_id_flow_label;
26283 	/* Destination VLAN ID. */
26284 	/* Flow label. */
26285 	#define CMDQ_CREATE_AH_FLOW_LABEL_MASK			UINT32_C(0xfffff)
26286 	#define CMDQ_CREATE_AH_FLOW_LABEL_SFT			0
26287 	/* Destination VLAN ID. */
26288 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK		UINT32_C(0xfff00000)
26289 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT			20
26290 	uint32_t pd_id;
26291 	/* Protection domain id. */
26292 	uint32_t unused_0;
26293 	uint16_t dest_mac[3];
26294 	/* Destination MAC address. */
26295 	uint8_t traffic_class;
26296 	/* Traffic class. */
26297 	uint8_t enable_cc;
26298 	/* Enable congestion control. */
26299 	#define CMDQ_CREATE_AH_ENABLE_CC			UINT32_C(0x1)
26300 } __attribute__((packed));
26301 
26302 /* Destroy AH command (24 bytes) */
26303 
26304 struct cmdq_destroy_ah {
26305 	uint8_t opcode;
26306 	/* Command opcode. */
26307 	/* Destroy AH command deletes the specified AH. */
26308 	#define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH		UINT32_C(0x16)
26309 	uint8_t cmd_size;
26310 	/* Size of the command in 16-byte units. */
26311 	uint16_t flags;
26312 	/* Flags and attribs of the command. */
26313 	uint16_t cookie;
26314 	/* Driver supplied handle to associate the command and the response. */
26315 	uint8_t resp_size;
26316 	/* Size of the response buffer in 16-byte units. */
26317 	uint8_t reserved8;
26318 	uint64_t resp_addr;
26319 	/* Host address of the response. */
26320 	uint32_t ah_cid;
26321 	/* AH context id */
26322 	uint32_t unused_0;
26323 } __attribute__((packed));
26324 
26325 /* Initialize Firmware command (112 bytes) */
26326 
26327 struct cmdq_initialize_fw {
26328 	uint8_t opcode;
26329 	/* Command opcode. */
26330 	/*
26331 	 * Initialize firmware command initializes the firmware with the
26332 	 * specified parameters.
26333 	 */
26334 	#define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW	UINT32_C(0x80)
26335 	uint8_t cmd_size;
26336 	/* Size of the command in 16-byte units. */
26337 	uint16_t flags;
26338 	/* Flags and attribs of the command. */
26339 	uint16_t cookie;
26340 	/* Driver supplied handle to associate the command and the response. */
26341 	uint8_t resp_size;
26342 	/* Size of the response buffer in 16-byte units. */
26343 	uint8_t reserved8;
26344 	uint64_t resp_addr;
26345 	/* Host address of the response. */
26346 	uint8_t qpc_pg_size_qpc_lvl;
26347 	/* QPC page size. */
26348 	/* QPC PBL indirect levels. */
26349 	#define CMDQ_INITIALIZE_FW_QPC_LVL_MASK			UINT32_C(0xf)
26350 	#define CMDQ_INITIALIZE_FW_QPC_LVL_SFT			0
26351 	/* PBL pointer is physical start address. */
26352 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0		UINT32_C(0x0)
26353 	/* PBL pointer points to PTE table. */
26354 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1		UINT32_C(0x1)
26355 	/*
26356 	 * PBL pointer points to PDE table with each entry pointing to
26357 	 * PTE tables.
26358 	 */
26359 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2		UINT32_C(0x2)
26360 	/* QPC page size. */
26361 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK		UINT32_C(0xf0)
26362 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT		4
26363 	/* 4KB. */
26364 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26365 	/* 8KB. */
26366 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26367 	/* 64KB. */
26368 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26369 	/* 2MB. */
26370 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26371 	/* 8MB. */
26372 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26373 	/* 1GB. */
26374 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26375 	uint8_t mrw_pg_size_mrw_lvl;
26376 	/* MRW page size. */
26377 	/* MRW PBL indirect levels. */
26378 	#define CMDQ_INITIALIZE_FW_MRW_LVL_MASK			UINT32_C(0xf)
26379 	#define CMDQ_INITIALIZE_FW_MRW_LVL_SFT			0
26380 	/* PBL pointer is physical start address. */
26381 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0		UINT32_C(0x0)
26382 	/* PBL pointer points to PTE table. */
26383 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1		UINT32_C(0x1)
26384 	/*
26385 	 * PBL pointer points to PDE table with each entry pointing to
26386 	 * PTE tables.
26387 	 */
26388 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2		UINT32_C(0x2)
26389 	/* MRW page size. */
26390 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK		UINT32_C(0xf0)
26391 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT		4
26392 	/* 4KB. */
26393 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26394 	/* 8KB. */
26395 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26396 	/* 64KB. */
26397 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26398 	/* 2MB. */
26399 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26400 	/* 8MB. */
26401 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26402 	/* 1GB. */
26403 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26404 	uint8_t srq_pg_size_srq_lvl;
26405 	/* SRQ page size. */
26406 	/* SRQ PBL indirect levels. */
26407 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK			UINT32_C(0xf)
26408 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT			0
26409 	/* PBL pointer is physical start address. */
26410 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0		UINT32_C(0x0)
26411 	/* PBL pointer points to PTE table. */
26412 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1		UINT32_C(0x1)
26413 	/*
26414 	 * PBL pointer points to PDE table with each entry pointing to
26415 	 * PTE tables.
26416 	 */
26417 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2		UINT32_C(0x2)
26418 	/* SRQ page size. */
26419 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK		UINT32_C(0xf0)
26420 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT		4
26421 	/* 4KB. */
26422 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26423 	/* 8KB. */
26424 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26425 	/* 64KB. */
26426 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26427 	/* 2MB. */
26428 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26429 	/* 8MB. */
26430 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26431 	/* 1GB. */
26432 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26433 	uint8_t cq_pg_size_cq_lvl;
26434 	/* CQ page size. */
26435 	/* CQ PBL indirect levels. */
26436 	#define CMDQ_INITIALIZE_FW_CQ_LVL_MASK			UINT32_C(0xf)
26437 	#define CMDQ_INITIALIZE_FW_CQ_LVL_SFT			0
26438 	/* PBL pointer is physical start address. */
26439 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0		UINT32_C(0x0)
26440 	/* PBL pointer points to PTE table. */
26441 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1		UINT32_C(0x1)
26442 	/*
26443 	 * PBL pointer points to PDE table with each entry pointing to
26444 	 * PTE tables.
26445 	 */
26446 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2		UINT32_C(0x2)
26447 	/* CQ page size. */
26448 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK		UINT32_C(0xf0)
26449 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT		4
26450 	/* 4KB. */
26451 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26452 	/* 8KB. */
26453 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26454 	/* 64KB. */
26455 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26456 	/* 2MB. */
26457 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26458 	/* 8MB. */
26459 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26460 	/* 1GB. */
26461 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26462 	uint8_t tqm_pg_size_tqm_lvl;
26463 	/* TQM page size. */
26464 	/* TQM PBL indirect levels. */
26465 	#define CMDQ_INITIALIZE_FW_TQM_LVL_MASK			UINT32_C(0xf)
26466 	#define CMDQ_INITIALIZE_FW_TQM_LVL_SFT			0
26467 	/* PBL pointer is physical start address. */
26468 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0		UINT32_C(0x0)
26469 	/* PBL pointer points to PTE table. */
26470 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1		UINT32_C(0x1)
26471 	/*
26472 	 * PBL pointer points to PDE table with each entry pointing to
26473 	 * PTE tables.
26474 	 */
26475 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2		UINT32_C(0x2)
26476 	/* TQM page size. */
26477 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK		UINT32_C(0xf0)
26478 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT		4
26479 	/* 4KB. */
26480 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26481 	/* 8KB. */
26482 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26483 	/* 64KB. */
26484 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26485 	/* 2MB. */
26486 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26487 	/* 8MB. */
26488 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26489 	/* 1GB. */
26490 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26491 	uint8_t tim_pg_size_tim_lvl;
26492 	/* TIM page size. */
26493 	/* TIM PBL indirect levels. */
26494 	#define CMDQ_INITIALIZE_FW_TIM_LVL_MASK			UINT32_C(0xf)
26495 	#define CMDQ_INITIALIZE_FW_TIM_LVL_SFT			0
26496 	/* PBL pointer is physical start address. */
26497 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0		UINT32_C(0x0)
26498 	/* PBL pointer points to PTE table. */
26499 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1		UINT32_C(0x1)
26500 	/*
26501 	 * PBL pointer points to PDE table with each entry pointing to
26502 	 * PTE tables.
26503 	 */
26504 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2		UINT32_C(0x2)
26505 	/* TIM page size. */
26506 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK		UINT32_C(0xf0)
26507 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT		4
26508 	/* 4KB. */
26509 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K		(UINT32_C(0x0) << 4)
26510 	/* 8KB. */
26511 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K		(UINT32_C(0x1) << 4)
26512 	/* 64KB. */
26513 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K		(UINT32_C(0x2) << 4)
26514 	/* 2MB. */
26515 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M		(UINT32_C(0x3) << 4)
26516 	/* 8MB. */
26517 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M		(UINT32_C(0x4) << 4)
26518 	/* 1GB. */
26519 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G		(UINT32_C(0x5) << 4)
26520 	uint16_t reserved16;
26521 	uint64_t qpc_page_dir;
26522 	/* Kernel notification queue page directory. */
26523 	uint64_t mrw_page_dir;
26524 	/* MRW page directory. */
26525 	uint64_t srq_page_dir;
26526 	/* SRQ page directory. */
26527 	uint64_t cq_page_dir;
26528 	/* CQ page directory. */
26529 	uint64_t tqm_page_dir;
26530 	/* TQM page directory. */
26531 	uint64_t tim_page_dir;
26532 	/* TIM page directory. */
26533 	uint32_t number_of_qp;
26534 	/* Number of QPs. */
26535 	uint32_t number_of_mrw;
26536 	/* Number of MRWs. */
26537 	uint32_t number_of_srq;
26538 	/* Number of SRQs. */
26539 	uint32_t number_of_cq;
26540 	/* Number of CQs. */
26541 	uint32_t max_qp_per_vf;
26542 	/* Number of QPs per VF. */
26543 	uint32_t max_mrw_per_vf;
26544 	/* Number of MRWs per VF. */
26545 	uint32_t max_srq_per_vf;
26546 	/* Number of SRQs per VF. */
26547 	uint32_t max_cq_per_vf;
26548 	/* Number of CQs per VF. */
26549 	uint32_t max_gid_per_vf;
26550 	/* Number of GIDs per VF. */
26551 	uint32_t stat_ctx_id;
26552 	/* Statistics context index for this function. */
26553 } __attribute__((packed));
26554 
26555 /* De-initialize Firmware command (16 bytes) */
26556 
26557 struct cmdq_deinitialize_fw {
26558 	uint8_t opcode;
26559 	/* Command opcode. */
26560 	/* De-initialize firmware command deinitializes the firmware. */
26561 	#define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW	UINT32_C(0x81)
26562 	uint8_t cmd_size;
26563 	/* Size of the command in 16-byte units. */
26564 	uint16_t flags;
26565 	/* Flags and attribs of the command. */
26566 	uint16_t cookie;
26567 	/* Driver supplied handle to associate the command and the response. */
26568 	uint8_t resp_size;
26569 	/* Size of the response buffer in 16-byte units. */
26570 	uint8_t reserved8;
26571 	uint64_t resp_addr;
26572 	/* Host address of the response. */
26573 } __attribute__((packed));
26574 
26575 /* Stop function command (16 bytes) */
26576 
26577 struct cmdq_stop_func {
26578 	uint8_t opcode;
26579 	/* Command opcode. */
26580 	/* Stop the function */
26581 	#define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC		UINT32_C(0x82)
26582 	uint8_t cmd_size;
26583 	/* Size of the command in 16-byte units. */
26584 	uint16_t flags;
26585 	/* Flags and attribs of the command. */
26586 	uint16_t cookie;
26587 	/* Driver supplied handle to associate the command and the response. */
26588 	uint8_t resp_size;
26589 	/* Size of the response buffer in 16-byte units. */
26590 	uint8_t reserved8;
26591 	uint64_t resp_addr;
26592 	/* Host address of the response. */
26593 } __attribute__((packed));
26594 
26595 /* Query function command (16 bytes) */
26596 
26597 struct cmdq_query_func {
26598 	uint8_t opcode;
26599 	/* Command opcode. */
26600 	/* Query the HW capabilities for the function. */
26601 	#define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC		UINT32_C(0x83)
26602 	uint8_t cmd_size;
26603 	/* Size of the command in 16-byte units. */
26604 	uint16_t flags;
26605 	/* Flags and attribs of the command. */
26606 	uint16_t cookie;
26607 	/* Driver supplied handle to associate the command and the response. */
26608 	uint8_t resp_size;
26609 	/* Size of the response buffer in 16-byte units. */
26610 	uint8_t reserved8;
26611 	uint64_t resp_addr;
26612 	/* Host address of the response. */
26613 } __attribute__((packed));
26614 
26615 /* Set function resources command (56 bytes) */
26616 
26617 struct cmdq_set_func_resources {
26618 	uint8_t opcode;
26619 	/* Command opcode. */
26620 	/*
26621 	 * Set the following resources for the function: - Max QP, CQ,
26622 	 * MR+MW, SRQ per PF - Max QP, CQ, MR+MW, SRQ per VF
26623 	 */
26624 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES UINT32_C(0x84)
26625 	uint8_t cmd_size;
26626 	/* Size of the command in 16-byte units. */
26627 	uint16_t flags;
26628 	/* Flags and attribs of the command. */
26629 	uint16_t cookie;
26630 	/* Driver supplied handle to associate the command and the response. */
26631 	uint8_t resp_size;
26632 	/* Size of the response buffer in 16-byte units. */
26633 	uint8_t reserved8;
26634 	uint64_t resp_addr;
26635 	/* Host address of the response. */
26636 	uint32_t number_of_qp;
26637 	/*
26638 	 * Number of QPs. It is the responsibility of the host to first extend
26639 	 * the existing PBL with new addresses to pages to handle the
26640 	 * adjustment. Must be greater or equal to current.
26641 	 */
26642 	uint32_t number_of_mrw;
26643 	/*
26644 	 * Number of MRWs. It is the responsibility of the host to first extend
26645 	 * the existing PBL with new addresses to pages to handle the
26646 	 * adjustment. Must be greater or equal to current.
26647 	 */
26648 	uint32_t number_of_srq;
26649 	/*
26650 	 * Number of SRQs. It is the responsibility of the host to first extend
26651 	 * the existing PBL with new addresses to pages to handle the
26652 	 * adjustment. Must be greater or equal to current.
26653 	 */
26654 	uint32_t number_of_cq;
26655 	/*
26656 	 * Number of CQs. It is the responsibility of the host to first extend
26657 	 * the existing PBL with new addresses to pages to handle the
26658 	 * adjustment. Must be greater or equal to current.
26659 	 */
26660 	uint32_t max_qp_per_vf;
26661 	/* Number of QPs per VF. */
26662 	uint32_t max_mrw_per_vf;
26663 	/* Number of MRWs per VF. */
26664 	uint32_t max_srq_per_vf;
26665 	/* Number of SRQs per VF. */
26666 	uint32_t max_cq_per_vf;
26667 	/* Number of CQs per VF. */
26668 	uint32_t max_gid_per_vf;
26669 	/* Number of GIDs per VF. */
26670 	uint32_t stat_ctx_id;
26671 	/* Statistics context index for this function. */
26672 } __attribute__((packed));
26673 
26674 /* Read hardware resource context command (24 bytes) */
26675 
26676 struct cmdq_read_context {
26677 	uint8_t opcode;
26678 	/* Command opcode. */
26679 	/*
26680 	 * Read the current state of any internal resource context. Can
26681 	 * only be issued from a PF.
26682 	 */
26683 	#define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT		UINT32_C(0x85)
26684 	uint8_t cmd_size;
26685 	/* Size of the command in 16-byte units. */
26686 	uint16_t flags;
26687 	/* Flags and attribs of the command. */
26688 	uint16_t cookie;
26689 	/* Driver supplied handle to associate the command and the response. */
26690 	uint8_t resp_size;
26691 	/* Size of the response buffer in 16-byte units. */
26692 	uint8_t reserved8;
26693 	uint64_t resp_addr;
26694 	/* Host address of the response. */
26695 	uint32_t type_xid;
26696 	/* Context type */
26697 	/* Context ID */
26698 	#define CMDQ_READ_CONTEXT_XID_MASK			UINT32_C(0xffffff)
26699 	#define CMDQ_READ_CONTEXT_XID_SFT			0
26700 	/* Context type */
26701 	#define CMDQ_READ_CONTEXT_TYPE_MASK			UINT32_C(0xff000000)
26702 	#define CMDQ_READ_CONTEXT_TYPE_SFT			24
26703 	/*
26704 	 * Read QPC. The context (448 bytes) goes to resp_addr (as is,
26705 	 * without a header), and resp_size should be set to 28 (448/16)
26706 	 */
26707 	#define CMDQ_READ_CONTEXT_TYPE_QPC			(UINT32_C(0x0) << 24)
26708 	/*
26709 	 * Read CQ. The context (64 bytes) goes to resp_addr (as is,
26710 	 * without a header), and resp_size should be set to 4 (64/16)
26711 	 */
26712 	#define CMDQ_READ_CONTEXT_TYPE_CQ			(UINT32_C(0x1) << 24)
26713 	/*
26714 	 * Read MRW. The context (128 bytes) goes to resp_addr (as is,
26715 	 * without a header), and resp_size should be set to 8 (128/16)
26716 	 */
26717 	#define CMDQ_READ_CONTEXT_TYPE_MRW			(UINT32_C(0x2) << 24)
26718 	/*
26719 	 * Read SRQ. The context (64 bytes) goes to resp_addr (as is,
26720 	 * without a header), and resp_size should be set to 4 (64/16)
26721 	 */
26722 	#define CMDQ_READ_CONTEXT_TYPE_SRQ			(UINT32_C(0x3) << 24)
26723 	uint32_t unused_0;
26724 } __attribute__((packed));
26725 
26726 /* Send a request from VF to pass a command to the PF. VF HSI is suspended until the PF returns the response (32 bytes) */
26727 
26728 struct cmdq_vf_backchannel_request {
26729 	uint8_t opcode;
26730 	/* Command opcode. */
26731 	/*
26732 	 * Send a request from VF to pass a command to the PF. VF HSI is
26733 	 * suspended until the PF returns the response
26734 	 */
26735 	#define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
26736 	uint8_t cmd_size;
26737 	/* Size of the command in 16-byte units. */
26738 	uint16_t flags;
26739 	/* Flags and attribs of the command. */
26740 	uint16_t cookie;
26741 	/* Driver supplied handle to associate the command and the response. */
26742 	uint8_t resp_size;
26743 	/* Size of the response buffer in 16-byte units. */
26744 	uint8_t reserved8;
26745 	uint64_t resp_addr;
26746 	/* Host address of the response. */
26747 	uint64_t command_addr;
26748 	/* Address of command request structure in VF space */
26749 	uint16_t command_length;
26750 	/*
26751 	 * Command request length (up to 4K). An optional address of the
26752 	 * extended response buffer should be provided in the request
26753 	 */
26754 	uint16_t unused_0[3];
26755 } __attribute__((packed));
26756 
26757 /* Read VF memory (primarily to get the backchannel request blob). Can only be issued from a PF. (32 bytes) */
26758 
26759 struct cmdq_read_vf_memory {
26760 	uint8_t opcode;
26761 	/* Command opcode. */
26762 	/*
26763 	 * Read VF memory (primarily to get the backchannel request
26764 	 * blob). Can only be issued from a PF.
26765 	 */
26766 	#define CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY	UINT32_C(0x87)
26767 	uint8_t cmd_size;
26768 	/* Size of the command in 16-byte units. */
26769 	uint16_t flags;
26770 	/* Flags and attribs of the command. */
26771 	uint16_t cookie;
26772 	/* Driver supplied handle to associate the command and the response. */
26773 	uint8_t resp_size;
26774 	/* Size of the response buffer in 16-byte units. */
26775 	uint8_t reserved8;
26776 	uint64_t resp_addr;
26777 	/* Host address of the response. */
26778 	uint64_t addr;
26779 	/* Address of memory in VF space to read */
26780 	uint16_t vf_id;
26781 	/* VF id, as provided in 0xC0 VF request notification */
26782 	uint16_t length;
26783 	/* Length to read, up to 4K */
26784 	uint32_t unused_0;
26785 } __attribute__((packed));
26786 
26787 /* 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. (40 bytes) */
26788 
26789 struct cmdq_complete_vf_request {
26790 	uint8_t opcode;
26791 	/* Command opcode. */
26792 	/*
26793 	 * Write VF memory (primarily to put the backchannel response
26794 	 * blob), and reenable VF HSI (post a CAG completion to it). Can
26795 	 * only be issued from a PF.
26796 	 */
26797 	#define CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST UINT32_C(0x88)
26798 	uint8_t cmd_size;
26799 	/* Size of the command in 16-byte units. */
26800 	uint16_t flags;
26801 	/* Flags and attribs of the command. */
26802 	uint16_t cookie;
26803 	/* Driver supplied handle to associate the command and the response. */
26804 	uint8_t resp_size;
26805 	/* Size of the response buffer in 16-byte units. */
26806 	uint8_t reserved8;
26807 	uint64_t resp_addr;
26808 	/* Host address of the response. */
26809 	uint64_t addr;
26810 	/*
26811 	 * Optional address of extended response in VF space to write. Length is
26812 	 * in resp_size in 16 byte units.
26813 	 */
26814 	uint32_t vf_misc;
26815 	/* Completion misc field to VF CREQ */
26816 	uint16_t vf_id;
26817 	/* VF id, as provided in 0xC0 VF request notification */
26818 	uint16_t vf_cookie;
26819 	/* Completion cookie for the VF command, goes to VF CREQ */
26820 	uint8_t vf_status;
26821 	/* Completion status for the VF command, goes to VF CREQ */
26822 	uint8_t unused_0[7];
26823 } __attribute__((packed));
26824 
26825 /* Map TC to COS. Can only be issued from a PF (24 bytes) */
26826 
26827 struct cmdq_map_tc_to_cos {
26828 	uint8_t opcode;
26829 	/* Command opcode. */
26830 	/* Map TC to COS. Can only be issued from a PF. */
26831 	#define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS	UINT32_C(0x8a)
26832 	uint8_t cmd_size;
26833 	/* Size of the command in 16-byte units. */
26834 	uint16_t flags;
26835 	/* Flags and attribs of the command. */
26836 	uint16_t cookie;
26837 	/* Driver supplied handle to associate the command and the response. */
26838 	uint8_t resp_size;
26839 	/* Size of the response buffer in 16-byte units. */
26840 	uint8_t reserved8;
26841 	uint64_t resp_addr;
26842 	/* Host address of the response. */
26843 	uint16_t cos0;
26844 	/* 1st COS index mapped to RoCE */
26845 	/* Don't change this COS. */
26846 	#define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE		UINT32_C(0xffff)
26847 	uint16_t cos1;
26848 	/* 2nd COS index mapped to RoCE */
26849 	/* Disable this COS. */
26850 	#define CMDQ_MAP_TC_TO_COS_COS1_DISABLE		UINT32_C(0x8000)
26851 	/* Don't change this COS. */
26852 	#define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE		UINT32_C(0xffff)
26853 	uint32_t unused_0;
26854 } __attribute__((packed));
26855 
26856 /* Query version command (16 bytes) */
26857 
26858 struct cmdq_query_version {
26859 	uint8_t opcode;
26860 	/* Command opcode. */
26861 	/* Query version. */
26862 	#define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION	UINT32_C(0x8b)
26863 	uint8_t cmd_size;
26864 	/* Size of the command in 16-byte units. */
26865 	uint16_t flags;
26866 	/* Flags and attribs of the command. */
26867 	uint16_t cookie;
26868 	/* Driver supplied handle to associate the command and the response. */
26869 	uint8_t resp_size;
26870 	/* Size of the response buffer in 16-byte units. */
26871 	uint8_t reserved8;
26872 	uint64_t resp_addr;
26873 	/* Host address of the response. */
26874 } __attribute__((packed));
26875 
26876 /* Modify congestion control command (56 bytes) */
26877 
26878 struct cmdq_modify_roce_cc {
26879 	uint8_t opcode;
26880 	/* Command opcode. */
26881 	/* Modify congestion control. Can only be issued from a PF. */
26882 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC	UINT32_C(0x8c)
26883 	uint8_t cmd_size;
26884 	/* Size of the command in 16-byte units. */
26885 	uint16_t flags;
26886 	/* Flags and attribs of the command. */
26887 	uint16_t cookie;
26888 	/* Driver supplied handle to associate the command and the response. */
26889 	uint8_t resp_size;
26890 	/* Size of the response buffer in 16-byte units. */
26891 	uint8_t reserved8;
26892 	uint64_t resp_addr;
26893 	/* Host address of the response. */
26894 	uint32_t modify_mask;
26895 	/* Modify mask signifies the field that is requesting the change. */
26896 	/* Enable change. */
26897 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC	UINT32_C(0x1)
26898 	/* Running average weight change. */
26899 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G		UINT32_C(0x2)
26900 	/* Number of phases in Fast Recovery. */
26901 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE   UINT32_C(0x4)
26902 	/* The starting value of rate change. */
26903 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR		UINT32_C(0x8)
26904 	/* The starting value of target rate change. */
26905 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR		UINT32_C(0x10)
26906 	/* IP TOS ECN change */
26907 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN		UINT32_C(0x20)
26908 	/* IP TOS DSCP change */
26909 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP	UINT32_C(0x40)
26910 	/* Alternate IP TOS ECN change */
26911 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP	UINT32_C(0x80)
26912 	/* Alternate IP TOS DSCP change */
26913 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP	UINT32_C(0x100)
26914 	/* Round trip time in units of usecs */
26915 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT		UINT32_C(0x200)
26916 	/* 0 for DCTCP , 1 for TCP */
26917 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE		UINT32_C(0x400)
26918 	/* The value used as CP when cc_mode is 1(TCP) */
26919 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP		UINT32_C(0x800)
26920 	/* Specifies the RoCE Tx Queue ( o to 3) to use for sending CNP packets */
26921 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE	UINT32_C(0x1000)
26922 	/* Inactivity time after which QP CC parameters are initialized */
26923 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP	UINT32_C(0x2000)
26924 	uint8_t enable_cc;
26925 	/* rsvd1 is 7 b */
26926 	/* Enable. */
26927 	#define CMDQ_MODIFY_ROCE_CC_ENABLE_CC			UINT32_C(0x1)
26928 	/* rsvd1 is 7 b */
26929 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK			UINT32_C(0xfe)
26930 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT			1
26931 	uint8_t g;
26932 	/* rsvd2 is 5 b */
26933 	/* Congestion Probability averaging factor. */
26934 	#define CMDQ_MODIFY_ROCE_CC_G_MASK			UINT32_C(0x7)
26935 	#define CMDQ_MODIFY_ROCE_CC_G_SFT			0
26936 	/* rsvd2 is 5 b */
26937 	#define CMDQ_MODIFY_ROCE_CC_RSVD2_MASK			UINT32_C(0xf8)
26938 	#define CMDQ_MODIFY_ROCE_CC_RSVD2_SFT			3
26939 	uint8_t num_phases_per_state;
26940 	/* Number of phases in Fast Recovery. */
26941 	uint8_t rsvd9;
26942 	/* rsvd9 is 8 b */
26943 	uint16_t init_cr;
26944 	/* The starting value of rate. */
26945 	uint16_t init_tr;
26946 	/* The starting value of target rate. */
26947 	uint8_t tos_dscp_tos_ecn;
26948 	/* IP TOS DSCP. */
26949 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
26950 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK		UINT32_C(0x3)
26951 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT			0
26952 	/* IP TOS DSCP. */
26953 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK		UINT32_C(0xfc)
26954 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT		2
26955 	uint8_t alt_vlan_pcp;
26956 	/* rsvd3 is 5 b */
26957 	/* Alternate vlan pcp value for CNP packets. */
26958 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK		UINT32_C(0x7)
26959 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT		0
26960 	/* rsvd3 is 5 b */
26961 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK			UINT32_C(0xf8)
26962 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT			3
26963 	uint16_t alt_tos_dscp;
26964 	/* rsvd4 is 10 b */
26965 	/* Alternate IP TOS DSCP. */
26966 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK		UINT32_C(0x3f)
26967 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT		0
26968 	/* rsvd4 is 10 b */
26969 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK			UINT32_C(0xffc0)
26970 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT			6
26971 	uint16_t rtt;
26972 	/* rsvd5 is 2 b */
26973 	/* Round trip time in units of usecs */
26974 	#define CMDQ_MODIFY_ROCE_CC_RTT_MASK			UINT32_C(0x3fff)
26975 	#define CMDQ_MODIFY_ROCE_CC_RTT_SFT			0
26976 	/* rsvd5 is 2 b */
26977 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK			UINT32_C(0xc000)
26978 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT			14
26979 	uint16_t tcp_cp;
26980 	/* rsvd6 is 6 b */
26981 	/* The value used as CP when cc_mode is 1(TCP) */
26982 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK			UINT32_C(0x3ff)
26983 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT			0
26984 	/* rsvd6 is 6 b */
26985 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK			UINT32_C(0xfc00)
26986 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT			10
26987 	uint8_t cc_mode;
26988 	/* rsvd7 is 7 b */
26989 	/* 0 for DCTCP , 1 for TCP */
26990 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE			UINT32_C(0x1)
26991 	/* rsvd7 is 7 b */
26992 	#define CMDQ_MODIFY_ROCE_CC_RSVD7_MASK			UINT32_C(0xfe)
26993 	#define CMDQ_MODIFY_ROCE_CC_RSVD7_SFT			1
26994 	uint8_t tx_queue;
26995 	/* rsvd8 is 6 b */
26996 	/* Specifies the RoCE Tx Queue ( o to 3) to use for sending CNP packets */
26997 	#define CMDQ_MODIFY_ROCE_CC_TX_QUEUE_MASK		UINT32_C(0x3)
26998 	#define CMDQ_MODIFY_ROCE_CC_TX_QUEUE_SFT		0
26999 	/* rsvd8 is 6 b */
27000 	#define CMDQ_MODIFY_ROCE_CC_RSVD8_MASK			UINT32_C(0xfc)
27001 	#define CMDQ_MODIFY_ROCE_CC_RSVD8_SFT			2
27002 	uint16_t inactivity_th;
27003 	/* Inactivity time after which QP CC parameters are initialized */
27004 	uint64_t reserved64;
27005 	uint64_t reserved64_1;
27006 } __attribute__((packed));
27007 
27008 /* Query congestion control command (16 bytes) */
27009 
27010 struct cmdq_query_roce_cc {
27011 	uint8_t opcode;
27012 	/* Command opcode. */
27013 	/* Query congestion control. */
27014 	#define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC	UINT32_C(0x8d)
27015 	uint8_t cmd_size;
27016 	/* Size of the command in 16-byte units. */
27017 	uint16_t flags;
27018 	/* Flags and attribs of the command. */
27019 	uint16_t cookie;
27020 	/* Driver supplied handle to associate the command and the response. */
27021 	uint8_t resp_size;
27022 	/* Size of the response buffer in 16-byte units. */
27023 	uint8_t reserved8;
27024 	uint64_t resp_addr;
27025 	/* Host address of the response. */
27026 } __attribute__((packed));
27027 
27028 /* Command-Response Event Queue (CREQ) Structures */
27029 /* Description: This is an async event indicating error happened on a QP. */
27030 /* Base CREQ Record (16 bytes) */
27031 
27032 struct creq_base {
27033 	uint8_t type;
27034 	/*
27035 	 * This field indicates the exact type of the completion. By convention,
27036 	 * the LSB identifies the length of the record in 16B units. Even values
27037 	 * indicate 16B records. Odd values indicate 32B records.
27038 	 */
27039 	#define CREQ_BASE_TYPE_MASK				UINT32_C(0x3f)
27040 	#define CREQ_BASE_TYPE_SFT				0
27041 	/* QP Async Notification */
27042 	#define CREQ_BASE_TYPE_QP_EVENT			UINT32_C(0x38)
27043 	/* Function Async Notification */
27044 	#define CREQ_BASE_TYPE_FUNC_EVENT			UINT32_C(0x3a)
27045 	#define CREQ_BASE_RESERVED2_MASK			UINT32_C(0xc0)
27046 	#define CREQ_BASE_RESERVED2_SFT				6
27047 	uint8_t reserved56[7];
27048 	uint8_t v;
27049 	/*
27050 	 * This value is written by the NIC such that it will be different for
27051 	 * each pass through the completion queue. The even passes will write 1.
27052 	 * The odd passes will write 0.
27053 	 */
27054 	#define CREQ_BASE_V					UINT32_C(0x1)
27055 	#define CREQ_BASE_RESERVED7_MASK			UINT32_C(0xfe)
27056 	#define CREQ_BASE_RESERVED7_SFT				1
27057 	uint8_t event;
27058 	/* This is the modifier on to the type field. */
27059 	uint16_t reserved48[3];
27060 } __attribute__((packed));
27061 
27062 /* RoCE Function Async Event Notification (16 bytes) */
27063 
27064 struct creq_func_event {
27065 	uint8_t type;
27066 	/*
27067 	 * This field indicates the exact type of the completion. By convention,
27068 	 * the LSB identifies the length of the record in 16B units. Even values
27069 	 * indicate 16B records. Odd values indicate 32B records.
27070 	 */
27071 	#define CREQ_FUNC_EVENT_TYPE_MASK			UINT32_C(0x3f)
27072 	#define CREQ_FUNC_EVENT_TYPE_SFT			0
27073 	/* Function Async Notification */
27074 	#define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT		UINT32_C(0x3a)
27075 	#define CREQ_FUNC_EVENT_RESERVED2_MASK			UINT32_C(0xc0)
27076 	#define CREQ_FUNC_EVENT_RESERVED2_SFT			6
27077 	uint8_t reserved56[7];
27078 	uint8_t v;
27079 	/*
27080 	 * This value is written by the NIC such that it will be different for
27081 	 * each pass through the completion queue. The even passes will write 1.
27082 	 * The odd passes will write 0.
27083 	 */
27084 	#define CREQ_FUNC_EVENT_V				UINT32_C(0x1)
27085 	#define CREQ_FUNC_EVENT_RESERVED7_MASK			UINT32_C(0xfe)
27086 	#define CREQ_FUNC_EVENT_RESERVED7_SFT			1
27087 	uint8_t event;
27088 	/*
27089 	 * This value defines what type of async event has occurred on the
27090 	 * function.
27091 	 */
27092 	/*
27093 	 * Invalid PBL or PCIE UR response occurred in SQ WQE or IRRQ
27094 	 * read access.
27095 	 */
27096 	#define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR		UINT32_C(0x1)
27097 	/* Invalid PBL or PCIE UR response occurred during data read access. */
27098 	#define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR		UINT32_C(0x2)
27099 	/*
27100 	 * Invalid PBL or PCIE UR response occurred in RQ/SRQ WQE or
27101 	 * ORRQ read access.
27102 	 */
27103 	#define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR		UINT32_C(0x3)
27104 	/* Invalid PBL occurred during data write access. */
27105 	#define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR		UINT32_C(0x4)
27106 	/* Invalid PBL occurred during CQ write access. */
27107 	#define CREQ_FUNC_EVENT_EVENT_CQ_ERROR			UINT32_C(0x5)
27108 	/* Invalid PBL or PCIE UR response occurred in TQM read access. */
27109 	#define CREQ_FUNC_EVENT_EVENT_TQM_ERROR		UINT32_C(0x6)
27110 	/* PCIE UR response occurred in CFC read access. */
27111 	#define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR		UINT32_C(0x7)
27112 	/* PCIE UR response occurred in CFC read access. */
27113 	#define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR		UINT32_C(0x8)
27114 	/* PCIE UR response occurred in CFC read access. */
27115 	#define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR		UINT32_C(0x9)
27116 	/* PCIE UR response occurred in CFC read access. */
27117 	#define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR		UINT32_C(0xa)
27118 	/* Invalid PBL or PCIE UR response occurred on timer read access. */
27119 	#define CREQ_FUNC_EVENT_EVENT_TIM_ERROR		UINT32_C(0xb)
27120 	/* A VF sent a backchannel command request */
27121 	#define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST		UINT32_C(0x80)
27122 	/*
27123 	 * Communication resource (QPC, CQ, SRQ, MRW) exhausted, and
27124 	 * resource array extension is enabled
27125 	 */
27126 	#define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED	UINT32_C(0x81)
27127 	uint16_t reserved48[3];
27128 } __attribute__((packed));
27129 
27130 /* RoCE Slowpath Command Completion (16 bytes) */
27131 
27132 struct creq_qp_event {
27133 	uint8_t type;
27134 	/*
27135 	 * This field indicates the exact type of the completion. By convention,
27136 	 * the LSB identifies the length of the record in 16B units. Even values
27137 	 * indicate 16B records. Odd values indicate 32B records.
27138 	 */
27139 	#define CREQ_QP_EVENT_TYPE_MASK				UINT32_C(0x3f)
27140 	#define CREQ_QP_EVENT_TYPE_SFT				0
27141 	/* QP Async Notification */
27142 	#define CREQ_QP_EVENT_TYPE_QP_EVENT			UINT32_C(0x38)
27143 	#define CREQ_QP_EVENT_RESERVED2_MASK			UINT32_C(0xc0)
27144 	#define CREQ_QP_EVENT_RESERVED2_SFT			6
27145 	uint8_t status;
27146 	/* Status of the response. */
27147 	/* Success. */
27148 	#define CREQ_QP_EVENT_STATUS_SUCCESS			UINT32_C(0x0)
27149 	/* Fail. */
27150 	#define CREQ_QP_EVENT_STATUS_FAIL			UINT32_C(0x1)
27151 	/* Resources. */
27152 	#define CREQ_QP_EVENT_STATUS_RESOURCES			UINT32_C(0x2)
27153 	/* Invalid command. */
27154 	#define CREQ_QP_EVENT_STATUS_INVALID_CMD		UINT32_C(0x3)
27155 	/* Not implemented. */
27156 	#define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED		UINT32_C(0x4)
27157 	/* Invalid parameter. */
27158 	#define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER		UINT32_C(0x5)
27159 	/* Hardware operation failed. */
27160 	#define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR		UINT32_C(0x6)
27161 	/* Firmware operation failed due to internal error. */
27162 	#define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR		UINT32_C(0x7)
27163 	uint16_t cookie;
27164 	/* Driver supplied handle to associate the command and the response. */
27165 	uint32_t reserved32;
27166 	uint8_t v;
27167 	/*
27168 	 * This value is written by the NIC such that it will be different for
27169 	 * each pass through the completion queue. The even passes will write 1.
27170 	 * The odd passes will write 0.
27171 	 */
27172 	#define CREQ_QP_EVENT_V					UINT32_C(0x1)
27173 	#define CREQ_QP_EVENT_RESERVED7_MASK			UINT32_C(0xfe)
27174 	#define CREQ_QP_EVENT_RESERVED7_SFT			1
27175 	uint8_t event;
27176 	/* Event or command opcode. */
27177 	/* Create QP command response. */
27178 	#define CREQ_QP_EVENT_EVENT_CREATE_QP			UINT32_C(0x1)
27179 	/* Destroy QP command response. */
27180 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP			UINT32_C(0x2)
27181 	/* Modify QP command response. */
27182 	#define CREQ_QP_EVENT_EVENT_MODIFY_QP			UINT32_C(0x3)
27183 	/* Query QP command response. */
27184 	#define CREQ_QP_EVENT_EVENT_QUERY_QP			UINT32_C(0x4)
27185 	/* Create SRQ command response. */
27186 	#define CREQ_QP_EVENT_EVENT_CREATE_SRQ			UINT32_C(0x5)
27187 	/* Destroy SRQ command response. */
27188 	#define CREQ_QP_EVENT_EVENT_DESTROY_SRQ		UINT32_C(0x6)
27189 	/* Query SRQ command response. */
27190 	#define CREQ_QP_EVENT_EVENT_QUERY_SRQ			UINT32_C(0x8)
27191 	/* Create CQ command response. */
27192 	#define CREQ_QP_EVENT_EVENT_CREATE_CQ			UINT32_C(0x9)
27193 	/* Destroy CQ command response. */
27194 	#define CREQ_QP_EVENT_EVENT_DESTROY_CQ			UINT32_C(0xa)
27195 	/* Resize CQ command response. */
27196 	#define CREQ_QP_EVENT_EVENT_RESIZE_CQ			UINT32_C(0xc)
27197 	/* Allocate MRW command response. */
27198 	#define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW		UINT32_C(0xd)
27199 	/* De-allocate key command response. */
27200 	#define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY		UINT32_C(0xe)
27201 	/* Register MR command response. */
27202 	#define CREQ_QP_EVENT_EVENT_REGISTER_MR		UINT32_C(0xf)
27203 	/* Deregister MR command response. */
27204 	#define CREQ_QP_EVENT_EVENT_DEREGISTER_MR		UINT32_C(0x10)
27205 	/* Add GID command response. */
27206 	#define CREQ_QP_EVENT_EVENT_ADD_GID			UINT32_C(0x11)
27207 	/* Delete GID command response. */
27208 	#define CREQ_QP_EVENT_EVENT_DELETE_GID			UINT32_C(0x12)
27209 	/* Modify GID command response. */
27210 	#define CREQ_QP_EVENT_EVENT_MODIFY_GID			UINT32_C(0x17)
27211 	/* Query GID command response. */
27212 	#define CREQ_QP_EVENT_EVENT_QUERY_GID			UINT32_C(0x18)
27213 	/* Create QP1 command response. */
27214 	#define CREQ_QP_EVENT_EVENT_CREATE_QP1			UINT32_C(0x13)
27215 	/* Destroy QP1 command response. */
27216 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP1		UINT32_C(0x14)
27217 	/* Create AH command response. */
27218 	#define CREQ_QP_EVENT_EVENT_CREATE_AH			UINT32_C(0x15)
27219 	/* Destroy AH command response. */
27220 	#define CREQ_QP_EVENT_EVENT_DESTROY_AH			UINT32_C(0x16)
27221 	/* Initialize firmware command response. */
27222 	#define CREQ_QP_EVENT_EVENT_INITIALIZE_FW		UINT32_C(0x80)
27223 	/* De-initialize firmware command response. */
27224 	#define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW		UINT32_C(0x81)
27225 	/* Stop PF command response. */
27226 	#define CREQ_QP_EVENT_EVENT_STOP_FUNC			UINT32_C(0x82)
27227 	/* Query info PF command response. */
27228 	#define CREQ_QP_EVENT_EVENT_QUERY_FUNC			UINT32_C(0x83)
27229 	/* Set function resources command response. */
27230 	#define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES		UINT32_C(0x84)
27231 	/* Map TC to COS response. */
27232 	#define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS		UINT32_C(0x8a)
27233 	/* Query firmware and interface version response. */
27234 	#define CREQ_QP_EVENT_EVENT_QUERY_VERSION		UINT32_C(0x8b)
27235 	/* Modify congestion control response. */
27236 	#define CREQ_QP_EVENT_EVENT_MODIFY_ROCE_CC		UINT32_C(0x8c)
27237 	/* Query congestion control response. */
27238 	#define CREQ_QP_EVENT_EVENT_QUERY_ROCE_CC		UINT32_C(0x8d)
27239 	/* QP error notification event. */
27240 	#define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION	UINT32_C(0xc0)
27241 	uint16_t reserved48[3];
27242 } __attribute__((packed));
27243 
27244 /* Create QP command response (16 bytes) */
27245 
27246 struct creq_create_qp_resp {
27247 	uint8_t type;
27248 	/*
27249 	 * This field indicates the exact type of the completion. By convention,
27250 	 * the LSB identifies the length of the record in 16B units. Even values
27251 	 * indicate 16B records. Odd values indicate 32B records.
27252 	 */
27253 	#define CREQ_CREATE_QP_RESP_TYPE_MASK			UINT32_C(0x3f)
27254 	#define CREQ_CREATE_QP_RESP_TYPE_SFT			0
27255 	/* QP Async Notification */
27256 	#define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27257 	#define CREQ_CREATE_QP_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27258 	#define CREQ_CREATE_QP_RESP_RESERVED2_SFT		6
27259 	uint8_t status;
27260 	/* Status of the response. */
27261 	uint16_t cookie;
27262 	/* Driver supplied handle to associate the command and the response. */
27263 	uint32_t xid;
27264 	/* QP context id */
27265 	uint8_t v;
27266 	/*
27267 	 * This value is written by the NIC such that it will be different for
27268 	 * each pass through the completion queue. The even passes will write 1.
27269 	 * The odd passes will write 0.
27270 	 */
27271 	#define CREQ_CREATE_QP_RESP_V				UINT32_C(0x1)
27272 	#define CREQ_CREATE_QP_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27273 	#define CREQ_CREATE_QP_RESP_RESERVED7_SFT		1
27274 	uint8_t event;
27275 	/* Event or command opcode. */
27276 	/* Create QP command response. */
27277 	#define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP		UINT32_C(0x1)
27278 	uint16_t reserved48[3];
27279 } __attribute__((packed));
27280 
27281 /* Destroy QP command response (16 bytes) */
27282 
27283 struct creq_destroy_qp_resp {
27284 	uint8_t type;
27285 	/*
27286 	 * This field indicates the exact type of the completion. By convention,
27287 	 * the LSB identifies the length of the record in 16B units. Even values
27288 	 * indicate 16B records. Odd values indicate 32B records.
27289 	 */
27290 	#define CREQ_DESTROY_QP_RESP_TYPE_MASK			UINT32_C(0x3f)
27291 	#define CREQ_DESTROY_QP_RESP_TYPE_SFT			0
27292 	/* QP Async Notification */
27293 	#define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27294 	#define CREQ_DESTROY_QP_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27295 	#define CREQ_DESTROY_QP_RESP_RESERVED2_SFT		6
27296 	uint8_t status;
27297 	/* Status of the response. */
27298 	uint16_t cookie;
27299 	/* Driver supplied handle to associate the command and the response. */
27300 	uint32_t xid;
27301 	/* QP context id */
27302 	uint8_t v;
27303 	/*
27304 	 * This value is written by the NIC such that it will be different for
27305 	 * each pass through the completion queue. The even passes will write 1.
27306 	 * The odd passes will write 0.
27307 	 */
27308 	#define CREQ_DESTROY_QP_RESP_V				UINT32_C(0x1)
27309 	#define CREQ_DESTROY_QP_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27310 	#define CREQ_DESTROY_QP_RESP_RESERVED7_SFT		1
27311 	uint8_t event;
27312 	/* Event or command opcode. */
27313 	/* Destroy QP command response. */
27314 	#define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP		UINT32_C(0x2)
27315 	uint16_t reserved48[3];
27316 } __attribute__((packed));
27317 
27318 /* Modify QP command response (16 bytes) */
27319 
27320 struct creq_modify_qp_resp {
27321 	uint8_t type;
27322 	/*
27323 	 * This field indicates the exact type of the completion. By convention,
27324 	 * the LSB identifies the length of the record in 16B units. Even values
27325 	 * indicate 16B records. Odd values indicate 32B records.
27326 	 */
27327 	#define CREQ_MODIFY_QP_RESP_TYPE_MASK			UINT32_C(0x3f)
27328 	#define CREQ_MODIFY_QP_RESP_TYPE_SFT			0
27329 	/* QP Async Notification */
27330 	#define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27331 	#define CREQ_MODIFY_QP_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27332 	#define CREQ_MODIFY_QP_RESP_RESERVED2_SFT		6
27333 	uint8_t status;
27334 	/* Status of the response. */
27335 	uint16_t cookie;
27336 	/* Driver supplied handle to associate the command and the response. */
27337 	uint32_t xid;
27338 	/* QP context id */
27339 	uint8_t v;
27340 	/*
27341 	 * This value is written by the NIC such that it will be different for
27342 	 * each pass through the completion queue. The even passes will write 1.
27343 	 * The odd passes will write 0.
27344 	 */
27345 	#define CREQ_MODIFY_QP_RESP_V				UINT32_C(0x1)
27346 	#define CREQ_MODIFY_QP_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27347 	#define CREQ_MODIFY_QP_RESP_RESERVED7_SFT		1
27348 	uint8_t event;
27349 	/* Event or command opcode. */
27350 	/* Modify QP command response. */
27351 	#define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP		UINT32_C(0x3)
27352 	uint16_t reserved48[3];
27353 } __attribute__((packed));
27354 
27355 /* Query QP command response (16 bytes) */
27356 
27357 struct creq_query_qp_resp {
27358 	uint8_t type;
27359 	/*
27360 	 * This field indicates the exact type of the completion. By convention,
27361 	 * the LSB identifies the length of the record in 16B units. Even values
27362 	 * indicate 16B records. Odd values indicate 32B records.
27363 	 */
27364 	#define CREQ_QUERY_QP_RESP_TYPE_MASK			UINT32_C(0x3f)
27365 	#define CREQ_QUERY_QP_RESP_TYPE_SFT			0
27366 	/* QP Async Notification */
27367 	#define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27368 	#define CREQ_QUERY_QP_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27369 	#define CREQ_QUERY_QP_RESP_RESERVED2_SFT		6
27370 	uint8_t status;
27371 	/* Status of the response. */
27372 	uint16_t cookie;
27373 	/* Driver supplied handle to associate the command and the response. */
27374 	uint32_t size;
27375 	/* Side buffer size in 16-byte units */
27376 	uint8_t v;
27377 	/*
27378 	 * This value is written by the NIC such that it will be different for
27379 	 * each pass through the completion queue. The even passes will write 1.
27380 	 * The odd passes will write 0.
27381 	 */
27382 	#define CREQ_QUERY_QP_RESP_V				UINT32_C(0x1)
27383 	#define CREQ_QUERY_QP_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27384 	#define CREQ_QUERY_QP_RESP_RESERVED7_SFT		1
27385 	uint8_t event;
27386 	/* Event or command opcode. */
27387 	/* Query QP command response. */
27388 	#define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP		UINT32_C(0x4)
27389 	uint16_t reserved48[3];
27390 } __attribute__((packed));
27391 
27392 /* Query QP command response side buffer structure (104 bytes) */
27393 
27394 struct creq_query_qp_resp_sb {
27395 	uint8_t opcode;
27396 	/* Command opcode. */
27397 	/* Query QP command response. */
27398 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP		UINT32_C(0x4)
27399 	uint8_t status;
27400 	/* Status of the response. */
27401 	uint16_t cookie;
27402 	/* Driver supplied handle to associate the command and the response. */
27403 	uint16_t flags;
27404 	/* Flags and attribs of the command. */
27405 	uint8_t resp_size;
27406 	/* Size of the response buffer in 16-byte units. */
27407 	uint8_t reserved8;
27408 	uint32_t xid;
27409 	/* QP context id */
27410 	uint8_t en_sqd_async_notify_state;
27411 	/* Enable congestion control. */
27412 	/* QP state */
27413 	#define CREQ_QUERY_QP_RESP_SB_STATE_MASK		UINT32_C(0xf)
27414 	#define CREQ_QUERY_QP_RESP_SB_STATE_SFT			0
27415 	/* Reset. */
27416 	#define CREQ_QUERY_QP_RESP_SB_STATE_RESET		UINT32_C(0x0)
27417 	/* Init. */
27418 	#define CREQ_QUERY_QP_RESP_SB_STATE_INIT		UINT32_C(0x1)
27419 	/* Ready To Receive. */
27420 	#define CREQ_QUERY_QP_RESP_SB_STATE_RTR		UINT32_C(0x2)
27421 	/* Ready To Send. */
27422 	#define CREQ_QUERY_QP_RESP_SB_STATE_RTS		UINT32_C(0x3)
27423 	/* SQ Drain. */
27424 	#define CREQ_QUERY_QP_RESP_SB_STATE_SQD		UINT32_C(0x4)
27425 	/* SQ Error. */
27426 	#define CREQ_QUERY_QP_RESP_SB_STATE_SQE		UINT32_C(0x5)
27427 	/* Error. */
27428 	#define CREQ_QUERY_QP_RESP_SB_STATE_ERR		UINT32_C(0x6)
27429 	/* SQ drain asynchronous notification. */
27430 	#define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x10)
27431 	/* Enable congestion control. */
27432 	uint8_t access;
27433 	/* Access flags. */
27434 	/* Local write access. */
27435 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE	UINT32_C(0x1)
27436 	/* Remote write access. */
27437 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE	UINT32_C(0x2)
27438 	/* Remote read access. */
27439 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ	UINT32_C(0x4)
27440 	/* Remote atomic access. */
27441 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC	UINT32_C(0x8)
27442 	uint16_t pkey;
27443 	/* P_KEY index. */
27444 	uint32_t qkey;
27445 	/* Q_KEY. */
27446 	uint32_t reserved32;
27447 	uint32_t dgid[4];
27448 	/* Destination GID. */
27449 	uint32_t flow_label;
27450 	/* Flow label. */
27451 	uint16_t sgid_index;
27452 	/* Source GID index. */
27453 	uint8_t hop_limit;
27454 	/* Hop limit. */
27455 	uint8_t traffic_class;
27456 	/* Traffic class. */
27457 	uint16_t dest_mac[3];
27458 	/* Destination MAC address. */
27459 	uint16_t path_mtu_dest_vlan_id;
27460 	/* Path MTU. */
27461 	/* Destination VLAN ID. */
27462 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK		UINT32_C(0xfff)
27463 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT		0
27464 	/* Path MTU. */
27465 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK		UINT32_C(0xf000)
27466 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT		12
27467 	/* 256. */
27468 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256		(UINT32_C(0x0) << 12)
27469 	/* 512. */
27470 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512		(UINT32_C(0x1) << 12)
27471 	/* 1024. */
27472 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024	(UINT32_C(0x2) << 12)
27473 	/* 2048. */
27474 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048	(UINT32_C(0x3) << 12)
27475 	/* 4096. */
27476 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096	(UINT32_C(0x4) << 12)
27477 	/* 8192. */
27478 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192	(UINT32_C(0x5) << 12)
27479 	uint8_t timeout;
27480 	/* Timeout value for SWQEs. */
27481 	uint8_t retry_cnt;
27482 	/* Max retry count for WQEs. */
27483 	uint8_t rnr_retry;
27484 	/* Max RNR retry count for WQEs. */
27485 	uint8_t min_rnr_timer;
27486 	/* Min RNR timer that the QP will report to the remote. */
27487 	uint32_t rq_psn;
27488 	/* RQ start packet sequence number. */
27489 	uint32_t sq_psn;
27490 	/* SQ start packet sequence number. */
27491 	uint8_t max_rd_atomic;
27492 	/* Max outstanding RDMA read atomic. */
27493 	uint8_t max_dest_rd_atomic;
27494 	/* Max destination outstanding RDMA read atomic. */
27495 	uint8_t tos_dscp_tos_ecn;
27496 	/* IP TOS DSCP. */
27497 	/* IP TOS ECN. */
27498 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK		UINT32_C(0x3)
27499 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT		0
27500 	/* IP TOS DSCP. */
27501 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK		UINT32_C(0xfc)
27502 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT		2
27503 	uint8_t enable_cc;
27504 	/* enable_cc is 1 b */
27505 	#define CREQ_QUERY_QP_RESP_SB_ENABLE_CC			UINT32_C(0x1)
27506 	#define CREQ_QUERY_QP_RESP_SB_RESERVED7_MASK		UINT32_C(0xfe)
27507 	#define CREQ_QUERY_QP_RESP_SB_RESERVED7_SFT		1
27508 	uint32_t sq_size;
27509 	/* Max send WQE. */
27510 	uint32_t rq_size;
27511 	/* Max recv WQE. */
27512 	uint16_t sq_sge;
27513 	/* Max send SGEs per SWQE. */
27514 	uint16_t rq_sge;
27515 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
27516 	uint32_t max_inline_data;
27517 	/* Max inline data length (upto 120 bytes). */
27518 	uint32_t dest_qp_id;
27519 	/* Destination QP id. */
27520 	uint32_t unused_1;
27521 	uint16_t src_mac[3];
27522 	/* Source MAC. */
27523 	uint16_t vlan_pcp_vlan_dei_vlan_id;
27524 	/* VLAN PCP field - Priority Code Point. */
27525 	/* Source VLAN id. */
27526 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK		UINT32_C(0xfff)
27527 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT		0
27528 	/* VLAN DEI field - Drop Eligibility Indicator. */
27529 	#define CREQ_QUERY_QP_RESP_SB_VLAN_DEI			UINT32_C(0x1000)
27530 	/* VLAN PCP field - Priority Code Point. */
27531 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK		UINT32_C(0xe000)
27532 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT		13
27533 } __attribute__((packed));
27534 
27535 /* Create SRQ command response (16 bytes) */
27536 
27537 struct creq_create_srq_resp {
27538 	uint8_t type;
27539 	/*
27540 	 * This field indicates the exact type of the completion. By convention,
27541 	 * the LSB identifies the length of the record in 16B units. Even values
27542 	 * indicate 16B records. Odd values indicate 32B records.
27543 	 */
27544 	#define CREQ_CREATE_SRQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27545 	#define CREQ_CREATE_SRQ_RESP_TYPE_SFT			0
27546 	/* QP Async Notification */
27547 	#define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27548 	#define CREQ_CREATE_SRQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27549 	#define CREQ_CREATE_SRQ_RESP_RESERVED2_SFT		6
27550 	uint8_t status;
27551 	/* Status of the response. */
27552 	uint16_t cookie;
27553 	/* Driver supplied handle to associate the command and the response. */
27554 	uint32_t xid;
27555 	/* SRQ context id */
27556 	uint8_t v;
27557 	/*
27558 	 * This value is written by the NIC such that it will be different for
27559 	 * each pass through the completion queue. The even passes will write 1.
27560 	 * The odd passes will write 0.
27561 	 */
27562 	#define CREQ_CREATE_SRQ_RESP_V				UINT32_C(0x1)
27563 	#define CREQ_CREATE_SRQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27564 	#define CREQ_CREATE_SRQ_RESP_RESERVED7_SFT		1
27565 	uint8_t event;
27566 	/* Event or command opcode. */
27567 	/* Create SRQ command response. */
27568 	#define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ		UINT32_C(0x5)
27569 	uint16_t reserved48[3];
27570 } __attribute__((packed));
27571 
27572 /* Destroy SRQ command response (16 bytes) */
27573 
27574 struct creq_destroy_srq_resp {
27575 	uint8_t type;
27576 	/*
27577 	 * This field indicates the exact type of the completion. By convention,
27578 	 * the LSB identifies the length of the record in 16B units. Even values
27579 	 * indicate 16B records. Odd values indicate 32B records.
27580 	 */
27581 	#define CREQ_DESTROY_SRQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27582 	#define CREQ_DESTROY_SRQ_RESP_TYPE_SFT			0
27583 	/* QP Async Notification */
27584 	#define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27585 	#define CREQ_DESTROY_SRQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27586 	#define CREQ_DESTROY_SRQ_RESP_RESERVED2_SFT		6
27587 	uint8_t status;
27588 	/* Status of the response. */
27589 	uint16_t cookie;
27590 	/* Driver supplied handle to associate the command and the response. */
27591 	uint32_t xid;
27592 	/* SRQ context id */
27593 	uint8_t v;
27594 	/*
27595 	 * This value is written by the NIC such that it will be different for
27596 	 * each pass through the completion queue. The even passes will write 1.
27597 	 * The odd passes will write 0.
27598 	 */
27599 	#define CREQ_DESTROY_SRQ_RESP_V				UINT32_C(0x1)
27600 	#define CREQ_DESTROY_SRQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27601 	#define CREQ_DESTROY_SRQ_RESP_RESERVED7_SFT		1
27602 	uint8_t event;
27603 	/* Event or command opcode. */
27604 	/* Destroy SRQ command response. */
27605 	#define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ	UINT32_C(0x6)
27606 	uint16_t enable_for_arm[3];
27607 	/* Set to 1 if this SRQ is allowed to be armed for threshold async event */
27608 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK	UINT32_C(0x30000)
27609 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT	16
27610 	#define CREQ_DESTROY_SRQ_RESP_RESERVED46_MASK		UINT32_C(0xfffc0000)
27611 	#define CREQ_DESTROY_SRQ_RESP_RESERVED46_SFT		18
27612 } __attribute__((packed));
27613 
27614 /* Query SRQ command response (16 bytes) */
27615 
27616 struct creq_query_srq_resp {
27617 	uint8_t type;
27618 	/*
27619 	 * This field indicates the exact type of the completion. By convention,
27620 	 * the LSB identifies the length of the record in 16B units. Even values
27621 	 * indicate 16B records. Odd values indicate 32B records.
27622 	 */
27623 	#define CREQ_QUERY_SRQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27624 	#define CREQ_QUERY_SRQ_RESP_TYPE_SFT			0
27625 	/* QP Async Notification */
27626 	#define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27627 	#define CREQ_QUERY_SRQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27628 	#define CREQ_QUERY_SRQ_RESP_RESERVED2_SFT		6
27629 	uint8_t status;
27630 	/* Status of the response. */
27631 	uint16_t cookie;
27632 	/* Driver supplied handle to associate the command and the response. */
27633 	uint32_t size;
27634 	/* Side buffer size in 16-byte units */
27635 	uint8_t v;
27636 	/*
27637 	 * This value is written by the NIC such that it will be different for
27638 	 * each pass through the completion queue. The even passes will write 1.
27639 	 * The odd passes will write 0.
27640 	 */
27641 	#define CREQ_QUERY_SRQ_RESP_V				UINT32_C(0x1)
27642 	#define CREQ_QUERY_SRQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27643 	#define CREQ_QUERY_SRQ_RESP_RESERVED7_SFT		1
27644 	uint8_t event;
27645 	/* Event or command opcode. */
27646 	/* Query SRQ command response. */
27647 	#define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ		UINT32_C(0x8)
27648 	uint16_t reserved48[3];
27649 } __attribute__((packed));
27650 
27651 /* Query SRQ command response side buffer structure (24 bytes) */
27652 
27653 struct creq_query_srq_resp_sb {
27654 	uint8_t opcode;
27655 	/* Command opcode. */
27656 	/* Query SRQ command response. */
27657 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ	UINT32_C(0x8)
27658 	uint8_t status;
27659 	/* Status of the response. */
27660 	uint16_t cookie;
27661 	/* Driver supplied handle to associate the command and the response. */
27662 	uint16_t flags;
27663 	/* Flags and attribs of the command. */
27664 	uint8_t resp_size;
27665 	/* Size of the response buffer in 16-byte units. */
27666 	uint8_t reserved8;
27667 	uint32_t xid;
27668 	/* SRQ context id */
27669 	uint16_t srq_limit;
27670 	/* Watermark value to generate a SRQ limit event. */
27671 	uint16_t reserved16;
27672 	uint32_t data[4];
27673 	/* data is 128 b */
27674 } __attribute__((packed));
27675 
27676 /* Create CQ command Response (16 bytes) */
27677 
27678 struct creq_create_cq_resp {
27679 	uint8_t type;
27680 	/*
27681 	 * This field indicates the exact type of the completion. By convention,
27682 	 * the LSB identifies the length of the record in 16B units. Even values
27683 	 * indicate 16B records. Odd values indicate 32B records.
27684 	 */
27685 	#define CREQ_CREATE_CQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27686 	#define CREQ_CREATE_CQ_RESP_TYPE_SFT			0
27687 	/* QP Async Notification */
27688 	#define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27689 	#define CREQ_CREATE_CQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27690 	#define CREQ_CREATE_CQ_RESP_RESERVED2_SFT		6
27691 	uint8_t status;
27692 	/* Status of the response. */
27693 	uint16_t cookie;
27694 	/* Driver supplied handle to associate the command and the response. */
27695 	uint32_t xid;
27696 	/* CQ context id */
27697 	uint8_t v;
27698 	/*
27699 	 * This value is written by the NIC such that it will be different for
27700 	 * each pass through the completion queue. The even passes will write 1.
27701 	 * The odd passes will write 0.
27702 	 */
27703 	#define CREQ_CREATE_CQ_RESP_V				UINT32_C(0x1)
27704 	#define CREQ_CREATE_CQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27705 	#define CREQ_CREATE_CQ_RESP_RESERVED7_SFT		1
27706 	uint8_t event;
27707 	/* Event or command opcode. */
27708 	/* Create CQ command response. */
27709 	#define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ		UINT32_C(0x9)
27710 	uint16_t reserved48[3];
27711 } __attribute__((packed));
27712 
27713 /* Destroy CQ command response (16 bytes) */
27714 
27715 struct creq_destroy_cq_resp {
27716 	uint8_t type;
27717 	/*
27718 	 * This field indicates the exact type of the completion. By convention,
27719 	 * the LSB identifies the length of the record in 16B units. Even values
27720 	 * indicate 16B records. Odd values indicate 32B records.
27721 	 */
27722 	#define CREQ_DESTROY_CQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27723 	#define CREQ_DESTROY_CQ_RESP_TYPE_SFT			0
27724 	/* QP Async Notification */
27725 	#define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27726 	#define CREQ_DESTROY_CQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27727 	#define CREQ_DESTROY_CQ_RESP_RESERVED2_SFT		6
27728 	uint8_t status;
27729 	/* Status of the response. */
27730 	uint16_t cookie;
27731 	/* Driver supplied handle to associate the command and the response. */
27732 	uint32_t xid;
27733 	/* CQ context id */
27734 	uint8_t v;
27735 	/*
27736 	 * This value is written by the NIC such that it will be different for
27737 	 * each pass through the completion queue. The even passes will write 1.
27738 	 * The odd passes will write 0.
27739 	 */
27740 	#define CREQ_DESTROY_CQ_RESP_V				UINT32_C(0x1)
27741 	#define CREQ_DESTROY_CQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27742 	#define CREQ_DESTROY_CQ_RESP_RESERVED7_SFT		1
27743 	uint8_t event;
27744 	/* Event or command opcode. */
27745 	/* Destroy CQ command response. */
27746 	#define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ		UINT32_C(0xa)
27747 	uint16_t cq_arm_lvl;
27748 	/*
27749 	 * CQ ARM Level: 0 ? Not Armed 1 ? Arm SE Only, Generate CNQE only for
27750 	 * incoming Solicted Events 2 ? Arm all, Generate CNQE for Rx and Tx
27751 	 */
27752 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK		UINT32_C(0x3)
27753 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT		0
27754 	#define CREQ_DESTROY_CQ_RESP_RESERVED14_MASK		UINT32_C(0xfffc)
27755 	#define CREQ_DESTROY_CQ_RESP_RESERVED14_SFT		2
27756 	uint16_t total_cnq_events;
27757 	/*
27758 	 * The total number of CNQ events for the CQ, incremented on each CNQ
27759 	 * event for the CQ (including firmware-generated CQ error
27760 	 * notification).
27761 	 */
27762 	uint16_t reserved16;
27763 } __attribute__((packed));
27764 
27765 /* Resize CQ command response (16 bytes) */
27766 
27767 struct creq_resize_cq_resp {
27768 	uint8_t type;
27769 	/*
27770 	 * This field indicates the exact type of the completion. By convention,
27771 	 * the LSB identifies the length of the record in 16B units. Even values
27772 	 * indicate 16B records. Odd values indicate 32B records.
27773 	 */
27774 	#define CREQ_RESIZE_CQ_RESP_TYPE_MASK			UINT32_C(0x3f)
27775 	#define CREQ_RESIZE_CQ_RESP_TYPE_SFT			0
27776 	/* QP Async Notification */
27777 	#define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27778 	#define CREQ_RESIZE_CQ_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27779 	#define CREQ_RESIZE_CQ_RESP_RESERVED2_SFT		6
27780 	uint8_t status;
27781 	/* Status of the response. */
27782 	uint16_t cookie;
27783 	/* Driver supplied handle to associate the command and the response. */
27784 	uint32_t xid;
27785 	/* CQ context id */
27786 	uint8_t v;
27787 	/*
27788 	 * This value is written by the NIC such that it will be different for
27789 	 * each pass through the completion queue. The even passes will write 1.
27790 	 * The odd passes will write 0.
27791 	 */
27792 	#define CREQ_RESIZE_CQ_RESP_V				UINT32_C(0x1)
27793 	#define CREQ_RESIZE_CQ_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27794 	#define CREQ_RESIZE_CQ_RESP_RESERVED7_SFT		1
27795 	uint8_t event;
27796 	/* Event or command opcode. */
27797 	/* Resize CQ command response. */
27798 	#define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ		UINT32_C(0xc)
27799 	uint16_t reserved48[3];
27800 } __attribute__((packed));
27801 
27802 /* Allocate MRW command response (16 bytes) */
27803 
27804 struct creq_allocate_mrw_resp {
27805 	uint8_t type;
27806 	/*
27807 	 * This field indicates the exact type of the completion. By convention,
27808 	 * the LSB identifies the length of the record in 16B units. Even values
27809 	 * indicate 16B records. Odd values indicate 32B records.
27810 	 */
27811 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK		UINT32_C(0x3f)
27812 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT			0
27813 	/* QP Async Notification */
27814 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27815 	#define CREQ_ALLOCATE_MRW_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27816 	#define CREQ_ALLOCATE_MRW_RESP_RESERVED2_SFT		6
27817 	uint8_t status;
27818 	/* Status of the response. */
27819 	uint16_t cookie;
27820 	/* Driver supplied handle to associate the command and the response. */
27821 	uint32_t xid;
27822 	/* L_KEY for MR, R_KEY for MW */
27823 	uint8_t v;
27824 	/*
27825 	 * This value is written by the NIC such that it will be different for
27826 	 * each pass through the completion queue. The even passes will write 1.
27827 	 * The odd passes will write 0.
27828 	 */
27829 	#define CREQ_ALLOCATE_MRW_RESP_V			UINT32_C(0x1)
27830 	#define CREQ_ALLOCATE_MRW_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27831 	#define CREQ_ALLOCATE_MRW_RESP_RESERVED7_SFT		1
27832 	uint8_t event;
27833 	/* Event or command opcode. */
27834 	/* Allocate MRW command response. */
27835 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW	UINT32_C(0xd)
27836 	uint16_t reserved48[3];
27837 } __attribute__((packed));
27838 
27839 /* De-allocate key command response (16 bytes) */
27840 
27841 struct creq_deallocate_key_resp {
27842 	uint8_t type;
27843 	/*
27844 	 * This field indicates the exact type of the completion. By convention,
27845 	 * the LSB identifies the length of the record in 16B units. Even values
27846 	 * indicate 16B records. Odd values indicate 32B records.
27847 	 */
27848 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK		UINT32_C(0x3f)
27849 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT		0
27850 	/* QP Async Notification */
27851 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27852 	#define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27853 	#define CREQ_DEALLOCATE_KEY_RESP_RESERVED2_SFT		6
27854 	uint8_t status;
27855 	/* Status of the response. */
27856 	uint16_t cookie;
27857 	/* Driver supplied handle to associate the command and the response. */
27858 	uint32_t xid;
27859 	/* L_KEY for MR, R_KEY for MW */
27860 	uint8_t v;
27861 	/*
27862 	 * This value is written by the NIC such that it will be different for
27863 	 * each pass through the completion queue. The even passes will write 1.
27864 	 * The odd passes will write 0.
27865 	 */
27866 	#define CREQ_DEALLOCATE_KEY_RESP_V			UINT32_C(0x1)
27867 	#define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27868 	#define CREQ_DEALLOCATE_KEY_RESP_RESERVED7_SFT		1
27869 	uint8_t event;
27870 	/* Event or command opcode. */
27871 	/* De-allocate key command response. */
27872 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY	UINT32_C(0xe)
27873 	uint16_t reserved16;
27874 	uint32_t bound_window_info;
27875 	/*
27876 	 * This is advisory data to facilitate eventual descruction of lingering
27877 	 * memory regions in Windows. For memory window, it contains non-zero
27878 	 * HWID of a region this window was bound to (without the 8-bit key
27879 	 * portion). The host may check if the region is lingering in destroyed
27880 	 * state and try to destroy it now. For memory region, if deallocation
27881 	 * fails because there are windows bound to this region, this field will
27882 	 * contain approximate number of those windows. This number is read from
27883 	 * the context right before the deregistration is attempted and can
27884 	 * potentially be slightly different from the current number.
27885 	 */
27886 } __attribute__((packed));
27887 
27888 /* Register MR command response (16 bytes) */
27889 
27890 struct creq_register_mr_resp {
27891 	uint8_t type;
27892 	/*
27893 	 * This field indicates the exact type of the completion. By convention,
27894 	 * the LSB identifies the length of the record in 16B units. Even values
27895 	 * indicate 16B records. Odd values indicate 32B records.
27896 	 */
27897 	#define CREQ_REGISTER_MR_RESP_TYPE_MASK			UINT32_C(0x3f)
27898 	#define CREQ_REGISTER_MR_RESP_TYPE_SFT			0
27899 	/* QP Async Notification */
27900 	#define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27901 	#define CREQ_REGISTER_MR_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27902 	#define CREQ_REGISTER_MR_RESP_RESERVED2_SFT		6
27903 	uint8_t status;
27904 	/* Status of the response. */
27905 	uint16_t cookie;
27906 	/* Driver supplied handle to associate the command and the response. */
27907 	uint32_t xid;
27908 	/* L_KEY */
27909 	uint8_t v;
27910 	/*
27911 	 * This value is written by the NIC such that it will be different for
27912 	 * each pass through the completion queue. The even passes will write 1.
27913 	 * The odd passes will write 0.
27914 	 */
27915 	#define CREQ_REGISTER_MR_RESP_V				UINT32_C(0x1)
27916 	#define CREQ_REGISTER_MR_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27917 	#define CREQ_REGISTER_MR_RESP_RESERVED7_SFT		1
27918 	uint8_t event;
27919 	/* Event or command opcode. */
27920 	/* Register MR command response. */
27921 	#define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR	UINT32_C(0xf)
27922 	uint16_t reserved48[3];
27923 } __attribute__((packed));
27924 
27925 /* Deregister MR command response (16 bytes) */
27926 
27927 struct creq_deregister_mr_resp {
27928 	uint8_t type;
27929 	/*
27930 	 * This field indicates the exact type of the completion. By convention,
27931 	 * the LSB identifies the length of the record in 16B units. Even values
27932 	 * indicate 16B records. Odd values indicate 32B records.
27933 	 */
27934 	#define CREQ_DEREGISTER_MR_RESP_TYPE_MASK		UINT32_C(0x3f)
27935 	#define CREQ_DEREGISTER_MR_RESP_TYPE_SFT		0
27936 	/* QP Async Notification */
27937 	#define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27938 	#define CREQ_DEREGISTER_MR_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27939 	#define CREQ_DEREGISTER_MR_RESP_RESERVED2_SFT		6
27940 	uint8_t status;
27941 	/* Status of the response. */
27942 	uint16_t cookie;
27943 	/* Driver supplied handle to associate the command and the response. */
27944 	uint32_t xid;
27945 	/* L_KEY */
27946 	uint8_t v;
27947 	/*
27948 	 * This value is written by the NIC such that it will be different for
27949 	 * each pass through the completion queue. The even passes will write 1.
27950 	 * The odd passes will write 0.
27951 	 */
27952 	#define CREQ_DEREGISTER_MR_RESP_V			UINT32_C(0x1)
27953 	#define CREQ_DEREGISTER_MR_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27954 	#define CREQ_DEREGISTER_MR_RESP_RESERVED7_SFT		1
27955 	uint8_t event;
27956 	/* Event or command opcode. */
27957 	/* Deregister MR command response. */
27958 	#define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR	UINT32_C(0x10)
27959 	uint16_t reserved16;
27960 	uint32_t bound_windows;
27961 	/*
27962 	 * If deregister fails because there are windows bound to this region,
27963 	 * this field will contain approximate number of those windows. This
27964 	 * number is read from the context right before the deregistration is
27965 	 * attempted and can potentially be slightly different from the current
27966 	 * number.
27967 	 */
27968 } __attribute__((packed));
27969 
27970 /* Add GID command response (16 bytes) */
27971 
27972 struct creq_add_gid_resp {
27973 	uint8_t type;
27974 	/*
27975 	 * This field indicates the exact type of the completion. By convention,
27976 	 * the LSB identifies the length of the record in 16B units. Even values
27977 	 * indicate 16B records. Odd values indicate 32B records.
27978 	 */
27979 	#define CREQ_ADD_GID_RESP_TYPE_MASK			UINT32_C(0x3f)
27980 	#define CREQ_ADD_GID_RESP_TYPE_SFT			0
27981 	/* QP Async Notification */
27982 	#define CREQ_ADD_GID_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
27983 	#define CREQ_ADD_GID_RESP_RESERVED2_MASK		UINT32_C(0xc0)
27984 	#define CREQ_ADD_GID_RESP_RESERVED2_SFT			6
27985 	uint8_t status;
27986 	/* Status of the response. */
27987 	uint16_t cookie;
27988 	/* Driver supplied handle to associate the command and the response. */
27989 	uint32_t xid;
27990 	/* GID index */
27991 	uint8_t v;
27992 	/*
27993 	 * This value is written by the NIC such that it will be different for
27994 	 * each pass through the completion queue. The even passes will write 1.
27995 	 * The odd passes will write 0.
27996 	 */
27997 	#define CREQ_ADD_GID_RESP_V				UINT32_C(0x1)
27998 	#define CREQ_ADD_GID_RESP_RESERVED7_MASK		UINT32_C(0xfe)
27999 	#define CREQ_ADD_GID_RESP_RESERVED7_SFT			1
28000 	uint8_t event;
28001 	/* Event or command opcode. */
28002 	/* Add GID command response. */
28003 	#define CREQ_ADD_GID_RESP_EVENT_ADD_GID		UINT32_C(0x11)
28004 	uint16_t reserved48[3];
28005 } __attribute__((packed));
28006 
28007 /* Delete GID command response (16 bytes) */
28008 
28009 struct creq_delete_gid_resp {
28010 	uint8_t type;
28011 	/*
28012 	 * This field indicates the exact type of the completion. By convention,
28013 	 * the LSB identifies the length of the record in 16B units. Even values
28014 	 * indicate 16B records. Odd values indicate 32B records.
28015 	 */
28016 	#define CREQ_DELETE_GID_RESP_TYPE_MASK			UINT32_C(0x3f)
28017 	#define CREQ_DELETE_GID_RESP_TYPE_SFT			0
28018 	/* QP Async Notification */
28019 	#define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28020 	#define CREQ_DELETE_GID_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28021 	#define CREQ_DELETE_GID_RESP_RESERVED2_SFT		6
28022 	uint8_t status;
28023 	/* Status of the response. */
28024 	uint16_t cookie;
28025 	/* Driver supplied handle to associate the command and the response. */
28026 	uint32_t xid;
28027 	/* GID index */
28028 	uint8_t v;
28029 	/*
28030 	 * This value is written by the NIC such that it will be different for
28031 	 * each pass through the completion queue. The even passes will write 1.
28032 	 * The odd passes will write 0.
28033 	 */
28034 	#define CREQ_DELETE_GID_RESP_V				UINT32_C(0x1)
28035 	#define CREQ_DELETE_GID_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28036 	#define CREQ_DELETE_GID_RESP_RESERVED7_SFT		1
28037 	uint8_t event;
28038 	/* Event or command opcode. */
28039 	/* Delete GID command response. */
28040 	#define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID		UINT32_C(0x12)
28041 	uint16_t reserved48[3];
28042 } __attribute__((packed));
28043 
28044 /* Modify GID command response (16 bytes) */
28045 
28046 struct creq_modify_gid_resp {
28047 	uint8_t type;
28048 	/*
28049 	 * This field indicates the exact type of the completion. By convention,
28050 	 * the LSB identifies the length of the record in 16B units. Even values
28051 	 * indicate 16B records. Odd values indicate 32B records.
28052 	 */
28053 	#define CREQ_MODIFY_GID_RESP_TYPE_MASK			UINT32_C(0x3f)
28054 	#define CREQ_MODIFY_GID_RESP_TYPE_SFT			0
28055 	/* QP Async Notification */
28056 	#define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28057 	#define CREQ_MODIFY_GID_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28058 	#define CREQ_MODIFY_GID_RESP_RESERVED2_SFT		6
28059 	uint8_t status;
28060 	/* Status of the response. */
28061 	uint16_t cookie;
28062 	/* Driver supplied handle to associate the command and the response. */
28063 	uint32_t xid;
28064 	/* GID index */
28065 	uint8_t v;
28066 	/*
28067 	 * This value is written by the NIC such that it will be different for
28068 	 * each pass through the completion queue. The even passes will write 1.
28069 	 * The odd passes will write 0.
28070 	 */
28071 	#define CREQ_MODIFY_GID_RESP_V				UINT32_C(0x1)
28072 	#define CREQ_MODIFY_GID_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28073 	#define CREQ_MODIFY_GID_RESP_RESERVED7_SFT		1
28074 	uint8_t event;
28075 	/* Event or command opcode. */
28076 	/* Add GID command response. */
28077 	#define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID		UINT32_C(0x11)
28078 	uint16_t reserved48[3];
28079 } __attribute__((packed));
28080 
28081 /* Query GID command response (16 bytes) */
28082 
28083 struct creq_query_gid_resp {
28084 	uint8_t type;
28085 	/*
28086 	 * This field indicates the exact type of the completion. By convention,
28087 	 * the LSB identifies the length of the record in 16B units. Even values
28088 	 * indicate 16B records. Odd values indicate 32B records.
28089 	 */
28090 	#define CREQ_QUERY_GID_RESP_TYPE_MASK			UINT32_C(0x3f)
28091 	#define CREQ_QUERY_GID_RESP_TYPE_SFT			0
28092 	/* QP Async Notification */
28093 	#define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28094 	#define CREQ_QUERY_GID_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28095 	#define CREQ_QUERY_GID_RESP_RESERVED2_SFT		6
28096 	uint8_t status;
28097 	/* Status of the response. */
28098 	uint16_t cookie;
28099 	/* Driver supplied handle to associate the command and the response. */
28100 	uint32_t size;
28101 	/* Side buffer size in 16-byte units */
28102 	uint8_t v;
28103 	/*
28104 	 * This value is written by the NIC such that it will be different for
28105 	 * each pass through the completion queue. The even passes will write 1.
28106 	 * The odd passes will write 0.
28107 	 */
28108 	#define CREQ_QUERY_GID_RESP_V				UINT32_C(0x1)
28109 	#define CREQ_QUERY_GID_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28110 	#define CREQ_QUERY_GID_RESP_RESERVED7_SFT		1
28111 	uint8_t event;
28112 	/* Event or command opcode. */
28113 	/* Query GID command response. */
28114 	#define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID		UINT32_C(0x18)
28115 	uint16_t reserved48[3];
28116 } __attribute__((packed));
28117 
28118 /* Query GID command response side buffer structure (40 bytes) */
28119 
28120 struct creq_query_gid_resp_sb {
28121 	uint8_t opcode;
28122 	/* Command opcode. */
28123 	/* Query GID command response. */
28124 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID	UINT32_C(0x18)
28125 	uint8_t status;
28126 	/* Status of the response. */
28127 	uint16_t cookie;
28128 	/* Driver supplied handle to associate the command and the response. */
28129 	uint16_t flags;
28130 	/* Flags and attribs of the command. */
28131 	uint8_t resp_size;
28132 	/* Size of the response buffer in 16-byte units. */
28133 	uint8_t reserved8;
28134 	uint32_t gid[4];
28135 	/* GID */
28136 	uint16_t src_mac[3];
28137 	/* Source MAC. */
28138 	uint16_t vlan;
28139 	/* flags. */
28140 	/* Source VLAN id. */
28141 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK	UINT32_C(0xfff)
28142 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT		0
28143 	/* This set of bits select the TPID of the VLAN Tag. */
28144 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK		UINT32_C(0x7000)
28145 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT		12
28146 	/* TPID = 0x88A8. */
28147 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8	(UINT32_C(0x0) << 12)
28148 	/* TPID = 0x8100. */
28149 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100	(UINT32_C(0x1) << 12)
28150 	/* TPID = 0x9100. */
28151 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100	(UINT32_C(0x2) << 12)
28152 	/* TPID = 0x9200. */
28153 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200	(UINT32_C(0x3) << 12)
28154 	/* TPID = 0x9300. */
28155 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300	(UINT32_C(0x4) << 12)
28156 	/* TPID = Configurable 1. */
28157 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1	(UINT32_C(0x5) << 12)
28158 	/* TPID = Configurable 2. */
28159 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2	(UINT32_C(0x6) << 12)
28160 	/* TPID = Configurable 3. */
28161 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3	(UINT32_C(0x7) << 12)
28162 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST	CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
28163 	/*
28164 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
28165 	 * header.
28166 	 */
28167 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN		UINT32_C(0x8000)
28168 	uint16_t ipid;
28169 	/* Identifier field in the IP header. */
28170 	uint16_t gid_index;
28171 	/* GID index */
28172 	uint32_t unused_0;
28173 } __attribute__((packed));
28174 
28175 /* Create QP1 command response (16 bytes) */
28176 
28177 struct creq_create_qp1_resp {
28178 	uint8_t type;
28179 	/*
28180 	 * This field indicates the exact type of the completion. By convention,
28181 	 * the LSB identifies the length of the record in 16B units. Even values
28182 	 * indicate 16B records. Odd values indicate 32B records.
28183 	 */
28184 	#define CREQ_CREATE_QP1_RESP_TYPE_MASK			UINT32_C(0x3f)
28185 	#define CREQ_CREATE_QP1_RESP_TYPE_SFT			0
28186 	/* QP Async Notification */
28187 	#define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28188 	#define CREQ_CREATE_QP1_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28189 	#define CREQ_CREATE_QP1_RESP_RESERVED2_SFT		6
28190 	uint8_t status;
28191 	/* Status of the response. */
28192 	uint16_t cookie;
28193 	/* Driver supplied handle to associate the command and the response. */
28194 	uint32_t xid;
28195 	/* QP1 context id */
28196 	uint8_t v;
28197 	/*
28198 	 * This value is written by the NIC such that it will be different for
28199 	 * each pass through the completion queue. The even passes will write 1.
28200 	 * The odd passes will write 0.
28201 	 */
28202 	#define CREQ_CREATE_QP1_RESP_V				UINT32_C(0x1)
28203 	#define CREQ_CREATE_QP1_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28204 	#define CREQ_CREATE_QP1_RESP_RESERVED7_SFT		1
28205 	uint8_t event;
28206 	/* Event or command opcode. */
28207 	/* Create QP1 command response. */
28208 	#define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1		UINT32_C(0x13)
28209 	uint16_t reserved48[3];
28210 } __attribute__((packed));
28211 
28212 /* Destroy QP1 command response (16 bytes) */
28213 
28214 struct creq_destroy_qp1_resp {
28215 	uint8_t type;
28216 	/*
28217 	 * This field indicates the exact type of the completion. By convention,
28218 	 * the LSB identifies the length of the record in 16B units. Even values
28219 	 * indicate 16B records. Odd values indicate 32B records.
28220 	 */
28221 	#define CREQ_DESTROY_QP1_RESP_TYPE_MASK			UINT32_C(0x3f)
28222 	#define CREQ_DESTROY_QP1_RESP_TYPE_SFT			0
28223 	/* QP Async Notification */
28224 	#define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28225 	#define CREQ_DESTROY_QP1_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28226 	#define CREQ_DESTROY_QP1_RESP_RESERVED2_SFT		6
28227 	uint8_t status;
28228 	/* Status of the response. */
28229 	uint16_t cookie;
28230 	/* Driver supplied handle to associate the command and the response. */
28231 	uint32_t xid;
28232 	/* QP1 context id */
28233 	uint8_t v;
28234 	/*
28235 	 * This value is written by the NIC such that it will be different for
28236 	 * each pass through the completion queue. The even passes will write 1.
28237 	 * The odd passes will write 0.
28238 	 */
28239 	#define CREQ_DESTROY_QP1_RESP_V				UINT32_C(0x1)
28240 	#define CREQ_DESTROY_QP1_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28241 	#define CREQ_DESTROY_QP1_RESP_RESERVED7_SFT		1
28242 	uint8_t event;
28243 	/* Event or command opcode. */
28244 	/* Destroy QP1 command response. */
28245 	#define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1	UINT32_C(0x14)
28246 	uint16_t reserved48[3];
28247 } __attribute__((packed));
28248 
28249 /* Create AH command response (16 bytes) */
28250 
28251 struct creq_create_ah_resp {
28252 	uint8_t type;
28253 	/*
28254 	 * This field indicates the exact type of the completion. By convention,
28255 	 * the LSB identifies the length of the record in 16B units. Even values
28256 	 * indicate 16B records. Odd values indicate 32B records.
28257 	 */
28258 	#define CREQ_CREATE_AH_RESP_TYPE_MASK			UINT32_C(0x3f)
28259 	#define CREQ_CREATE_AH_RESP_TYPE_SFT			0
28260 	/* QP Async Notification */
28261 	#define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28262 	#define CREQ_CREATE_AH_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28263 	#define CREQ_CREATE_AH_RESP_RESERVED2_SFT		6
28264 	uint8_t status;
28265 	/* Status of the response. */
28266 	uint16_t cookie;
28267 	/* Driver supplied handle to associate the command and the response. */
28268 	uint32_t xid;
28269 	/* AH context id */
28270 	uint8_t v;
28271 	/*
28272 	 * This value is written by the NIC such that it will be different for
28273 	 * each pass through the completion queue. The even passes will write 1.
28274 	 * The odd passes will write 0.
28275 	 */
28276 	#define CREQ_CREATE_AH_RESP_V				UINT32_C(0x1)
28277 	#define CREQ_CREATE_AH_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28278 	#define CREQ_CREATE_AH_RESP_RESERVED7_SFT		1
28279 	uint8_t event;
28280 	/* Event or command opcode. */
28281 	/* Create AH command response. */
28282 	#define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH		UINT32_C(0x15)
28283 	uint16_t reserved48[3];
28284 } __attribute__((packed));
28285 
28286 /* Destroy AH command response (16 bytes) */
28287 
28288 struct creq_destroy_ah_resp {
28289 	uint8_t type;
28290 	/*
28291 	 * This field indicates the exact type of the completion. By convention,
28292 	 * the LSB identifies the length of the record in 16B units. Even values
28293 	 * indicate 16B records. Odd values indicate 32B records.
28294 	 */
28295 	#define CREQ_DESTROY_AH_RESP_TYPE_MASK			UINT32_C(0x3f)
28296 	#define CREQ_DESTROY_AH_RESP_TYPE_SFT			0
28297 	/* QP Async Notification */
28298 	#define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28299 	#define CREQ_DESTROY_AH_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28300 	#define CREQ_DESTROY_AH_RESP_RESERVED2_SFT		6
28301 	uint8_t status;
28302 	/* Status of the response. */
28303 	uint16_t cookie;
28304 	/* Driver supplied handle to associate the command and the response. */
28305 	uint32_t xid;
28306 	/* AH context id */
28307 	uint8_t v;
28308 	/*
28309 	 * This value is written by the NIC such that it will be different for
28310 	 * each pass through the completion queue. The even passes will write 1.
28311 	 * The odd passes will write 0.
28312 	 */
28313 	#define CREQ_DESTROY_AH_RESP_V				UINT32_C(0x1)
28314 	#define CREQ_DESTROY_AH_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28315 	#define CREQ_DESTROY_AH_RESP_RESERVED7_SFT		1
28316 	uint8_t event;
28317 	/* Event or command opcode. */
28318 	/* Destroy AH command response. */
28319 	#define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH		UINT32_C(0x16)
28320 	uint16_t reserved48[3];
28321 } __attribute__((packed));
28322 
28323 /* Initialize Firmware command response (16 bytes) */
28324 
28325 struct creq_initialize_fw_resp {
28326 	uint8_t type;
28327 	/*
28328 	 * This field indicates the exact type of the completion. By convention,
28329 	 * the LSB identifies the length of the record in 16B units. Even values
28330 	 * indicate 16B records. Odd values indicate 32B records.
28331 	 */
28332 	#define CREQ_INITIALIZE_FW_RESP_TYPE_MASK		UINT32_C(0x3f)
28333 	#define CREQ_INITIALIZE_FW_RESP_TYPE_SFT		0
28334 	/* QP Async Notification */
28335 	#define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28336 	#define CREQ_INITIALIZE_FW_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28337 	#define CREQ_INITIALIZE_FW_RESP_RESERVED2_SFT		6
28338 	uint8_t status;
28339 	/* Status of the response. */
28340 	uint16_t cookie;
28341 	/* Driver supplied handle to associate the command and the response. */
28342 	uint32_t reserved32;
28343 	uint8_t v;
28344 	/*
28345 	 * This value is written by the NIC such that it will be different for
28346 	 * each pass through the completion queue. The even passes will write 1.
28347 	 * The odd passes will write 0.
28348 	 */
28349 	#define CREQ_INITIALIZE_FW_RESP_V			UINT32_C(0x1)
28350 	#define CREQ_INITIALIZE_FW_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28351 	#define CREQ_INITIALIZE_FW_RESP_RESERVED7_SFT		1
28352 	uint8_t event;
28353 	/* Event or command opcode. */
28354 	/* Initialize firmware command response. */
28355 	#define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW	UINT32_C(0x80)
28356 	uint16_t reserved48[3];
28357 } __attribute__((packed));
28358 
28359 /* De-initialize Firmware command response (16 bytes) */
28360 
28361 struct creq_deinitialize_fw_resp {
28362 	uint8_t type;
28363 	/*
28364 	 * This field indicates the exact type of the completion. By convention,
28365 	 * the LSB identifies the length of the record in 16B units. Even values
28366 	 * indicate 16B records. Odd values indicate 32B records.
28367 	 */
28368 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK		UINT32_C(0x3f)
28369 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT		0
28370 	/* QP Async Notification */
28371 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT	UINT32_C(0x38)
28372 	#define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_MASK	UINT32_C(0xc0)
28373 	#define CREQ_DEINITIALIZE_FW_RESP_RESERVED2_SFT		6
28374 	uint8_t status;
28375 	/* Status of the response. */
28376 	uint16_t cookie;
28377 	/* Driver supplied handle to associate the command and the response. */
28378 	uint32_t reserved32;
28379 	uint8_t v;
28380 	/*
28381 	 * This value is written by the NIC such that it will be different for
28382 	 * each pass through the completion queue. The even passes will write 1.
28383 	 * The odd passes will write 0.
28384 	 */
28385 	#define CREQ_DEINITIALIZE_FW_RESP_V			UINT32_C(0x1)
28386 	#define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_MASK	UINT32_C(0xfe)
28387 	#define CREQ_DEINITIALIZE_FW_RESP_RESERVED7_SFT		1
28388 	uint8_t event;
28389 	/* Event or command opcode. */
28390 	/* De-initialize firmware command response. */
28391 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW   UINT32_C(0x81)
28392 	uint16_t reserved48[3];
28393 } __attribute__((packed));
28394 
28395 /* Stop function command response (16 bytes) */
28396 
28397 struct creq_stop_func_resp {
28398 	uint8_t type;
28399 	/*
28400 	 * This field indicates the exact type of the completion. By convention,
28401 	 * the LSB identifies the length of the record in 16B units. Even values
28402 	 * indicate 16B records. Odd values indicate 32B records.
28403 	 */
28404 	#define CREQ_STOP_FUNC_RESP_TYPE_MASK			UINT32_C(0x3f)
28405 	#define CREQ_STOP_FUNC_RESP_TYPE_SFT			0
28406 	/* QP Async Notification */
28407 	#define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28408 	#define CREQ_STOP_FUNC_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28409 	#define CREQ_STOP_FUNC_RESP_RESERVED2_SFT		6
28410 	uint8_t status;
28411 	/* Status of the response. */
28412 	uint16_t cookie;
28413 	/* Driver supplied handle to associate the command and the response. */
28414 	uint32_t reserved32;
28415 	uint8_t v;
28416 	/*
28417 	 * This value is written by the NIC such that it will be different for
28418 	 * each pass through the completion queue. The even passes will write 1.
28419 	 * The odd passes will write 0.
28420 	 */
28421 	#define CREQ_STOP_FUNC_RESP_V				UINT32_C(0x1)
28422 	#define CREQ_STOP_FUNC_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28423 	#define CREQ_STOP_FUNC_RESP_RESERVED7_SFT		1
28424 	uint8_t event;
28425 	/* Event or command opcode. */
28426 	/* Stop PF command response. */
28427 	#define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC		UINT32_C(0x82)
28428 	uint16_t reserved48[3];
28429 } __attribute__((packed));
28430 
28431 /* Query function command response (16 bytes) */
28432 
28433 struct creq_query_func_resp {
28434 	uint8_t type;
28435 	/*
28436 	 * This field indicates the exact type of the completion. By convention,
28437 	 * the LSB identifies the length of the record in 16B units. Even values
28438 	 * indicate 16B records. Odd values indicate 32B records.
28439 	 */
28440 	#define CREQ_QUERY_FUNC_RESP_TYPE_MASK			UINT32_C(0x3f)
28441 	#define CREQ_QUERY_FUNC_RESP_TYPE_SFT			0
28442 	/* QP Async Notification */
28443 	#define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28444 	#define CREQ_QUERY_FUNC_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28445 	#define CREQ_QUERY_FUNC_RESP_RESERVED2_SFT		6
28446 	uint8_t status;
28447 	/* Status of the response. */
28448 	uint16_t cookie;
28449 	/* Driver supplied handle to associate the command and the response. */
28450 	uint32_t size;
28451 	/* Side buffer size in 16-byte units */
28452 	uint8_t v;
28453 	/*
28454 	 * This value is written by the NIC such that it will be different for
28455 	 * each pass through the completion queue. The even passes will write 1.
28456 	 * The odd passes will write 0.
28457 	 */
28458 	#define CREQ_QUERY_FUNC_RESP_V				UINT32_C(0x1)
28459 	#define CREQ_QUERY_FUNC_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28460 	#define CREQ_QUERY_FUNC_RESP_RESERVED7_SFT		1
28461 	uint8_t event;
28462 	/* Event or command opcode. */
28463 	/* Query info PF command response. */
28464 	#define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC		UINT32_C(0x83)
28465 	uint16_t reserved48[3];
28466 } __attribute__((packed));
28467 
28468 /* Query function command response side buffer structure (88 bytes) */
28469 
28470 struct creq_query_func_resp_sb {
28471 	uint8_t opcode;
28472 	/* Command opcode. */
28473 	/* Query info PF command response. */
28474 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC	UINT32_C(0x83)
28475 	uint8_t status;
28476 	/* Status of the response. */
28477 	uint16_t cookie;
28478 	/* Driver supplied handle to associate the command and the response. */
28479 	uint16_t flags;
28480 	/* Flags and attribs of the command. */
28481 	uint8_t resp_size;
28482 	/* Size of the response buffer in 16-byte units. */
28483 	uint8_t reserved8;
28484 	uint64_t max_mr_size;
28485 	/* Max MR size supported. */
28486 	uint32_t max_qp;
28487 	/* Max QP supported. */
28488 	uint16_t max_qp_wr;
28489 	/* Max WQEs per QP. */
28490 	uint16_t dev_cap_flags;
28491 	/* Device capability flags. */
28492 	/* Allow QP resizing. */
28493 	#define CREQ_QUERY_FUNC_RESP_SB_DEV_CAP_FLAGS_RESIZE_QP   UINT32_C(0x1)
28494 	uint32_t max_cq;
28495 	/* Max CQs supported. */
28496 	uint32_t max_cqe;
28497 	/* Max CQEs per CQ supported. */
28498 	uint32_t max_pd;
28499 	/* Max PDs supported. */
28500 	uint8_t max_sge;
28501 	/* Max SGEs per QP WQE supported. */
28502 	uint8_t max_srq_sge;
28503 	/* Max SGEs per SRQ WQE supported. */
28504 	uint8_t max_qp_rd_atom;
28505 	/* Max outstanding RDMA read & atomic supported. */
28506 	uint8_t max_qp_init_rd_atom;
28507 	/*
28508 	 * Max outstanding RDMA read & atomic that can be sent from an
28509 	 * initiator.
28510 	 */
28511 	uint32_t max_mr;
28512 	/* Max MRs supported. */
28513 	uint32_t max_mw;
28514 	/* Max MWs supported. */
28515 	uint32_t max_raw_eth_qp;
28516 	/* Max Raw Ethertype QPs supported. */
28517 	uint32_t max_ah;
28518 	/* Max AHs supported. */
28519 	uint32_t max_fmr;
28520 	/* Max FMRs supported. */
28521 	uint32_t max_srq_wr;
28522 	/* Max WQEs per SRQ supported. */
28523 	uint32_t max_pkeys;
28524 	/* Max PKEYs supported. */
28525 	uint32_t max_inline_data;
28526 	/* Max inline data supported. */
28527 	uint8_t max_map_per_fmr;
28528 	/* Max mappings per FMR supported. */
28529 	uint8_t l2_db_space_size;
28530 	/* L2 DB space size in pages. */
28531 	uint16_t max_srq;
28532 	/* Max SRQs supported. */
28533 	uint32_t max_gid;
28534 	/* Max GIDs supported. */
28535 	uint32_t tqm_alloc_reqs[12];
28536 	/*
28537 	 * An array of 48 8-bit values to specify allocation multiplier for TQM
28538 	 * host buffer regions. Each region occupies 16 MB of TQM PBL address
28539 	 * space: 0x00000000, 0x01000000, 0x02000000, etc. The host needs to
28540 	 * allocate (<Number of QPs>*multiplier, rounded up to page size) of
28541 	 * physical memory for non-zero slots and map the pages to the
28542 	 * corresponding 16MB regions. Typically there are total 3 non-zero
28543 	 * values in this array, their values are 16, 16, 12. Cu+ will only
28544 	 * populate up to index 11. SR may populate up to index 47.
28545 	 */
28546 } __attribute__((packed));
28547 
28548 /* Set resources command response (16 bytes) */
28549 
28550 struct creq_set_func_resources_resp {
28551 	uint8_t type;
28552 	/*
28553 	 * This field indicates the exact type of the completion. By convention,
28554 	 * the LSB identifies the length of the record in 16B units. Even values
28555 	 * indicate 16B records. Odd values indicate 32B records.
28556 	 */
28557 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK		UINT32_C(0x3f)
28558 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT		0
28559 	/* QP Async Notification */
28560 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT	UINT32_C(0x38)
28561 	#define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_MASK	UINT32_C(0xc0)
28562 	#define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED2_SFT	6
28563 	uint8_t status;
28564 	/* Status of the response. */
28565 	uint16_t cookie;
28566 	/* Driver supplied handle to associate the command and the response. */
28567 	uint32_t reserved32;
28568 	uint8_t v;
28569 	/*
28570 	 * This value is written by the NIC such that it will be different for
28571 	 * each pass through the completion queue. The even passes will write 1.
28572 	 * The odd passes will write 0.
28573 	 */
28574 	#define CREQ_SET_FUNC_RESOURCES_RESP_V			UINT32_C(0x1)
28575 	#define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_MASK	UINT32_C(0xfe)
28576 	#define CREQ_SET_FUNC_RESOURCES_RESP_RESERVED7_SFT	1
28577 	uint8_t event;
28578 	/* Event or command opcode. */
28579 	/* Set function resources command response. */
28580 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES UINT32_C(0x84)
28581 	uint16_t reserved48[3];
28582 } __attribute__((packed));
28583 
28584 /* Map TC to COS response (16 bytes) */
28585 
28586 struct creq_map_tc_to_cos_resp {
28587 	uint8_t type;
28588 	/*
28589 	 * This field indicates the exact type of the completion. By convention,
28590 	 * the LSB identifies the length of the record in 16B units. Even values
28591 	 * indicate 16B records. Odd values indicate 32B records.
28592 	 */
28593 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK		UINT32_C(0x3f)
28594 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT		0
28595 	/* QP Async Notification */
28596 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28597 	#define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28598 	#define CREQ_MAP_TC_TO_COS_RESP_RESERVED2_SFT		6
28599 	uint8_t status;
28600 	/* Status of the response. */
28601 	uint16_t cookie;
28602 	/* Driver supplied handle to associate the command and the response. */
28603 	uint32_t reserved32;
28604 	uint8_t v;
28605 	/*
28606 	 * This value is written by the NIC such that it will be different for
28607 	 * each pass through the completion queue. The even passes will write 1.
28608 	 * The odd passes will write 0.
28609 	 */
28610 	#define CREQ_MAP_TC_TO_COS_RESP_V			UINT32_C(0x1)
28611 	#define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28612 	#define CREQ_MAP_TC_TO_COS_RESP_RESERVED7_SFT		1
28613 	uint8_t event;
28614 	/* Event or command opcode. */
28615 	/* Map TC to COS response. */
28616 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS	UINT32_C(0x8a)
28617 	uint16_t reserved48[3];
28618 } __attribute__((packed));
28619 
28620 /* Query version response (16 bytes) */
28621 
28622 struct creq_query_version_resp {
28623 	uint8_t type;
28624 	/*
28625 	 * This field indicates the exact type of the completion. By convention,
28626 	 * the LSB identifies the length of the record in 16B units. Even values
28627 	 * indicate 16B records. Odd values indicate 32B records.
28628 	 */
28629 	#define CREQ_QUERY_VERSION_RESP_TYPE_MASK		UINT32_C(0x3f)
28630 	#define CREQ_QUERY_VERSION_RESP_TYPE_SFT		0
28631 	/* QP Async Notification */
28632 	#define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28633 	#define CREQ_QUERY_VERSION_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28634 	#define CREQ_QUERY_VERSION_RESP_RESERVED2_SFT		6
28635 	uint8_t status;
28636 	/* Status of the response. */
28637 	uint16_t cookie;
28638 	/* Driver supplied handle to associate the command and the response. */
28639 	uint8_t fw_maj;
28640 	/* firmware major version */
28641 	uint8_t fw_minor;
28642 	/* firmware minor version */
28643 	uint8_t fw_bld;
28644 	/* firmware build version */
28645 	uint8_t fw_rsvd;
28646 	/* firmware reserved version */
28647 	uint8_t v;
28648 	/*
28649 	 * This value is written by the NIC such that it will be different for
28650 	 * each pass through the completion queue. The even passes will write 1.
28651 	 * The odd passes will write 0.
28652 	 */
28653 	#define CREQ_QUERY_VERSION_RESP_V			UINT32_C(0x1)
28654 	#define CREQ_QUERY_VERSION_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28655 	#define CREQ_QUERY_VERSION_RESP_RESERVED7_SFT		1
28656 	uint8_t event;
28657 	/* Event or command opcode. */
28658 	/* Query firmware and interface version response. */
28659 	#define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION	UINT32_C(0x8b)
28660 	uint16_t reserved16;
28661 	uint8_t intf_maj;
28662 	/* interface major version */
28663 	uint8_t intf_minor;
28664 	/* interface minor version */
28665 	uint8_t intf_bld;
28666 	/* interface build version */
28667 	uint8_t intf_rsvd;
28668 	/* interface reserved version */
28669 } __attribute__((packed));
28670 
28671 /* Modify congestion control command response (16 bytes) */
28672 
28673 struct creq_modify_roce_cc_resp {
28674 	uint8_t type;
28675 	/*
28676 	 * This field indicates the exact type of the completion. By convention,
28677 	 * the LSB identifies the length of the record in 16B units. Even values
28678 	 * indicate 16B records. Odd values indicate 32B records.
28679 	 */
28680 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK		UINT32_C(0x3f)
28681 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT		0
28682 	/* QP Async Notification */
28683 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28684 	#define CREQ_MODIFY_ROCE_CC_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28685 	#define CREQ_MODIFY_ROCE_CC_RESP_RESERVED2_SFT		6
28686 	uint8_t status;
28687 	/* Status of the response. */
28688 	uint16_t cookie;
28689 	/* Driver supplied handle to associate the command and the response. */
28690 	uint32_t reserved32;
28691 	uint8_t v;
28692 	/*
28693 	 * This value is written by the NIC such that it will be different for
28694 	 * each pass through the completion queue. The even passes will write 1.
28695 	 * The odd passes will write 0.
28696 	 */
28697 	#define CREQ_MODIFY_ROCE_CC_RESP_V			UINT32_C(0x1)
28698 	#define CREQ_MODIFY_ROCE_CC_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28699 	#define CREQ_MODIFY_ROCE_CC_RESP_RESERVED7_SFT		1
28700 	uint8_t event;
28701 	/* Event or command opcode. */
28702 	/* Modify congestion control response. */
28703 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC	UINT32_C(0x8c)
28704 	uint16_t reserved48[3];
28705 } __attribute__((packed));
28706 
28707 /* Query congestion control command response (16 bytes) */
28708 
28709 struct creq_query_roce_cc_resp {
28710 	uint8_t type;
28711 	/*
28712 	 * This field indicates the exact type of the completion. By convention,
28713 	 * the LSB identifies the length of the record in 16B units. Even values
28714 	 * indicate 16B records. Odd values indicate 32B records.
28715 	 */
28716 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK		UINT32_C(0x3f)
28717 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT		0
28718 	/* QP Async Notification */
28719 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT		UINT32_C(0x38)
28720 	#define CREQ_QUERY_ROCE_CC_RESP_RESERVED2_MASK		UINT32_C(0xc0)
28721 	#define CREQ_QUERY_ROCE_CC_RESP_RESERVED2_SFT		6
28722 	uint8_t status;
28723 	/* Status of the response. */
28724 	uint16_t cookie;
28725 	/* Driver supplied handle to associate the command and the response. */
28726 	uint32_t size;
28727 	/* Side buffer size in 16-byte units */
28728 	uint8_t v;
28729 	/*
28730 	 * This value is written by the NIC such that it will be different for
28731 	 * each pass through the completion queue. The even passes will write 1.
28732 	 * The odd passes will write 0.
28733 	 */
28734 	#define CREQ_QUERY_ROCE_CC_RESP_V			UINT32_C(0x1)
28735 	#define CREQ_QUERY_ROCE_CC_RESP_RESERVED7_MASK		UINT32_C(0xfe)
28736 	#define CREQ_QUERY_ROCE_CC_RESP_RESERVED7_SFT		1
28737 	uint8_t event;
28738 	/* Event or command opcode. */
28739 	/* Query congestion control response. */
28740 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC	UINT32_C(0x8d)
28741 	uint16_t reserved48[3];
28742 } __attribute__((packed));
28743 
28744 /* Query congestion control command response side buffer structure (32 bytes) */
28745 
28746 struct creq_query_roce_cc_resp_sb {
28747 	uint8_t opcode;
28748 	/* Command opcode. */
28749 	/* Query congestion control response. */
28750 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC   UINT32_C(0x8d)
28751 	uint8_t status;
28752 	/* Status of the response. */
28753 	uint16_t cookie;
28754 	/* Driver supplied handle to associate the command and the response. */
28755 	uint16_t flags;
28756 	/* Flags and attribs of the command. */
28757 	uint8_t resp_size;
28758 	/* Size of the response buffer in 16-byte units. */
28759 	uint8_t reserved8;
28760 	uint8_t enable_cc;
28761 	/* unused7 is 7 b */
28762 	/* Enable. */
28763 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC		UINT32_C(0x1)
28764 	/* unused7 is 7 b */
28765 	uint8_t tos_dscp_tos_ecn;
28766 	/* IP TOS DSCP. */
28767 	/* IP TOS ECN. */
28768 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK		UINT32_C(0x3)
28769 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT		0
28770 	/* IP TOS DSCP. */
28771 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK	UINT32_C(0xfc)
28772 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT		2
28773 	uint8_t g;
28774 	/* unused5 is 5 b */
28775 	/* Congestion Probability averaging factor. */
28776 	#define CREQ_QUERY_ROCE_CC_RESP_SB_G_MASK		UINT32_C(0x7)
28777 	#define CREQ_QUERY_ROCE_CC_RESP_SB_G_SFT		0
28778 	/* unused5 is 5 b */
28779 	uint8_t num_phases_per_state;
28780 	/* Number of phases in Fast Recovery and Active Increase. */
28781 	uint16_t init_cr;
28782 	/* The starting value of rate. */
28783 	uint16_t init_tr;
28784 	/* The starting value of target rate. */
28785 	uint8_t alt_vlan_pcp;
28786 	/* rsvd1 is 5 b */
28787 	/* Alternate vlan pcp value for CNP packets. */
28788 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK	UINT32_C(0x7)
28789 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT	0
28790 	/* rsvd1 is 5 b */
28791 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK		UINT32_C(0xf8)
28792 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT		3
28793 	uint8_t alt_tos_dscp;
28794 	/* rsvd4 is 2 b */
28795 	/* Alternate IP TOS DSCP. */
28796 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK	UINT32_C(0x3f)
28797 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT	0
28798 	/* rsvd4 is 2 b */
28799 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK		UINT32_C(0xc0)
28800 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT		6
28801 	uint8_t cc_mode;
28802 	/* rsvd2 is 7 b */
28803 	/* 0 for DCTCP , 1 for TCP */
28804 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE		UINT32_C(0x1)
28805 	/* rsvd2 is 7 b */
28806 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD2_MASK		UINT32_C(0xfe)
28807 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD2_SFT		1
28808 	uint8_t tx_queue;
28809 	/* rsvd3 is 6 b */
28810 	/* Specifies the RoCE Tx Queue ( o to 3) to use for sending CNP packets */
28811 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TX_QUEUE_MASK	UINT32_C(0x3)
28812 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TX_QUEUE_SFT		0
28813 	/* rsvd3 is 6 b */
28814 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD3_MASK		UINT32_C(0xfc)
28815 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD3_SFT		2
28816 	uint16_t rtt;
28817 	/* rsvd5 is 2 b */
28818 	/* Round trip time in units of usecs */
28819 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK		UINT32_C(0x3fff)
28820 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT		0
28821 	/* rsvd5 is 2 b */
28822 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK		UINT32_C(0xc000)
28823 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT		14
28824 	uint16_t tcp_cp;
28825 	/* rsvd6 is 6 b */
28826 	/* The value used as CP when cc_mode is 1(TCP) */
28827 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK		UINT32_C(0x3ff)
28828 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT		0
28829 	/* rsvd6 is 6 b */
28830 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK		UINT32_C(0xfc00)
28831 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT		10
28832 	uint16_t inactivity_th;
28833 	/* Inactivity time after which QP CC parameters are initialized */
28834 	uint16_t reserved16;
28835 	uint32_t reserved32;
28836 } __attribute__((packed));
28837 
28838 /* QP error notification event (16 bytes) */
28839 
28840 struct creq_qp_error_notification {
28841 	uint8_t type;
28842 	/*
28843 	 * This field indicates the exact type of the completion. By convention,
28844 	 * the LSB identifies the length of the record in 16B units. Even values
28845 	 * indicate 16B records. Odd values indicate 32B records.
28846 	 */
28847 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK		UINT32_C(0x3f)
28848 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT		0
28849 	/* QP Async Notification */
28850 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT	UINT32_C(0x38)
28851 	#define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_MASK	UINT32_C(0xc0)
28852 	#define CREQ_QP_ERROR_NOTIFICATION_RESERVED2_SFT	6
28853 	uint8_t status;
28854 	/* Status of the response. */
28855 	uint8_t req_slow_path_state;
28856 	/* requestor slow path state */
28857 	uint8_t req_err_state_reason;
28858 	/* requestor error reason */
28859 	uint32_t xid;
28860 	/* QP context id */
28861 	uint8_t v;
28862 	/*
28863 	 * This value is written by the NIC such that it will be different for
28864 	 * each pass through the completion queue. The even passes will write 1.
28865 	 * The odd passes will write 0.
28866 	 */
28867 	#define CREQ_QP_ERROR_NOTIFICATION_V			UINT32_C(0x1)
28868 	#define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_MASK	UINT32_C(0xfe)
28869 	#define CREQ_QP_ERROR_NOTIFICATION_RESERVED7_SFT	1
28870 	uint8_t event;
28871 	/* Event or command opcode. */
28872 	/* QP error notification event. */
28873 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
28874 	uint8_t res_slow_path_state;
28875 	/* responder slow path state */
28876 	uint8_t res_err_state_reason;
28877 	uint16_t sq_cons_idx;
28878 	/*
28879 	 * Final SQ Consumer Index value. Any additional SQ WQEs will have to be
28880 	 * completed by the user provider.
28881 	 */
28882 	uint16_t rq_cons_idx;
28883 	/*
28884 	 * Final RQ Consumer Index value. Any additional RQ WQEs will have to be
28885 	 * completed by the user provider.
28886 	 */
28887 } __attribute__((packed));
28888 
28889 /* RoCE Slowpath Data Structures */
28890 /*
28891  * Note: This section documents the Host Structures used between software and
28892  * RoCE control firmware.
28893  */
28894 /* hwrm_selftest_qlist */
28895 /*
28896  * Description: This function is called by a driver to determine which selftests
28897  * are available to be run against the requested function.
28898  */
28899 /* Input (16 bytes) */
28900 
28901 struct hwrm_selftest_qlist_input {
28902 	uint16_t req_type;
28903 	/*
28904 	 * This value indicates what type of request this is. The format for the
28905 	 * rest of the command is determined by this field.
28906 	 */
28907 	uint16_t cmpl_ring;
28908 	/*
28909 	 * This value indicates the what completion ring the request will be
28910 	 * optionally completed on. If the value is -1, then no CR completion
28911 	 * will be generated. Any other value must be a valid CR ring_id value
28912 	 * for this function.
28913 	 */
28914 	uint16_t seq_id;
28915 	/* This value indicates the command sequence number. */
28916 	uint16_t target_id;
28917 	/*
28918 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
28919 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
28920 	 */
28921 	uint64_t resp_addr;
28922 	/*
28923 	 * This is the host address where the response will be written when the
28924 	 * request is complete. This area must be 16B aligned and must be
28925 	 * cleared to zero before the request is made.
28926 	 */
28927 } __attribute__((packed));
28928 
28929 /* Output (272 bytes) */
28930 
28931 struct hwrm_selftest_qlist_output {
28932 	uint16_t error_code;
28933 	/*
28934 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
28935 	 * and fail the call with an error when appropriate
28936 	 */
28937 	uint16_t req_type;
28938 	/* This field returns the type of original request. */
28939 	uint16_t seq_id;
28940 	/* This field provides original sequence number of the command. */
28941 	uint16_t resp_len;
28942 	/*
28943 	 * This field is the length of the response in bytes. The last byte of
28944 	 * the response is a valid flag that will read as '1' when the command
28945 	 * has been completely written to memory.
28946 	 */
28947 	uint8_t num_tests;
28948 	/*
28949 	 * This field represents the number of tests available to be requested
28950 	 * by a driver.
28951 	 */
28952 	uint8_t available_tests;
28953 	/* This field indicates which self-test is available to be run. */
28954 	/* Can run the NVM test. */
28955 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_NVM_TEST UINT32_C(0x1)
28956 	/* Can run the link test. */
28957 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_LINK_TEST UINT32_C(0x2)
28958 	/* Can run the register test. */
28959 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_REGISTER_TEST UINT32_C(0x4)
28960 	/* Can run the memory test. */
28961 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_MEMORY_TEST UINT32_C(0x8)
28962 	/* Can run the PCIe serdes test. */
28963 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_PCIE_SERDES_TEST UINT32_C(0x10)
28964 	/* Can run the Ethernet serdes test. */
28965 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_ETHERNET_SERDES_TEST UINT32_C(0x20)
28966 	uint8_t offline_tests;
28967 	/* The NVM test is an offline test. */
28968 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_NVM_TEST  UINT32_C(0x1)
28969 	/* The link test is an offline test. */
28970 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_LINK_TEST UINT32_C(0x2)
28971 	/* The register test is an offline test. */
28972 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_REGISTER_TEST UINT32_C(0x4)
28973 	/* The memory test is an offline test. */
28974 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_MEMORY_TEST UINT32_C(0x8)
28975 	/* The PCIe serdes test is an offline test. */
28976 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_PCIE_SERDES_TEST UINT32_C(0x10)
28977 	/* The Ethernet serdes test is an offline test. */
28978 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_ETHERNET_SERDES_TEST UINT32_C(0x20)
28979 	uint8_t unused_0;
28980 	uint16_t test_timeout;
28981 	/*
28982 	 * This field represents the the maximum timeout for all the tests to
28983 	 * complete in milliseconds.
28984 	 */
28985 	uint8_t unused_1;
28986 	uint8_t unused_2;
28987 	char test0_name[32];
28988 	/*
28989 	 * This field represents the name of the NVM test (ASCII chars with NULL
28990 	 * at the end).
28991 	 */
28992 	char test1_name[32];
28993 	/*
28994 	 * This field represents the name of the link test (ASCII chars with
28995 	 * NULL at the end).
28996 	 */
28997 	char test2_name[32];
28998 	/*
28999 	 * This field represents the name of the register test (ASCII chars with
29000 	 * NULL at the end).
29001 	 */
29002 	char test3_name[32];
29003 	/*
29004 	 * This field represents the name of the memory test (ASCII chars with
29005 	 * NULL at the end).
29006 	 */
29007 	char test4_name[32];
29008 	/*
29009 	 * This field represents the name of the PCIe serdes test (ASCII chars
29010 	 * with NULL at the end).
29011 	 */
29012 	char test5_name[32];
29013 	/*
29014 	 * This field represents the name of the Ethernet serdes test (ASCII
29015 	 * chars with NULL at the end).
29016 	 */
29017 	char test6_name[32];
29018 	/*
29019 	 * This field represents the name of some future test (ASCII chars with
29020 	 * NULL at the end).
29021 	 */
29022 	char test7_name[32];
29023 	/*
29024 	 * This field represents the name of some future test (ASCII chars with
29025 	 * NULL at the end).
29026 	 */
29027 } __attribute__((packed));
29028 
29029 /* hwrm_selftest_exec */
29030 /*
29031  * Description: This function is called by a driver to request which self tests
29032  * are to be run.
29033  */
29034 /* Input (24 bytes) */
29035 
29036 struct hwrm_selftest_exec_input {
29037 	uint16_t req_type;
29038 	/*
29039 	 * This value indicates what type of request this is. The format for the
29040 	 * rest of the command is determined by this field.
29041 	 */
29042 	uint16_t cmpl_ring;
29043 	/*
29044 	 * This value indicates the what completion ring the request will be
29045 	 * optionally completed on. If the value is -1, then no CR completion
29046 	 * will be generated. Any other value must be a valid CR ring_id value
29047 	 * for this function.
29048 	 */
29049 	uint16_t seq_id;
29050 	/* This value indicates the command sequence number. */
29051 	uint16_t target_id;
29052 	/*
29053 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
29054 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
29055 	 */
29056 	uint64_t resp_addr;
29057 	/*
29058 	 * This is the host address where the response will be written when the
29059 	 * request is complete. This area must be 16B aligned and must be
29060 	 * cleared to zero before the request is made.
29061 	 */
29062 	uint8_t flags;
29063 	/* This field indicates which self-test is being requested to run. */
29064 	/* Run the NVM test. */
29065 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_NVM_TEST		UINT32_C(0x1)
29066 	/* Run the link test. */
29067 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_LINK_TEST	UINT32_C(0x2)
29068 	/* Run the register test. */
29069 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_REGISTER_TEST	UINT32_C(0x4)
29070 	/* Run the memory test. */
29071 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_MEMORY_TEST	UINT32_C(0x8)
29072 	/* Run the PCIe serdes test. */
29073 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
29074 	/* Run the Ethernet serdes test. */
29075 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_ETHERNET_SERDES_TEST UINT32_C(0x20)
29076 	uint8_t unused_0[7];
29077 } __attribute__((packed));
29078 
29079 /* Output (16 bytes) */
29080 
29081 struct hwrm_selftest_exec_output {
29082 	uint16_t error_code;
29083 	/*
29084 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
29085 	 * and fail the call with an error when appropriate
29086 	 */
29087 	uint16_t req_type;
29088 	/* This field returns the type of original request. */
29089 	uint16_t seq_id;
29090 	/* This field provides original sequence number of the command. */
29091 	uint16_t resp_len;
29092 	/*
29093 	 * This field is the length of the response in bytes. The last byte of
29094 	 * the response is a valid flag that will read as '1' when the command
29095 	 * has been completely written to memory.
29096 	 */
29097 	uint8_t requested_tests;
29098 	/* The following tests were requested to be run. */
29099 	/* A reqeust was made to run the NVM test. */
29100 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_NVM_TEST UINT32_C(0x1)
29101 	/* A request was made to run the link test. */
29102 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_LINK_TEST UINT32_C(0x2)
29103 	/* A request was made to run the register test. */
29104 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_REGISTER_TEST UINT32_C(0x4)
29105 	/* A request was made to run the memory test. */
29106 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_MEMORY_TEST UINT32_C(0x8)
29107 	/* A request was made to run the PCIe serdes test. */
29108 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_PCIE_SERDES_TEST UINT32_C(0x10)
29109 	/* A request was made to run the Ethernet serdes test. */
29110 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_ETHERNET_SERDES_TEST UINT32_C(0x20)
29111 	uint8_t test_success;
29112 	/*
29113 	 * If a test was requested to be run as seen in the requested_tests
29114 	 * field, this bit indicates whether the test was successful(1) or
29115 	 * failed(0).
29116 	 */
29117 	/*
29118 	 * If requested, a value of 1 indicates the NVM test completed
29119 	 * successfully.
29120 	 */
29121 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_NVM_TEST	UINT32_C(0x1)
29122 	/*
29123 	 * If requested, a value of 1 indicates the link test completed
29124 	 * successfully.
29125 	 */
29126 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_LINK_TEST   UINT32_C(0x2)
29127 	/*
29128 	 * If requested, a value of 1 indicates the register test completed
29129 	 * successfully.
29130 	 */
29131 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_REGISTER_TEST UINT32_C(0x4)
29132 	/*
29133 	 * If requested, a value of 1 indicates the memory test completed
29134 	 * successfully.
29135 	 */
29136 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_MEMORY_TEST UINT32_C(0x8)
29137 	/*
29138 	 * If requested, a value of 1 indicates the PCIe serdes test completed
29139 	 * successfully.
29140 	 */
29141 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_PCIE_SERDES_TEST UINT32_C(0x10)
29142 	/*
29143 	 * If requested, a value of 1 indicates the Ethernet serdes test
29144 	 * completed successfully.
29145 	 */
29146 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_ETHERNET_SERDES_TEST UINT32_C(0x20)
29147 	uint16_t unused_0[3];
29148 } __attribute__((packed));
29149 
29150 /* hwrm_selftest_irq */
29151 /*
29152  * Description: This function is called by a driver to request the interrupt
29153  * test be run. In response to this request the interrupt associated with the
29154  * completion ring specified in the cmpl_ring field will be asserted to the
29155  * host.
29156  */
29157 /* Input (16 bytes) */
29158 
29159 struct hwrm_selftest_irq_input {
29160 	uint16_t req_type;
29161 	/*
29162 	 * This value indicates what type of request this is. The format for the
29163 	 * rest of the command is determined by this field.
29164 	 */
29165 	uint16_t cmpl_ring;
29166 	/*
29167 	 * This value indicates the what completion ring the request will be
29168 	 * optionally completed on. If the value is -1, then no CR completion
29169 	 * will be generated. Any other value must be a valid CR ring_id value
29170 	 * for this function.
29171 	 */
29172 	uint16_t seq_id;
29173 	/* This value indicates the command sequence number. */
29174 	uint16_t target_id;
29175 	/*
29176 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
29177 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
29178 	 */
29179 	uint64_t resp_addr;
29180 	/*
29181 	 * This is the host address where the response will be written when the
29182 	 * request is complete. This area must be 16B aligned and must be
29183 	 * cleared to zero before the request is made.
29184 	 */
29185 } __attribute__((packed));
29186 
29187 /* Output (8 bytes) */
29188 
29189 struct hwrm_selftest_irq_output {
29190 	uint16_t error_code;
29191 	/*
29192 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
29193 	 * and fail the call with an error when appropriate
29194 	 */
29195 	uint16_t req_type;
29196 	/* This field returns the type of original request. */
29197 	uint16_t seq_id;
29198 	/* This field provides original sequence number of the command. */
29199 	uint16_t resp_len;
29200 	/*
29201 	 * This field is the length of the response in bytes. The last byte of
29202 	 * the response is a valid flag that will read as '1' when the command
29203 	 * has been completely written to memory.
29204 	 */
29205 } __attribute__((packed));
29206 
29207 /* hwrm_selftest_retreive_serdes_data */
29208 /*
29209  * Description: This function is called by a driver to retreieve the data
29210  * collected when running the previous PCIe or Ethernet serdes test. The driver
29211  * can use multiple calls to this command to retreive the entire stored buffer
29212  * in the event it cannot do so with a single call.
29213  */
29214 /* Input (32 bytes) */
29215 
29216 struct hwrm_selftest_retreive_serdes_data_input {
29217 	uint16_t req_type;
29218 	/*
29219 	 * This value indicates what type of request this is. The format for the
29220 	 * rest of the command is determined by this field.
29221 	 */
29222 	uint16_t cmpl_ring;
29223 	/*
29224 	 * This value indicates the what completion ring the request will be
29225 	 * optionally completed on. If the value is -1, then no CR completion
29226 	 * will be generated. Any other value must be a valid CR ring_id value
29227 	 * for this function.
29228 	 */
29229 	uint16_t seq_id;
29230 	/* This value indicates the command sequence number. */
29231 	uint16_t target_id;
29232 	/*
29233 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
29234 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
29235 	 */
29236 	uint64_t resp_addr;
29237 	/*
29238 	 * This is the host address where the response will be written when the
29239 	 * request is complete. This area must be 16B aligned and must be
29240 	 * cleared to zero before the request is made.
29241 	 */
29242 	uint64_t resp_data_addr;
29243 	/* Host address data is to DMA'd to. */
29244 	uint32_t resp_data_offset;
29245 	/*
29246 	 * This field contains the offset into the captured data to begin
29247 	 * copying the data to the host from. This should be set to 0 on the
29248 	 * initial call to this command.
29249 	 */
29250 	uint16_t data_len;
29251 	/*
29252 	 * Size of the buffer pointed to by resp_data_addr. The firmware may use
29253 	 * this entire buffer or less than the entire buffer, but never more.
29254 	 */
29255 	uint8_t flags;
29256 	/*
29257 	 * This field allows this command to request the individual serdes tests
29258 	 * to be run using this command.
29259 	 */
29260 	/* Unused. */
29261 	#define HWRM_SELFTEST_RETREIVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_MASK UINT32_C(0xf)
29262 	#define HWRM_SELFTEST_RETREIVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_SFT 0
29263 	/* Run the PCIe serdes test. */
29264 	#define HWRM_SELFTEST_RETREIVE_SERDES_DATA_INPUT_FLAGS_PCIE_SERDES_TEST UINT32_C(0x10)
29265 	/* Run the Ethernet serdes test. */
29266 	#define HWRM_SELFTEST_RETREIVE_SERDES_DATA_INPUT_FLAGS_ETHERNET_SERDES_TEST UINT32_C(0x20)
29267 	uint8_t unused_0;
29268 } __attribute__((packed));
29269 
29270 /* Output (16 bytes) */
29271 
29272 struct hwrm_selftest_retreive_serdes_data_output {
29273 	uint16_t error_code;
29274 	/*
29275 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
29276 	 * and fail the call with an error when appropriate
29277 	 */
29278 	uint16_t req_type;
29279 	/* This field returns the type of original request. */
29280 	uint16_t seq_id;
29281 	/* This field provides original sequence number of the command. */
29282 	uint16_t resp_len;
29283 	/*
29284 	 * This field is the length of the response in bytes. The last byte of
29285 	 * the response is a valid flag that will read as '1' when the command
29286 	 * has been completely written to memory.
29287 	 */
29288 	uint16_t total_data_len;
29289 	/* Total length of stored data. */
29290 	uint16_t copied_data_len;
29291 	/*
29292 	 * Amount of data DMA'd to host by this call. The driver can use this
29293 	 * field along with the total_data_len field above to determine the
29294 	 * value to write to the resp_data_offset field in the next call if more
29295 	 * than one call to these commands is required to retreive all the
29296 	 * stored data.
29297 	 */
29298 	uint32_t unused_0;
29299 } __attribute__((packed));
29300 
29301 /* Hardware Resource Manager Specification */
29302 /* Description: This structure is used to configure a RSS Context. */
29303 /*
29304  * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
29305  * inside the chip. The HWRM is implemented in firmware, and runs on embedded
29306  * processors inside the chip. This firmware service is vital part of the chip.
29307  * The chip can not be used by a driver or HWRM client without the HWRM.
29308  */
29309 /* Input (16 bytes) */
29310 
29311 struct input {
29312 	uint16_t req_type;
29313 	/*
29314 	 * This value indicates what type of request this is. The format for the
29315 	 * rest of the command is determined by this field.
29316 	 */
29317 	uint16_t cmpl_ring;
29318 	/*
29319 	 * This value indicates the what completion ring the request will be
29320 	 * optionally completed on. If the value is -1, then no CR completion
29321 	 * will be generated. Any other value must be a valid CR ring_id value
29322 	 * for this function.
29323 	 */
29324 	uint16_t seq_id;
29325 	/* This value indicates the command sequence number. */
29326 	uint16_t target_id;
29327 	/*
29328 	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
29329 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
29330 	 */
29331 	uint64_t resp_addr;
29332 	/*
29333 	 * This is the host address where the response will be written when the
29334 	 * request is complete. This area must be 16B aligned and must be
29335 	 * cleared to zero before the request is made.
29336 	 */
29337 } __attribute__((packed));
29338 
29339 /* Output (8 bytes) */
29340 
29341 struct output {
29342 	uint16_t error_code;
29343 	/*
29344 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
29345 	 * and fail the call with an error when appropriate
29346 	 */
29347 	uint16_t req_type;
29348 	/* This field returns the type of original request. */
29349 	uint16_t seq_id;
29350 	/* This field provides original sequence number of the command. */
29351 	uint16_t resp_len;
29352 	/*
29353 	 * This field is the length of the response in bytes. The last byte of
29354 	 * the response is a valid flag that will read as '1' when the command
29355 	 * has been completely written to memory.
29356 	 */
29357 } __attribute__((packed));
29358 
29359 /* Short Command Structure (16 bytes) */
29360 
29361 struct hwrm_short_input {
29362 	uint16_t req_type;
29363 	/*
29364 	 * This field indicates the type of request in the request buffer. The
29365 	 * format for the rest of the command (request) is determined by this
29366 	 * field.
29367 	 */
29368 	uint16_t signature;
29369 	/*
29370 	 * This field indicates a signature that is used to identify short form
29371 	 * of the command listed here. This field shall be set to 17185
29372 	 * (0x4321).
29373 	 */
29374 	/* Signature indicating this is a short form of HWRM command */
29375 	#define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD		UINT32_C(0x4321)
29376 	uint16_t unused_0;
29377 	/* Reserved for future use. */
29378 	uint16_t size;
29379 	/* This value indicates the length of the request. */
29380 	uint64_t req_addr;
29381 	/*
29382 	 * This is the host address where the request was written. This area
29383 	 * must be 16B aligned.
29384 	 */
29385 } __attribute__((packed));
29386 
29387 #define GET_HWRM_REQ_TYPE(x) \
29388 	((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \
29389 	((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \
29390 	((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \
29391 	((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \
29392 	((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \
29393 	((x) == 0x94 ? "HWRM_CFA_VLAN_ANTISPOOF_CFG": \
29394 	((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \
29395 	((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \
29396 	((x) == 0x10 ? "RESERVED1": \
29397 	((x) == 0x11 ? "HWRM_FUNC_RESET": \
29398 	((x) == 0x12 ? "HWRM_FUNC_GETFID": \
29399 	((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \
29400 	((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \
29401 	((x) == 0x15 ? "HWRM_FUNC_QCAPS": \
29402 	((x) == 0x16 ? "HWRM_FUNC_QCFG": \
29403 	((x) == 0x17 ? "HWRM_FUNC_CFG": \
29404 	((x) == 0x18 ? "HWRM_FUNC_QSTATS": \
29405 	((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \
29406 	((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \
29407 	((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \
29408 	((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \
29409 	((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \
29410 	((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \
29411 	((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \
29412 	((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \
29413 	((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \
29414 	((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \
29415 	((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \
29416 	((x) == 0xd2 ? "HWRM_FWD_RESP": \
29417 	((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \
29418 	((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \
29419 	((x) == 0xc0 ? "HWRM_FW_RESET": \
29420 	((x) == 0xc1 ? "HWRM_FW_QSTATUS": \
29421 	((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \
29422 	((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \
29423 	((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \
29424 	((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \
29425 	((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \
29426 	((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \
29427 	((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \
29428 	((x) == 0x61 ? "HWRM_RING_GRP_FREE": \
29429 	((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \
29430 	((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \
29431 	((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \
29432 	((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \
29433 	((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \
29434 	((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \
29435 	((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \
29436 	((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \
29437 	((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \
29438 	((x) == 0x10a ? "HWRM_CFA_VLAN_ANTISPOOF_QCFG": \
29439 	((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \
29440 	((x) == 0xf ? "HWRM_FUNC_VF_CFG": \
29441 	((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \
29442 	((x) == 0xfffe ? "HWRM_NVM_WRITE": \
29443 	((x) == 0xfffd ? "HWRM_NVM_READ": \
29444 	((x) == 0x50 ? "HWRM_RING_ALLOC": \
29445 	((x) == 0x51 ? "HWRM_RING_FREE": \
29446 	((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \
29447 	((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \
29448 	((x) == 0x4a ? "HWRM_VNIC_QCAPS": \
29449 	((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \
29450 	((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \
29451 	((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \
29452 	((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \
29453 	((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \
29454 	((x) == 0x43 ? "HWRM_VNIC_QCFG": \
29455 	((x) == 0x42 ? "HWRM_VNIC_CFG": \
29456 	((x) == 0x41 ? "HWRM_VNIC_FREE": \
29457 	((x) == 0x40 ? "HWRM_VNIC_ALLOC": \
29458 	((x) == 0x0 ? "HWRM_VER_GET": \
29459 	((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \
29460 	((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \
29461 	((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \
29462 	((x) == 0x5e ? "HWRM_RING_RESET": \
29463 	((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \
29464 	((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \
29465 	((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \
29466 	((x) == 0xfff2 ? "HWRM_NVM_SET_VARIABLE": \
29467 	((x) == 0xfff1 ? "HWRM_NVM_GET_VARIABLE": \
29468 	((x) == 0xfff0 ? "HWRM_NVM_FLUSH": \
29469 	((x) == 0x2e ? "HWRM_PORT_LED_QCFG": \
29470 	((x) == 0x2d ? "HWRM_PORT_LED_CFG": \
29471 	((x) == 0x2f ? "HWRM_PORT_LED_QCAPS": \
29472 	((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \
29473 	((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \
29474 	((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \
29475 	((x) == 0x32 ? "HWRM_QUEUE_CFG": \
29476 	((x) == 0x33 ? "HWRM_FUNC_VLAN_CFG": \
29477 	((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \
29478 	((x) == 0x31 ? "HWRM_QUEUE_QCFG": \
29479 	((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \
29480 	((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \
29481 	((x) == 0x34 ? "HWRM_FUNC_VLAN_QCFG": \
29482 	((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \
29483 	((x) == 0xff14 ? "HWRM_DBG_DUMP": \
29484 	((x) == 0xc8 ? "HWRM_FW_SET_TIME": \
29485 	((x) == 0xc9 ? "HWRM_FW_GET_TIME": \
29486 	((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \
29487 	((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \
29488 	((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \
29489 	((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \
29490 	((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \
29491 	((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \
29492 	((x) == 0x23 ? "HWRM_PORT_QSTATS": \
29493 	((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \
29494 	((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \
29495 	((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \
29496 	"Unknown req_type"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
29497 
29498 /* Command numbering (8 bytes) */
29499 
29500 struct cmd_nums {
29501 	uint16_t req_type;
29502 	/*
29503 	 * This version of the specification defines the commands listed in the
29504 	 * table below. The following are general implementation requirements
29505 	 * for these commands: # All commands listed below that are marked
29506 	 * neither reserved nor experimental shall be implemented by the HWRM. #
29507 	 * A HWRM client compliant to this specification should not use commands
29508 	 * outside of the list below. # A HWRM client compliant to this
29509 	 * specification should not use command numbers marked reserved below. #
29510 	 * A command marked experimental below may not be implemented by the
29511 	 * HWRM. # A command marked experimental may change in the future
29512 	 * version of the HWRM specification. # A command not listed below may
29513 	 * be implemented by the HWRM. The behavior of commands that are not
29514 	 * listed below is outside the scope of this specification.
29515 	 */
29516 	#define HWRM_VER_GET					(UINT32_C(0x0))
29517 	#define HWRM_FUNC_BUF_UNRGTR				(UINT32_C(0xe))
29518 	#define HWRM_FUNC_VF_CFG				(UINT32_C(0xf))
29519 	/* Reserved for future use */
29520 	#define RESERVED1					(UINT32_C(0x10))
29521 	#define HWRM_FUNC_RESET				(UINT32_C(0x11))
29522 	#define HWRM_FUNC_GETFID				(UINT32_C(0x12))
29523 	#define HWRM_FUNC_VF_ALLOC				(UINT32_C(0x13))
29524 	#define HWRM_FUNC_VF_FREE				(UINT32_C(0x14))
29525 	#define HWRM_FUNC_QCAPS				(UINT32_C(0x15))
29526 	#define HWRM_FUNC_QCFG					(UINT32_C(0x16))
29527 	#define HWRM_FUNC_CFG					(UINT32_C(0x17))
29528 	#define HWRM_FUNC_QSTATS				(UINT32_C(0x18))
29529 	#define HWRM_FUNC_CLR_STATS				(UINT32_C(0x19))
29530 	#define HWRM_FUNC_DRV_UNRGTR				(UINT32_C(0x1a))
29531 	#define HWRM_FUNC_VF_RESC_FREE				(UINT32_C(0x1b))
29532 	#define HWRM_FUNC_VF_VNIC_IDS_QUERY			(UINT32_C(0x1c))
29533 	#define HWRM_FUNC_DRV_RGTR				(UINT32_C(0x1d))
29534 	#define HWRM_FUNC_DRV_QVER				(UINT32_C(0x1e))
29535 	#define HWRM_FUNC_BUF_RGTR				(UINT32_C(0x1f))
29536 	#define HWRM_PORT_PHY_CFG				(UINT32_C(0x20))
29537 	#define HWRM_PORT_MAC_CFG				(UINT32_C(0x21))
29538 	#define HWRM_PORT_QSTATS				(UINT32_C(0x23))
29539 	#define HWRM_PORT_LPBK_QSTATS				(UINT32_C(0x24))
29540 	#define HWRM_PORT_PHY_QCFG				(UINT32_C(0x27))
29541 	#define HWRM_PORT_MAC_QCFG				(UINT32_C(0x28))
29542 	#define HWRM_PORT_PHY_QCAPS				(UINT32_C(0x2a))
29543 	#define HWRM_PORT_PHY_I2C_WRITE				(UINT32_C(0x2b))
29544 	#define HWRM_PORT_PHY_I2C_READ				(UINT32_C(0x2c))
29545 	#define HWRM_PORT_LED_CFG				(UINT32_C(0x2d))
29546 	#define HWRM_PORT_LED_QCFG				(UINT32_C(0x2e))
29547 	#define HWRM_PORT_LED_QCAPS				(UINT32_C(0x2f))
29548 	#define HWRM_QUEUE_QPORTCFG				(UINT32_C(0x30))
29549 	#define HWRM_QUEUE_QCFG				(UINT32_C(0x31))
29550 	#define HWRM_QUEUE_CFG					(UINT32_C(0x32))
29551 	#define HWRM_FUNC_VLAN_CFG				(UINT32_C(0x33))
29552 	#define HWRM_FUNC_VLAN_QCFG				(UINT32_C(0x34))
29553 	#define HWRM_QUEUE_PFCENABLE_QCFG			(UINT32_C(0x35))
29554 	#define HWRM_QUEUE_PFCENABLE_CFG			(UINT32_C(0x36))
29555 	#define HWRM_QUEUE_PRI2COS_QCFG			(UINT32_C(0x37))
29556 	#define HWRM_QUEUE_PRI2COS_CFG				(UINT32_C(0x38))
29557 	#define HWRM_QUEUE_COS2BW_QCFG				(UINT32_C(0x39))
29558 	#define HWRM_QUEUE_COS2BW_CFG				(UINT32_C(0x3a))
29559 	#define HWRM_VNIC_ALLOC				(UINT32_C(0x40))
29560 	#define HWRM_VNIC_FREE					(UINT32_C(0x41))
29561 	#define HWRM_VNIC_CFG					(UINT32_C(0x42))
29562 	#define HWRM_VNIC_QCFG					(UINT32_C(0x43))
29563 	#define HWRM_VNIC_TPA_CFG				(UINT32_C(0x44))
29564 	#define HWRM_VNIC_RSS_CFG				(UINT32_C(0x46))
29565 	#define HWRM_VNIC_RSS_QCFG				(UINT32_C(0x47))
29566 	#define HWRM_VNIC_PLCMODES_CFG				(UINT32_C(0x48))
29567 	#define HWRM_VNIC_PLCMODES_QCFG			(UINT32_C(0x49))
29568 	#define HWRM_VNIC_QCAPS				(UINT32_C(0x4a))
29569 	#define HWRM_RING_ALLOC				(UINT32_C(0x50))
29570 	#define HWRM_RING_FREE					(UINT32_C(0x51))
29571 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS		(UINT32_C(0x52))
29572 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS		(UINT32_C(0x53))
29573 	#define HWRM_RING_RESET				(UINT32_C(0x5e))
29574 	#define HWRM_RING_GRP_ALLOC				(UINT32_C(0x60))
29575 	#define HWRM_RING_GRP_FREE				(UINT32_C(0x61))
29576 	#define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC			(UINT32_C(0x70))
29577 	#define HWRM_VNIC_RSS_COS_LB_CTX_FREE			(UINT32_C(0x71))
29578 	#define HWRM_CFA_L2_FILTER_ALLOC			(UINT32_C(0x90))
29579 	#define HWRM_CFA_L2_FILTER_FREE			(UINT32_C(0x91))
29580 	#define HWRM_CFA_L2_FILTER_CFG				(UINT32_C(0x92))
29581 	#define HWRM_CFA_L2_SET_RX_MASK			(UINT32_C(0x93))
29582 	#define HWRM_CFA_VLAN_ANTISPOOF_CFG			(UINT32_C(0x94))
29583 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC			(UINT32_C(0x95))
29584 	#define HWRM_CFA_TUNNEL_FILTER_FREE			(UINT32_C(0x96))
29585 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC			(UINT32_C(0x99))
29586 	#define HWRM_CFA_NTUPLE_FILTER_FREE			(UINT32_C(0x9a))
29587 	#define HWRM_CFA_NTUPLE_FILTER_CFG			(UINT32_C(0x9b))
29588 	#define HWRM_TUNNEL_DST_PORT_QUERY			(UINT32_C(0xa0))
29589 	#define HWRM_TUNNEL_DST_PORT_ALLOC			(UINT32_C(0xa1))
29590 	#define HWRM_TUNNEL_DST_PORT_FREE			(UINT32_C(0xa2))
29591 	#define HWRM_STAT_CTX_ALLOC				(UINT32_C(0xb0))
29592 	#define HWRM_STAT_CTX_FREE				(UINT32_C(0xb1))
29593 	#define HWRM_STAT_CTX_QUERY				(UINT32_C(0xb2))
29594 	#define HWRM_STAT_CTX_CLR_STATS			(UINT32_C(0xb3))
29595 	#define HWRM_FW_RESET					(UINT32_C(0xc0))
29596 	#define HWRM_FW_QSTATUS				(UINT32_C(0xc1))
29597 	#define HWRM_FW_SET_TIME				(UINT32_C(0xc8))
29598 	#define HWRM_FW_GET_TIME				(UINT32_C(0xc9))
29599 	#define HWRM_FW_SET_STRUCTURED_DATA			(UINT32_C(0xca))
29600 	#define HWRM_FW_GET_STRUCTURED_DATA			(UINT32_C(0xcb))
29601 	#define HWRM_EXEC_FWD_RESP				(UINT32_C(0xd0))
29602 	#define HWRM_REJECT_FWD_RESP				(UINT32_C(0xd1))
29603 	#define HWRM_FWD_RESP					(UINT32_C(0xd2))
29604 	#define HWRM_FWD_ASYNC_EVENT_CMPL			(UINT32_C(0xd3))
29605 	#define HWRM_TEMP_MONITOR_QUERY			(UINT32_C(0xe0))
29606 	#define HWRM_WOL_FILTER_ALLOC				(UINT32_C(0xf0))
29607 	#define HWRM_WOL_FILTER_FREE				(UINT32_C(0xf1))
29608 	#define HWRM_WOL_FILTER_QCFG				(UINT32_C(0xf2))
29609 	#define HWRM_WOL_REASON_QCFG				(UINT32_C(0xf3))
29610 	#define HWRM_CFA_VLAN_ANTISPOOF_QCFG			(UINT32_C(0x10a))
29611 	#define HWRM_DBG_DUMP					(UINT32_C(0xff14))
29612 	#define HWRM_NVM_VALIDATE_OPTION			(UINT32_C(0xffef))
29613 	#define HWRM_NVM_FLUSH					(UINT32_C(0xfff0))
29614 	#define HWRM_NVM_GET_VARIABLE				(UINT32_C(0xfff1))
29615 	#define HWRM_NVM_SET_VARIABLE				(UINT32_C(0xfff2))
29616 	#define HWRM_NVM_INSTALL_UPDATE			(UINT32_C(0xfff3))
29617 	#define HWRM_NVM_MODIFY				(UINT32_C(0xfff4))
29618 	#define HWRM_NVM_VERIFY_UPDATE				(UINT32_C(0xfff5))
29619 	#define HWRM_NVM_GET_DEV_INFO				(UINT32_C(0xfff6))
29620 	#define HWRM_NVM_ERASE_DIR_ENTRY			(UINT32_C(0xfff7))
29621 	#define HWRM_NVM_MOD_DIR_ENTRY				(UINT32_C(0xfff8))
29622 	#define HWRM_NVM_FIND_DIR_ENTRY			(UINT32_C(0xfff9))
29623 	#define HWRM_NVM_GET_DIR_ENTRIES			(UINT32_C(0xfffa))
29624 	#define HWRM_NVM_GET_DIR_INFO				(UINT32_C(0xfffb))
29625 	#define HWRM_NVM_RAW_DUMP				(UINT32_C(0xfffc))
29626 	#define HWRM_NVM_READ					(UINT32_C(0xfffd))
29627 	#define HWRM_NVM_WRITE					(UINT32_C(0xfffe))
29628 	#define HWRM_NVM_RAW_WRITE_BLK				(UINT32_C(0xffff))
29629 	uint16_t unused_0[3];
29630 } __attribute__((packed));
29631 
29632 #define GET_HWRM_ERROR_CODE(x) \
29633 	((x) == 0xf ? "HWRM_ERROR": \
29634 	((x) == 0xffff ? "CMD_NOT_SUPPORTED": \
29635 	((x) == 0xfffe ? "UNKNOWN_ERR": \
29636 	((x) == 0x4 ? "RESOURCE_ALLOC_ERROR": \
29637 	((x) == 0x5 ? "INVALID_FLAGS": \
29638 	((x) == 0x6 ? "INVALID_ENABLES": \
29639 	((x) == 0x0 ? "SUCCESS": \
29640 	((x) == 0x1 ? "FAIL": \
29641 	((x) == 0x2 ? "INVALID_PARAMS": \
29642 	((x) == 0x3 ? "RESOURCE_ACCESS_DENIED": \
29643 	"Unknown error_code"))))))))))
29644 
29645 /* Return Codes (8 bytes) */
29646 
29647 struct ret_codes {
29648 	uint16_t error_code;
29649 	/* These are numbers assigned to return/error codes. */
29650 	/* Request was successfully executed by the HWRM. */
29651 	#define HWRM_ERR_CODE_SUCCESS				(UINT32_C(0x0))
29652 	/* THe HWRM failed to execute the request. */
29653 	#define HWRM_ERR_CODE_FAIL				(UINT32_C(0x1))
29654 	/* The request contains invalid argument(s) or input parameters. */
29655 	#define HWRM_ERR_CODE_INVALID_PARAMS			(UINT32_C(0x2))
29656 	/*
29657 	 * The requester is not allowed to access the requested
29658 	 * resource. This error code shall be provided in a response to
29659 	 * a request to query or modify an existing resource that is not
29660 	 * accessible by the requester.
29661 	 */
29662 	#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED		(UINT32_C(0x3))
29663 	/*
29664 	 * The HWRM is unable to allocate the requested resource. This
29665 	 * code only applies to requests for HWRM resource allocations.
29666 	 */
29667 	#define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR		(UINT32_C(0x4))
29668 	/* Invalid combination of flags is specified in the request. */
29669 	#define HWRM_ERR_CODE_INVALID_FLAGS			(UINT32_C(0x5))
29670 	/*
29671 	 * Invalid combination of enables fields is specified in the
29672 	 * request.
29673 	 */
29674 	#define HWRM_ERR_CODE_INVALID_ENABLES			(UINT32_C(0x6))
29675 	/* Generic HWRM execution error that represents an internal error. */
29676 	#define HWRM_ERR_CODE_HWRM_ERROR			(UINT32_C(0xf))
29677 	/* Unknown error */
29678 	#define HWRM_ERR_CODE_UNKNOWN_ERR			(UINT32_C(0xfffe))
29679 	/* Unsupported or invalid command */
29680 	#define HWRM_ERR_CODE_CMD_NOT_SUPPORTED		(UINT32_C(0xffff))
29681 	uint16_t unused_0[3];
29682 } __attribute__((packed));
29683 
29684 /* Output (16 bytes) */
29685 
29686 struct hwrm_err_output {
29687 	uint16_t error_code;
29688 	/*
29689 	 * Pass/Fail or error type Note: receiver to verify the in parameters,
29690 	 * and fail the call with an error when appropriate
29691 	 */
29692 	uint16_t req_type;
29693 	/* This field returns the type of original request. */
29694 	uint16_t seq_id;
29695 	/* This field provides original sequence number of the command. */
29696 	uint16_t resp_len;
29697 	/*
29698 	 * This field is the length of the response in bytes. The last byte of
29699 	 * the response is a valid flag that will read as '1' when the command
29700 	 * has been completely written to memory.
29701 	 */
29702 	uint32_t opaque_0;
29703 	/* debug info for this error response. */
29704 	uint16_t opaque_1;
29705 	/* debug info for this error response. */
29706 	uint8_t cmd_err;
29707 	/*
29708 	 * In the case of an error response, command specific error code is
29709 	 * returned in this field.
29710 	 */
29711 	uint8_t valid;
29712 	/*
29713 	 * This field is used in Output records to indicate that the output is
29714 	 * completely written to RAM. This field should be read as '1' to
29715 	 * indicate that the output has been completely written. When writing a
29716 	 * command completion or response to an internal processor, the order of
29717 	 * writes has to be such that this field is written last.
29718 	 */
29719 } __attribute__((packed));
29720 
29721 /* Port Tx Statistics Formats (408 bytes) */
29722 
29723 struct tx_port_stats {
29724 	uint64_t tx_64b_frames;
29725 	/* Total Number of 64 Bytes frames transmitted */
29726 	uint64_t tx_65b_127b_frames;
29727 	/* Total Number of 65-127 Bytes frames transmitted */
29728 	uint64_t tx_128b_255b_frames;
29729 	/* Total Number of 128-255 Bytes frames transmitted */
29730 	uint64_t tx_256b_511b_frames;
29731 	/* Total Number of 256-511 Bytes frames transmitted */
29732 	uint64_t tx_512b_1023b_frames;
29733 	/* Total Number of 512-1023 Bytes frames transmitted */
29734 	uint64_t tx_1024b_1518_frames;
29735 	/* Total Number of 1024-1518 Bytes frames transmitted */
29736 	uint64_t tx_good_vlan_frames;
29737 	/*
29738 	 * Total Number of each good VLAN (exludes FCS errors) frame transmitted
29739 	 * which is 1519 to 1522 bytes in length inclusive (excluding framing
29740 	 * bits but including FCS bytes).
29741 	 */
29742 	uint64_t tx_1519b_2047_frames;
29743 	/* Total Number of 1519-2047 Bytes frames transmitted */
29744 	uint64_t tx_2048b_4095b_frames;
29745 	/* Total Number of 2048-4095 Bytes frames transmitted */
29746 	uint64_t tx_4096b_9216b_frames;
29747 	/* Total Number of 4096-9216 Bytes frames transmitted */
29748 	uint64_t tx_9217b_16383b_frames;
29749 	/* Total Number of 9217-16383 Bytes frames transmitted */
29750 	uint64_t tx_good_frames;
29751 	/* Total Number of good frames transmitted */
29752 	uint64_t tx_total_frames;
29753 	/* Total Number of frames transmitted */
29754 	uint64_t tx_ucast_frames;
29755 	/* Total number of unicast frames transmitted */
29756 	uint64_t tx_mcast_frames;
29757 	/* Total number of multicast frames transmitted */
29758 	uint64_t tx_bcast_frames;
29759 	/* Total number of broadcast frames transmitted */
29760 	uint64_t tx_pause_frames;
29761 	/* Total number of PAUSE control frames transmitted */
29762 	uint64_t tx_pfc_frames;
29763 	/* Total number of PFC/per-priority PAUSE control frames transmitted */
29764 	uint64_t tx_jabber_frames;
29765 	/* Total number of jabber frames transmitted */
29766 	uint64_t tx_fcs_err_frames;
29767 	/* Total number of frames transmitted with FCS error */
29768 	uint64_t tx_control_frames;
29769 	/* Total number of control frames transmitted */
29770 	uint64_t tx_oversz_frames;
29771 	/* Total number of over-sized frames transmitted */
29772 	uint64_t tx_single_dfrl_frames;
29773 	/* Total number of frames with single deferral */
29774 	uint64_t tx_multi_dfrl_frames;
29775 	/* Total number of frames with multiple deferrals */
29776 	uint64_t tx_single_coll_frames;
29777 	/* Total number of frames with single collision */
29778 	uint64_t tx_multi_coll_frames;
29779 	/* Total number of frames with multiple collisions */
29780 	uint64_t tx_late_coll_frames;
29781 	/* Total number of frames with late collisions */
29782 	uint64_t tx_excessive_coll_frames;
29783 	/* Total number of frames with excessive collisions */
29784 	uint64_t tx_frag_frames;
29785 	/* Total number of fragmented frames transmitted */
29786 	uint64_t tx_err;
29787 	/* Total number of transmit errors */
29788 	uint64_t tx_tagged_frames;
29789 	/* Total number of single VLAN tagged frames transmitted */
29790 	uint64_t tx_dbl_tagged_frames;
29791 	/* Total number of double VLAN tagged frames transmitted */
29792 	uint64_t tx_runt_frames;
29793 	/* Total number of runt frames transmitted */
29794 	uint64_t tx_fifo_underruns;
29795 	/* Total number of TX FIFO under runs */
29796 	uint64_t tx_pfc_ena_frames_pri0;
29797 	/* Total number of PFC frames with PFC enabled bit for Pri 0 transmitted */
29798 	uint64_t tx_pfc_ena_frames_pri1;
29799 	/* Total number of PFC frames with PFC enabled bit for Pri 1 transmitted */
29800 	uint64_t tx_pfc_ena_frames_pri2;
29801 	/* Total number of PFC frames with PFC enabled bit for Pri 2 transmitted */
29802 	uint64_t tx_pfc_ena_frames_pri3;
29803 	/* Total number of PFC frames with PFC enabled bit for Pri 3 transmitted */
29804 	uint64_t tx_pfc_ena_frames_pri4;
29805 	/* Total number of PFC frames with PFC enabled bit for Pri 4 transmitted */
29806 	uint64_t tx_pfc_ena_frames_pri5;
29807 	/* Total number of PFC frames with PFC enabled bit for Pri 5 transmitted */
29808 	uint64_t tx_pfc_ena_frames_pri6;
29809 	/* Total number of PFC frames with PFC enabled bit for Pri 6 transmitted */
29810 	uint64_t tx_pfc_ena_frames_pri7;
29811 	/* Total number of PFC frames with PFC enabled bit for Pri 7 transmitted */
29812 	uint64_t tx_eee_lpi_events;
29813 	/* Total number of EEE LPI Events on TX */
29814 	uint64_t tx_eee_lpi_duration;
29815 	/* EEE LPI Duration Counter on TX */
29816 	uint64_t tx_llfc_logical_msgs;
29817 	/* Total number of Link Level Flow Control (LLFC) messages transmitted */
29818 	uint64_t tx_hcfc_msgs;
29819 	/* Total number of HCFC messages transmitted */
29820 	uint64_t tx_total_collisions;
29821 	/* Total number of TX collisions */
29822 	uint64_t tx_bytes;
29823 	/* Total number of transmitted bytes */
29824 	uint64_t tx_xthol_frames;
29825 	/* Total number of end-to-end HOL frames */
29826 	uint64_t tx_stat_discard;
29827 	/* Total Tx Drops per Port reported by STATS block */
29828 	uint64_t tx_stat_error;
29829 	/* Total Tx Error Drops per Port reported by STATS block */
29830 } __attribute__((packed));
29831 
29832 /* Port Rx Statistics Formats (528 bytes) */
29833 
29834 struct rx_port_stats {
29835 	uint64_t rx_64b_frames;
29836 	/* Total Number of 64 Bytes frames received */
29837 	uint64_t rx_65b_127b_frames;
29838 	/* Total Number of 65-127 Bytes frames received */
29839 	uint64_t rx_128b_255b_frames;
29840 	/* Total Number of 128-255 Bytes frames received */
29841 	uint64_t rx_256b_511b_frames;
29842 	/* Total Number of 256-511 Bytes frames received */
29843 	uint64_t rx_512b_1023b_frames;
29844 	/* Total Number of 512-1023 Bytes frames received */
29845 	uint64_t rx_1024b_1518_frames;
29846 	/* Total Number of 1024-1518 Bytes frames received */
29847 	uint64_t rx_good_vlan_frames;
29848 	/*
29849 	 * Total Number of each good VLAN (exludes FCS errors) frame received
29850 	 * which is 1519 to 1522 bytes in length inclusive (excluding framing
29851 	 * bits but including FCS bytes).
29852 	 */
29853 	uint64_t rx_1519b_2047b_frames;
29854 	/* Total Number of 1519-2047 Bytes frames received */
29855 	uint64_t rx_2048b_4095b_frames;
29856 	/* Total Number of 2048-4095 Bytes frames received */
29857 	uint64_t rx_4096b_9216b_frames;
29858 	/* Total Number of 4096-9216 Bytes frames received */
29859 	uint64_t rx_9217b_16383b_frames;
29860 	/* Total Number of 9217-16383 Bytes frames received */
29861 	uint64_t rx_total_frames;
29862 	/* Total number of frames received */
29863 	uint64_t rx_ucast_frames;
29864 	/* Total number of unicast frames received */
29865 	uint64_t rx_mcast_frames;
29866 	/* Total number of multicast frames received */
29867 	uint64_t rx_bcast_frames;
29868 	/* Total number of broadcast frames received */
29869 	uint64_t rx_fcs_err_frames;
29870 	/* Total number of received frames with FCS error */
29871 	uint64_t rx_ctrl_frames;
29872 	/* Total number of control frames received */
29873 	uint64_t rx_pause_frames;
29874 	/* Total number of PAUSE frames received */
29875 	uint64_t rx_pfc_frames;
29876 	/* Total number of PFC frames received */
29877 	uint64_t rx_unsupported_opcode_frames;
29878 	/* Total number of frames received with an unsupported opcode */
29879 	uint64_t rx_unsupported_da_pausepfc_frames;
29880 	/*
29881 	 * Total number of frames received with an unsupported DA for pause and
29882 	 * PFC
29883 	 */
29884 	uint64_t rx_wrong_sa_frames;
29885 	/* Total number of frames received with an unsupported SA */
29886 	uint64_t rx_align_err_frames;
29887 	/* Total number of received packets with alignment error */
29888 	uint64_t rx_oor_len_frames;
29889 	/* Total number of received frames with out-of-range length */
29890 	uint64_t rx_code_err_frames;
29891 	/* Total number of received frames with error termination */
29892 	uint64_t rx_false_carrier_frames;
29893 	/*
29894 	 * Total number of received frames with a false carrier is detected
29895 	 * during idle, as defined by RX_ER samples active and RXD is 0xE. The
29896 	 * event is reported along with the statistics generated on the next
29897 	 * received frame. Only one false carrier condition can be detected and
29898 	 * logged between frames. Carrier event, valid for 10M/100M speed modes
29899 	 * only.
29900 	 */
29901 	uint64_t rx_ovrsz_frames;
29902 	/* Total number of over-sized frames received */
29903 	uint64_t rx_jbr_frames;
29904 	/* Total number of jabber packets received */
29905 	uint64_t rx_mtu_err_frames;
29906 	/* Total number of received frames with MTU error */
29907 	uint64_t rx_match_crc_frames;
29908 	/* Total number of received frames with CRC match */
29909 	uint64_t rx_promiscuous_frames;
29910 	/* Total number of frames received promiscuously */
29911 	uint64_t rx_tagged_frames;
29912 	/* Total number of received frames with one or two VLAN tags */
29913 	uint64_t rx_double_tagged_frames;
29914 	/* Total number of received frames with two VLAN tags */
29915 	uint64_t rx_trunc_frames;
29916 	/* Total number of truncated frames received */
29917 	uint64_t rx_good_frames;
29918 	/* Total number of good frames (without errors) received */
29919 	uint64_t rx_pfc_xon2xoff_frames_pri0;
29920 	/*
29921 	 * Total number of received PFC frames with transition from XON to XOFF
29922 	 * on Pri 0
29923 	 */
29924 	uint64_t rx_pfc_xon2xoff_frames_pri1;
29925 	/*
29926 	 * Total number of received PFC frames with transition from XON to XOFF
29927 	 * on Pri 1
29928 	 */
29929 	uint64_t rx_pfc_xon2xoff_frames_pri2;
29930 	/*
29931 	 * Total number of received PFC frames with transition from XON to XOFF
29932 	 * on Pri 2
29933 	 */
29934 	uint64_t rx_pfc_xon2xoff_frames_pri3;
29935 	/*
29936 	 * Total number of received PFC frames with transition from XON to XOFF
29937 	 * on Pri 3
29938 	 */
29939 	uint64_t rx_pfc_xon2xoff_frames_pri4;
29940 	/*
29941 	 * Total number of received PFC frames with transition from XON to XOFF
29942 	 * on Pri 4
29943 	 */
29944 	uint64_t rx_pfc_xon2xoff_frames_pri5;
29945 	/*
29946 	 * Total number of received PFC frames with transition from XON to XOFF
29947 	 * on Pri 5
29948 	 */
29949 	uint64_t rx_pfc_xon2xoff_frames_pri6;
29950 	/*
29951 	 * Total number of received PFC frames with transition from XON to XOFF
29952 	 * on Pri 6
29953 	 */
29954 	uint64_t rx_pfc_xon2xoff_frames_pri7;
29955 	/*
29956 	 * Total number of received PFC frames with transition from XON to XOFF
29957 	 * on Pri 7
29958 	 */
29959 	uint64_t rx_pfc_ena_frames_pri0;
29960 	/* Total number of received PFC frames with PFC enabled bit for Pri 0 */
29961 	uint64_t rx_pfc_ena_frames_pri1;
29962 	/* Total number of received PFC frames with PFC enabled bit for Pri 1 */
29963 	uint64_t rx_pfc_ena_frames_pri2;
29964 	/* Total number of received PFC frames with PFC enabled bit for Pri 2 */
29965 	uint64_t rx_pfc_ena_frames_pri3;
29966 	/* Total number of received PFC frames with PFC enabled bit for Pri 3 */
29967 	uint64_t rx_pfc_ena_frames_pri4;
29968 	/* Total number of received PFC frames with PFC enabled bit for Pri 4 */
29969 	uint64_t rx_pfc_ena_frames_pri5;
29970 	/* Total number of received PFC frames with PFC enabled bit for Pri 5 */
29971 	uint64_t rx_pfc_ena_frames_pri6;
29972 	/* Total number of received PFC frames with PFC enabled bit for Pri 6 */
29973 	uint64_t rx_pfc_ena_frames_pri7;
29974 	/* Total number of received PFC frames with PFC enabled bit for Pri 7 */
29975 	uint64_t rx_sch_crc_err_frames;
29976 	/* Total Number of frames received with SCH CRC error */
29977 	uint64_t rx_undrsz_frames;
29978 	/* Total Number of under-sized frames received */
29979 	uint64_t rx_frag_frames;
29980 	/* Total Number of fragmented frames received */
29981 	uint64_t rx_eee_lpi_events;
29982 	/* Total number of RX EEE LPI Events */
29983 	uint64_t rx_eee_lpi_duration;
29984 	/* EEE LPI Duration Counter on RX */
29985 	uint64_t rx_llfc_physical_msgs;
29986 	/*
29987 	 * Total number of physical type Link Level Flow Control (LLFC) messages
29988 	 * received
29989 	 */
29990 	uint64_t rx_llfc_logical_msgs;
29991 	/*
29992 	 * Total number of logical type Link Level Flow Control (LLFC) messages
29993 	 * received
29994 	 */
29995 	uint64_t rx_llfc_msgs_with_crc_err;
29996 	/*
29997 	 * Total number of logical type Link Level Flow Control (LLFC) messages
29998 	 * received with CRC error
29999 	 */
30000 	uint64_t rx_hcfc_msgs;
30001 	/* Total number of HCFC messages received */
30002 	uint64_t rx_hcfc_msgs_with_crc_err;
30003 	/* Total number of HCFC messages received with CRC error */
30004 	uint64_t rx_bytes;
30005 	/* Total number of received bytes */
30006 	uint64_t rx_runt_bytes;
30007 	/* Total number of bytes received in runt frames */
30008 	uint64_t rx_runt_frames;
30009 	/* Total number of runt frames received */
30010 	uint64_t rx_stat_discard;
30011 	/* Total Rx Discards per Port reported by STATS block */
30012 	uint64_t rx_stat_err;
30013 	/* Total Rx Error Drops per Port reported by STATS block */
30014 } __attribute__((packed));
30015 
30016 /* Periodic Statistics Context DMA to host (160 bytes) */
30017 
30018 struct ctx_hw_stats {
30019 	uint64_t rx_ucast_pkts;
30020 	/* Number of received unicast packets */
30021 	uint64_t rx_mcast_pkts;
30022 	/* Number of received multicast packets */
30023 	uint64_t rx_bcast_pkts;
30024 	/* Number of received broadcast packets */
30025 	uint64_t rx_discard_pkts;
30026 	/* Number of discarded packets on received path */
30027 	uint64_t rx_drop_pkts;
30028 	/* Number of dropped packets on received path */
30029 	uint64_t rx_ucast_bytes;
30030 	/* Number of received bytes for unicast traffic */
30031 	uint64_t rx_mcast_bytes;
30032 	/* Number of received bytes for multicast traffic */
30033 	uint64_t rx_bcast_bytes;
30034 	/* Number of received bytes for broadcast traffic */
30035 	uint64_t tx_ucast_pkts;
30036 	/* Number of transmitted unicast packets */
30037 	uint64_t tx_mcast_pkts;
30038 	/* Number of transmitted multicast packets */
30039 	uint64_t tx_bcast_pkts;
30040 	/* Number of transmitted broadcast packets */
30041 	uint64_t tx_discard_pkts;
30042 	/* Number of discarded packets on transmit path */
30043 	uint64_t tx_drop_pkts;
30044 	/* Number of dropped packets on transmit path */
30045 	uint64_t tx_ucast_bytes;
30046 	/* Number of transmitted bytes for unicast traffic */
30047 	uint64_t tx_mcast_bytes;
30048 	/* Number of transmitted bytes for multicast traffic */
30049 	uint64_t tx_bcast_bytes;
30050 	/* Number of transmitted bytes for broadcast traffic */
30051 	uint64_t tpa_pkts;
30052 	/* Number of TPA packets */
30053 	uint64_t tpa_bytes;
30054 	/* Number of TPA bytes */
30055 	uint64_t tpa_events;
30056 	/* Number of TPA events */
30057 	uint64_t tpa_aborts;
30058 	/* Number of TPA aborts */
30059 } __attribute__((packed));
30060 
30061 /* Structure data header (16 bytes) */
30062 
30063 struct hwrm_struct_hdr {
30064 	uint16_t struct_id;
30065 	/* This value indicates the structured data ID. */
30066 	/* LLDP configuration structured data ID. */
30067 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_CFG		UINT32_C(0x41b)
30068 	/* DCBX ETS configuration structured data ID. */
30069 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_ETS		UINT32_C(0x41d)
30070 	/* DCBX PFC configuration structured data ID. */
30071 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_PFC		UINT32_C(0x41f)
30072 	/* DCBX APP configuration structured data ID. */
30073 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP		UINT32_C(0x421)
30074 	/*
30075 	 * DCBX state configuration structured data ID for all DCBX
30076 	 * features.
30077 	 */
30078 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_FEATURE_STATE	UINT32_C(0x422)
30079 	/*
30080 	 * LLDP generic structured data ID. This is used with
30081 	 * GET_STRUCTURED_DATA only.
30082 	 */
30083 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_GENERIC		UINT32_C(0x424)
30084 	/*
30085 	 * LLDP device structured data ID. This is used with
30086 	 * GET_STRUCTURED_DATA only.
30087 	 */
30088 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_DEVICE		UINT32_C(0x426)
30089 	/* reserved for AFM usage. */
30090 	#define HWRM_STRUCT_HDR_STRUCT_ID_AFM_OPAQUE		UINT32_C(0x1)
30091 	/* Port description. */
30092 	#define HWRM_STRUCT_HDR_STRUCT_ID_PORT_DESCRIPTION	UINT32_C(0xa)
30093 	/* RSSv2 Configuration. */
30094 	#define HWRM_STRUCT_HDR_STRUCT_ID_RSS_V2		UINT32_C(0x64)
30095 	uint16_t len;
30096 	/* This value indicates the length of structured data. */
30097 	uint8_t version;
30098 	/* This value indicates the version of structured data. */
30099 	uint8_t count;
30100 	/* This value indicates the number of structured data elements. */
30101 	uint16_t subtype;
30102 	/* This value indicates the subtype. */
30103 	uint16_t next_offset;
30104 	/*
30105 	 * This value indicates the count of 64-bit values that point to the
30106 	 * next header. A value of 0 means that this is the last element. The
30107 	 * value is a count of 64-bit words from the beginning of the current
30108 	 * header.
30109 	 */
30110 	/* This value indicates this is the last element */
30111 	#define HWRM_STRUCT_HDR_NEXT_OFFSET_LAST		UINT32_C(0x0)
30112 	uint16_t unused_0[3];
30113 } __attribute__((packed));
30114 
30115 /* DCBX ETS configuration structure (1053) (32 bytes) */
30116 
30117 struct hwrm_struct_data_dcbx_ets {
30118 	uint8_t destination;
30119 	/*
30120 	 * This field indicates if this configuration is ETS recommendation or
30121 	 * ETS configuration. A value 1 means it is ETS configuration, A value
30122 	 * of 2 means it is a ETS recommendation.
30123 	 */
30124 	/* ETS configuration */
30125 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_CONFIGURATION UINT32_C(0x1)
30126 	/* ETS recommendation */
30127 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION UINT32_C(0x2)
30128 	uint8_t max_tcs;
30129 	/* This value indicates maximum ETS TCs supported. */
30130 	uint16_t unused_0;
30131 	/* unused. */
30132 	uint8_t pri0_to_tc_map;
30133 	/* ETS priority 0 to TC map. */
30134 	uint8_t pri1_to_tc_map;
30135 	/* ETS priority 1 to TC map. */
30136 	uint8_t pri2_to_tc_map;
30137 	/* ETS priority 2 to TC map. */
30138 	uint8_t pri3_to_tc_map;
30139 	/* ETS priority 3 to TC map. */
30140 	uint8_t pri4_to_tc_map;
30141 	/* ETS priority 4 to TC map. */
30142 	uint8_t pri5_to_tc_map;
30143 	/* ETS priority 5 to TC map. */
30144 	uint8_t pri6_to_tc_map;
30145 	/* ETS priority 6 to TC map. */
30146 	uint8_t pri7_to_tc_map;
30147 	/* ETS priority 7 to TC map. */
30148 	uint8_t tc0_to_bw_map;
30149 	/* ETS TC 0 to bandwidth map. */
30150 	uint8_t tc1_to_bw_map;
30151 	/* ETS TC 1 to bandwidth map. */
30152 	uint8_t tc2_to_bw_map;
30153 	/* ETS TC 2 to bandwidth map. */
30154 	uint8_t tc3_to_bw_map;
30155 	/* ETS TC 3 to bandwidth map. */
30156 	uint8_t tc4_to_bw_map;
30157 	/* ETS TC 4 to bandwidth map. */
30158 	uint8_t tc5_to_bw_map;
30159 	/* ETS TC 5 to bandwidth map. */
30160 	uint8_t tc6_to_bw_map;
30161 	/* ETS TC 6 to bandwidth map. */
30162 	uint8_t tc7_to_bw_map;
30163 	/* ETS TC 7 to bandwidth map. */
30164 	uint8_t tc0_to_tsa_map;
30165 	/* ETS TC 0 to TSA map. */
30166 	/* strict priority */
30167 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_SP UINT32_C(0x0)
30168 	/* credit based shaper */
30169 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_CBS UINT32_C(0x1)
30170 	/* ETS */
30171 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_ETS UINT32_C(0x2)
30172 	/* vendor specific */
30173 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC UINT32_C(0xff)
30174 	uint8_t tc1_to_tsa_map;
30175 	/* ETS TC 1 to TSA map. */
30176 	uint8_t tc2_to_tsa_map;
30177 	/* ETS TC 2 to TSA map. */
30178 	uint8_t tc3_to_tsa_map;
30179 	/* ETS TC 3 to TSA map. */
30180 	uint8_t tc4_to_tsa_map;
30181 	/* ETS TC 4 to TSA map. */
30182 	uint8_t tc5_to_tsa_map;
30183 	/* ETS TC 5 to TSA map. */
30184 	uint8_t tc6_to_tsa_map;
30185 	/* ETS TC 6 to TSA map. */
30186 	uint8_t tc7_to_tsa_map;
30187 	/* ETS TC 7 to TSA map. */
30188 	uint32_t unused_1;
30189 } __attribute__((packed));
30190 
30191 /* DCBX PFC configuration structure (1055) (8 bytes) */
30192 
30193 struct hwrm_struct_data_dcbx_pfc {
30194 	uint8_t pfc_priority_bitmap;
30195 	/*
30196 	 * This field indicates PFC priority bit map. A value of '0' indicates
30197 	 * PFC is disabled. A value of '1' indicates PFC is enabled on that
30198 	 * priority.
30199 	 */
30200 	uint8_t max_pfc_tcs;
30201 	/*
30202 	 * This field indicates max PFC TCs supported. Each PFC TC will map to a
30203 	 * lossless CoS queue.
30204 	 */
30205 	uint8_t mbc;
30206 	/*
30207 	 * This field indicates if MACSec bypass capability is enabled. A value
30208 	 * of '1' indicates MBC is enabled. A value of '0' indicates MBC is
30209 	 * disabled.
30210 	 */
30211 	uint8_t unused_0[5];
30212 } __attribute__((packed));
30213 
30214 /* DCBX Application configuration structure (1057) (8 bytes) */
30215 
30216 struct hwrm_struct_data_dcbx_app {
30217 	uint16_t protocol_id; /* big endian */
30218 	/*
30219 	 * This field indicates the protocol identifier. This should be
30220 	 * specified in big endian format.
30221 	 */
30222 	uint8_t protocol_selector;
30223 	/*
30224 	 * This field indicates the protocol selector. The valid values are
30225 	 * mentioned below.
30226 	 */
30227 	/* ether type */
30228 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_ETHER_TYPE UINT32_C(0x1)
30229 	/* TCP port */
30230 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_PORT UINT32_C(0x2)
30231 	/* UDP port */
30232 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_UDP_PORT UINT32_C(0x3)
30233 	/* TCP & UDP port */
30234 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT UINT32_C(0x4)
30235 	uint8_t priority;
30236 	/* This field indicates application priority. */
30237 	uint8_t valid;
30238 	/* This field indicates this entry is valid. */
30239 	uint8_t unused_0[3];
30240 } __attribute__((packed));
30241 
30242 /* DCBX feature states configuration structure (1058) (8 bytes) */
30243 
30244 struct hwrm_struct_data_dcbx_feature_state {
30245 	uint8_t dcbx_mode;
30246 	/* DCBX mode - IEEE or CEE. This is read only field. */
30247 	/* DCBX disabled mode. */
30248 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_DISABLED UINT32_C(0x0)
30249 	/* DCBX IEEE mode. */
30250 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_IEEE UINT32_C(0x1)
30251 	/* DCBX CEE mode. */
30252 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE UINT32_C(0x2)
30253 	uint8_t ets_state;
30254 	/* ETS TLV state. */
30255 	uint8_t pfc_state;
30256 	/* PFC TLV state. */
30257 	uint8_t app_state;
30258 	/* App TLV state. */
30259 	/* Feature enable bit position. */
30260 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ENABLE_BIT_POS UINT32_C(0x7)
30261 	/* Feature willing bit position. */
30262 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_WILLING_BIT_POS UINT32_C(0x6)
30263 	/* Feature advertise bit position. */
30264 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS UINT32_C(0x5)
30265 	uint8_t unused_0[3];
30266 	/* unused. */
30267 	uint8_t resets;
30268 	/*
30269 	 * This field is used to reset the DCBX configuration to factory
30270 	 * defaults.
30271 	 */
30272 	/* reset ETS configuration. */
30273 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_ETS UINT32_C(0x1)
30274 	/* reset PFC configuration. */
30275 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_PFC UINT32_C(0x2)
30276 	/* reset application configuration. */
30277 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_APP UINT32_C(0x4)
30278 	/* reset DCBX state configuration. */
30279 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE UINT32_C(0x8)
30280 } __attribute__((packed));
30281 
30282 /* LLDP TLVs transmit configuration structure (1051) (8 bytes) */
30283 
30284 struct hwrm_struct_data_lldp {
30285 	uint8_t admin_state;
30286 	/* Port admin state */
30287 	/* Disable both Tx and Rx */
30288 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_DISABLE	UINT32_C(0x0)
30289 	/* Enable Tx only */
30290 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_TX		UINT32_C(0x1)
30291 	/* Enable Rx only */
30292 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_RX		UINT32_C(0x2)
30293 	/* Enable both Tx and Rx */
30294 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE	UINT32_C(0x3)
30295 	uint8_t port_description_state;
30296 	/* Port desciption TLV transmit state (enable(1)/disable(0)). */
30297 	/* Disable */
30298 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_DISABLE UINT32_C(0x0)
30299 	/* Enable */
30300 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE UINT32_C(0x1)
30301 	uint8_t system_name_state;
30302 	/* System name TLV transmit state (enable(1)/disable(0)). */
30303 	/* Disable */
30304 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_DISABLE   UINT32_C(0x0)
30305 	/* Enable */
30306 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE	UINT32_C(0x1)
30307 	uint8_t system_desc_state;
30308 	/* System desciption TLV transmit state (enable(1)/disable(0)). */
30309 	/* Disable */
30310 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_DISABLE   UINT32_C(0x0)
30311 	/* Enable */
30312 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE	UINT32_C(0x1)
30313 	uint8_t system_cap_state;
30314 	/* System capabilities TLV transmit state (enable(1)/disable(0)). */
30315 	/* Disable */
30316 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_DISABLE	UINT32_C(0x0)
30317 	/* Enable */
30318 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE	UINT32_C(0x1)
30319 	uint8_t mgmt_addr_state;
30320 	/* Management address TLV transmit state (enable(1)/disable(0)). */
30321 	/* Disable */
30322 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_DISABLE	UINT32_C(0x0)
30323 	/* Enable */
30324 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE	UINT32_C(0x1)
30325 	uint8_t async_event_notification_state;
30326 	/* Async event notification state (enable(1)/disable(0)). */
30327 	/* Disable */
30328 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_DISABLE UINT32_C(0x0)
30329 	/* Enable */
30330 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE UINT32_C(0x1)
30331 	uint8_t unused_0;
30332 } __attribute__((packed));
30333 
30334 /* LLDP generic TLV configuration (1060) (16 bytes) */
30335 
30336 struct hwrm_struct_data_lldp_generic {
30337 	uint8_t tlv_type;
30338 	/* TLV type. */
30339 	/* Chassis ID TLV */
30340 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_CHASSIS	UINT32_C(0x1)
30341 	/* Port ID TLV */
30342 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT	UINT32_C(0x2)
30343 	/* System name TLV */
30344 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_NAME UINT32_C(0x3)
30345 	/* System description TLV */
30346 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_DESCRIPTION UINT32_C(0x4)
30347 	/* Port name TLV */
30348 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_NAME  UINT32_C(0x5)
30349 	/* Port description TLV */
30350 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION UINT32_C(0x6)
30351 	uint8_t subtype;
30352 	/* TLV sub-type. */
30353 	uint8_t length;
30354 	/* Length. */
30355 	uint8_t unused_0;
30356 	/* unused. */
30357 	uint32_t unused_1;
30358 	uint32_t tlv_value[64];
30359 	/* TLV value. */
30360 } __attribute__((packed));
30361 
30362 /* LLDP device TLV configuration (1062) (64 bytes) */
30363 
30364 struct hwrm_struct_data_lldp_device {
30365 	uint16_t ttl;
30366 	/* Time to Live. */
30367 	uint8_t mgmt_addr_len;
30368 	/* Management address length. */
30369 	uint8_t mgmt_addr_type;
30370 	/* Management address type. */
30371 	uint32_t unused_0;
30372 	uint32_t mgmt_addr[8];
30373 	/* Management address. */
30374 	uint32_t system_caps;
30375 	/* System capabilities. */
30376 	uint8_t intf_num_type;
30377 	/* Interface number type. */
30378 	uint8_t mgmt_addr_oid_length;
30379 	/* Management address OID length. */
30380 	uint8_t unused_1;
30381 	uint8_t unused_2;
30382 	uint32_t intf_num;
30383 	/* Interface number. */
30384 	uint32_t unused_3;
30385 	uint32_t mgmt_addr_oid[32];
30386 	/* Management address OID. */
30387 } __attribute__((packed));
30388 
30389 /* port description (10) (8 bytes) */
30390 
30391 struct hwrm_struct_data_port_description {
30392 	uint8_t port_id;
30393 	/*
30394 	 * Port #. Port number starts at 0 and anything greater than number of
30395 	 * ports minus 1 is an error.
30396 	 */
30397 	uint8_t unused_0[7];
30398 } __attribute__((packed));
30399 
30400 /* RSSv2 Configuration (100) (16 bytes) */
30401 
30402 struct hwrm_struct_data_rss_v2 {
30403 	uint16_t flags;
30404 	/* When this bit is '1', the hash type and hash key are included. */
30405 	#define HWRM_STRUCT_DATA_RSS_V2_FLAGS_HASH_VALID	UINT32_C(0x1)
30406 	uint16_t rss_ctx_id;
30407 	/* RSS Context index. */
30408 	uint16_t num_ring_groups;
30409 	/* Number ring group IDs. */
30410 	uint16_t hash_type;
30411 	/*
30412 	 * When this bit is '1', the RSS hash shall be computed over source and
30413 	 * destination IPv4 addresses of IPv4 packets.
30414 	 */
30415 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV4		UINT32_C(0x1)
30416 	/*
30417 	 * When this bit is '1', the RSS hash shall be computed over
30418 	 * source/destination IPv4 addresses and source/destination ports of
30419 	 * TCP/IPv4 packets.
30420 	 */
30421 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
30422 	/*
30423 	 * When this bit is '1', the RSS hash shall be computed over
30424 	 * source/destination IPv4 addresses and source/destination ports of
30425 	 * UDP/IPv4 packets.
30426 	 */
30427 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
30428 	/*
30429 	 * When this bit is '1', the RSS hash shall be computed over source and
30430 	 * destination IPv4 addresses of IPv6 packets.
30431 	 */
30432 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV6		UINT32_C(0x8)
30433 	/*
30434 	 * When this bit is '1', the RSS hash shall be computed over
30435 	 * source/destination IPv6 addresses and source/destination ports of
30436 	 * TCP/IPv6 packets.
30437 	 */
30438 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
30439 	/*
30440 	 * When this bit is '1', the RSS hash shall be computed over
30441 	 * source/destination IPv6 addresses and source/destination ports of
30442 	 * UDP/IPv6 packets.
30443 	 */
30444 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
30445 	uint64_t hash_key_ring_group_ids;
30446 	/* Variable size data. Hash key (optional) followed by ring_group_ids. */
30447 } __attribute__((packed));
30448 
30449 #endif /* _HSI_STRUCT_DEF_EXTERNAL_H_ */
30450