354f9a93a2a6b969c8045b76c6db231e43f691e5
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2019 Broadcom Limited
3  * All rights reserved.
4  *
5  * DO NOT MODIFY!!! This file is automatically generated.
6  */
7
8 #ifndef _HSI_STRUCT_DEF_DPDK_H_
9 #define _HSI_STRUCT_DEF_DPDK_H_
10
11 /* This is the HWRM command header. */
12 /* hwrm_cmd_hdr (size:128b/16B) */
13 struct hwrm_cmd_hdr {
14         /* The HWRM command request type. */
15         uint16_t        req_type;
16         /*
17          * The completion ring to send the completion event on. This should
18          * be the NQ ID returned from the `nq_alloc` HWRM command.
19          */
20         uint16_t        cmpl_ring;
21         /*
22          * The sequence ID is used by the driver for tracking multiple
23          * commands. This ID is treated as opaque data by the firmware and
24          * the value is returned in the `hwrm_resp_hdr` upon completion.
25          */
26         uint16_t        seq_id;
27         /*
28          * The target ID of the command:
29          * * 0x0-0xFFF8 - The function ID
30          * * 0xFFF8-0xFFFE - Reserved for internal processors
31          * * 0xFFFF - HWRM
32          */
33         uint16_t        target_id;
34         /*
35          * A physical address pointer pointing to a host buffer that the
36          * command's response data will be written. This can be either a host
37          * physical address (HPA) or a guest physical address (GPA) and must
38          * point to a physically contiguous block of memory.
39          */
40         uint64_t        resp_addr;
41 } __attribute__((packed));
42
43 /* This is the HWRM response header. */
44 /* hwrm_resp_hdr (size:64b/8B) */
45 struct hwrm_resp_hdr {
46         /* The specific error status for the command. */
47         uint16_t        error_code;
48         /* The HWRM command request type. */
49         uint16_t        req_type;
50         /* The sequence ID from the original command. */
51         uint16_t        seq_id;
52         /* The length of the response data in number of bytes. */
53         uint16_t        resp_len;
54 } __attribute__((packed));
55
56 /*
57  * TLV encapsulated message. Use the TLV type field of the
58  * TLV to determine the type of message encapsulated.
59  */
60 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
61 #define CMD_DISCR_LAST     CMD_DISCR_TLV_ENCAP
62
63
64 /* HWRM request message */
65 #define TLV_TYPE_HWRM_REQUEST                    UINT32_C(0x1)
66 /* HWRM response message */
67 #define TLV_TYPE_HWRM_RESPONSE                   UINT32_C(0x2)
68 /* RoCE slow path command */
69 #define TLV_TYPE_ROCE_SP_COMMAND                 UINT32_C(0x3)
70 /* RoCE slow path command to query CC Gen1 support. */
71 #define TLV_TYPE_QUERY_ROCE_CC_GEN1              UINT32_C(0x4)
72 /* RoCE slow path command to modify CC Gen1 support. */
73 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1             UINT32_C(0x5)
74 /* Engine CKV - The device's serial number. */
75 #define TLV_TYPE_ENGINE_CKV_DEVICE_SERIAL_NUMBER UINT32_C(0x8001)
76 /* Engine CKV - Per-function random nonce data. */
77 #define TLV_TYPE_ENGINE_CKV_NONCE                UINT32_C(0x8002)
78 /* Engine CKV - Initialization vector. */
79 #define TLV_TYPE_ENGINE_CKV_IV                   UINT32_C(0x8003)
80 /* Engine CKV - Authentication tag. */
81 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG             UINT32_C(0x8004)
82 /* Engine CKV - The encrypted data. */
83 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT           UINT32_C(0x8005)
84 /* Engine CKV - Supported algorithms. */
85 #define TLV_TYPE_ENGINE_CKV_ALGORITHMS           UINT32_C(0x8006)
86 /* Engine CKV - The EC curve name and ECC public key information. */
87 #define TLV_TYPE_ENGINE_CKV_ECC_PUBLIC_KEY       UINT32_C(0x8007)
88 /* Engine CKV - The ECDSA signature. */
89 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE      UINT32_C(0x8008)
90 #define TLV_TYPE_LAST \
91         TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE
92
93
94 /* tlv (size:64b/8B) */
95 struct tlv {
96         /*
97          * The command discriminator is used to differentiate between various
98          * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
99          * command messages as well as newer TLV encapsulated HWRM commands.
100          *
101          * For TLV encapsulated messages this field must be 0x8000.
102          */
103         uint16_t        cmd_discr;
104         uint8_t reserved_8b;
105         uint8_t flags;
106         /*
107          * Indicates the presence of additional TLV encapsulated data
108          * follows this TLV.
109          */
110         #define TLV_FLAGS_MORE         UINT32_C(0x1)
111         /* Last TLV in a sequence of TLVs. */
112         #define TLV_FLAGS_MORE_LAST      UINT32_C(0x0)
113         /* More TLVs follow this TLV. */
114         #define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
115         /*
116          * When an HWRM receiver detects a TLV type that it does not
117          * support with the TLV required flag set, the receiver must
118          * reject the HWRM message with an error code indicating an
119          * unsupported TLV type.
120          */
121         #define TLV_FLAGS_REQUIRED     UINT32_C(0x2)
122         /* No */
123         #define TLV_FLAGS_REQUIRED_NO    (UINT32_C(0x0) << 1)
124         /* Yes */
125         #define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
126         #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
127         /*
128          * This field defines the TLV type value which is divided into
129          * two ranges to differentiate between global and local TLV types.
130          * Global TLV types must be unique across all defined TLV types.
131          * Local TLV types are valid only for extensions to a given
132          * HWRM message and may be repeated across different HWRM message
133          * types. There is a direct correlation of each HWRM message type
134          * to a single global TLV type value.
135          *
136          * Global TLV range: `0 - (63k-1)`
137          *
138          * Local TLV range: `63k - (64k-1)`
139          */
140         uint16_t        tlv_type;
141         /*
142          * Length of the message data encapsulated by this TLV in bytes.
143          * This length does not include the size of the TLV header itself
144          * and it must be an integer multiple of 8B.
145          */
146         uint16_t        length;
147 } __attribute__((packed));
148
149 /* Input */
150 /* input (size:128b/16B) */
151 struct input {
152         /*
153          * This value indicates what type of request this is.  The format
154          * for the rest of the command is determined by this field.
155          */
156         uint16_t        req_type;
157         /*
158          * This value indicates the what completion ring the request will
159          * be optionally completed on.  If the value is -1, then no
160          * CR completion will be generated.  Any other value must be a
161          * valid CR ring_id value for this function.
162          */
163         uint16_t        cmpl_ring;
164         /* This value indicates the command sequence number. */
165         uint16_t        seq_id;
166         /*
167          * Target ID of this command.
168          *
169          * 0x0 - 0xFFF8 - Used for function ids
170          * 0xFFF8 - 0xFFFE - Reserved for internal processors
171          * 0xFFFF - HWRM
172          */
173         uint16_t        target_id;
174         /*
175          * This is the host address where the response will be written
176          * when the request is complete.  This area must be 16B aligned
177          * and must be cleared to zero before the request is made.
178          */
179         uint64_t        resp_addr;
180 } __attribute__((packed));
181
182 /* Output */
183 /* output (size:64b/8B) */
184 struct output {
185         /*
186          * Pass/Fail or error type
187          *
188          * Note: receiver to verify the in parameters, and fail the call
189          * with an error when appropriate
190          */
191         uint16_t        error_code;
192         /* This field returns the type of original request. */
193         uint16_t        req_type;
194         /* This field provides original sequence number of the command. */
195         uint16_t        seq_id;
196         /*
197          * This field is the length of the response in bytes.  The
198          * last byte of the response is a valid flag that will read
199          * as '1' when the command has been completely written to
200          * memory.
201          */
202         uint16_t        resp_len;
203 } __attribute__((packed));
204
205 /* Short Command Structure */
206 /* hwrm_short_input (size:128b/16B) */
207 struct hwrm_short_input {
208         /*
209          * This field indicates the type of request in the request buffer.
210          * The format for the rest of the command (request) is determined
211          * by this field.
212          */
213         uint16_t        req_type;
214         /*
215          * This field indicates a signature that is used to identify short
216          * form of the command listed here. This field shall be set to
217          * 17185 (0x4321).
218          */
219         uint16_t        signature;
220         /* Signature indicating this is a short form of HWRM command */
221         #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
222         #define HWRM_SHORT_INPUT_SIGNATURE_LAST \
223                 HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
224         /* Reserved for future use. */
225         uint16_t        unused_0;
226         /* This value indicates the length of the request. */
227         uint16_t        size;
228         /*
229          * This is the host address where the request was written.
230          * This area must be 16B aligned.
231          */
232         uint64_t        req_addr;
233 } __attribute__((packed));
234
235 /*
236  * Command numbering
237  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
238  * #        So only structure definition is provided here.
239  */
240 /* cmd_nums (size:64b/8B) */
241 struct cmd_nums {
242         /*
243          * This version of the specification defines the commands listed in
244          * the table below. The following are general implementation
245          * requirements for these commands:
246          *
247          * # All commands listed below that are marked neither
248          * reserved nor experimental shall be implemented by the HWRM.
249          * # A HWRM client compliant to this specification should not use
250          * commands outside of the list below.
251          * # A HWRM client compliant to this specification should not use
252          * command numbers marked reserved below.
253          * # A command marked experimental below may not be implemented
254          * by the HWRM.
255          * # A command marked experimental may change in the
256          * future version of the HWRM specification.
257          * # A command not listed below may be implemented by the HWRM.
258          * The behavior of commands that are not listed below is outside
259          * the scope of this specification.
260          */
261         uint16_t        req_type;
262         #define HWRM_VER_GET                              UINT32_C(0x0)
263         #define HWRM_FUNC_DRV_IF_CHANGE                   UINT32_C(0xd)
264         #define HWRM_FUNC_BUF_UNRGTR                      UINT32_C(0xe)
265         #define HWRM_FUNC_VF_CFG                          UINT32_C(0xf)
266         /* Reserved for future use. */
267         #define HWRM_RESERVED1                            UINT32_C(0x10)
268         #define HWRM_FUNC_RESET                           UINT32_C(0x11)
269         #define HWRM_FUNC_GETFID                          UINT32_C(0x12)
270         #define HWRM_FUNC_VF_ALLOC                        UINT32_C(0x13)
271         #define HWRM_FUNC_VF_FREE                         UINT32_C(0x14)
272         #define HWRM_FUNC_QCAPS                           UINT32_C(0x15)
273         #define HWRM_FUNC_QCFG                            UINT32_C(0x16)
274         #define HWRM_FUNC_CFG                             UINT32_C(0x17)
275         #define HWRM_FUNC_QSTATS                          UINT32_C(0x18)
276         #define HWRM_FUNC_CLR_STATS                       UINT32_C(0x19)
277         #define HWRM_FUNC_DRV_UNRGTR                      UINT32_C(0x1a)
278         #define HWRM_FUNC_VF_RESC_FREE                    UINT32_C(0x1b)
279         #define HWRM_FUNC_VF_VNIC_IDS_QUERY               UINT32_C(0x1c)
280         #define HWRM_FUNC_DRV_RGTR                        UINT32_C(0x1d)
281         #define HWRM_FUNC_DRV_QVER                        UINT32_C(0x1e)
282         #define HWRM_FUNC_BUF_RGTR                        UINT32_C(0x1f)
283         #define HWRM_PORT_PHY_CFG                         UINT32_C(0x20)
284         #define HWRM_PORT_MAC_CFG                         UINT32_C(0x21)
285         /* Experimental */
286         #define HWRM_PORT_TS_QUERY                        UINT32_C(0x22)
287         #define HWRM_PORT_QSTATS                          UINT32_C(0x23)
288         #define HWRM_PORT_LPBK_QSTATS                     UINT32_C(0x24)
289         /* Experimental */
290         #define HWRM_PORT_CLR_STATS                       UINT32_C(0x25)
291         /* Experimental */
292         #define HWRM_PORT_LPBK_CLR_STATS                  UINT32_C(0x26)
293         #define HWRM_PORT_PHY_QCFG                        UINT32_C(0x27)
294         #define HWRM_PORT_MAC_QCFG                        UINT32_C(0x28)
295         /* Experimental */
296         #define HWRM_PORT_MAC_PTP_QCFG                    UINT32_C(0x29)
297         #define HWRM_PORT_PHY_QCAPS                       UINT32_C(0x2a)
298         #define HWRM_PORT_PHY_I2C_WRITE                   UINT32_C(0x2b)
299         #define HWRM_PORT_PHY_I2C_READ                    UINT32_C(0x2c)
300         #define HWRM_PORT_LED_CFG                         UINT32_C(0x2d)
301         #define HWRM_PORT_LED_QCFG                        UINT32_C(0x2e)
302         #define HWRM_PORT_LED_QCAPS                       UINT32_C(0x2f)
303         #define HWRM_QUEUE_QPORTCFG                       UINT32_C(0x30)
304         #define HWRM_QUEUE_QCFG                           UINT32_C(0x31)
305         #define HWRM_QUEUE_CFG                            UINT32_C(0x32)
306         #define HWRM_FUNC_VLAN_CFG                        UINT32_C(0x33)
307         #define HWRM_FUNC_VLAN_QCFG                       UINT32_C(0x34)
308         #define HWRM_QUEUE_PFCENABLE_QCFG                 UINT32_C(0x35)
309         #define HWRM_QUEUE_PFCENABLE_CFG                  UINT32_C(0x36)
310         #define HWRM_QUEUE_PRI2COS_QCFG                   UINT32_C(0x37)
311         #define HWRM_QUEUE_PRI2COS_CFG                    UINT32_C(0x38)
312         #define HWRM_QUEUE_COS2BW_QCFG                    UINT32_C(0x39)
313         #define HWRM_QUEUE_COS2BW_CFG                     UINT32_C(0x3a)
314         /* Experimental */
315         #define HWRM_QUEUE_DSCP_QCAPS                     UINT32_C(0x3b)
316         /* Experimental */
317         #define HWRM_QUEUE_DSCP2PRI_QCFG                  UINT32_C(0x3c)
318         /* Experimental */
319         #define HWRM_QUEUE_DSCP2PRI_CFG                   UINT32_C(0x3d)
320         #define HWRM_VNIC_ALLOC                           UINT32_C(0x40)
321         #define HWRM_VNIC_FREE                            UINT32_C(0x41)
322         #define HWRM_VNIC_CFG                             UINT32_C(0x42)
323         #define HWRM_VNIC_QCFG                            UINT32_C(0x43)
324         #define HWRM_VNIC_TPA_CFG                         UINT32_C(0x44)
325         /* Experimental */
326         #define HWRM_VNIC_TPA_QCFG                        UINT32_C(0x45)
327         #define HWRM_VNIC_RSS_CFG                         UINT32_C(0x46)
328         #define HWRM_VNIC_RSS_QCFG                        UINT32_C(0x47)
329         #define HWRM_VNIC_PLCMODES_CFG                    UINT32_C(0x48)
330         #define HWRM_VNIC_PLCMODES_QCFG                   UINT32_C(0x49)
331         #define HWRM_VNIC_QCAPS                           UINT32_C(0x4a)
332         #define HWRM_RING_ALLOC                           UINT32_C(0x50)
333         #define HWRM_RING_FREE                            UINT32_C(0x51)
334         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS        UINT32_C(0x52)
335         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS     UINT32_C(0x53)
336         #define HWRM_RING_AGGINT_QCAPS                    UINT32_C(0x54)
337         #define HWRM_RING_RESET                           UINT32_C(0x5e)
338         #define HWRM_RING_GRP_ALLOC                       UINT32_C(0x60)
339         #define HWRM_RING_GRP_FREE                        UINT32_C(0x61)
340         /* Reserved for future use. */
341         #define HWRM_RESERVED5                            UINT32_C(0x64)
342         /* Reserved for future use. */
343         #define HWRM_RESERVED6                            UINT32_C(0x65)
344         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC            UINT32_C(0x70)
345         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE             UINT32_C(0x71)
346         #define HWRM_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
347         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
348         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
349         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
350         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
351         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
352         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
353         /* Experimental */
354         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
355         /* Experimental */
356         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
357         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
358         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
359         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
360         /* Experimental */
361         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
362         /* Experimental */
363         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
364         /* Experimental */
365         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
366         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
367         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
368         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
369         #define HWRM_STAT_CTX_ENG_QUERY                   UINT32_C(0xaf)
370         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
371         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
372         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
373         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
374         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
375         #define HWRM_FW_RESET                             UINT32_C(0xc0)
376         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
377         #define HWRM_FW_HEALTH_CHECK                      UINT32_C(0xc2)
378         #define HWRM_FW_SYNC                              UINT32_C(0xc3)
379         /* Experimental */
380         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
381         /* Experimental */
382         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
383         /* Experimental */
384         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
385         /* Experimental */
386         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
387         /* Experimental */
388         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
389         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
390         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
391         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
392         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
393         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
394         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
395         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
396         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
397         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
398         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
399         /* Experimental */
400         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
401         /* Experimental */
402         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
403         /* Experimental */
404         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
405         /* Experimental */
406         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
407         /* Experimental */
408         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
409         /* Experimental */
410         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
411         /* Experimental */
412         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
413         /* Experimental */
414         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
415         /* Experimental */
416         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
417         /* Experimental */
418         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
419         /* Experimental */
420         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
421         /* Experimental */
422         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
423         /* Experimental */
424         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
425         /* Experimental */
426         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
427         /* Experimental */
428         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
429         /* Experimental */
430         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
431         /* Experimental */
432         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
433         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
434         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
435         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
436         /* Experimental */
437         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
438         /* Experimental */
439         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
440         /* Experimental */
441         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
442         /* Experimental */
443         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
444         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
445         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE       UINT32_C(0x112)
446         /* Experimental */
447         #define HWRM_CFA_FLOW_AGING_TIMER_RESET           UINT32_C(0x113)
448         /* Experimental */
449         #define HWRM_CFA_FLOW_AGING_CFG                   UINT32_C(0x114)
450         /* Experimental */
451         #define HWRM_CFA_FLOW_AGING_QCFG                  UINT32_C(0x115)
452         /* Experimental */
453         #define HWRM_CFA_FLOW_AGING_QCAPS                 UINT32_C(0x116)
454         /* Engine CKV - Ping the device and SRT firmware to get the public key. */
455         #define HWRM_ENGINE_CKV_HELLO                     UINT32_C(0x12d)
456         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
457         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
458         /* Engine CKV - Add a new CKEK used to encrypt keys. */
459         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
460         /* Engine CKV - Delete a previously added CKEK. */
461         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
462         /* Engine CKV - Add a new key to the key vault. */
463         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
464         /* Engine CKV - Delete a key from the key vault. */
465         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
466         /* Engine CKV - Delete all keys from the key vault. */
467         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
468         /* Engine CKV - Get random data. */
469         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
470         /* Engine CKV - Generate and encrypt a new AES key. */
471         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
472         /* Engine - Query the available queue groups configuration. */
473         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
474         /* Engine - Query the queue groups assigned to a function. */
475         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
476         /* Engine - Query the available queue group meter profile configuration. */
477         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
478         /* Engine - Query the configuration of a queue group meter profile. */
479         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
480         /* Engine - Allocate a queue group meter profile. */
481         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
482         /* Engine - Free a queue group meter profile. */
483         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
484         /* Engine - Query the meters assigned to a queue group. */
485         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
486         /* Engine - Bind a queue group meter profile to a queue group. */
487         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
488         /* Engine - Unbind a queue group meter profile from a queue group. */
489         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
490         /* Engine - Bind a queue group to a function. */
491         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
492         /* Engine - Query the scheduling group configuration. */
493         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
494         /* Engine - Query the queue groups assigned to a scheduling group. */
495         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
496         /* Engine - Query the configuration of a scheduling group's meter profiles. */
497         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
498         /* Engine - Configure a scheduling group's meter profiles. */
499         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
500         /* Engine - Bind a queue group to a scheduling group. */
501         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
502         /* Engine - Unbind a queue group from its scheduling group. */
503         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
504         /* Engine - Query the Engine configuration. */
505         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
506         /* Engine - Configure the statistics accumulator for an Engine. */
507         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
508         /* Engine - Clear the statistics accumulator for an Engine. */
509         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
510         /* Engine - Query the statistics accumulator for an Engine. */
511         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
512         /* Engine - Allocate an Engine RQ. */
513         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
514         /* Engine - Free an Engine RQ. */
515         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
516         /* Engine - Allocate an Engine CQ. */
517         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
518         /* Engine - Free an Engine CQ. */
519         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
520         /* Engine - Allocate an NQ. */
521         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
522         /* Engine - Free an NQ. */
523         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
524         /* Engine - Set the on-die RQE credit update location. */
525         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
526         /* Experimental */
527         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
528         /* Experimental */
529         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
530         /* Experimental */
531         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
532         /* Experimental */
533         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
534         /* Experimental */
535         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
536         /* Configures the BW of any VF */
537         #define HWRM_FUNC_VF_BW_CFG                       UINT32_C(0x195)
538         /* Queries the BW of any VF */
539         #define HWRM_FUNC_VF_BW_QCFG                      UINT32_C(0x196)
540         /* Experimental */
541         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
542         /* Experimental */
543         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
544         /* Experimental */
545         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
546         /* Experimental */
547         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
548         /* Experimental */
549         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
550         /* Experimental */
551         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
552         /* Experimental */
553         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
554         /* Experimental */
555         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
556         /* Experimental */
557         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
558         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
559         /* Experimental */
560         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
561         /* Experimental */
562         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
563         /* Experimental */
564         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
565         /* Experimental */
566         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
567         /* Experimental */
568         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
569         /* Experimental */
570         #define HWRM_DBG_FW_CLI                           UINT32_C(0xff1a)
571         /*  */
572         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
573         /*  */
574         #define HWRM_DBG_RING_INFO_GET                    UINT32_C(0xff1c)
575         /* Experimental */
576         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
577         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
578         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
579         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
580         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
581         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
582         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
583         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
584         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
585         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
586         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
587         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
588         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
589         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
590         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
591         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
592         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
593         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
594         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
595         uint16_t        unused_0[3];
596 } __attribute__((packed));
597
598 /* Return Codes */
599 /* ret_codes (size:64b/8B) */
600 struct ret_codes {
601         uint16_t        error_code;
602         /* Request was successfully executed by the HWRM. */
603         #define HWRM_ERR_CODE_SUCCESS                   UINT32_C(0x0)
604         /* The HWRM failed to execute the request. */
605         #define HWRM_ERR_CODE_FAIL                      UINT32_C(0x1)
606         /*
607          * The request contains invalid argument(s) or input
608          * parameters.
609          */
610         #define HWRM_ERR_CODE_INVALID_PARAMS            UINT32_C(0x2)
611         /*
612          * The requester is not allowed to access the requested
613          * resource. This error code shall be provided in a
614          * response to a request to query or modify an existing
615          * resource that is not accessible by the requester.
616          */
617         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED    UINT32_C(0x3)
618         /*
619          * The HWRM is unable to allocate the requested resource.
620          * This code only applies to requests for HWRM resource
621          * allocations.
622          */
623         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR      UINT32_C(0x4)
624         /*
625          * Invalid combination of flags is specified in the
626          * request.
627          */
628         #define HWRM_ERR_CODE_INVALID_FLAGS             UINT32_C(0x5)
629         /*
630          * Invalid combination of enables fields is specified in
631          * the request.
632          */
633         #define HWRM_ERR_CODE_INVALID_ENABLES           UINT32_C(0x6)
634         /*
635          * Request contains a required TLV that is not supported by
636          * the installed version of firmware.
637          */
638         #define HWRM_ERR_CODE_UNSUPPORTED_TLV           UINT32_C(0x7)
639         /*
640          * No firmware buffer available to accept the request. Driver
641          * should retry the request.
642          */
643         #define HWRM_ERR_CODE_NO_BUFFER                 UINT32_C(0x8)
644         /*
645          * This error code is only reported by firmware when some
646          * sub-option of a supported HWRM command is unsupported.
647          */
648         #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR    UINT32_C(0x9)
649         /*
650          * This error code is only reported by firmware when the specific
651          * request is not able to process when the HOT reset in progress.
652          */
653         #define HWRM_ERR_CODE_HOT_RESET_PROGRESS        UINT32_C(0xa)
654         /*
655          * This error code is only reported by firmware when the registered
656          * driver instances are not capable of hot reset.
657          */
658         #define HWRM_ERR_CODE_HOT_RESET_FAIL            UINT32_C(0xb)
659         /*
660          * Generic HWRM execution error that represents an
661          * internal error.
662          */
663         #define HWRM_ERR_CODE_HWRM_ERROR                UINT32_C(0xf)
664         /*
665          * This value indicates that the HWRM response is in TLV format and
666          * should be interpreted as one or more TLVs starting with the
667          * hwrm_resp_hdr TLV. This value is not an indicatation of any error
668          * by itself, just an indicatation that the response should be parsed
669          * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
670          */
671         #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE UINT32_C(0x8000)
672         /* Unknown error */
673         #define HWRM_ERR_CODE_UNKNOWN_ERR               UINT32_C(0xfffe)
674         /* Unsupported or invalid command */
675         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED         UINT32_C(0xffff)
676         #define HWRM_ERR_CODE_LAST \
677                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
678         uint16_t        unused_0[3];
679 } __attribute__((packed));
680
681 /* Output */
682 /* hwrm_err_output (size:128b/16B) */
683 struct hwrm_err_output {
684         /*
685          * Pass/Fail or error type
686          *
687          * Note: receiver to verify the in parameters, and fail the call
688          * with an error when appropriate
689          */
690         uint16_t        error_code;
691         /* This field returns the type of original request. */
692         uint16_t        req_type;
693         /* This field provides original sequence number of the command. */
694         uint16_t        seq_id;
695         /*
696          * This field is the length of the response in bytes.  The
697          * last byte of the response is a valid flag that will read
698          * as '1' when the command has been completely written to
699          * memory.
700          */
701         uint16_t        resp_len;
702         /* debug info for this error response. */
703         uint32_t        opaque_0;
704         /* debug info for this error response. */
705         uint16_t        opaque_1;
706         /*
707          * In the case of an error response, command specific error
708          * code is returned in this field.
709          */
710         uint8_t cmd_err;
711         /*
712          * This field is used in Output records to indicate that the output
713          * is completely written to RAM.  This field should be read as '1'
714          * to indicate that the output has been completely written.
715          * When writing a command completion or response to an internal processor,
716          * the order of writes has to be such that this field is written last.
717          */
718         uint8_t valid;
719 } __attribute__((packed));
720 /*
721  * Following is the signature for HWRM message field that indicates not
722  * applicable (All F's). Need to cast it the size of the field if needed.
723  */
724 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
725 /* hwrm_func_buf_rgtr */
726 #define HWRM_MAX_REQ_LEN 128
727 /* hwrm_selftest_qlist */
728 #define HWRM_MAX_RESP_LEN 280
729 /* 7 bit indirection table index. */
730 #define HW_HASH_INDEX_SIZE 0x80
731 #define HW_HASH_KEY_SIZE 40
732 /* valid key for HWRM response */
733 #define HWRM_RESP_VALID_KEY 1
734 #define HWRM_VERSION_MAJOR 1
735 #define HWRM_VERSION_MINOR 10
736 #define HWRM_VERSION_UPDATE 0
737 /* non-zero means beta version */
738 #define HWRM_VERSION_RSVD 19
739 #define HWRM_VERSION_STR "1.10.0.19"
740
741 /****************
742  * hwrm_ver_get *
743  ****************/
744
745
746 /* hwrm_ver_get_input (size:192b/24B) */
747 struct hwrm_ver_get_input {
748         /* The HWRM command request type. */
749         uint16_t        req_type;
750         /*
751          * The completion ring to send the completion event on. This should
752          * be the NQ ID returned from the `nq_alloc` HWRM command.
753          */
754         uint16_t        cmpl_ring;
755         /*
756          * The sequence ID is used by the driver for tracking multiple
757          * commands. This ID is treated as opaque data by the firmware and
758          * the value is returned in the `hwrm_resp_hdr` upon completion.
759          */
760         uint16_t        seq_id;
761         /*
762          * The target ID of the command:
763          * * 0x0-0xFFF8 - The function ID
764          * * 0xFFF8-0xFFFE - Reserved for internal processors
765          * * 0xFFFF - HWRM
766          */
767         uint16_t        target_id;
768         /*
769          * A physical address pointer pointing to a host buffer that the
770          * command's response data will be written. This can be either a host
771          * physical address (HPA) or a guest physical address (GPA) and must
772          * point to a physically contiguous block of memory.
773          */
774         uint64_t        resp_addr;
775         /*
776          * This field represents the major version of HWRM interface
777          * specification supported by the driver HWRM implementation.
778          * The interface major version is intended to change only when
779          * non backward compatible changes are made to the HWRM
780          * interface specification.
781          */
782         uint8_t hwrm_intf_maj;
783         /*
784          * This field represents the minor version of HWRM interface
785          * specification supported by the driver HWRM implementation.
786          * A change in interface minor version is used to reflect
787          * significant backward compatible modification to HWRM
788          * interface specification.
789          * This can be due to addition or removal of functionality.
790          * HWRM interface specifications with the same major version
791          * but different minor versions are compatible.
792          */
793         uint8_t hwrm_intf_min;
794         /*
795          * This field represents the update version of HWRM interface
796          * specification supported by the driver HWRM implementation.
797          * The interface update version is used to reflect minor
798          * changes or bug fixes to a released HWRM interface
799          * specification.
800          */
801         uint8_t hwrm_intf_upd;
802         uint8_t unused_0[5];
803 } __attribute__((packed));
804
805 /* hwrm_ver_get_output (size:1408b/176B) */
806 struct hwrm_ver_get_output {
807         /* The specific error status for the command. */
808         uint16_t        error_code;
809         /* The HWRM command request type. */
810         uint16_t        req_type;
811         /* The sequence ID from the original command. */
812         uint16_t        seq_id;
813         /* The length of the response data in number of bytes. */
814         uint16_t        resp_len;
815         /*
816          * This field represents the major version of HWRM interface
817          * specification supported by the HWRM implementation.
818          * The interface major version is intended to change only when
819          * non backward compatible changes are made to the HWRM
820          * interface specification.
821          * A HWRM implementation that is compliant with this
822          * specification shall provide value of 1 in this field.
823          */
824         uint8_t hwrm_intf_maj_8b;
825         /*
826          * This field represents the minor version of HWRM interface
827          * specification supported by the HWRM implementation.
828          * A change in interface minor version is used to reflect
829          * significant backward compatible modification to HWRM
830          * interface specification.
831          * This can be due to addition or removal of functionality.
832          * HWRM interface specifications with the same major version
833          * but different minor versions are compatible.
834          * A HWRM implementation that is compliant with this
835          * specification shall provide value of 2 in this field.
836          */
837         uint8_t hwrm_intf_min_8b;
838         /*
839          * This field represents the update version of HWRM interface
840          * specification supported by the HWRM implementation.
841          * The interface update version is used to reflect minor
842          * changes or bug fixes to a released HWRM interface
843          * specification.
844          * A HWRM implementation that is compliant with this
845          * specification shall provide value of 2 in this field.
846          */
847         uint8_t hwrm_intf_upd_8b;
848         uint8_t hwrm_intf_rsvd_8b;
849         /*
850          * This field represents the major version of HWRM firmware.
851          * A change in firmware major version represents a major
852          * firmware release.
853          */
854         uint8_t hwrm_fw_maj_8b;
855         /*
856          * This field represents the minor version of HWRM firmware.
857          * A change in firmware minor version represents significant
858          * firmware functionality changes.
859          */
860         uint8_t hwrm_fw_min_8b;
861         /*
862          * This field represents the build version of HWRM firmware.
863          * A change in firmware build version represents bug fixes
864          * to a released firmware.
865          */
866         uint8_t hwrm_fw_bld_8b;
867         /*
868          * This field is a reserved field. This field can be used to
869          * represent firmware branches or customer specific releases
870          * tied to a specific (major,minor,update) version of the
871          * HWRM firmware.
872          */
873         uint8_t hwrm_fw_rsvd_8b;
874         /*
875          * This field represents the major version of mgmt firmware.
876          * A change in major version represents a major release.
877          */
878         uint8_t mgmt_fw_maj_8b;
879         /*
880          * This field represents the minor version of mgmt firmware.
881          * A change in minor version represents significant
882          * functionality changes.
883          */
884         uint8_t mgmt_fw_min_8b;
885         /*
886          * This field represents the build version of mgmt firmware.
887          * A change in update version represents bug fixes.
888          */
889         uint8_t mgmt_fw_bld_8b;
890         /*
891          * This field is a reserved field. This field can be used to
892          * represent firmware branches or customer specific releases
893          * tied to a specific (major,minor,update) version
894          */
895         uint8_t mgmt_fw_rsvd_8b;
896         /*
897          * This field represents the major version of network
898          * control firmware.
899          * A change in major version represents a major release.
900          */
901         uint8_t netctrl_fw_maj_8b;
902         /*
903          * This field represents the minor version of network
904          * control firmware.
905          * A change in minor version represents significant
906          * functionality changes.
907          */
908         uint8_t netctrl_fw_min_8b;
909         /*
910          * This field represents the build version of network
911          * control firmware.
912          * A change in update version represents bug fixes.
913          */
914         uint8_t netctrl_fw_bld_8b;
915         /*
916          * This field is a reserved field. This field can be used to
917          * represent firmware branches or customer specific releases
918          * tied to a specific (major,minor,update) version
919          */
920         uint8_t netctrl_fw_rsvd_8b;
921         /*
922          * This field is used to indicate device's capabilities and
923          * configurations.
924          */
925         uint32_t        dev_caps_cfg;
926         /*
927          * If set to 1, then secure firmware update behavior
928          * is supported.
929          * If set to 0, then secure firmware update behavior is
930          * not supported.
931          */
932         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
933                 UINT32_C(0x1)
934         /*
935          * If set to 1, then firmware based DCBX agent is supported.
936          * If set to 0, then firmware based DCBX agent capability
937          * is not supported on this device.
938          */
939         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
940                 UINT32_C(0x2)
941         /*
942          * If set to 1, then HWRM short command format is supported.
943          * If set to 0, then HWRM short command format is not supported.
944          */
945         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
946                 UINT32_C(0x4)
947         /*
948          * If set to 1, then HWRM short command format is required.
949          * If set to 0, then HWRM short command format is not required.
950          */
951         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
952                 UINT32_C(0x8)
953         /*
954          * If set to 1, then the KONG host mailbox channel is supported.
955          * If set to 0, then the KONG host mailbox channel is not supported.
956          * By default, this flag should be 0 for older version of core firmware.
957          */
958         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \
959                 UINT32_C(0x10)
960         /*
961          * If set to 1, then the 64bit flow handle is supported in addition to the
962          * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
963          * supported. By default, this flag should be 0 for older version of core firmware.
964          */
965         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \
966                 UINT32_C(0x20)
967         /*
968          * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
969          * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
970          * If set to 0, then filter types not supported.
971          * By default, this flag should be 0 for older version of core firmware.
972          */
973         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \
974                 UINT32_C(0x40)
975         /*
976          * If set to 1, firmware is capable to support virtio vSwitch offload model.
977          * If set to 0, firmware can't supported virtio vSwitch offload model.
978          * By default, this flag should be 0 for older version of core firmware.
979          */
980         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \
981                 UINT32_C(0x80)
982         /*
983          * If set to 1, firmware is capable to support trusted VF.
984          * If set to 0, firmware is not capable to support trusted VF.
985          * By default, this flag should be 0 for older version of core firmware.
986          */
987         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \
988                 UINT32_C(0x100)
989         /*
990          * If set to 1, firmware is capable to support flow aging.
991          * If set to 0, firmware is not capable to support flow aging.
992          * By default, this flag should be 0 for older version of core firmware.
993          */
994         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED \
995                 UINT32_C(0x200)
996         /*
997          * This field represents the major version of RoCE firmware.
998          * A change in major version represents a major release.
999          */
1000         uint8_t roce_fw_maj_8b;
1001         /*
1002          * This field represents the minor version of RoCE firmware.
1003          * A change in minor version represents significant
1004          * functionality changes.
1005          */
1006         uint8_t roce_fw_min_8b;
1007         /*
1008          * This field represents the build version of RoCE firmware.
1009          * A change in update version represents bug fixes.
1010          */
1011         uint8_t roce_fw_bld_8b;
1012         /*
1013          * This field is a reserved field. This field can be used to
1014          * represent firmware branches or customer specific releases
1015          * tied to a specific (major,minor,update) version
1016          */
1017         uint8_t roce_fw_rsvd_8b;
1018         /*
1019          * This field represents the name of HWRM FW (ASCII chars
1020          * with NULL at the end).
1021          */
1022         char    hwrm_fw_name[16];
1023         /*
1024          * This field represents the name of mgmt FW (ASCII chars
1025          * with NULL at the end).
1026          */
1027         char    mgmt_fw_name[16];
1028         /*
1029          * This field represents the name of network control
1030          * firmware (ASCII chars with NULL at the end).
1031          */
1032         char    netctrl_fw_name[16];
1033         /*
1034          * This field is reserved for future use.
1035          * The responder should set it to 0.
1036          * The requester should ignore this field.
1037          */
1038         uint8_t reserved2[16];
1039         /*
1040          * This field represents the name of RoCE FW (ASCII chars
1041          * with NULL at the end).
1042          */
1043         char    roce_fw_name[16];
1044         /* This field returns the chip number. */
1045         uint16_t        chip_num;
1046         /* This field returns the revision of chip. */
1047         uint8_t chip_rev;
1048         /* This field returns the chip metal number. */
1049         uint8_t chip_metal;
1050         /* This field returns the bond id of the chip. */
1051         uint8_t chip_bond_id;
1052         /* This value indicates the type of platform used for chip implementation. */
1053         uint8_t chip_platform_type;
1054         /* ASIC */
1055         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
1056         /* FPGA platform of the chip. */
1057         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
1058         /* Palladium platform of the chip. */
1059         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1060         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
1061                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1062         /*
1063          * This field returns the maximum value of request window that
1064          * is supported by the HWRM. The request window is mapped
1065          * into device address space using MMIO.
1066          */
1067         uint16_t        max_req_win_len;
1068         /*
1069          * This field returns the maximum value of response buffer in
1070          * bytes.
1071          */
1072         uint16_t        max_resp_len;
1073         /*
1074          * This field returns the default request timeout value in
1075          * milliseconds.
1076          */
1077         uint16_t        def_req_timeout;
1078         /*
1079          * This field will indicate if any subsystems is not fully
1080          * initialized.
1081          */
1082         uint8_t flags;
1083         /*
1084          * If set to 1, device is not ready.
1085          * If set to 0, device is ready to accept all HWRM commands.
1086          */
1087         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY       UINT32_C(0x1)
1088         /*
1089          * If set to 1, external version present.
1090          * If set to 0, external version not present.
1091          */
1092         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL     UINT32_C(0x2)
1093         uint8_t unused_0[2];
1094         /*
1095          * For backward compatibility this field must be set to 1.
1096          * Older drivers might look for this field to be 1 before
1097          * processing the message.
1098          */
1099         uint8_t always_1;
1100         /*
1101          * This field represents the major version of HWRM interface
1102          * specification supported by the HWRM implementation.
1103          * The interface major version is intended to change only when
1104          * non backward compatible changes are made to the HWRM
1105          * interface specification. A HWRM implementation that is
1106          * compliant with this specification shall provide value of 1
1107          * in this field.
1108          */
1109         uint16_t        hwrm_intf_major;
1110         /*
1111          * This field represents the minor version of HWRM interface
1112          * specification supported by the HWRM implementation.
1113          * A change in interface minor version is used to reflect
1114          * significant backward compatible modification to HWRM
1115          * interface specification. This can be due to addition or
1116          * removal of functionality. HWRM interface specifications
1117          * with the same major version but different minor versions are
1118          * compatible. A HWRM implementation that is compliant with
1119          * this specification shall provide value of 2 in this field.
1120          */
1121         uint16_t        hwrm_intf_minor;
1122         /*
1123          * This field represents the update version of HWRM interface
1124          * specification supported by the HWRM implementation. The
1125          * interface update version is used to reflect minor changes or
1126          * bug fixes to a released HWRM interface specification.
1127          * A HWRM implementation that is compliant with this
1128          * specification shall provide value of 2 in this field.
1129          */
1130         uint16_t        hwrm_intf_build;
1131         /*
1132          * This field represents the patch version of HWRM interface
1133          * specification supported by the HWRM implementation.
1134          */
1135         uint16_t        hwrm_intf_patch;
1136         /*
1137          * This field represents the major version of HWRM firmware.
1138          * A change in firmware major version represents a major
1139          * firmware release.
1140          */
1141         uint16_t        hwrm_fw_major;
1142         /*
1143          * This field represents the minor version of HWRM firmware.
1144          * A change in firmware minor version represents significant
1145          * firmware functionality changes.
1146          */
1147         uint16_t        hwrm_fw_minor;
1148         /*
1149          * This field represents the build version of HWRM firmware.
1150          * A change in firmware build version represents bug fixes to
1151          * a released firmware.
1152          */
1153         uint16_t        hwrm_fw_build;
1154         /*
1155          * This field is a reserved field.
1156          * This field can be used to represent firmware branches or customer
1157          * specific releases tied to a specific (major,minor,update) version
1158          * of the HWRM firmware.
1159          */
1160         uint16_t        hwrm_fw_patch;
1161         /*
1162          * This field represents the major version of mgmt firmware.
1163          * A change in major version represents a major release.
1164          */
1165         uint16_t        mgmt_fw_major;
1166         /*
1167          * This field represents the minor version of HWRM firmware.
1168          * A change in firmware minor version represents significant
1169          * firmware functionality changes.
1170          */
1171         uint16_t        mgmt_fw_minor;
1172         /*
1173          * This field represents the build version of mgmt firmware.
1174          * A change in update version represents bug fixes.
1175          */
1176         uint16_t        mgmt_fw_build;
1177         /*
1178          * This field is a reserved field. This field can be used to
1179          * represent firmware branches or customer specific releases
1180          * tied to a specific (major,minor,update) version.
1181          */
1182         uint16_t        mgmt_fw_patch;
1183         /*
1184          * This field represents the major version of network control
1185          * firmware. A change in major version represents
1186          * a major release.
1187          */
1188         uint16_t        netctrl_fw_major;
1189         /*
1190          * This field represents the minor version of network control
1191          * firmware. A change in minor version represents significant
1192          * functionality changes.
1193          */
1194         uint16_t        netctrl_fw_minor;
1195         /*
1196          * This field represents the build version of network control
1197          * firmware. A change in update version represents bug fixes.
1198          */
1199         uint16_t        netctrl_fw_build;
1200         /*
1201          * This field is a reserved field. This field can be used to
1202          * represent firmware branches or customer specific releases
1203          * tied to a specific (major,minor,update) version
1204          */
1205         uint16_t        netctrl_fw_patch;
1206         /*
1207          * This field represents the major version of RoCE firmware.
1208          * A change in major version represents a major release.
1209          */
1210         uint16_t        roce_fw_major;
1211         /*
1212          * This field represents the minor version of RoCE firmware.
1213          * A change in minor version represents significant
1214          * functionality changes.
1215          */
1216         uint16_t        roce_fw_minor;
1217         /*
1218          * This field represents the build version of RoCE firmware.
1219          * A change in update version represents bug fixes.
1220          */
1221         uint16_t        roce_fw_build;
1222         /*
1223          * This field is a reserved field. This field can be used to
1224          * represent firmware branches or customer specific releases
1225          * tied to a specific (major,minor,update) version
1226          */
1227         uint16_t        roce_fw_patch;
1228         /*
1229          * This field returns the maximum extended request length acceptable
1230          * by the device which allows requests greater than mailbox size when
1231          * used with the short cmd request format.
1232          */
1233         uint16_t        max_ext_req_len;
1234         uint8_t unused_1[5];
1235         /*
1236          * This field is used in Output records to indicate that the output
1237          * is completely written to RAM.  This field should be read as '1'
1238          * to indicate that the output has been completely written.
1239          * When writing a command completion or response to an internal processor,
1240          * the order of writes has to be such that this field is written last.
1241          */
1242         uint8_t valid;
1243 } __attribute__((packed));
1244
1245 /* bd_base (size:64b/8B) */
1246 struct bd_base {
1247         uint8_t type;
1248         /* This value identifies the type of buffer descriptor. */
1249         #define BD_BASE_TYPE_MASK             UINT32_C(0x3f)
1250         #define BD_BASE_TYPE_SFT              0
1251         /*
1252          * Indicates that this BD is 16B long and is used for
1253          * normal L2 packet transmission.
1254          */
1255         #define BD_BASE_TYPE_TX_BD_SHORT        UINT32_C(0x0)
1256         /*
1257          * Indicates that this BD is 1BB long and is an empty
1258          * TX BD.  Not valid for use by the driver.
1259          */
1260         #define BD_BASE_TYPE_TX_BD_EMPTY        UINT32_C(0x1)
1261         /*
1262          * Indicates that this BD is 16B long and is an RX Producer
1263          * (ie. empty) buffer descriptor.
1264          */
1265         #define BD_BASE_TYPE_RX_PROD_PKT        UINT32_C(0x4)
1266         /*
1267          * Indicates that this BD is 16B long and is an RX
1268          * Producer Buffer BD.
1269          */
1270         #define BD_BASE_TYPE_RX_PROD_BFR        UINT32_C(0x5)
1271         /*
1272          * Indicates that this BD is 16B long and is an
1273          * RX Producer Assembly Buffer Descriptor.
1274          */
1275         #define BD_BASE_TYPE_RX_PROD_AGG        UINT32_C(0x6)
1276         /*
1277          * Indicates that this BD is 32B long and is used for
1278          * normal L2 packet transmission.
1279          */
1280         #define BD_BASE_TYPE_TX_BD_LONG         UINT32_C(0x10)
1281         /*
1282          * Indicates that this BD is 32B long and is used for
1283          * L2 packet transmission for small packets that require
1284          * low latency.
1285          */
1286         #define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1287         #define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
1288         uint8_t unused_1[7];
1289 } __attribute__((packed));
1290
1291 /* tx_bd_short (size:128b/16B) */
1292 struct tx_bd_short {
1293         /*
1294          * All bits in this field must be valid on the first BD of a packet.
1295          * Only the packet_end bit must be valid for the remaining BDs
1296          * of a packet.
1297          */
1298         uint16_t        flags_type;
1299         /* This value identifies the type of buffer descriptor. */
1300         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
1301         #define TX_BD_SHORT_TYPE_SFT             0
1302         /*
1303          * Indicates that this BD is 16B long and is used for
1304          * normal L2 packet transmission.
1305          */
1306         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
1307         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
1308         /*
1309          * All bits in this field must be valid on the first BD of a packet.
1310          * Only the packet_end bit must be valid for the remaining BDs
1311          * of a packet.
1312          */
1313         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
1314         #define TX_BD_SHORT_FLAGS_SFT            6
1315         /*
1316          * If set to 1, the packet ends with the data in the buffer
1317          * pointed to by this descriptor.  This flag must be
1318          * valid on every BD.
1319          */
1320         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
1321         /*
1322          * If set to 1, the device will not generate a completion for
1323          * this transmit packet unless there is an error in it's
1324          * processing.
1325          * If this bit
1326          * is set to 0, then the packet will be completed normally.
1327          *
1328          * This bit must be valid only on the first BD of a packet.
1329          */
1330         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
1331         /*
1332          * This value indicates how many 16B BD locations are consumed
1333          * in the ring by this packet.
1334          * A value of 1 indicates that this BD is the only BD (and that
1335          * the it is a short BD).  A value
1336          * of 3 indicates either 3 short BDs or 1 long BD and one short
1337          * BD in the packet.  A value of 0 indicates
1338          * that there are 32 BD locations in the packet (the maximum).
1339          *
1340          * This field is valid only on the first BD of a packet.
1341          */
1342         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1343         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
1344         /*
1345          * This value is a hint for the length of the entire packet.
1346          * It is used by the chip to optimize internal processing.
1347          *
1348          * The packet will be dropped if the hint is too short.
1349          *
1350          * This field is valid only on the first BD of a packet.
1351          */
1352         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1353         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
1354         /* indicates packet length < 512B */
1355         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1356         /* indicates 512 <= packet length < 1KB */
1357         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1358         /* indicates 1KB <= packet length < 2KB */
1359         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1360         /* indicates packet length >= 2KB */
1361         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1362         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
1363                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
1364         /*
1365          * If set to 1, the device immediately updates the Send Consumer
1366          * Index after the buffer associated with this descriptor has
1367          * been transferred via DMA to NIC memory from host memory. An
1368          * interrupt may or may not be generated according to the state
1369          * of the interrupt avoidance mechanisms. If this bit
1370          * is set to 0, then the Consumer Index is only updated as soon
1371          * as one of the host interrupt coalescing conditions has been met.
1372          *
1373          * This bit must be valid on the first BD of a packet.
1374          */
1375         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
1376         /*
1377          * This is the length of the host physical buffer this BD describes
1378          * in bytes.
1379          *
1380          * This field must be valid on all BDs of a packet.
1381          */
1382         uint16_t        len;
1383         /*
1384          * The opaque data field is pass through to the completion and can be
1385          * used for any data that the driver wants to associate with the
1386          * transmit BD.
1387          *
1388          * This field must be valid on the first BD of a packet.
1389          */
1390         uint32_t        opaque;
1391         /*
1392          * This is the host physical address for the portion of the packet
1393          * described by this TX BD.
1394          *
1395          * This value must be valid on all BDs of a packet.
1396          */
1397         uint64_t        address;
1398 } __attribute__((packed));
1399
1400 /* tx_bd_long (size:128b/16B) */
1401 struct tx_bd_long {
1402         /* This value identifies the type of buffer descriptor. */
1403         uint16_t        flags_type;
1404         /*
1405          * This value indicates the type of buffer descriptor.
1406          * packet.
1407          */
1408         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
1409         #define TX_BD_LONG_TYPE_SFT             0
1410         /*
1411          * Indicates that this BD is 32B long and is used for
1412          * normal L2 packet transmission.
1413          */
1414         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
1415         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
1416         /*
1417          * All bits in this field must be valid on the first BD of a packet.
1418          * Only the packet_end bit must be valid for the remaining BDs
1419          * of a packet.
1420          */
1421         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
1422         #define TX_BD_LONG_FLAGS_SFT            6
1423         /*
1424          * If set to 1, the packet ends with the data in the buffer
1425          * pointed to by this descriptor.  This flag must be
1426          * valid on every BD.
1427          */
1428         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
1429         /*
1430          * If set to 1, the device will not generate a completion for
1431          * this transmit packet unless there is an error in it's
1432          * processing.
1433          * If this bit
1434          * is set to 0, then the packet will be completed normally.
1435          *
1436          * This bit must be valid only on the first BD of a packet.
1437          */
1438         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
1439         /*
1440          * This value indicates how many 16B BD locations are consumed
1441          * in the ring by this packet.
1442          * A value of 1 indicates that this BD is the only BD (and that
1443          * the it is a short BD).  A value
1444          * of 3 indicates either 3 short BDs or 1 long BD and one short
1445          * BD in the packet.  A value of 0 indicates
1446          * that there are 32 BD locations in the packet (the maximum).
1447          *
1448          * This field is valid only on the first BD of a packet.
1449          */
1450         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1451         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
1452         /*
1453          * This value is a hint for the length of the entire packet.
1454          * It is used by the chip to optimize internal processing.
1455          *
1456          * The packet will be dropped if the hint is too short.
1457          *
1458          * This field is valid only on the first BD of a packet.
1459          */
1460         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1461         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
1462         /* indicates packet length < 512B */
1463         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1464         /* indicates 512 <= packet length < 1KB */
1465         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1466         /* indicates 1KB <= packet length < 2KB */
1467         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1468         /* indicates packet length >= 2KB */
1469         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1470         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
1471         /*
1472          * If set to 1, the device immediately updates the Send Consumer
1473          * Index after the buffer associated with this descriptor has
1474          * been transferred via DMA to NIC memory from host memory. An
1475          * interrupt may or may not be generated according to the state
1476          * of the interrupt avoidance mechanisms. If this bit
1477          * is set to 0, then the Consumer Index is only updated as soon
1478          * as one of the host interrupt coalescing conditions has been met.
1479          *
1480          * This bit must be valid on the first BD of a packet.
1481          */
1482         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
1483         /*
1484          * This is the length of the host physical buffer this BD describes
1485          * in bytes.
1486          *
1487          * This field must be valid on all BDs of a packet.
1488          */
1489         uint16_t        len;
1490         /*
1491          * The opaque data field is pass through to the completion and can be
1492          * used for any data that the driver wants to associate with the
1493          * transmit BD.
1494          *
1495          * This field must be valid on the first BD of a packet.
1496          */
1497         uint32_t        opaque;
1498         /*
1499          * This is the host physical address for the portion of the packet
1500          * described by this TX BD.
1501          *
1502          * This value must be valid on all BDs of a packet.
1503          */
1504         uint64_t        address;
1505 } __attribute__((packed));
1506
1507 /* Last 16 bytes of tx_bd_long. */
1508 /* tx_bd_long_hi (size:128b/16B) */
1509 struct tx_bd_long_hi {
1510         /*
1511          * All bits in this field must be valid on the first BD of a packet.
1512          * Their value on other BDs of the packet will be ignored.
1513          */
1514         uint16_t        lflags;
1515         /*
1516          * If set to 1, the controller replaces the TCP/UPD checksum
1517          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1518          * checksum field of the encapsulated TCP/UDP packets with the
1519          * hardware calculated TCP/UDP checksum for the packet associated
1520          * with this descriptor. The flag is ignored if the LSO flag is set.
1521          *
1522          * This bit must be valid on the first BD of a packet.
1523          */
1524         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1525         /*
1526          * If set to 1,  the controller replaces the IP checksum of the
1527          * normal packets, or the inner IP checksum of the encapsulated
1528          * packets with the hardware calculated IP checksum for the
1529          * packet associated with this descriptor.
1530          *
1531          * This bit must be valid on the first BD of a packet.
1532          */
1533         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1534         /*
1535          * If set to 1, the controller will not append an Ethernet CRC
1536          * to the end of the frame.
1537          *
1538          * This bit must be valid on the first BD of a packet.
1539          *
1540          * Packet must be 64B or longer when this flag is set.  It is not
1541          * useful to use this bit with any form of TX offload such as
1542          * CSO or LSO.  The intent is that the packet from the host already
1543          * has a valid Ethernet CRC on the packet.
1544          */
1545         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
1546         /*
1547          * If set to 1, the device will record the time at which the packet
1548          * was actually transmitted at the TX MAC.
1549          *
1550          * This bit must be valid on the first BD of a packet.
1551          */
1552         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
1553         /*
1554          * If set to 1, The controller replaces the tunnel IP checksum
1555          * field with hardware calculated IP checksum for the IP header
1556          * of the packet associated with this descriptor.
1557          *
1558          * For outer UDP checksum, global outer UDP checksum TE_NIC register
1559          * needs to be enabled. If the global outer UDP checksum TE_NIC register
1560          * bit is set, outer UDP checksum will be calculated for the following
1561          * cases:
1562          * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
1563          * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
1564          * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
1565          * checksum will not be calculated.
1566          * 2. Packets with lso flag set which implies inner TCP checksum calculation
1567          * as part of LSO operation.
1568          */
1569         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1570         /*
1571          * If set to 1,  the device will treat this packet with LSO(Large
1572          * Send Offload) processing for both normal or encapsulated
1573          * packets, which is a form of TCP segmentation.  When this bit
1574          * is 1, the hdr_size and mss fields must be valid. The driver
1575          * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
1576          * flags since the controller will replace the appropriate
1577          * checksum fields for segmented packets.
1578          *
1579          * When this bit is 1, the hdr_size and mss fields must be valid.
1580          */
1581         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
1582         /*
1583          * If set to zero when LSO is '1', then the IPID will be treated
1584          * as a 16b number and will be wrapped if it exceeds a value of
1585          * 0xffff.
1586          *
1587          * If set to one when LSO is '1', then the IPID will be treated
1588          * as a 15b number and will be wrapped if it exceeds a value 0f
1589          * 0x7fff.
1590          */
1591         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
1592         /*
1593          * If set to zero when LSO is '1', then the IPID of the tunnel
1594          * IP header will not be modified during LSO operations.
1595          *
1596          * If set to one when LSO is '1', then the IPID of the tunnel
1597          * IP header will be incremented for each subsequent segment of an
1598          * LSO operation.
1599          *
1600          * The flag is ignored if the LSO packet is a normal (non-tunneled)
1601          * TCP packet.
1602          */
1603         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
1604         /*
1605          * If set to '1', then the RoCE ICRC will be appended to the
1606          * packet.  Packet must be a valid RoCE format packet.
1607          */
1608         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1609         /*
1610          * If set to '1', then the FCoE CRC will be appended to the
1611          * packet.  Packet must be a valid FCoE format packet.
1612          */
1613         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1614         uint16_t        hdr_size;
1615         /*
1616          * When LSO is '1', this field must contain the offset of the
1617          * TCP payload from the beginning of the packet in as
1618          * 16b words. In case of encapsulated/tunneling packet, this  field
1619          * contains the offset of the inner TCP payload from beginning of the
1620          * packet as 16-bit words.
1621          *
1622          * This value must be valid on the first BD of a packet.
1623          */
1624         #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
1625         #define TX_BD_LONG_HDR_SIZE_SFT 0
1626         uint32_t        mss;
1627         /*
1628          * This is the MSS value that will be used to do the LSO processing.
1629          * The value is the length in bytes of the TCP payload for each
1630          * segment generated by the LSO operation.
1631          *
1632          * This value must be valid on the first BD of a packet.
1633          */
1634         #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
1635         #define TX_BD_LONG_MSS_SFT 0
1636         uint16_t        unused2;
1637         /*
1638          * This value selects a CFA action to perform on the packet.
1639          * Set this value to zero if no CFA action is desired.
1640          *
1641          * This value must be valid on the first BD of a packet.
1642          */
1643         uint16_t        cfa_action;
1644         /*
1645          * This value is action meta-data that defines CFA edit operations
1646          * that are done in addition to any action editing.
1647          */
1648         uint32_t        cfa_meta;
1649         /* When key=1, This is the VLAN tag VID value. */
1650         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1651         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT      0
1652         /* When key=1, This is the VLAN tag DE value. */
1653         #define TX_BD_LONG_CFA_META_VLAN_DE           UINT32_C(0x1000)
1654         /* When key=1, This is the VLAN tag PRI value. */
1655         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
1656         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT      13
1657         /* When key=1, This is the VLAN tag TPID select value. */
1658         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
1659         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT     16
1660         /* 0x88a8 */
1661         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
1662         /* 0x8100 */
1663         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
1664         /* 0x9100 */
1665         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
1666         /* 0x9200 */
1667         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
1668         /* 0x9300 */
1669         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
1670         /* Value programmed in CFA VLANTPID register. */
1671         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
1672         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
1673                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
1674         /* When key=1, This is the VLAN tag TPID select value. */
1675         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
1676         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
1677         /*
1678          * This field identifies the type of edit to be performed
1679          * on the packet.
1680          *
1681          * This value must be valid on the first BD of a packet.
1682          */
1683         #define TX_BD_LONG_CFA_META_KEY_MASK          UINT32_C(0xf0000000)
1684         #define TX_BD_LONG_CFA_META_KEY_SFT           28
1685         /* No editing */
1686         #define TX_BD_LONG_CFA_META_KEY_NONE            (UINT32_C(0x0) << 28)
1687         /*
1688          * - meta[17:16] - TPID select value (0 = 0x8100).
1689          * - meta[15:12] - PRI/DE value.
1690          * - meta[11:0] - VID value.
1691          */
1692         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG        (UINT32_C(0x1) << 28)
1693         #define TX_BD_LONG_CFA_META_KEY_LAST \
1694                 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
1695 } __attribute__((packed));
1696
1697 /*
1698  * This structure is used to inform the NIC of packet data that needs to be
1699  * transmitted with additional processing that requires extra data such as
1700  * VLAN insertion plus attached inline data. This BD type may be used to
1701  * improve latency for small packets needing the additional extended features
1702  * supported by long BDs.
1703  */
1704 /* tx_bd_long_inline (size:256b/32B) */
1705 struct tx_bd_long_inline {
1706         uint16_t        flags_type;
1707         /* This value identifies the type of buffer descriptor. */
1708         #define TX_BD_LONG_INLINE_TYPE_MASK             UINT32_C(0x3f)
1709         #define TX_BD_LONG_INLINE_TYPE_SFT              0
1710         /*
1711          * This type of BD is 32B long and is used for inline L2 packet
1712          * transmission.
1713          */
1714         #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1715         #define TX_BD_LONG_INLINE_TYPE_LAST \
1716                 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
1717         /*
1718          * All bits in this field may be set on the first BD of a packet.
1719          * Only the packet_end bit may be set in non-first BDs.
1720          */
1721         #define TX_BD_LONG_INLINE_FLAGS_MASK            UINT32_C(0xffc0)
1722         #define TX_BD_LONG_INLINE_FLAGS_SFT             6
1723         /*
1724          * If set to 1, the packet ends with the data in the buffer
1725          * pointed to by this descriptor.  This flag must be
1726          * valid on every BD.
1727          */
1728         #define TX_BD_LONG_INLINE_FLAGS_PACKET_END       UINT32_C(0x40)
1729         /*
1730          * If set to 1, the device will not generate a completion for
1731          * this transmit packet unless there is an error in its processing.
1732          * If this bit is set to 0, then the packet will be completed
1733          * normally.
1734          *
1735          * This bit may be set only on the first BD of a packet.
1736          */
1737         #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL          UINT32_C(0x80)
1738         /*
1739          * This value indicates how many 16B BD locations are consumed
1740          * in the ring by this packet, including the BD and inline
1741          * data.
1742          */
1743         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
1744         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT       8
1745         /* This field is deprecated. */
1746         #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK       UINT32_C(0x6000)
1747         #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT        13
1748         /*
1749          * If set to 1, the device immediately updates the Send Consumer
1750          * Index after the buffer associated with this descriptor has
1751          * been transferred via DMA to NIC memory from host memory. An
1752          * interrupt may or may not be generated according to the state
1753          * of the interrupt avoidance mechanisms. If this bit
1754          * is set to 0, then the Consumer Index is only updated as soon
1755          * as one of the host interrupt coalescing conditions has been met.
1756          *
1757          * This bit must be valid on the first BD of a packet.
1758          */
1759         #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW         UINT32_C(0x8000)
1760         /*
1761          * This is the length of the inline data, not including BD length, in
1762          * bytes.
1763          * The maximum value is 480.
1764          *
1765          * This field must be valid on all BDs of a packet.
1766          */
1767         uint16_t        len;
1768         /*
1769          * The opaque data field is passed through to the completion and can be
1770          * used for any data that the driver wants to associate with the transmit
1771          * BD.
1772          *
1773          * This field must be valid on the first BD of a packet.
1774          */
1775         uint32_t        opaque;
1776         uint64_t        unused1;
1777         /*
1778          * All bits in this field must be valid on the first BD of a packet.
1779          * Their value on other BDs of the packet is ignored.
1780          */
1781         uint16_t        lflags;
1782         /*
1783          * If set to 1, the controller replaces the TCP/UPD checksum
1784          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1785          * checksum field of the encapsulated TCP/UDP packets with the
1786          * hardware calculated TCP/UDP checksum for the packet associated
1787          * with this descriptor. The flag is ignored if the LSO flag is set.
1788          */
1789         #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1790         /*
1791          * If set to 1, the controller replaces the IP checksum of the
1792          * normal packets, or the inner IP checksum of the encapsulated
1793          * packets with the hardware calculated IP checksum for the
1794          * packet associated with this descriptor.
1795          */
1796         #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1797         /*
1798          * If set to 1, the controller will not append an Ethernet CRC
1799          * to the end of the frame.
1800          *
1801          * Packet must be 64B or longer when this flag is set. It is not
1802          * useful to use this bit with any form of TX offload such as
1803          * CSO or LSO. The intent is that the packet from the host already
1804          * has a valid Ethernet CRC on the packet.
1805          */
1806         #define TX_BD_LONG_INLINE_LFLAGS_NOCRC              UINT32_C(0x4)
1807         /*
1808          * If set to 1, the device will record the time at which the packet
1809          * was actually transmitted at the TX MAC.
1810          */
1811         #define TX_BD_LONG_INLINE_LFLAGS_STAMP              UINT32_C(0x8)
1812         /*
1813          * If set to 1, the controller replaces the tunnel IP checksum
1814          * field with hardware calculated IP checksum for the IP header
1815          * of the packet associated with this descriptor. The hardware
1816          * updates an outer UDP checksum if it is non-zero.
1817          */
1818         #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1819         /*
1820          * This bit must be 0 for BDs of this type. LSO is not supported with
1821          * inline BDs.
1822          */
1823         #define TX_BD_LONG_INLINE_LFLAGS_LSO                UINT32_C(0x20)
1824         /* Since LSO is not supported with inline BDs, this bit is not used. */
1825         #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT           UINT32_C(0x40)
1826         /* Since LSO is not supported with inline BDs, this bit is not used. */
1827         #define TX_BD_LONG_INLINE_LFLAGS_T_IPID             UINT32_C(0x80)
1828         /*
1829          * If set to '1', then the RoCE ICRC will be appended to the
1830          * packet.  Packet must be a valid RoCE format packet.
1831          */
1832         #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1833         /*
1834          * If set to '1', then the FCoE CRC will be appended to the
1835          * packet.  Packet must be a valid FCoE format packet.
1836          */
1837         #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1838         uint16_t        unused2;
1839         uint32_t        unused3;
1840         uint16_t        unused4;
1841         /*
1842          * This value selects a CFA action to perform on the packet.
1843          * Set this value to zero if no CFA action is desired.
1844          *
1845          * This value must be valid on the first BD of a packet.
1846          */
1847         uint16_t        cfa_action;
1848         /*
1849          * This value is action meta-data that defines CFA edit operations
1850          * that are done in addition to any action editing.
1851          */
1852         uint32_t        cfa_meta;
1853         /* When key = 1, this is the VLAN tag VID value. */
1854         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1855         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT      0
1856         /* When key = 1, this is the VLAN tag DE value. */
1857         #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE           UINT32_C(0x1000)
1858         /* When key = 1, this is the VLAN tag PRI value. */
1859         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
1860         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT      13
1861         /* When key = 1, this is the VLAN tag TPID select value. */
1862         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
1863         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT     16
1864         /* 0x88a8 */
1865         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \
1866                 (UINT32_C(0x0) << 16)
1867         /* 0x8100 */
1868         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \
1869                 (UINT32_C(0x1) << 16)
1870         /* 0x9100 */
1871         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \
1872                 (UINT32_C(0x2) << 16)
1873         /* 0x9200 */
1874         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \
1875                 (UINT32_C(0x3) << 16)
1876         /* 0x9300 */
1877         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \
1878                 (UINT32_C(0x4) << 16)
1879         /* Value programmed in CFA VLANTPID register. */
1880         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \
1881                 (UINT32_C(0x5) << 16)
1882         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \
1883                 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
1884         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \
1885                 UINT32_C(0xff80000)
1886         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT 19
1887         /*
1888          * This field identifies the type of edit to be performed
1889          * on the packet.
1890          *
1891          * This value must be valid on the first BD of a packet.
1892          */
1893         #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \
1894                 UINT32_C(0xf0000000)
1895         #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT           28
1896         /* No editing */
1897         #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \
1898                 (UINT32_C(0x0) << 28)
1899         /*
1900          * - meta[17:16] - TPID select value (0 = 0x8100).
1901          * - meta[15:12] - PRI/DE value.
1902          * - meta[11:0] - VID value.
1903          */
1904         #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \
1905                 (UINT32_C(0x1) << 28)
1906         #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
1907                 TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG
1908 } __attribute__((packed));
1909
1910 /* tx_bd_empty (size:128b/16B) */
1911 struct tx_bd_empty {
1912         /* This value identifies the type of buffer descriptor. */
1913         uint8_t type;
1914         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
1915         #define TX_BD_EMPTY_TYPE_SFT        0
1916         /*
1917          * Indicates that this BD is 1BB long and is an empty
1918          * TX BD.  Not valid for use by the driver.
1919          */
1920         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
1921         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
1922         uint8_t unused_1[3];
1923         uint8_t unused_2;
1924         uint8_t unused_3[3];
1925         uint8_t unused_4[8];
1926 } __attribute__((packed));
1927
1928 /* rx_prod_pkt_bd (size:128b/16B) */
1929 struct rx_prod_pkt_bd {
1930         /* This value identifies the type of buffer descriptor. */
1931         uint16_t        flags_type;
1932         /* This value identifies the type of buffer descriptor. */
1933         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
1934         #define RX_PROD_PKT_BD_TYPE_SFT          0
1935         /*
1936          * Indicates that this BD is 16B long and is an RX Producer
1937          * (ie. empty) buffer descriptor.
1938          */
1939         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
1940         #define RX_PROD_PKT_BD_TYPE_LAST \
1941                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
1942         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
1943         #define RX_PROD_PKT_BD_FLAGS_SFT         6
1944         /*
1945          * If set to 1, the packet will be placed at the address plus
1946          * 2B.  The 2 Bytes of padding will be written as zero.
1947          */
1948         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
1949         /*
1950          * If set to 1, the packet write will be padded out to the
1951          * nearest cache-line with zero value padding.
1952          */
1953         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
1954         /*
1955          * This value is the number of additional buffers in the ring that
1956          * describe the buffer space to be consumed for the this packet.
1957          * If the value is zero, then the packet must fit within the
1958          * space described by this BD.  If this value is 1 or more, it
1959          * indicates how many additional "buffer" BDs are in the ring
1960          * immediately following this BD to be used for the same
1961          * network packet.
1962          *
1963          * Even if the packet to be placed does not need all the
1964          * additional buffers, they will be consumed anyway.
1965          */
1966         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
1967         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
1968         /*
1969          * This is the length in Bytes of the host physical buffer where
1970          * data for the packet may be placed in host memory.
1971          */
1972         uint16_t        len;
1973         /*
1974          * The opaque data field is pass through to the completion and can be
1975          * used for any data that the driver wants to associate with this
1976          * receive buffer set.
1977          */
1978         uint32_t        opaque;
1979         /*
1980          * This is the host physical address where data for the packet may
1981          * by placed in host memory.
1982          */
1983         uint64_t        address;
1984 } __attribute__((packed));
1985
1986 /* rx_prod_bfr_bd (size:128b/16B) */
1987 struct rx_prod_bfr_bd {
1988         /* This value identifies the type of buffer descriptor. */
1989         uint16_t        flags_type;
1990         /* This value identifies the type of buffer descriptor. */
1991         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
1992         #define RX_PROD_BFR_BD_TYPE_SFT        0
1993         /*
1994          * Indicates that this BD is 16B long and is an RX
1995          * Producer Buffer BD.
1996          */
1997         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
1998         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
1999         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
2000         #define RX_PROD_BFR_BD_FLAGS_SFT       6
2001         /*
2002          * This is the length in Bytes of the host physical buffer where
2003          * data for the packet may be placed in host memory.
2004          */
2005         uint16_t        len;
2006         /* This field is not used. */
2007         uint32_t        opaque;
2008         /*
2009          * This is the host physical address where data for the packet may
2010          * by placed in host memory.
2011          */
2012         uint64_t        address;
2013 } __attribute__((packed));
2014
2015 /* rx_prod_agg_bd (size:128b/16B) */
2016 struct rx_prod_agg_bd {
2017         /* This value identifies the type of buffer descriptor. */
2018         uint16_t        flags_type;
2019         /* This value identifies the type of buffer descriptor. */
2020         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
2021         #define RX_PROD_AGG_BD_TYPE_SFT          0
2022         /*
2023          * Indicates that this BD is 16B long and is an
2024          * RX Producer Assembly Buffer Descriptor.
2025          */
2026         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
2027         #define RX_PROD_AGG_BD_TYPE_LAST \
2028                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
2029         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
2030         #define RX_PROD_AGG_BD_FLAGS_SFT         6
2031         /*
2032          * If set to 1, the packet write will be padded out to the
2033          * nearest cache-line with zero value padding.
2034          */
2035         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
2036         /*
2037          * This is the length in Bytes of the host physical buffer where
2038          * data for the packet may be placed in host memory.
2039          */
2040         uint16_t        len;
2041         /*
2042          * The opaque data field is pass through to the completion and can be
2043          * used for any data that the driver wants to associate with this
2044          * receive assembly buffer.
2045          */
2046         uint32_t        opaque;
2047         /*
2048          * This is the host physical address where data for the packet may
2049          * by placed in host memory.
2050          */
2051         uint64_t        address;
2052 } __attribute__((packed));
2053
2054 /* cmpl_base (size:128b/16B) */
2055 struct cmpl_base {
2056         uint16_t        type;
2057         /*
2058          * This field indicates the exact type of the completion.
2059          * By convention, the LSB identifies the length of the
2060          * record in 16B units.  Even values indicate 16B
2061          * records.  Odd values indicate 32B
2062          * records.
2063          */
2064         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
2065         #define CMPL_BASE_TYPE_SFT             0
2066         /*
2067          * TX L2 completion:
2068          * Completion of TX packet.  Length = 16B
2069          */
2070         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
2071         /*
2072          * RX L2 completion:
2073          * Completion of and L2 RX packet. Length = 32B
2074          */
2075         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
2076         /*
2077          * RX Aggregation Buffer completion :
2078          * Completion of an L2 aggregation buffer in support of
2079          * TPA, HDS, or Jumbo packet completion.  Length = 16B
2080          */
2081         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
2082         /*
2083          * RX L2 TPA Start Completion:
2084          * Completion at the beginning of a TPA operation.
2085          * Length = 32B
2086          */
2087         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
2088         /*
2089          * RX L2 TPA End Completion:
2090          * Completion at the end of a TPA operation.
2091          * Length = 32B
2092          */
2093         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
2094         /*
2095          * Statistics Ejection Completion:
2096          * Completion of statistics data ejection buffer.
2097          * Length = 16B
2098          */
2099         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
2100         /*
2101          * HWRM Command Completion:
2102          * Completion of an HWRM command.
2103          */
2104         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
2105         /* Forwarded HWRM Request */
2106         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
2107         /* Forwarded HWRM Response */
2108         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
2109         /* HWRM Asynchronous Event Information */
2110         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
2111         /* CQ Notification */
2112         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
2113         /* SRQ Threshold Event */
2114         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
2115         /* DBQ Threshold Event */
2116         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
2117         /* QP Async Notification */
2118         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
2119         /* Function Async Notification */
2120         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
2121         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
2122         /* info1 is 16 b */
2123         uint16_t        info1;
2124         /* info2 is 32 b */
2125         uint32_t        info2;
2126         /*
2127          * This value is written by the NIC such that it will be different
2128          * for each pass through the completion queue.   The even passes
2129          * will write 1.  The odd passes will write 0.
2130          */
2131         uint32_t        info3_v;
2132         #define CMPL_BASE_V         UINT32_C(0x1)
2133         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
2134         #define CMPL_BASE_INFO3_SFT 1
2135         /* info4 is 32 b */
2136         uint32_t        info4;
2137 } __attribute__((packed));
2138
2139 /* tx_cmpl (size:128b/16B) */
2140 struct tx_cmpl {
2141         uint16_t        flags_type;
2142         /*
2143          * This field indicates the exact type of the completion.
2144          * By convention, the LSB identifies the length of the
2145          * record in 16B units.  Even values indicate 16B
2146          * records.  Odd values indicate 32B
2147          * records.
2148          */
2149         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
2150         #define TX_CMPL_TYPE_SFT        0
2151         /*
2152          * TX L2 completion:
2153          * Completion of TX packet.  Length = 16B
2154          */
2155         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
2156         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
2157         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
2158         #define TX_CMPL_FLAGS_SFT       6
2159         /*
2160          * When this bit is '1', it indicates a packet that has an
2161          * error of some type.  Type of error is indicated in
2162          * error_flags.
2163          */
2164         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
2165         /*
2166          * When this bit is '1', it indicates that the packet completed
2167          * was transmitted using the push acceleration data provided
2168          * by the driver.  When this bit is '0', it indicates that the
2169          * packet had not push acceleration data written or was executed
2170          * as a normal packet even though push data was provided.
2171          */
2172         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
2173         /* unused1 is 16 b */
2174         uint16_t        unused_0;
2175         /*
2176          * This is a copy of the opaque field from the first TX BD of this
2177          * transmitted packet.
2178          */
2179         uint32_t        opaque;
2180         uint16_t        errors_v;
2181         /*
2182          * This value is written by the NIC such that it will be different
2183          * for each pass through the completion queue.   The even passes
2184          * will write 1.  The odd passes will write 0.
2185          */
2186         #define TX_CMPL_V                              UINT32_C(0x1)
2187         #define TX_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
2188         #define TX_CMPL_ERRORS_SFT                     1
2189         /*
2190          * This error indicates that there was some sort of problem
2191          * with the BDs for the packet.
2192          */
2193         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
2194         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT         1
2195         /* No error */
2196         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR      (UINT32_C(0x0) << 1)
2197         /*
2198          * Bad Format:
2199          * BDs were not formatted correctly.
2200          */
2201         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT       (UINT32_C(0x2) << 1)
2202         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
2203                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
2204         /*
2205          * When this bit is '1', it indicates that the length of
2206          * the packet was zero.  No packet was transmitted.
2207          */
2208         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT          UINT32_C(0x10)
2209         /*
2210          * When this bit is '1', it indicates that the packet
2211          * was longer than the programmed limit in TDI. No
2212          * packet was transmitted.
2213          */
2214         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH      UINT32_C(0x20)
2215         /*
2216          * When this bit is '1', it indicates that one or more of the
2217          * BDs associated with this packet generated a PCI error.
2218          * This probably means the address was not valid.
2219          */
2220         #define TX_CMPL_ERRORS_DMA_ERROR                UINT32_C(0x40)
2221         /*
2222          * When this bit is '1', it indicates that the packet was longer
2223          * than indicated by the hint.  No packet was transmitted.
2224          */
2225         #define TX_CMPL_ERRORS_HINT_TOO_SHORT           UINT32_C(0x80)
2226         /*
2227          * When this bit is '1', it indicates that the packet was
2228          * dropped due to Poison TLP error on one or more of the
2229          * TLPs in the PXP completion.
2230          */
2231         #define TX_CMPL_ERRORS_POISON_TLP_ERROR         UINT32_C(0x100)
2232         /* unused2 is 16 b */
2233         uint16_t        unused_1;
2234         /* unused3 is 32 b */
2235         uint32_t        unused_2;
2236 } __attribute__((packed));
2237
2238 /* rx_pkt_cmpl (size:128b/16B) */
2239 struct rx_pkt_cmpl {
2240         uint16_t        flags_type;
2241         /*
2242          * This field indicates the exact type of the completion.
2243          * By convention, the LSB identifies the length of the
2244          * record in 16B units.  Even values indicate 16B
2245          * records.  Odd values indicate 32B
2246          * records.
2247          */
2248         #define RX_PKT_CMPL_TYPE_MASK                   UINT32_C(0x3f)
2249         #define RX_PKT_CMPL_TYPE_SFT                    0
2250         /*
2251          * RX L2 completion:
2252          * Completion of and L2 RX packet. Length = 32B
2253          */
2254         #define RX_PKT_CMPL_TYPE_RX_L2                    UINT32_C(0x11)
2255         #define RX_PKT_CMPL_TYPE_LAST                    RX_PKT_CMPL_TYPE_RX_L2
2256         #define RX_PKT_CMPL_FLAGS_MASK                  UINT32_C(0xffc0)
2257         #define RX_PKT_CMPL_FLAGS_SFT                   6
2258         /*
2259          * When this bit is '1', it indicates a packet that has an
2260          * error of some type.  Type of error is indicated in
2261          * error_flags.
2262          */
2263         #define RX_PKT_CMPL_FLAGS_ERROR                  UINT32_C(0x40)
2264         /* This field indicates how the packet was placed in the buffer. */
2265         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK         UINT32_C(0x380)
2266         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT          7
2267         /*
2268          * Normal:
2269          * Packet was placed using normal algorithm.
2270          */
2271         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL         (UINT32_C(0x0) << 7)
2272         /*
2273          * Jumbo:
2274          * Packet was placed using jumbo algorithm.
2275          */
2276         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO          (UINT32_C(0x1) << 7)
2277         /*
2278          * Header/Data Separation:
2279          * Packet was placed using Header/Data separation algorithm.
2280          * The separation location is indicated by the itype field.
2281          */
2282         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS            (UINT32_C(0x2) << 7)
2283         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
2284                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
2285         /* This bit is '1' if the RSS field in this completion is valid. */
2286         #define RX_PKT_CMPL_FLAGS_RSS_VALID              UINT32_C(0x400)
2287         /* unused is 1 b */
2288         #define RX_PKT_CMPL_FLAGS_UNUSED                 UINT32_C(0x800)
2289         /*
2290          * This value indicates what the inner packet determined for the
2291          * packet was.
2292          */
2293         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK             UINT32_C(0xf000)
2294         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT              12
2295         /*
2296          * Not Known:
2297          * Indicates that the packet type was not known.
2298          */
2299         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
2300                 (UINT32_C(0x0) << 12)
2301         /*
2302          * IP Packet:
2303          * Indicates that the packet was an IP packet, but further
2304          * classification was not possible.
2305          */
2306         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
2307                 (UINT32_C(0x1) << 12)
2308         /*
2309          * TCP Packet:
2310          * Indicates that the packet was IP and TCP.
2311          * This indicates that the payload_offset field is valid.
2312          */
2313         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
2314                 (UINT32_C(0x2) << 12)
2315         /*
2316          * UDP Packet:
2317          * Indicates that the packet was IP and UDP.
2318          * This indicates that the payload_offset field is valid.
2319          */
2320         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
2321                 (UINT32_C(0x3) << 12)
2322         /*
2323          * FCoE Packet:
2324          * Indicates that the packet was recognized as a FCoE.
2325          * This also indicates that the payload_offset field is valid.
2326          */
2327         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
2328                 (UINT32_C(0x4) << 12)
2329         /*
2330          * RoCE Packet:
2331          * Indicates that the packet was recognized as a RoCE.
2332          * This also indicates that the payload_offset field is valid.
2333          */
2334         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
2335                 (UINT32_C(0x5) << 12)
2336         /*
2337          * ICMP Packet:
2338          * Indicates that the packet was recognized as ICMP.
2339          * This indicates that the payload_offset field is valid.
2340          */
2341         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
2342                 (UINT32_C(0x7) << 12)
2343         /*
2344          * PtP packet wo/timestamp:
2345          * Indicates that the packet was recognized as a PtP
2346          * packet.
2347          */
2348         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
2349                 (UINT32_C(0x8) << 12)
2350         /*
2351          * PtP packet w/timestamp:
2352          * Indicates that the packet was recognized as a PtP
2353          * packet and that a timestamp was taken for the packet.
2354          */
2355         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
2356                 (UINT32_C(0x9) << 12)
2357         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
2358                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
2359         /*
2360          * This is the length of the data for the packet stored in the
2361          * buffer(s) identified by the opaque value.  This includes
2362          * the packet BD and any associated buffer BDs.  This does not include
2363          * the the length of any data places in aggregation BDs.
2364          */
2365         uint16_t        len;
2366         /*
2367          * This is a copy of the opaque field from the RX BD this completion
2368          * corresponds to.
2369          */
2370         uint32_t        opaque;
2371         uint8_t agg_bufs_v1;
2372         /*
2373          * This value is written by the NIC such that it will be different
2374          * for each pass through the completion queue.   The even passes
2375          * will write 1.  The odd passes will write 0.
2376          */
2377         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
2378         /*
2379          * This value is the number of aggregation buffers that follow this
2380          * entry in the completion ring that are a part of this packet.
2381          * If the value is zero, then the packet is completely contained
2382          * in the buffer space provided for the packet in the RX ring.
2383          */
2384         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
2385         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
2386         /* unused1 is 2 b */
2387         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
2388         #define RX_PKT_CMPL_UNUSED1_SFT  6
2389         /*
2390          * This is the RSS hash type for the packet.  The value is packed
2391          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2392          *
2393          * The value of tuple_extrac_op provides the information about
2394          * what fields the hash was computed on.
2395          * * 0: The RSS hash was computed over source IP address,
2396          * destination IP address, source port, and destination port of inner
2397          * IP and TCP or UDP headers. Note: For non-tunneled packets,
2398          * the packet headers are considered inner packet headers for the RSS
2399          * hash computation purpose.
2400          * * 1: The RSS hash was computed over source IP address and destination
2401          * IP address of inner IP header. Note: For non-tunneled packets,
2402          * the packet headers are considered inner packet headers for the RSS
2403          * hash computation purpose.
2404          * * 2: The RSS hash was computed over source IP address,
2405          * destination IP address, source port, and destination port of
2406          * IP and TCP or UDP headers of outer tunnel headers.
2407          * Note: For non-tunneled packets, this value is not applicable.
2408          * * 3: The RSS hash was computed over source IP address and
2409          * destination IP address of IP header of outer tunnel headers.
2410          * Note: For non-tunneled packets, this value is not applicable.
2411          *
2412          * Note that 4-tuples values listed above are applicable
2413          * for layer 4 protocols supported and enabled for RSS in the hardware,
2414          * HWRM firmware, and drivers. For example, if RSS hash is supported and
2415          * enabled for TCP traffic only, then the values of tuple_extract_op
2416          * corresponding to 4-tuples are only valid for TCP traffic.
2417          */
2418         uint8_t rss_hash_type;
2419         /*
2420          * This value indicates the offset in bytes from the beginning of the packet
2421          * where the inner payload starts.  This value is valid for TCP, UDP,
2422          * FCoE, and RoCE packets.
2423          *
2424          * A value of zero indicates that header is 256B into the packet.
2425          */
2426         uint8_t payload_offset;
2427         /* unused2 is 8 b */
2428         uint8_t unused1;
2429         /*
2430          * This value is the RSS hash value calculated for the packet
2431          * based on the mode bits and key value in the VNIC.
2432          */
2433         uint32_t        rss_hash;
2434 } __attribute__((packed));
2435
2436 /* Last 16 bytes of rx_pkt_cmpl. */
2437 /* rx_pkt_cmpl_hi (size:128b/16B) */
2438 struct rx_pkt_cmpl_hi {
2439         uint32_t        flags2;
2440         /*
2441          * This indicates that the ip checksum was calculated for the
2442          * inner packet and that the ip_cs_error field indicates if there
2443          * was an error.
2444          */
2445         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC                 UINT32_C(0x1)
2446         /*
2447          * This indicates that the TCP, UDP or ICMP checksum was
2448          * calculated for the inner packet and that the l4_cs_error field
2449          * indicates if there was an error.
2450          */
2451         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC                 UINT32_C(0x2)
2452         /*
2453          * This indicates that the ip checksum was calculated for the
2454          * tunnel header and that the t_ip_cs_error field indicates if there
2455          * was an error.
2456          */
2457         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC               UINT32_C(0x4)
2458         /*
2459          * This indicates that the UDP checksum was
2460          * calculated for the tunnel packet and that the t_l4_cs_error field
2461          * indicates if there was an error.
2462          */
2463         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC               UINT32_C(0x8)
2464         /* This value indicates what format the metadata field is. */
2465         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK           UINT32_C(0xf0)
2466         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT            4
2467         /* No metadata informtaion.  Value is zero. */
2468         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE \
2469                 (UINT32_C(0x0) << 4)
2470         /*
2471          * The metadata field contains the VLAN tag and TPID value.
2472          * - metadata[11:0] contains the vlan VID value.
2473          * - metadata[12] contains the vlan DE value.
2474          * - metadata[15:13] contains the vlan PRI value.
2475          * - metadata[31:16] contains the vlan TPID value.
2476          */
2477         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN \
2478                 (UINT32_C(0x1) << 4)
2479         /*
2480          * If ext_meta_format is equal to 1, the metadata field
2481          * contains the lower 16b of the tunnel ID value, justified
2482          * to LSB
2483          * - VXLAN = VNI[23:0] -> VXLAN Network ID
2484          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
2485          * - NVGRE = TNI[23:0] -> Tenant Network ID
2486          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
2487          * - IPV4 = 0 (not populated)
2488          * - IPV6 = Flow Label[19:0]
2489          * - PPPoE = sessionID[15:0]
2490          * - MPLs = Outer label[19:0]
2491          * - UPAR = Selected[31:0] with bit mask
2492          */
2493         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
2494                 (UINT32_C(0x2) << 4)
2495         /*
2496          * if ext_meta_format is equal to 1, metadata field contains
2497          * 16b metadata from the prepended header (chdr_data).
2498          */
2499         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
2500                 (UINT32_C(0x3) << 4)
2501         /*
2502          * If ext_meta_format is equal to 1, the metadata field contains
2503          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
2504          * inner_l4_size.
2505          * - metadata[8:0] contains the outer_l3_offset.
2506          * - metadata[17:9] contains the inner_l2_offset.
2507          * - metadata[26:18] contains the inner_l3_offset.
2508          * - metadata[31:27] contains the inner_l4_size.
2509          */
2510         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
2511                 (UINT32_C(0x4) << 4)
2512         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
2513                 RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
2514         /*
2515          * This field indicates the IP type for the inner-most IP header.
2516          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
2517          * This value is only valid if itype indicates a packet
2518          * with an IP header.
2519          */
2520         #define RX_PKT_CMPL_FLAGS2_IP_TYPE                    UINT32_C(0x100)
2521         /*
2522          * This indicates that the complete 1's complement checksum was
2523          * calculated for the packet.
2524          */
2525         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC     UINT32_C(0x200)
2526         /*
2527          * The combination of this value and meta_format indicated what
2528          * format the metadata field is.
2529          */
2530         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK       UINT32_C(0xc00)
2531         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
2532         /*
2533          * This value is the complete 1's complement checksum calculated from
2534          * the start of the outer L3 header to the end of the packet (not
2535          * including the ethernet crc). It is valid when the
2536          * 'complete_checksum_calc' flag is set.
2537          */
2538         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
2539                 UINT32_C(0xffff0000)
2540         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
2541         /*
2542          * This is data from the CFA block as indicated by the meta_format
2543          * field.
2544          */
2545         uint32_t        metadata;
2546         /* When meta_format=1, this value is the VLAN VID. */
2547         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
2548         #define RX_PKT_CMPL_METADATA_VID_SFT  0
2549         /* When meta_format=1, this value is the VLAN DE. */
2550         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
2551         /* When meta_format=1, this value is the VLAN PRI. */
2552         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
2553         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
2554         /* When meta_format=1, this value is the VLAN TPID. */
2555         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
2556         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
2557         uint16_t        errors_v2;
2558         /*
2559          * This value is written by the NIC such that it will be different
2560          * for each pass through the completion queue.   The even passes
2561          * will write 1.  The odd passes will write 0.
2562          */
2563         #define RX_PKT_CMPL_V2 \
2564                 UINT32_C(0x1)
2565         #define RX_PKT_CMPL_ERRORS_MASK \
2566                 UINT32_C(0xfffe)
2567         #define RX_PKT_CMPL_ERRORS_SFT                               1
2568         /*
2569          * This error indicates that there was some sort of problem with
2570          * the BDs for the packet that was found after part of the
2571          * packet was already placed.  The packet should be treated as
2572          * invalid.
2573          */
2574         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
2575                 UINT32_C(0xe)
2576         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
2577         /* No buffer error */
2578         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
2579                 (UINT32_C(0x0) << 1)
2580         /*
2581          * Did Not Fit:
2582          * Packet did not fit into packet buffer provided.
2583          * For regular placement, this means the packet did not fit
2584          * in the buffer provided.  For HDS and jumbo placement, this
2585          * means that the packet could not be placed into 7 physical
2586          * buffers or less.
2587          */
2588         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
2589                 (UINT32_C(0x1) << 1)
2590         /*
2591          * Not On Chip:
2592          * All BDs needed for the packet were not on-chip when
2593          * the packet arrived.
2594          */
2595         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
2596                 (UINT32_C(0x2) << 1)
2597         /*
2598          * Bad Format:
2599          * BDs were not formatted correctly.
2600          */
2601         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
2602                 (UINT32_C(0x3) << 1)
2603         /*
2604          * Flush:
2605          * There was a bad_format error on the previous operation
2606          */
2607         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
2608                 (UINT32_C(0x5) << 1)
2609         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
2610                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
2611         /*
2612          * This indicates that there was an error in the IP header
2613          * checksum.
2614          */
2615         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
2616                 UINT32_C(0x10)
2617         /*
2618          * This indicates that there was an error in the TCP, UDP
2619          * or ICMP checksum.
2620          */
2621         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
2622                 UINT32_C(0x20)
2623         /*
2624          * This indicates that there was an error in the tunnel
2625          * IP header checksum.
2626          */
2627         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
2628                 UINT32_C(0x40)
2629         /*
2630          * This indicates that there was an error in the tunnel
2631          * UDP checksum.
2632          */
2633         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
2634                 UINT32_C(0x80)
2635         /*
2636          * This indicates that there was a CRC error on either an FCoE
2637          * or RoCE packet.  The itype indicates the packet type.
2638          */
2639         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
2640                 UINT32_C(0x100)
2641         /*
2642          * This indicates that there was an error in the tunnel
2643          * portion of the packet when this
2644          * field is non-zero.
2645          */
2646         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
2647                 UINT32_C(0xe00)
2648         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
2649         /*
2650          * No additional error occurred on the tunnel portion
2651          * or the packet of the packet does not have a tunnel.
2652          */
2653         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
2654                 (UINT32_C(0x0) << 9)
2655         /*
2656          * Indicates that IP header version does not match
2657          * expectation from L2 Ethertype for IPv4 and IPv6
2658          * in the tunnel header.
2659          */
2660         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
2661                 (UINT32_C(0x1) << 9)
2662         /*
2663          * Indicates that header length is out of range in the
2664          * tunnel header. Valid for
2665          * IPv4.
2666          */
2667         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
2668                 (UINT32_C(0x2) << 9)
2669         /*
2670          * Indicates that the physical packet is shorter than that
2671          * claimed by the PPPoE header length for a tunnel PPPoE
2672          * packet.
2673          */
2674         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
2675                 (UINT32_C(0x3) << 9)
2676         /*
2677          * Indicates that physical packet is shorter than that claimed
2678          * by the tunnel l3 header length. Valid for IPv4, or IPv6
2679          * tunnel packet packets.
2680          */
2681         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
2682                 (UINT32_C(0x4) << 9)
2683         /*
2684          * Indicates that the physical packet is shorter than that
2685          * claimed by the tunnel UDP header length for a tunnel
2686          * UDP packet that is not fragmented.
2687          */
2688         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
2689                 (UINT32_C(0x5) << 9)
2690         /*
2691          * indicates that the IPv4 TTL or IPv6 hop limit check
2692          * have failed (e.g. TTL = 0) in the tunnel header. Valid
2693          * for IPv4, and IPv6.
2694          */
2695         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
2696                 (UINT32_C(0x6) << 9)
2697         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
2698                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
2699         /*
2700          * This indicates that there was an error in the inner
2701          * portion of the packet when this
2702          * field is non-zero.
2703          */
2704         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
2705                 UINT32_C(0xf000)
2706         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
2707         /*
2708          * No additional error occurred on the tunnel portion
2709          * or the packet of the packet does not have a tunnel.
2710          */
2711         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
2712                 (UINT32_C(0x0) << 12)
2713         /*
2714          * Indicates that IP header version does not match
2715          * expectation from L2 Ethertype for IPv4 and IPv6 or that
2716          * option other than VFT was parsed on
2717          * FCoE packet.
2718          */
2719         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
2720                 (UINT32_C(0x1) << 12)
2721         /*
2722          * indicates that header length is out of range. Valid for
2723          * IPv4 and RoCE
2724          */
2725         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
2726                 (UINT32_C(0x2) << 12)
2727         /*
2728          * indicates that the IPv4 TTL or IPv6 hop limit check
2729          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
2730          */
2731         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
2732                 (UINT32_C(0x3) << 12)
2733         /*
2734          * Indicates that physical packet is shorter than that
2735          * claimed by the l3 header length. Valid for IPv4,
2736          * IPv6 packet or RoCE packets.
2737          */
2738         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
2739                 (UINT32_C(0x4) << 12)
2740         /*
2741          * Indicates that the physical packet is shorter than that
2742          * claimed by the UDP header length for a UDP packet that is
2743          * not fragmented.
2744          */
2745         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
2746                 (UINT32_C(0x5) << 12)
2747         /*
2748          * Indicates that TCP header length > IP payload. Valid for
2749          * TCP packets only.
2750          */
2751         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
2752                 (UINT32_C(0x6) << 12)
2753         /* Indicates that TCP header length < 5. Valid for TCP. */
2754         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
2755                 (UINT32_C(0x7) << 12)
2756         /*
2757          * Indicates that TCP option headers result in a TCP header
2758          * size that does not match data offset in TCP header. Valid
2759          * for TCP.
2760          */
2761         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
2762                 (UINT32_C(0x8) << 12)
2763         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
2764                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
2765         /*
2766          * This field identifies the CFA action rule that was used for this
2767          * packet.
2768          */
2769         uint16_t        cfa_code;
2770         uint32_t        reorder;
2771         /*
2772          * This value holds the reordering sequence number for the packet.
2773          * If the reordering sequence is not valid, then this value is zero.
2774          * The reordering domain for the packet is in the bottom 8 to 10b of
2775          * the rss_hash value.  The bottom 20b of this value contain the
2776          * ordering domain value for the packet.
2777          */
2778         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
2779         #define RX_PKT_CMPL_REORDER_SFT 0
2780 } __attribute__((packed));
2781
2782 /* rx_tpa_start_cmpl (size:128b/16B) */
2783 struct rx_tpa_start_cmpl {
2784         uint16_t        flags_type;
2785         /*
2786          * This field indicates the exact type of the completion.
2787          * By convention, the LSB identifies the length of the
2788          * record in 16B units.  Even values indicate 16B
2789          * records.  Odd values indicate 32B
2790          * records.
2791          */
2792         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
2793         #define RX_TPA_START_CMPL_TYPE_SFT                 0
2794         /*
2795          * RX L2 TPA Start Completion:
2796          * Completion at the beginning of a TPA operation.
2797          * Length = 32B
2798          */
2799         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
2800         #define RX_TPA_START_CMPL_TYPE_LAST \
2801                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
2802         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
2803         #define RX_TPA_START_CMPL_FLAGS_SFT                6
2804         /* This bit will always be '0' for TPA start completions. */
2805         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
2806         /* This field indicates how the packet was placed in the buffer. */
2807         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
2808         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
2809         /*
2810          * Jumbo:
2811          * TPA Packet was placed using jumbo algorithm.  This means
2812          * that the first buffer will be filled with data before
2813          * moving to aggregation buffers.  Each aggregation buffer
2814          * will be filled before moving to the next aggregation
2815          * buffer.
2816          */
2817         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
2818                 (UINT32_C(0x1) << 7)
2819         /*
2820          * Header/Data Separation:
2821          * Packet was placed using Header/Data separation algorithm.
2822          * The separation location is indicated by the itype field.
2823          */
2824         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
2825                 (UINT32_C(0x2) << 7)
2826         /*
2827          * GRO/Jumbo:
2828          * Packet will be placed using GRO/Jumbo where the first
2829          * packet is filled with data. Subsequent packets will be
2830          * placed such that any one packet does not span two
2831          * aggregation buffers unless it starts at the beginning of
2832          * an aggregation buffer.
2833          */
2834         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
2835                 (UINT32_C(0x5) << 7)
2836         /*
2837          * GRO/Header-Data Separation:
2838          * Packet will be placed using GRO/HDS where the header
2839          * is in the first packet.
2840          * Payload of each packet will be
2841          * placed such that any one packet does not span two
2842          * aggregation buffers unless it starts at the beginning of
2843          * an aggregation buffer.
2844          */
2845         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
2846                 (UINT32_C(0x6) << 7)
2847         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
2848                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
2849         /* This bit is '1' if the RSS field in this completion is valid. */
2850         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
2851         /* unused is 1 b */
2852         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
2853         /*
2854          * This value indicates what the inner packet determined for the
2855          * packet was.
2856          */
2857         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
2858         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
2859         /*
2860          * TCP Packet:
2861          * Indicates that the packet was IP and TCP.
2862          */
2863         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
2864                 (UINT32_C(0x2) << 12)
2865         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
2866                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
2867         /*
2868          * This value indicates the amount of packet data written to the
2869          * buffer the opaque field in this completion corresponds to.
2870          */
2871         uint16_t        len;
2872         /*
2873          * This is a copy of the opaque field from the RX BD this completion
2874          * corresponds to.
2875          */
2876         uint32_t        opaque;
2877         /*
2878          * This value is written by the NIC such that it will be different
2879          * for each pass through the completion queue.   The even passes
2880          * will write 1.  The odd passes will write 0.
2881          */
2882         uint8_t v1;
2883         /*
2884          * This value is written by the NIC such that it will be different
2885          * for each pass through the completion queue.   The even passes
2886          * will write 1.  The odd passes will write 0.
2887          */
2888         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
2889         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
2890         /*
2891          * This is the RSS hash type for the packet.  The value is packed
2892          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2893          *
2894          * The value of tuple_extrac_op provides the information about
2895          * what fields the hash was computed on.
2896          * * 0: The RSS hash was computed over source IP address,
2897          * destination IP address, source port, and destination port of inner
2898          * IP and TCP or UDP headers. Note: For non-tunneled packets,
2899          * the packet headers are considered inner packet headers for the RSS
2900          * hash computation purpose.
2901          * * 1: The RSS hash was computed over source IP address and destination
2902          * IP address of inner IP header. Note: For non-tunneled packets,
2903          * the packet headers are considered inner packet headers for the RSS
2904          * hash computation purpose.
2905          * * 2: The RSS hash was computed over source IP address,
2906          * destination IP address, source port, and destination port of
2907          * IP and TCP or UDP headers of outer tunnel headers.
2908          * Note: For non-tunneled packets, this value is not applicable.
2909          * * 3: The RSS hash was computed over source IP address and
2910          * destination IP address of IP header of outer tunnel headers.
2911          * Note: For non-tunneled packets, this value is not applicable.
2912          *
2913          * Note that 4-tuples values listed above are applicable
2914          * for layer 4 protocols supported and enabled for RSS in the hardware,
2915          * HWRM firmware, and drivers. For example, if RSS hash is supported and
2916          * enabled for TCP traffic only, then the values of tuple_extract_op
2917          * corresponding to 4-tuples are only valid for TCP traffic.
2918          */
2919         uint8_t rss_hash_type;
2920         /*
2921          * This is the aggregation ID that the completion is associated
2922          * with.  Use this number to correlate the TPA start completion
2923          * with the TPA end completion.
2924          */
2925         uint16_t        agg_id;
2926         /* unused2 is 9 b */
2927         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
2928         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
2929         /*
2930          * This is the aggregation ID that the completion is associated
2931          * with.  Use this number to correlate the TPA start completion
2932          * with the TPA end completion.
2933          */
2934         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
2935         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
2936         /*
2937          * This value is the RSS hash value calculated for the packet
2938          * based on the mode bits and key value in the VNIC.
2939          */
2940         uint32_t        rss_hash;
2941 } __attribute__((packed));
2942
2943 /* Last 16 bytes of rx_tpq_start_cmpl. */
2944 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
2945 struct rx_tpa_start_cmpl_hi {
2946         uint32_t        flags2;
2947         /*
2948          * This indicates that the ip checksum was calculated for the
2949          * inner packet and that the sum passed for all segments
2950          * included in the aggregation.
2951          */
2952         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC \
2953                 UINT32_C(0x1)
2954         /*
2955          * This indicates that the TCP, UDP or ICMP checksum was
2956          * calculated for the inner packet and that the sum passed
2957          * for all segments included in the aggregation.
2958          */
2959         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC \
2960                 UINT32_C(0x2)
2961         /*
2962          * This indicates that the ip checksum was calculated for the
2963          * tunnel header and that the sum passed for all segments
2964          * included in the aggregation.
2965          */
2966         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC \
2967                 UINT32_C(0x4)
2968         /*
2969          * This indicates that the UDP checksum was
2970          * calculated for the tunnel packet and that the sum passed for
2971          * all segments included in the aggregation.
2972          */
2973         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC \
2974                 UINT32_C(0x8)
2975         /* This value indicates what format the metadata field is. */
2976         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK \
2977                 UINT32_C(0xf0)
2978         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT            4
2979         /* No metadata informtaion.  Value is zero. */
2980         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
2981                 (UINT32_C(0x0) << 4)
2982         /*
2983          * The metadata field contains the VLAN tag and TPID value.
2984          * - metadata[11:0] contains the vlan VID value.
2985          * - metadata[12] contains the vlan DE value.
2986          * - metadata[15:13] contains the vlan PRI value.
2987          * - metadata[31:16] contains the vlan TPID value.
2988          */
2989         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
2990                 (UINT32_C(0x1) << 4)
2991         /*
2992          * If ext_meta_format is equal to 1, the metadata field
2993          * contains the lower 16b of the tunnel ID value, justified
2994          * to LSB
2995          * - VXLAN = VNI[23:0] -> VXLAN Network ID
2996          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
2997          * - NVGRE = TNI[23:0] -> Tenant Network ID
2998          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
2999          * - IPV4 = 0 (not populated)
3000          * - IPV6 = Flow Label[19:0]
3001          * - PPPoE = sessionID[15:0]
3002          * - MPLs = Outer label[19:0]
3003          * - UPAR = Selected[31:0] with bit mask
3004          */
3005         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
3006                 (UINT32_C(0x2) << 4)
3007         /*
3008          * if ext_meta_format is equal to 1, metadata field contains
3009          * 16b metadata from the prepended header (chdr_data).
3010          */
3011         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
3012                 (UINT32_C(0x3) << 4)
3013         /*
3014          * If ext_meta_format is equal to 1, the metadata field contains
3015          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
3016          * inner_l4_size.
3017          * - metadata[8:0] contains the outer_l3_offset.
3018          * - metadata[17:9] contains the inner_l2_offset.
3019          * - metadata[26:18] contains the inner_l3_offset.
3020          * - metadata[31:27] contains the inner_l4_size.
3021          */
3022         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
3023                 (UINT32_C(0x4) << 4)
3024         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
3025                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
3026         /*
3027          * This field indicates the IP type for the inner-most IP header.
3028          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
3029          */
3030         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE \
3031                 UINT32_C(0x100)
3032         /*
3033          * This indicates that the complete 1's complement checksum was
3034          * calculated for the packet.
3035          */
3036         #define RX_TPA_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
3037                 UINT32_C(0x200)
3038         /*
3039          * The combination of this value and meta_format indicated what
3040          * format the metadata field is.
3041          */
3042         #define RX_TPA_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK \
3043                 UINT32_C(0xc00)
3044         #define RX_TPA_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
3045         /*
3046          * This value is the complete 1's complement checksum calculated from
3047          * the start of the outer L3 header to the end of the packet (not
3048          * including the ethernet crc). It is valid when the
3049          * 'complete_checksum_calc' flag is set. For TPA Start completions,
3050          * the complete checksum is calculated for the first packet in the
3051          * aggregation only.
3052          */
3053         #define RX_TPA_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
3054                 UINT32_C(0xffff0000)
3055         #define RX_TPA_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
3056         /*
3057          * This is data from the CFA block as indicated by the meta_format
3058          * field.
3059          */
3060         uint32_t        metadata;
3061         /* When meta_format=1, this value is the VLAN VID. */
3062         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
3063         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
3064         /* When meta_format=1, this value is the VLAN DE. */
3065         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
3066         /* When meta_format=1, this value is the VLAN PRI. */
3067         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
3068         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
3069         /* When meta_format=1, this value is the VLAN TPID. */
3070         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
3071         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
3072         uint16_t        errors_v2;
3073         /*
3074          * This value is written by the NIC such that it will be different
3075          * for each pass through the completion queue.   The even passes
3076          * will write 1.  The odd passes will write 0.
3077          */
3078         #define RX_TPA_START_CMPL_V2                            UINT32_C(0x1)
3079         #define RX_TPA_START_CMPL_ERRORS_MASK \
3080                 UINT32_C(0xfffe)
3081         #define RX_TPA_START_CMPL_ERRORS_SFT                    1
3082         /*
3083          * This error indicates that there was some sort of problem with
3084          * the BDs for the packet that was found after part of the
3085          * packet was already placed.  The packet should be treated as
3086          * invalid.
3087          */
3088         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_MASK       UINT32_C(0xe)
3089         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_SFT        1
3090         /* No buffer error */
3091         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
3092                 (UINT32_C(0x0) << 1)
3093         /*
3094          * Bad Format:
3095          * BDs were not formatted correctly.
3096          */
3097         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3098                 (UINT32_C(0x3) << 1)
3099         /*
3100          * Flush:
3101          * There was a bad_format error on the previous operation
3102          */
3103         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
3104                 (UINT32_C(0x5) << 1)
3105         #define RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_LAST \
3106                 RX_TPA_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
3107         /*
3108          * This field identifies the CFA action rule that was used for this
3109          * packet.
3110          */
3111         uint16_t        cfa_code;
3112         /*
3113          * This is the size in bytes of the inner most L4 header.
3114          * This can be subtracted from the payload_offset to determine
3115          * the start of the inner most L4 header.
3116          */
3117         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
3118         /*
3119          * This is the offset from the beginning of the packet in bytes for
3120          * the outer L3 header.  If there is no outer L3 header, then this
3121          * value is zero.
3122          */
3123         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
3124         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
3125         /*
3126          * This is the offset from the beginning of the packet in bytes for
3127          * the inner most L2 header.
3128          */
3129         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
3130         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
3131         /*
3132          * This is the offset from the beginning of the packet in bytes for
3133          * the inner most L3 header.
3134          */
3135         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
3136         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
3137         /*
3138          * This is the size in bytes of the inner most L4 header.
3139          * This can be subtracted from the payload_offset to determine
3140          * the start of the inner most L4 header.
3141          */
3142         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
3143         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
3144 } __attribute__((packed));
3145
3146 /* rx_tpa_end_cmpl (size:128b/16B) */
3147 struct rx_tpa_end_cmpl {
3148         uint16_t        flags_type;
3149         /*
3150          * This field indicates the exact type of the completion.
3151          * By convention, the LSB identifies the length of the
3152          * record in 16B units.  Even values indicate 16B
3153          * records.  Odd values indicate 32B
3154          * records.
3155          */
3156         #define RX_TPA_END_CMPL_TYPE_MASK                UINT32_C(0x3f)
3157         #define RX_TPA_END_CMPL_TYPE_SFT                 0
3158         /*
3159          * RX L2 TPA End Completion:
3160          * Completion at the end of a TPA operation.
3161          * Length = 32B
3162          */
3163         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END            UINT32_C(0x15)
3164         #define RX_TPA_END_CMPL_TYPE_LAST \
3165                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
3166         #define RX_TPA_END_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
3167         #define RX_TPA_END_CMPL_FLAGS_SFT                6
3168         /*
3169          * When this bit is '1', it indicates a packet that has an
3170          * error of some type.  Type of error is indicated in
3171          * error_flags.
3172          */
3173         #define RX_TPA_END_CMPL_FLAGS_ERROR               UINT32_C(0x40)
3174         /* This field indicates how the packet was placed in the buffer. */
3175         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
3176         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT       7
3177         /*
3178          * Jumbo:
3179          * TPA Packet was placed using jumbo algorithm.  This means
3180          * that the first buffer will be filled with data before
3181          * moving to aggregation buffers.  Each aggregation buffer
3182          * will be filled before moving to the next aggregation
3183          * buffer.
3184          */
3185         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
3186                 (UINT32_C(0x1) << 7)
3187         /*
3188          * Header/Data Separation:
3189          * Packet was placed using Header/Data separation algorithm.
3190          * The separation location is indicated by the itype field.
3191          */
3192         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
3193                 (UINT32_C(0x2) << 7)
3194         /*
3195          * GRO/Jumbo:
3196          * Packet will be placed using GRO/Jumbo where the first
3197          * packet is filled with data. Subsequent packets will be
3198          * placed such that any one packet does not span two
3199          * aggregation buffers unless it starts at the beginning of
3200          * an aggregation buffer.
3201          */
3202         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
3203                 (UINT32_C(0x5) << 7)
3204         /*
3205          * GRO/Header-Data Separation:
3206          * Packet will be placed using GRO/HDS where the header
3207          * is in the first packet.
3208          * Payload of each packet will be
3209          * placed such that any one packet does not span two
3210          * aggregation buffers unless it starts at the beginning of
3211          * an aggregation buffer.
3212          */
3213         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
3214                 (UINT32_C(0x6) << 7)
3215         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
3216                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
3217         /* unused is 2 b */
3218         #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK         UINT32_C(0xc00)
3219         #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT          10
3220         /*
3221          * This value indicates what the inner packet determined for the
3222          * packet was.
3223          * - 2 TCP Packet
3224          *     Indicates that the packet was IP and TCP.  This indicates
3225          *     that the ip_cs field is valid and that the tcp_udp_cs
3226          *     field is valid and contains the TCP checksum.
3227          *     This also indicates that the payload_offset field is valid.
3228          */
3229         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
3230         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT           12
3231         /*
3232          * This value is zero for TPA End completions.
3233          * There is no data in the buffer that corresponds to the opaque
3234          * value in this completion.
3235          */
3236         uint16_t        len;
3237         /*
3238          * This is a copy of the opaque field from the RX BD this completion
3239          * corresponds to.
3240          */
3241         uint32_t        opaque;
3242         /*
3243          * This value is written by the NIC such that it will be different
3244          * for each pass through the completion queue.   The even passes
3245          * will write 1.  The odd passes will write 0.
3246          */
3247         uint8_t agg_bufs_v1;
3248         /*
3249          * This value is written by the NIC such that it will be different
3250          * for each pass through the completion queue.   The even passes
3251          * will write 1.  The odd passes will write 0.
3252          */
3253         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
3254         /*
3255          * This value is the number of aggregation buffers that follow this
3256          * entry in the completion ring that are a part of this aggregation
3257          * packet.
3258          * If the value is zero, then the packet is completely contained
3259          * in the buffer space provided in the aggregation start completion.
3260          */
3261         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
3262         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
3263         /* This value is the number of segments in the TPA operation. */
3264         uint8_t tpa_segs;
3265         /*
3266          * This value indicates the offset in bytes from the beginning of the packet
3267          * where the inner payload starts.  This value is valid for TCP, UDP,
3268          * FCoE, and RoCE packets.
3269          *
3270          * A value of zero indicates an offset of 256 bytes.
3271          */
3272         uint8_t payload_offset;
3273         uint8_t agg_id;
3274         /* unused2 is 1 b */
3275         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
3276         /*
3277          * This is the aggregation ID that the completion is associated
3278          * with.  Use this number to correlate the TPA start completion
3279          * with the TPA end completion.
3280          */
3281         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
3282         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
3283         /*
3284          * For non-GRO packets, this value is the
3285          * timestamp delta between earliest and latest timestamp values for
3286          * TPA packet. If packets were not time stamped, then delta will be
3287          * zero.
3288          *
3289          * For GRO packets, this field is zero except for the following
3290          * sub-fields.
3291          * - tsdelta[31]
3292          *     Timestamp present indication.  When '0', no Timestamp
3293          *     option is in the packet.  When '1', then a Timestamp
3294          *     option is present in the packet.
3295          */
3296         uint32_t        tsdelta;
3297 } __attribute__((packed));
3298
3299 /* Last 16 bytes of rx_tpa_end_cmpl. */
3300 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
3301 struct rx_tpa_end_cmpl_hi {
3302         /*
3303          * This value is the number of duplicate ACKs that have been
3304          * received as part of the TPA operation.
3305          */
3306         uint16_t        tpa_dup_acks;
3307         /*
3308          * This value is the number of duplicate ACKs that have been
3309          * received as part of the TPA operation.
3310          */
3311         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
3312         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
3313         /*
3314          * This value indicated the offset in bytes from the beginning of
3315          * the packet where the inner payload starts. This value is valid
3316          * for TCP, UDP, FCoE and RoCE packets
3317          */
3318         uint8_t payload_offset;
3319         /*
3320          * The value is the total number of aggregation buffers that were
3321          * used in the TPA operation. All TPA aggregation buffer completions
3322          * precede the TPA End completion. If the value is zero, then the
3323          * aggregation is completely contained in the buffer space provided
3324          * in the aggregation start completion.
3325          * Note that the field is simply provided as a cross check.
3326          */
3327         uint8_t tpa_agg_bufs;
3328         /*
3329          * This value is the valid when TPA completion is active.  It
3330          * indicates the length of the longest segment of the TPA operation
3331          * for LRO mode and the length of the first segment in GRO mode.
3332          *
3333          * This value may be used by GRO software to re-construct the original
3334          * packet stream from the TPA packet.  This is the length of all
3335          * but the last segment for GRO.  In LRO mode this value may be used
3336          * to indicate MSS size to the stack.
3337          */
3338         uint16_t        tpa_seg_len;
3339         /* unused4 is 16 b */
3340         uint16_t        unused3;
3341         uint16_t        errors_v2;
3342         /*
3343          * This value is written by the NIC such that it will be different
3344          * for each pass through the completion queue.   The even passes
3345          * will write 1.  The odd passes will write 0.
3346          */
3347         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
3348         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
3349         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
3350         /*
3351          * This error indicates that there was some sort of problem with
3352          * the BDs for the packet that was found after part of the
3353          * packet was already placed.  The packet should be treated as
3354          * invalid.
3355          */
3356         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
3357         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
3358         /* No buffer error */
3359         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
3360                 (UINT32_C(0x0) << 1)
3361         /*
3362          * This error occurs when there is a fatal HW problem in
3363          * the chip only.  It indicates that there were not
3364          * BDs on chip but that there was adequate reservation.
3365          * provided by the TPA block.
3366          */
3367         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
3368                 (UINT32_C(0x2) << 1)
3369         /*
3370          * Bad Format:
3371          * BDs were not formatted correctly.
3372          */
3373         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3374                 (UINT32_C(0x3) << 1)
3375         /*
3376          * This error occurs when TPA block was not configured to
3377          * reserve adequate BDs for TPA operations on this RX
3378          * ring.  All data for the TPA operation was not placed.
3379          *
3380          * This error can also be generated when the number of
3381          * segments is not programmed correctly in TPA and the
3382          * 33 total aggregation buffers allowed for the TPA
3383          * operation has been exceeded.
3384          */
3385         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
3386                 (UINT32_C(0x4) << 1)
3387         /*
3388          * Flush:
3389          * There was a bad_format error on the previous operation
3390          */
3391         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
3392                 (UINT32_C(0x5) << 1)
3393         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
3394                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
3395         /* unused5 is 16 b */
3396         uint16_t        unused_4;
3397         /*
3398          * This is the opaque value that was completed for the TPA start
3399          * completion that corresponds to this TPA end completion.
3400          */
3401         uint32_t        start_opaque;
3402 } __attribute__((packed));
3403
3404 /* rx_abuf_cmpl (size:128b/16B) */
3405 struct rx_abuf_cmpl {
3406         uint16_t        type;
3407         /*
3408          * This field indicates the exact type of the completion.
3409          * By convention, the LSB identifies the length of the
3410          * record in 16B units.  Even values indicate 16B
3411          * records.  Odd values indicate 32B
3412          * records.
3413          */
3414         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
3415         #define RX_ABUF_CMPL_TYPE_SFT   0
3416         /*
3417          * RX Aggregation Buffer completion :
3418          * Completion of an L2 aggregation buffer in support of
3419          * TPA, HDS, or Jumbo packet completion.  Length = 16B
3420          */
3421         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
3422         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
3423         /*
3424          * This is the length of the data for the packet stored in this
3425          * aggregation buffer identified by the opaque value.  This does not
3426          * include the length of any
3427          * data placed in other aggregation BDs or in the packet or buffer
3428          * BDs.   This length does not include any space added due to
3429          * hdr_offset register during HDS placement mode.
3430          */
3431         uint16_t        len;
3432         /*
3433          * This is a copy of the opaque field from the RX BD this aggregation
3434          * buffer corresponds to.
3435          */
3436         uint32_t        opaque;
3437         uint32_t        v;
3438         /*
3439          * This value is written by the NIC such that it will be different
3440          * for each pass through the completion queue.   The even passes
3441          * will write 1.  The odd passes will write 0.
3442          */
3443         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
3444         /* unused3 is 32 b */
3445         uint32_t        unused_2;
3446 } __attribute__((packed));
3447
3448 /* eject_cmpl (size:128b/16B) */
3449 struct eject_cmpl {
3450         uint16_t        type;
3451         /*
3452          * This field indicates the exact type of the completion.
3453          * By convention, the LSB identifies the length of the
3454          * record in 16B units.  Even values indicate 16B
3455          * records.  Odd values indicate 32B
3456          * records.
3457          */
3458         #define EJECT_CMPL_TYPE_MASK       UINT32_C(0x3f)
3459         #define EJECT_CMPL_TYPE_SFT        0
3460         /*
3461          * Statistics Ejection Completion:
3462          * Completion of statistics data ejection buffer.
3463          * Length = 16B
3464          */
3465         #define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
3466         #define EJECT_CMPL_TYPE_LAST        EJECT_CMPL_TYPE_STAT_EJECT
3467         #define EJECT_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
3468         #define EJECT_CMPL_FLAGS_SFT       6
3469         /*
3470          * When this bit is '1', it indicates a packet that has an
3471          * error of some type.  Type of error is indicated in
3472          * error_flags.
3473          */
3474         #define EJECT_CMPL_FLAGS_ERROR      UINT32_C(0x40)
3475         /*
3476          * This is the length of the statistics data stored in this
3477          * buffer.
3478          */
3479         uint16_t        len;
3480         /*
3481          * This is a copy of the opaque field from the RX BD this ejection
3482          * buffer corresponds to.
3483          */
3484         uint32_t        opaque;
3485         uint16_t        v;
3486         /*
3487          * This value is written by the NIC such that it will be different
3488          * for each pass through the completion queue.   The even passes
3489          * will write 1.  The odd passes will write 0.
3490          */
3491         #define EJECT_CMPL_V                              UINT32_C(0x1)
3492         #define EJECT_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
3493         #define EJECT_CMPL_ERRORS_SFT                     1
3494         /*
3495          * This error indicates that there was some sort of problem with
3496          * the BDs for statistics ejection. The statistics ejection should
3497          * be treated as invalid
3498          */
3499         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
3500         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT         1
3501         /* No buffer error */
3502         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
3503                 (UINT32_C(0x0) << 1)
3504         /*
3505          * Did Not Fit:
3506          * Statistics did not fit into aggregation buffer provided.
3507          */
3508         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
3509                 (UINT32_C(0x1) << 1)
3510         /*
3511          * Bad Format:
3512          * BDs were not formatted correctly.
3513          */
3514         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3515                 (UINT32_C(0x3) << 1)
3516         /*
3517          * Flush:
3518          * There was a bad_format error on the previous operation
3519          */
3520         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
3521                 (UINT32_C(0x5) << 1)
3522         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST \
3523                 EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
3524         /* reserved16 is 16 b */
3525         uint16_t        reserved16;
3526         /* unused3 is 32 b */
3527         uint32_t        unused_2;
3528 } __attribute__((packed));
3529
3530 /* hwrm_cmpl (size:128b/16B) */
3531 struct hwrm_cmpl {
3532         uint16_t        type;
3533         /*
3534          * This field indicates the exact type of the completion.
3535          * By convention, the LSB identifies the length of the
3536          * record in 16B units.  Even values indicate 16B
3537          * records.  Odd values indicate 32B
3538          * records.
3539          */
3540         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
3541         #define HWRM_CMPL_TYPE_SFT      0
3542         /*
3543          * HWRM Command Completion:
3544          * Completion of an HWRM command.
3545          */
3546         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
3547         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
3548         /* This is the sequence_id of the HWRM command that has completed. */
3549         uint16_t        sequence_id;
3550         /* unused2 is 32 b */
3551         uint32_t        unused_1;
3552         uint32_t        v;
3553         /*
3554          * This value is written by the NIC such that it will be different
3555          * for each pass through the completion queue.   The even passes
3556          * will write 1.  The odd passes will write 0.
3557          */
3558         #define HWRM_CMPL_V     UINT32_C(0x1)
3559         /* unused4 is 32 b */
3560         uint32_t        unused_3;
3561 } __attribute__((packed));
3562
3563 /* hwrm_fwd_req_cmpl (size:128b/16B) */
3564 struct hwrm_fwd_req_cmpl {
3565         /*
3566          * This field indicates the exact type of the completion.
3567          * By convention, the LSB identifies the length of the
3568          * record in 16B units.  Even values indicate 16B
3569          * records.  Odd values indicate 32B
3570          * records.
3571          */
3572         uint16_t        req_len_type;
3573         /*
3574          * This field indicates the exact type of the completion.
3575          * By convention, the LSB identifies the length of the
3576          * record in 16B units.  Even values indicate 16B
3577          * records.  Odd values indicate 32B
3578          * records.
3579          */
3580         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
3581         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
3582         /* Forwarded HWRM Request */
3583         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
3584         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
3585                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
3586         /* Length of forwarded request in bytes. */
3587         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
3588         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
3589         /*
3590          * Source ID of this request.
3591          * Typically used in forwarding requests and responses.
3592          * 0x0 - 0xFFF8 - Used for function ids
3593          * 0xFFF8 - 0xFFFE - Reserved for internal processors
3594          * 0xFFFF - HWRM
3595          */
3596         uint16_t        source_id;
3597         /* unused1 is 32 b */
3598         uint32_t        unused0;
3599         /* Address of forwarded request. */
3600         uint32_t        req_buf_addr_v[2];
3601         /*
3602          * This value is written by the NIC such that it will be different
3603          * for each pass through the completion queue.   The even passes
3604          * will write 1.  The odd passes will write 0.
3605          */
3606         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
3607         /* Address of forwarded request. */
3608         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
3609         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
3610 } __attribute__((packed));
3611
3612 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
3613 struct hwrm_fwd_resp_cmpl {
3614         uint16_t        type;
3615         /*
3616          * This field indicates the exact type of the completion.
3617          * By convention, the LSB identifies the length of the
3618          * record in 16B units.  Even values indicate 16B
3619          * records.  Odd values indicate 32B
3620          * records.
3621          */
3622         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
3623         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
3624         /* Forwarded HWRM Response */
3625         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
3626         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
3627                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
3628         /*
3629          * Source ID of this response.
3630          * Typically used in forwarding requests and responses.
3631          * 0x0 - 0xFFF8 - Used for function ids
3632          * 0xFFF8 - 0xFFFE - Reserved for internal processors
3633          * 0xFFFF - HWRM
3634          */
3635         uint16_t        source_id;
3636         /* Length of forwarded response in bytes. */
3637         uint16_t        resp_len;
3638         /* unused2 is 16 b */
3639         uint16_t        unused_1;
3640         /* Address of forwarded request. */
3641         uint32_t        resp_buf_addr_v[2];
3642         /*
3643          * This value is written by the NIC such that it will be different
3644          * for each pass through the completion queue.   The even passes
3645          * will write 1.  The odd passes will write 0.
3646          */
3647         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
3648         /* Address of forwarded request. */
3649         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
3650         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
3651 } __attribute__((packed));
3652
3653 /* hwrm_async_event_cmpl (size:128b/16B) */
3654 struct hwrm_async_event_cmpl {
3655         uint16_t        type;
3656         /*
3657          * This field indicates the exact type of the completion.
3658          * By convention, the LSB identifies the length of the
3659          * record in 16B units.  Even values indicate 16B
3660          * records.  Odd values indicate 32B
3661          * records.
3662          */
3663         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
3664         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
3665         /* HWRM Asynchronous Event Information */
3666         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
3667         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
3668                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
3669         /* Identifiers of events. */
3670         uint16_t        event_id;
3671         /* Link status changed */
3672         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
3673                 UINT32_C(0x0)
3674         /* Link MTU changed */
3675         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
3676                 UINT32_C(0x1)
3677         /* Link speed changed */
3678         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
3679                 UINT32_C(0x2)
3680         /* DCB Configuration changed */
3681         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
3682                 UINT32_C(0x3)
3683         /* Port connection not allowed */
3684         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
3685                 UINT32_C(0x4)
3686         /* Link speed configuration was not allowed */
3687         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
3688                 UINT32_C(0x5)
3689         /* Link speed configuration change */
3690         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
3691                 UINT32_C(0x6)
3692         /* Port PHY configuration change */
3693         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
3694                 UINT32_C(0x7)
3695         /* Reset notification to clients */
3696         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \
3697                 UINT32_C(0x8)
3698         /* Function driver unloaded */
3699         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
3700                 UINT32_C(0x10)
3701         /* Function driver loaded */
3702         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
3703                 UINT32_C(0x11)
3704         /* Function FLR related processing has completed */
3705         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
3706                 UINT32_C(0x12)
3707         /* PF driver unloaded */
3708         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
3709                 UINT32_C(0x20)
3710         /* PF driver loaded */
3711         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
3712                 UINT32_C(0x21)
3713         /* VF Function Level Reset (FLR) */
3714         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
3715                 UINT32_C(0x30)
3716         /* VF MAC Address Change */
3717         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
3718                 UINT32_C(0x31)
3719         /* PF-VF communication channel status change. */
3720         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
3721                 UINT32_C(0x32)
3722         /* VF Configuration Change */
3723         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
3724                 UINT32_C(0x33)
3725         /* LLFC/PFC Configuration Change */
3726         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
3727                 UINT32_C(0x34)
3728         /* Default VNIC Configuration Change */
3729         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \
3730                 UINT32_C(0x35)
3731         /* HW flow aged */
3732         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED \
3733                 UINT32_C(0x36)
3734         /*
3735          * A debug notification being posted to the driver. These
3736          * notifications are purely for diagnostic purpose and should not be
3737          * used for functional purpose. The driver is not supposed to act
3738          * on these messages except to log/record it.
3739          */
3740         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION \
3741                 UINT32_C(0x37)
3742         /*
3743          * A trace log message. This contains firmware trace logs string
3744          * embedded in the asynchronous message. This is an experimental
3745          * event, not meant for production use at this time.
3746          */
3747         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG \
3748                 UINT32_C(0xfe)
3749         /* HWRM Error */
3750         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
3751                 UINT32_C(0xff)
3752         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
3753                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
3754         /* Event specific data */
3755         uint32_t        event_data2;
3756         uint8_t opaque_v;
3757         /*
3758          * This value is written by the NIC such that it will be different
3759          * for each pass through the completion queue.   The even passes
3760          * will write 1.  The odd passes will write 0.
3761          */
3762         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
3763         /* opaque is 7 b */
3764         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
3765         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
3766         /* 8-lsb timestamp from POR (100-msec resolution) */
3767         uint8_t timestamp_lo;
3768         /* 16-lsb timestamp from POR (100-msec resolution) */
3769         uint16_t        timestamp_hi;
3770         /* Event specific data */
3771         uint32_t        event_data1;
3772 } __attribute__((packed));
3773
3774 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
3775 struct hwrm_async_event_cmpl_link_status_change {
3776         uint16_t        type;
3777         /*
3778          * This field indicates the exact type of the completion.
3779          * By convention, the LSB identifies the length of the
3780          * record in 16B units.  Even values indicate 16B
3781          * records.  Odd values indicate 32B
3782          * records.
3783          */
3784         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
3785                 UINT32_C(0x3f)
3786         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
3787         /* HWRM Asynchronous Event Information */
3788         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
3789                 UINT32_C(0x2e)
3790         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
3791                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
3792         /* Identifiers of events. */
3793         uint16_t        event_id;
3794         /* Link status changed */
3795         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
3796                 UINT32_C(0x0)
3797         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
3798                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
3799         /* Event specific data */
3800         uint32_t        event_data2;
3801         uint8_t opaque_v;
3802         /*
3803          * This value is written by the NIC such that it will be different
3804          * for each pass through the completion queue.   The even passes
3805          * will write 1.  The odd passes will write 0.
3806          */
3807         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
3808                 UINT32_C(0x1)
3809         /* opaque is 7 b */
3810         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
3811                 UINT32_C(0xfe)
3812         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
3813         /* 8-lsb timestamp from POR (100-msec resolution) */
3814         uint8_t timestamp_lo;
3815         /* 16-lsb timestamp from POR (100-msec resolution) */
3816         uint16_t        timestamp_hi;
3817         /* Event specific data */
3818         uint32_t        event_data1;
3819         /* Indicates link status change */
3820         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
3821                 UINT32_C(0x1)
3822         /*
3823          * If this bit set to 0, then it indicates that the link
3824          * was up and it went down.
3825          */
3826         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
3827                 UINT32_C(0x0)
3828         /*
3829          * If this bit is set to 1, then it indicates that the link
3830          * was down and it went up.
3831          */
3832         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
3833                 UINT32_C(0x1)
3834         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
3835                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
3836         /* Indicates the physical port this link status change occur */
3837         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
3838                 UINT32_C(0xe)
3839         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
3840                 1
3841         /* PORT ID */
3842         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
3843                 UINT32_C(0xffff0)
3844         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
3845                 4
3846         /* Indicates the physical function this event occurred on. */
3847         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \
3848                 UINT32_C(0xff00000)
3849         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
3850                 20
3851 } __attribute__((packed));
3852
3853 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
3854 struct hwrm_async_event_cmpl_link_mtu_change {
3855         uint16_t        type;
3856         /*
3857          * This field indicates the exact type of the completion.
3858          * By convention, the LSB identifies the length of the
3859          * record in 16B units.  Even values indicate 16B
3860          * records.  Odd values indicate 32B
3861          * records.
3862          */
3863         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \
3864                 UINT32_C(0x3f)
3865         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT             0
3866         /* HWRM Asynchronous Event Information */
3867         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \
3868                 UINT32_C(0x2e)
3869         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \
3870                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
3871         /* Identifiers of events. */
3872         uint16_t        event_id;
3873         /* Link MTU changed */
3874         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \
3875                 UINT32_C(0x1)
3876         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \
3877                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
3878         /* Event specific data */
3879         uint32_t        event_data2;
3880         uint8_t opaque_v;
3881         /*
3882          * This value is written by the NIC such that it will be different
3883          * for each pass through the completion queue.   The even passes
3884          * will write 1.  The odd passes will write 0.
3885          */
3886         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V          UINT32_C(0x1)
3887         /* opaque is 7 b */
3888         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \
3889                 UINT32_C(0xfe)
3890         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
3891         /* 8-lsb timestamp from POR (100-msec resolution) */
3892         uint8_t timestamp_lo;
3893         /* 16-lsb timestamp from POR (100-msec resolution) */
3894         uint16_t        timestamp_hi;
3895         /* Event specific data */
3896         uint32_t        event_data1;
3897         /* The new MTU of the link in bytes. */
3898         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
3899                 UINT32_C(0xffff)
3900         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
3901 } __attribute__((packed));
3902
3903 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
3904 struct hwrm_async_event_cmpl_link_speed_change {
3905         uint16_t        type;
3906         /*
3907          * This field indicates the exact type of the completion.
3908          * By convention, the LSB identifies the length of the
3909          * record in 16B units.  Even values indicate 16B
3910          * records.  Odd values indicate 32B
3911          * records.
3912          */
3913         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \
3914                 UINT32_C(0x3f)
3915         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT             0
3916         /* HWRM Asynchronous Event Information */
3917         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \
3918                 UINT32_C(0x2e)
3919         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \
3920                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
3921         /* Identifiers of events. */
3922         uint16_t        event_id;
3923         /* Link speed changed */
3924         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \
3925                 UINT32_C(0x2)
3926         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \
3927                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
3928         /* Event specific data */
3929         uint32_t        event_data2;
3930         uint8_t opaque_v;
3931         /*
3932          * This value is written by the NIC such that it will be different
3933          * for each pass through the completion queue.   The even passes
3934          * will write 1.  The odd passes will write 0.
3935          */
3936         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \
3937                 UINT32_C(0x1)
3938         /* opaque is 7 b */
3939         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \
3940                 UINT32_C(0xfe)
3941         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
3942         /* 8-lsb timestamp from POR (100-msec resolution) */
3943         uint8_t timestamp_lo;
3944         /* 16-lsb timestamp from POR (100-msec resolution) */
3945         uint16_t        timestamp_hi;
3946         /* Event specific data */
3947         uint32_t        event_data1;
3948         /*
3949          * When this bit is '1', the link was forced to the
3950          * force_link_speed value.
3951          */
3952         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \
3953                 UINT32_C(0x1)
3954         /* The new link speed in 100 Mbps units. */
3955         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \
3956                 UINT32_C(0xfffe)
3957         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \
3958                 1
3959         /* 100Mb link speed */
3960         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \
3961                 (UINT32_C(0x1) << 1)
3962         /* 1Gb link speed */
3963         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \
3964                 (UINT32_C(0xa) << 1)
3965         /* 2Gb link speed */
3966         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \
3967                 (UINT32_C(0x14) << 1)
3968         /* 25Gb link speed */
3969         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \
3970                 (UINT32_C(0x19) << 1)
3971         /* 10Gb link speed */
3972         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \
3973                 (UINT32_C(0x64) << 1)
3974         /* 20Mb link speed */
3975         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \
3976                 (UINT32_C(0xc8) << 1)
3977         /* 25Gb link speed */
3978         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \
3979                 (UINT32_C(0xfa) << 1)
3980         /* 40Gb link speed */
3981         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \
3982                 (UINT32_C(0x190) << 1)
3983         /* 50Gb link speed */
3984         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \
3985                 (UINT32_C(0x1f4) << 1)
3986         /* 100Gb link speed */
3987         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \
3988                 (UINT32_C(0x3e8) << 1)
3989         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \
3990                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
3991         /* PORT ID */
3992         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \
3993                 UINT32_C(0xffff0000)
3994         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
3995                 16
3996 } __attribute__((packed));
3997
3998 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
3999 struct hwrm_async_event_cmpl_dcb_config_change {
4000         uint16_t        type;
4001         /*
4002          * This field indicates the exact type of the completion.
4003          * By convention, the LSB identifies the length of the
4004          * record in 16B units.  Even values indicate 16B
4005          * records.  Odd values indicate 32B
4006          * records.
4007          */
4008         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \
4009                 UINT32_C(0x3f)
4010         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT             0
4011         /* HWRM Asynchronous Event Information */
4012         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4013                 UINT32_C(0x2e)
4014         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \
4015                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4016         /* Identifiers of events. */
4017         uint16_t        event_id;
4018         /* DCB Configuration changed */
4019         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \
4020                 UINT32_C(0x3)
4021         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \
4022                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
4023         /* Event specific data */
4024         uint32_t        event_data2;
4025         /* ETS configuration change */
4026         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \
4027                 UINT32_C(0x1)
4028         /* PFC configuration change */
4029         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \
4030                 UINT32_C(0x2)
4031         /* APP configuration change */
4032         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \
4033                 UINT32_C(0x4)
4034         uint8_t opaque_v;
4035         /*
4036          * This value is written by the NIC such that it will be different
4037          * for each pass through the completion queue.   The even passes
4038          * will write 1.  The odd passes will write 0.
4039          */
4040         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \
4041                 UINT32_C(0x1)
4042         /* opaque is 7 b */
4043         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \
4044                 UINT32_C(0xfe)
4045         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
4046         /* 8-lsb timestamp from POR (100-msec resolution) */
4047         uint8_t timestamp_lo;
4048         /* 16-lsb timestamp from POR (100-msec resolution) */
4049         uint16_t        timestamp_hi;
4050         /* Event specific data */
4051         uint32_t        event_data1;
4052         /* PORT ID */
4053         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4054                 UINT32_C(0xffff)
4055         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4056                 0
4057         /* Priority recommended for RoCE traffic */
4058         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \
4059                 UINT32_C(0xff0000)
4060         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \
4061                 16
4062         /* none is 255 */
4063         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \
4064                 (UINT32_C(0xff) << 16)
4065         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \
4066                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
4067         /* Priority recommended for L2 traffic */
4068         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \
4069                 UINT32_C(0xff000000)
4070         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \
4071                 24
4072         /* none is 255 */
4073         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \
4074                 (UINT32_C(0xff) << 24)
4075         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
4076                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
4077 } __attribute__((packed));
4078
4079 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
4080 struct hwrm_async_event_cmpl_port_conn_not_allowed {
4081         uint16_t        type;
4082         /*
4083          * This field indicates the exact type of the completion.
4084          * By convention, the LSB identifies the length of the
4085          * record in 16B units.  Even values indicate 16B
4086          * records.  Odd values indicate 32B
4087          * records.
4088          */
4089         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \
4090                 UINT32_C(0x3f)
4091         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \
4092                 0
4093         /* HWRM Asynchronous Event Information */
4094         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
4095                 UINT32_C(0x2e)
4096         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \
4097                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
4098         /* Identifiers of events. */
4099         uint16_t        event_id;
4100         /* Port connection not allowed */
4101         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \
4102                 UINT32_C(0x4)
4103         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \
4104                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
4105         /* Event specific data */
4106         uint32_t        event_data2;
4107         uint8_t opaque_v;
4108         /*
4109          * This value is written by the NIC such that it will be different
4110          * for each pass through the completion queue.   The even passes
4111          * will write 1.  The odd passes will write 0.
4112          */
4113         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \
4114                 UINT32_C(0x1)
4115         /* opaque is 7 b */
4116         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \
4117                 UINT32_C(0xfe)
4118         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
4119         /* 8-lsb timestamp from POR (100-msec resolution) */
4120         uint8_t timestamp_lo;
4121         /* 16-lsb timestamp from POR (100-msec resolution) */
4122         uint16_t        timestamp_hi;
4123         /* Event specific data */
4124         uint32_t        event_data1;
4125         /* PORT ID */
4126         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
4127                 UINT32_C(0xffff)
4128         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
4129                 0
4130         /*
4131          * This value indicates the current port level enforcement policy
4132          * for the optics module when there is an optical module mismatch
4133          * and port is not connected.
4134          */
4135         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \
4136                 UINT32_C(0xff0000)
4137         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \
4138                 16
4139         /* No enforcement */
4140         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \
4141                 (UINT32_C(0x0) << 16)
4142         /* Disable Transmit side Laser. */
4143         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \
4144                 (UINT32_C(0x1) << 16)
4145         /* Raise a warning message. */
4146         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \
4147                 (UINT32_C(0x2) << 16)
4148         /* Power down the module. */
4149         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \
4150                 (UINT32_C(0x3) << 16)
4151         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
4152                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
4153 } __attribute__((packed));
4154
4155 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
4156 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
4157         uint16_t        type;
4158         /*
4159          * This field indicates the exact type of the completion.
4160          * By convention, the LSB identifies the length of the
4161          * record in 16B units.  Even values indicate 16B
4162          * records.  Odd values indicate 32B
4163          * records.
4164          */
4165         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \
4166                 UINT32_C(0x3f)
4167         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \
4168                 0
4169         /* HWRM Asynchronous Event Information */
4170         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
4171                 UINT32_C(0x2e)
4172         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \
4173                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
4174         /* Identifiers of events. */
4175         uint16_t        event_id;
4176         /* Link speed configuration was not allowed */
4177         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
4178                 UINT32_C(0x5)
4179         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \
4180                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
4181         /* Event specific data */
4182         uint32_t        event_data2;
4183         uint8_t opaque_v;
4184         /*
4185          * This value is written by the NIC such that it will be different
4186          * for each pass through the completion queue.   The even passes
4187          * will write 1.  The odd passes will write 0.
4188          */
4189         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \
4190                 UINT32_C(0x1)
4191         /* opaque is 7 b */
4192         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \
4193                 UINT32_C(0xfe)
4194         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
4195         /* 8-lsb timestamp from POR (100-msec resolution) */
4196         uint8_t timestamp_lo;
4197         /* 16-lsb timestamp from POR (100-msec resolution) */
4198         uint16_t        timestamp_hi;
4199         /* Event specific data */
4200         uint32_t        event_data1;
4201         /* PORT ID */
4202         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
4203                 UINT32_C(0xffff)
4204         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
4205                 0
4206 } __attribute__((packed));
4207
4208 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
4209 struct hwrm_async_event_cmpl_link_speed_cfg_change {
4210         uint16_t        type;
4211         /*
4212          * This field indicates the exact type of the completion.
4213          * By convention, the LSB identifies the length of the
4214          * record in 16B units.  Even values indicate 16B
4215          * records.  Odd values indicate 32B
4216          * records.
4217          */
4218         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \
4219                 UINT32_C(0x3f)
4220         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \
4221                 0
4222         /* HWRM Asynchronous Event Information */
4223         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4224                 UINT32_C(0x2e)
4225         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \
4226                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4227         /* Identifiers of events. */
4228         uint16_t        event_id;
4229         /* Link speed configuration change */
4230         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \
4231                 UINT32_C(0x6)
4232         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \
4233                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
4234         /* Event specific data */
4235         uint32_t        event_data2;
4236         uint8_t opaque_v;
4237         /*
4238          * This value is written by the NIC such that it will be different
4239          * for each pass through the completion queue.   The even passes
4240          * will write 1.  The odd passes will write 0.
4241          */
4242         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \
4243                 UINT32_C(0x1)
4244         /* opaque is 7 b */
4245         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \
4246                 UINT32_C(0xfe)
4247         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
4248         /* 8-lsb timestamp from POR (100-msec resolution) */
4249         uint8_t timestamp_lo;
4250         /* 16-lsb timestamp from POR (100-msec resolution) */
4251         uint16_t        timestamp_hi;
4252         /* Event specific data */
4253         uint32_t        event_data1;
4254         /* PORT ID */
4255         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4256                 UINT32_C(0xffff)
4257         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4258                 0
4259         /*
4260          * If set to 1, it indicates that the supported link speeds
4261          * configuration on the port has changed.
4262          * If set to 0, then there is no change in supported link speeds
4263          * configuration.
4264          */
4265         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \
4266                 UINT32_C(0x10000)
4267         /*
4268          * If set to 1, it indicates that the link speed configuration
4269          * on the port has become illegal or invalid.
4270          * If set to 0, then the link speed configuration on the port is
4271          * legal or valid.
4272          */
4273         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
4274                 UINT32_C(0x20000)
4275 } __attribute__((packed));
4276
4277 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
4278 struct hwrm_async_event_cmpl_port_phy_cfg_change {
4279         uint16_t        type;
4280         /*
4281          * This field indicates the exact type of the completion.
4282          * By convention, the LSB identifies the length of the
4283          * record in 16B units.  Even values indicate 16B
4284          * records.  Odd values indicate 32B
4285          * records.
4286          */
4287         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \
4288                 UINT32_C(0x3f)
4289         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \
4290                 0
4291         /* HWRM Asynchronous Event Information */
4292         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4293                 UINT32_C(0x2e)
4294         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \
4295                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4296         /* Identifiers of events. */
4297         uint16_t        event_id;
4298         /* Port PHY configuration change */
4299         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \
4300                 UINT32_C(0x7)
4301         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \
4302                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
4303         /* Event specific data */
4304         uint32_t        event_data2;
4305         uint8_t opaque_v;
4306         /*
4307          * This value is written by the NIC such that it will be different
4308          * for each pass through the completion queue.   The even passes
4309          * will write 1.  The odd passes will write 0.
4310          */
4311         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \
4312                 UINT32_C(0x1)
4313         /* opaque is 7 b */
4314         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \
4315                 UINT32_C(0xfe)
4316         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
4317         /* 8-lsb timestamp from POR (100-msec resolution) */
4318         uint8_t timestamp_lo;
4319         /* 16-lsb timestamp from POR (100-msec resolution) */
4320         uint16_t        timestamp_hi;
4321         /* Event specific data */
4322         uint32_t        event_data1;
4323         /* PORT ID */
4324         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4325                 UINT32_C(0xffff)
4326         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4327                 0
4328         /*
4329          * If set to 1, it indicates that the FEC
4330          * configuration on the port has changed.
4331          * If set to 0, then there is no change in FEC configuration.
4332          */
4333         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \
4334                 UINT32_C(0x10000)
4335         /*
4336          * If set to 1, it indicates that the EEE configuration
4337          * on the port has changed.
4338          * If set to 0, then there is no change in EEE configuration
4339          * on the port.
4340          */
4341         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \
4342                 UINT32_C(0x20000)
4343         /*
4344          * If set to 1, it indicates that the pause configuration
4345          * on the PHY has changed.
4346          * If set to 0, then there is no change in the pause
4347          * configuration on the PHY.
4348          */
4349         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
4350                 UINT32_C(0x40000)
4351 } __attribute__((packed));
4352
4353 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
4354 struct hwrm_async_event_cmpl_reset_notify {
4355         uint16_t        type;
4356         /*
4357          * This field indicates the exact type of the completion.
4358          * By convention, the LSB identifies the length of the
4359          * record in 16B units.  Even values indicate 16B
4360          * records.  Odd values indicate 32B
4361          * records.
4362          */
4363         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \
4364                 UINT32_C(0x3f)
4365         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT             0
4366         /* HWRM Asynchronous Event Information */
4367         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \
4368                 UINT32_C(0x2e)
4369         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \
4370                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
4371         /* Identifiers of events. */
4372         uint16_t        event_id;
4373         /* Notify clients of imminent reset. */
4374         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \
4375                 UINT32_C(0x8)
4376         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \
4377                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
4378         /* Event specific data */
4379         uint32_t        event_data2;
4380         uint8_t opaque_v;
4381         /*
4382          * This value is written by the NIC such that it will be different
4383          * for each pass through the completion queue.   The even passes
4384          * will write 1.  The odd passes will write 0.
4385          */
4386         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V          UINT32_C(0x1)
4387         /* opaque is 7 b */
4388         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
4389         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
4390         /*
4391          * 8-lsb timestamp (100-msec resolution)
4392          * The Minimum time required for the Firmware readiness after sending this
4393          * notification to the driver instances.
4394          */
4395         uint8_t timestamp_lo;
4396         /*
4397          * 16-lsb timestamp (100-msec resolution)
4398          * The Maximum Firmware Reset bail out value in the order of 100
4399          * milli seconds. The driver instances will use this value to re-initiate the
4400          * registration process again if the core firmware didn’t set the ready
4401          * state bit.
4402          */
4403         uint16_t        timestamp_hi;
4404         /* Event specific data */
4405         uint32_t        event_data1;
4406         /* Indicates driver action requested */
4407         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \
4408                 UINT32_C(0xff)
4409         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \
4410                 0
4411         /*
4412          * If set to 1, it indicates that the l2 client should
4413          * stop sending in band traffic to Nitro.
4414          * if set to 0, there is no change in L2 client behavior.
4415          */
4416         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \
4417                 UINT32_C(0x1)
4418         /*
4419          * If set to 1, it indicates that the L2 client should
4420          * bring down the interface.
4421          * If set to 0, then there is no change in L2 client behavior.
4422          */
4423         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \
4424                 UINT32_C(0x2)
4425         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \
4426                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
4427         /* Indicates reason for reset. */
4428         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \
4429                 UINT32_C(0xff00)
4430         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \
4431                 8
4432         /* A management client has requested reset. */
4433         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \
4434                 (UINT32_C(0x1) << 8)
4435         /* A fatal firmware exception has occurred. */
4436         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \
4437                 (UINT32_C(0x2) << 8)
4438         /* A non-fatal firmware exception has occurred. */
4439         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \
4440                 (UINT32_C(0x3) << 8)
4441         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \
4442                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL
4443         /*
4444          * Minimum time before driver should attempt access - units 100ms ticks.
4445          * Range 0-65535
4446          */
4447         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \
4448                 UINT32_C(0xffff0000)
4449         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
4450                 16
4451 } __attribute__((packed));
4452
4453 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
4454 struct hwrm_async_event_cmpl_func_drvr_unload {
4455         uint16_t        type;
4456         /*
4457          * This field indicates the exact type of the completion.
4458          * By convention, the LSB identifies the length of the
4459          * record in 16B units.  Even values indicate 16B
4460          * records.  Odd values indicate 32B
4461          * records.
4462          */
4463         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \
4464                 UINT32_C(0x3f)
4465         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT             0
4466         /* HWRM Asynchronous Event Information */
4467         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
4468                 UINT32_C(0x2e)
4469         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \
4470                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
4471         /* Identifiers of events. */
4472         uint16_t        event_id;
4473         /* Function driver unloaded */
4474         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \
4475                 UINT32_C(0x10)
4476         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \
4477                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
4478         /* Event specific data */
4479         uint32_t        event_data2;
4480         uint8_t opaque_v;
4481         /*
4482          * This value is written by the NIC such that it will be different
4483          * for each pass through the completion queue.   The even passes
4484          * will write 1.  The odd passes will write 0.
4485          */
4486         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V          UINT32_C(0x1)
4487         /* opaque is 7 b */
4488         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \
4489                 UINT32_C(0xfe)
4490         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
4491         /* 8-lsb timestamp from POR (100-msec resolution) */
4492         uint8_t timestamp_lo;
4493         /* 16-lsb timestamp from POR (100-msec resolution) */
4494         uint16_t        timestamp_hi;
4495         /* Event specific data */
4496         uint32_t        event_data1;
4497         /* Function ID */
4498         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
4499                 UINT32_C(0xffff)
4500         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
4501                 0
4502 } __attribute__((packed));
4503
4504 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
4505 struct hwrm_async_event_cmpl_func_drvr_load {
4506         uint16_t        type;
4507         /*
4508          * This field indicates the exact type of the completion.
4509          * By convention, the LSB identifies the length of the
4510          * record in 16B units.  Even values indicate 16B
4511          * records.  Odd values indicate 32B
4512          * records.
4513          */
4514         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \
4515                 UINT32_C(0x3f)
4516         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT             0
4517         /* HWRM Asynchronous Event Information */
4518         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
4519                 UINT32_C(0x2e)
4520         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \
4521                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
4522         /* Identifiers of events. */
4523         uint16_t        event_id;
4524         /* Function driver loaded */
4525         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \
4526                 UINT32_C(0x11)
4527         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \
4528                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
4529         /* Event specific data */
4530         uint32_t        event_data2;
4531         uint8_t opaque_v;
4532         /*
4533          * This value is written by the NIC such that it will be different
4534          * for each pass through the completion queue.   The even passes
4535          * will write 1.  The odd passes will write 0.
4536          */
4537         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V          UINT32_C(0x1)
4538         /* opaque is 7 b */
4539         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
4540         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
4541         /* 8-lsb timestamp from POR (100-msec resolution) */
4542         uint8_t timestamp_lo;
4543         /* 16-lsb timestamp from POR (100-msec resolution) */
4544         uint16_t        timestamp_hi;
4545         /* Event specific data */
4546         uint32_t        event_data1;
4547         /* Function ID */
4548         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
4549                 UINT32_C(0xffff)
4550         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
4551 } __attribute__((packed));
4552
4553 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
4554 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
4555         uint16_t        type;
4556         /*
4557          * This field indicates the exact type of the completion.
4558          * By convention, the LSB identifies the length of the
4559          * record in 16B units.  Even values indicate 16B
4560          * records.  Odd values indicate 32B
4561          * records.
4562          */
4563         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \
4564                 UINT32_C(0x3f)
4565         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \
4566                 0
4567         /* HWRM Asynchronous Event Information */
4568         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \
4569                 UINT32_C(0x2e)
4570         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \
4571                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
4572         /* Identifiers of events. */
4573         uint16_t        event_id;
4574         /* Function FLR related processing has completed */
4575         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \
4576                 UINT32_C(0x12)
4577         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \
4578                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
4579         /* Event specific data */
4580         uint32_t        event_data2;
4581         uint8_t opaque_v;
4582         /*
4583          * This value is written by the NIC such that it will be different
4584          * for each pass through the completion queue.   The even passes
4585          * will write 1.  The odd passes will write 0.
4586          */
4587         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \
4588                 UINT32_C(0x1)
4589         /* opaque is 7 b */
4590         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \
4591                 UINT32_C(0xfe)
4592         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
4593         /* 8-lsb timestamp from POR (100-msec resolution) */
4594         uint8_t timestamp_lo;
4595         /* 16-lsb timestamp from POR (100-msec resolution) */
4596         uint16_t        timestamp_hi;
4597         /* Event specific data */
4598         uint32_t        event_data1;
4599         /* Function ID */
4600         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \
4601                 UINT32_C(0xffff)
4602         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
4603                 0
4604 } __attribute__((packed));
4605
4606 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
4607 struct hwrm_async_event_cmpl_pf_drvr_unload {
4608         uint16_t        type;
4609         /*
4610          * This field indicates the exact type of the completion.
4611          * By convention, the LSB identifies the length of the
4612          * record in 16B units.  Even values indicate 16B
4613          * records.  Odd values indicate 32B
4614          * records.
4615          */
4616         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \
4617                 UINT32_C(0x3f)
4618         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT             0
4619         /* HWRM Asynchronous Event Information */
4620         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
4621                 UINT32_C(0x2e)
4622         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \
4623                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
4624         /* Identifiers of events. */
4625         uint16_t        event_id;
4626         /* PF driver unloaded */
4627         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \
4628                 UINT32_C(0x20)
4629         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \
4630                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
4631         /* Event specific data */
4632         uint32_t        event_data2;
4633         uint8_t opaque_v;
4634         /*
4635          * This value is written by the NIC such that it will be different
4636          * for each pass through the completion queue.   The even passes
4637          * will write 1.  The odd passes will write 0.
4638          */
4639         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V          UINT32_C(0x1)
4640         /* opaque is 7 b */
4641         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
4642         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
4643         /* 8-lsb timestamp from POR (100-msec resolution) */
4644         uint8_t timestamp_lo;
4645         /* 16-lsb timestamp from POR (100-msec resolution) */
4646         uint16_t        timestamp_hi;
4647         /* Event specific data */
4648         uint32_t        event_data1;
4649         /* PF ID */
4650         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
4651                 UINT32_C(0xffff)
4652         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
4653         /* Indicates the physical port this pf belongs to */
4654         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
4655                 UINT32_C(0x70000)
4656         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
4657 } __attribute__((packed));
4658
4659 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
4660 struct hwrm_async_event_cmpl_pf_drvr_load {
4661         uint16_t        type;
4662         /*
4663          * This field indicates the exact type of the completion.
4664          * By convention, the LSB identifies the length of the
4665          * record in 16B units.  Even values indicate 16B
4666          * records.  Odd values indicate 32B
4667          * records.
4668          */
4669         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \
4670                 UINT32_C(0x3f)
4671         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT             0
4672         /* HWRM Asynchronous Event Information */
4673         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
4674                 UINT32_C(0x2e)
4675         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \
4676                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
4677         /* Identifiers of events. */
4678         uint16_t        event_id;
4679         /* PF driver loaded */
4680         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \
4681                 UINT32_C(0x21)
4682         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \
4683                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
4684         /* Event specific data */
4685         uint32_t        event_data2;
4686         uint8_t opaque_v;
4687         /*
4688          * This value is written by the NIC such that it will be different
4689          * for each pass through the completion queue.   The even passes
4690          * will write 1.  The odd passes will write 0.
4691          */
4692         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V          UINT32_C(0x1)
4693         /* opaque is 7 b */
4694         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
4695         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
4696         /* 8-lsb timestamp from POR (100-msec resolution) */
4697         uint8_t timestamp_lo;
4698         /* 16-lsb timestamp from POR (100-msec resolution) */
4699         uint16_t        timestamp_hi;
4700         /* Event specific data */
4701         uint32_t        event_data1;
4702         /* PF ID */
4703         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
4704                 UINT32_C(0xffff)
4705         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
4706         /* Indicates the physical port this pf belongs to */
4707         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
4708                 UINT32_C(0x70000)
4709         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
4710 } __attribute__((packed));
4711
4712 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
4713 struct hwrm_async_event_cmpl_vf_flr {
4714         uint16_t        type;
4715         /*
4716          * This field indicates the exact type of the completion.
4717          * By convention, the LSB identifies the length of the
4718          * record in 16B units.  Even values indicate 16B
4719          * records.  Odd values indicate 32B
4720          * records.
4721          */
4722         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \
4723                 UINT32_C(0x3f)
4724         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT             0
4725         /* HWRM Asynchronous Event Information */
4726         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \
4727                 UINT32_C(0x2e)
4728         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \
4729                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
4730         /* Identifiers of events. */
4731         uint16_t        event_id;
4732         /* VF Function Level Reset (FLR) */
4733         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
4734         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \
4735                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
4736         /* Event specific data */
4737         uint32_t        event_data2;
4738         uint8_t opaque_v;
4739         /*
4740          * This value is written by the NIC such that it will be different
4741          * for each pass through the completion queue.   The even passes
4742          * will write 1.  The odd passes will write 0.
4743          */
4744         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V          UINT32_C(0x1)
4745         /* opaque is 7 b */
4746         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
4747         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
4748         /* 8-lsb timestamp from POR (100-msec resolution) */
4749         uint8_t timestamp_lo;
4750         /* 16-lsb timestamp from POR (100-msec resolution) */
4751         uint16_t        timestamp_hi;
4752         /* Event specific data */
4753         uint32_t        event_data1;
4754         /* VF ID */
4755         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \
4756                 UINT32_C(0xffff)
4757         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
4758         /* Indicates the physical function this event occurred on. */
4759         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
4760                 UINT32_C(0xff0000)
4761         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
4762 } __attribute__((packed));
4763
4764 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
4765 struct hwrm_async_event_cmpl_vf_mac_addr_change {
4766         uint16_t        type;
4767         /*
4768          * This field indicates the exact type of the completion.
4769          * By convention, the LSB identifies the length of the
4770          * record in 16B units.  Even values indicate 16B
4771          * records.  Odd values indicate 32B
4772          * records.
4773          */
4774         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \
4775                 UINT32_C(0x3f)
4776         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT             0
4777         /* HWRM Asynchronous Event Information */
4778         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4779                 UINT32_C(0x2e)
4780         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \
4781                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
4782         /* Identifiers of events. */
4783         uint16_t        event_id;
4784         /* VF MAC Address Change */
4785         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \
4786                 UINT32_C(0x31)
4787         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \
4788                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
4789         /* Event specific data */
4790         uint32_t        event_data2;
4791         uint8_t opaque_v;
4792         /*
4793          * This value is written by the NIC such that it will be different
4794          * for each pass through the completion queue.   The even passes
4795          * will write 1.  The odd passes will write 0.
4796          */
4797         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \
4798                 UINT32_C(0x1)
4799         /* opaque is 7 b */
4800         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \
4801                 UINT32_C(0xfe)
4802         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
4803         /* 8-lsb timestamp from POR (100-msec resolution) */
4804         uint8_t timestamp_lo;
4805         /* 16-lsb timestamp from POR (100-msec resolution) */
4806         uint16_t        timestamp_hi;
4807         /* Event specific data */
4808         uint32_t        event_data1;
4809         /* VF ID */
4810         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \
4811                 UINT32_C(0xffff)
4812         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
4813                 0
4814 } __attribute__((packed));
4815
4816 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
4817 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
4818         uint16_t        type;
4819         /*
4820          * This field indicates the exact type of the completion.
4821          * By convention, the LSB identifies the length of the
4822          * record in 16B units.  Even values indicate 16B
4823          * records.  Odd values indicate 32B
4824          * records.
4825          */
4826         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \
4827                 UINT32_C(0x3f)
4828         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \
4829                 0
4830         /* HWRM Asynchronous Event Information */
4831         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4832                 UINT32_C(0x2e)
4833         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \
4834                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
4835         /* Identifiers of events. */
4836         uint16_t        event_id;
4837         /* PF-VF communication channel status change. */
4838         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
4839                 UINT32_C(0x32)
4840         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \
4841                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
4842         /* Event specific data */
4843         uint32_t        event_data2;
4844         uint8_t opaque_v;
4845         /*
4846          * This value is written by the NIC such that it will be different
4847          * for each pass through the completion queue.   The even passes
4848          * will write 1.  The odd passes will write 0.
4849          */
4850         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \
4851                 UINT32_C(0x1)
4852         /* opaque is 7 b */
4853         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \
4854                 UINT32_C(0xfe)
4855         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
4856         /* 8-lsb timestamp from POR (100-msec resolution) */
4857         uint8_t timestamp_lo;
4858         /* 16-lsb timestamp from POR (100-msec resolution) */
4859         uint16_t        timestamp_hi;
4860         /* Event specific data */
4861         uint32_t        event_data1;
4862         /*
4863          * If this bit is set to 1, then it indicates that the PF-VF
4864          * communication was lost and it is established.
4865          * If this bit set to 0, then it indicates that the PF-VF
4866          * communication was established and it is lost.
4867          */
4868         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
4869                 UINT32_C(0x1)
4870 } __attribute__((packed));
4871
4872 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
4873 struct hwrm_async_event_cmpl_vf_cfg_change {
4874         uint16_t        type;
4875         /*
4876          * This field indicates the exact type of the completion.
4877          * By convention, the LSB identifies the length of the
4878          * record in 16B units.  Even values indicate 16B
4879          * records.  Odd values indicate 32B
4880          * records.
4881          */
4882         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \
4883                 UINT32_C(0x3f)
4884         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT             0
4885         /* HWRM Asynchronous Event Information */
4886         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4887                 UINT32_C(0x2e)
4888         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \
4889                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4890         /* Identifiers of events. */
4891         uint16_t        event_id;
4892         /* VF Configuration Change */
4893         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \
4894                 UINT32_C(0x33)
4895         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \
4896                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
4897         /* Event specific data */
4898         uint32_t        event_data2;
4899         uint8_t opaque_v;
4900         /*
4901          * This value is written by the NIC such that it will be different
4902          * for each pass through the completion queue.   The even passes
4903          * will write 1.  The odd passes will write 0.
4904          */
4905         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V          UINT32_C(0x1)
4906         /* opaque is 7 b */
4907         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
4908         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
4909         /* 8-lsb timestamp from POR (100-msec resolution) */
4910         uint8_t timestamp_lo;
4911         /* 16-lsb timestamp from POR (100-msec resolution) */
4912         uint16_t        timestamp_hi;
4913         /*
4914          * Each flag provided in this field indicates a specific VF
4915          * configuration change. At least one of these flags shall be set to 1
4916          * when an asynchronous event completion of this type is provided
4917          * by the HWRM.
4918          */
4919         uint32_t        event_data1;
4920         /*
4921          * If this bit is set to 1, then the value of MTU
4922          * was changed on this VF.
4923          * If set to 0, then this bit should be ignored.
4924          */
4925         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \
4926                 UINT32_C(0x1)
4927         /*
4928          * If this bit is set to 1, then the value of MRU
4929          * was changed on this VF.
4930          * If set to 0, then this bit should be ignored.
4931          */
4932         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \
4933                 UINT32_C(0x2)
4934         /*
4935          * If this bit is set to 1, then the value of default MAC
4936          * address was changed on this VF.
4937          * If set to 0, then this bit should be ignored.
4938          */
4939         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \
4940                 UINT32_C(0x4)
4941         /*
4942          * If this bit is set to 1, then the value of default VLAN
4943          * was changed on this VF.
4944          * If set to 0, then this bit should be ignored.
4945          */
4946         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \
4947                 UINT32_C(0x8)
4948         /*
4949          * If this bit is set to 1, then the value of trusted VF enable
4950          * was changed on this VF.
4951          * If set to 0, then this bit should be ignored.
4952          */
4953         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
4954                 UINT32_C(0x10)
4955 } __attribute__((packed));
4956
4957 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
4958 struct hwrm_async_event_cmpl_llfc_pfc_change {
4959         uint16_t        type;
4960         /*
4961          * This field indicates the exact type of the completion.
4962          * By convention, the LSB identifies the length of the
4963          * record in 16B units.  Even values indicate 16B
4964          * records.  Odd values indicate 32B
4965          * records.
4966          */
4967         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \
4968                 UINT32_C(0x3f)
4969         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT             0
4970         /* HWRM Asynchronous Event Information */
4971         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4972                 UINT32_C(0x2e)
4973         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \
4974                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
4975         /* unused1 is 10 b */
4976         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \
4977                 UINT32_C(0xffc0)
4978         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT          6
4979         /* Identifiers of events. */
4980         uint16_t        event_id;
4981         /* LLFC/PFC Configuration Change */
4982         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \
4983                 UINT32_C(0x34)
4984         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \
4985                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
4986         /* Event specific data */
4987         uint32_t        event_data2;
4988         uint8_t opaque_v;
4989         /*
4990          * This value is written by the NIC such that it will be different
4991          * for each pass through the completion queue.   The even passes
4992          * will write 1.  The odd passes will write 0.
4993          */
4994         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V          UINT32_C(0x1)
4995         /* opaque is 7 b */
4996         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \
4997                 UINT32_C(0xfe)
4998         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
4999         /* 8-lsb timestamp from POR (100-msec resolution) */
5000         uint8_t timestamp_lo;
5001         /* 16-lsb timestamp from POR (100-msec resolution) */
5002         uint16_t        timestamp_hi;
5003         /* Event specific data */
5004         uint32_t        event_data1;
5005         /* Indicates llfc pfc status change */
5006         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \
5007                 UINT32_C(0x3)
5008         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \
5009                 0
5010         /*
5011          * If this field set to 1, then it indicates that llfc is
5012          * enabled.
5013          */
5014         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \
5015                 UINT32_C(0x1)
5016         /*
5017          * If this field is set to 2, then it indicates that pfc
5018          * is enabled.
5019          */
5020         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \
5021                 UINT32_C(0x2)
5022         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \
5023                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
5024         /* Indicates the physical port this llfc pfc change occur */
5025         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \
5026                 UINT32_C(0x1c)
5027         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \
5028                 2
5029         /* PORT ID */
5030         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \
5031                 UINT32_C(0x1fffe0)
5032         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
5033                 5
5034 } __attribute__((packed));
5035
5036 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
5037 struct hwrm_async_event_cmpl_default_vnic_change {
5038         uint16_t        type;
5039         /*
5040          * This field indicates the exact type of the completion.
5041          * By convention, the LSB identifies the length of the
5042          * record in 16B units.  Even values indicate 16B
5043          * records.  Odd values indicate 32B
5044          * records.
5045          */
5046         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \
5047                 UINT32_C(0x3f)
5048         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \
5049                 0
5050         /* HWRM Asynchronous Event Information */
5051         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5052                 UINT32_C(0x2e)
5053         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \
5054                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
5055         /* unused1 is 10 b */
5056         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \
5057                 UINT32_C(0xffc0)
5058         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \
5059                 6
5060         /* Identifiers of events. */
5061         uint16_t        event_id;
5062         /* Notification of a default vnic allocaiton or free */
5063         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \
5064                 UINT32_C(0x35)
5065         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \
5066                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
5067         /* Event specific data */
5068         uint32_t        event_data2;
5069         uint8_t opaque_v;
5070         /*
5071          * This value is written by the NIC such that it will be different
5072          * for each pass through the completion queue.   The even passes
5073          * will write 1.  The odd passes will write 0.
5074          */
5075         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \
5076                 UINT32_C(0x1)
5077         /* opaque is 7 b */
5078         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \
5079                 UINT32_C(0xfe)
5080         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
5081         /* 8-lsb timestamp from POR (100-msec resolution) */
5082         uint8_t timestamp_lo;
5083         /* 16-lsb timestamp from POR (100-msec resolution) */
5084         uint16_t        timestamp_hi;
5085         /* Event specific data */
5086         uint32_t        event_data1;
5087         /* Indicates default vnic configuration change */
5088         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \
5089                 UINT32_C(0x3)
5090         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \
5091                 0
5092         /*
5093          * If this field is set to 1, then it indicates that
5094          * a default VNIC has been allocate.
5095          */
5096         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \
5097                 UINT32_C(0x1)
5098         /*
5099          * If this field is set to 2, then it indicates that
5100          * a default VNIC has been freed.
5101          */
5102         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \
5103                 UINT32_C(0x2)
5104         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \
5105                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
5106         /* Indicates the physical function this event occurred on. */
5107         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \
5108                 UINT32_C(0x3fc)
5109         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \
5110                 2
5111         /* Indicates the virtual function this event occurred on */
5112         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \
5113                 UINT32_C(0x3fffc00)
5114         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
5115                 10
5116 } __attribute__((packed));
5117
5118 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
5119 struct hwrm_async_event_cmpl_hw_flow_aged {
5120         uint16_t        type;
5121         /*
5122          * This field indicates the exact type of the completion.
5123          * By convention, the LSB identifies the length of the
5124          * record in 16B units.  Even values indicate 16B
5125          * records.  Odd values indicate 32B
5126          * records.
5127          */
5128         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK \
5129                 UINT32_C(0x3f)
5130         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT             0
5131         /* HWRM Asynchronous Event Information */
5132         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT \
5133                 UINT32_C(0x2e)
5134         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST \
5135                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
5136         /* Identifiers of events. */
5137         uint16_t        event_id;
5138         /* Notification of a hw flow aged */
5139         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED \
5140                 UINT32_C(0x36)
5141         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST \
5142                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
5143         /* Event specific data */
5144         uint32_t        event_data2;
5145         uint8_t opaque_v;
5146         /*
5147          * This value is written by the NIC such that it will be different
5148          * for each pass through the completion queue.   The even passes
5149          * will write 1.  The odd passes will write 0.
5150          */
5151         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V          UINT32_C(0x1)
5152         /* opaque is 7 b */
5153         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
5154         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
5155         /* 8-lsb timestamp from POR (100-msec resolution) */
5156         uint8_t timestamp_lo;
5157         /* 16-lsb timestamp from POR (100-msec resolution) */
5158         uint16_t        timestamp_hi;
5159         /* Event specific data */
5160         uint32_t        event_data1;
5161         /* Indicates flow ID this event occurred on. */
5162         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK \
5163                 UINT32_C(0x7fffffff)
5164         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT \
5165                 0
5166         /* Indicates flow direction this event occurred on. */
5167         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION \
5168                 UINT32_C(0x80000000)
5169         /*
5170          * If this bit set to 0, then it indicates that the aged
5171          * event was rx flow.
5172          */
5173         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX \
5174                 (UINT32_C(0x0) << 31)
5175         /*
5176          * If this bit is set to 1, then it indicates that the aged
5177          * event was tx flow.
5178          */
5179         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX \
5180                 (UINT32_C(0x1) << 31)
5181         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
5182                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
5183 } __attribute__((packed));
5184
5185 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
5186 struct hwrm_async_event_cmpl_hwrm_error {
5187         uint16_t        type;
5188         /*
5189          * This field indicates the exact type of the completion.
5190          * By convention, the LSB identifies the length of the
5191          * record in 16B units.  Even values indicate 16B
5192          * records.  Odd values indicate 32B
5193          * records.
5194          */
5195         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \
5196                 UINT32_C(0x3f)
5197         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT             0
5198         /* HWRM Asynchronous Event Information */
5199         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \
5200                 UINT32_C(0x2e)
5201         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \
5202                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
5203         /* Identifiers of events. */
5204         uint16_t        event_id;
5205         /* HWRM Error */
5206         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \
5207                 UINT32_C(0xff)
5208         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \
5209                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
5210         /* Event specific data */
5211         uint32_t        event_data2;
5212         /* Severity of HWRM Error */
5213         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \
5214                 UINT32_C(0xff)
5215         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT     0
5216         /* Warning */
5217         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \
5218                 UINT32_C(0x0)
5219         /* Non-fatal Error */
5220         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \
5221                 UINT32_C(0x1)
5222         /* Fatal Error */
5223         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \
5224                 UINT32_C(0x2)
5225         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \
5226                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
5227         uint8_t opaque_v;
5228         /*
5229          * This value is written by the NIC such that it will be different
5230          * for each pass through the completion queue.   The even passes
5231          * will write 1.  The odd passes will write 0.
5232          */
5233         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V          UINT32_C(0x1)
5234         /* opaque is 7 b */
5235         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
5236         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
5237         /* 8-lsb timestamp from POR (100-msec resolution) */
5238         uint8_t timestamp_lo;
5239         /* 16-lsb timestamp from POR (100-msec resolution) */
5240         uint16_t        timestamp_hi;
5241         /* Event specific data */
5242         uint32_t        event_data1;
5243         /* Time stamp for error event */
5244         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
5245                 UINT32_C(0x1)
5246 } __attribute__((packed));
5247
5248 /*******************
5249  * hwrm_func_reset *
5250  *******************/
5251
5252
5253 /* hwrm_func_reset_input (size:192b/24B) */
5254 struct hwrm_func_reset_input {
5255         /* The HWRM command request type. */
5256         uint16_t        req_type;
5257         /*
5258          * The completion ring to send the completion event on. This should
5259          * be the NQ ID returned from the `nq_alloc` HWRM command.
5260          */
5261         uint16_t        cmpl_ring;
5262         /*
5263          * The sequence ID is used by the driver for tracking multiple
5264          * commands. This ID is treated as opaque data by the firmware and
5265          * the value is returned in the `hwrm_resp_hdr` upon completion.
5266          */
5267         uint16_t        seq_id;
5268         /*
5269          * The target ID of the command:
5270          * * 0x0-0xFFF8 - The function ID
5271          * * 0xFFF8-0xFFFE - Reserved for internal processors
5272          * * 0xFFFF - HWRM
5273          */
5274         uint16_t        target_id;
5275         /*
5276          * A physical address pointer pointing to a host buffer that the
5277          * command's response data will be written. This can be either a host
5278          * physical address (HPA) or a guest physical address (GPA) and must
5279          * point to a physically contiguous block of memory.
5280          */
5281         uint64_t        resp_addr;
5282         uint32_t        enables;
5283         /*
5284          * This bit must be '1' for the vf_id_valid field to be
5285          * configured.
5286          */
5287         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
5288         /*
5289          * The ID of the VF that this PF is trying to reset.
5290          * Only the parent PF shall be allowed to reset a child VF.
5291          *
5292          * A parent PF driver shall use this field only when a specific child VF
5293          * is requested to be reset.
5294          */
5295         uint16_t        vf_id;
5296         /* This value indicates the level of a function reset. */
5297         uint8_t func_reset_level;
5298         /*
5299          * Reset the caller function and its children VFs (if any). If no
5300          * children functions exist, then reset the caller function only.
5301          */
5302         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
5303                 UINT32_C(0x0)
5304         /* Reset the caller function only */
5305         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
5306                 UINT32_C(0x1)
5307         /*
5308          * Reset all children VFs of the caller function driver if the
5309          * caller is a PF driver.
5310          * It is an error to specify this level by a VF driver.
5311          * It is an error to specify this level by a PF driver with
5312          * no children VFs.
5313          */
5314         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
5315                 UINT32_C(0x2)
5316         /*
5317          * Reset a specific VF of the caller function driver if the caller
5318          * is the parent PF driver.
5319          * It is an error to specify this level by a VF driver.
5320          * It is an error to specify this level by a PF driver that is not
5321          * the parent of the VF that is being requested to reset.
5322          */
5323         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
5324                 UINT32_C(0x3)
5325         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
5326                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
5327         uint8_t unused_0;
5328 } __attribute__((packed));
5329
5330 /* hwrm_func_reset_output (size:128b/16B) */
5331 struct hwrm_func_reset_output {
5332         /* The specific error status for the command. */
5333         uint16_t        error_code;
5334         /* The HWRM command request type. */
5335         uint16_t        req_type;
5336         /* The sequence ID from the original command. */
5337         uint16_t        seq_id;
5338         /* The length of the response data in number of bytes. */
5339         uint16_t        resp_len;
5340         uint8_t unused_0[7];
5341         /*
5342          * This field is used in Output records to indicate that the output
5343          * is completely written to RAM.  This field should be read as '1'
5344          * to indicate that the output has been completely written.
5345          * When writing a command completion or response to an internal processor,
5346          * the order of writes has to be such that this field is written last.
5347          */
5348         uint8_t valid;
5349 } __attribute__((packed));
5350
5351 /********************
5352  * hwrm_func_getfid *
5353  ********************/
5354
5355
5356 /* hwrm_func_getfid_input (size:192b/24B) */
5357 struct hwrm_func_getfid_input {
5358         /* The HWRM command request type. */
5359         uint16_t        req_type;
5360         /*
5361          * The completion ring to send the completion event on. This should
5362          * be the NQ ID returned from the `nq_alloc` HWRM command.
5363          */
5364         uint16_t        cmpl_ring;
5365         /*
5366          * The sequence ID is used by the driver for tracking multiple
5367          * commands. This ID is treated as opaque data by the firmware and
5368          * the value is returned in the `hwrm_resp_hdr` upon completion.
5369          */
5370         uint16_t        seq_id;
5371         /*
5372          * The target ID of the command:
5373          * * 0x0-0xFFF8 - The function ID
5374          * * 0xFFF8-0xFFFE - Reserved for internal processors
5375          * * 0xFFFF - HWRM
5376          */
5377         uint16_t        target_id;
5378         /*
5379          * A physical address pointer pointing to a host buffer that the
5380          * command's response data will be written. This can be either a host
5381          * physical address (HPA) or a guest physical address (GPA) and must
5382          * point to a physically contiguous block of memory.
5383          */
5384         uint64_t        resp_addr;
5385         uint32_t        enables;
5386         /*
5387          * This bit must be '1' for the pci_id field to be
5388          * configured.
5389          */
5390         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
5391         /*
5392          * This value is the PCI ID of the queried function.
5393          * If ARI is enabled, then it is
5394          * Bus Number (8b):Function Number(8b). Otherwise, it is
5395          * Bus Number (8b):Device Number (5b):Function Number(3b).
5396          */
5397         uint16_t        pci_id;
5398         uint8_t unused_0[2];
5399 } __attribute__((packed));
5400
5401 /* hwrm_func_getfid_output (size:128b/16B) */
5402 struct hwrm_func_getfid_output {
5403         /* The specific error status for the command. */
5404         uint16_t        error_code;
5405         /* The HWRM command request type. */
5406         uint16_t        req_type;
5407         /* The sequence ID from the original command. */
5408         uint16_t        seq_id;
5409         /* The length of the response data in number of bytes. */
5410         uint16_t        resp_len;
5411         /*
5412          * FID value.  This value is used to identify operations on the PCI
5413          * bus as belonging to a particular PCI function.
5414          */
5415         uint16_t        fid;
5416         uint8_t unused_0[5];
5417         /*
5418          * This field is used in Output records to indicate that the output
5419          * is completely written to RAM.  This field should be read as '1'
5420          * to indicate that the output has been completely written.
5421          * When writing a command completion or response to an internal processor,
5422          * the order of writes has to be such that this field is written last.
5423          */
5424         uint8_t valid;
5425 } __attribute__((packed));
5426
5427 /**********************
5428  * hwrm_func_vf_alloc *
5429  **********************/
5430
5431
5432 /* hwrm_func_vf_alloc_input (size:192b/24B) */
5433 struct hwrm_func_vf_alloc_input {
5434         /* The HWRM command request type. */
5435         uint16_t        req_type;
5436         /*
5437          * The completion ring to send the completion event on. This should
5438          * be the NQ ID returned from the `nq_alloc` HWRM command.
5439          */
5440         uint16_t        cmpl_ring;
5441         /*
5442          * The sequence ID is used by the driver for tracking multiple
5443          * commands. This ID is treated as opaque data by the firmware and
5444          * the value is returned in the `hwrm_resp_hdr` upon completion.
5445          */
5446         uint16_t        seq_id;
5447         /*
5448          * The target ID of the command:
5449          * * 0x0-0xFFF8 - The function ID
5450          * * 0xFFF8-0xFFFE - Reserved for internal processors
5451          * * 0xFFFF - HWRM
5452          */
5453         uint16_t        target_id;
5454         /*
5455          * A physical address pointer pointing to a host buffer that the
5456          * command's response data will be written. This can be either a host
5457          * physical address (HPA) or a guest physical address (GPA) and must
5458          * point to a physically contiguous block of memory.
5459          */
5460         uint64_t        resp_addr;
5461         uint32_t        enables;
5462         /*
5463          * This bit must be '1' for the first_vf_id field to be
5464          * configured.
5465          */
5466         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
5467         /*
5468          * This value is used to identify a Virtual Function (VF).
5469          * The scope of VF ID is local within a PF.
5470          */
5471         uint16_t        first_vf_id;
5472         /* The number of virtual functions requested. */
5473         uint16_t        num_vfs;
5474 } __attribute__((packed));
5475
5476 /* hwrm_func_vf_alloc_output (size:128b/16B) */
5477 struct hwrm_func_vf_alloc_output {
5478         /* The specific error status for the command. */
5479         uint16_t        error_code;
5480         /* The HWRM command request type. */
5481         uint16_t        req_type;
5482         /* The sequence ID from the original command. */
5483         uint16_t        seq_id;
5484         /* The length of the response data in number of bytes. */
5485         uint16_t        resp_len;
5486         /* The ID of the first VF allocated. */
5487         uint16_t        first_vf_id;
5488         uint8_t unused_0[5];
5489         /*
5490          * This field is used in Output records to indicate that the output
5491          * is completely written to RAM.  This field should be read as '1'
5492          * to indicate that the output has been completely written.
5493          * When writing a command completion or response to an internal processor,
5494          * the order of writes has to be such that this field is written last.
5495          */
5496         uint8_t valid;
5497 } __attribute__((packed));
5498
5499 /*********************
5500  * hwrm_func_vf_free *
5501  *********************/
5502
5503
5504 /* hwrm_func_vf_free_input (size:192b/24B) */
5505 struct hwrm_func_vf_free_input {
5506         /* The HWRM command request type. */
5507         uint16_t        req_type;
5508         /*
5509          * The completion ring to send the completion event on. This should
5510          * be the NQ ID returned from the `nq_alloc` HWRM command.
5511          */
5512         uint16_t        cmpl_ring;
5513         /*
5514          * The sequence ID is used by the driver for tracking multiple
5515          * commands. This ID is treated as opaque data by the firmware and
5516          * the value is returned in the `hwrm_resp_hdr` upon completion.
5517          */
5518         uint16_t        seq_id;
5519         /*
5520          * The target ID of the command:
5521          * * 0x0-0xFFF8 - The function ID
5522          * * 0xFFF8-0xFFFE - Reserved for internal processors
5523          * * 0xFFFF - HWRM
5524          */
5525         uint16_t        target_id;
5526         /*
5527          * A physical address pointer pointing to a host buffer that the
5528          * command's response data will be written. This can be either a host
5529          * physical address (HPA) or a guest physical address (GPA) and must
5530          * point to a physically contiguous block of memory.
5531          */
5532         uint64_t        resp_addr;
5533         uint32_t        enables;
5534         /*
5535          * This bit must be '1' for the first_vf_id field to be
5536          * configured.
5537          */
5538         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
5539         /*
5540          * This value is used to identify a Virtual Function (VF).
5541          * The scope of VF ID is local within a PF.
5542          */
5543         uint16_t        first_vf_id;
5544         /*
5545          * The number of virtual functions requested.
5546          * 0xFFFF - Cleanup all children of this PF.
5547          */
5548         uint16_t        num_vfs;
5549 } __attribute__((packed));
5550
5551 /* hwrm_func_vf_free_output (size:128b/16B) */
5552 struct hwrm_func_vf_free_output {
5553         /* The specific error status for the command. */
5554         uint16_t        error_code;
5555         /* The HWRM command request type. */
5556         uint16_t        req_type;
5557         /* The sequence ID from the original command. */
5558         uint16_t        seq_id;
5559         /* The length of the response data in number of bytes. */
5560         uint16_t        resp_len;
5561         uint8_t unused_0[7];
5562         /*
5563          * This field is used in Output records to indicate that the output
5564          * is completely written to RAM.  This field should be read as '1'
5565          * to indicate that the output has been completely written.
5566          * When writing a command completion or response to an internal processor,
5567          * the order of writes has to be such that this field is written last.
5568          */
5569         uint8_t valid;
5570 } __attribute__((packed));
5571
5572 /********************
5573  * hwrm_func_vf_cfg *
5574  ********************/
5575
5576
5577 /* hwrm_func_vf_cfg_input (size:448b/56B) */
5578 struct hwrm_func_vf_cfg_input {
5579         /* The HWRM command request type. */
5580         uint16_t        req_type;
5581         /*
5582          * The completion ring to send the completion event on. This should
5583          * be the NQ ID returned from the `nq_alloc` HWRM command.
5584          */
5585         uint16_t        cmpl_ring;
5586         /*
5587          * The sequence ID is used by the driver for tracking multiple
5588          * commands. This ID is treated as opaque data by the firmware and
5589          * the value is returned in the `hwrm_resp_hdr` upon completion.
5590          */
5591         uint16_t        seq_id;
5592         /*
5593          * The target ID of the command:
5594          * * 0x0-0xFFF8 - The function ID
5595          * * 0xFFF8-0xFFFE - Reserved for internal processors
5596          * * 0xFFFF - HWRM
5597          */
5598         uint16_t        target_id;
5599         /*
5600          * A physical address pointer pointing to a host buffer that the
5601          * command's response data will be written. This can be either a host
5602          * physical address (HPA) or a guest physical address (GPA) and must
5603          * point to a physically contiguous block of memory.
5604          */
5605         uint64_t        resp_addr;
5606         uint32_t        enables;
5607         /*
5608          * This bit must be '1' for the mtu field to be
5609          * configured.
5610          */
5611         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
5612                 UINT32_C(0x1)
5613         /*
5614          * This bit must be '1' for the guest_vlan field to be
5615          * configured.
5616          */
5617         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
5618                 UINT32_C(0x2)
5619         /*
5620          * This bit must be '1' for the async_event_cr field to be
5621          * configured.
5622          */
5623         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
5624                 UINT32_C(0x4)
5625         /*
5626          * This bit must be '1' for the dflt_mac_addr field to be
5627          * configured.
5628          */
5629         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
5630                 UINT32_C(0x8)
5631         /*
5632          * This bit must be '1' for the num_rsscos_ctxs field to be
5633          * configured.
5634          */
5635         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
5636                 UINT32_C(0x10)
5637         /*
5638          * This bit must be '1' for the num_cmpl_rings field to be
5639          * configured.
5640          */
5641         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
5642                 UINT32_C(0x20)
5643         /*
5644          * This bit must be '1' for the num_tx_rings field to be
5645          * configured.
5646          */
5647         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
5648                 UINT32_C(0x40)
5649         /*
5650          * This bit must be '1' for the num_rx_rings field to be
5651          * configured.
5652          */
5653         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
5654                 UINT32_C(0x80)
5655         /*
5656          * This bit must be '1' for the num_l2_ctxs field to be
5657          * configured.
5658          */
5659         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
5660                 UINT32_C(0x100)
5661         /*
5662          * This bit must be '1' for the num_vnics field to be
5663          * configured.
5664          */
5665         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
5666                 UINT32_C(0x200)
5667         /*
5668          * This bit must be '1' for the num_stat_ctxs field to be
5669          * configured.
5670          */
5671         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
5672                 UINT32_C(0x400)
5673         /*
5674          * This bit must be '1' for the num_hw_ring_grps field to be
5675          * configured.
5676          */
5677         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
5678                 UINT32_C(0x800)
5679         /*
5680          * The maximum transmission unit requested on the function.
5681          * The HWRM should make sure that the mtu of
5682          * the function does not exceed the mtu of the physical
5683          * port that this function is associated with.
5684          *
5685          * In addition to requesting mtu per function, it is
5686          * possible to configure mtu per transmit ring.
5687          * By default, the mtu of each transmit ring associated
5688          * with a function is equal to the mtu of the function.
5689          * The HWRM should make sure that the mtu of each transmit
5690          * ring that is assigned to a function has a valid mtu.
5691          */
5692         uint16_t        mtu;
5693         /*
5694          * The guest VLAN for the function being configured.
5695          * This field's format is same as 802.1Q Tag's
5696          * Tag Control Information (TCI) format that includes both
5697          * Priority Code Point (PCP) and VLAN Identifier (VID).
5698          */
5699         uint16_t        guest_vlan;
5700         /*
5701          * ID of the target completion ring for receiving asynchronous
5702          * event completions. If this field is not valid, then the
5703          * HWRM shall use the default completion ring of the function
5704          * that is being configured as the target completion ring for
5705          * providing any asynchronous event completions for that
5706          * function.
5707          * If this field is valid, then the HWRM shall use the
5708          * completion ring identified by this ID as the target
5709          * completion ring for providing any asynchronous event
5710          * completions for the function that is being configured.
5711          */
5712         uint16_t        async_event_cr;
5713         /*
5714          * This value is the current MAC address requested by the VF
5715          * driver to be configured on this VF. A value of
5716          * 00-00-00-00-00-00 indicates no MAC address configuration
5717          * is requested by the VF driver.
5718          * The parent PF driver may reject or overwrite this
5719          * MAC address.
5720          */
5721         uint8_t dflt_mac_addr[6];
5722         uint32_t        flags;
5723         /*
5724          * This bit requests that the firmware test to see if all the assets
5725          * requested in this command (i.e. number of TX rings) are available.
5726          * The firmware will return an error if the requested assets are
5727          * not available. The firwmare will NOT reserve the assets if they
5728          * are available.
5729          */
5730         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
5731                 UINT32_C(0x1)
5732         /*
5733          * This bit requests that the firmware test to see if all the assets
5734          * requested in this command (i.e. number of RX rings) are available.
5735          * The firmware will return an error if the requested assets are
5736          * not available. The firwmare will NOT reserve the assets if they
5737          * are available.
5738          */
5739         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
5740                 UINT32_C(0x2)
5741         /*
5742          * This bit requests that the firmware test to see if all the assets
5743          * requested in this command (i.e. number of CMPL rings) are available.
5744          * The firmware will return an error if the requested assets are
5745          * not available. The firwmare will NOT reserve the assets if they
5746          * are available.
5747          */
5748         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
5749                 UINT32_C(0x4)
5750         /*
5751          * This bit requests that the firmware test to see if all the assets
5752          * requested in this command (i.e. number of RSS ctx) are available.
5753          * The firmware will return an error if the requested assets are
5754          * not available. The firwmare will NOT reserve the assets if they
5755          * are available.
5756          */
5757         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
5758                 UINT32_C(0x8)
5759         /*
5760          * This bit requests that the firmware test to see if all the assets
5761          * requested in this command (i.e. number of ring groups) are available.
5762          * The firmware will return an error if the requested assets are
5763          * not available. The firwmare will NOT reserve the assets if they
5764          * are available.
5765          */
5766         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
5767                 UINT32_C(0x10)
5768         /*
5769          * This bit requests that the firmware test to see if all the assets
5770          * requested in this command (i.e. number of stat ctx) are available.
5771          * The firmware will return an error if the requested assets are
5772          * not available. The firwmare will NOT reserve the assets if they
5773          * are available.
5774          */
5775         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
5776                 UINT32_C(0x20)
5777         /*
5778          * This bit requests that the firmware test to see if all the assets
5779          * requested in this command (i.e. number of VNICs) are available.
5780          * The firmware will return an error if the requested assets are
5781          * not available. The firwmare will NOT reserve the assets if they
5782          * are available.
5783          */
5784         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
5785                 UINT32_C(0x40)
5786         /*
5787          * This bit requests that the firmware test to see if all the assets
5788          * requested in this command (i.e. number of L2 ctx) are available.
5789          * The firmware will return an error if the requested assets are
5790          * not available. The firwmare will NOT reserve the assets if they
5791          * are available.
5792          */
5793         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
5794                 UINT32_C(0x80)
5795         /* The number of RSS/COS contexts requested for the VF. */
5796         uint16_t        num_rsscos_ctxs;
5797         /* The number of completion rings requested for the VF. */
5798         uint16_t        num_cmpl_rings;
5799         /* The number of transmit rings requested for the VF. */
5800         uint16_t        num_tx_rings;
5801         /* The number of receive rings requested for the VF. */
5802         uint16_t        num_rx_rings;
5803         /* The number of L2 contexts requested for the VF. */
5804         uint16_t        num_l2_ctxs;
5805         /* The number of vnics requested for the VF. */
5806         uint16_t        num_vnics;
5807         /* The number of statistic contexts requested for the VF. */
5808         uint16_t        num_stat_ctxs;
5809         /* The number of HW ring groups requested for the VF. */
5810         uint16_t        num_hw_ring_grps;
5811         uint8_t unused_0[4];
5812 } __attribute__((packed));
5813
5814 /* hwrm_func_vf_cfg_output (size:128b/16B) */
5815 struct hwrm_func_vf_cfg_output {
5816         /* The specific error status for the command. */
5817         uint16_t        error_code;
5818         /* The HWRM command request type. */
5819         uint16_t        req_type;
5820         /* The sequence ID from the original command. */
5821         uint16_t        seq_id;
5822         /* The length of the response data in number of bytes. */
5823         uint16_t        resp_len;
5824         uint8_t unused_0[7];
5825         /*
5826          * This field is used in Output records to indicate that the output
5827          * is completely written to RAM.  This field should be read as '1'
5828          * to indicate that the output has been completely written.
5829          * When writing a command completion or response to an internal processor,
5830          * the order of writes has to be such that this field is written last.
5831          */
5832         uint8_t valid;
5833 } __attribute__((packed));
5834
5835 /*******************
5836  * hwrm_func_qcaps *
5837  *******************/
5838
5839
5840 /* hwrm_func_qcaps_input (size:192b/24B) */
5841 struct hwrm_func_qcaps_input {
5842         /* The HWRM command request type. */
5843         uint16_t        req_type;
5844         /*
5845          * The completion ring to send the completion event on. This should
5846          * be the NQ ID returned from the `nq_alloc` HWRM command.
5847          */
5848         uint16_t        cmpl_ring;
5849         /*
5850          * The sequence ID is used by the driver for tracking multiple
5851          * commands. This ID is treated as opaque data by the firmware and
5852          * the value is returned in the `hwrm_resp_hdr` upon completion.
5853          */
5854         uint16_t        seq_id;
5855         /*
5856          * The target ID of the command:
5857          * * 0x0-0xFFF8 - The function ID
5858          * * 0xFFF8-0xFFFE - Reserved for internal processors
5859          * * 0xFFFF - HWRM
5860          */
5861         uint16_t        target_id;
5862         /*
5863          * A physical address pointer pointing to a host buffer that the
5864          * command's response data will be written. This can be either a host
5865          * physical address (HPA) or a guest physical address (GPA) and must
5866          * point to a physically contiguous block of memory.
5867          */
5868         uint64_t        resp_addr;
5869         /*
5870          * Function ID of the function that is being queried.
5871          * 0xFF... (All Fs) if the query is for the requesting
5872          * function.
5873          */
5874         uint16_t        fid;
5875         uint8_t unused_0[6];
5876 } __attribute__((packed));
5877
5878 /* hwrm_func_qcaps_output (size:640b/80B) */
5879 struct hwrm_func_qcaps_output {
5880         /* The specific error status for the command. */
5881         uint16_t        error_code;
5882         /* The HWRM command request type. */
5883         uint16_t        req_type;
5884         /* The sequence ID from the original command. */
5885         uint16_t        seq_id;
5886         /* The length of the response data in number of bytes. */
5887         uint16_t        resp_len;
5888         /*
5889          * FID value.  This value is used to identify operations on the PCI
5890          * bus as belonging to a particular PCI function.
5891          */
5892         uint16_t        fid;
5893         /*
5894          * Port ID of port that this function is associated with.
5895          * Valid only for the PF.
5896          * 0xFF... (All Fs) if this function is not associated with
5897          * any port.
5898          * 0xFF... (All Fs) if this function is called from a VF.
5899          */
5900         uint16_t        port_id;
5901         uint32_t        flags;
5902         /* If 1, then Push mode is supported on this function. */
5903         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
5904                 UINT32_C(0x1)
5905         /*
5906          * If 1, then the global MSI-X auto-masking is enabled for the
5907          * device.
5908          */
5909         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
5910                 UINT32_C(0x2)
5911         /*
5912          * If 1, then the Precision Time Protocol (PTP) processing
5913          * is supported on this function.
5914          * The HWRM should enable PTP on only a single Physical
5915          * Function (PF) per port.
5916          */
5917         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
5918                 UINT32_C(0x4)
5919         /*
5920          * If 1, then RDMA over Converged Ethernet (RoCE) v1
5921          * is supported on this function.
5922          */
5923         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
5924                 UINT32_C(0x8)
5925         /*
5926          * If 1, then RDMA over Converged Ethernet (RoCE) v2
5927          * is supported on this function.
5928          */
5929         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
5930                 UINT32_C(0x10)
5931         /*
5932          * If 1, then control and configuration of WoL magic packet
5933          * are supported on this function.
5934          */
5935         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
5936                 UINT32_C(0x20)
5937         /*
5938          * If 1, then control and configuration of bitmap pattern
5939          * packet are supported on this function.
5940          */
5941         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
5942                 UINT32_C(0x40)
5943         /*
5944          * If set to 1, then the control and configuration of rate limit
5945          * of an allocated TX ring on the queried function is supported.
5946          */
5947         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
5948                 UINT32_C(0x80)
5949         /*
5950          * If 1, then control and configuration of minimum and
5951          * maximum bandwidths are supported on the queried function.
5952          */
5953         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
5954                 UINT32_C(0x100)
5955         /*
5956          * If the query is for a VF, then this flag shall be ignored.
5957          * If this query is for a PF and this flag is set to 1,
5958          * then the PF has the capability to set the rate limits
5959          * on the TX rings of its children VFs.
5960          * If this query is for a PF and this flag is set to 0, then
5961          * the PF does not have the capability to set the rate limits
5962          * on the TX rings of its children VFs.
5963          */
5964         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
5965                 UINT32_C(0x200)
5966         /*
5967          * If the query is for a VF, then this flag shall be ignored.
5968          * If this query is for a PF and this flag is set to 1,
5969          * then the PF has the capability to set the minimum and/or
5970          * maximum bandwidths for its children VFs.
5971          * If this query is for a PF and this flag is set to 0, then
5972          * the PF does not have the capability to set the minimum or
5973          * maximum bandwidths for its children VFs.
5974          */
5975         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
5976                 UINT32_C(0x400)
5977         /*
5978          * Standard TX Ring mode is used for the allocation of TX ring
5979          * and underlying scheduling resources that allow bandwidth
5980          * reservation and limit settings on the queried function.
5981          * If set to 1, then standard TX ring mode is supported
5982          * on the queried function.
5983          * If set to 0, then standard TX ring mode is not available
5984          * on the queried function.
5985          */
5986         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
5987                 UINT32_C(0x800)
5988         /*
5989          * If the query is for a VF, then this flag shall be ignored,
5990          * If this query is for a PF and this flag is set to 1,
5991          * then the PF has the capability to detect GENEVE tunnel
5992          * flags.
5993          */
5994         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
5995                 UINT32_C(0x1000)
5996         /*
5997          * If the query is for a VF, then this flag shall be ignored,
5998          * If this query is for a PF and this flag is set to 1,
5999          * then the PF has the capability to detect NVGRE tunnel
6000          * flags.
6001          */
6002         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
6003                 UINT32_C(0x2000)
6004         /*
6005          * If the query is for a VF, then this flag shall be ignored,
6006          * If this query is for a PF and this flag is set to 1,
6007          * then the PF has the capability to detect GRE tunnel
6008          * flags.
6009          */
6010         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
6011                 UINT32_C(0x4000)
6012         /*
6013          * If the query is for a VF, then this flag shall be ignored,
6014          * If this query is for a PF and this flag is set to 1,
6015          * then the PF has the capability to detect MPLS tunnel
6016          * flags.
6017          */
6018         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
6019                 UINT32_C(0x8000)
6020         /*
6021          * If the query is for a VF, then this flag shall be ignored,
6022          * If this query is for a PF and this flag is set to 1,
6023          * then the PF has the capability to support pcie stats.
6024          */
6025         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
6026                 UINT32_C(0x10000)
6027         /*
6028          * If the query is for a VF, then this flag shall be ignored,
6029          * If this query is for a PF and this flag is set to 1,
6030          * then the PF has the capability to adopt the VF's belonging
6031          * to another PF.
6032          */
6033         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \
6034                 UINT32_C(0x20000)
6035         /*
6036          * If the query is for a VF, then this flag shall be ignored,
6037          * If this query is for a PF and this flag is set to 1,
6038          * then the PF has the administrative privilege to configure another PF
6039          */
6040         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \
6041                 UINT32_C(0x40000)
6042         /*
6043          * If the query is for a VF, then this flag shall be ignored.
6044          * If this query is for a PF and this flag is set to 1, then
6045          * the PF will know that the firmware has the capability to track
6046          * the virtual link status.
6047          */
6048         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \
6049                 UINT32_C(0x80000)
6050         /*
6051          * If 1, then this function supports the push mode that uses
6052          * write combine buffers and the long inline tx buffer descriptor.
6053          */
6054         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \
6055                 UINT32_C(0x100000)
6056         /*
6057          * If 1, then FW has capability to allocate TX rings dynamically
6058          * in ring alloc even if PF reserved pool is zero.
6059          * This bit will be used only for PFs.
6060          */
6061         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
6062                 UINT32_C(0x200000)
6063         /*
6064          * When this bit is '1', it indicates that core firmware is
6065          * capable of Hot Reset.
6066          */
6067         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE \
6068                 UINT32_C(0x400000)
6069         /*
6070          * This value is current MAC address configured for this
6071          * function. A value of 00-00-00-00-00-00 indicates no
6072          * MAC address is currently configured.
6073          */
6074         uint8_t mac_address[6];
6075         /*
6076          * The maximum number of RSS/COS contexts that can be
6077          * allocated to the function.
6078          */
6079         uint16_t        max_rsscos_ctx;
6080         /*
6081          * The maximum number of completion rings that can be
6082          * allocated to the function.
6083          */
6084         uint16_t        max_cmpl_rings;
6085         /*
6086          * The maximum number of transmit rings that can be
6087          * allocated to the function.
6088          */
6089         uint16_t        max_tx_rings;
6090         /*
6091          * The maximum number of receive rings that can be
6092          * allocated to the function.
6093          */
6094         uint16_t        max_rx_rings;
6095         /*
6096          * The maximum number of L2 contexts that can be
6097          * allocated to the function.
6098          */
6099         uint16_t        max_l2_ctxs;
6100         /*
6101          * The maximum number of VNICs that can be
6102          * allocated to the function.
6103          */
6104         uint16_t        max_vnics;
6105         /*
6106          * The identifier for the first VF enabled on a PF. This
6107          * is valid only on the PF with SR-IOV enabled.
6108          * 0xFF... (All Fs) if this command is called on a PF with
6109          * SR-IOV disabled or on a VF.
6110          */
6111         uint16_t        first_vf_id;
6112         /*
6113          * The maximum number of VFs that can be
6114          * allocated to the function. This is valid only on the
6115          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
6116          * command is called on a PF with SR-IOV disabled or
6117          * on a VF.
6118          */
6119         uint16_t        max_vfs;
6120         /*
6121          * The maximum number of statistic contexts that can be
6122          * allocated to the function.
6123          */
6124         uint16_t        max_stat_ctx;
6125         /*
6126          * The maximum number of Encapsulation records that can be
6127          * offloaded by this function.
6128          */
6129         uint32_t        max_encap_records;
6130         /*
6131          * The maximum number of decapsulation records that can
6132          * be offloaded by this function.
6133          */
6134         uint32_t        max_decap_records;
6135         /*
6136          * The maximum number of Exact Match (EM) flows that can be
6137          * offloaded by this function on the TX side.
6138          */
6139         uint32_t        max_tx_em_flows;
6140         /*
6141          * The maximum number of Wildcard Match (WM) flows that can
6142          * be offloaded by this function on the TX side.
6143          */
6144         uint32_t        max_tx_wm_flows;
6145         /*
6146          * The maximum number of Exact Match (EM) flows that can be
6147          * offloaded by this function on the RX side.
6148          */
6149         uint32_t        max_rx_em_flows;
6150         /*
6151          * The maximum number of Wildcard Match (WM) flows that can
6152          * be offloaded by this function on the RX side.
6153          */
6154         uint32_t        max_rx_wm_flows;
6155         /*
6156          * The maximum number of multicast filters that can
6157          * be supported by this function on the RX side.
6158          */
6159         uint32_t        max_mcast_filters;
6160         /*
6161          * The maximum value of flow_id that can be supported
6162          * in completion records.
6163          */
6164         uint32_t        max_flow_id;
6165         /*
6166          * The maximum number of HW ring groups that can be
6167          * supported on this function.
6168          */
6169         uint32_t        max_hw_ring_grps;
6170         /*
6171          * The maximum number of strict priority transmit rings
6172          * that can be allocated to the function.
6173          * This number indicates the maximum number of TX rings
6174          * that can be assigned strict priorities out of the
6175          * maximum number of TX rings that can be allocated
6176          * (max_tx_rings) to the function.
6177          */
6178         uint16_t        max_sp_tx_rings;
6179         uint8_t unused_0;
6180         /*
6181          * This field is used in Output records to indicate that the output
6182          * is completely written to RAM.  This field should be read as '1'
6183          * to indicate that the output has been completely written.
6184          * When writing a command completion or response to an internal processor,
6185          * the order of writes has to be such that this field is written last.
6186          */
6187         uint8_t valid;
6188 } __attribute__((packed));
6189
6190 /******************
6191  * hwrm_func_qcfg *
6192  ******************/
6193
6194
6195 /* hwrm_func_qcfg_input (size:192b/24B) */
6196 struct hwrm_func_qcfg_input {
6197         /* The HWRM command request type. */
6198         uint16_t        req_type;
6199         /*
6200          * The completion ring to send the completion event on. This should
6201          * be the NQ ID returned from the `nq_alloc` HWRM command.
6202          */
6203         uint16_t        cmpl_ring;
6204         /*
6205          * The sequence ID is used by the driver for tracking multiple
6206          * commands. This ID is treated as opaque data by the firmware and
6207          * the value is returned in the `hwrm_resp_hdr` upon completion.
6208          */
6209         uint16_t        seq_id;
6210         /*
6211          * The target ID of the command:
6212          * * 0x0-0xFFF8 - The function ID
6213          * * 0xFFF8-0xFFFE - Reserved for internal processors
6214          * * 0xFFFF - HWRM
6215          */
6216         uint16_t        target_id;
6217         /*
6218          * A physical address pointer pointing to a host buffer that the
6219          * command's response data will be written. This can be either a host
6220          * physical address (HPA) or a guest physical address (GPA) and must
6221          * point to a physically contiguous block of memory.
6222          */
6223         uint64_t        resp_addr;
6224         /*
6225          * Function ID of the function that is being queried.
6226          * 0xFF... (All Fs) if the query is for the requesting
6227          * function.
6228          */
6229         uint16_t        fid;
6230         uint8_t unused_0[6];
6231 } __attribute__((packed));
6232
6233 /* hwrm_func_qcfg_output (size:704b/88B) */
6234 struct hwrm_func_qcfg_output {
6235         /* The specific error status for the command. */
6236         uint16_t        error_code;
6237         /* The HWRM command request type. */
6238         uint16_t        req_type;
6239         /* The sequence ID from the original command. */
6240         uint16_t        seq_id;
6241         /* The length of the response data in number of bytes. */
6242         uint16_t        resp_len;
6243         /*
6244          * FID value.  This value is used to identify operations on the PCI
6245          * bus as belonging to a particular PCI function.
6246          */
6247         uint16_t        fid;
6248         /*
6249          * Port ID of port that this function is associated with.
6250          * 0xFF... (All Fs) if this function is not associated with
6251          * any port.
6252          */
6253         uint16_t        port_id;
6254         /*
6255          * This value is the current VLAN setting for this
6256          * function. The value of 0 for this field indicates
6257          * no priority tagging or VLAN is used.
6258          * This field's format is same as 802.1Q Tag's
6259          * Tag Control Information (TCI) format that includes both
6260          * Priority Code Point (PCP) and VLAN Identifier (VID).
6261          */
6262         uint16_t        vlan;
6263         uint16_t        flags;
6264         /*
6265          * If 1, then magic packet based Out-Of-Box WoL is enabled on
6266          * the port associated with this function.
6267          */
6268         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
6269                 UINT32_C(0x1)
6270         /*
6271          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
6272          * on the port associated with this function.
6273          */
6274         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
6275                 UINT32_C(0x2)
6276         /*
6277          * If set to 1, then FW based DCBX agent is enabled and running on
6278          * the port associated with this function.
6279          * If set to 0, then DCBX agent is not running in the firmware.
6280          */
6281         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
6282                 UINT32_C(0x4)
6283         /*
6284          * Standard TX Ring mode is used for the allocation of TX ring
6285          * and underlying scheduling resources that allow bandwidth
6286          * reservation and limit settings on the queried function.
6287          * If set to 1, then standard TX ring mode is enabled
6288          * on the queried function.
6289          * If set to 0, then the standard TX ring mode is disabled
6290          * on the queried function. In this extended TX ring resource
6291          * mode, the minimum and maximum bandwidth settings are not
6292          * supported to allow the allocation of TX rings to span multiple
6293          * scheduler nodes.
6294          */
6295         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
6296                 UINT32_C(0x8)
6297         /*
6298          * If set to 1 then FW based LLDP agent is enabled and running on
6299          * the port associated with this function.
6300          * If set to 0 then the LLDP agent is not running in the firmware.
6301          */
6302         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
6303                 UINT32_C(0x10)
6304         /*
6305          * If set to 1, then multi-host mode is active for this function.
6306          * If set to 0, then multi-host mode is inactive for this function
6307          * or not applicable for this device.
6308          */
6309         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
6310                 UINT32_C(0x20)
6311         /*
6312          * If the function that is being queried is a PF, then the HWRM shall
6313          * set this field to 0 and the HWRM client shall ignore this field.
6314          * If the function that is being queried is a VF, then the HWRM shall
6315          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
6316          * shall set this field to 0.
6317          */
6318         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
6319                 UINT32_C(0x40)
6320         /*
6321          * If set to 1, then secure mode is enabled for this function or device.
6322          * If set to 0, then secure mode is disabled (or normal mode) for this
6323          * function or device.
6324          */
6325         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
6326                 UINT32_C(0x80)
6327         /*
6328          * This value is current MAC address configured for this
6329          * function. A value of 00-00-00-00-00-00 indicates no
6330          * MAC address is currently configured.
6331          */
6332         uint8_t mac_address[6];
6333         /*
6334          * This value is current PCI ID of this
6335          * function. If ARI is enabled, then it is
6336          * Bus Number (8b):Function Number(8b). Otherwise, it is
6337          * Bus Number (8b):Device Number (4b):Function Number(4b).
6338          * If multi-host mode is active, the 4 lsb will indicate
6339          * the PF index for this function.
6340          */
6341         uint16_t        pci_id;
6342         /*
6343          * The number of RSS/COS contexts currently
6344          * allocated to the function.
6345          */
6346         uint16_t        alloc_rsscos_ctx;
6347         /*
6348          * The number of completion rings currently allocated to
6349          * the function. This does not include the rings allocated
6350          * to any children functions if any.
6351          */
6352         uint16_t        alloc_cmpl_rings;
6353         /*
6354          * The number of transmit rings currently allocated to
6355          * the function. This does not include the rings allocated
6356          * to any children functions if any.
6357          */
6358         uint16_t        alloc_tx_rings;
6359         /*
6360          * The number of receive rings currently allocated to
6361          * the function. This does not include the rings allocated
6362          * to any children functions if any.
6363          */
6364         uint16_t        alloc_rx_rings;
6365         /* The allocated number of L2 contexts to the function. */
6366         uint16_t        alloc_l2_ctx;
6367         /* The allocated number of vnics to the function. */
6368         uint16_t        alloc_vnics;
6369         /*
6370          * The maximum transmission unit of the function.
6371          * If the reported mtu value is non-zero then it will used for the
6372          * rings allocated on this function. otherwise the default
6373          * value is used if ring MTU is not specified.
6374          */
6375         uint16_t        mtu;
6376         /*
6377          * The maximum receive unit of the function.
6378          * For vnics allocated on this function, this default
6379          * value is used if vnic MRU is not specified.
6380          */
6381         uint16_t        mru;
6382         /* The statistics context assigned to a function. */
6383         uint16_t        stat_ctx_id;
6384         /*
6385          * The HWRM shall return Unknown value for this field
6386          * when this command is used to query VF's configuration.
6387          */
6388         uint8_t port_partition_type;
6389         /* Single physical function */
6390         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
6391         /* Multiple physical functions */
6392         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
6393         /* Network Partitioning 1.0 */
6394         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
6395         /* Network Partitioning 1.5 */
6396         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
6397         /* Network Partitioning 2.0 */
6398         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
6399         /* Unknown */
6400         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
6401                 UINT32_C(0xff)
6402         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
6403                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
6404         /*
6405          * This field will indicate number of physical functions on this port_partition.
6406          * HWRM shall return unavail (i.e. value of 0) for this field
6407          * when this command is used to query VF's configuration or
6408          * from older firmware that doesn't support this field.
6409          */
6410         uint8_t port_pf_cnt;
6411         /* number of PFs is not available */
6412         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
6413         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
6414                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
6415         /*
6416          * The default VNIC ID assigned to a function that is
6417          * being queried.
6418          */
6419         uint16_t        dflt_vnic_id;
6420         uint16_t        max_mtu_configured;
6421         /*
6422          * Minimum BW allocated for this function.
6423          * The HWRM will translate this value into byte counter and
6424          * time interval used for the scheduler inside the device.
6425          * A value of 0 indicates the minimum bandwidth is not
6426          * configured.
6427          */
6428         uint32_t        min_bw;
6429         /* The bandwidth value. */
6430         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
6431                 UINT32_C(0xfffffff)
6432         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
6433         /* The granularity of the value (bits or bytes). */
6434         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
6435                 UINT32_C(0x10000000)
6436         /* Value is in bits. */
6437         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
6438                 (UINT32_C(0x0) << 28)
6439         /* Value is in bytes. */
6440         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
6441                 (UINT32_C(0x1) << 28)
6442         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
6443                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
6444         /* bw_value_unit is 3 b */
6445         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
6446                 UINT32_C(0xe0000000)
6447         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
6448         /* Value is in Mb or MB (base 10). */
6449         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
6450                 (UINT32_C(0x0) << 29)
6451         /* Value is in Kb or KB (base 10). */
6452         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
6453                 (UINT32_C(0x2) << 29)
6454         /* Value is in bits or bytes. */
6455         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
6456                 (UINT32_C(0x4) << 29)
6457         /* Value is in Gb or GB (base 10). */
6458         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
6459                 (UINT32_C(0x6) << 29)
6460         /* Value is in 1/100th of a percentage of total bandwidth. */
6461         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
6462                 (UINT32_C(0x1) << 29)
6463         /* Invalid unit */
6464         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
6465                 (UINT32_C(0x7) << 29)
6466         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
6467                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
6468         /*
6469          * Maximum BW allocated for this function.
6470          * The HWRM will translate this value into byte counter and
6471          * time interval used for the scheduler inside the device.
6472          * A value of 0 indicates that the maximum bandwidth is not
6473          * configured.
6474          */
6475         uint32_t        max_bw;
6476         /* The bandwidth value. */
6477         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
6478                 UINT32_C(0xfffffff)
6479         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
6480         /* The granularity of the value (bits or bytes). */
6481         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
6482                 UINT32_C(0x10000000)
6483         /* Value is in bits. */
6484         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
6485                 (UINT32_C(0x0) << 28)
6486         /* Value is in bytes. */
6487         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
6488                 (UINT32_C(0x1) << 28)
6489         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
6490                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
6491         /* bw_value_unit is 3 b */
6492         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
6493                 UINT32_C(0xe0000000)
6494         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
6495         /* Value is in Mb or MB (base 10). */
6496         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
6497                 (UINT32_C(0x0) << 29)
6498         /* Value is in Kb or KB (base 10). */
6499         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
6500                 (UINT32_C(0x2) << 29)
6501         /* Value is in bits or bytes. */
6502         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
6503                 (UINT32_C(0x4) << 29)
6504         /* Value is in Gb or GB (base 10). */
6505         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
6506                 (UINT32_C(0x6) << 29)
6507         /* Value is in 1/100th of a percentage of total bandwidth. */
6508         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
6509                 (UINT32_C(0x1) << 29)
6510         /* Invalid unit */
6511         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
6512                 (UINT32_C(0x7) << 29)
6513         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
6514                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
6515         /*
6516          * This value indicates the Edge virtual bridge mode for the
6517          * domain that this function belongs to.
6518          */
6519         uint8_t evb_mode;
6520         /* No Edge Virtual Bridging (EVB) */
6521         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
6522         /* Virtual Ethernet Bridge (VEB) */
6523         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
6524         /* Virtual Ethernet Port Aggregator (VEPA) */
6525         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
6526         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
6527                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
6528         uint8_t options;
6529         /*
6530          * This value indicates the PCIE device cache line size.
6531          * The cache line size allows the DMA writes to terminate and
6532          * start at the cache boundary.
6533          */
6534         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
6535                 UINT32_C(0x3)
6536         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
6537         /* Cache Line Size 64 bytes */
6538         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
6539                 UINT32_C(0x0)
6540         /* Cache Line Size 128 bytes */
6541         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
6542                 UINT32_C(0x1)
6543         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
6544                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
6545         /* This value is the virtual link admin state setting. */
6546         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
6547                 UINT32_C(0xc)
6548         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
6549         /* Admin link state is in forced down mode. */
6550         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
6551                 (UINT32_C(0x0) << 2)
6552         /* Admin link state is in forced up mode. */
6553         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
6554                 (UINT32_C(0x1) << 2)
6555         /* Admin link state is in auto mode  - follows the physical link state. */
6556         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
6557                 (UINT32_C(0x2) << 2)
6558         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
6559                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
6560         /* Reserved for future. */
6561         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
6562                 UINT32_C(0xf0)
6563         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
6564         /*
6565          * The number of VFs that are allocated to the function.
6566          * This is valid only on the PF with SR-IOV enabled.
6567          * 0xFF... (All Fs) if this command is called on a PF with
6568          * SR-IOV disabled or on a VF.
6569          */
6570         uint16_t        alloc_vfs;
6571         /*
6572          * The number of allocated multicast filters for this
6573          * function on the RX side.
6574          */
6575         uint32_t        alloc_mcast_filters;
6576         /*
6577          * The number of allocated HW ring groups for this
6578          * function.
6579          */
6580         uint32_t        alloc_hw_ring_grps;
6581         /*
6582          * The number of strict priority transmit rings out of
6583          * currently allocated TX rings to the function
6584          * (alloc_tx_rings).
6585          */
6586         uint16_t        alloc_sp_tx_rings;
6587         /*
6588          * The number of statistics contexts
6589          * currently reserved for the function.
6590          */
6591         uint16_t        alloc_stat_ctx;
6592         /*
6593          * This field specifies how many NQs are reserved for the PF.
6594          * Remaining NQs that belong to the PF are available for VFs.
6595          * Once a PF has created VFs, it cannot change how many NQs are
6596          * reserved for itself (since the NQs must be contiguous in HW).
6597          */
6598         uint16_t        alloc_msix;
6599         /*
6600          * The number of registered VF’s associated with the PF. This field
6601          * should be ignored when the request received on the VF interface.
6602          * This field will be updated on the PF interface to initiate
6603          * the unregister request on PF in the HOT Reset Process.
6604          */
6605         uint16_t        registered_vfs;
6606         uint8_t unused_1[3];
6607         /*
6608          * For backward compatibility this field must be set to 1.
6609          * Older drivers might look for this field to be 1 before
6610          * processing the message.
6611          */
6612         uint8_t always_1;
6613         /*
6614          * This GRC address location is used by the Host driver interfaces to poll
6615          * the adapter ready state to re-initiate the registration process again
6616          * after receiving the RESET Notify event.
6617          */
6618         uint32_t        reset_addr_poll;
6619         uint8_t unused_2[3];
6620         /*
6621          * This field is used in Output records to indicate that the output
6622          * is completely written to RAM.  This field should be read as '1'
6623          * to indicate that the output has been completely written.
6624          * When writing a command completion or response to an internal processor,
6625          * the order of writes has to be such that this field is written last.
6626          */
6627         uint8_t valid;
6628 } __attribute__((packed));
6629
6630 /*****************
6631  * hwrm_func_cfg *
6632  *****************/
6633
6634
6635 /* hwrm_func_cfg_input (size:704b/88B) */
6636 struct hwrm_func_cfg_input {
6637         /* The HWRM command request type. */
6638         uint16_t        req_type;
6639         /*
6640          * The completion ring to send the completion event on. This should
6641          * be the NQ ID returned from the `nq_alloc` HWRM command.
6642          */
6643         uint16_t        cmpl_ring;
6644         /*
6645          * The sequence ID is used by the driver for tracking multiple
6646          * commands. This ID is treated as opaque data by the firmware and
6647          * the value is returned in the `hwrm_resp_hdr` upon completion.
6648          */
6649         uint16_t        seq_id;
6650         /*
6651          * The target ID of the command:
6652          * * 0x0-0xFFF8 - The function ID
6653          * * 0xFFF8-0xFFFE - Reserved for internal processors
6654          * * 0xFFFF - HWRM
6655          */
6656         uint16_t        target_id;
6657         /*
6658          * A physical address pointer pointing to a host buffer that the
6659          * command's response data will be written. This can be either a host
6660          * physical address (HPA) or a guest physical address (GPA) and must
6661          * point to a physically contiguous block of memory.
6662          */
6663         uint64_t        resp_addr;
6664         /*
6665          * Function ID of the function that is being
6666          * configured.
6667          * If set to 0xFF... (All Fs), then the the configuration is
6668          * for the requesting function.
6669          */
6670         uint16_t        fid;
6671         /*
6672          * This field specifies how many NQs will be reserved for the PF.
6673          * Remaining NQs that belong to the PF become available for VFs.
6674          * Once a PF has created VFs, it cannot change how many NQs are
6675          * reserved for itself (since the NQs must be contiguous in HW).
6676          */
6677         uint16_t        num_msix;
6678         uint32_t        flags;
6679         /*
6680          * When this bit is '1', the function is disabled with
6681          * source MAC address check.
6682          * This is an anti-spoofing check. If this flag is set,
6683          * then the function shall be configured to disallow
6684          * transmission of frames with the source MAC address that
6685          * is configured for this function.
6686          */
6687         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
6688                 UINT32_C(0x1)
6689         /*
6690          * When this bit is '1', the function is enabled with
6691          * source MAC address check.
6692          * This is an anti-spoofing check. If this flag is set,
6693          * then the function shall be configured to allow
6694          * transmission of frames with the source MAC address that
6695          * is configured for this function.
6696          */
6697         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
6698                 UINT32_C(0x2)
6699         /* reserved. */
6700         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
6701                 UINT32_C(0x1fc)
6702         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
6703         /*
6704          * Standard TX Ring mode is used for the allocation of TX ring
6705          * and underlying scheduling resources that allow bandwidth
6706          * reservation and limit settings on the queried function.
6707          * If set to 1, then standard TX ring mode is requested to be
6708          * enabled on the function being configured.
6709          */
6710         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
6711                 UINT32_C(0x200)
6712         /*
6713          * Standard TX Ring mode is used for the allocation of TX ring
6714          * and underlying scheduling resources that allow bandwidth
6715          * reservation and limit settings on the queried function.
6716          * If set to 1, then the standard TX ring mode is requested to
6717          * be disabled on the function being configured. In this extended
6718          * TX ring resource mode, the minimum and maximum bandwidth settings
6719          * are not supported to allow the allocation of TX rings to
6720          * span multiple scheduler nodes.
6721          */
6722         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
6723                 UINT32_C(0x400)
6724         /*
6725          * If this bit is set, virtual mac address configured
6726          * in this command will be persistent over warm boot.
6727          */
6728         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
6729                 UINT32_C(0x800)
6730         /*
6731          * This bit only applies to the VF. If this bit is set, the statistic
6732          * context counters will not be cleared when the statistic context is freed
6733          * or a function reset is called on VF. This bit will be cleared when the PF
6734          * is unloaded or a function reset is called on the PF.
6735          */
6736         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
6737                 UINT32_C(0x1000)
6738         /*
6739          * This bit requests that the firmware test to see if all the assets
6740          * requested in this command (i.e. number of TX rings) are available.
6741          * The firmware will return an error if the requested assets are
6742          * not available. The firwmare will NOT reserve the assets if they
6743          * are available.
6744          */
6745         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
6746                 UINT32_C(0x2000)
6747         /*
6748          * This bit requests that the firmware test to see if all the assets
6749          * requested in this command (i.e. number of RX rings) are available.
6750          * The firmware will return an error if the requested assets are
6751          * not available. The firwmare will NOT reserve the assets if they
6752          * are available.
6753          */
6754         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
6755                 UINT32_C(0x4000)
6756         /*
6757          * This bit requests that the firmware test to see if all the assets
6758          * requested in this command (i.e. number of CMPL rings) are available.
6759          * The firmware will return an error if the requested assets are
6760          * not available. The firwmare will NOT reserve the assets if they
6761          * are available.
6762          */
6763         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
6764                 UINT32_C(0x8000)
6765         /*
6766          * This bit requests that the firmware test to see if all the assets
6767          * requested in this command (i.e. number of RSS ctx) are available.
6768          * The firmware will return an error if the requested assets are
6769          * not available. The firwmare will NOT reserve the assets if they
6770          * are available.
6771          */
6772         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
6773                 UINT32_C(0x10000)
6774         /*
6775          * This bit requests that the firmware test to see if all the assets
6776          * requested in this command (i.e. number of ring groups) are available.
6777          * The firmware will return an error if the requested assets are
6778          * not available. The firwmare will NOT reserve the assets if they
6779          * are available.
6780          */
6781         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
6782                 UINT32_C(0x20000)
6783         /*
6784          * This bit requests that the firmware test to see if all the assets
6785          * requested in this command (i.e. number of stat ctx) are available.
6786          * The firmware will return an error if the requested assets are
6787          * not available. The firwmare will NOT reserve the assets if they
6788          * are available.
6789          */
6790         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
6791                 UINT32_C(0x40000)
6792         /*
6793          * This bit requests that the firmware test to see if all the assets
6794          * requested in this command (i.e. number of VNICs) are available.
6795          * The firmware will return an error if the requested assets are
6796          * not available. The firwmare will NOT reserve the assets if they
6797          * are available.
6798          */
6799         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
6800                 UINT32_C(0x80000)
6801         /*
6802          * This bit requests that the firmware test to see if all the assets
6803          * requested in this command (i.e. number of L2 ctx) are available.
6804          * The firmware will return an error if the requested assets are
6805          * not available. The firwmare will NOT reserve the assets if they
6806          * are available.
6807          */
6808         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
6809                 UINT32_C(0x100000)
6810         /*
6811          * This configuration change can be initiated by a PF driver. This
6812          * configuration request shall be targeted to a VF. From local host
6813          * resident HWRM clients, only the parent PF driver shall be allowed
6814          * to initiate this change on one of its children VFs. If this bit is
6815          * set to 1, then the VF that is being configured is requested to be
6816          * trusted. If this bit is set to 0, then the VF that is being configured
6817          * is requested to be not trusted.
6818          */
6819         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
6820                 UINT32_C(0x200000)
6821         /*
6822          * When this bit it set, even if PF reserved pool size is zero,
6823          * FW will allow driver to create TX rings in ring alloc,
6824          * by reserving TX ring, S3 node dynamically.
6825          */
6826         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
6827                 UINT32_C(0x400000)
6828         uint32_t        enables;
6829         /*
6830          * This bit must be '1' for the mtu field to be
6831          * configured.
6832          */
6833         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
6834                 UINT32_C(0x1)
6835         /*
6836          * This bit must be '1' for the mru field to be
6837          * configured.
6838          */
6839         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
6840                 UINT32_C(0x2)
6841         /*
6842          * This bit must be '1' for the num_rsscos_ctxs field to be
6843          * configured.
6844          */
6845         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
6846                 UINT32_C(0x4)
6847         /*
6848          * This bit must be '1' for the num_cmpl_rings field to be
6849          * configured.
6850          */
6851         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
6852                 UINT32_C(0x8)
6853         /*
6854          * This bit must be '1' for the num_tx_rings field to be
6855          * configured.
6856          */
6857         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
6858                 UINT32_C(0x10)
6859         /*
6860          * This bit must be '1' for the num_rx_rings field to be
6861          * configured.
6862          */
6863         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
6864                 UINT32_C(0x20)
6865         /*
6866          * This bit must be '1' for the num_l2_ctxs field to be
6867          * configured.
6868          */
6869         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
6870                 UINT32_C(0x40)
6871         /*
6872          * This bit must be '1' for the num_vnics field to be
6873          * configured.
6874          */
6875         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
6876                 UINT32_C(0x80)
6877         /*
6878          * This bit must be '1' for the num_stat_ctxs field to be
6879          * configured.
6880          */
6881         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
6882                 UINT32_C(0x100)
6883         /*
6884          * This bit must be '1' for the dflt_mac_addr field to be
6885          * configured.
6886          */
6887         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
6888                 UINT32_C(0x200)
6889         /*
6890          * This bit must be '1' for the dflt_vlan field to be
6891          * configured.
6892          */
6893         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
6894                 UINT32_C(0x400)
6895         /*
6896          * This bit must be '1' for the dflt_ip_addr field to be
6897          * configured.
6898          */
6899         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
6900                 UINT32_C(0x800)
6901         /*
6902          * This bit must be '1' for the min_bw field to be
6903          * configured.
6904          */
6905         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
6906                 UINT32_C(0x1000)
6907         /*
6908          * This bit must be '1' for the max_bw field to be
6909          * configured.
6910          */
6911         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
6912                 UINT32_C(0x2000)
6913         /*
6914          * This bit must be '1' for the async_event_cr field to be
6915          * configured.
6916          */
6917         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
6918                 UINT32_C(0x4000)
6919         /*
6920          * This bit must be '1' for the vlan_antispoof_mode field to be
6921          * configured.
6922          */
6923         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
6924                 UINT32_C(0x8000)
6925         /*
6926          * This bit must be '1' for the allowed_vlan_pris field to be
6927          * configured.
6928          */
6929         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
6930                 UINT32_C(0x10000)
6931         /*
6932          * This bit must be '1' for the evb_mode field to be
6933          * configured.
6934          */
6935         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
6936                 UINT32_C(0x20000)
6937         /*
6938          * This bit must be '1' for the num_mcast_filters field to be
6939          * configured.
6940          */
6941         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
6942                 UINT32_C(0x40000)
6943         /*
6944          * This bit must be '1' for the num_hw_ring_grps field to be
6945          * configured.
6946          */
6947         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
6948                 UINT32_C(0x80000)
6949         /*
6950          * This bit must be '1' for the cache_linesize field to be
6951          * configured.
6952          */
6953         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
6954                 UINT32_C(0x100000)
6955         /*
6956          * This bit must be '1' for the num_msix field to be
6957          * configured.
6958          */
6959         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
6960                 UINT32_C(0x200000)
6961         /*
6962          * This bit must be '1' for the link admin state field to be
6963          * configured.
6964          */
6965         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
6966                 UINT32_C(0x400000)
6967         /*
6968          * The maximum transmission unit of the function.
6969          * The HWRM should make sure that the mtu of
6970          * the function does not exceed the mtu of the physical
6971          * port that this function is associated with.
6972          *
6973          * In addition to configuring mtu per function, it is
6974          * possible to configure mtu per transmit ring.
6975          * By default, the mtu of each transmit ring associated
6976          * with a function is equal to the mtu of the function.
6977          * The HWRM should make sure that the mtu of each transmit
6978          * ring that is assigned to a function has a valid mtu.
6979          */
6980         uint16_t        mtu;
6981         /*
6982          * The maximum receive unit of the function.
6983          * The HWRM should make sure that the mru of
6984          * the function does not exceed the mru of the physical
6985          * port that this function is associated with.
6986          *
6987          * In addition to configuring mru per function, it is
6988          * possible to configure mru per vnic.
6989          * By default, the mru of each vnic associated
6990          * with a function is equal to the mru of the function.
6991          * The HWRM should make sure that the mru of each vnic
6992          * that is assigned to a function has a valid mru.
6993          */
6994         uint16_t        mru;
6995         /*
6996          * The number of RSS/COS contexts requested for the
6997          * function.
6998          */
6999         uint16_t        num_rsscos_ctxs;
7000         /*
7001          * The number of completion rings requested for the
7002          * function. This does not include the rings allocated
7003          * to any children functions if any.
7004          */
7005         uint16_t        num_cmpl_rings;
7006         /*
7007          * The number of transmit rings requested for the function.
7008          * This does not include the rings allocated to any
7009          * children functions if any.
7010          */
7011         uint16_t        num_tx_rings;
7012         /*
7013          * The number of receive rings requested for the function.
7014          * This does not include the rings allocated
7015          * to any children functions if any.
7016          */
7017         uint16_t        num_rx_rings;
7018         /* The requested number of L2 contexts for the function. */
7019         uint16_t        num_l2_ctxs;
7020         /* The requested number of vnics for the function. */
7021         uint16_t        num_vnics;
7022         /* The requested number of statistic contexts for the function. */
7023         uint16_t        num_stat_ctxs;
7024         /*
7025          * The number of HW ring groups that should
7026          * be reserved for this function.
7027          */
7028         uint16_t        num_hw_ring_grps;
7029         /* The default MAC address for the function being configured. */
7030         uint8_t dflt_mac_addr[6];
7031         /*
7032          * The default VLAN for the function being configured.
7033          * This field's format is same as 802.1Q Tag's
7034          * Tag Control Information (TCI) format that includes both
7035          * Priority Code Point (PCP) and VLAN Identifier (VID).
7036          */
7037         uint16_t        dflt_vlan;
7038         /*
7039          * The default IP address for the function being configured.
7040          * This address is only used in enabling source property check.
7041          */
7042         uint32_t        dflt_ip_addr[4];
7043         /*
7044          * Minimum BW allocated for this function.
7045          * The HWRM will translate this value into byte counter and
7046          * time interval used for the scheduler inside the device.
7047          */
7048         uint32_t        min_bw;
7049         /* The bandwidth value. */
7050         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
7051                 UINT32_C(0xfffffff)
7052         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
7053         /* The granularity of the value (bits or bytes). */
7054         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
7055                 UINT32_C(0x10000000)
7056         /* Value is in bits. */
7057         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
7058                 (UINT32_C(0x0) << 28)
7059         /* Value is in bytes. */
7060         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
7061                 (UINT32_C(0x1) << 28)
7062         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
7063                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
7064         /* bw_value_unit is 3 b */
7065         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
7066                 UINT32_C(0xe0000000)
7067         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
7068         /* Value is in Mb or MB (base 10). */
7069         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
7070                 (UINT32_C(0x0) << 29)
7071         /* Value is in Kb or KB (base 10). */
7072         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
7073                 (UINT32_C(0x2) << 29)
7074         /* Value is in bits or bytes. */
7075         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
7076                 (UINT32_C(0x4) << 29)
7077         /* Value is in Gb or GB (base 10). */
7078         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
7079                 (UINT32_C(0x6) << 29)
7080         /* Value is in 1/100th of a percentage of total bandwidth. */
7081         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
7082                 (UINT32_C(0x1) << 29)
7083         /* Invalid unit */
7084         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
7085                 (UINT32_C(0x7) << 29)
7086         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
7087                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
7088         /*
7089          * Maximum BW allocated for this function.
7090          * The HWRM will translate this value into byte counter and
7091          * time interval used for the scheduler inside the device.
7092          */
7093         uint32_t        max_bw;
7094         /* The bandwidth value. */
7095         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
7096                 UINT32_C(0xfffffff)
7097         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
7098         /* The granularity of the value (bits or bytes). */
7099         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
7100                 UINT32_C(0x10000000)
7101         /* Value is in bits. */
7102         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
7103                 (UINT32_C(0x0) << 28)
7104         /* Value is in bytes. */
7105         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
7106                 (UINT32_C(0x1) << 28)
7107         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
7108                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
7109         /* bw_value_unit is 3 b */
7110         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
7111                 UINT32_C(0xe0000000)
7112         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
7113         /* Value is in Mb or MB (base 10). */
7114         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
7115                 (UINT32_C(0x0) << 29)
7116         /* Value is in Kb or KB (base 10). */
7117         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
7118                 (UINT32_C(0x2) << 29)
7119         /* Value is in bits or bytes. */
7120         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
7121                 (UINT32_C(0x4) << 29)
7122         /* Value is in Gb or GB (base 10). */
7123         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
7124                 (UINT32_C(0x6) << 29)
7125         /* Value is in 1/100th of a percentage of total bandwidth. */
7126         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
7127                 (UINT32_C(0x1) << 29)
7128         /* Invalid unit */
7129         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
7130                 (UINT32_C(0x7) << 29)
7131         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
7132                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
7133         /*
7134          * ID of the target completion ring for receiving asynchronous
7135          * event completions. If this field is not valid, then the
7136          * HWRM shall use the default completion ring of the function
7137          * that is being configured as the target completion ring for
7138          * providing any asynchronous event completions for that
7139          * function.
7140          * If this field is valid, then the HWRM shall use the
7141          * completion ring identified by this ID as the target
7142          * completion ring for providing any asynchronous event
7143          * completions for the function that is being configured.
7144          */
7145         uint16_t        async_event_cr;
7146         /* VLAN Anti-spoofing mode. */
7147         uint8_t vlan_antispoof_mode;
7148         /* No VLAN anti-spoofing checks are enabled */
7149         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
7150                 UINT32_C(0x0)
7151         /* Validate VLAN against the configured VLAN(s) */
7152         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
7153                 UINT32_C(0x1)
7154         /* Insert VLAN if it does not exist, otherwise discard */
7155         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
7156                 UINT32_C(0x2)
7157         /* Insert VLAN if it does not exist, override VLAN if it exists */
7158         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
7159                 UINT32_C(0x3)
7160         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
7161                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
7162         /*
7163          * This bit field defines VLAN PRIs that are allowed on
7164          * this function.
7165          * If nth bit is set, then VLAN PRI n is allowed on this
7166          * function.
7167          */
7168         uint8_t allowed_vlan_pris;
7169         /*
7170          * The HWRM shall allow a PF driver to change EVB mode for the
7171          * partition it belongs to.
7172          * The HWRM shall not allow a VF driver to change the EVB mode.
7173          * The HWRM shall take into account the switching of EVB mode
7174          * from one to another and reconfigure hardware resources as
7175          * appropriately.
7176          * The switching from VEB to VEPA mode requires
7177          * the disabling of the loopback traffic. Additionally,
7178          * source knock outs are handled differently in VEB and VEPA
7179          * modes.
7180          */
7181         uint8_t evb_mode;
7182         /* No Edge Virtual Bridging (EVB) */
7183         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
7184         /* Virtual Ethernet Bridge (VEB) */
7185         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
7186         /* Virtual Ethernet Port Aggregator (VEPA) */
7187         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
7188         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
7189                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
7190         uint8_t options;
7191         /*
7192          * This value indicates the PCIE device cache line size.
7193          * The cache line size allows the DMA writes to terminate and
7194          * start at the cache boundary.
7195          */
7196         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
7197                 UINT32_C(0x3)
7198         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
7199         /* Cache Line Size 64 bytes */
7200         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
7201                 UINT32_C(0x0)
7202         /* Cache Line Size 128 bytes */
7203         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
7204                 UINT32_C(0x1)
7205         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
7206                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
7207         /* This value is the virtual link admin state setting. */
7208         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
7209                 UINT32_C(0xc)
7210         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
7211         /* Admin state is forced down. */
7212         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
7213                 (UINT32_C(0x0) << 2)
7214         /* Admin state is forced up. */
7215         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
7216                 (UINT32_C(0x1) << 2)
7217         /* Admin state is in auto mode - is to follow the physical link state. */
7218         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
7219                 (UINT32_C(0x2) << 2)
7220         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
7221                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
7222         /* Reserved for future. */
7223         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
7224                 UINT32_C(0xf0)
7225         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
7226         /*
7227          * The number of multicast filters that should
7228          * be reserved for this function on the RX side.
7229          */
7230         uint16_t        num_mcast_filters;
7231 } __attribute__((packed));
7232
7233 /* hwrm_func_cfg_output (size:128b/16B) */
7234 struct hwrm_func_cfg_output {
7235         /* The specific error status for the command. */
7236         uint16_t        error_code;
7237         /* The HWRM command request type. */
7238         uint16_t        req_type;
7239         /* The sequence ID from the original command. */
7240         uint16_t        seq_id;
7241         /* The length of the response data in number of bytes. */
7242         uint16_t        resp_len;
7243         uint8_t unused_0[7];
7244         /*
7245          * This field is used in Output records to indicate that the output
7246          * is completely written to RAM.  This field should be read as '1'
7247          * to indicate that the output has been completely written.
7248          * When writing a command completion or response to an internal processor,
7249          * the order of writes has to be such that this field is written last.
7250          */
7251         uint8_t valid;
7252 } __attribute__((packed));
7253
7254 /********************
7255  * hwrm_func_qstats *
7256  ********************/
7257
7258
7259 /* hwrm_func_qstats_input (size:192b/24B) */
7260 struct hwrm_func_qstats_input {
7261         /* The HWRM command request type. */
7262         uint16_t        req_type;
7263         /*
7264          * The completion ring to send the completion event on. This should
7265          * be the NQ ID returned from the `nq_alloc` HWRM command.
7266          */
7267         uint16_t        cmpl_ring;
7268         /*
7269          * The sequence ID is used by the driver for tracking multiple
7270          * commands. This ID is treated as opaque data by the firmware and
7271          * the value is returned in the `hwrm_resp_hdr` upon completion.
7272          */
7273         uint16_t        seq_id;
7274         /*
7275          * The target ID of the command:
7276          * * 0x0-0xFFF8 - The function ID
7277          * * 0xFFF8-0xFFFE - Reserved for internal processors
7278          * * 0xFFFF - HWRM
7279          */
7280         uint16_t        target_id;
7281         /*
7282          * A physical address pointer pointing to a host buffer that the
7283          * command's response data will be written. This can be either a host
7284          * physical address (HPA) or a guest physical address (GPA) and must
7285          * point to a physically contiguous block of memory.
7286          */
7287         uint64_t        resp_addr;
7288         /*
7289          * Function ID of the function that is being queried.
7290          * 0xFF... (All Fs) if the query is for the requesting
7291          * function.
7292          */
7293         uint16_t        fid;
7294         uint8_t unused_0[6];
7295 } __attribute__((packed));
7296
7297 /* hwrm_func_qstats_output (size:1408b/176B) */
7298 struct hwrm_func_qstats_output {
7299         /* The specific error status for the command. */
7300         uint16_t        error_code;
7301         /* The HWRM command request type. */
7302         uint16_t        req_type;
7303         /* The sequence ID from the original command. */
7304         uint16_t        seq_id;
7305         /* The length of the response data in number of bytes. */
7306         uint16_t        resp_len;
7307         /* Number of transmitted unicast packets on the function. */
7308         uint64_t        tx_ucast_pkts;
7309         /* Number of transmitted multicast packets on the function. */
7310         uint64_t        tx_mcast_pkts;
7311         /* Number of transmitted broadcast packets on the function. */
7312         uint64_t        tx_bcast_pkts;
7313         /*
7314          * Number of transmitted packets that were discarded due to
7315          * internal NIC resource problems.  For transmit, this
7316          * can only happen if TMP is configured to allow dropping
7317          * in HOL blocking conditions, which is not a normal
7318          * configuration.
7319          */
7320         uint64_t        tx_discard_pkts;
7321         /*
7322          * Number of dropped packets on transmit path on the function.
7323          * These are packets that have been marked for drop by
7324          * the TE CFA block or are packets that exceeded the
7325          * transmit MTU limit for the function.
7326          */
7327         uint64_t        tx_drop_pkts;
7328         /* Number of transmitted bytes for unicast traffic on the function. */
7329         uint64_t        tx_ucast_bytes;
7330         /* Number of transmitted bytes for multicast traffic on the function. */
7331         uint64_t        tx_mcast_bytes;
7332         /* Number of transmitted bytes for broadcast traffic on the function. */
7333         uint64_t        tx_bcast_bytes;
7334         /* Number of received unicast packets on the function. */
7335         uint64_t        rx_ucast_pkts;
7336         /* Number of received multicast packets on the function. */
7337         uint64_t        rx_mcast_pkts;
7338         /* Number of received broadcast packets on the function. */
7339         uint64_t        rx_bcast_pkts;
7340         /*
7341          * Number of received packets that were discarded on the function
7342          * due to resource limitations.  This can happen for 3 reasons.
7343          * # The BD used for the packet has a bad format.
7344          * # There were no BDs available in the ring for the packet.
7345          * # There were no BDs available on-chip for the packet.
7346          */
7347         uint64_t        rx_discard_pkts;
7348         /*
7349          * Number of dropped packets on received path on the function.
7350          * These are packets that have been marked for drop by the
7351          * RE CFA.
7352          */
7353         uint64_t        rx_drop_pkts;
7354         /* Number of received bytes for unicast traffic on the function. */
7355         uint64_t        rx_ucast_bytes;
7356         /* Number of received bytes for multicast traffic on the function. */
7357         uint64_t        rx_mcast_bytes;
7358         /* Number of received bytes for broadcast traffic on the function. */
7359         uint64_t        rx_bcast_bytes;
7360         /* Number of aggregated unicast packets on the function. */
7361         uint64_t        rx_agg_pkts;
7362         /* Number of aggregated unicast bytes on the function. */
7363         uint64_t        rx_agg_bytes;
7364         /* Number of aggregation events on the function. */
7365         uint64_t        rx_agg_events;
7366         /* Number of aborted aggregations on the function. */
7367         uint64_t        rx_agg_aborts;
7368         uint8_t unused_0[7];
7369         /*
7370          * This field is used in Output records to indicate that the output
7371          * is completely written to RAM.  This field should be read as '1'
7372          * to indicate that the output has been completely written.
7373          * When writing a command completion or response to an internal processor,
7374          * the order of writes has to be such that this field is written last.
7375          */
7376         uint8_t valid;
7377 } __attribute__((packed));
7378
7379 /***********************
7380  * hwrm_func_clr_stats *
7381  ***********************/
7382
7383
7384 /* hwrm_func_clr_stats_input (size:192b/24B) */
7385 struct hwrm_func_clr_stats_input {
7386         /* The HWRM command request type. */
7387         uint16_t        req_type;
7388         /*
7389          * The completion ring to send the completion event on. This should
7390          * be the NQ ID returned from the `nq_alloc` HWRM command.
7391          */
7392         uint16_t        cmpl_ring;
7393         /*
7394          * The sequence ID is used by the driver for tracking multiple
7395          * commands. This ID is treated as opaque data by the firmware and
7396          * the value is returned in the `hwrm_resp_hdr` upon completion.
7397          */
7398         uint16_t        seq_id;
7399         /*
7400          * The target ID of the command:
7401          * * 0x0-0xFFF8 - The function ID
7402          * * 0xFFF8-0xFFFE - Reserved for internal processors
7403          * * 0xFFFF - HWRM
7404          */
7405         uint16_t        target_id;
7406         /*
7407          * A physical address pointer pointing to a host buffer that the
7408          * command's response data will be written. This can be either a host
7409          * physical address (HPA) or a guest physical address (GPA) and must
7410          * point to a physically contiguous block of memory.
7411          */
7412         uint64_t        resp_addr;
7413         /*
7414          * Function ID of the function.
7415          * 0xFF... (All Fs) if the query is for the requesting
7416          * function.
7417          */
7418         uint16_t        fid;
7419         uint8_t unused_0[6];
7420 } __attribute__((packed));
7421
7422 /* hwrm_func_clr_stats_output (size:128b/16B) */
7423 struct hwrm_func_clr_stats_output {
7424         /* The specific error status for the command. */
7425         uint16_t        error_code;
7426         /* The HWRM command request type. */
7427         uint16_t        req_type;
7428         /* The sequence ID from the original command. */
7429         uint16_t        seq_id;
7430         /* The length of the response data in number of bytes. */
7431         uint16_t        resp_len;
7432         uint8_t unused_0[7];
7433         /*
7434          * This field is used in Output records to indicate that the output
7435          * is completely written to RAM.  This field should be read as '1'
7436          * to indicate that the output has been completely written.
7437          * When writing a command completion or response to an internal processor,
7438          * the order of writes has to be such that this field is written last.
7439          */
7440         uint8_t valid;
7441 } __attribute__((packed));
7442
7443 /**************************
7444  * hwrm_func_vf_resc_free *
7445  **************************/
7446
7447
7448 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
7449 struct hwrm_func_vf_resc_free_input {
7450         /* The HWRM command request type. */
7451         uint16_t        req_type;
7452         /*
7453          * The completion ring to send the completion event on. This should
7454          * be the NQ ID returned from the `nq_alloc` HWRM command.
7455          */
7456         uint16_t        cmpl_ring;
7457         /*
7458          * The sequence ID is used by the driver for tracking multiple
7459          * commands. This ID is treated as opaque data by the firmware and
7460          * the value is returned in the `hwrm_resp_hdr` upon completion.
7461          */
7462         uint16_t        seq_id;
7463         /*
7464          * The target ID of the command:
7465          * * 0x0-0xFFF8 - The function ID
7466          * * 0xFFF8-0xFFFE - Reserved for internal processors
7467          * * 0xFFFF - HWRM
7468          */
7469         uint16_t        target_id;
7470         /*
7471          * A physical address pointer pointing to a host buffer that the
7472          * command's response data will be written. This can be either a host
7473          * physical address (HPA) or a guest physical address (GPA) and must
7474          * point to a physically contiguous block of memory.
7475          */
7476         uint64_t        resp_addr;
7477         /*
7478          * This value is used to identify a Virtual Function (VF).
7479          * The scope of VF ID is local within a PF.
7480          */
7481         uint16_t        vf_id;
7482         uint8_t unused_0[6];
7483 } __attribute__((packed));
7484
7485 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
7486 struct hwrm_func_vf_resc_free_output {
7487         /* The specific error status for the command. */
7488         uint16_t        error_code;
7489         /* The HWRM command request type. */
7490         uint16_t        req_type;
7491         /* The sequence ID from the original command. */
7492         uint16_t        seq_id;
7493         /* The length of the response data in number of bytes. */
7494         uint16_t        resp_len;
7495         uint8_t unused_0[7];
7496         /*
7497          * This field is used in Output records to indicate that the output
7498          * is completely written to RAM.  This field should be read as '1'
7499          * to indicate that the output has been completely written.
7500          * When writing a command completion or response to an internal processor,
7501          * the order of writes has to be such that this field is written last.
7502          */
7503         uint8_t valid;
7504 } __attribute__((packed));
7505
7506 /**********************
7507  * hwrm_func_drv_rgtr *
7508  **********************/
7509
7510
7511 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
7512 struct hwrm_func_drv_rgtr_input {
7513         /* The HWRM command request type. */
7514         uint16_t        req_type;
7515         /*
7516          * The completion ring to send the completion event on. This should
7517          * be the NQ ID returned from the `nq_alloc` HWRM command.
7518          */
7519         uint16_t        cmpl_ring;
7520         /*
7521          * The sequence ID is used by the driver for tracking multiple
7522          * commands. This ID is treated as opaque data by the firmware and
7523          * the value is returned in the `hwrm_resp_hdr` upon completion.
7524          */
7525         uint16_t        seq_id;
7526         /*
7527          * The target ID of the command:
7528          * * 0x0-0xFFF8 - The function ID
7529          * * 0xFFF8-0xFFFE - Reserved for internal processors
7530          * * 0xFFFF - HWRM
7531          */
7532         uint16_t        target_id;
7533         /*
7534          * A physical address pointer pointing to a host buffer that the
7535          * command's response data will be written. This can be either a host
7536          * physical address (HPA) or a guest physical address (GPA) and must
7537          * point to a physically contiguous block of memory.
7538          */
7539         uint64_t        resp_addr;
7540         uint32_t        flags;
7541         /*
7542          * When this bit is '1', the function driver is requesting
7543          * all requests from its children VF drivers to be
7544          * forwarded to itself.
7545          * This flag can only be set by the PF driver.
7546          * If a VF driver sets this flag, it should be ignored
7547          * by the HWRM.
7548          */
7549         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
7550                 UINT32_C(0x1)
7551         /*
7552          * When this bit is '1', the function is requesting none of
7553          * the requests from its children VF drivers to be
7554          * forwarded to itself.
7555          * This flag can only be set by the PF driver.
7556          * If a VF driver sets this flag, it should be ignored
7557          * by the HWRM.
7558          */
7559         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
7560                 UINT32_C(0x2)
7561         /*
7562          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
7563          * fields shall be ignored and ver_maj, ver_min, ver_upd
7564          * and ver_patch shall be used for the driver version information.
7565          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
7566          * fields shall be used for the driver version information and
7567          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
7568          */
7569         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
7570                 UINT32_C(0x4)
7571         /*
7572          * When this bit is '1', the function is indicating support of
7573          * 64bit flow handle.  The firmware that only supports 64bit flow
7574          * handle should check this bit before allowing processing of
7575          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
7576          * with 64bit flow handle support can only be compatible with drivers
7577          * that support 64bit flow handle. The legacy drivers that don't support
7578          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
7579          * running with new firmware that only supports 64bit flow handle. The new
7580          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
7581          * status to the legacy driver when encounters these commands.
7582          */
7583         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
7584                 UINT32_C(0x8)
7585         /*
7586          * When this bit is '1', the function is indicating support of
7587          * Hot Reset. The driver interface will destroy the resources,
7588          * unregister the function and register again up on receiving
7589          * the RESET_NOTIFY Async notification from the core firmware.
7590          * The core firmware will this use flag and trigger the Hot Reset
7591          * process only if all the registered driver instances are capable
7592          * of this support.
7593          */
7594         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
7595                 UINT32_C(0x10)
7596         uint32_t        enables;
7597         /*
7598          * This bit must be '1' for the os_type field to be
7599          * configured.
7600          */
7601         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
7602                 UINT32_C(0x1)
7603         /*
7604          * This bit must be '1' for the ver field to be
7605          * configured.
7606          */
7607         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
7608                 UINT32_C(0x2)
7609         /*
7610          * This bit must be '1' for the timestamp field to be
7611          * configured.
7612          */
7613         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
7614                 UINT32_C(0x4)
7615         /*
7616          * This bit must be '1' for the vf_req_fwd field to be
7617          * configured.
7618          */
7619         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
7620                 UINT32_C(0x8)
7621         /*
7622          * This bit must be '1' for the async_event_fwd field to be
7623          * configured.
7624          */
7625         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
7626                 UINT32_C(0x10)
7627         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
7628         uint16_t        os_type;
7629         /* Unknown */
7630         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
7631         /* Other OS not listed below. */
7632         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
7633         /* MSDOS OS. */
7634         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
7635         /* Windows OS. */
7636         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
7637         /* Solaris OS. */
7638         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
7639         /* Linux OS. */
7640         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
7641         /* FreeBSD OS. */
7642         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
7643         /* VMware ESXi OS. */
7644         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
7645         /* Microsoft Windows 8 64-bit OS. */
7646         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
7647         /* Microsoft Windows Server 2012 R2 OS. */
7648         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
7649         /* UEFI driver. */
7650         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
7651         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
7652                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
7653         /* This is the 8bit major version of the driver. */
7654         uint8_t ver_maj_8b;
7655         /* This is the 8bit minor version of the driver. */
7656         uint8_t ver_min_8b;
7657         /* This is the 8bit update version of the driver. */
7658         uint8_t ver_upd_8b;
7659         uint8_t unused_0[3];
7660         /*
7661          * This is a 32-bit timestamp provided by the driver for
7662          * keep alive.
7663          * The timestamp is in multiples of 1ms.
7664          */
7665         uint32_t        timestamp;
7666         uint8_t unused_1[4];
7667         /*
7668          * This is a 256-bit bit mask provided by the PF driver for
7669          * letting the HWRM know what commands issued by the VF driver
7670          * to the HWRM should be forwarded to the PF driver.
7671          * Nth bit refers to the Nth req_type.
7672          *
7673          * Setting Nth bit to 1 indicates that requests from the
7674          * VF driver with req_type equal to N shall be forwarded to
7675          * the parent PF driver.
7676          *
7677          * This field is not valid for the VF driver.
7678          */
7679         uint32_t        vf_req_fwd[8];
7680         /*
7681          * This is a 256-bit bit mask provided by the function driver
7682          * (PF or VF driver) to indicate the list of asynchronous event
7683          * completions to be forwarded.
7684          *
7685          * Nth bit refers to the Nth event_id.
7686          *
7687          * Setting Nth bit to 1 by the function driver shall result in
7688          * the HWRM forwarding asynchronous event completion with
7689          * event_id equal to N.
7690          *
7691          * If all bits are set to 0 (value of 0), then the HWRM shall
7692          * not forward any asynchronous event completion to this
7693          * function driver.
7694          */
7695         uint32_t        async_event_fwd[8];
7696         /* This is the 16bit major version of the driver. */
7697         uint16_t        ver_maj;
7698         /* This is the 16bit minor version of the driver. */
7699         uint16_t        ver_min;
7700         /* This is the 16bit update version of the driver. */
7701         uint16_t        ver_upd;
7702         /* This is the 16bit patch version of the driver. */
7703         uint16_t        ver_patch;
7704 } __attribute__((packed));
7705
7706 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
7707 struct hwrm_func_drv_rgtr_output {
7708         /* The specific error status for the command. */
7709         uint16_t        error_code;
7710         /* The HWRM command request type. */
7711         uint16_t        req_type;
7712         /* The sequence ID from the original command. */
7713         uint16_t        seq_id;
7714         /* The length of the response data in number of bytes. */
7715         uint16_t        resp_len;
7716         uint32_t        flags;
7717         /*
7718          * When this bit is '1', it indicates that the
7719          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
7720          */
7721         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
7722                 UINT32_C(0x1)
7723         uint8_t unused_0[3];
7724         /*
7725          * This field is used in Output records to indicate that the output
7726          * is completely written to RAM.  This field should be read as '1'
7727          * to indicate that the output has been completely written.
7728          * When writing a command completion or response to an internal processor,
7729          * the order of writes has to be such that this field is written last.
7730          */
7731         uint8_t valid;
7732 } __attribute__((packed));
7733
7734 /************************
7735  * hwrm_func_drv_unrgtr *
7736  ************************/
7737
7738
7739 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
7740 struct hwrm_func_drv_unrgtr_input {
7741         /* The HWRM command request type. */
7742         uint16_t        req_type;
7743         /*
7744          * The completion ring to send the completion event on. This should
7745          * be the NQ ID returned from the `nq_alloc` HWRM command.
7746          */
7747         uint16_t        cmpl_ring;
7748         /*
7749          * The sequence ID is used by the driver for tracking multiple
7750          * commands. This ID is treated as opaque data by the firmware and
7751          * the value is returned in the `hwrm_resp_hdr` upon completion.
7752          */
7753         uint16_t        seq_id;
7754         /*
7755          * The target ID of the command:
7756          * * 0x0-0xFFF8 - The function ID
7757          * * 0xFFF8-0xFFFE - Reserved for internal processors
7758          * * 0xFFFF - HWRM
7759          */
7760         uint16_t        target_id;
7761         /*
7762          * A physical address pointer pointing to a host buffer that the
7763          * command's response data will be written. This can be either a host
7764          * physical address (HPA) or a guest physical address (GPA) and must
7765          * point to a physically contiguous block of memory.
7766          */
7767         uint64_t        resp_addr;
7768         uint32_t        flags;
7769         /*
7770          * When this bit is '1', the function driver is notifying
7771          * the HWRM to prepare for the shutdown.
7772          */
7773         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
7774                 UINT32_C(0x1)
7775         uint8_t unused_0[4];
7776 } __attribute__((packed));
7777
7778 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
7779 struct hwrm_func_drv_unrgtr_output {
7780         /* The specific error status for the command. */
7781         uint16_t        error_code;
7782         /* The HWRM command request type. */
7783         uint16_t        req_type;
7784         /* The sequence ID from the original command. */
7785         uint16_t        seq_id;
7786         /* The length of the response data in number of bytes. */
7787         uint16_t        resp_len;
7788         uint8_t unused_0[7];
7789         /*
7790          * This field is used in Output records to indicate that the output
7791          * is completely written to RAM.  This field should be read as '1'
7792          * to indicate that the output has been completely written.
7793          * When writing a command completion or response to an internal processor,
7794          * the order of writes has to be such that this field is written last.
7795          */
7796         uint8_t valid;
7797 } __attribute__((packed));
7798
7799 /**********************
7800  * hwrm_func_buf_rgtr *
7801  **********************/
7802
7803
7804 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
7805 struct hwrm_func_buf_rgtr_input {
7806         /* The HWRM command request type. */
7807         uint16_t        req_type;
7808         /*
7809          * The completion ring to send the completion event on. This should
7810          * be the NQ ID returned from the `nq_alloc` HWRM command.
7811          */
7812         uint16_t        cmpl_ring;
7813         /*
7814          * The sequence ID is used by the driver for tracking multiple
7815          * commands. This ID is treated as opaque data by the firmware and
7816          * the value is returned in the `hwrm_resp_hdr` upon completion.
7817          */
7818         uint16_t        seq_id;
7819         /*
7820          * The target ID of the command:
7821          * * 0x0-0xFFF8 - The function ID
7822          * * 0xFFF8-0xFFFE - Reserved for internal processors
7823          * * 0xFFFF - HWRM
7824          */
7825         uint16_t        target_id;
7826         /*
7827          * A physical address pointer pointing to a host buffer that the
7828          * command's response data will be written. This can be either a host
7829          * physical address (HPA) or a guest physical address (GPA) and must
7830          * point to a physically contiguous block of memory.
7831          */
7832         uint64_t        resp_addr;
7833         uint32_t        enables;
7834         /*
7835          * This bit must be '1' for the vf_id field to be
7836          * configured.
7837          */
7838         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
7839         /*
7840          * This bit must be '1' for the err_buf_addr field to be
7841          * configured.
7842          */
7843         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
7844         /*
7845          * This value is used to identify a Virtual Function (VF).
7846          * The scope of VF ID is local within a PF.
7847          */
7848         uint16_t        vf_id;
7849         /*
7850          * This field represents the number of pages used for request
7851          * buffer(s).
7852          */
7853         uint16_t        req_buf_num_pages;
7854         /*
7855          * This field represents the page size used for request
7856          * buffer(s).
7857          */
7858         uint16_t        req_buf_page_size;
7859         /* 16 bytes */
7860         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
7861         /* 4 Kbytes */
7862         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
7863         /* 8 Kbytes */
7864         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
7865         /* 64 Kbytes */
7866         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
7867         /* 2 Mbytes */
7868         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
7869         /* 4 Mbytes */
7870         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
7871         /* 1 Gbytes */
7872         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
7873         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
7874                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
7875         /* The length of the request buffer per VF in bytes. */
7876         uint16_t        req_buf_len;
7877         /* The length of the response buffer in bytes. */
7878         uint16_t        resp_buf_len;
7879         uint8_t unused_0[2];
7880         /* This field represents the page address of page #0. */
7881         uint64_t        req_buf_page_addr0;
7882         /* This field represents the page address of page #1. */
7883         uint64_t        req_buf_page_addr1;
7884         /* This field represents the page address of page #2. */
7885         uint64_t        req_buf_page_addr2;
7886         /* This field represents the page address of page #3. */
7887         uint64_t        req_buf_page_addr3;
7888         /* This field represents the page address of page #4. */
7889         uint64_t        req_buf_page_addr4;
7890         /* This field represents the page address of page #5. */
7891         uint64_t        req_buf_page_addr5;
7892         /* This field represents the page address of page #6. */
7893         uint64_t        req_buf_page_addr6;
7894         /* This field represents the page address of page #7. */
7895         uint64_t        req_buf_page_addr7;
7896         /* This field represents the page address of page #8. */
7897         uint64_t        req_buf_page_addr8;
7898         /* This field represents the page address of page #9. */
7899         uint64_t        req_buf_page_addr9;
7900         /*
7901          * This field is used to receive the error reporting from
7902          * the chipset. Only applicable for PFs.
7903          */
7904         uint64_t        error_buf_addr;
7905         /*
7906          * This field is used to receive the response forwarded by the
7907          * HWRM.
7908          */
7909         uint64_t        resp_buf_addr;
7910 } __attribute__((packed));
7911
7912 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
7913 struct hwrm_func_buf_rgtr_output {
7914         /* The specific error status for the command. */
7915         uint16_t        error_code;
7916         /* The HWRM command request type. */
7917         uint16_t        req_type;
7918         /* The sequence ID from the original command. */
7919         uint16_t        seq_id;
7920         /* The length of the response data in number of bytes. */
7921         uint16_t        resp_len;
7922         uint8_t unused_0[7];
7923         /*
7924          * This field is used in Output records to indicate that the output
7925          * is completely written to RAM.  This field should be read as '1'
7926          * to indicate that the output has been completely written.
7927          * When writing a command completion or response to an internal processor,
7928          * the order of writes has to be such that this field is written last.
7929          */
7930         uint8_t valid;
7931 } __attribute__((packed));
7932
7933 /************************
7934  * hwrm_func_buf_unrgtr *
7935  ************************/
7936
7937
7938 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
7939 struct hwrm_func_buf_unrgtr_input {
7940         /* The HWRM command request type. */
7941         uint16_t        req_type;
7942         /*
7943          * The completion ring to send the completion event on. This should
7944          * be the NQ ID returned from the `nq_alloc` HWRM command.
7945          */
7946         uint16_t        cmpl_ring;
7947         /*
7948          * The sequence ID is used by the driver for tracking multiple
7949          * commands. This ID is treated as opaque data by the firmware and
7950          * the value is returned in the `hwrm_resp_hdr` upon completion.
7951          */
7952         uint16_t        seq_id;
7953         /*
7954          * The target ID of the command:
7955          * * 0x0-0xFFF8 - The function ID
7956          * * 0xFFF8-0xFFFE - Reserved for internal processors
7957          * * 0xFFFF - HWRM
7958          */
7959         uint16_t        target_id;
7960         /*
7961          * A physical address pointer pointing to a host buffer that the
7962          * command's response data will be written. This can be either a host
7963          * physical address (HPA) or a guest physical address (GPA) and must
7964          * point to a physically contiguous block of memory.
7965          */
7966         uint64_t        resp_addr;
7967         uint32_t        enables;
7968         /*
7969          * This bit must be '1' for the vf_id field to be
7970          * configured.
7971          */
7972         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
7973         /*
7974          * This value is used to identify a Virtual Function (VF).
7975          * The scope of VF ID is local within a PF.
7976          */
7977         uint16_t        vf_id;
7978         uint8_t unused_0[2];
7979 } __attribute__((packed));
7980
7981 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
7982 struct hwrm_func_buf_unrgtr_output {
7983         /* The specific error status for the command. */
7984         uint16_t        error_code;
7985         /* The HWRM command request type. */
7986         uint16_t        req_type;
7987         /* The sequence ID from the original command. */
7988         uint16_t        seq_id;
7989         /* The length of the response data in number of bytes. */
7990         uint16_t        resp_len;
7991         uint8_t unused_0[7];
7992         /*
7993          * This field is used in Output records to indicate that the output
7994          * is completely written to RAM.  This field should be read as '1'
7995          * to indicate that the output has been completely written.
7996          * When writing a command completion or response to an internal processor,
7997          * the order of writes has to be such that this field is written last.
7998          */
7999         uint8_t valid;
8000 } __attribute__((packed));
8001
8002 /**********************
8003  * hwrm_func_drv_qver *
8004  **********************/
8005
8006
8007 /* hwrm_func_drv_qver_input (size:192b/24B) */
8008 struct hwrm_func_drv_qver_input {
8009         /* The HWRM command request type. */
8010         uint16_t        req_type;
8011         /*
8012          * The completion ring to send the completion event on. This should
8013          * be the NQ ID returned from the `nq_alloc` HWRM command.
8014          */
8015         uint16_t        cmpl_ring;
8016         /*
8017          * The sequence ID is used by the driver for tracking multiple
8018          * commands. This ID is treated as opaque data by the firmware and
8019          * the value is returned in the `hwrm_resp_hdr` upon completion.
8020          */
8021         uint16_t        seq_id;
8022         /*
8023          * The target ID of the command:
8024          * * 0x0-0xFFF8 - The function ID
8025          * * 0xFFF8-0xFFFE - Reserved for internal processors
8026          * * 0xFFFF - HWRM
8027          */
8028         uint16_t        target_id;
8029         /*
8030          * A physical address pointer pointing to a host buffer that the
8031          * command's response data will be written. This can be either a host
8032          * physical address (HPA) or a guest physical address (GPA) and must
8033          * point to a physically contiguous block of memory.
8034          */
8035         uint64_t        resp_addr;
8036         /* Reserved for future use. */
8037         uint32_t        reserved;
8038         /*
8039          * Function ID of the function that is being queried.
8040          * 0xFF... (All Fs) if the query is for the requesting
8041          * function.
8042          */
8043         uint16_t        fid;
8044         uint8_t unused_0[2];
8045 } __attribute__((packed));
8046
8047 /* hwrm_func_drv_qver_output (size:256b/32B) */
8048 struct hwrm_func_drv_qver_output {
8049         /* The specific error status for the command. */
8050         uint16_t        error_code;
8051         /* The HWRM command request type. */
8052         uint16_t        req_type;
8053         /* The sequence ID from the original command. */
8054         uint16_t        seq_id;
8055         /* The length of the response data in number of bytes. */
8056         uint16_t        resp_len;
8057         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
8058         uint16_t        os_type;
8059         /* Unknown */
8060         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
8061         /* Other OS not listed below. */
8062         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
8063         /* MSDOS OS. */
8064         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
8065         /* Windows OS. */
8066         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
8067         /* Solaris OS. */
8068         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
8069         /* Linux OS. */
8070         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
8071         /* FreeBSD OS. */
8072         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
8073         /* VMware ESXi OS. */
8074         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
8075         /* Microsoft Windows 8 64-bit OS. */
8076         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
8077         /* Microsoft Windows Server 2012 R2 OS. */
8078         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
8079         /* UEFI driver. */
8080         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
8081         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
8082                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
8083         /* This is the 8bit major version of the driver. */
8084         uint8_t ver_maj_8b;
8085         /* This is the 8bit minor version of the driver. */
8086         uint8_t ver_min_8b;
8087         /* This is the 8bit update version of the driver. */
8088         uint8_t ver_upd_8b;
8089         uint8_t unused_0[3];
8090         /* This is the 16bit major version of the driver. */
8091         uint16_t        ver_maj;
8092         /* This is the 16bit minor version of the driver. */
8093         uint16_t        ver_min;
8094         /* This is the 16bit update version of the driver. */
8095         uint16_t        ver_upd;
8096         /* This is the 16bit patch version of the driver. */
8097         uint16_t        ver_patch;
8098         uint8_t unused_1[7];
8099         /*
8100          * This field is used in Output records to indicate that the output
8101          * is completely written to RAM.  This field should be read as '1'
8102          * to indicate that the output has been completely written.
8103          * When writing a command completion or response to an internal processor,
8104          * the order of writes has to be such that this field is written last.
8105          */
8106         uint8_t valid;
8107 } __attribute__((packed));
8108
8109 /****************************
8110  * hwrm_func_resource_qcaps *
8111  ****************************/
8112
8113
8114 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
8115 struct hwrm_func_resource_qcaps_input {
8116         /* The HWRM command request type. */
8117         uint16_t        req_type;
8118         /*
8119          * The completion ring to send the completion event on. This should
8120          * be the NQ ID returned from the `nq_alloc` HWRM command.
8121          */
8122         uint16_t        cmpl_ring;
8123         /*
8124          * The sequence ID is used by the driver for tracking multiple
8125          * commands. This ID is treated as opaque data by the firmware and
8126          * the value is returned in the `hwrm_resp_hdr` upon completion.
8127          */
8128         uint16_t        seq_id;
8129         /*
8130          * The target ID of the command:
8131          * * 0x0-0xFFF8 - The function ID
8132          * * 0xFFF8-0xFFFE - Reserved for internal processors
8133          * * 0xFFFF - HWRM
8134          */
8135         uint16_t        target_id;
8136         /*
8137          * A physical address pointer pointing to a host buffer that the
8138          * command's response data will be written. This can be either a host
8139          * physical address (HPA) or a guest physical address (GPA) and must
8140          * point to a physically contiguous block of memory.
8141          */
8142         uint64_t        resp_addr;
8143         /*
8144          * Function ID of the function that is being queried.
8145          * 0xFF... (All Fs) if the query is for the requesting
8146          * function.
8147          */
8148         uint16_t        fid;
8149         uint8_t unused_0[6];
8150 } __attribute__((packed));
8151
8152 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
8153 struct hwrm_func_resource_qcaps_output {
8154         /* The specific error status for the command. */
8155         uint16_t        error_code;
8156         /* The HWRM command request type. */
8157         uint16_t        req_type;
8158         /* The sequence ID from the original command. */
8159         uint16_t        seq_id;
8160         /* The length of the response data in number of bytes. */
8161         uint16_t        resp_len;
8162         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
8163         uint16_t        max_vfs;
8164         /* Maximum guaranteed number of MSI-X vectors supported by function */
8165         uint16_t        max_msix;
8166         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
8167         uint16_t        vf_reservation_strategy;
8168         /* The PF driver should evenly divide its remaining resources among all VFs. */
8169         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
8170                 UINT32_C(0x0)
8171         /* The PF driver should only reserve minimal resources for each VF. */
8172         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
8173                 UINT32_C(0x1)
8174         /*
8175          * The PF driver should not reserve any resources for each VF until the
8176          * the VF interface is brought up.
8177          */
8178         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
8179                 UINT32_C(0x2)
8180         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
8181                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
8182         /* Minimum guaranteed number of RSS/COS contexts */
8183         uint16_t        min_rsscos_ctx;
8184         /* Maximum non-guaranteed number of RSS/COS contexts */
8185         uint16_t        max_rsscos_ctx;
8186         /* Minimum guaranteed number of completion rings */
8187         uint16_t        min_cmpl_rings;
8188         /* Maximum non-guaranteed number of completion rings */
8189         uint16_t        max_cmpl_rings;
8190         /* Minimum guaranteed number of transmit rings */
8191         uint16_t        min_tx_rings;
8192         /* Maximum non-guaranteed number of transmit rings */
8193         uint16_t        max_tx_rings;
8194         /* Minimum guaranteed number of receive rings */
8195         uint16_t        min_rx_rings;
8196         /* Maximum non-guaranteed number of receive rings */
8197         uint16_t        max_rx_rings;
8198         /* Minimum guaranteed number of L2 contexts */
8199         uint16_t        min_l2_ctxs;
8200         /* Maximum non-guaranteed number of L2 contexts */
8201         uint16_t        max_l2_ctxs;
8202         /* Minimum guaranteed number of VNICs */
8203         uint16_t        min_vnics;
8204         /* Maximum non-guaranteed number of VNICs */
8205         uint16_t        max_vnics;
8206         /* Minimum guaranteed number of statistic contexts */
8207         uint16_t        min_stat_ctx;
8208         /* Maximum non-guaranteed number of statistic contexts */
8209         uint16_t        max_stat_ctx;
8210         /* Minimum guaranteed number of ring groups */
8211         uint16_t        min_hw_ring_grps;
8212         /* Maximum non-guaranteed number of ring groups */
8213         uint16_t        max_hw_ring_grps;
8214         /*
8215          * Maximum number of inputs into the transmit scheduler for this function.
8216          * The number of TX rings assigned to the function cannot exceed this value.
8217          */
8218         uint16_t        max_tx_scheduler_inputs;
8219         uint16_t        flags;
8220         /*
8221          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
8222          * feature to reserve all minimum resources when minimum >= 1, otherwise
8223          * returns an error.
8224          */
8225         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
8226                 UINT32_C(0x1)
8227         uint8_t unused_0[5];
8228         /*
8229          * This field is used in Output records to indicate that the output
8230          * is completely written to RAM.  This field should be read as '1'
8231          * to indicate that the output has been completely written.
8232          * When writing a command completion or response to an internal processor,
8233          * the order of writes has to be such that this field is written last.
8234          */
8235         uint8_t valid;
8236 } __attribute__((packed));
8237
8238 /*********************************
8239  * hwrm_func_backing_store_qcaps *
8240  *********************************/
8241
8242
8243 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
8244 struct hwrm_func_backing_store_qcaps_input {
8245         /* The HWRM command request type. */
8246         uint16_t        req_type;
8247         /*
8248          * The completion ring to send the completion event on. This should
8249          * be the NQ ID returned from the `nq_alloc` HWRM command.
8250          */
8251         uint16_t        cmpl_ring;
8252         /*
8253          * The sequence ID is used by the driver for tracking multiple
8254          * commands. This ID is treated as opaque data by the firmware and
8255          * the value is returned in the `hwrm_resp_hdr` upon completion.
8256          */
8257         uint16_t        seq_id;
8258         /*
8259          * The target ID of the command:
8260          * * 0x0-0xFFF8 - The function ID
8261          * * 0xFFF8-0xFFFE - Reserved for internal processors
8262          * * 0xFFFF - HWRM
8263          */
8264         uint16_t        target_id;
8265         /*
8266          * A physical address pointer pointing to a host buffer that the
8267          * command's response data will be written. This can be either a host
8268          * physical address (HPA) or a guest physical address (GPA) and must
8269          * point to a physically contiguous block of memory.
8270          */
8271         uint64_t        resp_addr;
8272 } __attribute__((packed));
8273
8274 /* hwrm_func_backing_store_qcaps_output (size:576b/72B) */
8275 struct hwrm_func_backing_store_qcaps_output {
8276         /* The specific error status for the command. */
8277         uint16_t        error_code;
8278         /* The HWRM command request type. */
8279         uint16_t        req_type;
8280         /* The sequence ID from the original command. */
8281         uint16_t        seq_id;
8282         /* The length of the response data in number of bytes. */
8283         uint16_t        resp_len;
8284         /* Maximum number of QP context entries supported for this function. */
8285         uint32_t        qp_max_entries;
8286         /*
8287          * Minimum number of QP context entries that are needed to be reserved
8288          * for QP1 for the PF and its VFs. PF drivers must allocate at least
8289          * this many QP context entries, even if RoCE will not be used.
8290          */
8291         uint16_t        qp_min_qp1_entries;
8292         /* Maximum number of QP context entries that can be used for L2. */
8293         uint16_t        qp_max_l2_entries;
8294         /* Number of bytes that must be allocated for each context entry. */
8295         uint16_t        qp_entry_size;
8296         /* Maximum number of SRQ context entries that can be used for L2. */
8297         uint16_t        srq_max_l2_entries;
8298         /* Maximum number of SRQ context entries supported for this function. */
8299         uint32_t        srq_max_entries;
8300         /* Number of bytes that must be allocated for each context entry. */
8301         uint16_t        srq_entry_size;
8302         /* Maximum number of CQ context entries that can be used for L2. */
8303         uint16_t        cq_max_l2_entries;
8304         /* Maximum number of CQ context entries supported for this function. */
8305         uint32_t        cq_max_entries;
8306         /* Number of bytes that must be allocated for each context entry. */
8307         uint16_t        cq_entry_size;
8308         /* Maximum number of VNIC context entries supported for this function. */
8309         uint16_t        vnic_max_vnic_entries;
8310         /* Maximum number of Ring table context entries supported for this function. */
8311         uint16_t        vnic_max_ring_table_entries;
8312         /* Number of bytes that must be allocated for each context entry. */
8313         uint16_t        vnic_entry_size;
8314         /* Maximum number of statistic context entries supported for this function. */
8315         uint32_t        stat_max_entries;
8316         /* Number of bytes that must be allocated for each context entry. */
8317         uint16_t        stat_entry_size;
8318         /* Number of bytes that must be allocated for each context entry. */
8319         uint16_t        tqm_entry_size;
8320         /* Minimum number of TQM context entries required per ring. */
8321         uint32_t        tqm_min_entries_per_ring;
8322         /*
8323          * Maximum number of TQM context entries supported per ring. This is
8324          * actually a recommended TQM queue size based on worst case usage of
8325          * the TQM queue.
8326          *
8327          * TQM fastpath rings should be sized large enough to accommodate the
8328          * maximum number of QPs (either L2 or RoCE, or both if shared)
8329          * that can be enqueued to the TQM ring.
8330          *
8331          * TQM slowpath rings should be sized as follows:
8332          *
8333          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
8334          *
8335          * Where:
8336          *   num_vnics is the number of VNICs allocated in the VNIC backing store
8337          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
8338          *   num_roce_qps is the number of RoCE QPs in the QP backing store
8339          *   tqm_min_size is tqm_min_entries_per_ring reported by
8340          *     HWRM_FUNC_BACKING_STORE_QCAPS
8341          *
8342          * Note that TQM ring sizes cannot be extended while the system is
8343          * operational. If a PF driver needs to extend a TQM ring, it needs
8344          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
8345          * the backing store.
8346          */
8347         uint32_t        tqm_max_entries_per_ring;
8348         /* Maximum number of MR/AV context entries supported for this function. */
8349         uint32_t        mrav_max_entries;
8350         /* Number of bytes that must be allocated for each context entry. */
8351         uint16_t        mrav_entry_size;
8352         /* Number of bytes that must be allocated for each context entry. */
8353         uint16_t        tim_entry_size;
8354         /* Maximum number of Timer context entries supported for this function. */
8355         uint32_t        tim_max_entries;
8356         uint8_t unused_0[2];
8357         /*
8358          * The number of entries specified for any TQM ring must be a
8359          * multiple of this value to prevent any resource allocation
8360          * limitations.
8361          */
8362         uint8_t tqm_entries_multiple;
8363         /*
8364          * This field is used in Output records to indicate that the output
8365          * is completely written to RAM.  This field should be read as '1'
8366          * to indicate that the output has been completely written.
8367          * When writing a command completion or response to an internal processor,
8368          * the order of writes has to be such that this field is written last.
8369          */
8370         uint8_t valid;
8371 } __attribute__((packed));
8372
8373 /*******************************
8374  * hwrm_func_backing_store_cfg *
8375  *******************************/
8376
8377
8378 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
8379 struct hwrm_func_backing_store_cfg_input {
8380         /* The HWRM command request type. */
8381         uint16_t        req_type;
8382         /*
8383          * The completion ring to send the completion event on. This should
8384          * be the NQ ID returned from the `nq_alloc` HWRM command.
8385          */
8386         uint16_t        cmpl_ring;
8387         /*
8388          * The sequence ID is used by the driver for tracking multiple
8389          * commands. This ID is treated as opaque data by the firmware and
8390          * the value is returned in the `hwrm_resp_hdr` upon completion.
8391          */
8392         uint16_t        seq_id;
8393         /*
8394          * The target ID of the command:
8395          * * 0x0-0xFFF8 - The function ID
8396          * * 0xFFF8-0xFFFE - Reserved for internal processors
8397          * * 0xFFFF - HWRM
8398          */
8399         uint16_t        target_id;
8400         /*
8401          * A physical address pointer pointing to a host buffer that the
8402          * command's response data will be written. This can be either a host
8403          * physical address (HPA) or a guest physical address (GPA) and must
8404          * point to a physically contiguous block of memory.
8405          */
8406         uint64_t        resp_addr;
8407         uint32_t        flags;
8408         /*
8409          * When set, the firmware only uses on-chip resources and does not
8410          * expect any backing store to be provided by the host driver. This
8411          * mode provides minimal L2 functionality (e.g. limited L2 resources,
8412          * no RoCE).
8413          */
8414         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
8415                 UINT32_C(0x1)
8416         uint32_t        enables;
8417         /*
8418          * This bit must be '1' for the qp fields to be
8419          * configured.
8420          */
8421         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
8422                 UINT32_C(0x1)
8423         /*
8424          * This bit must be '1' for the srq fields to be
8425          * configured.
8426          */
8427         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
8428                 UINT32_C(0x2)
8429         /*
8430          * This bit must be '1' for the cq fields to be
8431          * configured.
8432          */
8433         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
8434                 UINT32_C(0x4)
8435         /*
8436          * This bit must be '1' for the vnic fields to be
8437          * configured.
8438          */
8439         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
8440                 UINT32_C(0x8)
8441         /*
8442          * This bit must be '1' for the stat fields to be
8443          * configured.
8444          */
8445         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
8446                 UINT32_C(0x10)
8447         /*
8448          * This bit must be '1' for the tqm_sp fields to be
8449          * configured.
8450          */
8451         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
8452                 UINT32_C(0x20)
8453         /*
8454          * This bit must be '1' for the tqm_ring0 fields to be
8455          * configured.
8456          */
8457         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
8458                 UINT32_C(0x40)
8459         /*
8460          * This bit must be '1' for the tqm_ring1 fields to be
8461          * configured.
8462          */
8463         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
8464                 UINT32_C(0x80)
8465         /*
8466          * This bit must be '1' for the tqm_ring2 fields to be
8467          * configured.
8468          */
8469         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
8470                 UINT32_C(0x100)
8471         /*
8472          * This bit must be '1' for the tqm_ring3 fields to be
8473          * configured.
8474          */
8475         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
8476                 UINT32_C(0x200)
8477         /*
8478          * This bit must be '1' for the tqm_ring4 fields to be
8479          * configured.
8480          */
8481         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
8482                 UINT32_C(0x400)
8483         /*
8484          * This bit must be '1' for the tqm_ring5 fields to be
8485          * configured.
8486          */
8487         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
8488                 UINT32_C(0x800)
8489         /*
8490          * This bit must be '1' for the tqm_ring6 fields to be
8491          * configured.
8492          */
8493         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
8494                 UINT32_C(0x1000)
8495         /*
8496          * This bit must be '1' for the tqm_ring7 fields to be
8497          * configured.
8498          */
8499         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
8500                 UINT32_C(0x2000)
8501         /*
8502          * This bit must be '1' for the mrav fields to be
8503          * configured.
8504          */
8505         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
8506                 UINT32_C(0x4000)
8507         /*
8508          * This bit must be '1' for the tim fields to be
8509          * configured.
8510          */
8511         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
8512                 UINT32_C(0x8000)
8513         /* QPC page size and level. */
8514         uint8_t qpc_pg_size_qpc_lvl;
8515         /* QPC PBL indirect levels. */
8516         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
8517                 UINT32_C(0xf)
8518         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
8519         /* PBL pointer is physical start address. */
8520         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
8521                 UINT32_C(0x0)
8522         /* PBL pointer points to PTE table. */
8523         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
8524                 UINT32_C(0x1)
8525         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8526         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
8527                 UINT32_C(0x2)
8528         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
8529                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
8530         /* QPC page size. */
8531         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
8532                 UINT32_C(0xf0)
8533         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
8534         /* 4KB. */
8535         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
8536                 (UINT32_C(0x0) << 4)
8537         /* 8KB. */
8538         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
8539                 (UINT32_C(0x1) << 4)
8540         /* 64KB. */
8541         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
8542                 (UINT32_C(0x2) << 4)
8543         /* 2MB. */
8544         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
8545                 (UINT32_C(0x3) << 4)
8546         /* 8MB. */
8547         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
8548                 (UINT32_C(0x4) << 4)
8549         /* 1GB. */
8550         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
8551                 (UINT32_C(0x5) << 4)
8552         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
8553                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
8554         /* SRQ page size and level. */
8555         uint8_t srq_pg_size_srq_lvl;
8556         /* SRQ PBL indirect levels. */
8557         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
8558                 UINT32_C(0xf)
8559         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
8560         /* PBL pointer is physical start address. */
8561         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
8562                 UINT32_C(0x0)
8563         /* PBL pointer points to PTE table. */
8564         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
8565                 UINT32_C(0x1)
8566         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8567         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
8568                 UINT32_C(0x2)
8569         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
8570                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
8571         /* SRQ page size. */
8572         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
8573                 UINT32_C(0xf0)
8574         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
8575         /* 4KB. */
8576         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
8577                 (UINT32_C(0x0) << 4)
8578         /* 8KB. */
8579         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
8580                 (UINT32_C(0x1) << 4)
8581         /* 64KB. */
8582         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
8583                 (UINT32_C(0x2) << 4)
8584         /* 2MB. */
8585         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
8586                 (UINT32_C(0x3) << 4)
8587         /* 8MB. */
8588         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
8589                 (UINT32_C(0x4) << 4)
8590         /* 1GB. */
8591         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
8592                 (UINT32_C(0x5) << 4)
8593         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
8594                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
8595         /* CQ page size and level. */
8596         uint8_t cq_pg_size_cq_lvl;
8597         /* CQ PBL indirect levels. */
8598         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
8599                 UINT32_C(0xf)
8600         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
8601         /* PBL pointer is physical start address. */
8602         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
8603                 UINT32_C(0x0)
8604         /* PBL pointer points to PTE table. */
8605         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
8606                 UINT32_C(0x1)
8607         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8608         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
8609                 UINT32_C(0x2)
8610         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
8611                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
8612         /* CQ page size. */
8613         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
8614                 UINT32_C(0xf0)
8615         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
8616         /* 4KB. */
8617         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
8618                 (UINT32_C(0x0) << 4)
8619         /* 8KB. */
8620         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
8621                 (UINT32_C(0x1) << 4)
8622         /* 64KB. */
8623         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
8624                 (UINT32_C(0x2) << 4)
8625         /* 2MB. */
8626         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
8627                 (UINT32_C(0x3) << 4)
8628         /* 8MB. */
8629         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
8630                 (UINT32_C(0x4) << 4)
8631         /* 1GB. */
8632         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
8633                 (UINT32_C(0x5) << 4)
8634         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
8635                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
8636         /* VNIC page size and level. */
8637         uint8_t vnic_pg_size_vnic_lvl;
8638         /* VNIC PBL indirect levels. */
8639         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
8640                 UINT32_C(0xf)
8641         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
8642         /* PBL pointer is physical start address. */
8643         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
8644                 UINT32_C(0x0)
8645         /* PBL pointer points to PTE table. */
8646         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
8647                 UINT32_C(0x1)
8648         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8649         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
8650                 UINT32_C(0x2)
8651         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
8652                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
8653         /* VNIC page size. */
8654         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
8655                 UINT32_C(0xf0)
8656         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
8657         /* 4KB. */
8658         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
8659                 (UINT32_C(0x0) << 4)
8660         /* 8KB. */
8661         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
8662                 (UINT32_C(0x1) << 4)
8663         /* 64KB. */
8664         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
8665                 (UINT32_C(0x2) << 4)
8666         /* 2MB. */
8667         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
8668                 (UINT32_C(0x3) << 4)
8669         /* 8MB. */
8670         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
8671                 (UINT32_C(0x4) << 4)
8672         /* 1GB. */
8673         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
8674                 (UINT32_C(0x5) << 4)
8675         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
8676                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
8677         /* Stat page size and level. */
8678         uint8_t stat_pg_size_stat_lvl;
8679         /* Stat PBL indirect levels. */
8680         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
8681                 UINT32_C(0xf)
8682         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
8683         /* PBL pointer is physical start address. */
8684         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
8685                 UINT32_C(0x0)
8686         /* PBL pointer points to PTE table. */
8687         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
8688                 UINT32_C(0x1)
8689         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8690         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
8691                 UINT32_C(0x2)
8692         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
8693                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
8694         /* Stat page size. */
8695         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
8696                 UINT32_C(0xf0)
8697         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
8698         /* 4KB. */
8699         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
8700                 (UINT32_C(0x0) << 4)
8701         /* 8KB. */
8702         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
8703                 (UINT32_C(0x1) << 4)
8704         /* 64KB. */
8705         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
8706                 (UINT32_C(0x2) << 4)
8707         /* 2MB. */
8708         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
8709                 (UINT32_C(0x3) << 4)
8710         /* 8MB. */
8711         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
8712                 (UINT32_C(0x4) << 4)
8713         /* 1GB. */
8714         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
8715                 (UINT32_C(0x5) << 4)
8716         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
8717                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
8718         /* TQM slow path page size and level. */
8719         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
8720         /* TQM slow path PBL indirect levels. */
8721         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
8722                 UINT32_C(0xf)
8723         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
8724         /* PBL pointer is physical start address. */
8725         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
8726                 UINT32_C(0x0)
8727         /* PBL pointer points to PTE table. */
8728         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
8729                 UINT32_C(0x1)
8730         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8731         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
8732                 UINT32_C(0x2)
8733         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
8734                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
8735         /* TQM slow path page size. */
8736         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
8737                 UINT32_C(0xf0)
8738         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
8739         /* 4KB. */
8740         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
8741                 (UINT32_C(0x0) << 4)
8742         /* 8KB. */
8743         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
8744                 (UINT32_C(0x1) << 4)
8745         /* 64KB. */
8746         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
8747                 (UINT32_C(0x2) << 4)
8748         /* 2MB. */
8749         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
8750                 (UINT32_C(0x3) << 4)
8751         /* 8MB. */
8752         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
8753                 (UINT32_C(0x4) << 4)
8754         /* 1GB. */
8755         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
8756                 (UINT32_C(0x5) << 4)
8757         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
8758                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
8759         /* TQM ring 0 page size and level. */
8760         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
8761         /* TQM ring 0 PBL indirect levels. */
8762         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
8763                 UINT32_C(0xf)
8764         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
8765         /* PBL pointer is physical start address. */
8766         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
8767                 UINT32_C(0x0)
8768         /* PBL pointer points to PTE table. */
8769         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
8770                 UINT32_C(0x1)
8771         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8772         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
8773                 UINT32_C(0x2)
8774         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
8775                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
8776         /* TQM ring 0 page size. */
8777         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
8778                 UINT32_C(0xf0)
8779         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
8780         /* 4KB. */
8781         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
8782                 (UINT32_C(0x0) << 4)
8783         /* 8KB. */
8784         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
8785                 (UINT32_C(0x1) << 4)
8786         /* 64KB. */
8787         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
8788                 (UINT32_C(0x2) << 4)
8789         /* 2MB. */
8790         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
8791                 (UINT32_C(0x3) << 4)
8792         /* 8MB. */
8793         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
8794                 (UINT32_C(0x4) << 4)
8795         /* 1GB. */
8796         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
8797                 (UINT32_C(0x5) << 4)
8798         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
8799                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
8800         /* TQM ring 1 page size and level. */
8801         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
8802         /* TQM ring 1 PBL indirect levels. */
8803         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
8804                 UINT32_C(0xf)
8805         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
8806         /* PBL pointer is physical start address. */
8807         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
8808                 UINT32_C(0x0)
8809         /* PBL pointer points to PTE table. */
8810         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
8811                 UINT32_C(0x1)
8812         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8813         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
8814                 UINT32_C(0x2)
8815         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
8816                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
8817         /* TQM ring 1 page size. */
8818         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
8819                 UINT32_C(0xf0)
8820         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
8821         /* 4KB. */
8822         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
8823                 (UINT32_C(0x0) << 4)
8824         /* 8KB. */
8825         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
8826                 (UINT32_C(0x1) << 4)
8827         /* 64KB. */
8828         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
8829                 (UINT32_C(0x2) << 4)
8830         /* 2MB. */
8831         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
8832                 (UINT32_C(0x3) << 4)
8833         /* 8MB. */
8834         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
8835                 (UINT32_C(0x4) << 4)
8836         /* 1GB. */
8837         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
8838                 (UINT32_C(0x5) << 4)
8839         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
8840                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
8841         /* TQM ring 2 page size and level. */
8842         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
8843         /* TQM ring 2 PBL indirect levels. */
8844         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
8845                 UINT32_C(0xf)
8846         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
8847         /* PBL pointer is physical start address. */
8848         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
8849                 UINT32_C(0x0)
8850         /* PBL pointer points to PTE table. */
8851         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
8852                 UINT32_C(0x1)
8853         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8854         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
8855                 UINT32_C(0x2)
8856         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
8857                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
8858         /* TQM ring 2 page size. */
8859         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
8860                 UINT32_C(0xf0)
8861         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
8862         /* 4KB. */
8863         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
8864                 (UINT32_C(0x0) << 4)
8865         /* 8KB. */
8866         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
8867                 (UINT32_C(0x1) << 4)
8868         /* 64KB. */
8869         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
8870                 (UINT32_C(0x2) << 4)
8871         /* 2MB. */
8872         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
8873                 (UINT32_C(0x3) << 4)
8874         /* 8MB. */
8875         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
8876                 (UINT32_C(0x4) << 4)
8877         /* 1GB. */
8878         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
8879                 (UINT32_C(0x5) << 4)
8880         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
8881                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
8882         /* TQM ring 3 page size and level. */
8883         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
8884         /* TQM ring 3 PBL indirect levels. */
8885         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
8886                 UINT32_C(0xf)
8887         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
8888         /* PBL pointer is physical start address. */
8889         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
8890                 UINT32_C(0x0)
8891         /* PBL pointer points to PTE table. */
8892         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
8893                 UINT32_C(0x1)
8894         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8895         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
8896                 UINT32_C(0x2)
8897         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
8898                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
8899         /* TQM ring 3 page size. */
8900         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
8901                 UINT32_C(0xf0)
8902         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
8903         /* 4KB. */
8904         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
8905                 (UINT32_C(0x0) << 4)
8906         /* 8KB. */
8907         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
8908                 (UINT32_C(0x1) << 4)
8909         /* 64KB. */
8910         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
8911                 (UINT32_C(0x2) << 4)
8912         /* 2MB. */
8913         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
8914                 (UINT32_C(0x3) << 4)
8915         /* 8MB. */
8916         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
8917                 (UINT32_C(0x4) << 4)
8918         /* 1GB. */
8919         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
8920                 (UINT32_C(0x5) << 4)
8921         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
8922                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
8923         /* TQM ring 4 page size and level. */
8924         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
8925         /* TQM ring 4 PBL indirect levels. */
8926         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
8927                 UINT32_C(0xf)
8928         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
8929         /* PBL pointer is physical start address. */
8930         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
8931                 UINT32_C(0x0)
8932         /* PBL pointer points to PTE table. */
8933         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
8934                 UINT32_C(0x1)
8935         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8936         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
8937                 UINT32_C(0x2)
8938         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
8939                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
8940         /* TQM ring 4 page size. */
8941         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
8942                 UINT32_C(0xf0)
8943         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
8944         /* 4KB. */
8945         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
8946                 (UINT32_C(0x0) << 4)
8947         /* 8KB. */
8948         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
8949                 (UINT32_C(0x1) << 4)
8950         /* 64KB. */
8951         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
8952                 (UINT32_C(0x2) << 4)
8953         /* 2MB. */
8954         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
8955                 (UINT32_C(0x3) << 4)
8956         /* 8MB. */
8957         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
8958                 (UINT32_C(0x4) << 4)
8959         /* 1GB. */
8960         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
8961                 (UINT32_C(0x5) << 4)
8962         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
8963                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
8964         /* TQM ring 5 page size and level. */
8965         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
8966         /* TQM ring 5 PBL indirect levels. */
8967         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
8968                 UINT32_C(0xf)
8969         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
8970         /* PBL pointer is physical start address. */
8971         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
8972                 UINT32_C(0x0)
8973         /* PBL pointer points to PTE table. */
8974         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
8975                 UINT32_C(0x1)
8976         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8977         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
8978                 UINT32_C(0x2)
8979         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
8980                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
8981         /* TQM ring 5 page size. */
8982         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
8983                 UINT32_C(0xf0)
8984         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
8985         /* 4KB. */
8986         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
8987                 (UINT32_C(0x0) << 4)
8988         /* 8KB. */
8989         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
8990                 (UINT32_C(0x1) << 4)
8991         /* 64KB. */
8992         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
8993                 (UINT32_C(0x2) << 4)
8994         /* 2MB. */
8995         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
8996                 (UINT32_C(0x3) << 4)
8997         /* 8MB. */
8998         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
8999                 (UINT32_C(0x4) << 4)
9000         /* 1GB. */
9001         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
9002                 (UINT32_C(0x5) << 4)
9003         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
9004                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
9005         /* TQM ring 6 page size and level. */
9006         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
9007         /* TQM ring 6 PBL indirect levels. */
9008         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
9009                 UINT32_C(0xf)
9010         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
9011         /* PBL pointer is physical start address. */
9012         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
9013                 UINT32_C(0x0)
9014         /* PBL pointer points to PTE table. */
9015         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
9016                 UINT32_C(0x1)
9017         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9018         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
9019                 UINT32_C(0x2)
9020         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
9021                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
9022         /* TQM ring 6 page size. */
9023         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
9024                 UINT32_C(0xf0)
9025         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
9026         /* 4KB. */
9027         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
9028                 (UINT32_C(0x0) << 4)
9029         /* 8KB. */
9030         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
9031                 (UINT32_C(0x1) << 4)
9032         /* 64KB. */
9033         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
9034                 (UINT32_C(0x2) << 4)
9035         /* 2MB. */
9036         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
9037                 (UINT32_C(0x3) << 4)
9038         /* 8MB. */
9039         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
9040                 (UINT32_C(0x4) << 4)
9041         /* 1GB. */
9042         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
9043                 (UINT32_C(0x5) << 4)
9044         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
9045                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
9046         /* TQM ring 7 page size and level. */
9047         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
9048         /* TQM ring 7 PBL indirect levels. */
9049         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
9050                 UINT32_C(0xf)
9051         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
9052         /* PBL pointer is physical start address. */
9053         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
9054                 UINT32_C(0x0)
9055         /* PBL pointer points to PTE table. */
9056         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
9057                 UINT32_C(0x1)
9058         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9059         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
9060                 UINT32_C(0x2)
9061         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
9062                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
9063         /* TQM ring 7 page size. */
9064         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
9065                 UINT32_C(0xf0)
9066         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
9067         /* 4KB. */
9068         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
9069                 (UINT32_C(0x0) << 4)
9070         /* 8KB. */
9071         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
9072                 (UINT32_C(0x1) << 4)
9073         /* 64KB. */
9074         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
9075                 (UINT32_C(0x2) << 4)
9076         /* 2MB. */
9077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
9078                 (UINT32_C(0x3) << 4)
9079         /* 8MB. */
9080         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
9081                 (UINT32_C(0x4) << 4)
9082         /* 1GB. */
9083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
9084                 (UINT32_C(0x5) << 4)
9085         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
9086                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
9087         /* MR/AV page size and level. */
9088         uint8_t mrav_pg_size_mrav_lvl;
9089         /* MR/AV PBL indirect levels. */
9090         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
9091                 UINT32_C(0xf)
9092         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
9093         /* PBL pointer is physical start address. */
9094         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
9095                 UINT32_C(0x0)
9096         /* PBL pointer points to PTE table. */
9097         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
9098                 UINT32_C(0x1)
9099         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9100         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
9101                 UINT32_C(0x2)
9102         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
9103                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
9104         /* MR/AV page size. */
9105         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
9106                 UINT32_C(0xf0)
9107         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
9108         /* 4KB. */
9109         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
9110                 (UINT32_C(0x0) << 4)
9111         /* 8KB. */
9112         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
9113                 (UINT32_C(0x1) << 4)
9114         /* 64KB. */
9115         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
9116                 (UINT32_C(0x2) << 4)
9117         /* 2MB. */
9118         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
9119                 (UINT32_C(0x3) << 4)
9120         /* 8MB. */
9121         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
9122                 (UINT32_C(0x4) << 4)
9123         /* 1GB. */
9124         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
9125                 (UINT32_C(0x5) << 4)
9126         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
9127                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
9128         /* Timer page size and level. */
9129         uint8_t tim_pg_size_tim_lvl;
9130         /* Timer PBL indirect levels. */
9131         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
9132                 UINT32_C(0xf)
9133         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
9134         /* PBL pointer is physical start address. */
9135         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
9136                 UINT32_C(0x0)
9137         /* PBL pointer points to PTE table. */
9138         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
9139                 UINT32_C(0x1)
9140         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9141         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
9142                 UINT32_C(0x2)
9143         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
9144                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
9145         /* Timer page size. */
9146         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
9147                 UINT32_C(0xf0)
9148         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
9149         /* 4KB. */
9150         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
9151                 (UINT32_C(0x0) << 4)
9152         /* 8KB. */
9153         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
9154                 (UINT32_C(0x1) << 4)
9155         /* 64KB. */
9156         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
9157                 (UINT32_C(0x2) << 4)
9158         /* 2MB. */
9159         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
9160                 (UINT32_C(0x3) << 4)
9161         /* 8MB. */
9162         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
9163                 (UINT32_C(0x4) << 4)
9164         /* 1GB. */
9165         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
9166                 (UINT32_C(0x5) << 4)
9167         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
9168                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
9169         /* QP page directory. */
9170         uint64_t        qpc_page_dir;
9171         /* SRQ page directory. */
9172         uint64_t        srq_page_dir;
9173         /* CQ page directory. */
9174         uint64_t        cq_page_dir;
9175         /* VNIC page directory. */
9176         uint64_t        vnic_page_dir;
9177         /* Stat page directory. */
9178         uint64_t        stat_page_dir;
9179         /* TQM slowpath page directory. */
9180         uint64_t        tqm_sp_page_dir;
9181         /* TQM ring 0 page directory. */
9182         uint64_t        tqm_ring0_page_dir;
9183         /* TQM ring 1 page directory. */
9184         uint64_t        tqm_ring1_page_dir;
9185         /* TQM ring 2 page directory. */
9186         uint64_t        tqm_ring2_page_dir;
9187         /* TQM ring 3 page directory. */
9188         uint64_t        tqm_ring3_page_dir;
9189         /* TQM ring 4 page directory. */
9190         uint64_t        tqm_ring4_page_dir;
9191         /* TQM ring 5 page directory. */
9192         uint64_t        tqm_ring5_page_dir;
9193         /* TQM ring 6 page directory. */
9194         uint64_t        tqm_ring6_page_dir;
9195         /* TQM ring 7 page directory. */
9196         uint64_t        tqm_ring7_page_dir;
9197         /* MR/AV page directory. */
9198         uint64_t        mrav_page_dir;
9199         /* Timer page directory. */
9200         uint64_t        tim_page_dir;
9201         /* Number of QPs. */
9202         uint32_t        qp_num_entries;
9203         /* Number of SRQs. */
9204         uint32_t        srq_num_entries;
9205         /* Number of CQs. */
9206         uint32_t        cq_num_entries;
9207         /* Number of Stats. */
9208         uint32_t        stat_num_entries;
9209         /*
9210          * Number of TQM slowpath entries.
9211          *
9212          * TQM slowpath rings should be sized as follows:
9213          *
9214          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
9215          *
9216          * Where:
9217          *   num_vnics is the number of VNICs allocated in the VNIC backing store
9218          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
9219          *   num_roce_qps is the number of RoCE QPs in the QP backing store
9220          *   tqm_min_size is tqm_min_entries_per_ring reported by
9221          *     HWRM_FUNC_BACKING_STORE_QCAPS
9222          *
9223          * Note that TQM ring sizes cannot be extended while the system is
9224          * operational. If a PF driver needs to extend a TQM ring, it needs
9225          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9226          * the backing store.
9227          */
9228         uint32_t        tqm_sp_num_entries;
9229         /*
9230          * Number of TQM ring 0 entries.
9231          *
9232          * TQM fastpath rings should be sized large enough to accommodate the
9233          * maximum number of QPs (either L2 or RoCE, or both if shared)
9234          * that can be enqueued to the TQM ring.
9235          *
9236          * Note that TQM ring sizes cannot be extended while the system is
9237          * operational. If a PF driver needs to extend a TQM ring, it needs
9238          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9239          * the backing store.
9240          */
9241         uint32_t        tqm_ring0_num_entries;
9242         /*
9243          * Number of TQM ring 1 entries.
9244          *
9245          * TQM fastpath rings should be sized large enough to accommodate the
9246          * maximum number of QPs (either L2 or RoCE, or both if shared)
9247          * that can be enqueued to the TQM ring.
9248          *
9249          * Note that TQM ring sizes cannot be extended while the system is
9250          * operational. If a PF driver needs to extend a TQM ring, it needs
9251          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9252          * the backing store.
9253          */
9254         uint32_t        tqm_ring1_num_entries;
9255         /*
9256          * Number of TQM ring 2 entries.
9257          *
9258          * TQM fastpath rings should be sized large enough to accommodate the
9259          * maximum number of QPs (either L2 or RoCE, or both if shared)
9260          * that can be enqueued to the TQM ring.
9261          *
9262          * Note that TQM ring sizes cannot be extended while the system is
9263          * operational. If a PF driver needs to extend a TQM ring, it needs
9264          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9265          * the backing store.
9266          */
9267         uint32_t        tqm_ring2_num_entries;
9268         /*
9269          * Number of TQM ring 3 entries.
9270          *
9271          * TQM fastpath rings should be sized large enough to accommodate the
9272          * maximum number of QPs (either L2 or RoCE, or both if shared)
9273          * that can be enqueued to the TQM ring.
9274          *
9275          * Note that TQM ring sizes cannot be extended while the system is
9276          * operational. If a PF driver needs to extend a TQM ring, it needs
9277          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9278          * the backing store.
9279          */
9280         uint32_t        tqm_ring3_num_entries;
9281         /*
9282          * Number of TQM ring 4 entries.
9283          *
9284          * TQM fastpath rings should be sized large enough to accommodate the
9285          * maximum number of QPs (either L2 or RoCE, or both if shared)
9286          * that can be enqueued to the TQM ring.
9287          *
9288          * Note that TQM ring sizes cannot be extended while the system is
9289          * operational. If a PF driver needs to extend a TQM ring, it needs
9290          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9291          * the backing store.
9292          */
9293         uint32_t        tqm_ring4_num_entries;
9294         /*
9295          * Number of TQM ring 5 entries.
9296          *
9297          * TQM fastpath rings should be sized large enough to accommodate the
9298          * maximum number of QPs (either L2 or RoCE, or both if shared)
9299          * that can be enqueued to the TQM ring.
9300          *
9301          * Note that TQM ring sizes cannot be extended while the system is
9302          * operational. If a PF driver needs to extend a TQM ring, it needs
9303          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9304          * the backing store.
9305          */
9306         uint32_t        tqm_ring5_num_entries;
9307         /*
9308          * Number of TQM ring 6 entries.
9309          *
9310          * TQM fastpath rings should be sized large enough to accommodate the
9311          * maximum number of QPs (either L2 or RoCE, or both if shared)
9312          * that can be enqueued to the TQM ring.
9313          *
9314          * Note that TQM ring sizes cannot be extended while the system is
9315          * operational. If a PF driver needs to extend a TQM ring, it needs
9316          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9317          * the backing store.
9318          */
9319         uint32_t        tqm_ring6_num_entries;
9320         /*
9321          * Number of TQM ring 7 entries.
9322          *
9323          * TQM fastpath rings should be sized large enough to accommodate the
9324          * maximum number of QPs (either L2 or RoCE, or both if shared)
9325          * that can be enqueued to the TQM ring.
9326          *
9327          * Note that TQM ring sizes cannot be extended while the system is
9328          * operational. If a PF driver needs to extend a TQM ring, it needs
9329          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9330          * the backing store.
9331          */
9332         uint32_t        tqm_ring7_num_entries;
9333         /* Number of MR/AV entries. */
9334         uint32_t        mrav_num_entries;
9335         /* Number of Timer entries. */
9336         uint32_t        tim_num_entries;
9337         /* Number of entries to reserve for QP1 */
9338         uint16_t        qp_num_qp1_entries;
9339         /* Number of entries to reserve for L2 */
9340         uint16_t        qp_num_l2_entries;
9341         /* Number of bytes that have been allocated for each context entry. */
9342         uint16_t        qp_entry_size;
9343         /* Number of entries to reserve for L2 */
9344         uint16_t        srq_num_l2_entries;
9345         /* Number of bytes that have been allocated for each context entry. */
9346         uint16_t        srq_entry_size;
9347         /* Number of entries to reserve for L2 */
9348         uint16_t        cq_num_l2_entries;
9349         /* Number of bytes that have been allocated for each context entry. */
9350         uint16_t        cq_entry_size;
9351         /* Number of entries to reserve for VNIC entries */
9352         uint16_t        vnic_num_vnic_entries;
9353         /* Number of entries to reserve for Ring table entries */
9354         uint16_t        vnic_num_ring_table_entries;
9355         /* Number of bytes that have been allocated for each context entry. */
9356         uint16_t        vnic_entry_size;
9357         /* Number of bytes that have been allocated for each context entry. */
9358         uint16_t        stat_entry_size;
9359         /* Number of bytes that have been allocated for each context entry. */
9360         uint16_t        tqm_entry_size;
9361         /* Number of bytes that have been allocated for each context entry. */
9362         uint16_t        mrav_entry_size;
9363         /* Number of bytes that have been allocated for each context entry. */
9364         uint16_t        tim_entry_size;
9365 } __attribute__((packed));
9366
9367 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
9368 struct hwrm_func_backing_store_cfg_output {
9369         /* The specific error status for the command. */
9370         uint16_t        error_code;
9371         /* The HWRM command request type. */
9372         uint16_t        req_type;
9373         /* The sequence ID from the original command. */
9374         uint16_t        seq_id;
9375         /* The length of the response data in number of bytes. */
9376         uint16_t        resp_len;
9377         uint8_t unused_0[7];
9378         /*
9379          * This field is used in Output records to indicate that the output
9380          * is completely written to RAM.  This field should be read as '1'
9381          * to indicate that the output has been completely written.
9382          * When writing a command completion or response to an internal processor,
9383          * the order of writes has to be such that this field is written last.
9384          */
9385         uint8_t valid;
9386 } __attribute__((packed));
9387
9388 /********************************
9389  * hwrm_func_backing_store_qcfg *
9390  ********************************/
9391
9392
9393 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
9394 struct hwrm_func_backing_store_qcfg_input {
9395         /* The HWRM command request type. */
9396         uint16_t        req_type;
9397         /*
9398          * The completion ring to send the completion event on. This should
9399          * be the NQ ID returned from the `nq_alloc` HWRM command.
9400          */
9401         uint16_t        cmpl_ring;
9402         /*
9403          * The sequence ID is used by the driver for tracking multiple
9404          * commands. This ID is treated as opaque data by the firmware and
9405          * the value is returned in the `hwrm_resp_hdr` upon completion.
9406          */
9407         uint16_t        seq_id;
9408         /*
9409          * The target ID of the command:
9410          * * 0x0-0xFFF8 - The function ID
9411          * * 0xFFF8-0xFFFE - Reserved for internal processors
9412          * * 0xFFFF - HWRM
9413          */
9414         uint16_t        target_id;
9415         /*
9416          * A physical address pointer pointing to a host buffer that the
9417          * command's response data will be written. This can be either a host
9418          * physical address (HPA) or a guest physical address (GPA) and must
9419          * point to a physically contiguous block of memory.
9420          */
9421         uint64_t        resp_addr;
9422 } __attribute__((packed));
9423
9424 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
9425 struct hwrm_func_backing_store_qcfg_output {
9426         /* The specific error status for the command. */
9427         uint16_t        error_code;
9428         /* The HWRM command request type. */
9429         uint16_t        req_type;
9430         /* The sequence ID from the original command. */
9431         uint16_t        seq_id;
9432         /* The length of the response data in number of bytes. */
9433         uint16_t        resp_len;
9434         uint32_t        flags;
9435         /*
9436          * When set, the firmware only uses on-chip resources and does not
9437          * expect any backing store to be provided by the host driver. This
9438          * mode provides minimal L2 functionality (e.g. limited L2 resources,
9439          * no RoCE).
9440          */
9441         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
9442                 UINT32_C(0x1)
9443         uint8_t unused_0[4];
9444         /*
9445          * This bit must be '1' for the qp fields to be
9446          * configured.
9447          */
9448         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
9449                 UINT32_C(0x1)
9450         /*
9451          * This bit must be '1' for the srq fields to be
9452          * configured.
9453          */
9454         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
9455                 UINT32_C(0x2)
9456         /*
9457          * This bit must be '1' for the cq fields to be
9458          * configured.
9459          */
9460         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
9461                 UINT32_C(0x4)
9462         /*
9463          * This bit must be '1' for the vnic fields to be
9464          * configured.
9465          */
9466         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
9467                 UINT32_C(0x8)
9468         /*
9469          * This bit must be '1' for the stat fields to be
9470          * configured.
9471          */
9472         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
9473                 UINT32_C(0x10)
9474         /*
9475          * This bit must be '1' for the tqm_sp fields to be
9476          * configured.
9477          */
9478         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
9479                 UINT32_C(0x20)
9480         /*
9481          * This bit must be '1' for the tqm_ring0 fields to be
9482          * configured.
9483          */
9484         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
9485                 UINT32_C(0x40)
9486         /*
9487          * This bit must be '1' for the tqm_ring1 fields to be
9488          * configured.
9489          */
9490         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
9491                 UINT32_C(0x80)
9492         /*
9493          * This bit must be '1' for the tqm_ring2 fields to be
9494          * configured.
9495          */
9496         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
9497                 UINT32_C(0x100)
9498         /*
9499          * This bit must be '1' for the tqm_ring3 fields to be
9500          * configured.
9501          */
9502         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
9503                 UINT32_C(0x200)
9504         /*
9505          * This bit must be '1' for the tqm_ring4 fields to be
9506          * configured.
9507          */
9508         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
9509                 UINT32_C(0x400)
9510         /*
9511          * This bit must be '1' for the tqm_ring5 fields to be
9512          * configured.
9513          */
9514         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
9515                 UINT32_C(0x800)
9516         /*
9517          * This bit must be '1' for the tqm_ring6 fields to be
9518          * configured.
9519          */
9520         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
9521                 UINT32_C(0x1000)
9522         /*
9523          * This bit must be '1' for the tqm_ring7 fields to be
9524          * configured.
9525          */
9526         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
9527                 UINT32_C(0x2000)
9528         /*
9529          * This bit must be '1' for the mrav fields to be
9530          * configured.
9531          */
9532         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
9533                 UINT32_C(0x4000)
9534         /*
9535          * This bit must be '1' for the tim fields to be
9536          * configured.
9537          */
9538         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
9539                 UINT32_C(0x8000)
9540         /* QPC page size and level. */
9541         uint8_t qpc_pg_size_qpc_lvl;
9542         /* QPC PBL indirect levels. */
9543         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
9544                 UINT32_C(0xf)
9545         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
9546         /* PBL pointer is physical start address. */
9547         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
9548                 UINT32_C(0x0)
9549         /* PBL pointer points to PTE table. */
9550         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
9551                 UINT32_C(0x1)
9552         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9553         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
9554                 UINT32_C(0x2)
9555         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
9556                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
9557         /* QPC page size. */
9558         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
9559                 UINT32_C(0xf0)
9560         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
9561         /* 4KB. */
9562         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
9563                 (UINT32_C(0x0) << 4)
9564         /* 8KB. */
9565         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
9566                 (UINT32_C(0x1) << 4)
9567         /* 64KB. */
9568         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
9569                 (UINT32_C(0x2) << 4)
9570         /* 2MB. */
9571         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
9572                 (UINT32_C(0x3) << 4)
9573         /* 8MB. */
9574         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
9575                 (UINT32_C(0x4) << 4)
9576         /* 1GB. */
9577         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
9578                 (UINT32_C(0x5) << 4)
9579         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
9580                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
9581         /* SRQ page size and level. */
9582         uint8_t srq_pg_size_srq_lvl;
9583         /* SRQ PBL indirect levels. */
9584         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
9585                 UINT32_C(0xf)
9586         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
9587         /* PBL pointer is physical start address. */
9588         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
9589                 UINT32_C(0x0)
9590         /* PBL pointer points to PTE table. */
9591         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
9592                 UINT32_C(0x1)
9593         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9594         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
9595                 UINT32_C(0x2)
9596         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
9597                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
9598         /* SRQ page size. */
9599         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
9600                 UINT32_C(0xf0)
9601         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
9602         /* 4KB. */
9603         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
9604                 (UINT32_C(0x0) << 4)
9605         /* 8KB. */
9606         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
9607                 (UINT32_C(0x1) << 4)
9608         /* 64KB. */
9609         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
9610                 (UINT32_C(0x2) << 4)
9611         /* 2MB. */
9612         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
9613                 (UINT32_C(0x3) << 4)
9614         /* 8MB. */
9615         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
9616                 (UINT32_C(0x4) << 4)
9617         /* 1GB. */
9618         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
9619                 (UINT32_C(0x5) << 4)
9620         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
9621                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
9622         /* CQ page size and level. */
9623         uint8_t cq_pg_size_cq_lvl;
9624         /* CQ PBL indirect levels. */
9625         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
9626                 UINT32_C(0xf)
9627         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
9628         /* PBL pointer is physical start address. */
9629         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
9630                 UINT32_C(0x0)
9631         /* PBL pointer points to PTE table. */
9632         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
9633                 UINT32_C(0x1)
9634         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9635         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
9636                 UINT32_C(0x2)
9637         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
9638                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
9639         /* CQ page size. */
9640         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
9641                 UINT32_C(0xf0)
9642         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
9643         /* 4KB. */
9644         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
9645                 (UINT32_C(0x0) << 4)
9646         /* 8KB. */
9647         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
9648                 (UINT32_C(0x1) << 4)
9649         /* 64KB. */
9650         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
9651                 (UINT32_C(0x2) << 4)
9652         /* 2MB. */
9653         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
9654                 (UINT32_C(0x3) << 4)
9655         /* 8MB. */
9656         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
9657                 (UINT32_C(0x4) << 4)
9658         /* 1GB. */
9659         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
9660                 (UINT32_C(0x5) << 4)
9661         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
9662                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
9663         /* VNIC page size and level. */
9664         uint8_t vnic_pg_size_vnic_lvl;
9665         /* VNIC PBL indirect levels. */
9666         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
9667                 UINT32_C(0xf)
9668         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
9669         /* PBL pointer is physical start address. */
9670         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
9671                 UINT32_C(0x0)
9672         /* PBL pointer points to PTE table. */
9673         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
9674                 UINT32_C(0x1)
9675         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9676         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
9677                 UINT32_C(0x2)
9678         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
9679                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
9680         /* VNIC page size. */
9681         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
9682                 UINT32_C(0xf0)
9683         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
9684         /* 4KB. */
9685         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
9686                 (UINT32_C(0x0) << 4)
9687         /* 8KB. */
9688         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
9689                 (UINT32_C(0x1) << 4)
9690         /* 64KB. */
9691         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
9692                 (UINT32_C(0x2) << 4)
9693         /* 2MB. */
9694         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
9695                 (UINT32_C(0x3) << 4)
9696         /* 8MB. */
9697         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
9698                 (UINT32_C(0x4) << 4)
9699         /* 1GB. */
9700         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
9701                 (UINT32_C(0x5) << 4)
9702         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
9703                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
9704         /* Stat page size and level. */
9705         uint8_t stat_pg_size_stat_lvl;
9706         /* Stat PBL indirect levels. */
9707         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
9708                 UINT32_C(0xf)
9709         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
9710         /* PBL pointer is physical start address. */
9711         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
9712                 UINT32_C(0x0)
9713         /* PBL pointer points to PTE table. */
9714         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
9715                 UINT32_C(0x1)
9716         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9717         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
9718                 UINT32_C(0x2)
9719         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
9720                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
9721         /* Stat page size. */
9722         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
9723                 UINT32_C(0xf0)
9724         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
9725         /* 4KB. */
9726         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
9727                 (UINT32_C(0x0) << 4)
9728         /* 8KB. */
9729         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
9730                 (UINT32_C(0x1) << 4)
9731         /* 64KB. */
9732         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
9733                 (UINT32_C(0x2) << 4)
9734         /* 2MB. */
9735         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
9736                 (UINT32_C(0x3) << 4)
9737         /* 8MB. */
9738         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
9739                 (UINT32_C(0x4) << 4)
9740         /* 1GB. */
9741         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
9742                 (UINT32_C(0x5) << 4)
9743         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
9744                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
9745         /* TQM slow path page size and level. */
9746         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
9747         /* TQM slow path PBL indirect levels. */
9748         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
9749                 UINT32_C(0xf)
9750         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
9751         /* PBL pointer is physical start address. */
9752         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
9753                 UINT32_C(0x0)
9754         /* PBL pointer points to PTE table. */
9755         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
9756                 UINT32_C(0x1)
9757         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9758         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
9759                 UINT32_C(0x2)
9760         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
9761                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
9762         /* TQM slow path page size. */
9763         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
9764                 UINT32_C(0xf0)
9765         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
9766         /* 4KB. */
9767         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
9768                 (UINT32_C(0x0) << 4)
9769         /* 8KB. */
9770         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
9771                 (UINT32_C(0x1) << 4)
9772         /* 64KB. */
9773         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
9774                 (UINT32_C(0x2) << 4)
9775         /* 2MB. */
9776         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
9777                 (UINT32_C(0x3) << 4)
9778         /* 8MB. */
9779         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
9780                 (UINT32_C(0x4) << 4)
9781         /* 1GB. */
9782         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
9783                 (UINT32_C(0x5) << 4)
9784         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
9785                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
9786         /* TQM ring 0 page size and level. */
9787         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
9788         /* TQM ring 0 PBL indirect levels. */
9789         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
9790                 UINT32_C(0xf)
9791         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
9792         /* PBL pointer is physical start address. */
9793         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
9794                 UINT32_C(0x0)
9795         /* PBL pointer points to PTE table. */
9796         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
9797                 UINT32_C(0x1)
9798         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9799         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
9800                 UINT32_C(0x2)
9801         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
9802                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
9803         /* TQM ring 0 page size. */
9804         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
9805                 UINT32_C(0xf0)
9806         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
9807         /* 4KB. */
9808         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
9809                 (UINT32_C(0x0) << 4)
9810         /* 8KB. */
9811         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
9812                 (UINT32_C(0x1) << 4)
9813         /* 64KB. */
9814         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
9815                 (UINT32_C(0x2) << 4)
9816         /* 2MB. */
9817         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
9818                 (UINT32_C(0x3) << 4)
9819         /* 8MB. */
9820         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
9821                 (UINT32_C(0x4) << 4)
9822         /* 1GB. */
9823         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
9824                 (UINT32_C(0x5) << 4)
9825         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
9826                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
9827         /* TQM ring 1 page size and level. */
9828         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
9829         /* TQM ring 1 PBL indirect levels. */
9830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
9831                 UINT32_C(0xf)
9832         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
9833         /* PBL pointer is physical start address. */
9834         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
9835                 UINT32_C(0x0)
9836         /* PBL pointer points to PTE table. */
9837         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
9838                 UINT32_C(0x1)
9839         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9840         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
9841                 UINT32_C(0x2)
9842         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
9843                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
9844         /* TQM ring 1 page size. */
9845         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
9846                 UINT32_C(0xf0)
9847         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
9848         /* 4KB. */
9849         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
9850                 (UINT32_C(0x0) << 4)
9851         /* 8KB. */
9852         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
9853                 (UINT32_C(0x1) << 4)
9854         /* 64KB. */
9855         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
9856                 (UINT32_C(0x2) << 4)
9857         /* 2MB. */
9858         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
9859                 (UINT32_C(0x3) << 4)
9860         /* 8MB. */
9861         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
9862                 (UINT32_C(0x4) << 4)
9863         /* 1GB. */
9864         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
9865                 (UINT32_C(0x5) << 4)
9866         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
9867                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
9868         /* TQM ring 2 page size and level. */
9869         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
9870         /* TQM ring 2 PBL indirect levels. */
9871         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
9872                 UINT32_C(0xf)
9873         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
9874         /* PBL pointer is physical start address. */
9875         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
9876                 UINT32_C(0x0)
9877         /* PBL pointer points to PTE table. */
9878         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
9879                 UINT32_C(0x1)
9880         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9881         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
9882                 UINT32_C(0x2)
9883         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
9884                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
9885         /* TQM ring 2 page size. */
9886         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
9887                 UINT32_C(0xf0)
9888         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
9889         /* 4KB. */
9890         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
9891                 (UINT32_C(0x0) << 4)
9892         /* 8KB. */
9893         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
9894                 (UINT32_C(0x1) << 4)
9895         /* 64KB. */
9896         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
9897                 (UINT32_C(0x2) << 4)
9898         /* 2MB. */
9899         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
9900                 (UINT32_C(0x3) << 4)
9901         /* 8MB. */
9902         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
9903                 (UINT32_C(0x4) << 4)
9904         /* 1GB. */
9905         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
9906                 (UINT32_C(0x5) << 4)
9907         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
9908                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
9909         /* TQM ring 3 page size and level. */
9910         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
9911         /* TQM ring 3 PBL indirect levels. */
9912         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
9913                 UINT32_C(0xf)
9914         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
9915         /* PBL pointer is physical start address. */
9916         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
9917                 UINT32_C(0x0)
9918         /* PBL pointer points to PTE table. */
9919         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
9920                 UINT32_C(0x1)
9921         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9922         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
9923                 UINT32_C(0x2)
9924         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
9925                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
9926         /* TQM ring 3 page size. */
9927         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
9928                 UINT32_C(0xf0)
9929         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
9930         /* 4KB. */
9931         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
9932                 (UINT32_C(0x0) << 4)
9933         /* 8KB. */
9934         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
9935                 (UINT32_C(0x1) << 4)
9936         /* 64KB. */
9937         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
9938                 (UINT32_C(0x2) << 4)
9939         /* 2MB. */
9940         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
9941                 (UINT32_C(0x3) << 4)
9942         /* 8MB. */
9943         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
9944                 (UINT32_C(0x4) << 4)
9945         /* 1GB. */
9946         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
9947                 (UINT32_C(0x5) << 4)
9948         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
9949                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
9950         /* TQM ring 4 page size and level. */
9951         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
9952         /* TQM ring 4 PBL indirect levels. */
9953         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
9954                 UINT32_C(0xf)
9955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
9956         /* PBL pointer is physical start address. */
9957         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
9958                 UINT32_C(0x0)
9959         /* PBL pointer points to PTE table. */
9960         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
9961                 UINT32_C(0x1)
9962         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9963         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
9964                 UINT32_C(0x2)
9965         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
9966                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
9967         /* TQM ring 4 page size. */
9968         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
9969                 UINT32_C(0xf0)
9970         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
9971         /* 4KB. */
9972         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
9973                 (UINT32_C(0x0) << 4)
9974         /* 8KB. */
9975         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
9976                 (UINT32_C(0x1) << 4)
9977         /* 64KB. */
9978         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
9979                 (UINT32_C(0x2) << 4)
9980         /* 2MB. */
9981         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
9982                 (UINT32_C(0x3) << 4)
9983         /* 8MB. */
9984         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
9985                 (UINT32_C(0x4) << 4)
9986         /* 1GB. */
9987         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
9988                 (UINT32_C(0x5) << 4)
9989         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
9990                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
9991         /* TQM ring 5 page size and level. */
9992         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
9993         /* TQM ring 5 PBL indirect levels. */
9994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
9995                 UINT32_C(0xf)
9996         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
9997         /* PBL pointer is physical start address. */
9998         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
9999                 UINT32_C(0x0)
10000         /* PBL pointer points to PTE table. */
10001         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
10002                 UINT32_C(0x1)
10003         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10004         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
10005                 UINT32_C(0x2)
10006         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
10007                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
10008         /* TQM ring 5 page size. */
10009         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
10010                 UINT32_C(0xf0)
10011         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
10012         /* 4KB. */
10013         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
10014                 (UINT32_C(0x0) << 4)
10015         /* 8KB. */
10016         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
10017                 (UINT32_C(0x1) << 4)
10018         /* 64KB. */
10019         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
10020                 (UINT32_C(0x2) << 4)
10021         /* 2MB. */
10022         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
10023                 (UINT32_C(0x3) << 4)
10024         /* 8MB. */
10025         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
10026                 (UINT32_C(0x4) << 4)
10027         /* 1GB. */
10028         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
10029                 (UINT32_C(0x5) << 4)
10030         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
10031                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
10032         /* TQM ring 6 page size and level. */
10033         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
10034         /* TQM ring 6 PBL indirect levels. */
10035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
10036                 UINT32_C(0xf)
10037         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
10038         /* PBL pointer is physical start address. */
10039         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
10040                 UINT32_C(0x0)
10041         /* PBL pointer points to PTE table. */
10042         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
10043                 UINT32_C(0x1)
10044         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10045         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
10046                 UINT32_C(0x2)
10047         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
10048                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
10049         /* TQM ring 6 page size. */
10050         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
10051                 UINT32_C(0xf0)
10052         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
10053         /* 4KB. */
10054         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
10055                 (UINT32_C(0x0) << 4)
10056         /* 8KB. */
10057         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
10058                 (UINT32_C(0x1) << 4)
10059         /* 64KB. */
10060         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
10061                 (UINT32_C(0x2) << 4)
10062         /* 2MB. */
10063         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
10064                 (UINT32_C(0x3) << 4)
10065         /* 8MB. */
10066         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
10067                 (UINT32_C(0x4) << 4)
10068         /* 1GB. */
10069         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
10070                 (UINT32_C(0x5) << 4)
10071         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
10072                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
10073         /* TQM ring 7 page size and level. */
10074         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
10075         /* TQM ring 7 PBL indirect levels. */
10076         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
10077                 UINT32_C(0xf)
10078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
10079         /* PBL pointer is physical start address. */
10080         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
10081                 UINT32_C(0x0)
10082         /* PBL pointer points to PTE table. */
10083         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
10084                 UINT32_C(0x1)
10085         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10086         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
10087                 UINT32_C(0x2)
10088         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
10089                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
10090         /* TQM ring 7 page size. */
10091         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
10092                 UINT32_C(0xf0)
10093         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
10094         /* 4KB. */
10095         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
10096                 (UINT32_C(0x0) << 4)
10097         /* 8KB. */
10098         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
10099                 (UINT32_C(0x1) << 4)
10100         /* 64KB. */
10101         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
10102                 (UINT32_C(0x2) << 4)
10103         /* 2MB. */
10104         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
10105                 (UINT32_C(0x3) << 4)
10106         /* 8MB. */
10107         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
10108                 (UINT32_C(0x4) << 4)
10109         /* 1GB. */
10110         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
10111                 (UINT32_C(0x5) << 4)
10112         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
10113                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
10114         /* MR/AV page size and level. */
10115         uint8_t mrav_pg_size_mrav_lvl;
10116         /* MR/AV PBL indirect levels. */
10117         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
10118                 UINT32_C(0xf)
10119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
10120         /* PBL pointer is physical start address. */
10121         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
10122                 UINT32_C(0x0)
10123         /* PBL pointer points to PTE table. */
10124         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
10125                 UINT32_C(0x1)
10126         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10127         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
10128                 UINT32_C(0x2)
10129         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
10130                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
10131         /* MR/AV page size. */
10132         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
10133                 UINT32_C(0xf0)
10134         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
10135         /* 4KB. */
10136         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
10137                 (UINT32_C(0x0) << 4)
10138         /* 8KB. */
10139         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
10140                 (UINT32_C(0x1) << 4)
10141         /* 64KB. */
10142         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
10143                 (UINT32_C(0x2) << 4)
10144         /* 2MB. */
10145         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
10146                 (UINT32_C(0x3) << 4)
10147         /* 8MB. */
10148         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
10149                 (UINT32_C(0x4) << 4)
10150         /* 1GB. */
10151         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
10152                 (UINT32_C(0x5) << 4)
10153         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
10154                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
10155         /* Timer page size and level. */
10156         uint8_t tim_pg_size_tim_lvl;
10157         /* Timer PBL indirect levels. */
10158         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
10159                 UINT32_C(0xf)
10160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
10161         /* PBL pointer is physical start address. */
10162         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
10163                 UINT32_C(0x0)
10164         /* PBL pointer points to PTE table. */
10165         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
10166                 UINT32_C(0x1)
10167         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10168         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
10169                 UINT32_C(0x2)
10170         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
10171                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
10172         /* Timer page size. */
10173         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
10174                 UINT32_C(0xf0)
10175         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
10176         /* 4KB. */
10177         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
10178                 (UINT32_C(0x0) << 4)
10179         /* 8KB. */
10180         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
10181                 (UINT32_C(0x1) << 4)
10182         /* 64KB. */
10183         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
10184                 (UINT32_C(0x2) << 4)
10185         /* 2MB. */
10186         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
10187                 (UINT32_C(0x3) << 4)
10188         /* 8MB. */
10189         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
10190                 (UINT32_C(0x4) << 4)
10191         /* 1GB. */
10192         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
10193                 (UINT32_C(0x5) << 4)
10194         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
10195                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
10196         /* QP page directory. */
10197         uint64_t        qpc_page_dir;
10198         /* SRQ page directory. */
10199         uint64_t        srq_page_dir;
10200         /* CQ page directory. */
10201         uint64_t        cq_page_dir;
10202         /* VNIC page directory. */
10203         uint64_t        vnic_page_dir;
10204         /* Stat page directory. */
10205         uint64_t        stat_page_dir;
10206         /* TQM slowpath page directory. */
10207         uint64_t        tqm_sp_page_dir;
10208         /* TQM ring 0 page directory. */
10209         uint64_t        tqm_ring0_page_dir;
10210         /* TQM ring 1 page directory. */
10211         uint64_t        tqm_ring1_page_dir;
10212         /* TQM ring 2 page directory. */
10213         uint64_t        tqm_ring2_page_dir;
10214         /* TQM ring 3 page directory. */
10215         uint64_t        tqm_ring3_page_dir;
10216         /* TQM ring 4 page directory. */
10217         uint64_t        tqm_ring4_page_dir;
10218         /* TQM ring 5 page directory. */
10219         uint64_t        tqm_ring5_page_dir;
10220         /* TQM ring 6 page directory. */
10221         uint64_t        tqm_ring6_page_dir;
10222         /* TQM ring 7 page directory. */
10223         uint64_t        tqm_ring7_page_dir;
10224         /* MR/AV page directory. */
10225         uint64_t        mrav_page_dir;
10226         /* Timer page directory. */
10227         uint64_t        tim_page_dir;
10228         /* Number of entries to reserve for QP1 */
10229         uint16_t        qp_num_qp1_entries;
10230         /* Number of entries to reserve for L2 */
10231         uint16_t        qp_num_l2_entries;
10232         /* Number of QPs. */
10233         uint32_t        qp_num_entries;
10234         /* Number of SRQs. */
10235         uint32_t        srq_num_entries;
10236         /* Number of entries to reserve for L2 */
10237         uint16_t        srq_num_l2_entries;
10238         /* Number of entries to reserve for L2 */
10239         uint16_t        cq_num_l2_entries;
10240         /* Number of CQs. */
10241         uint32_t        cq_num_entries;
10242         /* Number of entries to reserve for VNIC entries */
10243         uint16_t        vnic_num_vnic_entries;
10244         /* Number of entries to reserve for Ring table entries */
10245         uint16_t        vnic_num_ring_table_entries;
10246         /* Number of Stats. */
10247         uint32_t        stat_num_entries;
10248         /* Number of TQM slowpath entries. */
10249         uint32_t        tqm_sp_num_entries;
10250         /* Number of TQM ring 0 entries. */
10251         uint32_t        tqm_ring0_num_entries;
10252         /* Number of TQM ring 1 entries. */
10253         uint32_t        tqm_ring1_num_entries;
10254         /* Number of TQM ring 2 entries. */
10255         uint32_t        tqm_ring2_num_entries;
10256         /* Number of TQM ring 3 entries. */
10257         uint32_t        tqm_ring3_num_entries;
10258         /* Number of TQM ring 4 entries. */
10259         uint32_t        tqm_ring4_num_entries;
10260         /* Number of TQM ring 5 entries. */
10261         uint32_t        tqm_ring5_num_entries;
10262         /* Number of TQM ring 6 entries. */
10263         uint32_t        tqm_ring6_num_entries;
10264         /* Number of TQM ring 7 entries. */
10265         uint32_t        tqm_ring7_num_entries;
10266         /* Number of MR/AV entries. */
10267         uint32_t        mrav_num_entries;
10268         /* Number of Timer entries. */
10269         uint32_t        tim_num_entries;
10270         uint8_t unused_1[7];
10271         /*
10272          * This field is used in Output records to indicate that the output
10273          * is completely written to RAM.  This field should be read as '1'
10274          * to indicate that the output has been completely written.
10275          * When writing a command completion or response to an internal processor,
10276          * the order of writes has to be such that this field is written last.
10277          */
10278         uint8_t valid;
10279 } __attribute__((packed));
10280
10281 /***********************
10282  * hwrm_func_vlan_qcfg *
10283  ***********************/
10284
10285
10286 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
10287 struct hwrm_func_vlan_qcfg_input {
10288         /* The HWRM command request type. */
10289         uint16_t        req_type;
10290         /*
10291          * The completion ring to send the completion event on. This should
10292          * be the NQ ID returned from the `nq_alloc` HWRM command.
10293          */
10294         uint16_t        cmpl_ring;
10295         /*
10296          * The sequence ID is used by the driver for tracking multiple
10297          * commands. This ID is treated as opaque data by the firmware and
10298          * the value is returned in the `hwrm_resp_hdr` upon completion.
10299          */
10300         uint16_t        seq_id;
10301         /*
10302          * The target ID of the command:
10303          * * 0x0-0xFFF8 - The function ID
10304          * * 0xFFF8-0xFFFE - Reserved for internal processors
10305          * * 0xFFFF - HWRM
10306          */
10307         uint16_t        target_id;
10308         /*
10309          * A physical address pointer pointing to a host buffer that the
10310          * command's response data will be written. This can be either a host
10311          * physical address (HPA) or a guest physical address (GPA) and must
10312          * point to a physically contiguous block of memory.
10313          */
10314         uint64_t        resp_addr;
10315         /*
10316          * Function ID of the function that is being
10317          * configured.
10318          * If set to 0xFF... (All Fs), then the configuration is
10319          * for the requesting function.
10320          */
10321         uint16_t        fid;
10322         uint8_t unused_0[6];
10323 } __attribute__((packed));
10324
10325 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
10326 struct hwrm_func_vlan_qcfg_output {
10327         /* The specific error status for the command. */
10328         uint16_t        error_code;
10329         /* The HWRM command request type. */
10330         uint16_t        req_type;
10331         /* The sequence ID from the original command. */
10332         uint16_t        seq_id;
10333         /* The length of the response data in number of bytes. */
10334         uint16_t        resp_len;
10335         uint64_t        unused_0;
10336         /* S-TAG VLAN identifier configured for the function. */
10337         uint16_t        stag_vid;
10338         /* S-TAG PCP value configured for the function. */
10339         uint8_t stag_pcp;
10340         uint8_t unused_1;
10341         /*
10342          * S-TAG TPID value configured for the function. This field is specified in
10343          * network byte order.
10344          */
10345         uint16_t        stag_tpid;
10346         /* C-TAG VLAN identifier configured for the function. */
10347         uint16_t        ctag_vid;
10348         /* C-TAG PCP value configured for the function. */
10349         uint8_t ctag_pcp;
10350         uint8_t unused_2;
10351         /*
10352          * C-TAG TPID value configured for the function. This field is specified in
10353          * network byte order.
10354          */
10355         uint16_t        ctag_tpid;
10356         /* Future use. */
10357         uint32_t        rsvd2;
10358         /* Future use. */
10359         uint32_t        rsvd3;
10360         uint8_t unused_3[3];
10361         /*
10362          * This field is used in Output records to indicate that the output
10363          * is completely written to RAM.  This field should be read as '1'
10364          * to indicate that the output has been completely written.
10365          * When writing a command completion or response to an internal processor,
10366          * the order of writes has to be such that this field is written last.
10367          */
10368         uint8_t valid;
10369 } __attribute__((packed));
10370
10371 /**********************
10372  * hwrm_func_vlan_cfg *
10373  **********************/
10374
10375
10376 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
10377 struct hwrm_func_vlan_cfg_input {
10378         /* The HWRM command request type. */
10379         uint16_t        req_type;
10380         /*
10381          * The completion ring to send the completion event on. This should
10382          * be the NQ ID returned from the `nq_alloc` HWRM command.
10383          */
10384         uint16_t        cmpl_ring;
10385         /*
10386          * The sequence ID is used by the driver for tracking multiple
10387          * commands. This ID is treated as opaque data by the firmware and
10388          * the value is returned in the `hwrm_resp_hdr` upon completion.
10389          */
10390         uint16_t        seq_id;
10391         /*
10392          * The target ID of the command:
10393          * * 0x0-0xFFF8 - The function ID
10394          * * 0xFFF8-0xFFFE - Reserved for internal processors
10395          * * 0xFFFF - HWRM
10396          */
10397         uint16_t        target_id;
10398         /*
10399          * A physical address pointer pointing to a host buffer that the
10400          * command's response data will be written. This can be either a host
10401          * physical address (HPA) or a guest physical address (GPA) and must
10402          * point to a physically contiguous block of memory.
10403          */
10404         uint64_t        resp_addr;
10405         /*
10406          * Function ID of the function that is being
10407          * configured.
10408          * If set to 0xFF... (All Fs), then the configuration is
10409          * for the requesting function.
10410          */
10411         uint16_t        fid;
10412         uint8_t unused_0[2];
10413         uint32_t        enables;
10414         /*
10415          * This bit must be '1' for the stag_vid field to be
10416          * configured.
10417          */
10418         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
10419         /*
10420          * This bit must be '1' for the ctag_vid field to be
10421          * configured.
10422          */
10423         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
10424         /*
10425          * This bit must be '1' for the stag_pcp field to be
10426          * configured.
10427          */
10428         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
10429         /*
10430          * This bit must be '1' for the ctag_pcp field to be
10431          * configured.
10432          */
10433         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
10434         /*
10435          * This bit must be '1' for the stag_tpid field to be
10436          * configured.
10437          */
10438         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
10439         /*
10440          * This bit must be '1' for the ctag_tpid field to be
10441          * configured.
10442          */
10443         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
10444         /* S-TAG VLAN identifier configured for the function. */
10445         uint16_t        stag_vid;
10446         /* S-TAG PCP value configured for the function. */
10447         uint8_t stag_pcp;
10448         uint8_t unused_1;
10449         /*
10450          * S-TAG TPID value configured for the function. This field is specified in
10451          * network byte order.
10452          */
10453         uint16_t        stag_tpid;
10454         /* C-TAG VLAN identifier configured for the function. */
10455         uint16_t        ctag_vid;
10456         /* C-TAG PCP value configured for the function. */
10457         uint8_t ctag_pcp;
10458         uint8_t unused_2;
10459         /*
10460          * C-TAG TPID value configured for the function. This field is specified in
10461          * network byte order.
10462          */
10463         uint16_t        ctag_tpid;
10464         /* Future use. */
10465         uint32_t        rsvd1;
10466         /* Future use. */
10467         uint32_t        rsvd2;
10468         uint8_t unused_3[4];
10469 } __attribute__((packed));
10470
10471 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
10472 struct hwrm_func_vlan_cfg_output {
10473         /* The specific error status for the command. */
10474         uint16_t        error_code;
10475         /* The HWRM command request type. */
10476         uint16_t        req_type;
10477         /* The sequence ID from the original command. */
10478         uint16_t        seq_id;
10479         /* The length of the response data in number of bytes. */
10480         uint16_t        resp_len;
10481         uint8_t unused_0[7];
10482         /*
10483          * This field is used in Output records to indicate that the output
10484          * is completely written to RAM.  This field should be read as '1'
10485          * to indicate that the output has been completely written.
10486          * When writing a command completion or response to an internal processor,
10487          * the order of writes has to be such that this field is written last.
10488          */
10489         uint8_t valid;
10490 } __attribute__((packed));
10491
10492 /*******************************
10493  * hwrm_func_vf_vnic_ids_query *
10494  *******************************/
10495
10496
10497 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
10498 struct hwrm_func_vf_vnic_ids_query_input {
10499         /* The HWRM command request type. */
10500         uint16_t        req_type;
10501         /*
10502          * The completion ring to send the completion event on. This should
10503          * be the NQ ID returned from the `nq_alloc` HWRM command.
10504          */
10505         uint16_t        cmpl_ring;
10506         /*
10507          * The sequence ID is used by the driver for tracking multiple
10508          * commands. This ID is treated as opaque data by the firmware and
10509          * the value is returned in the `hwrm_resp_hdr` upon completion.
10510          */
10511         uint16_t        seq_id;
10512         /*
10513          * The target ID of the command:
10514          * * 0x0-0xFFF8 - The function ID
10515          * * 0xFFF8-0xFFFE - Reserved for internal processors
10516          * * 0xFFFF - HWRM
10517          */
10518         uint16_t        target_id;
10519         /*
10520          * A physical address pointer pointing to a host buffer that the
10521          * command's response data will be written. This can be either a host
10522          * physical address (HPA) or a guest physical address (GPA) and must
10523          * point to a physically contiguous block of memory.
10524          */
10525         uint64_t        resp_addr;
10526         /*
10527          * This value is used to identify a Virtual Function (VF).
10528          * The scope of VF ID is local within a PF.
10529          */
10530         uint16_t        vf_id;
10531         uint8_t unused_0[2];
10532         /* Max number of vnic ids in vnic id table */
10533         uint32_t        max_vnic_id_cnt;
10534         /* This is the address for VF VNIC ID table */
10535         uint64_t        vnic_id_tbl_addr;
10536 } __attribute__((packed));
10537
10538 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
10539 struct hwrm_func_vf_vnic_ids_query_output {
10540         /* The specific error status for the command. */
10541         uint16_t        error_code;
10542         /* The HWRM command request type. */
10543         uint16_t        req_type;
10544         /* The sequence ID from the original command. */
10545         uint16_t        seq_id;
10546         /* The length of the response data in number of bytes. */
10547         uint16_t        resp_len;
10548         /*
10549          * Actual number of vnic ids
10550          *
10551          * Each VNIC ID is written as a 32-bit number.
10552          */
10553         uint32_t        vnic_id_cnt;
10554         uint8_t unused_0[3];
10555         /*
10556          * This field is used in Output records to indicate that the output
10557          * is completely written to RAM.  This field should be read as '1'
10558          * to indicate that the output has been completely written.
10559          * When writing a command completion or response to an internal processor,
10560          * the order of writes has to be such that this field is written last.
10561          */
10562         uint8_t valid;
10563 } __attribute__((packed));
10564
10565 /***********************
10566  * hwrm_func_vf_bw_cfg *
10567  ***********************/
10568
10569
10570 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
10571 struct hwrm_func_vf_bw_cfg_input {
10572         /* The HWRM command request type. */
10573         uint16_t        req_type;
10574         /*
10575          * The completion ring to send the completion event on. This should
10576          * be the NQ ID returned from the `nq_alloc` HWRM command.
10577          */
10578         uint16_t        cmpl_ring;
10579         /*
10580          * The sequence ID is used by the driver for tracking multiple
10581          * commands. This ID is treated as opaque data by the firmware and
10582          * the value is returned in the `hwrm_resp_hdr` upon completion.
10583          */
10584         uint16_t        seq_id;
10585         /*
10586          * The target ID of the command:
10587          * * 0x0-0xFFF8 - The function ID
10588          * * 0xFFF8-0xFFFE - Reserved for internal processors
10589          * * 0xFFFF - HWRM
10590          */
10591         uint16_t        target_id;
10592         /*
10593          * A physical address pointer pointing to a host buffer that the
10594          * command's response data will be written. This can be either a host
10595          * physical address (HPA) or a guest physical address (GPA) and must
10596          * point to a physically contiguous block of memory.
10597          */
10598         uint64_t        resp_addr;
10599         /*
10600          * The number of VF functions that are being configured.
10601          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
10602          */
10603         uint16_t        num_vfs;
10604         uint16_t        unused[3];
10605         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
10606         uint16_t        vfn[48];
10607         /* The physical VF id the adjustment will be made to. */
10608         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
10609         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
10610         /*
10611          * This field configures the rate scale percentage of the VF as specified
10612          * by the physical VF id.
10613          */
10614         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
10615         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
10616         /* 0% of the max tx rate */
10617         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
10618                 (UINT32_C(0x0) << 12)
10619         /* 6.66% of the max tx rate */
10620         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
10621                 (UINT32_C(0x1) << 12)
10622         /* 13.33% of the max tx rate */
10623         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
10624                 (UINT32_C(0x2) << 12)
10625         /* 20% of the max tx rate */
10626         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
10627                 (UINT32_C(0x3) << 12)
10628         /* 26.66% of the max tx rate */
10629         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
10630                 (UINT32_C(0x4) << 12)
10631         /* 33% of the max tx rate */
10632         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
10633                 (UINT32_C(0x5) << 12)
10634         /* 40% of the max tx rate */
10635         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
10636                 (UINT32_C(0x6) << 12)
10637         /* 46.66% of the max tx rate */
10638         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
10639                 (UINT32_C(0x7) << 12)
10640         /* 53.33% of the max tx rate */
10641         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
10642                 (UINT32_C(0x8) << 12)
10643         /* 60% of the max tx rate */
10644         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
10645                 (UINT32_C(0x9) << 12)
10646         /* 66.66% of the max tx rate */
10647         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
10648                 (UINT32_C(0xa) << 12)
10649         /* 53.33% of the max tx rate */
10650         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
10651                 (UINT32_C(0xb) << 12)
10652         /* 80% of the max tx rate */
10653         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
10654                 (UINT32_C(0xc) << 12)
10655         /* 86.66% of the max tx rate */
10656         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
10657                 (UINT32_C(0xd) << 12)
10658         /* 93.33% of the max tx rate */
10659         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
10660                 (UINT32_C(0xe) << 12)
10661         /* 100% of the max tx rate */
10662         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
10663                 (UINT32_C(0xf) << 12)
10664         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
10665                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
10666 } __attribute__((packed));
10667
10668 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
10669 struct hwrm_func_vf_bw_cfg_output {
10670         /* The specific error status for the command. */
10671         uint16_t        error_code;
10672         /* The HWRM command request type. */
10673         uint16_t        req_type;
10674         /* The sequence ID from the original command. */
10675         uint16_t        seq_id;
10676         /* The length of the response data in number of bytes. */
10677         uint16_t        resp_len;
10678         uint8_t unused_0[7];
10679         /*
10680          * This field is used in Output records to indicate that the output
10681          * is completely written to RAM.  This field should be read as '1'
10682          * to indicate that the output has been completely written.
10683          * When writing a command completion or response to an internal processor,
10684          * the order of writes has to be such that this field is written last.
10685          */
10686         uint8_t valid;
10687 } __attribute__((packed));
10688
10689 /************************
10690  * hwrm_func_vf_bw_qcfg *
10691  ************************/
10692
10693
10694 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
10695 struct hwrm_func_vf_bw_qcfg_input {
10696         /* The HWRM command request type. */
10697         uint16_t        req_type;
10698         /*
10699          * The completion ring to send the completion event on. This should
10700          * be the NQ ID returned from the `nq_alloc` HWRM command.
10701          */
10702         uint16_t        cmpl_ring;
10703         /*
10704          * The sequence ID is used by the driver for tracking multiple
10705          * commands. This ID is treated as opaque data by the firmware and
10706          * the value is returned in the `hwrm_resp_hdr` upon completion.
10707          */
10708         uint16_t        seq_id;
10709         /*
10710          * The target ID of the command:
10711          * * 0x0-0xFFF8 - The function ID
10712          * * 0xFFF8-0xFFFE - Reserved for internal processors
10713          * * 0xFFFF - HWRM
10714          */
10715         uint16_t        target_id;
10716         /*
10717          * A physical address pointer pointing to a host buffer that the
10718          * command's response data will be written. This can be either a host
10719          * physical address (HPA) or a guest physical address (GPA) and must
10720          * point to a physically contiguous block of memory.
10721          */
10722         uint64_t        resp_addr;
10723         /*
10724          * The number of VF functions that are being queried.
10725          * The inline response space allows the host to query up to 50 VFs'
10726          * rate scale percentage
10727          */
10728         uint16_t        num_vfs;
10729         uint16_t        unused[3];
10730         /* These 16-bit fields contain the VF fid */
10731         uint16_t        vfn[48];
10732         /* The physical VF id of interest */
10733         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
10734         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
10735 } __attribute__((packed));
10736
10737 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
10738 struct hwrm_func_vf_bw_qcfg_output {
10739         /* The specific error status for the command. */
10740         uint16_t        error_code;
10741         /* The HWRM command request type. */
10742         uint16_t        req_type;
10743         /* The sequence ID from the original command. */
10744         uint16_t        seq_id;
10745         /* The length of the response data in number of bytes. */
10746         uint16_t        resp_len;
10747         /*
10748          * The number of VF functions that are being queried.
10749          * The inline response space allows the host to query up to 50 VFs' rate
10750          * scale percentage
10751          */
10752         uint16_t        num_vfs;
10753         uint16_t        unused[3];
10754         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
10755         uint16_t        vfn[48];
10756         /* The physical VF id the adjustment will be made to. */
10757         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
10758         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
10759         /*
10760          * This field configures the rate scale percentage of the VF as specified
10761          * by the physical VF id.
10762          */
10763         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
10764         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
10765         /* 0% of the max tx rate */
10766         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
10767                 (UINT32_C(0x0) << 12)
10768         /* 6.66% of the max tx rate */
10769         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
10770                 (UINT32_C(0x1) << 12)
10771         /* 13.33% of the max tx rate */
10772         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
10773                 (UINT32_C(0x2) << 12)
10774         /* 20% of the max tx rate */
10775         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
10776                 (UINT32_C(0x3) << 12)
10777         /* 26.66% of the max tx rate */
10778         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
10779                 (UINT32_C(0x4) << 12)
10780         /* 33% of the max tx rate */
10781         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
10782                 (UINT32_C(0x5) << 12)
10783         /* 40% of the max tx rate */
10784         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
10785                 (UINT32_C(0x6) << 12)
10786         /* 46.66% of the max tx rate */
10787         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
10788                 (UINT32_C(0x7) << 12)
10789         /* 53.33% of the max tx rate */
10790         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
10791                 (UINT32_C(0x8) << 12)
10792         /* 60% of the max tx rate */
10793         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
10794                 (UINT32_C(0x9) << 12)
10795         /* 66.66% of the max tx rate */
10796         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
10797                 (UINT32_C(0xa) << 12)
10798         /* 53.33% of the max tx rate */
10799         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
10800                 (UINT32_C(0xb) << 12)
10801         /* 80% of the max tx rate */
10802         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
10803                 (UINT32_C(0xc) << 12)
10804         /* 86.66% of the max tx rate */
10805         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
10806                 (UINT32_C(0xd) << 12)
10807         /* 93.33% of the max tx rate */
10808         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
10809                 (UINT32_C(0xe) << 12)
10810         /* 100% of the max tx rate */
10811         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
10812                 (UINT32_C(0xf) << 12)
10813         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
10814                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
10815         uint8_t unused_0[7];
10816         /*
10817          * This field is used in Output records to indicate that the output
10818          * is completely written to RAM.  This field should be read as '1'
10819          * to indicate that the output has been completely written.
10820          * When writing a command completion or response to an internal processor,
10821          * the order of writes has to be such that this field is written last.
10822          */
10823         uint8_t valid;
10824 } __attribute__((packed));
10825
10826 /***************************
10827  * hwrm_func_drv_if_change *
10828  ***************************/
10829
10830
10831 /* hwrm_func_drv_if_change_input (size:192b/24B) */
10832 struct hwrm_func_drv_if_change_input {
10833         /* The HWRM command request type. */
10834         uint16_t        req_type;
10835         /*
10836          * The completion ring to send the completion event on. This should
10837          * be the NQ ID returned from the `nq_alloc` HWRM command.
10838          */
10839         uint16_t        cmpl_ring;
10840         /*
10841          * The sequence ID is used by the driver for tracking multiple
10842          * commands. This ID is treated as opaque data by the firmware and
10843          * the value is returned in the `hwrm_resp_hdr` upon completion.
10844          */
10845         uint16_t        seq_id;
10846         /*
10847          * The target ID of the command:
10848          * * 0x0-0xFFF8 - The function ID
10849          * * 0xFFF8-0xFFFE - Reserved for internal processors
10850          * * 0xFFFF - HWRM
10851          */
10852         uint16_t        target_id;
10853         /*
10854          * A physical address pointer pointing to a host buffer that the
10855          * command's response data will be written. This can be either a host
10856          * physical address (HPA) or a guest physical address (GPA) and must
10857          * point to a physically contiguous block of memory.
10858          */
10859         uint64_t        resp_addr;
10860         uint32_t        flags;
10861         /*
10862          * When this bit is '1', the function driver is indicating
10863          * that the IF state is changing to UP state.  The call should
10864          * be made at the beginning of the driver's open call before
10865          * resources are allocated.  After making the call, the driver
10866          * should check the response to see if any resources may have
10867          * changed (see the response below).  If the driver fails
10868          * the open call, the driver should make this call again with
10869          * this bit cleared to indicate that the IF state is not UP.
10870          * During the driver's close call when the IF state is changing
10871          * to DOWN, the driver should make this call with the bit cleared
10872          * after all resources have been freed.
10873          */
10874         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
10875         uint32_t        unused;
10876 } __attribute__((packed));
10877
10878 /* hwrm_func_drv_if_change_output (size:128b/16B) */
10879 struct hwrm_func_drv_if_change_output {
10880         /* The specific error status for the command. */
10881         uint16_t        error_code;
10882         /* The HWRM command request type. */
10883         uint16_t        req_type;
10884         /* The sequence ID from the original command. */
10885         uint16_t        seq_id;
10886         /* The length of the response data in number of bytes. */
10887         uint16_t        resp_len;
10888         uint32_t        flags;
10889         /*
10890          * When this bit is '1', it indicates that the resources reserved
10891          * for this function may have changed.  The driver should check
10892          * resource capabilities and reserve resources again before
10893          * allocating resources.
10894          */
10895         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
10896                 UINT32_C(0x1)
10897         uint8_t unused_0[3];
10898         /*
10899          * This field is used in Output records to indicate that the output
10900          * is completely written to RAM.  This field should be read as '1'
10901          * to indicate that the output has been completely written.
10902          * When writing a command completion or response to an internal processor,
10903          * the order of writes has to be such that this field is written last.
10904          */
10905         uint8_t valid;
10906 } __attribute__((packed));
10907
10908 /*********************
10909  * hwrm_port_phy_cfg *
10910  *********************/
10911
10912
10913 /* hwrm_port_phy_cfg_input (size:448b/56B) */
10914 struct hwrm_port_phy_cfg_input {
10915         /* The HWRM command request type. */
10916         uint16_t        req_type;
10917         /*
10918          * The completion ring to send the completion event on. This should
10919          * be the NQ ID returned from the `nq_alloc` HWRM command.
10920          */
10921         uint16_t        cmpl_ring;
10922         /*
10923          * The sequence ID is used by the driver for tracking multiple
10924          * commands. This ID is treated as opaque data by the firmware and
10925          * the value is returned in the `hwrm_resp_hdr` upon completion.
10926          */
10927         uint16_t        seq_id;
10928         /*
10929          * The target ID of the command:
10930          * * 0x0-0xFFF8 - The function ID
10931          * * 0xFFF8-0xFFFE - Reserved for internal processors
10932          * * 0xFFFF - HWRM
10933          */
10934         uint16_t        target_id;
10935         /*
10936          * A physical address pointer pointing to a host buffer that the
10937          * command's response data will be written. This can be either a host
10938          * physical address (HPA) or a guest physical address (GPA) and must
10939          * point to a physically contiguous block of memory.
10940          */
10941         uint64_t        resp_addr;
10942         uint32_t        flags;
10943         /*
10944          * When this bit is set to '1', the PHY for the port shall
10945          * be reset.
10946          *
10947          * # If this bit is set to 1, then the HWRM shall reset the
10948          * PHY after applying PHY configuration changes specified
10949          * in this command.
10950          * # In order to guarantee that PHY configuration changes
10951          * specified in this command take effect, the HWRM
10952          * client should set this flag to 1.
10953          * # If this bit is not set to 1, then the HWRM may reset
10954          * the PHY depending on the current PHY configuration and
10955          * settings specified in this command.
10956          */
10957         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
10958                 UINT32_C(0x1)
10959         /* deprecated bit.  Do not use!!! */
10960         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
10961                 UINT32_C(0x2)
10962         /*
10963          * When this bit is set to '1', the link shall be forced to
10964          * the force_link_speed value.
10965          *
10966          * When this bit is set to '1', the HWRM client should
10967          * not enable any of the auto negotiation related
10968          * fields represented by auto_XXX fields in this command.
10969          * When this bit is set to '1' and the HWRM client has
10970          * enabled a auto_XXX field in this command, then the
10971          * HWRM shall ignore the enabled auto_XXX field.
10972          *
10973          * When this bit is set to zero, the link
10974          * shall be allowed to autoneg.
10975          */
10976         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
10977                 UINT32_C(0x4)
10978         /*
10979          * When this bit is set to '1', the auto-negotiation process
10980          * shall be restarted on the link.
10981          */
10982         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
10983                 UINT32_C(0x8)
10984         /*
10985          * When this bit is set to '1', Energy Efficient Ethernet
10986          * (EEE) is requested to be enabled on this link.
10987          * If EEE is not supported on this port, then this flag
10988          * shall be ignored by the HWRM.
10989          */
10990         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
10991                 UINT32_C(0x10)
10992         /*
10993          * When this bit is set to '1', Energy Efficient Ethernet
10994          * (EEE) is requested to be disabled on this link.
10995          * If EEE is not supported on this port, then this flag
10996          * shall be ignored by the HWRM.
10997          */
10998         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
10999                 UINT32_C(0x20)
11000         /*
11001          * When this bit is set to '1' and EEE is enabled on this
11002          * link, then TX LPI is requested to be enabled on the link.
11003          * If EEE is not supported on this port, then this flag
11004          * shall be ignored by the HWRM.
11005          * If EEE is disabled on this port, then this flag shall be
11006          * ignored by the HWRM.
11007          */
11008         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
11009                 UINT32_C(0x40)
11010         /*
11011          * When this bit is set to '1' and EEE is enabled on this
11012          * link, then TX LPI is requested to be disabled on the link.
11013          * If EEE is not supported on this port, then this flag
11014          * shall be ignored by the HWRM.
11015          * If EEE is disabled on this port, then this flag shall be
11016          * ignored by the HWRM.
11017          */
11018         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
11019                 UINT32_C(0x80)
11020         /*
11021          * When set to 1, then the HWRM shall enable FEC autonegotitation
11022          * on this port if supported.
11023          * When set to 0, then this flag shall be ignored.
11024          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
11025          * flag.
11026          */
11027         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
11028                 UINT32_C(0x100)
11029         /*
11030          * When set to 1, then the HWRM shall disable FEC autonegotiation
11031          * on this port if supported.
11032          * When set to 0, then this flag shall be ignored.
11033          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
11034          * flag.
11035          */
11036         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
11037                 UINT32_C(0x200)
11038         /*
11039          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
11040          * on this port if supported.
11041          * When set to 0, then this flag shall be ignored.
11042          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
11043          * flag.
11044          */
11045         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
11046                 UINT32_C(0x400)
11047         /*
11048          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
11049          * on this port if supported.
11050          * When set to 0, then this flag shall be ignored.
11051          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
11052          * flag.
11053          */
11054         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
11055                 UINT32_C(0x800)
11056         /*
11057          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
11058          * on this port if supported.
11059          * When set to 0, then this flag shall be ignored.
11060          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
11061          * flag.
11062          */
11063         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
11064                 UINT32_C(0x1000)
11065         /*
11066          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
11067          * on this port if supported.
11068          * When set to 0, then this flag shall be ignored.
11069          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
11070          * flag.
11071          */
11072         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
11073                 UINT32_C(0x2000)
11074         /*
11075          * When this bit is set to '1', the link shall be forced to
11076          * be taken down.
11077          *
11078          * # When this bit is set to '1", all other
11079          * command input settings related to the link speed shall
11080          * be ignored.
11081          * Once the link state is forced down, it can be
11082          * explicitly cleared from that state by setting this flag
11083          * to '0'.
11084          * # If this flag is set to '0', then the link shall be
11085          * cleared from forced down state if the link is in forced
11086          * down state.
11087          * There may be conditions (e.g. out-of-band or sideband
11088          * configuration changes for the link) outside the scope
11089          * of the HWRM implementation that may clear forced down
11090          * link state.
11091          */
11092         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
11093                 UINT32_C(0x4000)
11094         uint32_t        enables;
11095         /*
11096          * This bit must be '1' for the auto_mode field to be
11097          * configured.
11098          */
11099         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
11100                 UINT32_C(0x1)
11101         /*
11102          * This bit must be '1' for the auto_duplex field to be
11103          * configured.
11104          */
11105         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
11106                 UINT32_C(0x2)
11107         /*
11108          * This bit must be '1' for the auto_pause field to be
11109          * configured.
11110          */
11111         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
11112                 UINT32_C(0x4)
11113         /*
11114          * This bit must be '1' for the auto_link_speed field to be
11115          * configured.
11116          */
11117         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
11118                 UINT32_C(0x8)
11119         /*
11120          * This bit must be '1' for the auto_link_speed_mask field to be
11121          * configured.
11122          */
11123         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
11124                 UINT32_C(0x10)
11125         /*
11126          * This bit must be '1' for the wirespeed field to be
11127          * configured.
11128          */
11129         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
11130                 UINT32_C(0x20)
11131         /*
11132          * This bit must be '1' for the lpbk field to be
11133          * configured.
11134          */
11135         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
11136                 UINT32_C(0x40)
11137         /*
11138          * This bit must be '1' for the preemphasis field to be
11139          * configured.
11140          */
11141         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
11142                 UINT32_C(0x80)
11143         /*
11144          * This bit must be '1' for the force_pause field to be
11145          * configured.
11146          */
11147         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
11148                 UINT32_C(0x100)
11149         /*
11150          * This bit must be '1' for the eee_link_speed_mask field to be
11151          * configured.
11152          */
11153         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
11154                 UINT32_C(0x200)
11155         /*
11156          * This bit must be '1' for the tx_lpi_timer field to be
11157          * configured.
11158          */
11159         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
11160                 UINT32_C(0x400)
11161         /* Port ID of port that is to be configured. */
11162         uint16_t        port_id;
11163         /*
11164          * This is the speed that will be used if the force
11165          * bit is '1'.  If unsupported speed is selected, an error
11166          * will be generated.
11167          */
11168         uint16_t        force_link_speed;
11169         /* 100Mb link speed */
11170         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
11171         /* 1Gb link speed */
11172         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
11173         /* 2Gb link speed */
11174         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
11175         /* 25Gb link speed */
11176         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
11177         /* 10Gb link speed */
11178         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
11179         /* 20Mb link speed */
11180         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
11181         /* 25Gb link speed */
11182         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
11183         /* 40Gb link speed */
11184         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
11185         /* 50Gb link speed */
11186         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
11187         /* 100Gb link speed */
11188         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
11189         /* 200Gb link speed */
11190         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_200GB UINT32_C(0x7d0)
11191         /* 10Mb link speed */
11192         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
11193         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
11194                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
11195         /*
11196          * This value is used to identify what autoneg mode is
11197          * used when the link speed is not being forced.
11198          */
11199         uint8_t auto_mode;
11200         /* Disable autoneg or autoneg disabled. No speeds are selected. */
11201         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
11202         /* Select all possible speeds for autoneg mode. */
11203         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
11204         /*
11205          * Select only the auto_link_speed speed for autoneg mode. This mode has
11206          * been DEPRECATED. An HWRM client should not use this mode.
11207          */
11208         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
11209         /*
11210          * Select the auto_link_speed or any speed below that speed for autoneg.
11211          * This mode has been DEPRECATED. An HWRM client should not use this mode.
11212          */
11213         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
11214         /*
11215          * Select the speeds based on the corresponding link speed mask value
11216          * that is provided.
11217          */
11218         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
11219         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
11220                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
11221         /*
11222          * This is the duplex setting that will be used if the autoneg_mode
11223          * is "one_speed" or "one_or_below".
11224          */
11225         uint8_t auto_duplex;
11226         /* Half Duplex will be requested. */
11227         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
11228         /* Full duplex will be requested. */
11229         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
11230         /* Both Half and Full dupex will be requested. */
11231         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
11232         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
11233                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
11234         /*
11235          * This value is used to configure the pause that will be
11236          * used for autonegotiation.
11237          * Add text on the usage of auto_pause and force_pause.
11238          */
11239         uint8_t auto_pause;
11240         /*
11241          * When this bit is '1', Generation of tx pause messages
11242          * has been requested. Disabled otherwise.
11243          */
11244         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
11245                 UINT32_C(0x1)
11246         /*
11247          * When this bit is '1', Reception of rx pause messages
11248          * has been requested. Disabled otherwise.
11249          */
11250         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
11251                 UINT32_C(0x2)
11252         /*
11253          * When set to 1, the advertisement of pause is enabled.
11254          *
11255          * # When the auto_mode is not set to none and this flag is
11256          * set to 1, then the auto_pause bits on this port are being
11257          * advertised and autoneg pause results are being interpreted.
11258          * # When the auto_mode is not set to none and this
11259          * flag is set to 0, the pause is forced as indicated in
11260          * force_pause, and also advertised as auto_pause bits, but
11261          * the autoneg results are not interpreted since the pause
11262          * configuration is being forced.
11263          * # When the auto_mode is set to none and this flag is set to
11264          * 1, auto_pause bits should be ignored and should be set to 0.
11265          */
11266         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
11267                 UINT32_C(0x4)
11268         uint8_t unused_0;
11269         /*
11270          * This is the speed that will be used if the autoneg_mode
11271          * is "one_speed" or "one_or_below".  If an unsupported speed
11272          * is selected, an error will be generated.
11273          */
11274         uint16_t        auto_link_speed;
11275         /* 100Mb link speed */
11276         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
11277         /* 1Gb link speed */
11278         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
11279         /* 2Gb link speed */
11280         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
11281         /* 25Gb link speed */
11282         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
11283         /* 10Gb link speed */
11284         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
11285         /* 20Mb link speed */
11286         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
11287         /* 25Gb link speed */
11288         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
11289         /* 40Gb link speed */
11290         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
11291         /* 50Gb link speed */
11292         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
11293         /* 100Gb link speed */
11294         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
11295         /* 200Gb link speed */
11296         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
11297         /* 10Mb link speed */
11298         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
11299         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
11300                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
11301         /*
11302          * This is a mask of link speeds that will be used if
11303          * autoneg_mode is "mask".  If unsupported speed is enabled
11304          * an error will be generated.
11305          */
11306         uint16_t        auto_link_speed_mask;
11307         /* 100Mb link speed (Half-duplex) */
11308         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
11309                 UINT32_C(0x1)
11310         /* 100Mb link speed (Full-duplex) */
11311         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
11312                 UINT32_C(0x2)
11313         /* 1Gb link speed (Half-duplex) */
11314         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
11315                 UINT32_C(0x4)
11316         /* 1Gb link speed (Full-duplex) */
11317         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
11318                 UINT32_C(0x8)
11319         /* 2Gb link speed */
11320         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
11321                 UINT32_C(0x10)
11322         /* 25Gb link speed */
11323         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
11324                 UINT32_C(0x20)
11325         /* 10Gb link speed */
11326         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
11327                 UINT32_C(0x40)
11328         /* 20Gb link speed */
11329         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
11330                 UINT32_C(0x80)
11331         /* 25Gb link speed */
11332         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
11333                 UINT32_C(0x100)
11334         /* 40Gb link speed */
11335         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
11336                 UINT32_C(0x200)
11337         /* 50Gb link speed */
11338         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
11339                 UINT32_C(0x400)
11340         /* 100Gb link speed */
11341         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
11342                 UINT32_C(0x800)
11343         /* 10Mb link speed (Half-duplex) */
11344         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
11345                 UINT32_C(0x1000)
11346         /* 10Mb link speed (Full-duplex) */
11347         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
11348                 UINT32_C(0x2000)
11349         /* 200Gb link speed */
11350         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_200GB \
11351                 UINT32_C(0x4000)
11352         /* This value controls the wirespeed feature. */
11353         uint8_t wirespeed;
11354         /* Wirespeed feature is disabled. */
11355         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
11356         /* Wirespeed feature is enabled. */
11357         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
11358         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
11359                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
11360         /* This value controls the loopback setting for the PHY. */
11361         uint8_t lpbk;
11362         /* No loopback is selected.  Normal operation. */
11363         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
11364         /*
11365          * The HW will be configured with local loopback such that
11366          * host data is sent back to the host without modification.
11367          */
11368         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
11369         /*
11370          * The HW will be configured with remote loopback such that
11371          * port logic will send packets back out the transmitter that
11372          * are received.
11373          */
11374         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
11375         /*
11376          * The HW will be configured with external loopback such that
11377          * host data is sent on the trasmitter and based on the external
11378          * loopback connection the data will be received without modification.
11379          */
11380         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
11381         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
11382                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
11383         /*
11384          * This value is used to configure the pause that will be
11385          * used for force mode.
11386          */
11387         uint8_t force_pause;
11388         /*
11389          * When this bit is '1', Generation of tx pause messages
11390          * is supported. Disabled otherwise.
11391          */
11392         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
11393         /*
11394          * When this bit is '1', Reception of rx pause messages
11395          * is supported. Disabled otherwise.
11396          */
11397         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
11398         uint8_t unused_1;
11399         /*
11400          * This value controls the pre-emphasis to be used for the
11401          * link.  Driver should not set this value (use
11402          * enable.preemphasis = 0) unless driver is sure of setting.
11403          * Normally HWRM FW will determine proper pre-emphasis.
11404          */
11405         uint32_t        preemphasis;
11406         /*
11407          * Setting for link speed mask that is used to
11408          * advertise speeds during autonegotiation when EEE is enabled.
11409          * This field is valid only when EEE is enabled.
11410          * The speeds specified in this field shall be a subset of
11411          * speeds specified in auto_link_speed_mask.
11412          * If EEE is enabled,then at least one speed shall be provided
11413          * in this mask.
11414          */
11415         uint16_t        eee_link_speed_mask;
11416         /* Reserved */
11417         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
11418                 UINT32_C(0x1)
11419         /* 100Mb link speed (Full-duplex) */
11420         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
11421                 UINT32_C(0x2)
11422         /* Reserved */
11423         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
11424                 UINT32_C(0x4)
11425         /* 1Gb link speed (Full-duplex) */
11426         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
11427                 UINT32_C(0x8)
11428         /* Reserved */
11429         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
11430                 UINT32_C(0x10)
11431         /* Reserved */
11432         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
11433                 UINT32_C(0x20)
11434         /* 10Gb link speed */
11435         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
11436                 UINT32_C(0x40)
11437         uint8_t unused_2[2];
11438         /*
11439          * Reuested setting of TX LPI timer in microseconds.
11440          * This field is valid only when EEE is enabled and TX LPI is
11441          * enabled.
11442          */
11443         uint32_t        tx_lpi_timer;
11444         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
11445         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
11446         uint32_t        unused_3;
11447 } __attribute__((packed));
11448
11449 /* hwrm_port_phy_cfg_output (size:128b/16B) */
11450 struct hwrm_port_phy_cfg_output {
11451         /* The specific error status for the command. */
11452         uint16_t        error_code;
11453         /* The HWRM command request type. */
11454         uint16_t        req_type;
11455         /* The sequence ID from the original command. */
11456         uint16_t        seq_id;
11457         /* The length of the response data in number of bytes. */
11458         uint16_t        resp_len;
11459         uint8_t unused_0[7];
11460         /*
11461          * This field is used in Output records to indicate that the output
11462          * is completely written to RAM.  This field should be read as '1'
11463          * to indicate that the output has been completely written.
11464          * When writing a command completion or response to an internal processor,
11465          * the order of writes has to be such that this field is written last.
11466          */
11467         uint8_t valid;
11468 } __attribute__((packed));
11469
11470 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
11471 struct hwrm_port_phy_cfg_cmd_err {
11472         /*
11473          * command specific error codes that goes to
11474          * the cmd_err field in Common HWRM Error Response.
11475          */
11476         uint8_t code;
11477         /* Unknown error */
11478         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
11479         /* Unable to complete operation due to invalid speed */
11480         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
11481         /*
11482          * retry the command since the phy is not ready.
11483          * retry count is returned in opaque_0.
11484          * This is only valid for the first command and
11485          * this value will not change for successive calls.
11486          * but if a 0 is returned at any time then this should
11487          * be treated as an un recoverable failure,
11488          *
11489          * retry interval in milli seconds is returned in opaque_1.
11490          * This specifies the time that user should wait before
11491          * issuing the next port_phy_cfg command.
11492          */
11493         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
11494         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
11495                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
11496         uint8_t unused_0[7];
11497 } __attribute__((packed));
11498
11499 /**********************
11500  * hwrm_port_phy_qcfg *
11501  **********************/
11502
11503
11504 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
11505 struct hwrm_port_phy_qcfg_input {
11506         /* The HWRM command request type. */
11507         uint16_t        req_type;
11508         /*
11509          * The completion ring to send the completion event on. This should
11510          * be the NQ ID returned from the `nq_alloc` HWRM command.
11511          */
11512         uint16_t        cmpl_ring;
11513         /*
11514          * The sequence ID is used by the driver for tracking multiple
11515          * commands. This ID is treated as opaque data by the firmware and
11516          * the value is returned in the `hwrm_resp_hdr` upon completion.
11517          */
11518         uint16_t        seq_id;
11519         /*
11520          * The target ID of the command:
11521          * * 0x0-0xFFF8 - The function ID
11522          * * 0xFFF8-0xFFFE - Reserved for internal processors
11523          * * 0xFFFF - HWRM
11524          */
11525         uint16_t        target_id;
11526         /*
11527          * A physical address pointer pointing to a host buffer that the
11528          * command's response data will be written. This can be either a host
11529          * physical address (HPA) or a guest physical address (GPA) and must
11530          * point to a physically contiguous block of memory.
11531          */
11532         uint64_t        resp_addr;
11533         /* Port ID of port that is to be queried. */
11534         uint16_t        port_id;
11535         uint8_t unused_0[6];
11536 } __attribute__((packed));
11537
11538 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
11539 struct hwrm_port_phy_qcfg_output {
11540         /* The specific error status for the command. */
11541         uint16_t        error_code;
11542         /* The HWRM command request type. */
11543         uint16_t        req_type;
11544         /* The sequence ID from the original command. */
11545         uint16_t        seq_id;
11546         /* The length of the response data in number of bytes. */
11547         uint16_t        resp_len;
11548         /* This value indicates the current link status. */
11549         uint8_t link;
11550         /* There is no link or cable detected. */
11551         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
11552         /* There is no link, but a cable has been detected. */
11553         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
11554         /* There is a link. */
11555         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
11556         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
11557                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
11558         uint8_t unused_0;
11559         /* This value indicates the current link speed of the connection. */
11560         uint16_t        link_speed;
11561         /* 100Mb link speed */
11562         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
11563         /* 1Gb link speed */
11564         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
11565         /* 2Gb link speed */
11566         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
11567         /* 25Gb link speed */
11568         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
11569         /* 10Gb link speed */
11570         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
11571         /* 20Mb link speed */
11572         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
11573         /* 25Gb link speed */
11574         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
11575         /* 40Gb link speed */
11576         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
11577         /* 50Gb link speed */
11578         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
11579         /* 100Gb link speed */
11580         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
11581         /* 200Gb link speed */
11582         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
11583         /* 10Mb link speed */
11584         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
11585         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
11586                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
11587         /*
11588          * This value is indicates the duplex of the current
11589          * configuration.
11590          */
11591         uint8_t duplex_cfg;
11592         /* Half Duplex connection. */
11593         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
11594         /* Full duplex connection. */
11595         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
11596         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
11597                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
11598         /*
11599          * This value is used to indicate the current
11600          * pause configuration. When autoneg is enabled, this value
11601          * represents the autoneg results of pause configuration.
11602          */
11603         uint8_t pause;
11604         /*
11605          * When this bit is '1', Generation of tx pause messages
11606          * is supported. Disabled otherwise.
11607          */
11608         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
11609         /*
11610          * When this bit is '1', Reception of rx pause messages
11611          * is supported. Disabled otherwise.
11612          */
11613         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
11614         /*
11615          * The supported speeds for the port. This is a bit mask.
11616          * For each speed that is supported, the corrresponding
11617          * bit will be set to '1'.
11618          */
11619         uint16_t        support_speeds;
11620         /* 100Mb link speed (Half-duplex) */
11621         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
11622                 UINT32_C(0x1)
11623         /* 100Mb link speed (Full-duplex) */
11624         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
11625                 UINT32_C(0x2)
11626         /* 1Gb link speed (Half-duplex) */
11627         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
11628                 UINT32_C(0x4)
11629         /* 1Gb link speed (Full-duplex) */
11630         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
11631                 UINT32_C(0x8)
11632         /* 2Gb link speed */
11633         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
11634                 UINT32_C(0x10)
11635         /* 25Gb link speed */
11636         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
11637                 UINT32_C(0x20)
11638         /* 10Gb link speed */
11639         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
11640                 UINT32_C(0x40)
11641         /* 20Gb link speed */
11642         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
11643                 UINT32_C(0x80)
11644         /* 25Gb link speed */
11645         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
11646                 UINT32_C(0x100)
11647         /* 40Gb link speed */
11648         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
11649                 UINT32_C(0x200)
11650         /* 50Gb link speed */
11651         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
11652                 UINT32_C(0x400)
11653         /* 100Gb link speed */
11654         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
11655                 UINT32_C(0x800)
11656         /* 10Mb link speed (Half-duplex) */
11657         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
11658                 UINT32_C(0x1000)
11659         /* 10Mb link speed (Full-duplex) */
11660         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
11661                 UINT32_C(0x2000)
11662         /* 200Gb link speed */
11663         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB \
11664                 UINT32_C(0x4000)
11665         /*
11666          * Current setting of forced link speed.
11667          * When the link speed is not being forced, this
11668          * value shall be set to 0.
11669          */
11670         uint16_t        force_link_speed;
11671         /* 100Mb link speed */
11672         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
11673         /* 1Gb link speed */
11674         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
11675         /* 2Gb link speed */
11676         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
11677         /* 25Gb link speed */
11678         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
11679         /* 10Gb link speed */
11680         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
11681         /* 20Mb link speed */
11682         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
11683         /* 25Gb link speed */
11684         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
11685         /* 40Gb link speed */
11686         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
11687                 UINT32_C(0x190)
11688         /* 50Gb link speed */
11689         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
11690                 UINT32_C(0x1f4)
11691         /* 100Gb link speed */
11692         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
11693                 UINT32_C(0x3e8)
11694         /* 200Gb link speed */
11695         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_200GB \
11696                 UINT32_C(0x7d0)
11697         /* 10Mb link speed */
11698         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
11699                 UINT32_C(0xffff)
11700         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
11701                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
11702         /* Current setting of auto negotiation mode. */
11703         uint8_t auto_mode;
11704         /* Disable autoneg or autoneg disabled. No speeds are selected. */
11705         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
11706         /* Select all possible speeds for autoneg mode. */
11707         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
11708         /*
11709          * Select only the auto_link_speed speed for autoneg mode. This mode has
11710          * been DEPRECATED. An HWRM client should not use this mode.
11711          */
11712         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
11713         /*
11714          * Select the auto_link_speed or any speed below that speed for autoneg.
11715          * This mode has been DEPRECATED. An HWRM client should not use this mode.
11716          */
11717         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
11718         /*
11719          * Select the speeds based on the corresponding link speed mask value
11720          * that is provided.
11721          */
11722         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
11723         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
11724                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
11725         /*
11726          * Current setting of pause autonegotiation.
11727          * Move autoneg_pause flag here.
11728          */
11729         uint8_t auto_pause;
11730         /*
11731          * When this bit is '1', Generation of tx pause messages
11732          * has been requested. Disabled otherwise.
11733          */
11734         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
11735                 UINT32_C(0x1)
11736         /*
11737          * When this bit is '1', Reception of rx pause messages
11738          * has been requested. Disabled otherwise.
11739          */
11740         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
11741                 UINT32_C(0x2)
11742         /*
11743          * When set to 1, the advertisement of pause is enabled.
11744          *
11745          * # When the auto_mode is not set to none and this flag is
11746          * set to 1, then the auto_pause bits on this port are being
11747          * advertised and autoneg pause results are being interpreted.
11748          * # When the auto_mode is not set to none and this
11749          * flag is set to 0, the pause is forced as indicated in
11750          * force_pause, and also advertised as auto_pause bits, but
11751          * the autoneg results are not interpreted since the pause
11752          * configuration is being forced.
11753          * # When the auto_mode is set to none and this flag is set to
11754          * 1, auto_pause bits should be ignored and should be set to 0.
11755          */
11756         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
11757                 UINT32_C(0x4)
11758         /*
11759          * Current setting for auto_link_speed. This field is only
11760          * valid when auto_mode is set to "one_speed" or "one_or_below".
11761          */
11762         uint16_t        auto_link_speed;
11763         /* 100Mb link speed */
11764         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
11765         /* 1Gb link speed */
11766         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
11767         /* 2Gb link speed */
11768         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
11769         /* 25Gb link speed */
11770         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
11771         /* 10Gb link speed */
11772         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
11773         /* 20Mb link speed */
11774         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
11775         /* 25Gb link speed */
11776         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
11777         /* 40Gb link speed */
11778         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
11779         /* 50Gb link speed */
11780         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
11781         /* 100Gb link speed */
11782         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
11783         /* 200Gb link speed */
11784         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
11785         /* 10Mb link speed */
11786         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
11787                 UINT32_C(0xffff)
11788         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
11789                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
11790         /*
11791          * Current setting for auto_link_speed_mask that is used to
11792          * advertise speeds during autonegotiation.
11793          * This field is only valid when auto_mode is set to "mask".
11794          * The speeds specified in this field shall be a subset of
11795          * supported speeds on this port.
11796          */
11797         uint16_t        auto_link_speed_mask;
11798         /* 100Mb link speed (Half-duplex) */
11799         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
11800                 UINT32_C(0x1)
11801         /* 100Mb link speed (Full-duplex) */
11802         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
11803                 UINT32_C(0x2)
11804         /* 1Gb link speed (Half-duplex) */
11805         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
11806                 UINT32_C(0x4)
11807         /* 1Gb link speed (Full-duplex) */
11808         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
11809                 UINT32_C(0x8)
11810         /* 2Gb link speed */
11811         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
11812                 UINT32_C(0x10)
11813         /* 25Gb link speed */
11814         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
11815                 UINT32_C(0x20)
11816         /* 10Gb link speed */
11817         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
11818                 UINT32_C(0x40)
11819         /* 20Gb link speed */
11820         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
11821                 UINT32_C(0x80)
11822         /* 25Gb link speed */
11823         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
11824                 UINT32_C(0x100)
11825         /* 40Gb link speed */
11826         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
11827                 UINT32_C(0x200)
11828         /* 50Gb link speed */
11829         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
11830                 UINT32_C(0x400)
11831         /* 100Gb link speed */
11832         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
11833                 UINT32_C(0x800)
11834         /* 10Mb link speed (Half-duplex) */
11835         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
11836                 UINT32_C(0x1000)
11837         /* 10Mb link speed (Full-duplex) */
11838         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
11839                 UINT32_C(0x2000)
11840         /* 200Gb link speed */
11841         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_200GB \
11842                 UINT32_C(0x4000)
11843         /* Current setting for wirespeed. */
11844         uint8_t wirespeed;
11845         /* Wirespeed feature is disabled. */
11846         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
11847         /* Wirespeed feature is enabled. */
11848         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
11849         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
11850                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
11851         /* Current setting for loopback. */
11852         uint8_t lpbk;
11853         /* No loopback is selected.  Normal operation. */
11854         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
11855         /*
11856          * The HW will be configured with local loopback such that
11857          * host data is sent back to the host without modification.
11858          */
11859         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
11860         /*
11861          * The HW will be configured with remote loopback such that
11862          * port logic will send packets back out the transmitter that
11863          * are received.
11864          */
11865         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
11866         /*
11867          * The HW will be configured with external loopback such that
11868          * host data is sent on the trasmitter and based on the external
11869          * loopback connection the data will be received without modification.
11870          */
11871         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
11872         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
11873                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
11874         /*
11875          * Current setting of forced pause.
11876          * When the pause configuration is not being forced, then
11877          * this value shall be set to 0.
11878          */
11879         uint8_t force_pause;
11880         /*
11881          * When this bit is '1', Generation of tx pause messages
11882          * is supported. Disabled otherwise.
11883          */
11884         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
11885         /*
11886          * When this bit is '1', Reception of rx pause messages
11887          * is supported. Disabled otherwise.
11888          */
11889         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
11890         /*
11891          * This value indicates the current status of the optics module on
11892          * this port.
11893          */
11894         uint8_t module_status;
11895         /* Module is inserted and accepted */
11896         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
11897                 UINT32_C(0x0)
11898         /* Module is rejected and transmit side Laser is disabled. */
11899         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
11900                 UINT32_C(0x1)
11901         /* Module mismatch warning. */
11902         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
11903                 UINT32_C(0x2)
11904         /* Module is rejected and powered down. */
11905         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
11906                 UINT32_C(0x3)
11907         /* Module is not inserted. */
11908         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
11909                 UINT32_C(0x4)
11910         /* Module status is not applicable. */
11911         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
11912                 UINT32_C(0xff)
11913         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
11914                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
11915         /* Current setting for preemphasis. */
11916         uint32_t        preemphasis;
11917         /* This field represents the major version of the PHY. */
11918         uint8_t phy_maj;
11919         /* This field represents the minor version of the PHY. */
11920         uint8_t phy_min;
11921         /* This field represents the build version of the PHY. */
11922         uint8_t phy_bld;
11923         /* This value represents a PHY type. */
11924         uint8_t phy_type;
11925         /* Unknown */
11926         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
11927                 UINT32_C(0x0)
11928         /* BASE-CR */
11929         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
11930                 UINT32_C(0x1)
11931         /* BASE-KR4 (Deprecated) */
11932         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
11933                 UINT32_C(0x2)
11934         /* BASE-LR */
11935         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
11936                 UINT32_C(0x3)
11937         /* BASE-SR */
11938         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
11939                 UINT32_C(0x4)
11940         /* BASE-KR2 (Deprecated) */
11941         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
11942                 UINT32_C(0x5)
11943         /* BASE-KX */
11944         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
11945                 UINT32_C(0x6)
11946         /* BASE-KR */
11947         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
11948                 UINT32_C(0x7)
11949         /* BASE-T */
11950         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
11951                 UINT32_C(0x8)
11952         /* EEE capable BASE-T */
11953         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
11954                 UINT32_C(0x9)
11955         /* SGMII connected external PHY */
11956         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
11957                 UINT32_C(0xa)
11958         /* 25G_BASECR_CA_L */
11959         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
11960                 UINT32_C(0xb)
11961         /* 25G_BASECR_CA_S */
11962         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
11963                 UINT32_C(0xc)
11964         /* 25G_BASECR_CA_N */
11965         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
11966                 UINT32_C(0xd)
11967         /* 25G_BASESR */
11968         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
11969                 UINT32_C(0xe)
11970         /* 100G_BASECR4 */
11971         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
11972                 UINT32_C(0xf)
11973         /* 100G_BASESR4 */
11974         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
11975                 UINT32_C(0x10)
11976         /* 100G_BASELR4 */
11977         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
11978                 UINT32_C(0x11)
11979         /* 100G_BASEER4 */
11980         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
11981                 UINT32_C(0x12)
11982         /* 100G_BASESR10 */
11983         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
11984                 UINT32_C(0x13)
11985         /* 40G_BASECR4 */
11986         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
11987                 UINT32_C(0x14)
11988         /* 40G_BASESR4 */
11989         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
11990                 UINT32_C(0x15)
11991         /* 40G_BASELR4 */
11992         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
11993                 UINT32_C(0x16)
11994         /* 40G_BASEER4 */
11995         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
11996                 UINT32_C(0x17)
11997         /* 40G_ACTIVE_CABLE */
11998         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
11999                 UINT32_C(0x18)
12000         /* 1G_baseT */
12001         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
12002                 UINT32_C(0x19)
12003         /* 1G_baseSX */
12004         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
12005                 UINT32_C(0x1a)
12006         /* 1G_baseCX */
12007         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
12008                 UINT32_C(0x1b)
12009         /* 100G_BASECR4 */
12010         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
12011                 UINT32_C(0x1c)
12012         /* 100G_BASESR4 */
12013         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
12014                 UINT32_C(0x1d)
12015         /* 100G_BASELR4 */
12016         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
12017                 UINT32_C(0x1e)
12018         /* 100G_BASEER4 */
12019         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
12020                 UINT32_C(0x1f)
12021         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
12022                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
12023         /* This value represents a media type. */
12024         uint8_t media_type;
12025         /* Unknown */
12026         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
12027         /* Twisted Pair */
12028         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
12029         /* Direct Attached Copper */
12030         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
12031         /* Fiber */
12032         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
12033         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
12034                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
12035         /* This value represents a transceiver type. */
12036         uint8_t xcvr_pkg_type;
12037         /* PHY and MAC are in the same package */
12038         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
12039                 UINT32_C(0x1)
12040         /* PHY and MAC are in different packages */
12041         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
12042                 UINT32_C(0x2)
12043         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
12044                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
12045         uint8_t eee_config_phy_addr;
12046         /* This field represents PHY address. */
12047         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
12048                 UINT32_C(0x1f)
12049         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
12050         /*
12051          * This field represents flags related to EEE configuration.
12052          * These EEE configuration flags are valid only when the
12053          * auto_mode is not set to none (in other words autonegotiation
12054          * is enabled).
12055          */
12056         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
12057                 UINT32_C(0xe0)
12058         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
12059         /*
12060          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
12061          * Speeds for autoneg with EEE mode enabled
12062          * are based on eee_link_speed_mask.
12063          */
12064         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
12065                 UINT32_C(0x20)
12066         /*
12067          * This flag is valid only when eee_enabled is set to 1.
12068          *
12069          * # If eee_enabled is set to 0, then EEE mode is disabled
12070          * and this flag shall be ignored.
12071          * # If eee_enabled is set to 1 and this flag is set to 1,
12072          * then Energy Efficient Ethernet (EEE) mode is enabled
12073          * and in use.
12074          * # If eee_enabled is set to 1 and this flag is set to 0,
12075          * then Energy Efficient Ethernet (EEE) mode is enabled
12076          * but is currently not in use.
12077          */
12078         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
12079                 UINT32_C(0x40)
12080         /*
12081          * This flag is valid only when eee_enabled is set to 1.
12082          *
12083          * # If eee_enabled is set to 0, then EEE mode is disabled
12084          * and this flag shall be ignored.
12085          * # If eee_enabled is set to 1 and this flag is set to 1,
12086          * then Energy Efficient Ethernet (EEE) mode is enabled
12087          * and TX LPI is enabled.
12088          * # If eee_enabled is set to 1 and this flag is set to 0,
12089          * then Energy Efficient Ethernet (EEE) mode is enabled
12090          * but TX LPI is disabled.
12091          */
12092         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
12093                 UINT32_C(0x80)
12094         /*
12095          * When set to 1, the parallel detection is used to determine
12096          * the speed of the link partner.
12097          *
12098          * Parallel detection is used when a autonegotiation capable
12099          * device is connected to a link parter that is not capable
12100          * of autonegotiation.
12101          */
12102         uint8_t parallel_detect;
12103         /*
12104          * When set to 1, the parallel detection is used to determine
12105          * the speed of the link partner.
12106          *
12107          * Parallel detection is used when a autonegotiation capable
12108          * device is connected to a link parter that is not capable
12109          * of autonegotiation.
12110          */
12111         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
12112         /*
12113          * The advertised speeds for the port by the link partner.
12114          * Each advertised speed will be set to '1'.
12115          */
12116         uint16_t        link_partner_adv_speeds;
12117         /* 100Mb link speed (Half-duplex) */
12118         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
12119                 UINT32_C(0x1)
12120         /* 100Mb link speed (Full-duplex) */
12121         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
12122                 UINT32_C(0x2)
12123         /* 1Gb link speed (Half-duplex) */
12124         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
12125                 UINT32_C(0x4)
12126         /* 1Gb link speed (Full-duplex) */
12127         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
12128                 UINT32_C(0x8)
12129         /* 2Gb link speed */
12130         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
12131                 UINT32_C(0x10)
12132         /* 25Gb link speed */
12133         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
12134                 UINT32_C(0x20)
12135         /* 10Gb link speed */
12136         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
12137                 UINT32_C(0x40)
12138         /* 20Gb link speed */
12139         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
12140                 UINT32_C(0x80)
12141         /* 25Gb link speed */
12142         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
12143                 UINT32_C(0x100)
12144         /* 40Gb link speed */
12145         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
12146                 UINT32_C(0x200)
12147         /* 50Gb link speed */
12148         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
12149                 UINT32_C(0x400)
12150         /* 100Gb link speed */
12151         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
12152                 UINT32_C(0x800)
12153         /* 10Mb link speed (Half-duplex) */
12154         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
12155                 UINT32_C(0x1000)
12156         /* 10Mb link speed (Full-duplex) */
12157         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
12158                 UINT32_C(0x2000)
12159         /*
12160          * The advertised autoneg for the port by the link partner.
12161          * This field is deprecated and should be set to 0.
12162          */
12163         uint8_t link_partner_adv_auto_mode;
12164         /* Disable autoneg or autoneg disabled. No speeds are selected. */
12165         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
12166                 UINT32_C(0x0)
12167         /* Select all possible speeds for autoneg mode. */
12168         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
12169                 UINT32_C(0x1)
12170         /*
12171          * Select only the auto_link_speed speed for autoneg mode. This mode has
12172          * been DEPRECATED. An HWRM client should not use this mode.
12173          */
12174         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
12175                 UINT32_C(0x2)
12176         /*
12177          * Select the auto_link_speed or any speed below that speed for autoneg.
12178          * This mode has been DEPRECATED. An HWRM client should not use this mode.
12179          */
12180         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
12181                 UINT32_C(0x3)
12182         /*
12183          * Select the speeds based on the corresponding link speed mask value
12184          * that is provided.
12185          */
12186         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
12187                 UINT32_C(0x4)
12188         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
12189                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
12190         /* The advertised pause settings on the port by the link partner. */
12191         uint8_t link_partner_adv_pause;
12192         /*
12193          * When this bit is '1', Generation of tx pause messages
12194          * is supported. Disabled otherwise.
12195          */
12196         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
12197                 UINT32_C(0x1)
12198         /*
12199          * When this bit is '1', Reception of rx pause messages
12200          * is supported. Disabled otherwise.
12201          */
12202         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
12203                 UINT32_C(0x2)
12204         /*
12205          * Current setting for link speed mask that is used to
12206          * advertise speeds during autonegotiation when EEE is enabled.
12207          * This field is valid only when eee_enabled flags is set to 1.
12208          * The speeds specified in this field shall be a subset of
12209          * speeds specified in auto_link_speed_mask.
12210          */
12211         uint16_t        adv_eee_link_speed_mask;
12212         /* Reserved */
12213         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
12214                 UINT32_C(0x1)
12215         /* 100Mb link speed (Full-duplex) */
12216         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
12217                 UINT32_C(0x2)
12218         /* Reserved */
12219         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
12220                 UINT32_C(0x4)
12221         /* 1Gb link speed (Full-duplex) */
12222         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
12223                 UINT32_C(0x8)
12224         /* Reserved */
12225         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
12226                 UINT32_C(0x10)
12227         /* Reserved */
12228         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
12229                 UINT32_C(0x20)
12230         /* 10Gb link speed */
12231         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
12232                 UINT32_C(0x40)
12233         /*
12234          * Current setting for link speed mask that is advertised by
12235          * the link partner when EEE is enabled.
12236          * This field is valid only when eee_enabled flags is set to 1.
12237          */
12238         uint16_t        link_partner_adv_eee_link_speed_mask;
12239         /* Reserved */
12240         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
12241                 UINT32_C(0x1)
12242         /* 100Mb link speed (Full-duplex) */
12243         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
12244                 UINT32_C(0x2)
12245         /* Reserved */
12246         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
12247                 UINT32_C(0x4)
12248         /* 1Gb link speed (Full-duplex) */
12249         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
12250                 UINT32_C(0x8)
12251         /* Reserved */
12252         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
12253                 UINT32_C(0x10)
12254         /* Reserved */
12255         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
12256                 UINT32_C(0x20)
12257         /* 10Gb link speed */
12258         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
12259                 UINT32_C(0x40)
12260         uint32_t        xcvr_identifier_type_tx_lpi_timer;
12261         /*
12262          * Current setting of TX LPI timer in microseconds.
12263          * This field is valid only when_eee_enabled flag is set to 1
12264          * and tx_lpi_enabled is set to 1.
12265          */
12266         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
12267                 UINT32_C(0xffffff)
12268         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
12269         /* This value represents transceiver identifier type. */
12270         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
12271                 UINT32_C(0xff000000)
12272         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
12273         /* Unknown */
12274         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
12275                 (UINT32_C(0x0) << 24)
12276         /* SFP/SFP+/SFP28 */
12277         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
12278                 (UINT32_C(0x3) << 24)
12279         /* QSFP+ */
12280         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
12281                 (UINT32_C(0xc) << 24)
12282         /* QSFP+ */
12283         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
12284                 (UINT32_C(0xd) << 24)
12285         /* QSFP28 */
12286         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
12287                 (UINT32_C(0x11) << 24)
12288         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
12289                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
12290         /*
12291          * This value represents the current configuration of
12292          * Forward Error Correction (FEC) on the port.
12293          */
12294         uint16_t        fec_cfg;
12295         /*
12296          * When set to 1, then FEC is not supported on this port. If this flag
12297          * is set to 1, then all other FEC configuration flags shall be ignored.
12298          * When set to 0, then FEC is supported as indicated by other
12299          * configuration flags.
12300          * If no cable is attached and the HWRM does not yet know the FEC
12301          * capability, then the HWRM shall set this flag to 1 when reporting
12302          * FEC capability.
12303          */
12304         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
12305                 UINT32_C(0x1)
12306         /*
12307          * When set to 1, then FEC autonegotiation is supported on this port.
12308          * When set to 0, then FEC autonegotiation is not supported on this port.
12309          */
12310         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
12311                 UINT32_C(0x2)
12312         /*
12313          * When set to 1, then FEC autonegotiation is enabled on this port.
12314          * When set to 0, then FEC autonegotiation is disabled if supported.
12315          * This flag should be ignored if FEC autonegotiation is not supported on this port.
12316          */
12317         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
12318                 UINT32_C(0x4)
12319         /*
12320          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
12321          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
12322          */
12323         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
12324                 UINT32_C(0x8)
12325         /*
12326          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port.
12327          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
12328          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
12329          */
12330         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
12331                 UINT32_C(0x10)
12332         /*
12333          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
12334          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
12335          */
12336         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
12337                 UINT32_C(0x20)
12338         /*
12339          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port.
12340          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
12341          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
12342          */
12343         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
12344                 UINT32_C(0x40)
12345         /*
12346          * This value is indicates the duplex of the current
12347          * connection state.
12348          */
12349         uint8_t duplex_state;
12350         /* Half Duplex connection. */
12351         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
12352         /* Full duplex connection. */
12353         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
12354         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
12355                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
12356         /* Option flags fields. */
12357         uint8_t option_flags;
12358         /* When this bit is '1', Media auto detect is enabled. */
12359         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
12360                 UINT32_C(0x1)
12361         /*
12362          * Up to 16 bytes of null padded ASCII string representing
12363          * PHY vendor.
12364          * If the string is set to null, then the vendor name is not
12365          * available.
12366          */
12367         char    phy_vendor_name[16];
12368         /*
12369          * Up to 16 bytes of null padded ASCII string that
12370          * identifies vendor specific part number of the PHY.
12371          * If the string is set to null, then the vendor specific
12372          * part number is not available.
12373          */
12374         char    phy_vendor_partnumber[16];
12375         uint8_t unused_2[7];
12376         /*
12377          * This field is used in Output records to indicate that the output
12378          * is completely written to RAM.  This field should be read as '1'
12379          * to indicate that the output has been completely written.
12380          * When writing a command completion or response to an internal processor,
12381          * the order of writes has to be such that this field is written last.
12382          */
12383         uint8_t valid;
12384 } __attribute__((packed));
12385
12386 /*********************
12387  * hwrm_port_mac_cfg *
12388  *********************/
12389
12390
12391 /* hwrm_port_mac_cfg_input (size:320b/40B) */
12392 struct hwrm_port_mac_cfg_input {
12393         /* The HWRM command request type. */
12394         uint16_t        req_type;
12395         /*
12396          * The completion ring to send the completion event on. This should
12397          * be the NQ ID returned from the `nq_alloc` HWRM command.
12398          */
12399         uint16_t        cmpl_ring;
12400         /*
12401          * The sequence ID is used by the driver for tracking multiple
12402          * commands. This ID is treated as opaque data by the firmware and
12403          * the value is returned in the `hwrm_resp_hdr` upon completion.
12404          */
12405         uint16_t        seq_id;
12406         /*
12407          * The target ID of the command:
12408          * * 0x0-0xFFF8 - The function ID
12409          * * 0xFFF8-0xFFFE - Reserved for internal processors
12410          * * 0xFFFF - HWRM
12411          */
12412         uint16_t        target_id;
12413         /*
12414          * A physical address pointer pointing to a host buffer that the
12415          * command's response data will be written. This can be either a host
12416          * physical address (HPA) or a guest physical address (GPA) and must
12417          * point to a physically contiguous block of memory.
12418          */
12419         uint64_t        resp_addr;
12420         /*
12421          * In this field, there are a number of CoS mappings related flags
12422          * that are used to configure CoS mappings and their corresponding
12423          * priorities in the hardware.
12424          * For the priorities of CoS mappings, the HWRM uses the following
12425          * priority order (high to low) by default:
12426          * # vlan pri
12427          * # ip_dscp
12428          * # tunnel_vlan_pri
12429          * # default cos
12430          *
12431          * A subset of CoS mappings can be enabled.
12432          * If a priority is not specified for an enabled CoS mapping, the
12433          * priority will be assigned in the above order for the enabled CoS
12434          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
12435          * enabled and their priorities are not specified, the following
12436          * priority order (high to low) will be used by the HWRM:
12437          * # vlan_pri
12438          * # ip_dscp
12439          * # default cos
12440          *
12441          * vlan_pri CoS mapping together with default CoS with lower priority
12442          * are enabled by default by the HWRM.
12443          */
12444         uint32_t        flags;
12445         /*
12446          * When this bit is '1', this command will configure
12447          * the MAC to match the current link state of the PHY.
12448          * If the link is not established on the PHY, then this
12449          * bit has no effect.
12450          */
12451         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
12452                 UINT32_C(0x1)
12453         /*
12454          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
12455          * is requested to be enabled.
12456          */
12457         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
12458                 UINT32_C(0x2)
12459         /*
12460          * When this bit is set to '1', tunnel VLAN PRI field to
12461          * CoS mapping is requested to be enabled.
12462          */
12463         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
12464                 UINT32_C(0x4)
12465         /*
12466          * When this bit is set to '1', the IP DSCP to CoS mapping is
12467          * requested to be enabled.
12468          */
12469         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
12470                 UINT32_C(0x8)
12471         /*
12472          * When this bit is '1', the HWRM is requested to
12473          * enable timestamp capture capability on the receive side
12474          * of this port.
12475          */
12476         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
12477                 UINT32_C(0x10)
12478         /*
12479          * When this bit is '1', the HWRM is requested to
12480          * disable timestamp capture capability on the receive side
12481          * of this port.
12482          */
12483         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
12484                 UINT32_C(0x20)
12485         /*
12486          * When this bit is '1', the HWRM is requested to
12487          * enable timestamp capture capability on the transmit side
12488          * of this port.
12489          */
12490         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
12491                 UINT32_C(0x40)
12492         /*
12493          * When this bit is '1', the HWRM is requested to
12494          * disable timestamp capture capability on the transmit side
12495          * of this port.
12496          */
12497         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
12498                 UINT32_C(0x80)
12499         /*
12500          * When this bit is '1', the Out-Of-Box WoL is requested to
12501          * be enabled on this port.
12502          */
12503         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
12504                 UINT32_C(0x100)
12505         /*
12506          * When this bit is '1', the the Out-Of-Box WoL is requested to
12507          * be disabled on this port.
12508          */
12509         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
12510                 UINT32_C(0x200)
12511         /*
12512          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
12513          * is requested to be disabled.
12514          */
12515         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
12516                 UINT32_C(0x400)
12517         /*
12518          * When this bit is set to '1', tunnel VLAN PRI field to
12519          * CoS mapping is requested to be disabled.
12520          */
12521         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
12522                 UINT32_C(0x800)
12523         /*
12524          * When this bit is set to '1', the IP DSCP to CoS mapping is
12525          * requested to be disabled.
12526          */
12527         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
12528                 UINT32_C(0x1000)
12529         uint32_t        enables;
12530         /*
12531          * This bit must be '1' for the ipg field to be
12532          * configured.
12533          */
12534         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
12535                 UINT32_C(0x1)
12536         /*
12537          * This bit must be '1' for the lpbk field to be
12538          * configured.
12539          */
12540         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
12541                 UINT32_C(0x2)
12542         /*
12543          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
12544          * configured.
12545          */
12546         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
12547                 UINT32_C(0x4)
12548         /*
12549          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
12550          * configured.
12551          */
12552         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
12553                 UINT32_C(0x10)
12554         /*
12555          * This bit must be '1' for the dscp2cos_map_pri field to be
12556          * configured.
12557          */
12558         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
12559                 UINT32_C(0x20)
12560         /*
12561          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
12562          * configured.
12563          */
12564         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
12565                 UINT32_C(0x40)
12566         /*
12567          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
12568          * configured.
12569          */
12570         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
12571                 UINT32_C(0x80)
12572         /*
12573          * This bit must be '1' for the cos_field_cfg field to be
12574          * configured.
12575          */
12576         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
12577                 UINT32_C(0x100)
12578         /* Port ID of port that is to be configured. */
12579         uint16_t        port_id;
12580         /*
12581          * This value is used to configure the minimum IPG that will
12582          * be sent between packets by this port.
12583          */
12584         uint8_t ipg;
12585         /* This value controls the loopback setting for the MAC. */
12586         uint8_t lpbk;
12587         /* No loopback is selected.  Normal operation. */
12588         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
12589         /*
12590          * The HW will be configured with local loopback such that
12591          * host data is sent back to the host without modification.
12592          */
12593         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
12594         /*
12595          * The HW will be configured with remote loopback such that
12596          * port logic will send packets back out the transmitter that
12597          * are received.
12598          */
12599         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
12600         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
12601                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
12602         /*
12603          * This value controls the priority setting of VLAN PRI to CoS
12604          * mapping based on VLAN Tags of inner packet headers of
12605          * tunneled packets or packet headers of non-tunneled packets.
12606          *
12607          * # Each XXX_pri variable shall have a unique priority value
12608          * when it is being specified.
12609          * # When comparing priorities of mappings, higher value
12610          * indicates higher priority.
12611          * For example, a value of 0-3 is returned where 0 is being
12612          * the lowest priority and 3 is being the highest priority.
12613          */
12614         uint8_t vlan_pri2cos_map_pri;
12615         /* Reserved field. */
12616         uint8_t reserved1;
12617         /*
12618          * This value controls the priority setting of VLAN PRI to CoS
12619          * mapping based on VLAN Tags of tunneled header.
12620          * This mapping only applies when tunneled headers
12621          * are present.
12622          *
12623          * # Each XXX_pri variable shall have a unique priority value
12624          * when it is being specified.
12625          * # When comparing priorities of mappings, higher value
12626          * indicates higher priority.
12627          * For example, a value of 0-3 is returned where 0 is being
12628          * the lowest priority and 3 is being the highest priority.
12629          */
12630         uint8_t tunnel_pri2cos_map_pri;
12631         /*
12632          * This value controls the priority setting of IP DSCP to CoS
12633          * mapping based on inner IP header of tunneled packets or
12634          * IP header of non-tunneled packets.
12635          *
12636          * # Each XXX_pri variable shall have a unique priority value
12637          * when it is being specified.
12638          * # When comparing priorities of mappings, higher value
12639          * indicates higher priority.
12640          * For example, a value of 0-3 is returned where 0 is being
12641          * the lowest priority and 3 is being the highest priority.
12642          */
12643         uint8_t dscp2pri_map_pri;
12644         /*
12645          * This is a 16-bit bit mask that is used to request a
12646          * specific configuration of time stamp capture of PTP messages
12647          * on the receive side of this port.
12648          * This field shall be ignored if the ptp_rx_ts_capture_enable
12649          * flag is not set in this command.
12650          * Otherwise, if bit 'i' is set, then the HWRM is being
12651          * requested to configure the receive side of the port to
12652          * capture the time stamp of every received PTP message
12653          * with messageType field value set to i.
12654          */
12655         uint16_t        rx_ts_capture_ptp_msg_type;
12656         /*
12657          * This is a 16-bit bit mask that is used to request a
12658          * specific configuration of time stamp capture of PTP messages
12659          * on the transmit side of this port.
12660          * This field shall be ignored if the ptp_tx_ts_capture_enable
12661          * flag is not set in this command.
12662          * Otherwise, if bit 'i' is set, then the HWRM is being
12663          * requested to configure the transmit sied of the port to
12664          * capture the time stamp of every transmitted PTP message
12665          * with messageType field value set to i.
12666          */
12667         uint16_t        tx_ts_capture_ptp_msg_type;
12668         /* Configuration of CoS fields. */
12669         uint8_t cos_field_cfg;
12670         /* Reserved */
12671         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
12672                 UINT32_C(0x1)
12673         /*
12674          * This field is used to specify selection of VLAN PRI value
12675          * based on whether one or two VLAN Tags are present in
12676          * the inner packet headers of tunneled packets or
12677          * non-tunneled packets.
12678          * This field is valid only if inner VLAN PRI to CoS mapping
12679          * is enabled.
12680          * If VLAN PRI to CoS mapping is not enabled, then this
12681          * field shall be ignored.
12682          */
12683         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
12684                 UINT32_C(0x6)
12685         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
12686                 1
12687         /*
12688          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
12689          * present in the inner packet headers
12690          */
12691         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
12692                 (UINT32_C(0x0) << 1)
12693         /*
12694          * Select outer VLAN Tag PRI when 2 VLAN Tags are
12695          * present in the inner packet headers.
12696          * No VLAN PRI shall be selected for this configuration
12697          * if only one VLAN Tag is present in the inner
12698          * packet headers.
12699          */
12700         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
12701                 (UINT32_C(0x1) << 1)
12702         /*
12703          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
12704          * are present in the inner packet headers
12705          */
12706         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
12707                 (UINT32_C(0x2) << 1)
12708         /* Unspecified */
12709         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
12710                 (UINT32_C(0x3) << 1)
12711         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
12712                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
12713         /*
12714          * This field is used to specify selection of tunnel VLAN
12715          * PRI value based on whether one or two VLAN Tags are
12716          * present in tunnel headers.
12717          * This field is valid only if tunnel VLAN PRI to CoS mapping
12718          * is enabled.
12719          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
12720          * field shall be ignored.
12721          */
12722         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
12723                 UINT32_C(0x18)
12724         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
12725                 3
12726         /*
12727          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
12728          * present in the tunnel packet headers
12729          */
12730         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
12731                 (UINT32_C(0x0) << 3)
12732         /*
12733          * Select outer VLAN Tag PRI when 2 VLAN Tags are
12734          * present in the tunnel packet headers.
12735          * No tunnel VLAN PRI shall be selected for this
12736          * configuration if only one VLAN Tag is present in
12737          * the tunnel packet headers.
12738          */
12739         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
12740                 (UINT32_C(0x1) << 3)
12741         /*
12742          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
12743          * are present in the tunnel packet headers
12744          */
12745         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
12746                 (UINT32_C(0x2) << 3)
12747         /* Unspecified */
12748         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
12749                 (UINT32_C(0x3) << 3)
12750         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
12751                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
12752         /*
12753          * This field shall be used to provide default CoS value
12754          * that has been configured on this port.
12755          * This field is valid only if default CoS mapping
12756          * is enabled.
12757          * If default CoS mapping is not enabled, then this
12758          * field shall be ignored.
12759          */
12760         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
12761                 UINT32_C(0xe0)
12762         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
12763                 5
12764         uint8_t unused_0[3];
12765 } __attribute__((packed));
12766
12767 /* hwrm_port_mac_cfg_output (size:128b/16B) */
12768 struct hwrm_port_mac_cfg_output {
12769         /* The specific error status for the command. */
12770         uint16_t        error_code;
12771         /* The HWRM command request type. */
12772         uint16_t        req_type;
12773         /* The sequence ID from the original command. */
12774         uint16_t        seq_id;
12775         /* The length of the response data in number of bytes. */
12776         uint16_t        resp_len;
12777         /*
12778          * This is the configured maximum length of Ethernet packet
12779          * payload that is allowed to be received on the port.
12780          * This value does not include the number of bytes used by
12781          * Ethernet header and trailer (CRC).
12782          */
12783         uint16_t        mru;
12784         /*
12785          * This is the configured maximum length of Ethernet packet
12786          * payload that is allowed to be transmitted on the port.
12787          * This value does not include the number of bytes used by
12788          * Ethernet header and trailer (CRC).
12789          */
12790         uint16_t        mtu;
12791         /* Current configuration of the IPG value. */
12792         uint8_t ipg;
12793         /* Current value of the loopback value. */
12794         uint8_t lpbk;
12795         /* No loopback is selected.  Normal operation. */
12796         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
12797         /*
12798          * The HW will be configured with local loopback such that
12799          * host data is sent back to the host without modification.
12800          */
12801         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
12802         /*
12803          * The HW will be configured with remote loopback such that
12804          * port logic will send packets back out the transmitter that
12805          * are received.
12806          */
12807         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
12808         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
12809                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
12810         uint8_t unused_0;
12811         /*
12812          * This field is used in Output records to indicate that the output
12813          * is completely written to RAM.  This field should be read as '1'
12814          * to indicate that the output has been completely written.
12815          * When writing a command completion or response to an internal processor,
12816          * the order of writes has to be such that this field is written last.
12817          */
12818         uint8_t valid;
12819 } __attribute__((packed));
12820
12821 /**********************
12822  * hwrm_port_mac_qcfg *
12823  **********************/
12824
12825
12826 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
12827 struct hwrm_port_mac_qcfg_input {
12828         /* The HWRM command request type. */
12829         uint16_t        req_type;
12830         /*
12831          * The completion ring to send the completion event on. This should
12832          * be the NQ ID returned from the `nq_alloc` HWRM command.
12833          */
12834         uint16_t        cmpl_ring;
12835         /*
12836          * The sequence ID is used by the driver for tracking multiple
12837          * commands. This ID is treated as opaque data by the firmware and
12838          * the value is returned in the `hwrm_resp_hdr` upon completion.
12839          */
12840         uint16_t        seq_id;
12841         /*
12842          * The target ID of the command:
12843          * * 0x0-0xFFF8 - The function ID
12844          * * 0xFFF8-0xFFFE - Reserved for internal processors
12845          * * 0xFFFF - HWRM
12846          */
12847         uint16_t        target_id;
12848         /*
12849          * A physical address pointer pointing to a host buffer that the
12850          * command's response data will be written. This can be either a host
12851          * physical address (HPA) or a guest physical address (GPA) and must
12852          * point to a physically contiguous block of memory.
12853          */
12854         uint64_t        resp_addr;
12855         /* Port ID of port that is to be configured. */
12856         uint16_t        port_id;
12857         uint8_t unused_0[6];
12858 } __attribute__((packed));
12859
12860 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
12861 struct hwrm_port_mac_qcfg_output {
12862         /* The specific error status for the command. */
12863         uint16_t        error_code;
12864         /* The HWRM command request type. */
12865         uint16_t        req_type;
12866         /* The sequence ID from the original command. */
12867         uint16_t        seq_id;
12868         /* The length of the response data in number of bytes. */
12869         uint16_t        resp_len;
12870         /*
12871          * This is the configured maximum length of Ethernet packet
12872          * payload that is allowed to be received on the port.
12873          * This value does not include the number of bytes used by the
12874          * Ethernet header and trailer (CRC).
12875          */
12876         uint16_t        mru;
12877         /*
12878          * This is the configured maximum length of Ethernet packet
12879          * payload that is allowed to be transmitted on the port.
12880          * This value does not include the number of bytes used by the
12881          * Ethernet header and trailer (CRC).
12882          */
12883         uint16_t        mtu;
12884         /*
12885          * The minimum IPG that will
12886          * be sent between packets by this port.
12887          */
12888         uint8_t ipg;
12889         /* The loopback setting for the MAC. */
12890         uint8_t lpbk;
12891         /* No loopback is selected.  Normal operation. */
12892         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
12893         /*
12894          * The HW will be configured with local loopback such that
12895          * host data is sent back to the host without modification.
12896          */
12897         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
12898         /*
12899          * The HW will be configured with remote loopback such that
12900          * port logic will send packets back out the transmitter that
12901          * are received.
12902          */
12903         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
12904         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
12905                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
12906         /*
12907          * Priority setting for VLAN PRI to CoS mapping.
12908          * # Each XXX_pri variable shall have a unique priority value
12909          * when it is being used.
12910          * # When comparing priorities of mappings, higher value
12911          * indicates higher priority.
12912          * For example, a value of 0-3 is returned where 0 is being
12913          * the lowest priority and 3 is being the highest priority.
12914          * # If the correspoding CoS mapping is not enabled, then this
12915          * field should be ignored.
12916          * # This value indicates the normalized priority value retained
12917          * in the HWRM.
12918          */
12919         uint8_t vlan_pri2cos_map_pri;
12920         /*
12921          * In this field, a number of CoS mappings related flags
12922          * are used to indicate configured CoS mappings.
12923          */
12924         uint8_t flags;
12925         /*
12926          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
12927          * is enabled.
12928          */
12929         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
12930                 UINT32_C(0x1)
12931         /*
12932          * When this bit is set to '1', tunnel VLAN PRI field to
12933          * CoS mapping is enabled.
12934          */
12935         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
12936                 UINT32_C(0x2)
12937         /*
12938          * When this bit is set to '1', the IP DSCP to CoS mapping is
12939          * enabled.
12940          */
12941         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
12942                 UINT32_C(0x4)
12943         /*
12944          * When this bit is '1', the Out-Of-Box WoL is enabled on this
12945          * port.
12946          */
12947         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
12948                 UINT32_C(0x8)
12949         /* When this bit is '1', PTP is enabled for RX on this port. */
12950         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
12951                 UINT32_C(0x10)
12952         /* When this bit is '1', PTP is enabled for TX on this port. */
12953         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
12954                 UINT32_C(0x20)
12955         /*
12956          * Priority setting for tunnel VLAN PRI to CoS mapping.
12957          * # Each XXX_pri variable shall have a unique priority value
12958          * when it is being used.
12959          * # When comparing priorities of mappings, higher value
12960          * indicates higher priority.
12961          * For example, a value of 0-3 is returned where 0 is being
12962          * the lowest priority and 3 is being the highest priority.
12963          * # If the correspoding CoS mapping is not enabled, then this
12964          * field should be ignored.
12965          * # This value indicates the normalized priority value retained
12966          * in the HWRM.
12967          */
12968         uint8_t tunnel_pri2cos_map_pri;
12969         /*
12970          * Priority setting for DSCP to PRI mapping.
12971          * # Each XXX_pri variable shall have a unique priority value
12972          * when it is being used.
12973          * # When comparing priorities of mappings, higher value
12974          * indicates higher priority.
12975          * For example, a value of 0-3 is returned where 0 is being
12976          * the lowest priority and 3 is being the highest priority.
12977          * # If the correspoding CoS mapping is not enabled, then this
12978          * field should be ignored.
12979          * # This value indicates the normalized priority value retained
12980          * in the HWRM.
12981          */
12982         uint8_t dscp2pri_map_pri;
12983         /*
12984          * This is a 16-bit bit mask that represents the
12985          * current configuration of time stamp capture of PTP messages
12986          * on the receive side of this port.
12987          * If bit 'i' is set, then the receive side of the port
12988          * is configured to capture the time stamp of every
12989          * received PTP message with messageType field value set
12990          * to i.
12991          * If all bits are set to 0 (i.e. field value set 0),
12992          * then the receive side of the port is not configured
12993          * to capture timestamp for PTP messages.
12994          * If all bits are set to 1, then the receive side of the
12995          * port is configured to capture timestamp for all PTP
12996          * messages.
12997          */
12998         uint16_t        rx_ts_capture_ptp_msg_type;
12999         /*
13000          * This is a 16-bit bit mask that represents the
13001          * current configuration of time stamp capture of PTP messages
13002          * on the transmit side of this port.
13003          * If bit 'i' is set, then the transmit side of the port
13004          * is configured to capture the time stamp of every
13005          * received PTP message with messageType field value set
13006          * to i.
13007          * If all bits are set to 0 (i.e. field value set 0),
13008          * then the transmit side of the port is not configured
13009          * to capture timestamp for PTP messages.
13010          * If all bits are set to 1, then the transmit side of the
13011          * port is configured to capture timestamp for all PTP
13012          * messages.
13013          */
13014         uint16_t        tx_ts_capture_ptp_msg_type;
13015         /* Configuration of CoS fields. */
13016         uint8_t cos_field_cfg;
13017         /* Reserved */
13018         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
13019                 UINT32_C(0x1)
13020         /*
13021          * This field is used for selecting VLAN PRI value
13022          * based on whether one or two VLAN Tags are present in
13023          * the inner packet headers of tunneled packets or
13024          * non-tunneled packets.
13025          */
13026         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
13027                 UINT32_C(0x6)
13028         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
13029                 1
13030         /*
13031          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
13032          * present in the inner packet headers
13033          */
13034         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
13035                 (UINT32_C(0x0) << 1)
13036         /*
13037          * Select outer VLAN Tag PRI when 2 VLAN Tags are
13038          * present in the inner packet headers.
13039          * No VLAN PRI is selected for this configuration
13040          * if only one VLAN Tag is present in the inner
13041          * packet headers.
13042          */
13043         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
13044                 (UINT32_C(0x1) << 1)
13045         /*
13046          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
13047          * are present in the inner packet headers
13048          */
13049         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
13050                 (UINT32_C(0x2) << 1)
13051         /* Unspecified */
13052         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
13053                 (UINT32_C(0x3) << 1)
13054         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
13055                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
13056         /*
13057          * This field is used for selecting tunnel VLAN PRI value
13058          * based on whether one or two VLAN Tags are present in
13059          * the tunnel headers of tunneled packets. This selection
13060          * does not apply to non-tunneled packets.
13061          */
13062         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
13063                 UINT32_C(0x18)
13064         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
13065                 3
13066         /*
13067          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
13068          * present in the tunnel packet headers
13069          */
13070         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
13071                 (UINT32_C(0x0) << 3)
13072         /*
13073          * Select outer VLAN Tag PRI when 2 VLAN Tags are
13074          * present in the tunnel packet headers.
13075          * No VLAN PRI is selected for this configuration
13076          * if only one VLAN Tag is present in the tunnel
13077          * packet headers.
13078          */
13079         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
13080                 (UINT32_C(0x1) << 3)
13081         /*
13082          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
13083          * are present in the tunnel packet headers
13084          */
13085         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
13086                 (UINT32_C(0x2) << 3)
13087         /* Unspecified */
13088         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
13089                 (UINT32_C(0x3) << 3)
13090         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
13091                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
13092         /*
13093          * This field is used to provide default CoS value that
13094          * has been configured on this port.
13095          */
13096         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
13097                 UINT32_C(0xe0)
13098         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
13099                 5
13100         /*
13101          * This field is used in Output records to indicate that the output
13102          * is completely written to RAM.  This field should be read as '1'
13103          * to indicate that the output has been completely written.
13104          * When writing a command completion or response to an internal processor,
13105          * the order of writes has to be such that this field is written last.
13106          */
13107         uint8_t valid;
13108 } __attribute__((packed));
13109
13110 /**************************
13111  * hwrm_port_mac_ptp_qcfg *
13112  **************************/
13113
13114
13115 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
13116 struct hwrm_port_mac_ptp_qcfg_input {
13117         /* The HWRM command request type. */
13118         uint16_t        req_type;
13119         /*
13120          * The completion ring to send the completion event on. This should
13121          * be the NQ ID returned from the `nq_alloc` HWRM command.
13122          */
13123         uint16_t        cmpl_ring;
13124         /*
13125          * The sequence ID is used by the driver for tracking multiple
13126          * commands. This ID is treated as opaque data by the firmware and
13127          * the value is returned in the `hwrm_resp_hdr` upon completion.
13128          */
13129         uint16_t        seq_id;
13130         /*
13131          * The target ID of the command:
13132          * * 0x0-0xFFF8 - The function ID
13133          * * 0xFFF8-0xFFFE - Reserved for internal processors
13134          * * 0xFFFF - HWRM
13135          */
13136         uint16_t        target_id;
13137         /*
13138          * A physical address pointer pointing to a host buffer that the
13139          * command's response data will be written. This can be either a host
13140          * physical address (HPA) or a guest physical address (GPA) and must
13141          * point to a physically contiguous block of memory.
13142          */
13143         uint64_t        resp_addr;
13144         /* Port ID of port that is being queried. */
13145         uint16_t        port_id;
13146         uint8_t unused_0[6];
13147 } __attribute__((packed));
13148
13149 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
13150 struct hwrm_port_mac_ptp_qcfg_output {
13151         /* The specific error status for the command. */
13152         uint16_t        error_code;
13153         /* The HWRM command request type. */
13154         uint16_t        req_type;
13155         /* The sequence ID from the original command. */
13156         uint16_t        seq_id;
13157         /* The length of the response data in number of bytes. */
13158         uint16_t        resp_len;
13159         /*
13160          * In this field, a number of PTP related flags
13161          * are used to indicate configured PTP capabilities.
13162          */
13163         uint8_t flags;
13164         /*
13165          * When this bit is set to '1', the PTP related registers are
13166          * directly accessible by the host.
13167          */
13168         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
13169                 UINT32_C(0x1)
13170         /*
13171          * When this bit is set to '1', the PTP information is accessible
13172          * via HWRM commands.
13173          */
13174         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
13175                 UINT32_C(0x2)
13176         uint8_t unused_0[3];
13177         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
13178         uint32_t        rx_ts_reg_off_lower;
13179         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
13180         uint32_t        rx_ts_reg_off_upper;
13181         /* Offset of the PTP register for the sequence ID for RX. */
13182         uint32_t        rx_ts_reg_off_seq_id;
13183         /* Offset of the first PTP source ID for RX. */
13184         uint32_t        rx_ts_reg_off_src_id_0;
13185         /* Offset of the second PTP source ID for RX. */
13186         uint32_t        rx_ts_reg_off_src_id_1;
13187         /* Offset of the third PTP source ID for RX. */
13188         uint32_t        rx_ts_reg_off_src_id_2;
13189         /* Offset of the domain ID for RX. */
13190         uint32_t        rx_ts_reg_off_domain_id;
13191         /* Offset of the PTP FIFO register for RX. */
13192         uint32_t        rx_ts_reg_off_fifo;
13193         /* Offset of the PTP advance FIFO register for RX. */
13194         uint32_t        rx_ts_reg_off_fifo_adv;
13195         /* PTP timestamp granularity for RX. */
13196         uint32_t        rx_ts_reg_off_granularity;
13197         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
13198         uint32_t        tx_ts_reg_off_lower;
13199         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
13200         uint32_t        tx_ts_reg_off_upper;
13201         /* Offset of the PTP register for the sequence ID for TX. */
13202         uint32_t        tx_ts_reg_off_seq_id;
13203         /* Offset of the PTP FIFO register for TX. */
13204         uint32_t        tx_ts_reg_off_fifo;
13205         /* PTP timestamp granularity for TX. */
13206         uint32_t        tx_ts_reg_off_granularity;
13207         uint8_t unused_1[7];
13208         /*
13209          * This field is used in Output records to indicate that the output
13210          * is completely written to RAM.  This field should be read as '1'
13211          * to indicate that the output has been completely written.
13212          * When writing a command completion or response to an internal processor,
13213          * the order of writes has to be such that this field is written last.
13214          */
13215         uint8_t valid;
13216 } __attribute__((packed));
13217
13218 /* Port Tx Statistics Formats */
13219 /* tx_port_stats (size:3264b/408B) */
13220 struct tx_port_stats {
13221         /* Total Number of 64 Bytes frames transmitted */
13222         uint64_t        tx_64b_frames;
13223         /* Total Number of 65-127 Bytes frames transmitted */
13224         uint64_t        tx_65b_127b_frames;
13225         /* Total Number of 128-255 Bytes frames transmitted */
13226         uint64_t        tx_128b_255b_frames;
13227         /* Total Number of 256-511 Bytes frames transmitted */
13228         uint64_t        tx_256b_511b_frames;
13229         /* Total Number of 512-1023 Bytes frames transmitted */
13230         uint64_t        tx_512b_1023b_frames;
13231         /* Total Number of 1024-1518 Bytes frames transmitted */
13232         uint64_t        tx_1024b_1518b_frames;
13233         /*
13234          * Total Number of each good VLAN (exludes FCS errors)
13235          * frame transmitted which is 1519 to 1522 bytes in length
13236          * inclusive (excluding framing bits but including FCS bytes).
13237          */
13238         uint64_t        tx_good_vlan_frames;
13239         /* Total Number of 1519-2047 Bytes frames transmitted */
13240         uint64_t        tx_1519b_2047b_frames;
13241         /* Total Number of 2048-4095 Bytes frames transmitted */
13242         uint64_t        tx_2048b_4095b_frames;
13243         /* Total Number of 4096-9216 Bytes frames transmitted */
13244         uint64_t        tx_4096b_9216b_frames;
13245         /* Total Number of 9217-16383 Bytes frames transmitted */
13246         uint64_t        tx_9217b_16383b_frames;
13247         /* Total Number of good frames transmitted */
13248         uint64_t        tx_good_frames;
13249         /* Total Number of frames transmitted */
13250         uint64_t        tx_total_frames;
13251         /* Total number of unicast frames transmitted */
13252         uint64_t        tx_ucast_frames;
13253         /* Total number of multicast frames transmitted */
13254         uint64_t        tx_mcast_frames;
13255         /* Total number of broadcast frames transmitted */
13256         uint64_t        tx_bcast_frames;
13257         /* Total number of PAUSE control frames transmitted */
13258         uint64_t        tx_pause_frames;
13259         /*
13260          * Total number of PFC/per-priority PAUSE
13261          * control frames transmitted
13262          */
13263         uint64_t        tx_pfc_frames;
13264         /* Total number of jabber frames transmitted */
13265         uint64_t        tx_jabber_frames;
13266         /* Total number of frames transmitted with FCS error */
13267         uint64_t        tx_fcs_err_frames;
13268         /* Total number of control frames transmitted */
13269         uint64_t        tx_control_frames;
13270         /* Total number of over-sized frames transmitted */
13271         uint64_t        tx_oversz_frames;
13272         /* Total number of frames with single deferral */
13273         uint64_t        tx_single_dfrl_frames;
13274         /* Total number of frames with multiple deferrals */
13275         uint64_t        tx_multi_dfrl_frames;
13276         /* Total number of frames with single collision */
13277         uint64_t        tx_single_coll_frames;
13278         /* Total number of frames with multiple collisions */
13279         uint64_t        tx_multi_coll_frames;
13280         /* Total number of frames with late collisions */
13281         uint64_t        tx_late_coll_frames;
13282         /* Total number of frames with excessive collisions */
13283         uint64_t        tx_excessive_coll_frames;
13284         /* Total number of fragmented frames transmitted */
13285         uint64_t        tx_frag_frames;
13286         /* Total number of transmit errors */
13287         uint64_t        tx_err;
13288         /* Total number of single VLAN tagged frames transmitted */
13289         uint64_t        tx_tagged_frames;
13290         /* Total number of double VLAN tagged frames transmitted */
13291         uint64_t        tx_dbl_tagged_frames;
13292         /* Total number of runt frames transmitted */
13293         uint64_t        tx_runt_frames;
13294         /* Total number of TX FIFO under runs */
13295         uint64_t        tx_fifo_underruns;
13296         /*
13297          * Total number of PFC frames with PFC enabled bit for
13298          * Pri 0 transmitted
13299          */
13300         uint64_t        tx_pfc_ena_frames_pri0;
13301         /*
13302          * Total number of PFC frames with PFC enabled bit for
13303          * Pri 1 transmitted
13304          */
13305         uint64_t        tx_pfc_ena_frames_pri1;
13306         /*
13307          * Total number of PFC frames with PFC enabled bit for
13308          * Pri 2 transmitted
13309          */
13310         uint64_t        tx_pfc_ena_frames_pri2;
13311         /*
13312          * Total number of PFC frames with PFC enabled bit for
13313          * Pri 3 transmitted
13314          */
13315         uint64_t        tx_pfc_ena_frames_pri3;
13316         /*
13317          * Total number of PFC frames with PFC enabled bit for
13318          * Pri 4 transmitted
13319          */
13320         uint64_t        tx_pfc_ena_frames_pri4;
13321         /*
13322          * Total number of PFC frames with PFC enabled bit for
13323          * Pri 5 transmitted
13324          */
13325         uint64_t        tx_pfc_ena_frames_pri5;
13326         /*
13327          * Total number of PFC frames with PFC enabled bit for
13328          * Pri 6 transmitted
13329          */
13330         uint64_t        tx_pfc_ena_frames_pri6;
13331         /*
13332          * Total number of PFC frames with PFC enabled bit for
13333          * Pri 7 transmitted
13334          */
13335         uint64_t        tx_pfc_ena_frames_pri7;
13336         /* Total number of EEE LPI Events on TX */
13337         uint64_t        tx_eee_lpi_events;
13338         /* EEE LPI Duration Counter on TX */
13339         uint64_t        tx_eee_lpi_duration;
13340         /*
13341          * Total number of Link Level Flow Control (LLFC) messages
13342          * transmitted
13343          */
13344         uint64_t        tx_llfc_logical_msgs;
13345         /* Total number of HCFC messages transmitted */
13346         uint64_t        tx_hcfc_msgs;
13347         /* Total number of TX collisions */
13348         uint64_t        tx_total_collisions;
13349         /* Total number of transmitted bytes */
13350         uint64_t        tx_bytes;
13351         /* Total number of end-to-end HOL frames */
13352         uint64_t        tx_xthol_frames;
13353         /* Total Tx Drops per Port reported by STATS block */
13354         uint64_t        tx_stat_discard;
13355         /* Total Tx Error Drops per Port reported by STATS block */
13356         uint64_t        tx_stat_error;
13357 } __attribute__((packed));
13358
13359 /* Port Rx Statistics Formats */
13360 /* rx_port_stats (size:4224b/528B) */
13361 struct rx_port_stats {
13362         /* Total Number of 64 Bytes frames received */
13363         uint64_t        rx_64b_frames;
13364         /* Total Number of 65-127 Bytes frames received */
13365         uint64_t        rx_65b_127b_frames;
13366         /* Total Number of 128-255 Bytes frames received */
13367         uint64_t        rx_128b_255b_frames;
13368         /* Total Number of 256-511 Bytes frames received */
13369         uint64_t        rx_256b_511b_frames;
13370         /* Total Number of 512-1023 Bytes frames received */
13371         uint64_t        rx_512b_1023b_frames;
13372         /* Total Number of 1024-1518 Bytes frames received */
13373         uint64_t        rx_1024b_1518b_frames;
13374         /*
13375          * Total Number of each good VLAN (exludes FCS errors)
13376          * frame received which is 1519 to 1522 bytes in length
13377          * inclusive (excluding framing bits but including FCS bytes).
13378          */
13379         uint64_t        rx_good_vlan_frames;
13380         /* Total Number of 1519-2047 Bytes frames received */
13381         uint64_t        rx_1519b_2047b_frames;
13382         /* Total Number of 2048-4095 Bytes frames received */
13383         uint64_t        rx_2048b_4095b_frames;
13384         /* Total Number of 4096-9216 Bytes frames received */
13385         uint64_t        rx_4096b_9216b_frames;
13386         /* Total Number of 9217-16383 Bytes frames received */
13387         uint64_t        rx_9217b_16383b_frames;
13388         /* Total number of frames received */
13389         uint64_t        rx_total_frames;
13390         /* Total number of unicast frames received */
13391         uint64_t        rx_ucast_frames;
13392         /* Total number of multicast frames received */
13393         uint64_t        rx_mcast_frames;
13394         /* Total number of broadcast frames received */
13395         uint64_t        rx_bcast_frames;
13396         /* Total number of received frames with FCS error */
13397         uint64_t        rx_fcs_err_frames;
13398         /* Total number of control frames received */
13399         uint64_t        rx_ctrl_frames;
13400         /* Total number of PAUSE frames received */
13401         uint64_t        rx_pause_frames;
13402         /* Total number of PFC frames received */
13403         uint64_t        rx_pfc_frames;
13404         /*
13405          * Total number of frames received with an unsupported
13406          * opcode
13407          */
13408         uint64_t        rx_unsupported_opcode_frames;
13409         /*
13410          * Total number of frames received with an unsupported
13411          * DA for pause and PFC
13412          */
13413         uint64_t        rx_unsupported_da_pausepfc_frames;
13414         /* Total number of frames received with an unsupported SA */
13415         uint64_t        rx_wrong_sa_frames;
13416         /* Total number of received packets with alignment error */
13417         uint64_t        rx_align_err_frames;
13418         /* Total number of received frames with out-of-range length */
13419         uint64_t        rx_oor_len_frames;
13420         /* Total number of received frames with error termination */
13421         uint64_t        rx_code_err_frames;
13422         /*
13423          * Total number of received frames with a false carrier is
13424          * detected during idle, as defined by RX_ER samples active
13425          * and RXD is 0xE. The event is reported along with the
13426          * statistics generated on the next received frame. Only
13427          * one false carrier condition can be detected and logged
13428          * between frames.
13429          *
13430          * Carrier event, valid for 10M/100M speed modes only.
13431          */
13432         uint64_t        rx_false_carrier_frames;
13433         /* Total number of over-sized frames received */
13434         uint64_t        rx_ovrsz_frames;
13435         /* Total number of jabber packets received */
13436         uint64_t        rx_jbr_frames;
13437         /* Total number of received frames with MTU error */
13438         uint64_t        rx_mtu_err_frames;
13439         /* Total number of received frames with CRC match */
13440         uint64_t        rx_match_crc_frames;
13441         /* Total number of frames received promiscuously */
13442         uint64_t        rx_promiscuous_frames;
13443         /*
13444          * Total number of received frames with one or two VLAN
13445          * tags
13446          */
13447         uint64_t        rx_tagged_frames;
13448         /* Total number of received frames with two VLAN tags */
13449         uint64_t        rx_double_tagged_frames;
13450         /* Total number of truncated frames received */
13451         uint64_t        rx_trunc_frames;
13452         /* Total number of good frames (without errors) received */
13453         uint64_t        rx_good_frames;
13454         /*
13455          * Total number of received PFC frames with transition from
13456          * XON to XOFF on Pri 0
13457          */
13458         uint64_t        rx_pfc_xon2xoff_frames_pri0;
13459         /*
13460          * Total number of received PFC frames with transition from
13461          * XON to XOFF on Pri 1
13462          */
13463         uint64_t        rx_pfc_xon2xoff_frames_pri1;
13464         /*
13465          * Total number of received PFC frames with transition from
13466          * XON to XOFF on Pri 2
13467          */
13468         uint64_t        rx_pfc_xon2xoff_frames_pri2;
13469         /*
13470          * Total number of received PFC frames with transition from
13471          * XON to XOFF on Pri 3
13472          */
13473         uint64_t        rx_pfc_xon2xoff_frames_pri3;
13474         /*
13475          * Total number of received PFC frames with transition from
13476          * XON to XOFF on Pri 4
13477          */
13478         uint64_t        rx_pfc_xon2xoff_frames_pri4;
13479         /*
13480          * Total number of received PFC frames with transition from
13481          * XON to XOFF on Pri 5
13482          */
13483         uint64_t        rx_pfc_xon2xoff_frames_pri5;
13484         /*
13485          * Total number of received PFC frames with transition from
13486          * XON to XOFF on Pri 6
13487          */
13488         uint64_t        rx_pfc_xon2xoff_frames_pri6;
13489         /*
13490          * Total number of received PFC frames with transition from
13491          * XON to XOFF on Pri 7
13492          */
13493         uint64_t        rx_pfc_xon2xoff_frames_pri7;
13494         /*
13495          * Total number of received PFC frames with PFC enabled
13496          * bit for Pri 0
13497          */
13498         uint64_t        rx_pfc_ena_frames_pri0;
13499         /*
13500          * Total number of received PFC frames with PFC enabled
13501          * bit for Pri 1
13502          */
13503         uint64_t        rx_pfc_ena_frames_pri1;
13504         /*
13505          * Total number of received PFC frames with PFC enabled
13506          * bit for Pri 2
13507          */
13508         uint64_t        rx_pfc_ena_frames_pri2;
13509         /*
13510          * Total number of received PFC frames with PFC enabled
13511          * bit for Pri 3
13512          */
13513         uint64_t        rx_pfc_ena_frames_pri3;
13514         /*
13515          * Total number of received PFC frames with PFC enabled
13516          * bit for Pri 4
13517          */
13518         uint64_t        rx_pfc_ena_frames_pri4;
13519         /*
13520          * Total number of received PFC frames with PFC enabled
13521          * bit for Pri 5
13522          */
13523         uint64_t        rx_pfc_ena_frames_pri5;
13524         /*
13525          * Total number of received PFC frames with PFC enabled
13526          * bit for Pri 6
13527          */
13528         uint64_t        rx_pfc_ena_frames_pri6;
13529         /*
13530          * Total number of received PFC frames with PFC enabled
13531          * bit for Pri 7
13532          */
13533         uint64_t        rx_pfc_ena_frames_pri7;
13534         /* Total Number of frames received with SCH CRC error */
13535         uint64_t        rx_sch_crc_err_frames;
13536         /* Total Number of under-sized frames received */
13537         uint64_t        rx_undrsz_frames;
13538         /* Total Number of fragmented frames received */
13539         uint64_t        rx_frag_frames;
13540         /* Total number of RX EEE LPI Events */
13541         uint64_t        rx_eee_lpi_events;
13542         /* EEE LPI Duration Counter on RX */
13543         uint64_t        rx_eee_lpi_duration;
13544         /*
13545          * Total number of physical type Link Level Flow Control
13546          * (LLFC) messages received
13547          */
13548         uint64_t        rx_llfc_physical_msgs;
13549         /*
13550          * Total number of logical type Link Level Flow Control
13551          * (LLFC) messages received
13552          */
13553         uint64_t        rx_llfc_logical_msgs;
13554         /*
13555          * Total number of logical type Link Level Flow Control
13556          * (LLFC) messages received with CRC error
13557          */
13558         uint64_t        rx_llfc_msgs_with_crc_err;
13559         /* Total number of HCFC messages received */
13560         uint64_t        rx_hcfc_msgs;
13561         /* Total number of HCFC messages received with CRC error */
13562         uint64_t        rx_hcfc_msgs_with_crc_err;
13563         /* Total number of received bytes */
13564         uint64_t        rx_bytes;
13565         /* Total number of bytes received in runt frames */
13566         uint64_t        rx_runt_bytes;
13567         /* Total number of runt frames received */
13568         uint64_t        rx_runt_frames;
13569         /* Total Rx Discards per Port reported by STATS block */
13570         uint64_t        rx_stat_discard;
13571         uint64_t        rx_stat_err;
13572 } __attribute__((packed));
13573
13574 /********************
13575  * hwrm_port_qstats *
13576  ********************/
13577
13578
13579 /* hwrm_port_qstats_input (size:320b/40B) */
13580 struct hwrm_port_qstats_input {
13581         /* The HWRM command request type. */
13582         uint16_t        req_type;
13583         /*
13584          * The completion ring to send the completion event on. This should
13585          * be the NQ ID returned from the `nq_alloc` HWRM command.
13586          */
13587         uint16_t        cmpl_ring;
13588         /*
13589          * The sequence ID is used by the driver for tracking multiple
13590          * commands. This ID is treated as opaque data by the firmware and
13591          * the value is returned in the `hwrm_resp_hdr` upon completion.
13592          */
13593         uint16_t        seq_id;
13594         /*
13595          * The target ID of the command:
13596          * * 0x0-0xFFF8 - The function ID
13597          * * 0xFFF8-0xFFFE - Reserved for internal processors
13598          * * 0xFFFF - HWRM
13599          */
13600         uint16_t        target_id;
13601         /*
13602          * A physical address pointer pointing to a host buffer that the
13603          * command's response data will be written. This can be either a host
13604          * physical address (HPA) or a guest physical address (GPA) and must
13605          * point to a physically contiguous block of memory.
13606          */
13607         uint64_t        resp_addr;
13608         /* Port ID of port that is being queried. */
13609         uint16_t        port_id;
13610         uint8_t unused_0[6];
13611         /*
13612          * This is the host address where
13613          * Tx port statistics will be stored
13614          */
13615         uint64_t        tx_stat_host_addr;
13616         /*
13617          * This is the host address where
13618          * Rx port statistics will be stored
13619          */
13620         uint64_t        rx_stat_host_addr;
13621 } __attribute__((packed));
13622
13623 /* hwrm_port_qstats_output (size:128b/16B) */
13624 struct hwrm_port_qstats_output {
13625         /* The specific error status for the command. */
13626         uint16_t        error_code;
13627         /* The HWRM command request type. */
13628         uint16_t        req_type;
13629         /* The sequence ID from the original command. */
13630         uint16_t        seq_id;
13631         /* The length of the response data in number of bytes. */
13632         uint16_t        resp_len;
13633         /* The size of TX port statistics block in bytes. */
13634         uint16_t        tx_stat_size;
13635         /* The size of RX port statistics block in bytes. */
13636         uint16_t        rx_stat_size;
13637         uint8_t unused_0[3];
13638         /*
13639          * This field is used in Output records to indicate that the output
13640          * is completely written to RAM.  This field should be read as '1'
13641          * to indicate that the output has been completely written.
13642          * When writing a command completion or response to an internal processor,
13643          * the order of writes has to be such that this field is written last.
13644          */
13645         uint8_t valid;
13646 } __attribute__((packed));
13647
13648 /* Port Tx Statistics extended Formats */
13649 /* tx_port_stats_ext (size:2048b/256B) */
13650 struct tx_port_stats_ext {
13651         /* Total number of tx bytes count on cos queue 0 */
13652         uint64_t        tx_bytes_cos0;
13653         /* Total number of tx bytes count on cos queue 1 */
13654         uint64_t        tx_bytes_cos1;
13655         /* Total number of tx bytes count on cos queue 2 */
13656         uint64_t        tx_bytes_cos2;
13657         /* Total number of tx bytes count on cos queue 3 */
13658         uint64_t        tx_bytes_cos3;
13659         /* Total number of tx bytes count on cos queue 4 */
13660         uint64_t        tx_bytes_cos4;
13661         /* Total number of tx bytes count on cos queue 5 */
13662         uint64_t        tx_bytes_cos5;
13663         /* Total number of tx bytes count on cos queue 6 */
13664         uint64_t        tx_bytes_cos6;
13665         /* Total number of tx bytes count on cos queue 7 */
13666         uint64_t        tx_bytes_cos7;
13667         /* Total number of tx packets count on cos queue 0 */
13668         uint64_t        tx_packets_cos0;
13669         /* Total number of tx packets count on cos queue 1 */
13670         uint64_t        tx_packets_cos1;
13671         /* Total number of tx packets count on cos queue 2 */
13672         uint64_t        tx_packets_cos2;
13673         /* Total number of tx packets count on cos queue 3 */
13674         uint64_t        tx_packets_cos3;
13675         /* Total number of tx packets count on cos queue 4 */
13676         uint64_t        tx_packets_cos4;
13677         /* Total number of tx packets count on cos queue 5 */
13678         uint64_t        tx_packets_cos5;
13679         /* Total number of tx packets count on cos queue 6 */
13680         uint64_t        tx_packets_cos6;
13681         /* Total number of tx packets count on cos queue 7 */
13682         uint64_t        tx_packets_cos7;
13683         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
13684         uint64_t        pfc_pri0_tx_duration_us;
13685         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
13686         uint64_t        pfc_pri0_tx_transitions;
13687         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
13688         uint64_t        pfc_pri1_tx_duration_us;
13689         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
13690         uint64_t        pfc_pri1_tx_transitions;
13691         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
13692         uint64_t        pfc_pri2_tx_duration_us;
13693         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
13694         uint64_t        pfc_pri2_tx_transitions;
13695         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
13696         uint64_t        pfc_pri3_tx_duration_us;
13697         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
13698         uint64_t        pfc_pri3_tx_transitions;
13699         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
13700         uint64_t        pfc_pri4_tx_duration_us;
13701         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
13702         uint64_t        pfc_pri4_tx_transitions;
13703         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
13704         uint64_t        pfc_pri5_tx_duration_us;
13705         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
13706         uint64_t        pfc_pri5_tx_transitions;
13707         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
13708         uint64_t        pfc_pri6_tx_duration_us;
13709         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
13710         uint64_t        pfc_pri6_tx_transitions;
13711         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
13712         uint64_t        pfc_pri7_tx_duration_us;
13713         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
13714         uint64_t        pfc_pri7_tx_transitions;
13715 } __attribute__((packed));
13716
13717 /* Port Rx Statistics extended Formats */
13718 /* rx_port_stats_ext (size:2368b/296B) */
13719 struct rx_port_stats_ext {
13720         /* Number of times link state changed to down */
13721         uint64_t        link_down_events;
13722         /* Number of times the idle rings with pause bit are found */
13723         uint64_t        continuous_pause_events;
13724         /* Number of times the active rings pause bit resumed back */
13725         uint64_t        resume_pause_events;
13726         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
13727         uint64_t        continuous_roce_pause_events;
13728         /* Number of times, the ROCE cos queue PFC is enabled back */
13729         uint64_t        resume_roce_pause_events;
13730         /* Total number of rx bytes count on cos queue 0 */
13731         uint64_t        rx_bytes_cos0;
13732         /* Total number of rx bytes count on cos queue 1 */
13733         uint64_t        rx_bytes_cos1;
13734         /* Total number of rx bytes count on cos queue 2 */
13735         uint64_t        rx_bytes_cos2;
13736         /* Total number of rx bytes count on cos queue 3 */
13737         uint64_t        rx_bytes_cos3;
13738         /* Total number of rx bytes count on cos queue 4 */
13739         uint64_t        rx_bytes_cos4;
13740         /* Total number of rx bytes count on cos queue 5 */
13741         uint64_t        rx_bytes_cos5;
13742         /* Total number of rx bytes count on cos queue 6 */
13743         uint64_t        rx_bytes_cos6;
13744         /* Total number of rx bytes count on cos queue 7 */
13745         uint64_t        rx_bytes_cos7;
13746         /* Total number of rx packets count on cos queue 0 */
13747         uint64_t        rx_packets_cos0;
13748         /* Total number of rx packets count on cos queue 1 */
13749         uint64_t        rx_packets_cos1;
13750         /* Total number of rx packets count on cos queue 2 */
13751         uint64_t        rx_packets_cos2;
13752         /* Total number of rx packets count on cos queue 3 */
13753         uint64_t        rx_packets_cos3;
13754         /* Total number of rx packets count on cos queue 4 */
13755         uint64_t        rx_packets_cos4;
13756         /* Total number of rx packets count on cos queue 5 */
13757         uint64_t        rx_packets_cos5;
13758         /* Total number of rx packets count on cos queue 6 */
13759         uint64_t        rx_packets_cos6;
13760         /* Total number of rx packets count on cos queue 7 */
13761         uint64_t        rx_packets_cos7;
13762         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
13763         uint64_t        pfc_pri0_rx_duration_us;
13764         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
13765         uint64_t        pfc_pri0_rx_transitions;
13766         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
13767         uint64_t        pfc_pri1_rx_duration_us;
13768         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
13769         uint64_t        pfc_pri1_rx_transitions;
13770         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
13771         uint64_t        pfc_pri2_rx_duration_us;
13772         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
13773         uint64_t        pfc_pri2_rx_transitions;
13774         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
13775         uint64_t        pfc_pri3_rx_duration_us;
13776         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
13777         uint64_t        pfc_pri3_rx_transitions;
13778         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
13779         uint64_t        pfc_pri4_rx_duration_us;
13780         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
13781         uint64_t        pfc_pri4_rx_transitions;
13782         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
13783         uint64_t        pfc_pri5_rx_duration_us;
13784         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
13785         uint64_t        pfc_pri5_rx_transitions;
13786         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
13787         uint64_t        pfc_pri6_rx_duration_us;
13788         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
13789         uint64_t        pfc_pri6_rx_transitions;
13790         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
13791         uint64_t        pfc_pri7_rx_duration_us;
13792         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
13793         uint64_t        pfc_pri7_rx_transitions;
13794 } __attribute__((packed));
13795
13796 /************************
13797  * hwrm_port_qstats_ext *
13798  ************************/
13799
13800
13801 /* hwrm_port_qstats_ext_input (size:320b/40B) */
13802 struct hwrm_port_qstats_ext_input {
13803         /* The HWRM command request type. */
13804         uint16_t        req_type;
13805         /*
13806          * The completion ring to send the completion event on. This should
13807          * be the NQ ID returned from the `nq_alloc` HWRM command.
13808          */
13809         uint16_t        cmpl_ring;
13810         /*
13811          * The sequence ID is used by the driver for tracking multiple
13812          * commands. This ID is treated as opaque data by the firmware and
13813          * the value is returned in the `hwrm_resp_hdr` upon completion.
13814          */
13815         uint16_t        seq_id;
13816         /*
13817          * The target ID of the command:
13818          * * 0x0-0xFFF8 - The function ID
13819          * * 0xFFF8-0xFFFE - Reserved for internal processors
13820          * * 0xFFFF - HWRM
13821          */
13822         uint16_t        target_id;
13823         /*
13824          * A physical address pointer pointing to a host buffer that the
13825          * command's response data will be written. This can be either a host
13826          * physical address (HPA) or a guest physical address (GPA) and must
13827          * point to a physically contiguous block of memory.
13828          */
13829         uint64_t        resp_addr;
13830         /* Port ID of port that is being queried. */
13831         uint16_t        port_id;
13832         /*
13833          * The size of TX port extended
13834          * statistics block in bytes.
13835          */
13836         uint16_t        tx_stat_size;
13837         /*
13838          * The size of RX port extended
13839          * statistics block in bytes
13840          */
13841         uint16_t        rx_stat_size;
13842         uint8_t unused_0[2];
13843         /*
13844          * This is the host address where
13845          * Tx port statistics will be stored
13846          */
13847         uint64_t        tx_stat_host_addr;
13848         /*
13849          * This is the host address where
13850          * Rx port statistics will be stored
13851          */
13852         uint64_t        rx_stat_host_addr;
13853 } __attribute__((packed));
13854
13855 /* hwrm_port_qstats_ext_output (size:128b/16B) */
13856 struct hwrm_port_qstats_ext_output {
13857         /* The specific error status for the command. */
13858         uint16_t        error_code;
13859         /* The HWRM command request type. */
13860         uint16_t        req_type;
13861         /* The sequence ID from the original command. */
13862         uint16_t        seq_id;
13863         /* The length of the response data in number of bytes. */
13864         uint16_t        resp_len;
13865         /* The size of TX port statistics block in bytes. */
13866         uint16_t        tx_stat_size;
13867         /* The size of RX port statistics block in bytes. */
13868         uint16_t        rx_stat_size;
13869         /* Total number of active cos queues available. */
13870         uint16_t        total_active_cos_queues;
13871         uint8_t flags;
13872         /*
13873          * If set to 1, then this field indicates that clear
13874          * roce specific counters is supported.
13875          */
13876         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
13877                 UINT32_C(0x1)
13878         /*
13879          * This field is used in Output records to indicate that the output
13880          * is completely written to RAM.  This field should be read as '1'
13881          * to indicate that the output has been completely written.
13882          * When writing a command completion or response to an internal processor,
13883          * the order of writes has to be such that this field is written last.
13884          */
13885         uint8_t valid;
13886 } __attribute__((packed));
13887
13888 /*************************
13889  * hwrm_port_lpbk_qstats *
13890  *************************/
13891
13892
13893 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
13894 struct hwrm_port_lpbk_qstats_input {
13895         /* The HWRM command request type. */
13896         uint16_t        req_type;
13897         /*
13898          * The completion ring to send the completion event on. This should
13899          * be the NQ ID returned from the `nq_alloc` HWRM command.
13900          */
13901         uint16_t        cmpl_ring;
13902         /*
13903          * The sequence ID is used by the driver for tracking multiple
13904          * commands. This ID is treated as opaque data by the firmware and
13905          * the value is returned in the `hwrm_resp_hdr` upon completion.
13906          */
13907         uint16_t        seq_id;
13908         /*
13909          * The target ID of the command:
13910          * * 0x0-0xFFF8 - The function ID
13911          * * 0xFFF8-0xFFFE - Reserved for internal processors
13912          * * 0xFFFF - HWRM
13913          */
13914         uint16_t        target_id;
13915         /*
13916          * A physical address pointer pointing to a host buffer that the
13917          * command's response data will be written. This can be either a host
13918          * physical address (HPA) or a guest physical address (GPA) and must
13919          * point to a physically contiguous block of memory.
13920          */
13921         uint64_t        resp_addr;
13922 } __attribute__((packed));
13923
13924 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
13925 struct hwrm_port_lpbk_qstats_output {
13926         /* The specific error status for the command. */
13927         uint16_t        error_code;
13928         /* The HWRM command request type. */
13929         uint16_t        req_type;
13930         /* The sequence ID from the original command. */
13931         uint16_t        seq_id;
13932         /* The length of the response data in number of bytes. */
13933         uint16_t        resp_len;
13934         /* Number of transmitted unicast frames */
13935         uint64_t        lpbk_ucast_frames;
13936         /* Number of transmitted multicast frames */
13937         uint64_t        lpbk_mcast_frames;
13938         /* Number of transmitted broadcast frames */
13939         uint64_t        lpbk_bcast_frames;
13940         /* Number of transmitted bytes for unicast traffic */
13941         uint64_t        lpbk_ucast_bytes;
13942         /* Number of transmitted bytes for multicast traffic */
13943         uint64_t        lpbk_mcast_bytes;
13944         /* Number of transmitted bytes for broadcast traffic */
13945         uint64_t        lpbk_bcast_bytes;
13946         /* Total Tx Drops for loopback traffic reported by STATS block */
13947         uint64_t        tx_stat_discard;
13948         /* Total Tx Error Drops for loopback traffic reported by STATS block */
13949         uint64_t        tx_stat_error;
13950         /* Total Rx Drops for loopback traffic reported by STATS block */
13951         uint64_t        rx_stat_discard;
13952         /* Total Rx Error Drops for loopback traffic reported by STATS block */
13953         uint64_t        rx_stat_error;
13954         uint8_t unused_0[7];
13955         /*
13956          * This field is used in Output records to indicate that the output
13957          * is completely written to RAM.  This field should be read as '1'
13958          * to indicate that the output has been completely written.
13959          * When writing a command completion or response to an internal processor,
13960          * the order of writes has to be such that this field is written last.
13961          */
13962         uint8_t valid;
13963 } __attribute__((packed));
13964
13965 /***********************
13966  * hwrm_port_clr_stats *
13967  ***********************/
13968
13969
13970 /* hwrm_port_clr_stats_input (size:192b/24B) */
13971 struct hwrm_port_clr_stats_input {
13972         /* The HWRM command request type. */
13973         uint16_t        req_type;
13974         /*
13975          * The completion ring to send the completion event on. This should
13976          * be the NQ ID returned from the `nq_alloc` HWRM command.
13977          */
13978         uint16_t        cmpl_ring;
13979         /*
13980          * The sequence ID is used by the driver for tracking multiple
13981          * commands. This ID is treated as opaque data by the firmware and
13982          * the value is returned in the `hwrm_resp_hdr` upon completion.
13983          */
13984         uint16_t        seq_id;
13985         /*
13986          * The target ID of the command:
13987          * * 0x0-0xFFF8 - The function ID
13988          * * 0xFFF8-0xFFFE - Reserved for internal processors
13989          * * 0xFFFF - HWRM
13990          */
13991         uint16_t        target_id;
13992         /*
13993          * A physical address pointer pointing to a host buffer that the
13994          * command's response data will be written. This can be either a host
13995          * physical address (HPA) or a guest physical address (GPA) and must
13996          * point to a physically contiguous block of memory.
13997          */
13998         uint64_t        resp_addr;
13999         /* Port ID of port that is being queried. */
14000         uint16_t        port_id;
14001         uint8_t flags;
14002         /*
14003          * If set to 1, then this field indicates clear the following RoCE
14004          * specific counters.
14005          * RoCE associated TX/RX cos counters
14006          * CNP associated TX/RX cos counters
14007          * RoCE/CNP specific TX/RX flow counters
14008          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
14009          * This flag is honored only when RoCE is enabled on that port.
14010          */
14011         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
14012         uint8_t unused_0[5];
14013 } __attribute__((packed));
14014
14015 /* hwrm_port_clr_stats_output (size:128b/16B) */
14016 struct hwrm_port_clr_stats_output {
14017         /* The specific error status for the command. */
14018         uint16_t        error_code;
14019         /* The HWRM command request type. */
14020         uint16_t        req_type;
14021         /* The sequence ID from the original command. */
14022         uint16_t        seq_id;
14023         /* The length of the response data in number of bytes. */
14024         uint16_t        resp_len;
14025         uint8_t unused_0[7];
14026         /*
14027          * This field is used in Output records to indicate that the output
14028          * is completely written to RAM.  This field should be read as '1'
14029          * to indicate that the output has been completely written.
14030          * When writing a command completion or response to an internal processor,
14031          * the order of writes has to be such that this field is written last.
14032          */
14033         uint8_t valid;
14034 } __attribute__((packed));
14035
14036 /***********************
14037  * hwrm_port_phy_qcaps *
14038  ***********************/
14039
14040
14041 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
14042 struct hwrm_port_phy_qcaps_input {
14043         /* The HWRM command request type. */
14044         uint16_t        req_type;
14045         /*
14046          * The completion ring to send the completion event on. This should
14047          * be the NQ ID returned from the `nq_alloc` HWRM command.
14048          */
14049         uint16_t        cmpl_ring;
14050         /*
14051          * The sequence ID is used by the driver for tracking multiple
14052          * commands. This ID is treated as opaque data by the firmware and
14053          * the value is returned in the `hwrm_resp_hdr` upon completion.
14054          */
14055         uint16_t        seq_id;
14056         /*
14057          * The target ID of the command:
14058          * * 0x0-0xFFF8 - The function ID
14059          * * 0xFFF8-0xFFFE - Reserved for internal processors
14060          * * 0xFFFF - HWRM
14061          */
14062         uint16_t        target_id;
14063         /*
14064          * A physical address pointer pointing to a host buffer that the
14065          * command's response data will be written. This can be either a host
14066          * physical address (HPA) or a guest physical address (GPA) and must
14067          * point to a physically contiguous block of memory.
14068          */
14069         uint64_t        resp_addr;
14070         /* Port ID of port that is being queried. */
14071         uint16_t        port_id;
14072         uint8_t unused_0[6];
14073 } __attribute__((packed));
14074
14075 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
14076 struct hwrm_port_phy_qcaps_output {
14077         /* The specific error status for the command. */
14078         uint16_t        error_code;
14079         /* The HWRM command request type. */
14080         uint16_t        req_type;
14081         /* The sequence ID from the original command. */
14082         uint16_t        seq_id;
14083         /* The length of the response data in number of bytes. */
14084         uint16_t        resp_len;
14085         /* PHY capability flags */
14086         uint8_t flags;
14087         /*
14088          * If set to 1, then this field indicates that the
14089          * link is capable of supporting EEE.
14090          */
14091         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
14092                 UINT32_C(0x1)
14093         /*
14094          * If set to 1, then this field indicates that the
14095          * PHY is capable of supporting external loopback.
14096          */
14097         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
14098                 UINT32_C(0x2)
14099         /*
14100          * Reserved field. The HWRM shall set this field to 0.
14101          * An HWRM client shall ignore this field.
14102          */
14103         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
14104                 UINT32_C(0xfc)
14105         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT                   2
14106         /* Number of front panel ports for this device. */
14107         uint8_t port_cnt;
14108         /* Not supported or unknown */
14109         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
14110         /* single port device */
14111         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
14112         /* 2-port device */
14113         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
14114         /* 3-port device */
14115         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
14116         /* 4-port device */
14117         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
14118         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
14119                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
14120         /*
14121          * This is a bit mask to indicate what speeds are supported
14122          * as forced speeds on this link.
14123          * For each speed that can be forced on this link, the
14124          * corresponding mask bit shall be set to '1'.
14125          */
14126         uint16_t        supported_speeds_force_mode;
14127         /* 100Mb link speed (Half-duplex) */
14128         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
14129                 UINT32_C(0x1)
14130         /* 100Mb link speed (Full-duplex) */
14131         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
14132                 UINT32_C(0x2)
14133         /* 1Gb link speed (Half-duplex) */
14134         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
14135                 UINT32_C(0x4)
14136         /* 1Gb link speed (Full-duplex) */
14137         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
14138                 UINT32_C(0x8)
14139         /* 2Gb link speed */
14140         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
14141                 UINT32_C(0x10)
14142         /* 25Gb link speed */
14143         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
14144                 UINT32_C(0x20)
14145         /* 10Gb link speed */
14146         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
14147                 UINT32_C(0x40)
14148         /* 20Gb link speed */
14149         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
14150                 UINT32_C(0x80)
14151         /* 25Gb link speed */
14152         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
14153                 UINT32_C(0x100)
14154         /* 40Gb link speed */
14155         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
14156                 UINT32_C(0x200)
14157         /* 50Gb link speed */
14158         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
14159                 UINT32_C(0x400)
14160         /* 100Gb link speed */
14161         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
14162                 UINT32_C(0x800)
14163         /* 10Mb link speed (Half-duplex) */
14164         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
14165                 UINT32_C(0x1000)
14166         /* 10Mb link speed (Full-duplex) */
14167         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
14168                 UINT32_C(0x2000)
14169         /*
14170          * This is a bit mask to indicate what speeds are supported
14171          * for autonegotiation on this link.
14172          * For each speed that can be autonegotiated on this link, the
14173          * corresponding mask bit shall be set to '1'.
14174          */
14175         uint16_t        supported_speeds_auto_mode;
14176         /* 100Mb link speed (Half-duplex) */
14177         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
14178                 UINT32_C(0x1)
14179         /* 100Mb link speed (Full-duplex) */
14180         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
14181                 UINT32_C(0x2)
14182         /* 1Gb link speed (Half-duplex) */
14183         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
14184                 UINT32_C(0x4)
14185         /* 1Gb link speed (Full-duplex) */
14186         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
14187                 UINT32_C(0x8)
14188         /* 2Gb link speed */
14189         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
14190                 UINT32_C(0x10)
14191         /* 25Gb link speed */
14192         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
14193                 UINT32_C(0x20)
14194         /* 10Gb link speed */
14195         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
14196                 UINT32_C(0x40)
14197         /* 20Gb link speed */
14198         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
14199                 UINT32_C(0x80)
14200         /* 25Gb link speed */
14201         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
14202                 UINT32_C(0x100)
14203         /* 40Gb link speed */
14204         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
14205                 UINT32_C(0x200)
14206         /* 50Gb link speed */
14207         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
14208                 UINT32_C(0x400)
14209         /* 100Gb link speed */
14210         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
14211                 UINT32_C(0x800)
14212         /* 10Mb link speed (Half-duplex) */
14213         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
14214                 UINT32_C(0x1000)
14215         /* 10Mb link speed (Full-duplex) */
14216         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
14217                 UINT32_C(0x2000)
14218         /*
14219          * This is a bit mask to indicate what speeds are supported
14220          * for EEE on this link.
14221          * For each speed that can be autonegotiated when EEE is enabled
14222          * on this link, the corresponding mask bit shall be set to '1'.
14223          * This field is only valid when the eee_suppotred is set to '1'.
14224          */
14225         uint16_t        supported_speeds_eee_mode;
14226         /* Reserved */
14227         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
14228                 UINT32_C(0x1)
14229         /* 100Mb link speed (Full-duplex) */
14230         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
14231                 UINT32_C(0x2)
14232         /* Reserved */
14233         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
14234                 UINT32_C(0x4)
14235         /* 1Gb link speed (Full-duplex) */
14236         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
14237                 UINT32_C(0x8)
14238         /* Reserved */
14239         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
14240                 UINT32_C(0x10)
14241         /* Reserved */
14242         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
14243                 UINT32_C(0x20)
14244         /* 10Gb link speed */
14245         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
14246                 UINT32_C(0x40)
14247         uint32_t        tx_lpi_timer_low;
14248         /*
14249          * The lowest value of TX LPI timer that can be set on this link
14250          * when EEE is enabled. This value is in microseconds.
14251          * This field is valid only when_eee_supported is set to '1'.
14252          */
14253         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
14254                 UINT32_C(0xffffff)
14255         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
14256         /*
14257          * Reserved field. The HWRM shall set this field to 0.
14258          * An HWRM client shall ignore this field.
14259          */
14260         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
14261                 UINT32_C(0xff000000)
14262         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
14263         uint32_t        valid_tx_lpi_timer_high;
14264         /*
14265          * The highest value of TX LPI timer that can be set on this link
14266          * when EEE is enabled. This value is in microseconds.
14267          * This field is valid only when_eee_supported is set to '1'.
14268          */
14269         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
14270                 UINT32_C(0xffffff)
14271         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
14272         /*
14273          * This field is used in Output records to indicate that the output
14274          * is completely written to RAM.  This field should be read as '1'
14275          * to indicate that the output has been completely written.
14276          * When writing a command completion or response to an internal processor,
14277          * the order of writes has to be such that this field is written last.
14278          */
14279         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
14280                 UINT32_C(0xff000000)
14281         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
14282 } __attribute__((packed));
14283
14284 /*********************
14285  * hwrm_port_led_cfg *
14286  *********************/
14287
14288
14289 /* hwrm_port_led_cfg_input (size:512b/64B) */
14290 struct hwrm_port_led_cfg_input {
14291         /* The HWRM command request type. */
14292         uint16_t        req_type;
14293         /*
14294          * The completion ring to send the completion event on. This should
14295          * be the NQ ID returned from the `nq_alloc` HWRM command.
14296          */
14297         uint16_t        cmpl_ring;
14298         /*
14299          * The sequence ID is used by the driver for tracking multiple
14300          * commands. This ID is treated as opaque data by the firmware and
14301          * the value is returned in the `hwrm_resp_hdr` upon completion.
14302          */
14303         uint16_t        seq_id;
14304         /*
14305          * The target ID of the command:
14306          * * 0x0-0xFFF8 - The function ID
14307          * * 0xFFF8-0xFFFE - Reserved for internal processors
14308          * * 0xFFFF - HWRM
14309          */
14310         uint16_t        target_id;
14311         /*
14312          * A physical address pointer pointing to a host buffer that the
14313          * command's response data will be written. This can be either a host
14314          * physical address (HPA) or a guest physical address (GPA) and must
14315          * point to a physically contiguous block of memory.
14316          */
14317         uint64_t        resp_addr;
14318         uint32_t        enables;
14319         /*
14320          * This bit must be '1' for the led0_id field to be
14321          * configured.
14322          */
14323         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
14324                 UINT32_C(0x1)
14325         /*
14326          * This bit must be '1' for the led0_state field to be
14327          * configured.
14328          */
14329         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
14330                 UINT32_C(0x2)
14331         /*
14332          * This bit must be '1' for the led0_color field to be
14333          * configured.
14334          */
14335         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
14336                 UINT32_C(0x4)
14337         /*
14338          * This bit must be '1' for the led0_blink_on field to be
14339          * configured.
14340          */
14341         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
14342                 UINT32_C(0x8)
14343         /*
14344          * This bit must be '1' for the led0_blink_off field to be
14345          * configured.
14346          */
14347         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
14348                 UINT32_C(0x10)
14349         /*
14350          * This bit must be '1' for the led0_group_id field to be
14351          * configured.
14352          */
14353         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
14354                 UINT32_C(0x20)
14355         /*
14356          * This bit must be '1' for the led1_id field to be
14357          * configured.
14358          */
14359         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
14360                 UINT32_C(0x40)
14361         /*
14362          * This bit must be '1' for the led1_state field to be
14363          * configured.
14364          */
14365         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
14366                 UINT32_C(0x80)
14367         /*
14368          * This bit must be '1' for the led1_color field to be
14369          * configured.
14370          */
14371         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
14372                 UINT32_C(0x100)
14373         /*
14374          * This bit must be '1' for the led1_blink_on field to be
14375          * configured.
14376          */
14377         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
14378                 UINT32_C(0x200)
14379         /*
14380          * This bit must be '1' for the led1_blink_off field to be
14381          * configured.
14382          */
14383         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
14384                 UINT32_C(0x400)
14385         /*
14386          * This bit must be '1' for the led1_group_id field to be
14387          * configured.
14388          */
14389         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
14390                 UINT32_C(0x800)
14391         /*
14392          * This bit must be '1' for the led2_id field to be
14393          * configured.
14394          */
14395         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
14396                 UINT32_C(0x1000)
14397         /*
14398          * This bit must be '1' for the led2_state field to be
14399          * configured.
14400          */
14401         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
14402                 UINT32_C(0x2000)
14403         /*
14404          * This bit must be '1' for the led2_color field to be
14405          * configured.
14406          */
14407         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
14408                 UINT32_C(0x4000)
14409         /*
14410          * This bit must be '1' for the led2_blink_on field to be
14411          * configured.
14412          */
14413         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
14414                 UINT32_C(0x8000)
14415         /*
14416          * This bit must be '1' for the led2_blink_off field to be
14417          * configured.
14418          */
14419         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
14420                 UINT32_C(0x10000)
14421         /*
14422          * This bit must be '1' for the led2_group_id field to be
14423          * configured.
14424          */
14425         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
14426                 UINT32_C(0x20000)
14427         /*
14428          * This bit must be '1' for the led3_id field to be
14429          * configured.
14430          */
14431         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
14432                 UINT32_C(0x40000)
14433         /*
14434          * This bit must be '1' for the led3_state field to be
14435          * configured.
14436          */
14437         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
14438                 UINT32_C(0x80000)
14439         /*
14440          * This bit must be '1' for the led3_color field to be
14441          * configured.
14442          */
14443         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
14444                 UINT32_C(0x100000)
14445         /*
14446          * This bit must be '1' for the led3_blink_on field to be
14447          * configured.
14448          */
14449         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
14450                 UINT32_C(0x200000)
14451         /*
14452          * This bit must be '1' for the led3_blink_off field to be
14453          * configured.
14454          */
14455         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
14456                 UINT32_C(0x400000)
14457         /*
14458          * This bit must be '1' for the led3_group_id field to be
14459          * configured.
14460          */
14461         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
14462                 UINT32_C(0x800000)
14463         /* Port ID of port whose LEDs are configured. */
14464         uint16_t        port_id;
14465         /*
14466          * The number of LEDs that are being configured.
14467          * Up to 4 LEDs can be configured with this command.
14468          */
14469         uint8_t num_leds;
14470         /* Reserved field. */
14471         uint8_t rsvd;
14472         /* An identifier for the LED #0. */
14473         uint8_t led0_id;
14474         /* The requested state of the LED #0. */
14475         uint8_t led0_state;
14476         /* Default state of the LED */
14477         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
14478         /* Off */
14479         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
14480         /* On */
14481         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
14482         /* Blink */
14483         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
14484         /* Blink Alternately */
14485         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
14486         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
14487                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
14488         /* The requested color of LED #0. */
14489         uint8_t led0_color;
14490         /* Default */
14491         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
14492         /* Amber */
14493         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
14494         /* Green */
14495         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
14496         /* Green or Amber */
14497         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
14498         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
14499                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
14500         uint8_t unused_0;
14501         /*
14502          * If the LED #0 state is "blink" or "blinkalt", then
14503          * this field represents the requested time in milliseconds
14504          * to keep LED on between cycles.
14505          */
14506         uint16_t        led0_blink_on;
14507         /*
14508          * If the LED #0 state is "blink" or "blinkalt", then
14509          * this field represents the requested time in milliseconds
14510          * to keep LED off between cycles.
14511          */
14512         uint16_t        led0_blink_off;
14513         /*
14514          * An identifier for the group of LEDs that LED #0 belongs
14515          * to.
14516          * If set to 0, then the LED #0 shall not be grouped and
14517          * shall be treated as an individual resource.
14518          * For all other non-zero values of this field, LED #0 shall
14519          * be grouped together with the LEDs with the same group ID
14520          * value.
14521          */
14522         uint8_t led0_group_id;
14523         /* Reserved field. */
14524         uint8_t rsvd0;
14525         /* An identifier for the LED #1. */
14526         uint8_t led1_id;
14527         /* The requested state of the LED #1. */
14528         uint8_t led1_state;
14529         /* Default state of the LED */
14530         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
14531         /* Off */
14532         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
14533         /* On */
14534         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
14535         /* Blink */
14536         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
14537         /* Blink Alternately */
14538         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
14539         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
14540                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
14541         /* The requested color of LED #1. */
14542         uint8_t led1_color;
14543         /* Default */
14544         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
14545         /* Amber */
14546         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
14547         /* Green */
14548         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
14549         /* Green or Amber */
14550         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
14551         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
14552                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
14553         uint8_t unused_1;
14554         /*
14555          * If the LED #1 state is "blink" or "blinkalt", then
14556          * this field represents the requested time in milliseconds
14557          * to keep LED on between cycles.
14558          */
14559         uint16_t        led1_blink_on;
14560         /*
14561          * If the LED #1 state is "blink" or "blinkalt", then
14562          * this field represents the requested time in milliseconds
14563          * to keep LED off between cycles.
14564          */
14565         uint16_t        led1_blink_off;
14566         /*
14567          * An identifier for the group of LEDs that LED #1 belongs
14568          * to.
14569          * If set to 0, then the LED #1 shall not be grouped and
14570          * shall be treated as an individual resource.
14571          * For all other non-zero values of this field, LED #1 shall
14572          * be grouped together with the LEDs with the same group ID
14573          * value.
14574          */
14575         uint8_t led1_group_id;
14576         /* Reserved field. */
14577         uint8_t rsvd1;
14578         /* An identifier for the LED #2. */
14579         uint8_t led2_id;
14580         /* The requested state of the LED #2. */
14581         uint8_t led2_state;
14582         /* Default state of the LED */
14583         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
14584         /* Off */
14585         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
14586         /* On */
14587         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
14588         /* Blink */
14589         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
14590         /* Blink Alternately */
14591         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
14592         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
14593                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
14594         /* The requested color of LED #2. */
14595         uint8_t led2_color;
14596         /* Default */
14597         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
14598         /* Amber */
14599         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
14600         /* Green */
14601         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
14602         /* Green or Amber */
14603         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
14604         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
14605                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
14606         uint8_t unused_2;
14607         /*
14608          * If the LED #2 state is "blink" or "blinkalt", then
14609          * this field represents the requested time in milliseconds
14610          * to keep LED on between cycles.
14611          */
14612         uint16_t        led2_blink_on;
14613         /*
14614          * If the LED #2 state is "blink" or "blinkalt", then
14615          * this field represents the requested time in milliseconds
14616          * to keep LED off between cycles.
14617          */
14618         uint16_t        led2_blink_off;
14619         /*
14620          * An identifier for the group of LEDs that LED #2 belongs
14621          * to.
14622          * If set to 0, then the LED #2 shall not be grouped and
14623          * shall be treated as an individual resource.
14624          * For all other non-zero values of this field, LED #2 shall
14625          * be grouped together with the LEDs with the same group ID
14626          * value.
14627          */
14628         uint8_t led2_group_id;
14629         /* Reserved field. */
14630         uint8_t rsvd2;
14631         /* An identifier for the LED #3. */
14632         uint8_t led3_id;
14633         /* The requested state of the LED #3. */
14634         uint8_t led3_state;
14635         /* Default state of the LED */
14636         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
14637         /* Off */
14638         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
14639         /* On */
14640         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
14641         /* Blink */
14642         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
14643         /* Blink Alternately */
14644         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
14645         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
14646                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
14647         /* The requested color of LED #3. */
14648         uint8_t led3_color;
14649         /* Default */
14650         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
14651         /* Amber */
14652         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
14653         /* Green */
14654         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
14655         /* Green or Amber */
14656         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
14657         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
14658                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
14659         uint8_t unused_3;
14660         /*
14661          * If the LED #3 state is "blink" or "blinkalt", then
14662          * this field represents the requested time in milliseconds
14663          * to keep LED on between cycles.
14664          */
14665         uint16_t        led3_blink_on;
14666         /*
14667          * If the LED #3 state is "blink" or "blinkalt", then
14668          * this field represents the requested time in milliseconds
14669          * to keep LED off between cycles.
14670          */
14671         uint16_t        led3_blink_off;
14672         /*
14673          * An identifier for the group of LEDs that LED #3 belongs
14674          * to.
14675          * If set to 0, then the LED #3 shall not be grouped and
14676          * shall be treated as an individual resource.
14677          * For all other non-zero values of this field, LED #3 shall
14678          * be grouped together with the LEDs with the same group ID
14679          * value.
14680          */
14681         uint8_t led3_group_id;
14682         /* Reserved field. */
14683         uint8_t rsvd3;
14684 } __attribute__((packed));
14685
14686 /* hwrm_port_led_cfg_output (size:128b/16B) */
14687 struct hwrm_port_led_cfg_output {
14688         /* The specific error status for the command. */
14689         uint16_t        error_code;
14690         /* The HWRM command request type. */
14691         uint16_t        req_type;
14692         /* The sequence ID from the original command. */
14693         uint16_t        seq_id;
14694         /* The length of the response data in number of bytes. */
14695         uint16_t        resp_len;
14696         uint8_t unused_0[7];
14697         /*
14698          * This field is used in Output records to indicate that the output
14699          * is completely written to RAM.  This field should be read as '1'
14700          * to indicate that the output has been completely written.
14701          * When writing a command completion or response to an internal processor,
14702          * the order of writes has to be such that this field is written last.
14703          */
14704         uint8_t valid;
14705 } __attribute__((packed));
14706
14707 /**********************
14708  * hwrm_port_led_qcfg *
14709  **********************/
14710
14711
14712 /* hwrm_port_led_qcfg_input (size:192b/24B) */
14713 struct hwrm_port_led_qcfg_input {
14714         /* The HWRM command request type. */
14715         uint16_t        req_type;
14716         /*
14717          * The completion ring to send the completion event on. This should
14718          * be the NQ ID returned from the `nq_alloc` HWRM command.
14719          */
14720         uint16_t        cmpl_ring;
14721         /*
14722          * The sequence ID is used by the driver for tracking multiple
14723          * commands. This ID is treated as opaque data by the firmware and
14724          * the value is returned in the `hwrm_resp_hdr` upon completion.
14725          */
14726         uint16_t        seq_id;
14727         /*
14728          * The target ID of the command:
14729          * * 0x0-0xFFF8 - The function ID
14730          * * 0xFFF8-0xFFFE - Reserved for internal processors
14731          * * 0xFFFF - HWRM
14732          */
14733         uint16_t        target_id;
14734         /*
14735          * A physical address pointer pointing to a host buffer that the
14736          * command's response data will be written. This can be either a host
14737          * physical address (HPA) or a guest physical address (GPA) and must
14738          * point to a physically contiguous block of memory.
14739          */
14740         uint64_t        resp_addr;
14741         /* Port ID of port whose LED configuration is being queried. */
14742         uint16_t        port_id;
14743         uint8_t unused_0[6];
14744 } __attribute__((packed));
14745
14746 /* hwrm_port_led_qcfg_output (size:448b/56B) */
14747 struct hwrm_port_led_qcfg_output {
14748         /* The specific error status for the command. */
14749         uint16_t        error_code;
14750         /* The HWRM command request type. */
14751         uint16_t        req_type;
14752         /* The sequence ID from the original command. */
14753         uint16_t        seq_id;
14754         /* The length of the response data in number of bytes. */
14755         uint16_t        resp_len;
14756         /*
14757          * The number of LEDs that are configured on this port.
14758          * Up to 4 LEDs can be returned in the response.
14759          */
14760         uint8_t num_leds;
14761         /* An identifier for the LED #0. */
14762         uint8_t led0_id;
14763         /* The type of LED #0. */
14764         uint8_t led0_type;
14765         /* Speed LED */
14766         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
14767         /* Activity LED */
14768         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
14769         /* Invalid */
14770         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
14771         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
14772                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
14773         /* The current state of the LED #0. */
14774         uint8_t led0_state;
14775         /* Default state of the LED */
14776         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
14777         /* Off */
14778         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
14779         /* On */
14780         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
14781         /* Blink */
14782         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
14783         /* Blink Alternately */
14784         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
14785         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
14786                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
14787         /* The color of LED #0. */
14788         uint8_t led0_color;
14789         /* Default */
14790         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
14791         /* Amber */
14792         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
14793         /* Green */
14794         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
14795         /* Green or Amber */
14796         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
14797         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
14798                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
14799         uint8_t unused_0;
14800         /*
14801          * If the LED #0 state is "blink" or "blinkalt", then
14802          * this field represents the requested time in milliseconds
14803          * to keep LED on between cycles.
14804          */
14805         uint16_t        led0_blink_on;
14806         /*
14807          * If the LED #0 state is "blink" or "blinkalt", then
14808          * this field represents the requested time in milliseconds
14809          * to keep LED off between cycles.
14810          */
14811         uint16_t        led0_blink_off;
14812         /*
14813          * An identifier for the group of LEDs that LED #0 belongs
14814          * to.
14815          * If set to 0, then the LED #0 is not grouped.
14816          * For all other non-zero values of this field, LED #0 is
14817          * grouped together with the LEDs with the same group ID
14818          * value.
14819          */
14820         uint8_t led0_group_id;
14821         /* An identifier for the LED #1. */
14822         uint8_t led1_id;
14823         /* The type of LED #1. */
14824         uint8_t led1_type;
14825         /* Speed LED */
14826         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
14827         /* Activity LED */
14828         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
14829         /* Invalid */
14830         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
14831         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
14832                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
14833         /* The current state of the LED #1. */
14834         uint8_t led1_state;
14835         /* Default state of the LED */
14836         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
14837         /* Off */
14838         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
14839         /* On */
14840         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
14841         /* Blink */
14842         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
14843         /* Blink Alternately */
14844         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
14845         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
14846                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
14847         /* The color of LED #1. */
14848         uint8_t led1_color;
14849         /* Default */
14850         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
14851         /* Amber */
14852         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
14853         /* Green */
14854         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
14855         /* Green or Amber */
14856         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
14857         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
14858                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
14859         uint8_t unused_1;
14860         /*
14861          * If the LED #1 state is "blink" or "blinkalt", then
14862          * this field represents the requested time in milliseconds
14863          * to keep LED on between cycles.
14864          */
14865         uint16_t        led1_blink_on;
14866         /*
14867          * If the LED #1 state is "blink" or "blinkalt", then
14868          * this field represents the requested time in milliseconds
14869          * to keep LED off between cycles.
14870          */
14871         uint16_t        led1_blink_off;
14872         /*
14873          * An identifier for the group of LEDs that LED #1 belongs
14874          * to.
14875          * If set to 0, then the LED #1 is not grouped.
14876          * For all other non-zero values of this field, LED #1 is
14877          * grouped together with the LEDs with the same group ID
14878          * value.
14879          */
14880         uint8_t led1_group_id;
14881         /* An identifier for the LED #2. */
14882         uint8_t led2_id;
14883         /* The type of LED #2. */
14884         uint8_t led2_type;
14885         /* Speed LED */
14886         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
14887         /* Activity LED */
14888         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
14889         /* Invalid */
14890         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
14891         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
14892                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
14893         /* The current state of the LED #2. */
14894         uint8_t led2_state;
14895         /* Default state of the LED */
14896         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
14897         /* Off */
14898         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
14899         /* On */
14900         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
14901         /* Blink */
14902         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
14903         /* Blink Alternately */
14904         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
14905         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
14906                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
14907         /* The color of LED #2. */
14908         uint8_t led2_color;
14909         /* Default */
14910         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
14911         /* Amber */
14912         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
14913         /* Green */
14914         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
14915         /* Green or Amber */
14916         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
14917         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
14918                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
14919         uint8_t unused_2;
14920         /*
14921          * If the LED #2 state is "blink" or "blinkalt", then
14922          * this field represents the requested time in milliseconds
14923          * to keep LED on between cycles.
14924          */
14925         uint16_t        led2_blink_on;
14926         /*
14927          * If the LED #2 state is "blink" or "blinkalt", then
14928          * this field represents the requested time in milliseconds
14929          * to keep LED off between cycles.
14930          */
14931         uint16_t        led2_blink_off;
14932         /*
14933          * An identifier for the group of LEDs that LED #2 belongs
14934          * to.
14935          * If set to 0, then the LED #2 is not grouped.
14936          * For all other non-zero values of this field, LED #2 is
14937          * grouped together with the LEDs with the same group ID
14938          * value.
14939          */
14940         uint8_t led2_group_id;
14941         /* An identifier for the LED #3. */
14942         uint8_t led3_id;
14943         /* The type of LED #3. */
14944         uint8_t led3_type;
14945         /* Speed LED */
14946         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
14947         /* Activity LED */
14948         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
14949         /* Invalid */
14950         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
14951         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
14952                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
14953         /* The current state of the LED #3. */
14954         uint8_t led3_state;
14955         /* Default state of the LED */
14956         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
14957         /* Off */
14958         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
14959         /* On */
14960         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
14961         /* Blink */
14962         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
14963         /* Blink Alternately */
14964         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
14965         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
14966                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
14967         /* The color of LED #3. */
14968         uint8_t led3_color;
14969         /* Default */
14970         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
14971         /* Amber */
14972         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
14973         /* Green */
14974         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
14975         /* Green or Amber */
14976         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
14977         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
14978                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
14979         uint8_t unused_3;
14980         /*
14981          * If the LED #3 state is "blink" or "blinkalt", then
14982          * this field represents the requested time in milliseconds
14983          * to keep LED on between cycles.
14984          */
14985         uint16_t        led3_blink_on;
14986         /*
14987          * If the LED #3 state is "blink" or "blinkalt", then
14988          * this field represents the requested time in milliseconds
14989          * to keep LED off between cycles.
14990          */
14991         uint16_t        led3_blink_off;
14992         /*
14993          * An identifier for the group of LEDs that LED #3 belongs
14994          * to.
14995          * If set to 0, then the LED #3 is not grouped.
14996          * For all other non-zero values of this field, LED #3 is
14997          * grouped together with the LEDs with the same group ID
14998          * value.
14999          */
15000         uint8_t led3_group_id;
15001         uint8_t unused_4[6];
15002         /*
15003          * This field is used in Output records to indicate that the output
15004          * is completely written to RAM.  This field should be read as '1'
15005          * to indicate that the output has been completely written.
15006          * When writing a command completion or response to an internal processor,
15007          * the order of writes has to be such that this field is written last.
15008          */
15009         uint8_t valid;
15010 } __attribute__((packed));
15011
15012 /***********************
15013  * hwrm_port_led_qcaps *
15014  ***********************/
15015
15016
15017 /* hwrm_port_led_qcaps_input (size:192b/24B) */
15018 struct hwrm_port_led_qcaps_input {
15019         /* The HWRM command request type. */
15020         uint16_t        req_type;
15021         /*
15022          * The completion ring to send the completion event on. This should
15023          * be the NQ ID returned from the `nq_alloc` HWRM command.
15024          */
15025         uint16_t        cmpl_ring;
15026         /*
15027          * The sequence ID is used by the driver for tracking multiple
15028          * commands. This ID is treated as opaque data by the firmware and
15029          * the value is returned in the `hwrm_resp_hdr` upon completion.
15030          */
15031         uint16_t        seq_id;
15032         /*
15033          * The target ID of the command:
15034          * * 0x0-0xFFF8 - The function ID
15035          * * 0xFFF8-0xFFFE - Reserved for internal processors
15036          * * 0xFFFF - HWRM
15037          */
15038         uint16_t        target_id;
15039         /*
15040          * A physical address pointer pointing to a host buffer that the
15041          * command's response data will be written. This can be either a host
15042          * physical address (HPA) or a guest physical address (GPA) and must
15043          * point to a physically contiguous block of memory.
15044          */
15045         uint64_t        resp_addr;
15046         /* Port ID of port whose LED configuration is being queried. */
15047         uint16_t        port_id;
15048         uint8_t unused_0[6];
15049 } __attribute__((packed));
15050
15051 /* hwrm_port_led_qcaps_output (size:384b/48B) */
15052 struct hwrm_port_led_qcaps_output {
15053         /* The specific error status for the command. */
15054         uint16_t        error_code;
15055         /* The HWRM command request type. */
15056         uint16_t        req_type;
15057         /* The sequence ID from the original command. */
15058         uint16_t        seq_id;
15059         /* The length of the response data in number of bytes. */
15060         uint16_t        resp_len;
15061         /*
15062          * The number of LEDs that are configured on this port.
15063          * Up to 4 LEDs can be returned in the response.
15064          */
15065         uint8_t num_leds;
15066         /* Reserved for future use. */
15067         uint8_t unused[3];
15068         /* An identifier for the LED #0. */
15069         uint8_t led0_id;
15070         /* The type of LED #0. */
15071         uint8_t led0_type;
15072         /* Speed LED */
15073         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
15074         /* Activity LED */
15075         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
15076         /* Invalid */
15077         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
15078         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
15079                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
15080         /*
15081          * An identifier for the group of LEDs that LED #0 belongs
15082          * to.
15083          * If set to 0, then the LED #0 cannot be grouped.
15084          * For all other non-zero values of this field, LED #0 is
15085          * grouped together with the LEDs with the same group ID
15086          * value.
15087          */
15088         uint8_t led0_group_id;
15089         uint8_t unused_0;
15090         /* The states supported by LED #0. */
15091         uint16_t        led0_state_caps;
15092         /*
15093          * If set to 1, this LED is enabled.
15094          * If set to 0, this LED is disabled.
15095          */
15096         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
15097                 UINT32_C(0x1)
15098         /*
15099          * If set to 1, off state is supported on this LED.
15100          * If set to 0, off state is not supported on this LED.
15101          */
15102         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
15103                 UINT32_C(0x2)
15104         /*
15105          * If set to 1, on state is supported on this LED.
15106          * If set to 0, on state is not supported on this LED.
15107          */
15108         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
15109                 UINT32_C(0x4)
15110         /*
15111          * If set to 1, blink state is supported on this LED.
15112          * If set to 0, blink state is not supported on this LED.
15113          */
15114         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
15115                 UINT32_C(0x8)
15116         /*
15117          * If set to 1, blink_alt state is supported on this LED.
15118          * If set to 0, blink_alt state is not supported on this LED.
15119          */
15120         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
15121                 UINT32_C(0x10)
15122         /* The colors supported by LED #0. */
15123         uint16_t        led0_color_caps;
15124         /* reserved. */
15125         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
15126                 UINT32_C(0x1)
15127         /*
15128          * If set to 1, Amber color is supported on this LED.
15129          * If set to 0, Amber color is not supported on this LED.
15130          */
15131         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
15132                 UINT32_C(0x2)
15133         /*
15134          * If set to 1, Green color is supported on this LED.
15135          * If set to 0, Green color is not supported on this LED.
15136          */
15137         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
15138                 UINT32_C(0x4)
15139         /* An identifier for the LED #1. */
15140         uint8_t led1_id;
15141         /* The type of LED #1. */
15142         uint8_t led1_type;
15143         /* Speed LED */
15144         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
15145         /* Activity LED */
15146         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
15147         /* Invalid */
15148         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
15149         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
15150                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
15151         /*
15152          * An identifier for the group of LEDs that LED #1 belongs
15153          * to.
15154          * If set to 0, then the LED #0 cannot be grouped.
15155          * For all other non-zero values of this field, LED #0 is
15156          * grouped together with the LEDs with the same group ID
15157          * value.
15158          */
15159         uint8_t led1_group_id;
15160         uint8_t unused_1;
15161         /* The states supported by LED #1. */
15162         uint16_t        led1_state_caps;
15163         /*
15164          * If set to 1, this LED is enabled.
15165          * If set to 0, this LED is disabled.
15166          */
15167         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
15168                 UINT32_C(0x1)
15169         /*
15170          * If set to 1, off state is supported on this LED.
15171          * If set to 0, off state is not supported on this LED.
15172          */
15173         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
15174                 UINT32_C(0x2)
15175         /*
15176          * If set to 1, on state is supported on this LED.
15177          * If set to 0, on state is not supported on this LED.
15178          */
15179         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
15180                 UINT32_C(0x4)
15181         /*
15182          * If set to 1, blink state is supported on this LED.
15183          * If set to 0, blink state is not supported on this LED.
15184          */
15185         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
15186                 UINT32_C(0x8)
15187         /*
15188          * If set to 1, blink_alt state is supported on this LED.
15189          * If set to 0, blink_alt state is not supported on this LED.
15190          */
15191         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
15192                 UINT32_C(0x10)
15193         /* The colors supported by LED #1. */
15194         uint16_t        led1_color_caps;
15195         /* reserved. */
15196         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
15197                 UINT32_C(0x1)
15198         /*
15199          * If set to 1, Amber color is supported on this LED.
15200          * If set to 0, Amber color is not supported on this LED.
15201          */
15202         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
15203                 UINT32_C(0x2)
15204         /*
15205          * If set to 1, Green color is supported on this LED.
15206          * If set to 0, Green color is not supported on this LED.
15207          */
15208         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
15209                 UINT32_C(0x4)
15210         /* An identifier for the LED #2. */
15211         uint8_t led2_id;
15212         /* The type of LED #2. */
15213         uint8_t led2_type;
15214         /* Speed LED */
15215         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
15216         /* Activity LED */
15217         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
15218         /* Invalid */
15219         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
15220         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
15221                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
15222         /*
15223          * An identifier for the group of LEDs that LED #0 belongs
15224          * to.
15225          * If set to 0, then the LED #0 cannot be grouped.
15226          * For all other non-zero values of this field, LED #0 is
15227          * grouped together with the LEDs with the same group ID
15228          * value.
15229          */
15230         uint8_t led2_group_id;
15231         uint8_t unused_2;
15232         /* The states supported by LED #2. */
15233         uint16_t        led2_state_caps;
15234         /*
15235          * If set to 1, this LED is enabled.
15236          * If set to 0, this LED is disabled.
15237          */
15238         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
15239                 UINT32_C(0x1)
15240         /*
15241          * If set to 1, off state is supported on this LED.
15242          * If set to 0, off state is not supported on this LED.
15243          */
15244         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
15245                 UINT32_C(0x2)
15246         /*
15247          * If set to 1, on state is supported on this LED.
15248          * If set to 0, on state is not supported on this LED.
15249          */
15250         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
15251                 UINT32_C(0x4)
15252         /*
15253          * If set to 1, blink state is supported on this LED.
15254          * If set to 0, blink state is not supported on this LED.
15255          */
15256         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
15257                 UINT32_C(0x8)
15258         /*
15259          * If set to 1, blink_alt state is supported on this LED.
15260          * If set to 0, blink_alt state is not supported on this LED.
15261          */
15262         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
15263                 UINT32_C(0x10)
15264         /* The colors supported by LED #2. */
15265         uint16_t        led2_color_caps;
15266         /* reserved. */
15267         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
15268                 UINT32_C(0x1)
15269         /*
15270          * If set to 1, Amber color is supported on this LED.
15271          * If set to 0, Amber color is not supported on this LED.
15272          */
15273         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
15274                 UINT32_C(0x2)
15275         /*
15276          * If set to 1, Green color is supported on this LED.
15277          * If set to 0, Green color is not supported on this LED.
15278          */
15279         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
15280                 UINT32_C(0x4)
15281         /* An identifier for the LED #3. */
15282         uint8_t led3_id;
15283         /* The type of LED #3. */
15284         uint8_t led3_type;
15285         /* Speed LED */
15286         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
15287         /* Activity LED */
15288         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
15289         /* Invalid */
15290         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
15291         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
15292                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
15293         /*
15294          * An identifier for the group of LEDs that LED #3 belongs
15295          * to.
15296          * If set to 0, then the LED #0 cannot be grouped.
15297          * For all other non-zero values of this field, LED #0 is
15298          * grouped together with the LEDs with the same group ID
15299          * value.
15300          */
15301         uint8_t led3_group_id;
15302         uint8_t unused_3;
15303         /* The states supported by LED #3. */
15304         uint16_t        led3_state_caps;
15305         /*
15306          * If set to 1, this LED is enabled.
15307          * If set to 0, this LED is disabled.
15308          */
15309         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
15310                 UINT32_C(0x1)
15311         /*
15312          * If set to 1, off state is supported on this LED.
15313          * If set to 0, off state is not supported on this LED.
15314          */
15315         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
15316                 UINT32_C(0x2)
15317         /*
15318          * If set to 1, on state is supported on this LED.
15319          * If set to 0, on state is not supported on this LED.
15320          */
15321         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
15322                 UINT32_C(0x4)
15323         /*
15324          * If set to 1, blink state is supported on this LED.
15325          * If set to 0, blink state is not supported on this LED.
15326          */
15327         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
15328                 UINT32_C(0x8)
15329         /*
15330          * If set to 1, blink_alt state is supported on this LED.
15331          * If set to 0, blink_alt state is not supported on this LED.
15332          */
15333         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
15334                 UINT32_C(0x10)
15335         /* The colors supported by LED #3. */
15336         uint16_t        led3_color_caps;
15337         /* reserved. */
15338         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
15339                 UINT32_C(0x1)
15340         /*
15341          * If set to 1, Amber color is supported on this LED.
15342          * If set to 0, Amber color is not supported on this LED.
15343          */
15344         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
15345                 UINT32_C(0x2)
15346         /*
15347          * If set to 1, Green color is supported on this LED.
15348          * If set to 0, Green color is not supported on this LED.
15349          */
15350         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
15351                 UINT32_C(0x4)
15352         uint8_t unused_4[3];
15353         /*
15354          * This field is used in Output records to indicate that the output
15355          * is completely written to RAM.  This field should be read as '1'
15356          * to indicate that the output has been completely written.
15357          * When writing a command completion or response to an internal processor,
15358          * the order of writes has to be such that this field is written last.
15359          */
15360         uint8_t valid;
15361 } __attribute__((packed));
15362
15363 /***********************
15364  * hwrm_queue_qportcfg *
15365  ***********************/
15366
15367
15368 /* hwrm_queue_qportcfg_input (size:192b/24B) */
15369 struct hwrm_queue_qportcfg_input {
15370         /* The HWRM command request type. */
15371         uint16_t        req_type;
15372         /*
15373          * The completion ring to send the completion event on. This should
15374          * be the NQ ID returned from the `nq_alloc` HWRM command.
15375          */
15376         uint16_t        cmpl_ring;
15377         /*
15378          * The sequence ID is used by the driver for tracking multiple
15379          * commands. This ID is treated as opaque data by the firmware and
15380          * the value is returned in the `hwrm_resp_hdr` upon completion.
15381          */
15382         uint16_t        seq_id;
15383         /*
15384          * The target ID of the command:
15385          * * 0x0-0xFFF8 - The function ID
15386          * * 0xFFF8-0xFFFE - Reserved for internal processors
15387          * * 0xFFFF - HWRM
15388          */
15389         uint16_t        target_id;
15390         /*
15391          * A physical address pointer pointing to a host buffer that the
15392          * command's response data will be written. This can be either a host
15393          * physical address (HPA) or a guest physical address (GPA) and must
15394          * point to a physically contiguous block of memory.
15395          */
15396         uint64_t        resp_addr;
15397         uint32_t        flags;
15398         /*
15399          * Enumeration denoting the RX, TX type of the resource.
15400          * This enumeration is used for resources that are similar for both
15401          * TX and RX paths of the chip.
15402          */
15403         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
15404         /* tx path */
15405         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
15406         /* rx path */
15407         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
15408         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
15409                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
15410         /*
15411          * Port ID of port for which the queue configuration is being
15412          * queried.  This field is only required when sent by IPC.
15413          */
15414         uint16_t        port_id;
15415         /*
15416          * Drivers will set this capability when it can use
15417          * queue_idx_service_profile to map the queues to application.
15418          */
15419         uint8_t drv_qmap_cap;
15420         /* disabled */
15421         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
15422         /* enabled */
15423         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
15424         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
15425                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
15426         uint8_t unused_0;
15427 } __attribute__((packed));
15428
15429 /* hwrm_queue_qportcfg_output (size:256b/32B) */
15430 struct hwrm_queue_qportcfg_output {
15431         /* The specific error status for the command. */
15432         uint16_t        error_code;
15433         /* The HWRM command request type. */
15434         uint16_t        req_type;
15435         /* The sequence ID from the original command. */
15436         uint16_t        seq_id;
15437         /* The length of the response data in number of bytes. */
15438         uint16_t        resp_len;
15439         /*
15440          * The maximum number of queues that can be configured on this
15441          * port.
15442          * Valid values range from 1 through 8.
15443          */
15444         uint8_t max_configurable_queues;
15445         /*
15446          * The maximum number of lossless queues that can be configured
15447          * on this port.
15448          * Valid values range from 0 through 8.
15449          */
15450         uint8_t max_configurable_lossless_queues;
15451         /*
15452          * Bitmask indicating which queues can be configured by the
15453          * hwrm_queue_cfg command.
15454          *
15455          * Each bit represents a specific queue where bit 0 represents
15456          * queue 0 and bit 7 represents queue 7.
15457          * # A value of 0 indicates that the queue is not configurable
15458          * by the hwrm_queue_cfg command.
15459          * # A value of 1 indicates that the queue is configurable.
15460          * # A hwrm_queue_cfg command shall return error when trying to
15461          * configure a queue not configurable.
15462          */
15463         uint8_t queue_cfg_allowed;
15464         /* Information about queue configuration. */
15465         uint8_t queue_cfg_info;
15466         /*
15467          * If this flag is set to '1', then the queues are
15468          * configured asymmetrically on TX and RX sides.
15469          * If this flag is set to '0', then the queues are
15470          * configured symmetrically on TX and RX sides. For
15471          * symmetric configuration, the queue configuration
15472          * including queue ids and service profiles on the
15473          * TX side is the same as the corresponding queue
15474          * configuration on the RX side.
15475          */
15476         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
15477                 UINT32_C(0x1)
15478         /*
15479          * Bitmask indicating which queues can be configured by the
15480          * hwrm_queue_pfcenable_cfg command.
15481          *
15482          * Each bit represents a specific priority where bit 0 represents
15483          * priority 0 and bit 7 represents priority 7.
15484          * # A value of 0 indicates that the priority is not configurable by
15485          * the hwrm_queue_pfcenable_cfg command.
15486          * # A value of 1 indicates that the priority is configurable.
15487          * # A hwrm_queue_pfcenable_cfg command shall return error when
15488          * trying to configure a priority that is not configurable.
15489          */
15490         uint8_t queue_pfcenable_cfg_allowed;
15491         /*
15492          * Bitmask indicating which queues can be configured by the
15493          * hwrm_queue_pri2cos_cfg command.
15494          *
15495          * Each bit represents a specific queue where bit 0 represents
15496          * queue 0 and bit 7 represents queue 7.
15497          * # A value of 0 indicates that the queue is not configurable
15498          * by the hwrm_queue_pri2cos_cfg command.
15499          * # A value of 1 indicates that the queue is configurable.
15500          * # A hwrm_queue_pri2cos_cfg command shall return error when
15501          * trying to configure a queue that is not configurable.
15502          */
15503         uint8_t queue_pri2cos_cfg_allowed;
15504         /*
15505          * Bitmask indicating which queues can be configured by the
15506          * hwrm_queue_pri2cos_cfg command.
15507          *
15508          * Each bit represents a specific queue where bit 0 represents
15509          * queue 0 and bit 7 represents queue 7.
15510          * # A value of 0 indicates that the queue is not configurable
15511          * by the hwrm_queue_pri2cos_cfg command.
15512          * # A value of 1 indicates that the queue is configurable.
15513          * # A hwrm_queue_pri2cos_cfg command shall return error when
15514          * trying to configure a queue not configurable.
15515          */
15516         uint8_t queue_cos2bw_cfg_allowed;
15517         /*
15518          * ID of CoS Queue 0.
15519          * FF - Invalid id
15520          *
15521          * # This ID can be used on any subsequent call to an hwrm command
15522          * that takes a queue id.
15523          * # IDs must always be queried by this command before any use
15524          * by the driver or software.
15525          * # Any driver or software should not make any assumptions about
15526          * queue IDs.
15527          * # A value of 0xff indicates that the queue is not available.
15528          * # Available queues may not be in sequential order.
15529          */
15530         uint8_t queue_id0;
15531         /* This value is applicable to CoS queues only. */
15532         uint8_t queue_id0_service_profile;
15533         /* Lossy (best-effort) */
15534         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
15535                 UINT32_C(0x0)
15536         /* Lossless (legacy) */
15537         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
15538                 UINT32_C(0x1)
15539         /* Lossless RoCE */
15540         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
15541                 UINT32_C(0x1)
15542         /* Lossy RoCE CNP */
15543         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15544                 UINT32_C(0x2)
15545         /* Lossless NIC */
15546         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
15547                 UINT32_C(0x3)
15548         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15549         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
15550                 UINT32_C(0xff)
15551         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
15552                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
15553         /*
15554          * ID of CoS Queue 1.
15555          * FF - Invalid id
15556          *
15557          * # This ID can be used on any subsequent call to an hwrm command
15558          * that takes a queue id.
15559          * # IDs must always be queried by this command before any use
15560          * by the driver or software.
15561          * # Any driver or software should not make any assumptions about
15562          * queue IDs.
15563          * # A value of 0xff indicates that the queue is not available.
15564          * # Available queues may not be in sequential order.
15565          */
15566         uint8_t queue_id1;
15567         /* This value is applicable to CoS queues only. */
15568         uint8_t queue_id1_service_profile;
15569         /* Lossy (best-effort) */
15570         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
15571                 UINT32_C(0x0)
15572         /* Lossless (legacy) */
15573         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
15574                 UINT32_C(0x1)
15575         /* Lossless RoCE */
15576         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
15577                 UINT32_C(0x1)
15578         /* Lossy RoCE CNP */
15579         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15580                 UINT32_C(0x2)
15581         /* Lossless NIC */
15582         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
15583                 UINT32_C(0x3)
15584         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15585         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
15586                 UINT32_C(0xff)
15587         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
15588                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
15589         /*
15590          * ID of CoS Queue 2.
15591          * FF - Invalid id
15592          *
15593          * # This ID can be used on any subsequent call to an hwrm command
15594          * that takes a queue id.
15595          * # IDs must always be queried by this command before any use
15596          * by the driver or software.
15597          * # Any driver or software should not make any assumptions about
15598          * queue IDs.
15599          * # A value of 0xff indicates that the queue is not available.
15600          * # Available queues may not be in sequential order.
15601          */
15602         uint8_t queue_id2;
15603         /* This value is applicable to CoS queues only. */
15604         uint8_t queue_id2_service_profile;
15605         /* Lossy (best-effort) */
15606         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
15607                 UINT32_C(0x0)
15608         /* Lossless (legacy) */
15609         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
15610                 UINT32_C(0x1)
15611         /* Lossless RoCE */
15612         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
15613                 UINT32_C(0x1)
15614         /* Lossy RoCE CNP */
15615         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15616                 UINT32_C(0x2)
15617         /* Lossless NIC */
15618         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
15619                 UINT32_C(0x3)
15620         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15621         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
15622                 UINT32_C(0xff)
15623         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
15624                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
15625         /*
15626          * ID of CoS Queue 3.
15627          * FF - Invalid id
15628          *
15629          * # This ID can be used on any subsequent call to an hwrm command
15630          * that takes a queue id.
15631          * # IDs must always be queried by this command before any use
15632          * by the driver or software.
15633          * # Any driver or software should not make any assumptions about
15634          * queue IDs.
15635          * # A value of 0xff indicates that the queue is not available.
15636          * # Available queues may not be in sequential order.
15637          */
15638         uint8_t queue_id3;
15639         /* This value is applicable to CoS queues only. */
15640         uint8_t queue_id3_service_profile;
15641         /* Lossy (best-effort) */
15642         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
15643                 UINT32_C(0x0)
15644         /* Lossless (legacy) */
15645         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
15646                 UINT32_C(0x1)
15647         /* Lossless RoCE */
15648         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
15649                 UINT32_C(0x1)
15650         /* Lossy RoCE CNP */
15651         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15652                 UINT32_C(0x2)
15653         /* Lossless NIC */
15654         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
15655                 UINT32_C(0x3)
15656         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15657         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
15658                 UINT32_C(0xff)
15659         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
15660                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
15661         /*
15662          * ID of CoS Queue 4.
15663          * FF - Invalid id
15664          *
15665          * # This ID can be used on any subsequent call to an hwrm command
15666          * that takes a queue id.
15667          * # IDs must always be queried by this command before any use
15668          * by the driver or software.
15669          * # Any driver or software should not make any assumptions about
15670          * queue IDs.
15671          * # A value of 0xff indicates that the queue is not available.
15672          * # Available queues may not be in sequential order.
15673          */
15674         uint8_t queue_id4;
15675         /* This value is applicable to CoS queues only. */
15676         uint8_t queue_id4_service_profile;
15677         /* Lossy (best-effort) */
15678         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
15679                 UINT32_C(0x0)
15680         /* Lossless (legacy) */
15681         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
15682                 UINT32_C(0x1)
15683         /* Lossless RoCE */
15684         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
15685                 UINT32_C(0x1)
15686         /* Lossy RoCE CNP */
15687         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15688                 UINT32_C(0x2)
15689         /* Lossless NIC */
15690         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
15691                 UINT32_C(0x3)
15692         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15693         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
15694                 UINT32_C(0xff)
15695         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
15696                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
15697         /*
15698          * ID of CoS Queue 5.
15699          * FF - Invalid id
15700          *
15701          * # This ID can be used on any subsequent call to an hwrm command
15702          * that takes a queue id.
15703          * # IDs must always be queried by this command before any use
15704          * by the driver or software.
15705          * # Any driver or software should not make any assumptions about
15706          * queue IDs.
15707          * # A value of 0xff indicates that the queue is not available.
15708          * # Available queues may not be in sequential order.
15709          */
15710         uint8_t queue_id5;
15711         /* This value is applicable to CoS queues only. */
15712         uint8_t queue_id5_service_profile;
15713         /* Lossy (best-effort) */
15714         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
15715                 UINT32_C(0x0)
15716         /* Lossless (legacy) */
15717         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
15718                 UINT32_C(0x1)
15719         /* Lossless RoCE */
15720         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
15721                 UINT32_C(0x1)
15722         /* Lossy RoCE CNP */
15723         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15724                 UINT32_C(0x2)
15725         /* Lossless NIC */
15726         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
15727                 UINT32_C(0x3)
15728         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15729         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
15730                 UINT32_C(0xff)
15731         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
15732                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
15733         /*
15734          * ID of CoS Queue 6.
15735          * FF - Invalid id
15736          *
15737          * # This ID can be used on any subsequent call to an hwrm command
15738          * that takes a queue id.
15739          * # IDs must always be queried by this command before any use
15740          * by the driver or software.
15741          * # Any driver or software should not make any assumptions about
15742          * queue IDs.
15743          * # A value of 0xff indicates that the queue is not available.
15744          * # Available queues may not be in sequential order.
15745          */
15746         uint8_t queue_id6;
15747         /* This value is applicable to CoS queues only. */
15748         uint8_t queue_id6_service_profile;
15749         /* Lossy (best-effort) */
15750         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
15751                 UINT32_C(0x0)
15752         /* Lossless (legacy) */
15753         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
15754                 UINT32_C(0x1)
15755         /* Lossless RoCE */
15756         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
15757                 UINT32_C(0x1)
15758         /* Lossy RoCE CNP */
15759         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15760                 UINT32_C(0x2)
15761         /* Lossless NIC */
15762         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
15763                 UINT32_C(0x3)
15764         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15765         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
15766                 UINT32_C(0xff)
15767         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
15768                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
15769         /*
15770          * ID of CoS Queue 7.
15771          * FF - Invalid id
15772          *
15773          * # This ID can be used on any subsequent call to an hwrm command
15774          * that takes a queue id.
15775          * # IDs must always be queried by this command before any use
15776          * by the driver or software.
15777          * # Any driver or software should not make any assumptions about
15778          * queue IDs.
15779          * # A value of 0xff indicates that the queue is not available.
15780          * # Available queues may not be in sequential order.
15781          */
15782         uint8_t queue_id7;
15783         /* This value is applicable to CoS queues only. */
15784         uint8_t queue_id7_service_profile;
15785         /* Lossy (best-effort) */
15786         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
15787                 UINT32_C(0x0)
15788         /* Lossless (legacy) */
15789         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
15790                 UINT32_C(0x1)
15791         /* Lossless RoCE */
15792         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
15793                 UINT32_C(0x1)
15794         /* Lossy RoCE CNP */
15795         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
15796                 UINT32_C(0x2)
15797         /* Lossless NIC */
15798         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
15799                 UINT32_C(0x3)
15800         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15801         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
15802                 UINT32_C(0xff)
15803         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
15804                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
15805         /*
15806          * This field is used in Output records to indicate that the output
15807          * is completely written to RAM.  This field should be read as '1'
15808          * to indicate that the output has been completely written.
15809          * When writing a command completion or response to an internal processor,
15810          * the order of writes has to be such that this field is written last.
15811          */
15812         uint8_t valid;
15813 } __attribute__((packed));
15814
15815 /*******************
15816  * hwrm_queue_qcfg *
15817  *******************/
15818
15819
15820 /* hwrm_queue_qcfg_input (size:192b/24B) */
15821 struct hwrm_queue_qcfg_input {
15822         /* The HWRM command request type. */
15823         uint16_t        req_type;
15824         /*
15825          * The completion ring to send the completion event on. This should
15826          * be the NQ ID returned from the `nq_alloc` HWRM command.
15827          */
15828         uint16_t        cmpl_ring;
15829         /*
15830          * The sequence ID is used by the driver for tracking multiple
15831          * commands. This ID is treated as opaque data by the firmware and
15832          * the value is returned in the `hwrm_resp_hdr` upon completion.
15833          */
15834         uint16_t        seq_id;
15835         /*
15836          * The target ID of the command:
15837          * * 0x0-0xFFF8 - The function ID
15838          * * 0xFFF8-0xFFFE - Reserved for internal processors
15839          * * 0xFFFF - HWRM
15840          */
15841         uint16_t        target_id;
15842         /*
15843          * A physical address pointer pointing to a host buffer that the
15844          * command's response data will be written. This can be either a host
15845          * physical address (HPA) or a guest physical address (GPA) and must
15846          * point to a physically contiguous block of memory.
15847          */
15848         uint64_t        resp_addr;
15849         uint32_t        flags;
15850         /*
15851          * Enumeration denoting the RX, TX type of the resource.
15852          * This enumeration is used for resources that are similar for both
15853          * TX and RX paths of the chip.
15854          */
15855         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
15856         /* tx path */
15857         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
15858         /* rx path */
15859         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
15860         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
15861                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
15862         /* Queue ID of the queue. */
15863         uint32_t        queue_id;
15864 } __attribute__((packed));
15865
15866 /* hwrm_queue_qcfg_output (size:128b/16B) */
15867 struct hwrm_queue_qcfg_output {
15868         /* The specific error status for the command. */
15869         uint16_t        error_code;
15870         /* The HWRM command request type. */
15871         uint16_t        req_type;
15872         /* The sequence ID from the original command. */
15873         uint16_t        seq_id;
15874         /* The length of the response data in number of bytes. */
15875         uint16_t        resp_len;
15876         /*
15877          * This value is a the estimate packet length used in the
15878          * TX arbiter.
15879          */
15880         uint32_t        queue_len;
15881         /* This value is applicable to CoS queues only. */
15882         uint8_t service_profile;
15883         /* Lossy (best-effort) */
15884         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
15885         /* Lossless */
15886         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
15887         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15888         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
15889         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
15890                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
15891         /* Information about queue configuration. */
15892         uint8_t queue_cfg_info;
15893         /*
15894          * If this flag is set to '1', then the queue is
15895          * configured asymmetrically on TX and RX sides.
15896          * If this flag is set to '0', then this queue is
15897          * configured symmetrically on TX and RX sides.
15898          */
15899         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
15900                 UINT32_C(0x1)
15901         uint8_t unused_0;
15902         /*
15903          * This field is used in Output records to indicate that the output
15904          * is completely written to RAM.  This field should be read as '1'
15905          * to indicate that the output has been completely written.
15906          * When writing a command completion or response to an internal processor,
15907          * the order of writes has to be such that this field is written last.
15908          */
15909         uint8_t valid;
15910 } __attribute__((packed));
15911
15912 /******************
15913  * hwrm_queue_cfg *
15914  ******************/
15915
15916
15917 /* hwrm_queue_cfg_input (size:320b/40B) */
15918 struct hwrm_queue_cfg_input {
15919         /* The HWRM command request type. */
15920         uint16_t        req_type;
15921         /*
15922          * The completion ring to send the completion event on. This should
15923          * be the NQ ID returned from the `nq_alloc` HWRM command.
15924          */
15925         uint16_t        cmpl_ring;
15926         /*
15927          * The sequence ID is used by the driver for tracking multiple
15928          * commands. This ID is treated as opaque data by the firmware and
15929          * the value is returned in the `hwrm_resp_hdr` upon completion.
15930          */
15931         uint16_t        seq_id;
15932         /*
15933          * The target ID of the command:
15934          * * 0x0-0xFFF8 - The function ID
15935          * * 0xFFF8-0xFFFE - Reserved for internal processors
15936          * * 0xFFFF - HWRM
15937          */
15938         uint16_t        target_id;
15939         /*
15940          * A physical address pointer pointing to a host buffer that the
15941          * command's response data will be written. This can be either a host
15942          * physical address (HPA) or a guest physical address (GPA) and must
15943          * point to a physically contiguous block of memory.
15944          */
15945         uint64_t        resp_addr;
15946         uint32_t        flags;
15947         /*
15948          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
15949          * This enumeration is used for resources that are similar for both
15950          * TX and RX paths of the chip.
15951          */
15952         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
15953         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
15954         /* tx path */
15955         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
15956         /* rx path */
15957         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
15958         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
15959         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
15960         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
15961                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
15962         uint32_t        enables;
15963         /*
15964          * This bit must be '1' for the dflt_len field to be
15965          * configured.
15966          */
15967         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
15968         /*
15969          * This bit must be '1' for the service_profile field to be
15970          * configured.
15971          */
15972         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
15973         /* Queue ID of queue that is to be configured by this function. */
15974         uint32_t        queue_id;
15975         /*
15976          * This value is a the estimate packet length used in the
15977          * TX arbiter.
15978          * Set to 0xFF... (All Fs) to not adjust this value.
15979          */
15980         uint32_t        dflt_len;
15981         /* This value is applicable to CoS queues only. */
15982         uint8_t service_profile;
15983         /* Lossy (best-effort) */
15984         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
15985         /* Lossless */
15986         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
15987         /* Set to 0xFF... (All Fs) if there is no service profile specified */
15988         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
15989         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
15990                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
15991         uint8_t unused_0[7];
15992 } __attribute__((packed));
15993
15994 /* hwrm_queue_cfg_output (size:128b/16B) */
15995 struct hwrm_queue_cfg_output {
15996         /* The specific error status for the command. */
15997         uint16_t        error_code;
15998         /* The HWRM command request type. */
15999         uint16_t        req_type;
16000         /* The sequence ID from the original command. */
16001         uint16_t        seq_id;
16002         /* The length of the response data in number of bytes. */
16003         uint16_t        resp_len;
16004         uint8_t unused_0[7];
16005         /*
16006          * This field is used in Output records to indicate that the output
16007          * is completely written to RAM.  This field should be read as '1'
16008          * to indicate that the output has been completely written.
16009          * When writing a command completion or response to an internal processor,
16010          * the order of writes has to be such that this field is written last.
16011          */
16012         uint8_t valid;
16013 } __attribute__((packed));
16014
16015 /*****************************
16016  * hwrm_queue_pfcenable_qcfg *
16017  *****************************/
16018
16019
16020 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
16021 struct hwrm_queue_pfcenable_qcfg_input {
16022         /* The HWRM command request type. */
16023         uint16_t        req_type;
16024         /*
16025          * The completion ring to send the completion event on. This should
16026          * be the NQ ID returned from the `nq_alloc` HWRM command.
16027          */
16028         uint16_t        cmpl_ring;
16029         /*
16030          * The sequence ID is used by the driver for tracking multiple
16031          * commands. This ID is treated as opaque data by the firmware and
16032          * the value is returned in the `hwrm_resp_hdr` upon completion.
16033          */
16034         uint16_t        seq_id;
16035         /*
16036          * The target ID of the command:
16037          * * 0x0-0xFFF8 - The function ID
16038          * * 0xFFF8-0xFFFE - Reserved for internal processors
16039          * * 0xFFFF - HWRM
16040          */
16041         uint16_t        target_id;
16042         /*
16043          * A physical address pointer pointing to a host buffer that the
16044          * command's response data will be written. This can be either a host
16045          * physical address (HPA) or a guest physical address (GPA) and must
16046          * point to a physically contiguous block of memory.
16047          */
16048         uint64_t        resp_addr;
16049         /*
16050          * Port ID of port for which the table is being configured.
16051          * The HWRM needs to check whether this function is allowed
16052          * to configure pri2cos mapping on this port.
16053          */
16054         uint16_t        port_id;
16055         uint8_t unused_0[6];
16056 } __attribute__((packed));
16057
16058 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
16059 struct hwrm_queue_pfcenable_qcfg_output {
16060         /* The specific error status for the command. */
16061         uint16_t        error_code;
16062         /* The HWRM command request type. */
16063         uint16_t        req_type;
16064         /* The sequence ID from the original command. */
16065         uint16_t        seq_id;
16066         /* The length of the response data in number of bytes. */
16067         uint16_t        resp_len;
16068         uint32_t        flags;
16069         /* If set to 1, then PFC is enabled on PRI 0. */
16070         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
16071                 UINT32_C(0x1)
16072         /* If set to 1, then PFC is enabled on PRI 1. */
16073         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
16074                 UINT32_C(0x2)
16075         /* If set to 1, then PFC is enabled on PRI 2. */
16076         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
16077                 UINT32_C(0x4)
16078         /* If set to 1, then PFC is enabled on PRI 3. */
16079         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
16080                 UINT32_C(0x8)
16081         /* If set to 1, then PFC is enabled on PRI 4. */
16082         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
16083                 UINT32_C(0x10)
16084         /* If set to 1, then PFC is enabled on PRI 5. */
16085         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
16086                 UINT32_C(0x20)
16087         /* If set to 1, then PFC is enabled on PRI 6. */
16088         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
16089                 UINT32_C(0x40)
16090         /* If set to 1, then PFC is enabled on PRI 7. */
16091         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
16092                 UINT32_C(0x80)
16093         uint8_t unused_0[3];
16094         /*
16095          * This field is used in Output records to indicate that the output
16096          * is completely written to RAM.  This field should be read as '1'
16097          * to indicate that the output has been completely written.
16098          * When writing a command completion or response to an internal processor,
16099          * the order of writes has to be such that this field is written last.
16100          */
16101         uint8_t valid;
16102 } __attribute__((packed));
16103
16104 /****************************
16105  * hwrm_queue_pfcenable_cfg *
16106  ****************************/
16107
16108
16109 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
16110 struct hwrm_queue_pfcenable_cfg_input {
16111         /* The HWRM command request type. */
16112         uint16_t        req_type;
16113         /*
16114          * The completion ring to send the completion event on. This should
16115          * be the NQ ID returned from the `nq_alloc` HWRM command.
16116          */
16117         uint16_t        cmpl_ring;
16118         /*
16119          * The sequence ID is used by the driver for tracking multiple
16120          * commands. This ID is treated as opaque data by the firmware and
16121          * the value is returned in the `hwrm_resp_hdr` upon completion.
16122          */
16123         uint16_t        seq_id;
16124         /*
16125          * The target ID of the command:
16126          * * 0x0-0xFFF8 - The function ID
16127          * * 0xFFF8-0xFFFE - Reserved for internal processors
16128          * * 0xFFFF - HWRM
16129          */
16130         uint16_t        target_id;
16131         /*
16132          * A physical address pointer pointing to a host buffer that the
16133          * command's response data will be written. This can be either a host
16134          * physical address (HPA) or a guest physical address (GPA) and must
16135          * point to a physically contiguous block of memory.
16136          */
16137         uint64_t        resp_addr;
16138         uint32_t        flags;
16139         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
16140         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
16141                 UINT32_C(0x1)
16142         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
16143         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
16144                 UINT32_C(0x2)
16145         /* If set to 1, then PFC is requested to  be enabled on PRI 2. */
16146         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
16147                 UINT32_C(0x4)
16148         /* If set to 1, then PFC is requested to  be enabled on PRI 3. */
16149         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
16150                 UINT32_C(0x8)
16151         /* If set to 1, then PFC is requested to  be enabled on PRI 4. */
16152         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
16153                 UINT32_C(0x10)
16154         /* If set to 1, then PFC is requested to  be enabled on PRI 5. */
16155         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
16156                 UINT32_C(0x20)
16157         /* If set to 1, then PFC is requested to  be enabled on PRI 6. */
16158         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
16159                 UINT32_C(0x40)
16160         /* If set to 1, then PFC is requested to  be enabled on PRI 7. */
16161         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
16162                 UINT32_C(0x80)
16163         /*
16164          * Port ID of port for which the table is being configured.
16165          * The HWRM needs to check whether this function is allowed
16166          * to configure pri2cos mapping on this port.
16167          */
16168         uint16_t        port_id;
16169         uint8_t unused_0[2];
16170 } __attribute__((packed));
16171
16172 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
16173 struct hwrm_queue_pfcenable_cfg_output {
16174         /* The specific error status for the command. */
16175         uint16_t        error_code;
16176         /* The HWRM command request type. */
16177         uint16_t        req_type;
16178         /* The sequence ID from the original command. */
16179         uint16_t        seq_id;
16180         /* The length of the response data in number of bytes. */
16181         uint16_t        resp_len;
16182         uint8_t unused_0[7];
16183         /*
16184          * This field is used in Output records to indicate that the output
16185          * is completely written to RAM.  This field should be read as '1'
16186          * to indicate that the output has been completely written.
16187          * When writing a command completion or response to an internal processor,
16188          * the order of writes has to be such that this field is written last.
16189          */
16190         uint8_t valid;
16191 } __attribute__((packed));
16192
16193 /***************************
16194  * hwrm_queue_pri2cos_qcfg *
16195  ***************************/
16196
16197
16198 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
16199 struct hwrm_queue_pri2cos_qcfg_input {
16200         /* The HWRM command request type. */
16201         uint16_t        req_type;
16202         /*
16203          * The completion ring to send the completion event on. This should
16204          * be the NQ ID returned from the `nq_alloc` HWRM command.
16205          */
16206         uint16_t        cmpl_ring;
16207         /*
16208          * The sequence ID is used by the driver for tracking multiple
16209          * commands. This ID is treated as opaque data by the firmware and
16210          * the value is returned in the `hwrm_resp_hdr` upon completion.
16211          */
16212         uint16_t        seq_id;
16213         /*
16214          * The target ID of the command:
16215          * * 0x0-0xFFF8 - The function ID
16216          * * 0xFFF8-0xFFFE - Reserved for internal processors
16217          * * 0xFFFF - HWRM
16218          */
16219         uint16_t        target_id;
16220         /*
16221          * A physical address pointer pointing to a host buffer that the
16222          * command's response data will be written. This can be either a host
16223          * physical address (HPA) or a guest physical address (GPA) and must
16224          * point to a physically contiguous block of memory.
16225          */
16226         uint64_t        resp_addr;
16227         uint32_t        flags;
16228         /*
16229          * Enumeration denoting the RX, TX type of the resource.
16230          * This enumeration is used for resources that are similar for both
16231          * TX and RX paths of the chip.
16232          */
16233         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
16234         /* tx path */
16235         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
16236         /* rx path */
16237         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
16238         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
16239                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
16240         /*
16241          * When this bit is set to '0', the query is
16242          * for VLAN PRI field in tunnel headers.
16243          * When this bit is set to '1', the query is
16244          * for VLAN PRI field in inner packet headers.
16245          */
16246         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
16247         /*
16248          * Port ID of port for which the table is being configured.
16249          * The HWRM needs to check whether this function is allowed
16250          * to configure pri2cos mapping on this port.
16251          */
16252         uint8_t port_id;
16253         uint8_t unused_0[3];
16254 } __attribute__((packed));
16255
16256 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
16257 struct hwrm_queue_pri2cos_qcfg_output {
16258         /* The specific error status for the command. */
16259         uint16_t        error_code;
16260         /* The HWRM command request type. */
16261         uint16_t        req_type;
16262         /* The sequence ID from the original command. */
16263         uint16_t        seq_id;
16264         /* The length of the response data in number of bytes. */
16265         uint16_t        resp_len;
16266         /*
16267          * CoS Queue assigned to priority 0.  This value can only
16268          * be changed before traffic has started.
16269          * A value of 0xff indicates that no CoS queue is assigned to the
16270          * specified priority.
16271          */
16272         uint8_t pri0_cos_queue_id;
16273         /*
16274          * CoS Queue assigned to priority 1.  This value can only
16275          * be changed before traffic has started.
16276          * A value of 0xff indicates that no CoS queue is assigned to the
16277          * specified priority.
16278          */
16279         uint8_t pri1_cos_queue_id;
16280         /*
16281          * CoS Queue assigned to priority 2  This value can only
16282          * be changed before traffic has started.
16283          * A value of 0xff indicates that no CoS queue is assigned to the
16284          * specified priority.
16285          */
16286         uint8_t pri2_cos_queue_id;
16287         /*
16288          * CoS Queue assigned to priority 3.  This value can only
16289          * be changed before traffic has started.
16290          * A value of 0xff indicates that no CoS queue is assigned to the
16291          * specified priority.
16292          */
16293         uint8_t pri3_cos_queue_id;
16294         /*
16295          * CoS Queue assigned to priority 4.  This value can only
16296          * be changed before traffic has started.
16297          * A value of 0xff indicates that no CoS queue is assigned to the
16298          * specified priority.
16299          */
16300         uint8_t pri4_cos_queue_id;
16301         /*
16302          * CoS Queue assigned to priority 5.  This value can only
16303          * be changed before traffic has started.
16304          * A value of 0xff indicates that no CoS queue is assigned to the
16305          * specified priority.
16306          */
16307         uint8_t pri5_cos_queue_id;
16308         /*
16309          * CoS Queue assigned to priority 6.  This value can only
16310          * be changed before traffic has started.
16311          * A value of 0xff indicates that no CoS queue is assigned to the
16312          * specified priority.
16313          */
16314         uint8_t pri6_cos_queue_id;
16315         /*
16316          * CoS Queue assigned to priority 7.  This value can only
16317          * be changed before traffic has started.
16318          * A value of 0xff indicates that no CoS queue is assigned to the
16319          * specified priority.
16320          */
16321         uint8_t pri7_cos_queue_id;
16322         /* Information about queue configuration. */
16323         uint8_t queue_cfg_info;
16324         /*
16325          * If this flag is set to '1', then the PRI to CoS
16326          * configuration is asymmetric on TX and RX sides.
16327          * If this flag is set to '0', then PRI to CoS configuration
16328          * is symmetric on TX and RX sides.
16329          */
16330         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
16331                 UINT32_C(0x1)
16332         uint8_t unused_0[6];
16333         /*
16334          * This field is used in Output records to indicate that the output
16335          * is completely written to RAM.  This field should be read as '1'
16336          * to indicate that the output has been completely written.
16337          * When writing a command completion or response to an internal processor,
16338          * the order of writes has to be such that this field is written last.
16339          */
16340         uint8_t valid;
16341 } __attribute__((packed));
16342
16343 /**************************
16344  * hwrm_queue_pri2cos_cfg *
16345  **************************/
16346
16347
16348 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
16349 struct hwrm_queue_pri2cos_cfg_input {
16350         /* The HWRM command request type. */
16351         uint16_t        req_type;
16352         /*
16353          * The completion ring to send the completion event on. This should
16354          * be the NQ ID returned from the `nq_alloc` HWRM command.
16355          */
16356         uint16_t        cmpl_ring;
16357         /*
16358          * The sequence ID is used by the driver for tracking multiple
16359          * commands. This ID is treated as opaque data by the firmware and
16360          * the value is returned in the `hwrm_resp_hdr` upon completion.
16361          */
16362         uint16_t        seq_id;
16363         /*
16364          * The target ID of the command:
16365          * * 0x0-0xFFF8 - The function ID
16366          * * 0xFFF8-0xFFFE - Reserved for internal processors
16367          * * 0xFFFF - HWRM
16368          */
16369         uint16_t        target_id;
16370         /*
16371          * A physical address pointer pointing to a host buffer that the
16372          * command's response data will be written. This can be either a host
16373          * physical address (HPA) or a guest physical address (GPA) and must
16374          * point to a physically contiguous block of memory.
16375          */
16376         uint64_t        resp_addr;
16377         uint32_t        flags;
16378         /*
16379          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
16380          * This enumeration is used for resources that are similar for both
16381          * TX and RX paths of the chip.
16382          */
16383         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
16384         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
16385         /* tx path */
16386         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
16387         /* rx path */
16388         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
16389         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
16390         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
16391         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
16392                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
16393         /*
16394          * When this bit is set to '0', the mapping is requested
16395          * for VLAN PRI field in tunnel headers.
16396          * When this bit is set to '1', the mapping is requested
16397          * for VLAN PRI field in inner packet headers.
16398          */
16399         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
16400         uint32_t        enables;
16401         /*
16402          * This bit must be '1' for the pri0_cos_queue_id field to be
16403          * configured.
16404          */
16405         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
16406                 UINT32_C(0x1)
16407         /*
16408          * This bit must be '1' for the pri1_cos_queue_id field to be
16409          * configured.
16410          */
16411         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
16412                 UINT32_C(0x2)
16413         /*
16414          * This bit must be '1' for the pri2_cos_queue_id field to be
16415          * configured.
16416          */
16417         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
16418                 UINT32_C(0x4)
16419         /*
16420          * This bit must be '1' for the pri3_cos_queue_id field to be
16421          * configured.
16422          */
16423         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
16424                 UINT32_C(0x8)
16425         /*
16426          * This bit must be '1' for the pri4_cos_queue_id field to be
16427          * configured.
16428          */
16429         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
16430                 UINT32_C(0x10)
16431         /*
16432          * This bit must be '1' for the pri5_cos_queue_id field to be
16433          * configured.
16434          */
16435         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
16436                 UINT32_C(0x20)
16437         /*
16438          * This bit must be '1' for the pri6_cos_queue_id field to be
16439          * configured.
16440          */
16441         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
16442                 UINT32_C(0x40)
16443         /*
16444          * This bit must be '1' for the pri7_cos_queue_id field to be
16445          * configured.
16446          */
16447         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
16448                 UINT32_C(0x80)
16449         /*
16450          * Port ID of port for which the table is being configured.
16451          * The HWRM needs to check whether this function is allowed
16452          * to configure pri2cos mapping on this port.
16453          */
16454         uint8_t port_id;
16455         /*
16456          * CoS Queue assigned to priority 0.  This value can only
16457          * be changed before traffic has started.
16458          */
16459         uint8_t pri0_cos_queue_id;
16460         /*
16461          * CoS Queue assigned to priority 1.  This value can only
16462          * be changed before traffic has started.
16463          */
16464         uint8_t pri1_cos_queue_id;
16465         /*
16466          * CoS Queue assigned to priority 2  This value can only
16467          * be changed before traffic has started.
16468          */
16469         uint8_t pri2_cos_queue_id;
16470         /*
16471          * CoS Queue assigned to priority 3.  This value can only
16472          * be changed before traffic has started.
16473          */
16474         uint8_t pri3_cos_queue_id;
16475         /*
16476          * CoS Queue assigned to priority 4.  This value can only
16477          * be changed before traffic has started.
16478          */
16479         uint8_t pri4_cos_queue_id;
16480         /*
16481          * CoS Queue assigned to priority 5.  This value can only
16482          * be changed before traffic has started.
16483          */
16484         uint8_t pri5_cos_queue_id;
16485         /*
16486          * CoS Queue assigned to priority 6.  This value can only
16487          * be changed before traffic has started.
16488          */
16489         uint8_t pri6_cos_queue_id;
16490         /*
16491          * CoS Queue assigned to priority 7.  This value can only
16492          * be changed before traffic has started.
16493          */
16494         uint8_t pri7_cos_queue_id;
16495         uint8_t unused_0[7];
16496 } __attribute__((packed));
16497
16498 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
16499 struct hwrm_queue_pri2cos_cfg_output {
16500         /* The specific error status for the command. */
16501         uint16_t        error_code;
16502         /* The HWRM command request type. */
16503         uint16_t        req_type;
16504         /* The sequence ID from the original command. */
16505         uint16_t        seq_id;
16506         /* The length of the response data in number of bytes. */
16507         uint16_t        resp_len;
16508         uint8_t unused_0[7];
16509         /*
16510          * This field is used in Output records to indicate that the output
16511          * is completely written to RAM.  This field should be read as '1'
16512          * to indicate that the output has been completely written.
16513          * When writing a command completion or response to an internal processor,
16514          * the order of writes has to be such that this field is written last.
16515          */
16516         uint8_t valid;
16517 } __attribute__((packed));
16518
16519 /**************************
16520  * hwrm_queue_cos2bw_qcfg *
16521  **************************/
16522
16523
16524 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
16525 struct hwrm_queue_cos2bw_qcfg_input {
16526         /* The HWRM command request type. */
16527         uint16_t        req_type;
16528         /*
16529          * The completion ring to send the completion event on. This should
16530          * be the NQ ID returned from the `nq_alloc` HWRM command.
16531          */
16532         uint16_t        cmpl_ring;
16533         /*
16534          * The sequence ID is used by the driver for tracking multiple
16535          * commands. This ID is treated as opaque data by the firmware and
16536          * the value is returned in the `hwrm_resp_hdr` upon completion.
16537          */
16538         uint16_t        seq_id;
16539         /*
16540          * The target ID of the command:
16541          * * 0x0-0xFFF8 - The function ID
16542          * * 0xFFF8-0xFFFE - Reserved for internal processors
16543          * * 0xFFFF - HWRM
16544          */
16545         uint16_t        target_id;
16546         /*
16547          * A physical address pointer pointing to a host buffer that the
16548          * command's response data will be written. This can be either a host
16549          * physical address (HPA) or a guest physical address (GPA) and must
16550          * point to a physically contiguous block of memory.
16551          */
16552         uint64_t        resp_addr;
16553         /*
16554          * Port ID of port for which the table is being configured.
16555          * The HWRM needs to check whether this function is allowed
16556          * to configure TC BW assignment on this port.
16557          */
16558         uint16_t        port_id;
16559         uint8_t unused_0[6];
16560 } __attribute__((packed));
16561
16562 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
16563 struct hwrm_queue_cos2bw_qcfg_output {
16564         /* The specific error status for the command. */
16565         uint16_t        error_code;
16566         /* The HWRM command request type. */
16567         uint16_t        req_type;
16568         /* The sequence ID from the original command. */
16569         uint16_t        seq_id;
16570         /* The length of the response data in number of bytes. */
16571         uint16_t        resp_len;
16572         /* ID of CoS Queue 0. */
16573         uint8_t queue_id0;
16574         uint8_t unused_0;
16575         uint16_t        unused_1;
16576         /*
16577          * Minimum BW allocated to CoS Queue.
16578          * The HWRM will translate this value into byte counter and
16579          * time interval used for this COS inside the device.
16580          */
16581         uint32_t        queue_id0_min_bw;
16582         /* The bandwidth value. */
16583         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
16584                 UINT32_C(0xfffffff)
16585         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
16586                 0
16587         /* The granularity of the value (bits or bytes). */
16588         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
16589                 UINT32_C(0x10000000)
16590         /* Value is in bits. */
16591         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
16592                 (UINT32_C(0x0) << 28)
16593         /* Value is in bytes. */
16594         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
16595                 (UINT32_C(0x1) << 28)
16596         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
16597                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
16598         /* bw_value_unit is 3 b */
16599         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
16600                 UINT32_C(0xe0000000)
16601         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
16602                 29
16603         /* Value is in Mb or MB (base 10). */
16604         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
16605                 (UINT32_C(0x0) << 29)
16606         /* Value is in Kb or KB (base 10). */
16607         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
16608                 (UINT32_C(0x2) << 29)
16609         /* Value is in bits or bytes. */
16610         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
16611                 (UINT32_C(0x4) << 29)
16612         /* Value is in Gb or GB (base 10). */
16613         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
16614                 (UINT32_C(0x6) << 29)
16615         /* Value is in 1/100th of a percentage of total bandwidth. */
16616         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
16617                 (UINT32_C(0x1) << 29)
16618         /* Invalid unit */
16619         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
16620                 (UINT32_C(0x7) << 29)
16621         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
16622                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
16623         /*
16624          * Maximum BW allocated to CoS Queue.
16625          * The HWRM will translate this value into byte counter and
16626          * time interval used for this COS inside the device.
16627          */
16628         uint32_t        queue_id0_max_bw;
16629         /* The bandwidth value. */
16630         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
16631                 UINT32_C(0xfffffff)
16632         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
16633                 0
16634         /* The granularity of the value (bits or bytes). */
16635         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
16636                 UINT32_C(0x10000000)
16637         /* Value is in bits. */
16638         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
16639                 (UINT32_C(0x0) << 28)
16640         /* Value is in bytes. */
16641         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
16642                 (UINT32_C(0x1) << 28)
16643         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
16644                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
16645         /* bw_value_unit is 3 b */
16646         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
16647                 UINT32_C(0xe0000000)
16648         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
16649                 29
16650         /* Value is in Mb or MB (base 10). */
16651         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
16652                 (UINT32_C(0x0) << 29)
16653         /* Value is in Kb or KB (base 10). */
16654         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
16655                 (UINT32_C(0x2) << 29)
16656         /* Value is in bits or bytes. */
16657         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
16658                 (UINT32_C(0x4) << 29)
16659         /* Value is in Gb or GB (base 10). */
16660         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
16661                 (UINT32_C(0x6) << 29)
16662         /* Value is in 1/100th of a percentage of total bandwidth. */
16663         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
16664                 (UINT32_C(0x1) << 29)
16665         /* Invalid unit */
16666         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
16667                 (UINT32_C(0x7) << 29)
16668         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
16669                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
16670         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
16671         uint8_t queue_id0_tsa_assign;
16672         /* Strict Priority */
16673         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
16674                 UINT32_C(0x0)
16675         /* Enhanced Transmission Selection */
16676         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
16677                 UINT32_C(0x1)
16678         /* reserved. */
16679         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
16680                 UINT32_C(0x2)
16681         /* reserved. */
16682         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
16683                 UINT32_C(0xff)
16684         /*
16685          * Priority level for strict priority. Valid only when the
16686          * tsa_assign is 0 - Strict Priority (SP)
16687          * 0..7 - Valid values.
16688          * 8..255 - Reserved.
16689          */
16690         uint8_t queue_id0_pri_lvl;
16691         /*
16692          * Weight used to allocate remaining BW for this COS after
16693          * servicing guaranteed bandwidths for all COS.
16694          */
16695         uint8_t queue_id0_bw_weight;
16696         /* ID of CoS Queue 1. */
16697         uint8_t queue_id1;
16698         /*
16699          * Minimum BW allocated to CoS Queue.
16700          * The HWRM will translate this value into byte counter and
16701          * time interval used for this COS inside the device.
16702          */
16703         uint32_t        queue_id1_min_bw;
16704         /* The bandwidth value. */
16705         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
16706                 UINT32_C(0xfffffff)
16707         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
16708                 0
16709         /* The granularity of the value (bits or bytes). */
16710         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
16711                 UINT32_C(0x10000000)
16712         /* Value is in bits. */
16713         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
16714                 (UINT32_C(0x0) << 28)
16715         /* Value is in bytes. */
16716         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
16717                 (UINT32_C(0x1) << 28)
16718         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
16719                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
16720         /* bw_value_unit is 3 b */
16721         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
16722                 UINT32_C(0xe0000000)
16723         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
16724                 29
16725         /* Value is in Mb or MB (base 10). */
16726         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
16727                 (UINT32_C(0x0) << 29)
16728         /* Value is in Kb or KB (base 10). */
16729         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
16730                 (UINT32_C(0x2) << 29)
16731         /* Value is in bits or bytes. */
16732         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
16733                 (UINT32_C(0x4) << 29)
16734         /* Value is in Gb or GB (base 10). */
16735         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
16736                 (UINT32_C(0x6) << 29)
16737         /* Value is in 1/100th of a percentage of total bandwidth. */
16738         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
16739                 (UINT32_C(0x1) << 29)
16740         /* Invalid unit */
16741         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
16742                 (UINT32_C(0x7) << 29)
16743         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
16744                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
16745         /*
16746          * Maximum BW allocated to CoS queue.
16747          * The HWRM will translate this value into byte counter and
16748          * time interval used for this COS inside the device.
16749          */
16750         uint32_t        queue_id1_max_bw;
16751         /* The bandwidth value. */
16752         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
16753                 UINT32_C(0xfffffff)
16754         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
16755                 0
16756         /* The granularity of the value (bits or bytes). */
16757         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
16758                 UINT32_C(0x10000000)
16759         /* Value is in bits. */
16760         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
16761                 (UINT32_C(0x0) << 28)
16762         /* Value is in bytes. */
16763         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
16764                 (UINT32_C(0x1) << 28)
16765         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
16766                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
16767         /* bw_value_unit is 3 b */
16768         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
16769                 UINT32_C(0xe0000000)
16770         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
16771                 29
16772         /* Value is in Mb or MB (base 10). */
16773         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
16774                 (UINT32_C(0x0) << 29)
16775         /* Value is in Kb or KB (base 10). */
16776         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
16777                 (UINT32_C(0x2) << 29)
16778         /* Value is in bits or bytes. */
16779         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
16780                 (UINT32_C(0x4) << 29)
16781         /* Value is in Gb or GB (base 10). */
16782         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
16783                 (UINT32_C(0x6) << 29)
16784         /* Value is in 1/100th of a percentage of total bandwidth. */
16785         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
16786                 (UINT32_C(0x1) << 29)
16787         /* Invalid unit */
16788         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
16789                 (UINT32_C(0x7) << 29)
16790         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
16791                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
16792         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
16793         uint8_t queue_id1_tsa_assign;
16794         /* Strict Priority */
16795         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
16796                 UINT32_C(0x0)
16797         /* Enhanced Transmission Selection */
16798         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
16799                 UINT32_C(0x1)
16800         /* reserved. */
16801         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
16802                 UINT32_C(0x2)
16803         /* reserved. */
16804         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
16805                 UINT32_C(0xff)
16806         /*
16807          * Priority level for strict priority. Valid only when the
16808          * tsa_assign is 0 - Strict Priority (SP)
16809          * 0..7 - Valid values.
16810          * 8..255 - Reserved.
16811          */
16812         uint8_t queue_id1_pri_lvl;
16813         /*
16814          * Weight used to allocate remaining BW for this COS after
16815          * servicing guaranteed bandwidths for all COS.
16816          */
16817         uint8_t queue_id1_bw_weight;
16818         /* ID of CoS Queue 2. */
16819         uint8_t queue_id2;
16820         /*
16821          * Minimum BW allocated to CoS Queue.
16822          * The HWRM will translate this value into byte counter and
16823          * time interval used for this COS inside the device.
16824          */
16825         uint32_t        queue_id2_min_bw;
16826         /* The bandwidth value. */
16827         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
16828                 UINT32_C(0xfffffff)
16829         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
16830                 0
16831         /* The granularity of the value (bits or bytes). */
16832         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
16833                 UINT32_C(0x10000000)
16834         /* Value is in bits. */
16835         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
16836                 (UINT32_C(0x0) << 28)
16837         /* Value is in bytes. */
16838         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
16839                 (UINT32_C(0x1) << 28)
16840         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
16841                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
16842         /* bw_value_unit is 3 b */
16843         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
16844                 UINT32_C(0xe0000000)
16845         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
16846                 29
16847         /* Value is in Mb or MB (base 10). */
16848         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
16849                 (UINT32_C(0x0) << 29)
16850         /* Value is in Kb or KB (base 10). */
16851         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
16852                 (UINT32_C(0x2) << 29)
16853         /* Value is in bits or bytes. */
16854         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
16855                 (UINT32_C(0x4) << 29)
16856         /* Value is in Gb or GB (base 10). */
16857         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
16858                 (UINT32_C(0x6) << 29)
16859         /* Value is in 1/100th of a percentage of total bandwidth. */
16860         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
16861                 (UINT32_C(0x1) << 29)
16862         /* Invalid unit */
16863         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
16864                 (UINT32_C(0x7) << 29)
16865         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
16866                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
16867         /*
16868          * Maximum BW allocated to CoS queue.
16869          * The HWRM will translate this value into byte counter and
16870          * time interval used for this COS inside the device.
16871          */
16872         uint32_t        queue_id2_max_bw;
16873         /* The bandwidth value. */
16874         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
16875                 UINT32_C(0xfffffff)
16876         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
16877                 0
16878         /* The granularity of the value (bits or bytes). */
16879         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
16880                 UINT32_C(0x10000000)
16881         /* Value is in bits. */
16882         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
16883                 (UINT32_C(0x0) << 28)
16884         /* Value is in bytes. */
16885         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
16886                 (UINT32_C(0x1) << 28)
16887         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
16888                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
16889         /* bw_value_unit is 3 b */
16890         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
16891                 UINT32_C(0xe0000000)
16892         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
16893                 29
16894         /* Value is in Mb or MB (base 10). */
16895         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
16896                 (UINT32_C(0x0) << 29)
16897         /* Value is in Kb or KB (base 10). */
16898         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
16899                 (UINT32_C(0x2) << 29)
16900         /* Value is in bits or bytes. */
16901         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
16902                 (UINT32_C(0x4) << 29)
16903         /* Value is in Gb or GB (base 10). */
16904         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
16905                 (UINT32_C(0x6) << 29)
16906         /* Value is in 1/100th of a percentage of total bandwidth. */
16907         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
16908                 (UINT32_C(0x1) << 29)
16909         /* Invalid unit */
16910         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
16911                 (UINT32_C(0x7) << 29)
16912         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
16913                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
16914         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
16915         uint8_t queue_id2_tsa_assign;
16916         /* Strict Priority */
16917         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
16918                 UINT32_C(0x0)
16919         /* Enhanced Transmission Selection */
16920         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
16921                 UINT32_C(0x1)
16922         /* reserved. */
16923         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
16924                 UINT32_C(0x2)
16925         /* reserved. */
16926         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
16927                 UINT32_C(0xff)
16928         /*
16929          * Priority level for strict priority. Valid only when the
16930          * tsa_assign is 0 - Strict Priority (SP)
16931          * 0..7 - Valid values.
16932          * 8..255 - Reserved.
16933          */
16934         uint8_t queue_id2_pri_lvl;
16935         /*
16936          * Weight used to allocate remaining BW for this COS after
16937          * servicing guaranteed bandwidths for all COS.
16938          */
16939         uint8_t queue_id2_bw_weight;
16940         /* ID of CoS Queue 3. */
16941         uint8_t queue_id3;
16942         /*
16943          * Minimum BW allocated to CoS Queue.
16944          * The HWRM will translate this value into byte counter and
16945          * time interval used for this COS inside the device.
16946          */
16947         uint32_t        queue_id3_min_bw;
16948         /* The bandwidth value. */
16949         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
16950                 UINT32_C(0xfffffff)
16951         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
16952                 0
16953         /* The granularity of the value (bits or bytes). */
16954         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
16955                 UINT32_C(0x10000000)
16956         /* Value is in bits. */
16957         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
16958                 (UINT32_C(0x0) << 28)
16959         /* Value is in bytes. */
16960         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
16961                 (UINT32_C(0x1) << 28)
16962         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
16963                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
16964         /* bw_value_unit is 3 b */
16965         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
16966                 UINT32_C(0xe0000000)
16967         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
16968                 29
16969         /* Value is in Mb or MB (base 10). */
16970         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
16971                 (UINT32_C(0x0) << 29)
16972         /* Value is in Kb or KB (base 10). */
16973         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
16974                 (UINT32_C(0x2) << 29)
16975         /* Value is in bits or bytes. */
16976         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
16977                 (UINT32_C(0x4) << 29)
16978         /* Value is in Gb or GB (base 10). */
16979         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
16980                 (UINT32_C(0x6) << 29)
16981         /* Value is in 1/100th of a percentage of total bandwidth. */
16982         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
16983                 (UINT32_C(0x1) << 29)
16984         /* Invalid unit */
16985         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
16986                 (UINT32_C(0x7) << 29)
16987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
16988                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
16989         /*
16990          * Maximum BW allocated to CoS queue.
16991          * The HWRM will translate this value into byte counter and
16992          * time interval used for this COS inside the device.
16993          */
16994         uint32_t        queue_id3_max_bw;
16995         /* The bandwidth value. */
16996         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
16997                 UINT32_C(0xfffffff)
16998         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
16999                 0
17000         /* The granularity of the value (bits or bytes). */
17001         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
17002                 UINT32_C(0x10000000)
17003         /* Value is in bits. */
17004         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
17005                 (UINT32_C(0x0) << 28)
17006         /* Value is in bytes. */
17007         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
17008                 (UINT32_C(0x1) << 28)
17009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
17010                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
17011         /* bw_value_unit is 3 b */
17012         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
17013                 UINT32_C(0xe0000000)
17014         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
17015                 29
17016         /* Value is in Mb or MB (base 10). */
17017         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
17018                 (UINT32_C(0x0) << 29)
17019         /* Value is in Kb or KB (base 10). */
17020         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
17021                 (UINT32_C(0x2) << 29)
17022         /* Value is in bits or bytes. */
17023         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
17024                 (UINT32_C(0x4) << 29)
17025         /* Value is in Gb or GB (base 10). */
17026         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
17027                 (UINT32_C(0x6) << 29)
17028         /* Value is in 1/100th of a percentage of total bandwidth. */
17029         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17030                 (UINT32_C(0x1) << 29)
17031         /* Invalid unit */
17032         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
17033                 (UINT32_C(0x7) << 29)
17034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
17035                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
17036         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17037         uint8_t queue_id3_tsa_assign;
17038         /* Strict Priority */
17039         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
17040                 UINT32_C(0x0)
17041         /* Enhanced Transmission Selection */
17042         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
17043                 UINT32_C(0x1)
17044         /* reserved. */
17045         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
17046                 UINT32_C(0x2)
17047         /* reserved. */
17048         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
17049                 UINT32_C(0xff)
17050         /*
17051          * Priority level for strict priority. Valid only when the
17052          * tsa_assign is 0 - Strict Priority (SP)
17053          * 0..7 - Valid values.
17054          * 8..255 - Reserved.
17055          */
17056         uint8_t queue_id3_pri_lvl;
17057         /*
17058          * Weight used to allocate remaining BW for this COS after
17059          * servicing guaranteed bandwidths for all COS.
17060          */
17061         uint8_t queue_id3_bw_weight;
17062         /* ID of CoS Queue 4. */
17063         uint8_t queue_id4;
17064         /*
17065          * Minimum BW allocated to CoS Queue.
17066          * The HWRM will translate this value into byte counter and
17067          * time interval used for this COS inside the device.
17068          */
17069         uint32_t        queue_id4_min_bw;
17070         /* The bandwidth value. */
17071         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
17072                 UINT32_C(0xfffffff)
17073         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
17074                 0
17075         /* The granularity of the value (bits or bytes). */
17076         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
17077                 UINT32_C(0x10000000)
17078         /* Value is in bits. */
17079         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
17080                 (UINT32_C(0x0) << 28)
17081         /* Value is in bytes. */
17082         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
17083                 (UINT32_C(0x1) << 28)
17084         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
17085                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
17086         /* bw_value_unit is 3 b */
17087         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
17088                 UINT32_C(0xe0000000)
17089         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
17090                 29
17091         /* Value is in Mb or MB (base 10). */
17092         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
17093                 (UINT32_C(0x0) << 29)
17094         /* Value is in Kb or KB (base 10). */
17095         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
17096                 (UINT32_C(0x2) << 29)
17097         /* Value is in bits or bytes. */
17098         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
17099                 (UINT32_C(0x4) << 29)
17100         /* Value is in Gb or GB (base 10). */
17101         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
17102                 (UINT32_C(0x6) << 29)
17103         /* Value is in 1/100th of a percentage of total bandwidth. */
17104         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17105                 (UINT32_C(0x1) << 29)
17106         /* Invalid unit */
17107         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
17108                 (UINT32_C(0x7) << 29)
17109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
17110                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
17111         /*
17112          * Maximum BW allocated to CoS queue.
17113          * The HWRM will translate this value into byte counter and
17114          * time interval used for this COS inside the device.
17115          */
17116         uint32_t        queue_id4_max_bw;
17117         /* The bandwidth value. */
17118         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
17119                 UINT32_C(0xfffffff)
17120         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
17121                 0
17122         /* The granularity of the value (bits or bytes). */
17123         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
17124                 UINT32_C(0x10000000)
17125         /* Value is in bits. */
17126         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
17127                 (UINT32_C(0x0) << 28)
17128         /* Value is in bytes. */
17129         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
17130                 (UINT32_C(0x1) << 28)
17131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
17132                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
17133         /* bw_value_unit is 3 b */
17134         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
17135                 UINT32_C(0xe0000000)
17136         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
17137                 29
17138         /* Value is in Mb or MB (base 10). */
17139         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
17140                 (UINT32_C(0x0) << 29)
17141         /* Value is in Kb or KB (base 10). */
17142         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
17143                 (UINT32_C(0x2) << 29)
17144         /* Value is in bits or bytes. */
17145         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
17146                 (UINT32_C(0x4) << 29)
17147         /* Value is in Gb or GB (base 10). */
17148         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
17149                 (UINT32_C(0x6) << 29)
17150         /* Value is in 1/100th of a percentage of total bandwidth. */
17151         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17152                 (UINT32_C(0x1) << 29)
17153         /* Invalid unit */
17154         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
17155                 (UINT32_C(0x7) << 29)
17156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
17157                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
17158         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17159         uint8_t queue_id4_tsa_assign;
17160         /* Strict Priority */
17161         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
17162                 UINT32_C(0x0)
17163         /* Enhanced Transmission Selection */
17164         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
17165                 UINT32_C(0x1)
17166         /* reserved. */
17167         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
17168                 UINT32_C(0x2)
17169         /* reserved. */
17170         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
17171                 UINT32_C(0xff)
17172         /*
17173          * Priority level for strict priority. Valid only when the
17174          * tsa_assign is 0 - Strict Priority (SP)
17175          * 0..7 - Valid values.
17176          * 8..255 - Reserved.
17177          */
17178         uint8_t queue_id4_pri_lvl;
17179         /*
17180          * Weight used to allocate remaining BW for this COS after
17181          * servicing guaranteed bandwidths for all COS.
17182          */
17183         uint8_t queue_id4_bw_weight;
17184         /* ID of CoS Queue 5. */
17185         uint8_t queue_id5;
17186         /*
17187          * Minimum BW allocated to CoS Queue.
17188          * The HWRM will translate this value into byte counter and
17189          * time interval used for this COS inside the device.
17190          */
17191         uint32_t        queue_id5_min_bw;
17192         /* The bandwidth value. */
17193         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
17194                 UINT32_C(0xfffffff)
17195         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
17196                 0
17197         /* The granularity of the value (bits or bytes). */
17198         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
17199                 UINT32_C(0x10000000)
17200         /* Value is in bits. */
17201         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
17202                 (UINT32_C(0x0) << 28)
17203         /* Value is in bytes. */
17204         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
17205                 (UINT32_C(0x1) << 28)
17206         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
17207                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
17208         /* bw_value_unit is 3 b */
17209         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
17210                 UINT32_C(0xe0000000)
17211         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
17212                 29
17213         /* Value is in Mb or MB (base 10). */
17214         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
17215                 (UINT32_C(0x0) << 29)
17216         /* Value is in Kb or KB (base 10). */
17217         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
17218                 (UINT32_C(0x2) << 29)
17219         /* Value is in bits or bytes. */
17220         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
17221                 (UINT32_C(0x4) << 29)
17222         /* Value is in Gb or GB (base 10). */
17223         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
17224                 (UINT32_C(0x6) << 29)
17225         /* Value is in 1/100th of a percentage of total bandwidth. */
17226         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17227                 (UINT32_C(0x1) << 29)
17228         /* Invalid unit */
17229         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
17230                 (UINT32_C(0x7) << 29)
17231         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
17232                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
17233         /*
17234          * Maximum BW allocated to CoS queue.
17235          * The HWRM will translate this value into byte counter and
17236          * time interval used for this COS inside the device.
17237          */
17238         uint32_t        queue_id5_max_bw;
17239         /* The bandwidth value. */
17240         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
17241                 UINT32_C(0xfffffff)
17242         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
17243                 0
17244         /* The granularity of the value (bits or bytes). */
17245         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
17246                 UINT32_C(0x10000000)
17247         /* Value is in bits. */
17248         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
17249                 (UINT32_C(0x0) << 28)
17250         /* Value is in bytes. */
17251         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
17252                 (UINT32_C(0x1) << 28)
17253         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
17254                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
17255         /* bw_value_unit is 3 b */
17256         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
17257                 UINT32_C(0xe0000000)
17258         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
17259                 29
17260         /* Value is in Mb or MB (base 10). */
17261         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
17262                 (UINT32_C(0x0) << 29)
17263         /* Value is in Kb or KB (base 10). */
17264         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
17265                 (UINT32_C(0x2) << 29)
17266         /* Value is in bits or bytes. */
17267         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
17268                 (UINT32_C(0x4) << 29)
17269         /* Value is in Gb or GB (base 10). */
17270         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
17271                 (UINT32_C(0x6) << 29)
17272         /* Value is in 1/100th of a percentage of total bandwidth. */
17273         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17274                 (UINT32_C(0x1) << 29)
17275         /* Invalid unit */
17276         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
17277                 (UINT32_C(0x7) << 29)
17278         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
17279                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
17280         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17281         uint8_t queue_id5_tsa_assign;
17282         /* Strict Priority */
17283         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
17284                 UINT32_C(0x0)
17285         /* Enhanced Transmission Selection */
17286         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
17287                 UINT32_C(0x1)
17288         /* reserved. */
17289         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
17290                 UINT32_C(0x2)
17291         /* reserved. */
17292         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
17293                 UINT32_C(0xff)
17294         /*
17295          * Priority level for strict priority. Valid only when the
17296          * tsa_assign is 0 - Strict Priority (SP)
17297          * 0..7 - Valid values.
17298          * 8..255 - Reserved.
17299          */
17300         uint8_t queue_id5_pri_lvl;
17301         /*
17302          * Weight used to allocate remaining BW for this COS after
17303          * servicing guaranteed bandwidths for all COS.
17304          */
17305         uint8_t queue_id5_bw_weight;
17306         /* ID of CoS Queue 6. */
17307         uint8_t queue_id6;
17308         /*
17309          * Minimum BW allocated to CoS Queue.
17310          * The HWRM will translate this value into byte counter and
17311          * time interval used for this COS inside the device.
17312          */
17313         uint32_t        queue_id6_min_bw;
17314         /* The bandwidth value. */
17315         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
17316                 UINT32_C(0xfffffff)
17317         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
17318                 0
17319         /* The granularity of the value (bits or bytes). */
17320         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
17321                 UINT32_C(0x10000000)
17322         /* Value is in bits. */
17323         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
17324                 (UINT32_C(0x0) << 28)
17325         /* Value is in bytes. */
17326         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
17327                 (UINT32_C(0x1) << 28)
17328         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
17329                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
17330         /* bw_value_unit is 3 b */
17331         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
17332                 UINT32_C(0xe0000000)
17333         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
17334                 29
17335         /* Value is in Mb or MB (base 10). */
17336         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
17337                 (UINT32_C(0x0) << 29)
17338         /* Value is in Kb or KB (base 10). */
17339         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
17340                 (UINT32_C(0x2) << 29)
17341         /* Value is in bits or bytes. */
17342         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
17343                 (UINT32_C(0x4) << 29)
17344         /* Value is in Gb or GB (base 10). */
17345         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
17346                 (UINT32_C(0x6) << 29)
17347         /* Value is in 1/100th of a percentage of total bandwidth. */
17348         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17349                 (UINT32_C(0x1) << 29)
17350         /* Invalid unit */
17351         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
17352                 (UINT32_C(0x7) << 29)
17353         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
17354                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
17355         /*
17356          * Maximum BW allocated to CoS queue.
17357          * The HWRM will translate this value into byte counter and
17358          * time interval used for this COS inside the device.
17359          */
17360         uint32_t        queue_id6_max_bw;
17361         /* The bandwidth value. */
17362         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
17363                 UINT32_C(0xfffffff)
17364         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
17365                 0
17366         /* The granularity of the value (bits or bytes). */
17367         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
17368                 UINT32_C(0x10000000)
17369         /* Value is in bits. */
17370         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
17371                 (UINT32_C(0x0) << 28)
17372         /* Value is in bytes. */
17373         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
17374                 (UINT32_C(0x1) << 28)
17375         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
17376                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
17377         /* bw_value_unit is 3 b */
17378         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
17379                 UINT32_C(0xe0000000)
17380         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
17381                 29
17382         /* Value is in Mb or MB (base 10). */
17383         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
17384                 (UINT32_C(0x0) << 29)
17385         /* Value is in Kb or KB (base 10). */
17386         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
17387                 (UINT32_C(0x2) << 29)
17388         /* Value is in bits or bytes. */
17389         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
17390                 (UINT32_C(0x4) << 29)
17391         /* Value is in Gb or GB (base 10). */
17392         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
17393                 (UINT32_C(0x6) << 29)
17394         /* Value is in 1/100th of a percentage of total bandwidth. */
17395         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17396                 (UINT32_C(0x1) << 29)
17397         /* Invalid unit */
17398         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
17399                 (UINT32_C(0x7) << 29)
17400         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
17401                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
17402         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17403         uint8_t queue_id6_tsa_assign;
17404         /* Strict Priority */
17405         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
17406                 UINT32_C(0x0)
17407         /* Enhanced Transmission Selection */
17408         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
17409                 UINT32_C(0x1)
17410         /* reserved. */
17411         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
17412                 UINT32_C(0x2)
17413         /* reserved. */
17414         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
17415                 UINT32_C(0xff)
17416         /*
17417          * Priority level for strict priority. Valid only when the
17418          * tsa_assign is 0 - Strict Priority (SP)
17419          * 0..7 - Valid values.
17420          * 8..255 - Reserved.
17421          */
17422         uint8_t queue_id6_pri_lvl;
17423         /*
17424          * Weight used to allocate remaining BW for this COS after
17425          * servicing guaranteed bandwidths for all COS.
17426          */
17427         uint8_t queue_id6_bw_weight;
17428         /* ID of CoS Queue 7. */
17429         uint8_t queue_id7;
17430         /*
17431          * Minimum BW allocated to CoS Queue.
17432          * The HWRM will translate this value into byte counter and
17433          * time interval used for this COS inside the device.
17434          */
17435         uint32_t        queue_id7_min_bw;
17436         /* The bandwidth value. */
17437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
17438                 UINT32_C(0xfffffff)
17439         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
17440                 0
17441         /* The granularity of the value (bits or bytes). */
17442         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
17443                 UINT32_C(0x10000000)
17444         /* Value is in bits. */
17445         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
17446                 (UINT32_C(0x0) << 28)
17447         /* Value is in bytes. */
17448         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
17449                 (UINT32_C(0x1) << 28)
17450         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
17451                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
17452         /* bw_value_unit is 3 b */
17453         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
17454                 UINT32_C(0xe0000000)
17455         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
17456                 29
17457         /* Value is in Mb or MB (base 10). */
17458         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
17459                 (UINT32_C(0x0) << 29)
17460         /* Value is in Kb or KB (base 10). */
17461         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
17462                 (UINT32_C(0x2) << 29)
17463         /* Value is in bits or bytes. */
17464         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
17465                 (UINT32_C(0x4) << 29)
17466         /* Value is in Gb or GB (base 10). */
17467         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
17468                 (UINT32_C(0x6) << 29)
17469         /* Value is in 1/100th of a percentage of total bandwidth. */
17470         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17471                 (UINT32_C(0x1) << 29)
17472         /* Invalid unit */
17473         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
17474                 (UINT32_C(0x7) << 29)
17475         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
17476                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
17477         /*
17478          * Maximum BW allocated to CoS queue.
17479          * The HWRM will translate this value into byte counter and
17480          * time interval used for this COS inside the device.
17481          */
17482         uint32_t        queue_id7_max_bw;
17483         /* The bandwidth value. */
17484         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
17485                 UINT32_C(0xfffffff)
17486         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
17487                 0
17488         /* The granularity of the value (bits or bytes). */
17489         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
17490                 UINT32_C(0x10000000)
17491         /* Value is in bits. */
17492         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
17493                 (UINT32_C(0x0) << 28)
17494         /* Value is in bytes. */
17495         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
17496                 (UINT32_C(0x1) << 28)
17497         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
17498                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
17499         /* bw_value_unit is 3 b */
17500         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
17501                 UINT32_C(0xe0000000)
17502         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
17503                 29
17504         /* Value is in Mb or MB (base 10). */
17505         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
17506                 (UINT32_C(0x0) << 29)
17507         /* Value is in Kb or KB (base 10). */
17508         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
17509                 (UINT32_C(0x2) << 29)
17510         /* Value is in bits or bytes. */
17511         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
17512                 (UINT32_C(0x4) << 29)
17513         /* Value is in Gb or GB (base 10). */
17514         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
17515                 (UINT32_C(0x6) << 29)
17516         /* Value is in 1/100th of a percentage of total bandwidth. */
17517         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17518                 (UINT32_C(0x1) << 29)
17519         /* Invalid unit */
17520         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
17521                 (UINT32_C(0x7) << 29)
17522         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
17523                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
17524         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17525         uint8_t queue_id7_tsa_assign;
17526         /* Strict Priority */
17527         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
17528                 UINT32_C(0x0)
17529         /* Enhanced Transmission Selection */
17530         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
17531                 UINT32_C(0x1)
17532         /* reserved. */
17533         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
17534                 UINT32_C(0x2)
17535         /* reserved. */
17536         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
17537                 UINT32_C(0xff)
17538         /*
17539          * Priority level for strict priority. Valid only when the
17540          * tsa_assign is 0 - Strict Priority (SP)
17541          * 0..7 - Valid values.
17542          * 8..255 - Reserved.
17543          */
17544         uint8_t queue_id7_pri_lvl;
17545         /*
17546          * Weight used to allocate remaining BW for this COS after
17547          * servicing guaranteed bandwidths for all COS.
17548          */
17549         uint8_t queue_id7_bw_weight;
17550         uint8_t unused_2[4];
17551         /*
17552          * This field is used in Output records to indicate that the output
17553          * is completely written to RAM.  This field should be read as '1'
17554          * to indicate that the output has been completely written.
17555          * When writing a command completion or response to an internal processor,
17556          * the order of writes has to be such that this field is written last.
17557          */
17558         uint8_t valid;
17559 } __attribute__((packed));
17560
17561 /*************************
17562  * hwrm_queue_cos2bw_cfg *
17563  *************************/
17564
17565
17566 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
17567 struct hwrm_queue_cos2bw_cfg_input {
17568         /* The HWRM command request type. */
17569         uint16_t        req_type;
17570         /*
17571          * The completion ring to send the completion event on. This should
17572          * be the NQ ID returned from the `nq_alloc` HWRM command.
17573          */
17574         uint16_t        cmpl_ring;
17575         /*
17576          * The sequence ID is used by the driver for tracking multiple
17577          * commands. This ID is treated as opaque data by the firmware and
17578          * the value is returned in the `hwrm_resp_hdr` upon completion.
17579          */
17580         uint16_t        seq_id;
17581         /*
17582          * The target ID of the command:
17583          * * 0x0-0xFFF8 - The function ID
17584          * * 0xFFF8-0xFFFE - Reserved for internal processors
17585          * * 0xFFFF - HWRM
17586          */
17587         uint16_t        target_id;
17588         /*
17589          * A physical address pointer pointing to a host buffer that the
17590          * command's response data will be written. This can be either a host
17591          * physical address (HPA) or a guest physical address (GPA) and must
17592          * point to a physically contiguous block of memory.
17593          */
17594         uint64_t        resp_addr;
17595         uint32_t        flags;
17596         uint32_t        enables;
17597         /*
17598          * If this bit is set to 1, then all queue_id0 related
17599          * parameters in this command are valid.
17600          */
17601         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
17602                 UINT32_C(0x1)
17603         /*
17604          * If this bit is set to 1, then all queue_id1 related
17605          * parameters in this command are valid.
17606          */
17607         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
17608                 UINT32_C(0x2)
17609         /*
17610          * If this bit is set to 1, then all queue_id2 related
17611          * parameters in this command are valid.
17612          */
17613         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
17614                 UINT32_C(0x4)
17615         /*
17616          * If this bit is set to 1, then all queue_id3 related
17617          * parameters in this command are valid.
17618          */
17619         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
17620                 UINT32_C(0x8)
17621         /*
17622          * If this bit is set to 1, then all queue_id4 related
17623          * parameters in this command are valid.
17624          */
17625         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
17626                 UINT32_C(0x10)
17627         /*
17628          * If this bit is set to 1, then all queue_id5 related
17629          * parameters in this command are valid.
17630          */
17631         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
17632                 UINT32_C(0x20)
17633         /*
17634          * If this bit is set to 1, then all queue_id6 related
17635          * parameters in this command are valid.
17636          */
17637         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
17638                 UINT32_C(0x40)
17639         /*
17640          * If this bit is set to 1, then all queue_id7 related
17641          * parameters in this command are valid.
17642          */
17643         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
17644                 UINT32_C(0x80)
17645         /*
17646          * Port ID of port for which the table is being configured.
17647          * The HWRM needs to check whether this function is allowed
17648          * to configure TC BW assignment on this port.
17649          */
17650         uint16_t        port_id;
17651         /* ID of CoS Queue 0. */
17652         uint8_t queue_id0;
17653         uint8_t unused_0;
17654         /*
17655          * Minimum BW allocated to CoS Queue.
17656          * The HWRM will translate this value into byte counter and
17657          * time interval used for this COS inside the device.
17658          */
17659         uint32_t        queue_id0_min_bw;
17660         /* The bandwidth value. */
17661         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
17662                 UINT32_C(0xfffffff)
17663         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
17664                 0
17665         /* The granularity of the value (bits or bytes). */
17666         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
17667                 UINT32_C(0x10000000)
17668         /* Value is in bits. */
17669         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
17670                 (UINT32_C(0x0) << 28)
17671         /* Value is in bytes. */
17672         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
17673                 (UINT32_C(0x1) << 28)
17674         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
17675                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
17676         /* bw_value_unit is 3 b */
17677         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
17678                 UINT32_C(0xe0000000)
17679         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
17680                 29
17681         /* Value is in Mb or MB (base 10). */
17682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
17683                 (UINT32_C(0x0) << 29)
17684         /* Value is in Kb or KB (base 10). */
17685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
17686                 (UINT32_C(0x2) << 29)
17687         /* Value is in bits or bytes. */
17688         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
17689                 (UINT32_C(0x4) << 29)
17690         /* Value is in Gb or GB (base 10). */
17691         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
17692                 (UINT32_C(0x6) << 29)
17693         /* Value is in 1/100th of a percentage of total bandwidth. */
17694         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17695                 (UINT32_C(0x1) << 29)
17696         /* Invalid unit */
17697         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
17698                 (UINT32_C(0x7) << 29)
17699         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
17700                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
17701         /*
17702          * Maximum BW allocated to CoS Queue.
17703          * The HWRM will translate this value into byte counter and
17704          * time interval used for this COS inside the device.
17705          */
17706         uint32_t        queue_id0_max_bw;
17707         /* The bandwidth value. */
17708         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
17709                 UINT32_C(0xfffffff)
17710         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
17711                 0
17712         /* The granularity of the value (bits or bytes). */
17713         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
17714                 UINT32_C(0x10000000)
17715         /* Value is in bits. */
17716         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
17717                 (UINT32_C(0x0) << 28)
17718         /* Value is in bytes. */
17719         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
17720                 (UINT32_C(0x1) << 28)
17721         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
17722                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
17723         /* bw_value_unit is 3 b */
17724         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
17725                 UINT32_C(0xe0000000)
17726         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
17727                 29
17728         /* Value is in Mb or MB (base 10). */
17729         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
17730                 (UINT32_C(0x0) << 29)
17731         /* Value is in Kb or KB (base 10). */
17732         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
17733                 (UINT32_C(0x2) << 29)
17734         /* Value is in bits or bytes. */
17735         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
17736                 (UINT32_C(0x4) << 29)
17737         /* Value is in Gb or GB (base 10). */
17738         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
17739                 (UINT32_C(0x6) << 29)
17740         /* Value is in 1/100th of a percentage of total bandwidth. */
17741         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17742                 (UINT32_C(0x1) << 29)
17743         /* Invalid unit */
17744         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
17745                 (UINT32_C(0x7) << 29)
17746         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
17747                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
17748         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17749         uint8_t queue_id0_tsa_assign;
17750         /* Strict Priority */
17751         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
17752                 UINT32_C(0x0)
17753         /* Enhanced Transmission Selection */
17754         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
17755                 UINT32_C(0x1)
17756         /* reserved. */
17757         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
17758                 UINT32_C(0x2)
17759         /* reserved. */
17760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
17761                 UINT32_C(0xff)
17762         /*
17763          * Priority level for strict priority. Valid only when the
17764          * tsa_assign is 0 - Strict Priority (SP)
17765          * 0..7 - Valid values.
17766          * 8..255 - Reserved.
17767          */
17768         uint8_t queue_id0_pri_lvl;
17769         /*
17770          * Weight used to allocate remaining BW for this COS after
17771          * servicing guaranteed bandwidths for all COS.
17772          */
17773         uint8_t queue_id0_bw_weight;
17774         /* ID of CoS Queue 1. */
17775         uint8_t queue_id1;
17776         /*
17777          * Minimum BW allocated to CoS Queue.
17778          * The HWRM will translate this value into byte counter and
17779          * time interval used for this COS inside the device.
17780          */
17781         uint32_t        queue_id1_min_bw;
17782         /* The bandwidth value. */
17783         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
17784                 UINT32_C(0xfffffff)
17785         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
17786                 0
17787         /* The granularity of the value (bits or bytes). */
17788         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
17789                 UINT32_C(0x10000000)
17790         /* Value is in bits. */
17791         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
17792                 (UINT32_C(0x0) << 28)
17793         /* Value is in bytes. */
17794         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
17795                 (UINT32_C(0x1) << 28)
17796         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
17797                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
17798         /* bw_value_unit is 3 b */
17799         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
17800                 UINT32_C(0xe0000000)
17801         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
17802                 29
17803         /* Value is in Mb or MB (base 10). */
17804         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
17805                 (UINT32_C(0x0) << 29)
17806         /* Value is in Kb or KB (base 10). */
17807         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
17808                 (UINT32_C(0x2) << 29)
17809         /* Value is in bits or bytes. */
17810         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
17811                 (UINT32_C(0x4) << 29)
17812         /* Value is in Gb or GB (base 10). */
17813         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
17814                 (UINT32_C(0x6) << 29)
17815         /* Value is in 1/100th of a percentage of total bandwidth. */
17816         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17817                 (UINT32_C(0x1) << 29)
17818         /* Invalid unit */
17819         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
17820                 (UINT32_C(0x7) << 29)
17821         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
17822                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
17823         /*
17824          * Maximum BW allocated to CoS queue.
17825          * The HWRM will translate this value into byte counter and
17826          * time interval used for this COS inside the device.
17827          */
17828         uint32_t        queue_id1_max_bw;
17829         /* The bandwidth value. */
17830         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
17831                 UINT32_C(0xfffffff)
17832         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
17833                 0
17834         /* The granularity of the value (bits or bytes). */
17835         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
17836                 UINT32_C(0x10000000)
17837         /* Value is in bits. */
17838         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
17839                 (UINT32_C(0x0) << 28)
17840         /* Value is in bytes. */
17841         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
17842                 (UINT32_C(0x1) << 28)
17843         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
17844                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
17845         /* bw_value_unit is 3 b */
17846         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
17847                 UINT32_C(0xe0000000)
17848         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
17849                 29
17850         /* Value is in Mb or MB (base 10). */
17851         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
17852                 (UINT32_C(0x0) << 29)
17853         /* Value is in Kb or KB (base 10). */
17854         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
17855                 (UINT32_C(0x2) << 29)
17856         /* Value is in bits or bytes. */
17857         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
17858                 (UINT32_C(0x4) << 29)
17859         /* Value is in Gb or GB (base 10). */
17860         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
17861                 (UINT32_C(0x6) << 29)
17862         /* Value is in 1/100th of a percentage of total bandwidth. */
17863         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17864                 (UINT32_C(0x1) << 29)
17865         /* Invalid unit */
17866         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
17867                 (UINT32_C(0x7) << 29)
17868         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
17869                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
17870         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17871         uint8_t queue_id1_tsa_assign;
17872         /* Strict Priority */
17873         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
17874                 UINT32_C(0x0)
17875         /* Enhanced Transmission Selection */
17876         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
17877                 UINT32_C(0x1)
17878         /* reserved. */
17879         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
17880                 UINT32_C(0x2)
17881         /* reserved. */
17882         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
17883                 UINT32_C(0xff)
17884         /*
17885          * Priority level for strict priority. Valid only when the
17886          * tsa_assign is 0 - Strict Priority (SP)
17887          * 0..7 - Valid values.
17888          * 8..255 - Reserved.
17889          */
17890         uint8_t queue_id1_pri_lvl;
17891         /*
17892          * Weight used to allocate remaining BW for this COS after
17893          * servicing guaranteed bandwidths for all COS.
17894          */
17895         uint8_t queue_id1_bw_weight;
17896         /* ID of CoS Queue 2. */
17897         uint8_t queue_id2;
17898         /*
17899          * Minimum BW allocated to CoS Queue.
17900          * The HWRM will translate this value into byte counter and
17901          * time interval used for this COS inside the device.
17902          */
17903         uint32_t        queue_id2_min_bw;
17904         /* The bandwidth value. */
17905         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
17906                 UINT32_C(0xfffffff)
17907         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
17908                 0
17909         /* The granularity of the value (bits or bytes). */
17910         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
17911                 UINT32_C(0x10000000)
17912         /* Value is in bits. */
17913         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
17914                 (UINT32_C(0x0) << 28)
17915         /* Value is in bytes. */
17916         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
17917                 (UINT32_C(0x1) << 28)
17918         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
17919                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
17920         /* bw_value_unit is 3 b */
17921         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
17922                 UINT32_C(0xe0000000)
17923         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
17924                 29
17925         /* Value is in Mb or MB (base 10). */
17926         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
17927                 (UINT32_C(0x0) << 29)
17928         /* Value is in Kb or KB (base 10). */
17929         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
17930                 (UINT32_C(0x2) << 29)
17931         /* Value is in bits or bytes. */
17932         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
17933                 (UINT32_C(0x4) << 29)
17934         /* Value is in Gb or GB (base 10). */
17935         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
17936                 (UINT32_C(0x6) << 29)
17937         /* Value is in 1/100th of a percentage of total bandwidth. */
17938         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
17939                 (UINT32_C(0x1) << 29)
17940         /* Invalid unit */
17941         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
17942                 (UINT32_C(0x7) << 29)
17943         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
17944                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
17945         /*
17946          * Maximum BW allocated to CoS queue.
17947          * The HWRM will translate this value into byte counter and
17948          * time interval used for this COS inside the device.
17949          */
17950         uint32_t        queue_id2_max_bw;
17951         /* The bandwidth value. */
17952         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
17953                 UINT32_C(0xfffffff)
17954         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
17955                 0
17956         /* The granularity of the value (bits or bytes). */
17957         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
17958                 UINT32_C(0x10000000)
17959         /* Value is in bits. */
17960         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
17961                 (UINT32_C(0x0) << 28)
17962         /* Value is in bytes. */
17963         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
17964                 (UINT32_C(0x1) << 28)
17965         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
17966                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
17967         /* bw_value_unit is 3 b */
17968         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
17969                 UINT32_C(0xe0000000)
17970         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
17971                 29
17972         /* Value is in Mb or MB (base 10). */
17973         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
17974                 (UINT32_C(0x0) << 29)
17975         /* Value is in Kb or KB (base 10). */
17976         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
17977                 (UINT32_C(0x2) << 29)
17978         /* Value is in bits or bytes. */
17979         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
17980                 (UINT32_C(0x4) << 29)
17981         /* Value is in Gb or GB (base 10). */
17982         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
17983                 (UINT32_C(0x6) << 29)
17984         /* Value is in 1/100th of a percentage of total bandwidth. */
17985         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
17986                 (UINT32_C(0x1) << 29)
17987         /* Invalid unit */
17988         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
17989                 (UINT32_C(0x7) << 29)
17990         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
17991                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
17992         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
17993         uint8_t queue_id2_tsa_assign;
17994         /* Strict Priority */
17995         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
17996                 UINT32_C(0x0)
17997         /* Enhanced Transmission Selection */
17998         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
17999                 UINT32_C(0x1)
18000         /* reserved. */
18001         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
18002                 UINT32_C(0x2)
18003         /* reserved. */
18004         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
18005                 UINT32_C(0xff)
18006         /*
18007          * Priority level for strict priority. Valid only when the
18008          * tsa_assign is 0 - Strict Priority (SP)
18009          * 0..7 - Valid values.
18010          * 8..255 - Reserved.
18011          */
18012         uint8_t queue_id2_pri_lvl;
18013         /*
18014          * Weight used to allocate remaining BW for this COS after
18015          * servicing guaranteed bandwidths for all COS.
18016          */
18017         uint8_t queue_id2_bw_weight;
18018         /* ID of CoS Queue 3. */
18019         uint8_t queue_id3;
18020         /*
18021          * Minimum BW allocated to CoS Queue.
18022          * The HWRM will translate this value into byte counter and
18023          * time interval used for this COS inside the device.
18024          */
18025         uint32_t        queue_id3_min_bw;
18026         /* The bandwidth value. */
18027         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
18028                 UINT32_C(0xfffffff)
18029         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
18030                 0
18031         /* The granularity of the value (bits or bytes). */
18032         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
18033                 UINT32_C(0x10000000)
18034         /* Value is in bits. */
18035         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
18036                 (UINT32_C(0x0) << 28)
18037         /* Value is in bytes. */
18038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
18039                 (UINT32_C(0x1) << 28)
18040         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
18041                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
18042         /* bw_value_unit is 3 b */
18043         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
18044                 UINT32_C(0xe0000000)
18045         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
18046                 29
18047         /* Value is in Mb or MB (base 10). */
18048         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
18049                 (UINT32_C(0x0) << 29)
18050         /* Value is in Kb or KB (base 10). */
18051         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
18052                 (UINT32_C(0x2) << 29)
18053         /* Value is in bits or bytes. */
18054         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
18055                 (UINT32_C(0x4) << 29)
18056         /* Value is in Gb or GB (base 10). */
18057         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
18058                 (UINT32_C(0x6) << 29)
18059         /* Value is in 1/100th of a percentage of total bandwidth. */
18060         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18061                 (UINT32_C(0x1) << 29)
18062         /* Invalid unit */
18063         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
18064                 (UINT32_C(0x7) << 29)
18065         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
18066                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
18067         /*
18068          * Maximum BW allocated to CoS queue.
18069          * The HWRM will translate this value into byte counter and
18070          * time interval used for this COS inside the device.
18071          */
18072         uint32_t        queue_id3_max_bw;
18073         /* The bandwidth value. */
18074         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
18075                 UINT32_C(0xfffffff)
18076         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
18077                 0
18078         /* The granularity of the value (bits or bytes). */
18079         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
18080                 UINT32_C(0x10000000)
18081         /* Value is in bits. */
18082         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
18083                 (UINT32_C(0x0) << 28)
18084         /* Value is in bytes. */
18085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
18086                 (UINT32_C(0x1) << 28)
18087         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
18088                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
18089         /* bw_value_unit is 3 b */
18090         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
18091                 UINT32_C(0xe0000000)
18092         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
18093                 29
18094         /* Value is in Mb or MB (base 10). */
18095         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
18096                 (UINT32_C(0x0) << 29)
18097         /* Value is in Kb or KB (base 10). */
18098         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
18099                 (UINT32_C(0x2) << 29)
18100         /* Value is in bits or bytes. */
18101         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
18102                 (UINT32_C(0x4) << 29)
18103         /* Value is in Gb or GB (base 10). */
18104         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
18105                 (UINT32_C(0x6) << 29)
18106         /* Value is in 1/100th of a percentage of total bandwidth. */
18107         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18108                 (UINT32_C(0x1) << 29)
18109         /* Invalid unit */
18110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
18111                 (UINT32_C(0x7) << 29)
18112         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
18113                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
18114         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
18115         uint8_t queue_id3_tsa_assign;
18116         /* Strict Priority */
18117         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
18118                 UINT32_C(0x0)
18119         /* Enhanced Transmission Selection */
18120         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
18121                 UINT32_C(0x1)
18122         /* reserved. */
18123         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
18124                 UINT32_C(0x2)
18125         /* reserved. */
18126         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
18127                 UINT32_C(0xff)
18128         /*
18129          * Priority level for strict priority. Valid only when the
18130          * tsa_assign is 0 - Strict Priority (SP)
18131          * 0..7 - Valid values.
18132          * 8..255 - Reserved.
18133          */
18134         uint8_t queue_id3_pri_lvl;
18135         /*
18136          * Weight used to allocate remaining BW for this COS after
18137          * servicing guaranteed bandwidths for all COS.
18138          */
18139         uint8_t queue_id3_bw_weight;
18140         /* ID of CoS Queue 4. */
18141         uint8_t queue_id4;
18142         /*
18143          * Minimum BW allocated to CoS Queue.
18144          * The HWRM will translate this value into byte counter and
18145          * time interval used for this COS inside the device.
18146          */
18147         uint32_t        queue_id4_min_bw;
18148         /* The bandwidth value. */
18149         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
18150                 UINT32_C(0xfffffff)
18151         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
18152                 0
18153         /* The granularity of the value (bits or bytes). */
18154         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
18155                 UINT32_C(0x10000000)
18156         /* Value is in bits. */
18157         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
18158                 (UINT32_C(0x0) << 28)
18159         /* Value is in bytes. */
18160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
18161                 (UINT32_C(0x1) << 28)
18162         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
18163                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
18164         /* bw_value_unit is 3 b */
18165         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
18166                 UINT32_C(0xe0000000)
18167         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
18168                 29
18169         /* Value is in Mb or MB (base 10). */
18170         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
18171                 (UINT32_C(0x0) << 29)
18172         /* Value is in Kb or KB (base 10). */
18173         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
18174                 (UINT32_C(0x2) << 29)
18175         /* Value is in bits or bytes. */
18176         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
18177                 (UINT32_C(0x4) << 29)
18178         /* Value is in Gb or GB (base 10). */
18179         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
18180                 (UINT32_C(0x6) << 29)
18181         /* Value is in 1/100th of a percentage of total bandwidth. */
18182         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18183                 (UINT32_C(0x1) << 29)
18184         /* Invalid unit */
18185         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
18186                 (UINT32_C(0x7) << 29)
18187         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
18188                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
18189         /*
18190          * Maximum BW allocated to CoS queue.
18191          * The HWRM will translate this value into byte counter and
18192          * time interval used for this COS inside the device.
18193          */
18194         uint32_t        queue_id4_max_bw;
18195         /* The bandwidth value. */
18196         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
18197                 UINT32_C(0xfffffff)
18198         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
18199                 0
18200         /* The granularity of the value (bits or bytes). */
18201         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
18202                 UINT32_C(0x10000000)
18203         /* Value is in bits. */
18204         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
18205                 (UINT32_C(0x0) << 28)
18206         /* Value is in bytes. */
18207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
18208                 (UINT32_C(0x1) << 28)
18209         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
18210                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
18211         /* bw_value_unit is 3 b */
18212         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
18213                 UINT32_C(0xe0000000)
18214         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
18215                 29
18216         /* Value is in Mb or MB (base 10). */
18217         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
18218                 (UINT32_C(0x0) << 29)
18219         /* Value is in Kb or KB (base 10). */
18220         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
18221                 (UINT32_C(0x2) << 29)
18222         /* Value is in bits or bytes. */
18223         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
18224                 (UINT32_C(0x4) << 29)
18225         /* Value is in Gb or GB (base 10). */
18226         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
18227                 (UINT32_C(0x6) << 29)
18228         /* Value is in 1/100th of a percentage of total bandwidth. */
18229         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18230                 (UINT32_C(0x1) << 29)
18231         /* Invalid unit */
18232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
18233                 (UINT32_C(0x7) << 29)
18234         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
18235                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
18236         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
18237         uint8_t queue_id4_tsa_assign;
18238         /* Strict Priority */
18239         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
18240                 UINT32_C(0x0)
18241         /* Enhanced Transmission Selection */
18242         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
18243                 UINT32_C(0x1)
18244         /* reserved. */
18245         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
18246                 UINT32_C(0x2)
18247         /* reserved. */
18248         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
18249                 UINT32_C(0xff)
18250         /*
18251          * Priority level for strict priority. Valid only when the
18252          * tsa_assign is 0 - Strict Priority (SP)
18253          * 0..7 - Valid values.
18254          * 8..255 - Reserved.
18255          */
18256         uint8_t queue_id4_pri_lvl;
18257         /*
18258          * Weight used to allocate remaining BW for this COS after
18259          * servicing guaranteed bandwidths for all COS.
18260          */
18261         uint8_t queue_id4_bw_weight;
18262         /* ID of CoS Queue 5. */
18263         uint8_t queue_id5;
18264         /*
18265          * Minimum BW allocated to CoS Queue.
18266          * The HWRM will translate this value into byte counter and
18267          * time interval used for this COS inside the device.
18268          */
18269         uint32_t        queue_id5_min_bw;
18270         /* The bandwidth value. */
18271         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
18272                 UINT32_C(0xfffffff)
18273         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
18274                 0
18275         /* The granularity of the value (bits or bytes). */
18276         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
18277                 UINT32_C(0x10000000)
18278         /* Value is in bits. */
18279         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
18280                 (UINT32_C(0x0) << 28)
18281         /* Value is in bytes. */
18282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
18283                 (UINT32_C(0x1) << 28)
18284         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
18285                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
18286         /* bw_value_unit is 3 b */
18287         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
18288                 UINT32_C(0xe0000000)
18289         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
18290                 29
18291         /* Value is in Mb or MB (base 10). */
18292         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
18293                 (UINT32_C(0x0) << 29)
18294         /* Value is in Kb or KB (base 10). */
18295         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
18296                 (UINT32_C(0x2) << 29)
18297         /* Value is in bits or bytes. */
18298         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
18299                 (UINT32_C(0x4) << 29)
18300         /* Value is in Gb or GB (base 10). */
18301         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
18302                 (UINT32_C(0x6) << 29)
18303         /* Value is in 1/100th of a percentage of total bandwidth. */
18304         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18305                 (UINT32_C(0x1) << 29)
18306         /* Invalid unit */
18307         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
18308                 (UINT32_C(0x7) << 29)
18309         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
18310                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
18311         /*
18312          * Maximum BW allocated to CoS queue.
18313          * The HWRM will translate this value into byte counter and
18314          * time interval used for this COS inside the device.
18315          */
18316         uint32_t        queue_id5_max_bw;
18317         /* The bandwidth value. */
18318         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
18319                 UINT32_C(0xfffffff)
18320         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
18321                 0
18322         /* The granularity of the value (bits or bytes). */
18323         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
18324                 UINT32_C(0x10000000)
18325         /* Value is in bits. */
18326         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
18327                 (UINT32_C(0x0) << 28)
18328         /* Value is in bytes. */
18329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
18330                 (UINT32_C(0x1) << 28)
18331         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
18332                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
18333         /* bw_value_unit is 3 b */
18334         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
18335                 UINT32_C(0xe0000000)
18336         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
18337                 29
18338         /* Value is in Mb or MB (base 10). */
18339         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
18340                 (UINT32_C(0x0) << 29)
18341         /* Value is in Kb or KB (base 10). */
18342         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
18343                 (UINT32_C(0x2) << 29)
18344         /* Value is in bits or bytes. */
18345         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
18346                 (UINT32_C(0x4) << 29)
18347         /* Value is in Gb or GB (base 10). */
18348         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
18349                 (UINT32_C(0x6) << 29)
18350         /* Value is in 1/100th of a percentage of total bandwidth. */
18351         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18352                 (UINT32_C(0x1) << 29)
18353         /* Invalid unit */
18354         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
18355                 (UINT32_C(0x7) << 29)
18356         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
18357                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
18358         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
18359         uint8_t queue_id5_tsa_assign;
18360         /* Strict Priority */
18361         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
18362                 UINT32_C(0x0)
18363         /* Enhanced Transmission Selection */
18364         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
18365                 UINT32_C(0x1)
18366         /* reserved. */
18367         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
18368                 UINT32_C(0x2)
18369         /* reserved. */
18370         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
18371                 UINT32_C(0xff)
18372         /*
18373          * Priority level for strict priority. Valid only when the
18374          * tsa_assign is 0 - Strict Priority (SP)
18375          * 0..7 - Valid values.
18376          * 8..255 - Reserved.
18377          */
18378         uint8_t queue_id5_pri_lvl;
18379         /*
18380          * Weight used to allocate remaining BW for this COS after
18381          * servicing guaranteed bandwidths for all COS.
18382          */
18383         uint8_t queue_id5_bw_weight;
18384         /* ID of CoS Queue 6. */
18385         uint8_t queue_id6;
18386         /*
18387          * Minimum BW allocated to CoS Queue.
18388          * The HWRM will translate this value into byte counter and
18389          * time interval used for this COS inside the device.
18390          */
18391         uint32_t        queue_id6_min_bw;
18392         /* The bandwidth value. */
18393         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
18394                 UINT32_C(0xfffffff)
18395         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
18396                 0
18397         /* The granularity of the value (bits or bytes). */
18398         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
18399                 UINT32_C(0x10000000)
18400         /* Value is in bits. */
18401         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
18402                 (UINT32_C(0x0) << 28)
18403         /* Value is in bytes. */
18404         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
18405                 (UINT32_C(0x1) << 28)
18406         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
18407                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
18408         /* bw_value_unit is 3 b */
18409         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
18410                 UINT32_C(0xe0000000)
18411         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
18412                 29
18413         /* Value is in Mb or MB (base 10). */
18414         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
18415                 (UINT32_C(0x0) << 29)
18416         /* Value is in Kb or KB (base 10). */
18417         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
18418                 (UINT32_C(0x2) << 29)
18419         /* Value is in bits or bytes. */
18420         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
18421                 (UINT32_C(0x4) << 29)
18422         /* Value is in Gb or GB (base 10). */
18423         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
18424                 (UINT32_C(0x6) << 29)
18425         /* Value is in 1/100th of a percentage of total bandwidth. */
18426         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18427                 (UINT32_C(0x1) << 29)
18428         /* Invalid unit */
18429         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
18430                 (UINT32_C(0x7) << 29)
18431         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
18432                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
18433         /*
18434          * Maximum BW allocated to CoS queue.
18435          * The HWRM will translate this value into byte counter and
18436          * time interval used for this COS inside the device.
18437          */
18438         uint32_t        queue_id6_max_bw;
18439         /* The bandwidth value. */
18440         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
18441                 UINT32_C(0xfffffff)
18442         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
18443                 0
18444         /* The granularity of the value (bits or bytes). */
18445         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
18446                 UINT32_C(0x10000000)
18447         /* Value is in bits. */
18448         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
18449                 (UINT32_C(0x0) << 28)
18450         /* Value is in bytes. */
18451         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
18452                 (UINT32_C(0x1) << 28)
18453         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
18454                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
18455         /* bw_value_unit is 3 b */
18456         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
18457                 UINT32_C(0xe0000000)
18458         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
18459                 29
18460         /* Value is in Mb or MB (base 10). */
18461         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
18462                 (UINT32_C(0x0) << 29)
18463         /* Value is in Kb or KB (base 10). */
18464         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
18465                 (UINT32_C(0x2) << 29)
18466         /* Value is in bits or bytes. */
18467         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
18468                 (UINT32_C(0x4) << 29)
18469         /* Value is in Gb or GB (base 10). */
18470         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
18471                 (UINT32_C(0x6) << 29)
18472         /* Value is in 1/100th of a percentage of total bandwidth. */
18473         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18474                 (UINT32_C(0x1) << 29)
18475         /* Invalid unit */
18476         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
18477                 (UINT32_C(0x7) << 29)
18478         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
18479                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
18480         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
18481         uint8_t queue_id6_tsa_assign;
18482         /* Strict Priority */
18483         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
18484                 UINT32_C(0x0)
18485         /* Enhanced Transmission Selection */
18486         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
18487                 UINT32_C(0x1)
18488         /* reserved. */
18489         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
18490                 UINT32_C(0x2)
18491         /* reserved. */
18492         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
18493                 UINT32_C(0xff)
18494         /*
18495          * Priority level for strict priority. Valid only when the
18496          * tsa_assign is 0 - Strict Priority (SP)
18497          * 0..7 - Valid values.
18498          * 8..255 - Reserved.
18499          */
18500         uint8_t queue_id6_pri_lvl;
18501         /*
18502          * Weight used to allocate remaining BW for this COS after
18503          * servicing guaranteed bandwidths for all COS.
18504          */
18505         uint8_t queue_id6_bw_weight;
18506         /* ID of CoS Queue 7. */
18507         uint8_t queue_id7;
18508         /*
18509          * Minimum BW allocated to CoS Queue.
18510          * The HWRM will translate this value into byte counter and
18511          * time interval used for this COS inside the device.
18512          */
18513         uint32_t        queue_id7_min_bw;
18514         /* The bandwidth value. */
18515         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
18516                 UINT32_C(0xfffffff)
18517         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
18518                 0
18519         /* The granularity of the value (bits or bytes). */
18520         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
18521                 UINT32_C(0x10000000)
18522         /* Value is in bits. */
18523         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
18524                 (UINT32_C(0x0) << 28)
18525         /* Value is in bytes. */
18526         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
18527                 (UINT32_C(0x1) << 28)
18528         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
18529                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
18530         /* bw_value_unit is 3 b */
18531         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
18532                 UINT32_C(0xe0000000)
18533         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
18534                 29
18535         /* Value is in Mb or MB (base 10). */
18536         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
18537                 (UINT32_C(0x0) << 29)
18538         /* Value is in Kb or KB (base 10). */
18539         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
18540                 (UINT32_C(0x2) << 29)
18541         /* Value is in bits or bytes. */
18542         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
18543                 (UINT32_C(0x4) << 29)
18544         /* Value is in Gb or GB (base 10). */
18545         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
18546                 (UINT32_C(0x6) << 29)
18547         /* Value is in 1/100th of a percentage of total bandwidth. */
18548         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18549                 (UINT32_C(0x1) << 29)
18550         /* Invalid unit */
18551         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
18552                 (UINT32_C(0x7) << 29)
18553         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
18554                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
18555         /*
18556          * Maximum BW allocated to CoS queue.
18557          * The HWRM will translate this value into byte counter and
18558          * time interval used for this COS inside the device.
18559          */
18560         uint32_t        queue_id7_max_bw;
18561         /* The bandwidth value. */
18562         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
18563                 UINT32_C(0xfffffff)
18564         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
18565                 0
18566         /* The granularity of the value (bits or bytes). */
18567         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
18568                 UINT32_C(0x10000000)
18569         /* Value is in bits. */
18570         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
18571                 (UINT32_C(0x0) << 28)
18572         /* Value is in bytes. */
18573         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
18574                 (UINT32_C(0x1) << 28)
18575         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
18576                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
18577         /* bw_value_unit is 3 b */
18578         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
18579                 UINT32_C(0xe0000000)
18580         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
18581                 29
18582         /* Value is in Mb or MB (base 10). */
18583         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
18584                 (UINT32_C(0x0) << 29)
18585         /* Value is in Kb or KB (base 10). */
18586         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
18587                 (UINT32_C(0x2) << 29)
18588         /* Value is in bits or bytes. */
18589         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
18590                 (UINT32_C(0x4) << 29)
18591         /* Value is in Gb or GB (base 10). */
18592         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
18593                 (UINT32_C(0x6) << 29)
18594         /* Value is in 1/100th of a percentage of total bandwidth. */
18595         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18596                 (UINT32_C(0x1) << 29)
18597         /* Invalid unit */
18598         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
18599                 (UINT32_C(0x7) << 29)
18600         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
18601                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
18602         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
18603         uint8_t queue_id7_tsa_assign;
18604         /* Strict Priority */
18605         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
18606                 UINT32_C(0x0)
18607         /* Enhanced Transmission Selection */
18608         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
18609                 UINT32_C(0x1)
18610         /* reserved. */
18611         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
18612                 UINT32_C(0x2)
18613         /* reserved. */
18614         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
18615                 UINT32_C(0xff)
18616         /*
18617          * Priority level for strict priority. Valid only when the
18618          * tsa_assign is 0 - Strict Priority (SP)
18619          * 0..7 - Valid values.
18620          * 8..255 - Reserved.
18621          */
18622         uint8_t queue_id7_pri_lvl;
18623         /*
18624          * Weight used to allocate remaining BW for this COS after
18625          * servicing guaranteed bandwidths for all COS.
18626          */
18627         uint8_t queue_id7_bw_weight;
18628         uint8_t unused_1[5];
18629 } __attribute__((packed));
18630
18631 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
18632 struct hwrm_queue_cos2bw_cfg_output {
18633         /* The specific error status for the command. */
18634         uint16_t        error_code;
18635         /* The HWRM command request type. */
18636         uint16_t        req_type;
18637         /* The sequence ID from the original command. */
18638         uint16_t        seq_id;
18639         /* The length of the response data in number of bytes. */
18640         uint16_t        resp_len;
18641         uint8_t unused_0[7];
18642         /*
18643          * This field is used in Output records to indicate that the output
18644          * is completely written to RAM.  This field should be read as '1'
18645          * to indicate that the output has been completely written.
18646          * When writing a command completion or response to an internal processor,
18647          * the order of writes has to be such that this field is written last.
18648          */
18649         uint8_t valid;
18650 } __attribute__((packed));
18651
18652 /*******************
18653  * hwrm_vnic_alloc *
18654  *******************/
18655
18656
18657 /* hwrm_vnic_alloc_input (size:192b/24B) */
18658 struct hwrm_vnic_alloc_input {
18659         /* The HWRM command request type. */
18660         uint16_t        req_type;
18661         /*
18662          * The completion ring to send the completion event on. This should
18663          * be the NQ ID returned from the `nq_alloc` HWRM command.
18664          */
18665         uint16_t        cmpl_ring;
18666         /*
18667          * The sequence ID is used by the driver for tracking multiple
18668          * commands. This ID is treated as opaque data by the firmware and
18669          * the value is returned in the `hwrm_resp_hdr` upon completion.
18670          */
18671         uint16_t        seq_id;
18672         /*
18673          * The target ID of the command:
18674          * * 0x0-0xFFF8 - The function ID
18675          * * 0xFFF8-0xFFFE - Reserved for internal processors
18676          * * 0xFFFF - HWRM
18677          */
18678         uint16_t        target_id;
18679         /*
18680          * A physical address pointer pointing to a host buffer that the
18681          * command's response data will be written. This can be either a host
18682          * physical address (HPA) or a guest physical address (GPA) and must
18683          * point to a physically contiguous block of memory.
18684          */
18685         uint64_t        resp_addr;
18686         uint32_t        flags;
18687         /*
18688          * When this bit is '1', this VNIC is requested to
18689          * be the default VNIC for this function.
18690          */
18691         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
18692         uint8_t unused_0[4];
18693 } __attribute__((packed));
18694
18695 /* hwrm_vnic_alloc_output (size:128b/16B) */
18696 struct hwrm_vnic_alloc_output {
18697         /* The specific error status for the command. */
18698         uint16_t        error_code;
18699         /* The HWRM command request type. */
18700         uint16_t        req_type;
18701         /* The sequence ID from the original command. */
18702         uint16_t        seq_id;
18703         /* The length of the response data in number of bytes. */
18704         uint16_t        resp_len;
18705         /* Logical vnic ID */
18706         uint32_t        vnic_id;
18707         uint8_t unused_0[3];
18708         /*
18709          * This field is used in Output records to indicate that the output
18710          * is completely written to RAM.  This field should be read as '1'
18711          * to indicate that the output has been completely written.
18712          * When writing a command completion or response to an internal processor,
18713          * the order of writes has to be such that this field is written last.
18714          */
18715         uint8_t valid;
18716 } __attribute__((packed));
18717
18718 /******************
18719  * hwrm_vnic_free *
18720  ******************/
18721
18722
18723 /* hwrm_vnic_free_input (size:192b/24B) */
18724 struct hwrm_vnic_free_input {
18725         /* The HWRM command request type. */
18726         uint16_t        req_type;
18727         /*
18728          * The completion ring to send the completion event on. This should
18729          * be the NQ ID returned from the `nq_alloc` HWRM command.
18730          */
18731         uint16_t        cmpl_ring;
18732         /*
18733          * The sequence ID is used by the driver for tracking multiple
18734          * commands. This ID is treated as opaque data by the firmware and
18735          * the value is returned in the `hwrm_resp_hdr` upon completion.
18736          */
18737         uint16_t        seq_id;
18738         /*
18739          * The target ID of the command:
18740          * * 0x0-0xFFF8 - The function ID
18741          * * 0xFFF8-0xFFFE - Reserved for internal processors
18742          * * 0xFFFF - HWRM
18743          */
18744         uint16_t        target_id;
18745         /*
18746          * A physical address pointer pointing to a host buffer that the
18747          * command's response data will be written. This can be either a host
18748          * physical address (HPA) or a guest physical address (GPA) and must
18749          * point to a physically contiguous block of memory.
18750          */
18751         uint64_t        resp_addr;
18752         /* Logical vnic ID */
18753         uint32_t        vnic_id;
18754         uint8_t unused_0[4];
18755 } __attribute__((packed));
18756
18757 /* hwrm_vnic_free_output (size:128b/16B) */
18758 struct hwrm_vnic_free_output {
18759         /* The specific error status for the command. */
18760         uint16_t        error_code;
18761         /* The HWRM command request type. */
18762         uint16_t        req_type;
18763         /* The sequence ID from the original command. */
18764         uint16_t        seq_id;
18765         /* The length of the response data in number of bytes. */
18766         uint16_t        resp_len;
18767         uint8_t unused_0[7];
18768         /*
18769          * This field is used in Output records to indicate that the output
18770          * is completely written to RAM.  This field should be read as '1'
18771          * to indicate that the output has been completely written.
18772          * When writing a command completion or response to an internal processor,
18773          * the order of writes has to be such that this field is written last.
18774          */
18775         uint8_t valid;
18776 } __attribute__((packed));
18777
18778 /*****************
18779  * hwrm_vnic_cfg *
18780  *****************/
18781
18782
18783 /* hwrm_vnic_cfg_input (size:320b/40B) */
18784 struct hwrm_vnic_cfg_input {
18785         /* The HWRM command request type. */
18786         uint16_t        req_type;
18787         /*
18788          * The completion ring to send the completion event on. This should
18789          * be the NQ ID returned from the `nq_alloc` HWRM command.
18790          */
18791         uint16_t        cmpl_ring;
18792         /*
18793          * The sequence ID is used by the driver for tracking multiple
18794          * commands. This ID is treated as opaque data by the firmware and
18795          * the value is returned in the `hwrm_resp_hdr` upon completion.
18796          */
18797         uint16_t        seq_id;
18798         /*
18799          * The target ID of the command:
18800          * * 0x0-0xFFF8 - The function ID
18801          * * 0xFFF8-0xFFFE - Reserved for internal processors
18802          * * 0xFFFF - HWRM
18803          */
18804         uint16_t        target_id;
18805         /*
18806          * A physical address pointer pointing to a host buffer that the
18807          * command's response data will be written. This can be either a host
18808          * physical address (HPA) or a guest physical address (GPA) and must
18809          * point to a physically contiguous block of memory.
18810          */
18811         uint64_t        resp_addr;
18812         uint32_t        flags;
18813         /*
18814          * When this bit is '1', the VNIC is requested to
18815          * be the default VNIC for the function.
18816          */
18817         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
18818                 UINT32_C(0x1)
18819         /*
18820          * When this bit is '1', the VNIC is being configured to
18821          * strip VLAN in the RX path.
18822          * If set to '0', then VLAN stripping is disabled on
18823          * this VNIC.
18824          */
18825         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
18826                 UINT32_C(0x2)
18827         /*
18828          * When this bit is '1', the VNIC is being configured to
18829          * buffer receive packets in the hardware until the host
18830          * posts new receive buffers.
18831          * If set to '0', then bd_stall is being configured to be
18832          * disabled on this VNIC.
18833          */
18834         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
18835                 UINT32_C(0x4)
18836         /*
18837          * When this bit is '1', the VNIC is being configured to
18838          * receive both RoCE and non-RoCE traffic.
18839          * If set to '0', then this VNIC is not configured to be
18840          * operating in dual VNIC mode.
18841          */
18842         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
18843                 UINT32_C(0x8)
18844         /*
18845          * When this flag is set to '1', the VNIC is requested to
18846          * be configured to receive only RoCE traffic.
18847          * If this flag is set to '0', then this flag shall be
18848          * ignored by the HWRM.
18849          * If roce_dual_vnic_mode flag is set to '1'
18850          * or roce_mirroring_capable_vnic_mode flag to 1,
18851          * then the HWRM client shall not set this flag to '1'.
18852          */
18853         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
18854                 UINT32_C(0x10)
18855         /*
18856          * When a VNIC uses one destination ring group for certain
18857          * application (e.g. Receive Flow Steering) where
18858          * exact match is used to direct packets to a VNIC with one
18859          * destination ring group only, there is no need to configure
18860          * RSS indirection table for that VNIC as only one destination
18861          * ring group is used.
18862          *
18863          * This flag is used to enable a mode where
18864          * RSS is enabled in the VNIC using a RSS context
18865          * for computing RSS hash but the RSS indirection table is
18866          * not configured using hwrm_vnic_rss_cfg.
18867          *
18868          * If this mode is enabled, then the driver should not program
18869          * RSS indirection table for the RSS context that is used for
18870          * computing RSS hash only.
18871          */
18872         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
18873                 UINT32_C(0x20)
18874         /*
18875          * When this bit is '1', the VNIC is being configured to
18876          * receive both RoCE and non-RoCE traffic, but forward only the
18877          * RoCE traffic further. Also, RoCE traffic can be mirrored to
18878          * L2 driver.
18879          */
18880         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
18881                 UINT32_C(0x40)
18882         uint32_t        enables;
18883         /*
18884          * This bit must be '1' for the dflt_ring_grp field to be
18885          * configured.
18886          */
18887         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
18888                 UINT32_C(0x1)
18889         /*
18890          * This bit must be '1' for the rss_rule field to be
18891          * configured.
18892          */
18893         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
18894                 UINT32_C(0x2)
18895         /*
18896          * This bit must be '1' for the cos_rule field to be
18897          * configured.
18898          */
18899         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
18900                 UINT32_C(0x4)
18901         /*
18902          * This bit must be '1' for the lb_rule field to be
18903          * configured.
18904          */
18905         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
18906                 UINT32_C(0x8)
18907         /*
18908          * This bit must be '1' for the mru field to be
18909          * configured.
18910          */
18911         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
18912                 UINT32_C(0x10)
18913         /*
18914          * This bit must be '1' for the default_rx_ring_id field to be
18915          * configured.
18916          */
18917         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
18918                 UINT32_C(0x20)
18919         /*
18920          * This bit must be '1' for the default_cmpl_ring_id field to be
18921          * configured.
18922          */
18923         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
18924                 UINT32_C(0x40)
18925         /* Logical vnic ID */
18926         uint16_t        vnic_id;
18927         /*
18928          * Default Completion ring for the VNIC.  This ring will
18929          * be chosen if packet does not match any RSS rules and if
18930          * there is no COS rule.
18931          */
18932         uint16_t        dflt_ring_grp;
18933         /*
18934          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
18935          * there is no RSS rule.
18936          */
18937         uint16_t        rss_rule;
18938         /*
18939          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
18940          * there is no COS rule.
18941          */
18942         uint16_t        cos_rule;
18943         /*
18944          * RSS ID for load balancing rule/table structure.
18945          * 0xFF... (All Fs) if there is no LB rule.
18946          */
18947         uint16_t        lb_rule;
18948         /*
18949          * The maximum receive unit of the vnic.
18950          * Each vnic is associated with a function.
18951          * The vnic mru value overwrites the mru setting of the
18952          * associated function.
18953          * The HWRM shall make sure that vnic mru does not exceed
18954          * the mru of the port the function is associated with.
18955          */
18956         uint16_t        mru;
18957         /*
18958          * Default Rx ring for the VNIC.  This ring will
18959          * be chosen if packet does not match any RSS rules.
18960          * The aggregation ring associated with the Rx ring is
18961          * implied based on the Rx ring specified when the
18962          * aggregation ring was allocated.
18963          */
18964         uint16_t        default_rx_ring_id;
18965         /*
18966          * Default completion ring for the VNIC.  This ring will
18967          * be chosen if packet does not match any RSS rules.
18968          */
18969         uint16_t        default_cmpl_ring_id;
18970 } __attribute__((packed));
18971
18972 /* hwrm_vnic_cfg_output (size:128b/16B) */
18973 struct hwrm_vnic_cfg_output {
18974         /* The specific error status for the command. */
18975         uint16_t        error_code;
18976         /* The HWRM command request type. */
18977         uint16_t        req_type;
18978         /* The sequence ID from the original command. */
18979         uint16_t        seq_id;
18980         /* The length of the response data in number of bytes. */
18981         uint16_t        resp_len;
18982         uint8_t unused_0[7];
18983         /*
18984          * This field is used in Output records to indicate that the output
18985          * is completely written to RAM.  This field should be read as '1'
18986          * to indicate that the output has been completely written.
18987          * When writing a command completion or response to an internal processor,
18988          * the order of writes has to be such that this field is written last.
18989          */
18990         uint8_t valid;
18991 } __attribute__((packed));
18992
18993 /******************
18994  * hwrm_vnic_qcfg *
18995  ******************/
18996
18997
18998 /* hwrm_vnic_qcfg_input (size:256b/32B) */
18999 struct hwrm_vnic_qcfg_input {
19000         /* The HWRM command request type. */
19001         uint16_t        req_type;
19002         /*
19003          * The completion ring to send the completion event on. This should
19004          * be the NQ ID returned from the `nq_alloc` HWRM command.
19005          */
19006         uint16_t        cmpl_ring;
19007         /*
19008          * The sequence ID is used by the driver for tracking multiple
19009          * commands. This ID is treated as opaque data by the firmware and
19010          * the value is returned in the `hwrm_resp_hdr` upon completion.
19011          */
19012         uint16_t        seq_id;
19013         /*
19014          * The target ID of the command:
19015          * * 0x0-0xFFF8 - The function ID
19016          * * 0xFFF8-0xFFFE - Reserved for internal processors
19017          * * 0xFFFF - HWRM
19018          */
19019         uint16_t        target_id;
19020         /*
19021          * A physical address pointer pointing to a host buffer that the
19022          * command's response data will be written. This can be either a host
19023          * physical address (HPA) or a guest physical address (GPA) and must
19024          * point to a physically contiguous block of memory.
19025          */
19026         uint64_t        resp_addr;
19027         uint32_t        enables;
19028         /*
19029          * This bit must be '1' for the vf_id_valid field to be
19030          * configured.
19031          */
19032         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
19033         /* Logical vnic ID */
19034         uint32_t        vnic_id;
19035         /* ID of Virtual Function whose VNIC resource is being queried. */
19036         uint16_t        vf_id;
19037         uint8_t unused_0[6];
19038 } __attribute__((packed));
19039
19040 /* hwrm_vnic_qcfg_output (size:256b/32B) */
19041 struct hwrm_vnic_qcfg_output {
19042         /* The specific error status for the command. */
19043         uint16_t        error_code;
19044         /* The HWRM command request type. */
19045         uint16_t        req_type;
19046         /* The sequence ID from the original command. */
19047         uint16_t        seq_id;
19048         /* The length of the response data in number of bytes. */
19049         uint16_t        resp_len;
19050         /* Default Completion ring for the VNIC. */
19051         uint16_t        dflt_ring_grp;
19052         /*
19053          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
19054          * there is no RSS rule.
19055          */
19056         uint16_t        rss_rule;
19057         /*
19058          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
19059          * there is no COS rule.
19060          */
19061         uint16_t        cos_rule;
19062         /*
19063          * RSS ID for load balancing rule/table structure.
19064          * 0xFF... (All Fs) if there is no LB rule.
19065          */
19066         uint16_t        lb_rule;
19067         /* The maximum receive unit of the vnic. */
19068         uint16_t        mru;
19069         uint8_t unused_0[2];
19070         uint32_t        flags;
19071         /*
19072          * When this bit is '1', the VNIC is the default VNIC for
19073          * the function.
19074          */
19075         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
19076                 UINT32_C(0x1)
19077         /*
19078          * When this bit is '1', the VNIC is configured to
19079          * strip VLAN in the RX path.
19080          * If set to '0', then VLAN stripping is disabled on
19081          * this VNIC.
19082          */
19083         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
19084                 UINT32_C(0x2)
19085         /*
19086          * When this bit is '1', the VNIC is configured to
19087          * buffer receive packets in the hardware until the host
19088          * posts new receive buffers.
19089          * If set to '0', then bd_stall is disabled on
19090          * this VNIC.
19091          */
19092         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
19093                 UINT32_C(0x4)
19094         /*
19095          * When this bit is '1', the VNIC is configured to
19096          * receive both RoCE and non-RoCE traffic.
19097          * If set to '0', then this VNIC is not configured to
19098          * operate in dual VNIC mode.
19099          */
19100         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
19101                 UINT32_C(0x8)
19102         /*
19103          * When this flag is set to '1', the VNIC is configured to
19104          * receive only RoCE traffic.
19105          * When this flag is set to '0', the VNIC is not configured
19106          * to receive only RoCE traffic.
19107          * If roce_dual_vnic_mode flag and this flag both are set
19108          * to '1', then it is an invalid configuration of the
19109          * VNIC. The HWRM should not allow that type of
19110          * mis-configuration by HWRM clients.
19111          */
19112         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
19113                 UINT32_C(0x10)
19114         /*
19115          * When a VNIC uses one destination ring group for certain
19116          * application (e.g. Receive Flow Steering) where
19117          * exact match is used to direct packets to a VNIC with one
19118          * destination ring group only, there is no need to configure
19119          * RSS indirection table for that VNIC as only one destination
19120          * ring group is used.
19121          *
19122          * When this bit is set to '1', then the VNIC is enabled in a
19123          * mode where RSS is enabled in the VNIC using a RSS context
19124          * for computing RSS hash but the RSS indirection table is
19125          * not configured.
19126          */
19127         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
19128                 UINT32_C(0x20)
19129         /*
19130          * When this bit is '1', the VNIC is configured to
19131          * receive both RoCE and non-RoCE traffic, but forward only
19132          * RoCE traffic further. Also RoCE traffic can be mirrored to
19133          * L2 driver.
19134          */
19135         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
19136                 UINT32_C(0x40)
19137         uint8_t unused_1[7];
19138         /*
19139          * This field is used in Output records to indicate that the output
19140          * is completely written to RAM.  This field should be read as '1'
19141          * to indicate that the output has been completely written.
19142          * When writing a command completion or response to an internal processor,
19143          * the order of writes has to be such that this field is written last.
19144          */
19145         uint8_t valid;
19146 } __attribute__((packed));
19147
19148 /*******************
19149  * hwrm_vnic_qcaps *
19150  *******************/
19151
19152
19153 /* hwrm_vnic_qcaps_input (size:192b/24B) */
19154 struct hwrm_vnic_qcaps_input {
19155         /* The HWRM command request type. */
19156         uint16_t        req_type;
19157         /*
19158          * The completion ring to send the completion event on. This should
19159          * be the NQ ID returned from the `nq_alloc` HWRM command.
19160          */
19161         uint16_t        cmpl_ring;
19162         /*
19163          * The sequence ID is used by the driver for tracking multiple
19164          * commands. This ID is treated as opaque data by the firmware and
19165          * the value is returned in the `hwrm_resp_hdr` upon completion.
19166          */
19167         uint16_t        seq_id;
19168         /*
19169          * The target ID of the command:
19170          * * 0x0-0xFFF8 - The function ID
19171          * * 0xFFF8-0xFFFE - Reserved for internal processors
19172          * * 0xFFFF - HWRM
19173          */
19174         uint16_t        target_id;
19175         /*
19176          * A physical address pointer pointing to a host buffer that the
19177          * command's response data will be written. This can be either a host
19178          * physical address (HPA) or a guest physical address (GPA) and must
19179          * point to a physically contiguous block of memory.
19180          */
19181         uint64_t        resp_addr;
19182         uint32_t        enables;
19183         uint8_t unused_0[4];
19184 } __attribute__((packed));
19185
19186 /* hwrm_vnic_qcaps_output (size:192b/24B) */
19187 struct hwrm_vnic_qcaps_output {
19188         /* The specific error status for the command. */
19189         uint16_t        error_code;
19190         /* The HWRM command request type. */
19191         uint16_t        req_type;
19192         /* The sequence ID from the original command. */
19193         uint16_t        seq_id;
19194         /* The length of the response data in number of bytes. */
19195         uint16_t        resp_len;
19196         /* The maximum receive unit that is settable on a vnic. */
19197         uint16_t        mru;
19198         uint8_t unused_0[2];
19199         uint32_t        flags;
19200         /* Unused. */
19201         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
19202                 UINT32_C(0x1)
19203         /*
19204          * When this bit is '1', the capability of stripping VLAN in
19205          * the RX path is supported on VNIC(s).
19206          * If set to '0', then VLAN stripping capability is
19207          * not supported on VNIC(s).
19208          */
19209         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
19210                 UINT32_C(0x2)
19211         /*
19212          * When this bit is '1', the capability to buffer receive
19213          * packets in the hardware until the host posts new receive buffers
19214          * is supported on VNIC(s).
19215          * If set to '0', then bd_stall capability is not supported
19216          * on VNIC(s).
19217          */
19218         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
19219                 UINT32_C(0x4)
19220         /*
19221          * When this bit is '1', the capability to
19222          * receive both RoCE and non-RoCE traffic on VNIC(s) is
19223          * supported.
19224          * If set to '0', then the capability to receive
19225          * both RoCE and non-RoCE traffic on VNIC(s) is
19226          * not supported.
19227          */
19228         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
19229                 UINT32_C(0x8)
19230         /*
19231          * When this bit is set to '1', the capability to configure
19232          * a VNIC to receive only RoCE traffic is supported.
19233          * When this flag is set to '0', the VNIC capability to
19234          * configure to receive only RoCE traffic is not supported.
19235          */
19236         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
19237                 UINT32_C(0x10)
19238         /*
19239          * When this bit is set to '1', then the capability to enable
19240          * a VNIC in a mode where RSS context without configuring
19241          * RSS indirection table is supported (for RSS hash computation).
19242          * When this bit is set to '0', then a VNIC can not be configured
19243          * with a mode to enable RSS context without configuring RSS
19244          * indirection table.
19245          */
19246         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
19247                 UINT32_C(0x20)
19248         /*
19249          * When this bit is '1', the capability to
19250          * mirror the the RoCE traffic is supported.
19251          * If set to '0', then the capability to mirror the
19252          * RoCE traffic is not supported.
19253          */
19254         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
19255                 UINT32_C(0x40)
19256         /*
19257          * When this bit is '1', the outermost RSS hashing capability
19258          * is supported. If set to '0', then the outermost RSS hashing
19259          * capability is not supported.
19260          */
19261         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
19262                 UINT32_C(0x80)
19263         uint8_t unused_1[7];
19264         /*
19265          * This field is used in Output records to indicate that the output
19266          * is completely written to RAM.  This field should be read as '1'
19267          * to indicate that the output has been completely written.
19268          * When writing a command completion or response to an internal processor,
19269          * the order of writes has to be such that this field is written last.
19270          */
19271         uint8_t valid;
19272 } __attribute__((packed));
19273
19274 /*********************
19275  * hwrm_vnic_tpa_cfg *
19276  *********************/
19277
19278
19279 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
19280 struct hwrm_vnic_tpa_cfg_input {
19281         /* The HWRM command request type. */
19282         uint16_t        req_type;
19283         /*
19284          * The completion ring to send the completion event on. This should
19285          * be the NQ ID returned from the `nq_alloc` HWRM command.
19286          */
19287         uint16_t        cmpl_ring;
19288         /*
19289          * The sequence ID is used by the driver for tracking multiple
19290          * commands. This ID is treated as opaque data by the firmware and
19291          * the value is returned in the `hwrm_resp_hdr` upon completion.
19292          */
19293         uint16_t        seq_id;
19294         /*
19295          * The target ID of the command:
19296          * * 0x0-0xFFF8 - The function ID
19297          * * 0xFFF8-0xFFFE - Reserved for internal processors
19298          * * 0xFFFF - HWRM
19299          */
19300         uint16_t        target_id;
19301         /*
19302          * A physical address pointer pointing to a host buffer that the
19303          * command's response data will be written. This can be either a host
19304          * physical address (HPA) or a guest physical address (GPA) and must
19305          * point to a physically contiguous block of memory.
19306          */
19307         uint64_t        resp_addr;
19308         uint32_t        flags;
19309         /*
19310          * When this bit is '1', the VNIC shall be configured to
19311          * perform transparent packet aggregation (TPA) of
19312          * non-tunneled TCP packets.
19313          */
19314         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
19315                 UINT32_C(0x1)
19316         /*
19317          * When this bit is '1', the VNIC shall be configured to
19318          * perform transparent packet aggregation (TPA) of
19319          * tunneled TCP packets.
19320          */
19321         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
19322                 UINT32_C(0x2)
19323         /*
19324          * When this bit is '1', the VNIC shall be configured to
19325          * perform transparent packet aggregation (TPA) according
19326          * to Windows Receive Segment Coalescing (RSC) rules.
19327          */
19328         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
19329                 UINT32_C(0x4)
19330         /*
19331          * When this bit is '1', the VNIC shall be configured to
19332          * perform transparent packet aggregation (TPA) according
19333          * to Linux Generic Receive Offload (GRO) rules.
19334          */
19335         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
19336                 UINT32_C(0x8)
19337         /*
19338          * When this bit is '1', the VNIC shall be configured to
19339          * perform transparent packet aggregation (TPA) for TCP
19340          * packets with IP ECN set to non-zero.
19341          */
19342         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
19343                 UINT32_C(0x10)
19344         /*
19345          * When this bit is '1', the VNIC shall be configured to
19346          * perform transparent packet aggregation (TPA) for
19347          * GRE tunneled TCP packets only if all packets have the
19348          * same GRE sequence.
19349          */
19350         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
19351                 UINT32_C(0x20)
19352         /*
19353          * When this bit is '1' and the GRO mode is enabled,
19354          * the VNIC shall be configured to
19355          * perform transparent packet aggregation (TPA) for
19356          * TCP/IPv4 packets with consecutively increasing IPIDs.
19357          * In other words, the last packet that is being
19358          * aggregated to an already existing aggregation context
19359          * shall have IPID 1 more than the IPID of the last packet
19360          * that was aggregated in that aggregation context.
19361          */
19362         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
19363                 UINT32_C(0x40)
19364         /*
19365          * When this bit is '1' and the GRO mode is enabled,
19366          * the VNIC shall be configured to
19367          * perform transparent packet aggregation (TPA) for
19368          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
19369          * value.
19370          */
19371         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
19372                 UINT32_C(0x80)
19373         uint32_t        enables;
19374         /*
19375          * This bit must be '1' for the max_agg_segs field to be
19376          * configured.
19377          */
19378         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
19379         /*
19380          * This bit must be '1' for the max_aggs field to be
19381          * configured.
19382          */
19383         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
19384         /*
19385          * This bit must be '1' for the max_agg_timer field to be
19386          * configured.
19387          */
19388         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
19389         /*
19390          * This bit must be '1' for the min_agg_len field to be
19391          * configured.
19392          */
19393         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
19394         /* Logical vnic ID */
19395         uint16_t        vnic_id;
19396         /*
19397          * This is the maximum number of TCP segments that can
19398          * be aggregated (unit is Log2). Max value is 31.
19399          */
19400         uint16_t        max_agg_segs;
19401         /* 1 segment */
19402         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
19403         /* 2 segments */
19404         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
19405         /* 4 segments */
19406         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
19407         /* 8 segments */
19408         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
19409         /* Any segment size larger than this is not valid */
19410         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
19411         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
19412                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
19413         /*
19414          * This is the maximum number of aggregations this VNIC is
19415          * allowed (unit is Log2). Max value is 7
19416          */
19417         uint16_t        max_aggs;
19418         /* 1 aggregation */
19419         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
19420         /* 2 aggregations */
19421         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
19422         /* 4 aggregations */
19423         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
19424         /* 8 aggregations */
19425         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
19426         /* 16 aggregations */
19427         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
19428         /* Any aggregation size larger than this is not valid */
19429         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
19430         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
19431                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
19432         uint8_t unused_0[2];
19433         /*
19434          * This is the maximum amount of time allowed for
19435          * an aggregation context to complete after it was initiated.
19436          */
19437         uint32_t        max_agg_timer;
19438         /*
19439          * This is the minimum amount of payload length required to
19440          * start an aggregation context.
19441          */
19442         uint32_t        min_agg_len;
19443 } __attribute__((packed));
19444
19445 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
19446 struct hwrm_vnic_tpa_cfg_output {
19447         /* The specific error status for the command. */
19448         uint16_t        error_code;
19449         /* The HWRM command request type. */
19450         uint16_t        req_type;
19451         /* The sequence ID from the original command. */
19452         uint16_t        seq_id;
19453         /* The length of the response data in number of bytes. */
19454         uint16_t        resp_len;
19455         uint8_t unused_0[7];
19456         /*
19457          * This field is used in Output records to indicate that the output
19458          * is completely written to RAM.  This field should be read as '1'
19459          * to indicate that the output has been completely written.
19460          * When writing a command completion or response to an internal processor,
19461          * the order of writes has to be such that this field is written last.
19462          */
19463         uint8_t valid;
19464 } __attribute__((packed));
19465
19466 /*********************
19467  * hwrm_vnic_rss_cfg *
19468  *********************/
19469
19470
19471 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
19472 struct hwrm_vnic_rss_cfg_input {
19473         /* The HWRM command request type. */
19474         uint16_t        req_type;
19475         /*
19476          * The completion ring to send the completion event on. This should
19477          * be the NQ ID returned from the `nq_alloc` HWRM command.
19478          */
19479         uint16_t        cmpl_ring;
19480         /*
19481          * The sequence ID is used by the driver for tracking multiple
19482          * commands. This ID is treated as opaque data by the firmware and
19483          * the value is returned in the `hwrm_resp_hdr` upon completion.
19484          */
19485         uint16_t        seq_id;
19486         /*
19487          * The target ID of the command:
19488          * * 0x0-0xFFF8 - The function ID
19489          * * 0xFFF8-0xFFFE - Reserved for internal processors
19490          * * 0xFFFF - HWRM
19491          */
19492         uint16_t        target_id;
19493         /*
19494          * A physical address pointer pointing to a host buffer that the
19495          * command's response data will be written. This can be either a host
19496          * physical address (HPA) or a guest physical address (GPA) and must
19497          * point to a physically contiguous block of memory.
19498          */
19499         uint64_t        resp_addr;
19500         uint32_t        hash_type;
19501         /*
19502          * When this bit is '1', the RSS hash shall be computed
19503          * over source and destination IPv4 addresses of IPv4
19504          * packets.
19505          */
19506         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
19507         /*
19508          * When this bit is '1', the RSS hash shall be computed
19509          * over source/destination IPv4 addresses and
19510          * source/destination ports of TCP/IPv4 packets.
19511          */
19512         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
19513         /*
19514          * When this bit is '1', the RSS hash shall be computed
19515          * over source/destination IPv4 addresses and
19516          * source/destination ports of UDP/IPv4 packets.
19517          */
19518         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
19519         /*
19520          * When this bit is '1', the RSS hash shall be computed
19521          * over source and destination IPv4 addresses of IPv6
19522          * packets.
19523          */
19524         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
19525         /*
19526          * When this bit is '1', the RSS hash shall be computed
19527          * over source/destination IPv6 addresses and
19528          * source/destination ports of TCP/IPv6 packets.
19529          */
19530         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
19531         /*
19532          * When this bit is '1', the RSS hash shall be computed
19533          * over source/destination IPv6 addresses and
19534          * source/destination ports of UDP/IPv6 packets.
19535          */
19536         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
19537         /* VNIC ID of VNIC associated with RSS table being configured. */
19538         uint16_t        vnic_id;
19539         /*
19540          * Specifies which VNIC ring table pair to configure.
19541          * Valid values range from 0 to 7.
19542          */
19543         uint8_t ring_table_pair_index;
19544         /* Flags to specify different RSS hash modes. */
19545         uint8_t hash_mode_flags;
19546         /*
19547          * When this bit is '1', it indicates using current RSS
19548          * hash mode setting configured in the device.
19549          */
19550         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
19551                 UINT32_C(0x1)
19552         /*
19553          * When this bit is '1', it indicates requesting support of
19554          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
19555          * l4.src, l4.dest} for tunnel packets. For none-tunnel
19556          * packets, the RSS hash is computed over the normal
19557          * src/dest l3 and src/dest l4 headers.
19558          */
19559         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
19560                 UINT32_C(0x2)
19561         /*
19562          * When this bit is '1', it indicates requesting support of
19563          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
19564          * tunnel packets. For none-tunnel packets, the RSS hash is
19565          * computed over the normal src/dest l3 headers.
19566          */
19567         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
19568                 UINT32_C(0x4)
19569         /*
19570          * When this bit is '1', it indicates requesting support of
19571          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
19572          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
19573          * packets, the RSS hash is computed over the normal
19574          * src/dest l3 and src/dest l4 headers.
19575          */
19576         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
19577                 UINT32_C(0x8)
19578         /*
19579          * When this bit is '1', it indicates requesting support of
19580          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
19581          * tunnel packets. For none-tunnel packets, the RSS hash is
19582          * computed over the normal src/dest l3 headers.
19583          */
19584         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
19585                 UINT32_C(0x10)
19586         /* This is the address for rss ring group table */
19587         uint64_t        ring_grp_tbl_addr;
19588         /* This is the address for rss hash key table */
19589         uint64_t        hash_key_tbl_addr;
19590         /* Index to the rss indirection table. */
19591         uint16_t        rss_ctx_idx;
19592         uint8_t unused_1[6];
19593 } __attribute__((packed));
19594
19595 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
19596 struct hwrm_vnic_rss_cfg_output {
19597         /* The specific error status for the command. */
19598         uint16_t        error_code;
19599         /* The HWRM command request type. */
19600         uint16_t        req_type;
19601         /* The sequence ID from the original command. */
19602         uint16_t        seq_id;
19603         /* The length of the response data in number of bytes. */
19604         uint16_t        resp_len;
19605         uint8_t unused_0[7];
19606         /*
19607          * This field is used in Output records to indicate that the output
19608          * is completely written to RAM.  This field should be read as '1'
19609          * to indicate that the output has been completely written.
19610          * When writing a command completion or response to an internal processor,
19611          * the order of writes has to be such that this field is written last.
19612          */
19613         uint8_t valid;
19614 } __attribute__((packed));
19615
19616 /**********************
19617  * hwrm_vnic_rss_qcfg *
19618  **********************/
19619
19620
19621 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
19622 struct hwrm_vnic_rss_qcfg_input {
19623         /* The HWRM command request type. */
19624         uint16_t        req_type;
19625         /*
19626          * The completion ring to send the completion event on. This should
19627          * be the NQ ID returned from the `nq_alloc` HWRM command.
19628          */
19629         uint16_t        cmpl_ring;
19630         /*
19631          * The sequence ID is used by the driver for tracking multiple
19632          * commands. This ID is treated as opaque data by the firmware and
19633          * the value is returned in the `hwrm_resp_hdr` upon completion.
19634          */
19635         uint16_t        seq_id;
19636         /*
19637          * The target ID of the command:
19638          * * 0x0-0xFFF8 - The function ID
19639          * * 0xFFF8-0xFFFE - Reserved for internal processors
19640          * * 0xFFFF - HWRM
19641          */
19642         uint16_t        target_id;
19643         /*
19644          * A physical address pointer pointing to a host buffer that the
19645          * command's response data will be written. This can be either a host
19646          * physical address (HPA) or a guest physical address (GPA) and must
19647          * point to a physically contiguous block of memory.
19648          */
19649         uint64_t        resp_addr;
19650         /* Index to the rss indirection table. */
19651         uint16_t        rss_ctx_idx;
19652         uint8_t unused_0[6];
19653 } __attribute__((packed));
19654
19655 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
19656 struct hwrm_vnic_rss_qcfg_output {
19657         /* The specific error status for the command. */
19658         uint16_t        error_code;
19659         /* The HWRM command request type. */
19660         uint16_t        req_type;
19661         /* The sequence ID from the original command. */
19662         uint16_t        seq_id;
19663         /* The length of the response data in number of bytes. */
19664         uint16_t        resp_len;
19665         uint32_t        hash_type;
19666         /*
19667          * When this bit is '1', the RSS hash shall be computed
19668          * over source and destination IPv4 addresses of IPv4
19669          * packets.
19670          */
19671         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
19672         /*
19673          * When this bit is '1', the RSS hash shall be computed
19674          * over source/destination IPv4 addresses and
19675          * source/destination ports of TCP/IPv4 packets.
19676          */
19677         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
19678         /*
19679          * When this bit is '1', the RSS hash shall be computed
19680          * over source/destination IPv4 addresses and
19681          * source/destination ports of UDP/IPv4 packets.
19682          */
19683         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
19684         /*
19685          * When this bit is '1', the RSS hash shall be computed
19686          * over source and destination IPv4 addresses of IPv6
19687          * packets.
19688          */
19689         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
19690         /*
19691          * When this bit is '1', the RSS hash shall be computed
19692          * over source/destination IPv6 addresses and
19693          * source/destination ports of TCP/IPv6 packets.
19694          */
19695         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
19696         /*
19697          * When this bit is '1', the RSS hash shall be computed
19698          * over source/destination IPv6 addresses and
19699          * source/destination ports of UDP/IPv6 packets.
19700          */
19701         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
19702         uint8_t unused_0[4];
19703         /* This is the value of rss hash key */
19704         uint32_t        hash_key[10];
19705         /* Flags to specify different RSS hash modes. */
19706         uint8_t hash_mode_flags;
19707         /*
19708          * When this bit is '1', it indicates using current RSS
19709          * hash mode setting configured in the device.
19710          */
19711         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
19712                 UINT32_C(0x1)
19713         /*
19714          * When this bit is '1', it indicates requesting support of
19715          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
19716          * l4.src, l4.dest} for tunnel packets. For none-tunnel
19717          * packets, the RSS hash is computed over the normal
19718          * src/dest l3 and src/dest l4 headers.
19719          */
19720         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
19721                 UINT32_C(0x2)
19722         /*
19723          * When this bit is '1', it indicates requesting support of
19724          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
19725          * tunnel packets. For none-tunnel packets, the RSS hash is
19726          * computed over the normal src/dest l3 headers.
19727          */
19728         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
19729                 UINT32_C(0x4)
19730         /*
19731          * When this bit is '1', it indicates requesting support of
19732          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
19733          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
19734          * packets, the RSS hash is computed over the normal
19735          * src/dest l3 and src/dest l4 headers.
19736          */
19737         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
19738                 UINT32_C(0x8)
19739         /*
19740          * When this bit is '1', it indicates requesting support of
19741          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
19742          * tunnel packets. For none-tunnel packets, the RSS hash is
19743          * computed over the normal src/dest l3 headers.
19744          */
19745         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
19746                 UINT32_C(0x10)
19747         uint8_t unused_1[6];
19748         /*
19749          * This field is used in Output records to indicate that the output
19750          * is completely written to RAM.  This field should be read as '1'
19751          * to indicate that the output has been completely written.
19752          * When writing a command completion or response to an internal processor,
19753          * the order of writes has to be such that this field is written last.
19754          */
19755         uint8_t valid;
19756 } __attribute__((packed));
19757
19758 /**************************
19759  * hwrm_vnic_plcmodes_cfg *
19760  **************************/
19761
19762
19763 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
19764 struct hwrm_vnic_plcmodes_cfg_input {
19765         /* The HWRM command request type. */
19766         uint16_t        req_type;
19767         /*
19768          * The completion ring to send the completion event on. This should
19769          * be the NQ ID returned from the `nq_alloc` HWRM command.
19770          */
19771         uint16_t        cmpl_ring;
19772         /*
19773          * The sequence ID is used by the driver for tracking multiple
19774          * commands. This ID is treated as opaque data by the firmware and
19775          * the value is returned in the `hwrm_resp_hdr` upon completion.
19776          */
19777         uint16_t        seq_id;
19778         /*
19779          * The target ID of the command:
19780          * * 0x0-0xFFF8 - The function ID
19781          * * 0xFFF8-0xFFFE - Reserved for internal processors
19782          * * 0xFFFF - HWRM
19783          */
19784         uint16_t        target_id;
19785         /*
19786          * A physical address pointer pointing to a host buffer that the
19787          * command's response data will be written. This can be either a host
19788          * physical address (HPA) or a guest physical address (GPA) and must
19789          * point to a physically contiguous block of memory.
19790          */
19791         uint64_t        resp_addr;
19792         uint32_t        flags;
19793         /*
19794          * When this bit is '1', the VNIC shall be configured to
19795          * use regular placement algorithm.
19796          * By default, the regular placement algorithm shall be
19797          * enabled on the VNIC.
19798          */
19799         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
19800                 UINT32_C(0x1)
19801         /*
19802          * When this bit is '1', the VNIC shall be configured
19803          * use the jumbo placement algorithm.
19804          */
19805         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
19806                 UINT32_C(0x2)
19807         /*
19808          * When this bit is '1', the VNIC shall be configured
19809          * to enable Header-Data split for IPv4 packets according
19810          * to the following rules:
19811          * # If the packet is identified as TCP/IPv4, then the
19812          * packet is split at the beginning of the TCP payload.
19813          * # If the packet is identified as UDP/IPv4, then the
19814          * packet is split at the beginning of UDP payload.
19815          * # If the packet is identified as non-TCP and non-UDP
19816          * IPv4 packet, then the packet is split at the beginning
19817          * of the upper layer protocol header carried in the IPv4
19818          * packet.
19819          */
19820         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
19821                 UINT32_C(0x4)
19822         /*
19823          * When this bit is '1', the VNIC shall be configured
19824          * to enable Header-Data split for IPv6 packets according
19825          * to the following rules:
19826          * # If the packet is identified as TCP/IPv6, then the
19827          * packet is split at the beginning of the TCP payload.
19828          * # If the packet is identified as UDP/IPv6, then the
19829          * packet is split at the beginning of UDP payload.
19830          * # If the packet is identified as non-TCP and non-UDP
19831          * IPv6 packet, then the packet is split at the beginning
19832          * of the upper layer protocol header carried in the IPv6
19833          * packet.
19834          */
19835         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
19836                 UINT32_C(0x8)
19837         /*
19838          * When this bit is '1', the VNIC shall be configured
19839          * to enable Header-Data split for FCoE packets at the
19840          * beginning of FC payload.
19841          */
19842         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
19843                 UINT32_C(0x10)
19844         /*
19845          * When this bit is '1', the VNIC shall be configured
19846          * to enable Header-Data split for RoCE packets at the
19847          * beginning of RoCE payload (after BTH/GRH headers).
19848          */
19849         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
19850                 UINT32_C(0x20)
19851         uint32_t        enables;
19852         /*
19853          * This bit must be '1' for the jumbo_thresh_valid field to be
19854          * configured.
19855          */
19856         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
19857                 UINT32_C(0x1)
19858         /*
19859          * This bit must be '1' for the hds_offset_valid field to be
19860          * configured.
19861          */
19862         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
19863                 UINT32_C(0x2)
19864         /*
19865          * This bit must be '1' for the hds_threshold_valid field to be
19866          * configured.
19867          */
19868         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
19869                 UINT32_C(0x4)
19870         /* Logical vnic ID */
19871         uint32_t        vnic_id;
19872         /*
19873          * When jumbo placement algorithm is enabled, this value
19874          * is used to determine the threshold for jumbo placement.
19875          * Packets with length larger than this value will be
19876          * placed according to the jumbo placement algorithm.
19877          */
19878         uint16_t        jumbo_thresh;
19879         /*
19880          * This value is used to determine the offset into
19881          * packet buffer where the split data (payload) will be
19882          * placed according to one of of HDS placement algorithm.
19883          *
19884          * The lengths of packet buffers provided for split data
19885          * shall be larger than this value.
19886          */
19887         uint16_t        hds_offset;
19888         /*
19889          * When one of the HDS placement algorithm is enabled, this
19890          * value is used to determine the threshold for HDS
19891          * placement.
19892          * Packets with length larger than this value will be
19893          * placed according to the HDS placement algorithm.
19894          * This value shall be in multiple of 4 bytes.
19895          */
19896         uint16_t        hds_threshold;
19897         uint8_t unused_0[6];
19898 } __attribute__((packed));
19899
19900 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
19901 struct hwrm_vnic_plcmodes_cfg_output {
19902         /* The specific error status for the command. */
19903         uint16_t        error_code;
19904         /* The HWRM command request type. */
19905         uint16_t        req_type;
19906         /* The sequence ID from the original command. */
19907         uint16_t        seq_id;
19908         /* The length of the response data in number of bytes. */
19909         uint16_t        resp_len;
19910         uint8_t unused_0[7];
19911         /*
19912          * This field is used in Output records to indicate that the output
19913          * is completely written to RAM.  This field should be read as '1'
19914          * to indicate that the output has been completely written.
19915          * When writing a command completion or response to an internal processor,
19916          * the order of writes has to be such that this field is written last.
19917          */
19918         uint8_t valid;
19919 } __attribute__((packed));
19920
19921 /***************************
19922  * hwrm_vnic_plcmodes_qcfg *
19923  ***************************/
19924
19925
19926 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
19927 struct hwrm_vnic_plcmodes_qcfg_input {
19928         /* The HWRM command request type. */
19929         uint16_t        req_type;
19930         /*
19931          * The completion ring to send the completion event on. This should
19932          * be the NQ ID returned from the `nq_alloc` HWRM command.
19933          */
19934         uint16_t        cmpl_ring;
19935         /*
19936          * The sequence ID is used by the driver for tracking multiple
19937          * commands. This ID is treated as opaque data by the firmware and
19938          * the value is returned in the `hwrm_resp_hdr` upon completion.
19939          */
19940         uint16_t        seq_id;
19941         /*
19942          * The target ID of the command:
19943          * * 0x0-0xFFF8 - The function ID
19944          * * 0xFFF8-0xFFFE - Reserved for internal processors
19945          * * 0xFFFF - HWRM
19946          */
19947         uint16_t        target_id;
19948         /*
19949          * A physical address pointer pointing to a host buffer that the
19950          * command's response data will be written. This can be either a host
19951          * physical address (HPA) or a guest physical address (GPA) and must
19952          * point to a physically contiguous block of memory.
19953          */
19954         uint64_t        resp_addr;
19955         /* Logical vnic ID */
19956         uint32_t        vnic_id;
19957         uint8_t unused_0[4];
19958 } __attribute__((packed));
19959
19960 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
19961 struct hwrm_vnic_plcmodes_qcfg_output {
19962         /* The specific error status for the command. */
19963         uint16_t        error_code;
19964         /* The HWRM command request type. */
19965         uint16_t        req_type;
19966         /* The sequence ID from the original command. */
19967         uint16_t        seq_id;
19968         /* The length of the response data in number of bytes. */
19969         uint16_t        resp_len;
19970         uint32_t        flags;
19971         /*
19972          * When this bit is '1', the VNIC is configured to
19973          * use regular placement algorithm.
19974          */
19975         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
19976                 UINT32_C(0x1)
19977         /*
19978          * When this bit is '1', the VNIC is configured to
19979          * use the jumbo placement algorithm.
19980          */
19981         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
19982                 UINT32_C(0x2)
19983         /*
19984          * When this bit is '1', the VNIC is configured
19985          * to enable Header-Data split for IPv4 packets.
19986          */
19987         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
19988                 UINT32_C(0x4)
19989         /*
19990          * When this bit is '1', the VNIC is configured
19991          * to enable Header-Data split for IPv6 packets.
19992          */
19993         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
19994                 UINT32_C(0x8)
19995         /*
19996          * When this bit is '1', the VNIC is configured
19997          * to enable Header-Data split for FCoE packets.
19998          */
19999         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
20000                 UINT32_C(0x10)
20001         /*
20002          * When this bit is '1', the VNIC is configured
20003          * to enable Header-Data split for RoCE packets.
20004          */
20005         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
20006                 UINT32_C(0x20)
20007         /*
20008          * When this bit is '1', the VNIC is configured
20009          * to be the default VNIC of the requesting function.
20010          */
20011         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
20012                 UINT32_C(0x40)
20013         /*
20014          * When jumbo placement algorithm is enabled, this value
20015          * is used to determine the threshold for jumbo placement.
20016          * Packets with length larger than this value will be
20017          * placed according to the jumbo placement algorithm.
20018          */
20019         uint16_t        jumbo_thresh;
20020         /*
20021          * This value is used to determine the offset into
20022          * packet buffer where the split data (payload) will be
20023          * placed according to one of of HDS placement algorithm.
20024          *
20025          * The lengths of packet buffers provided for split data
20026          * shall be larger than this value.
20027          */
20028         uint16_t        hds_offset;
20029         /*
20030          * When one of the HDS placement algorithm is enabled, this
20031          * value is used to determine the threshold for HDS
20032          * placement.
20033          * Packets with length larger than this value will be
20034          * placed according to the HDS placement algorithm.
20035          * This value shall be in multiple of 4 bytes.
20036          */
20037         uint16_t        hds_threshold;
20038         uint8_t unused_0[5];
20039         /*
20040          * This field is used in Output records to indicate that the output
20041          * is completely written to RAM.  This field should be read as '1'
20042          * to indicate that the output has been completely written.
20043          * When writing a command completion or response to an internal processor,
20044          * the order of writes has to be such that this field is written last.
20045          */
20046         uint8_t valid;
20047 } __attribute__((packed));
20048
20049 /**********************************
20050  * hwrm_vnic_rss_cos_lb_ctx_alloc *
20051  **********************************/
20052
20053
20054 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
20055 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
20056         /* The HWRM command request type. */
20057         uint16_t        req_type;
20058         /*
20059          * The completion ring to send the completion event on. This should
20060          * be the NQ ID returned from the `nq_alloc` HWRM command.
20061          */
20062         uint16_t        cmpl_ring;
20063         /*
20064          * The sequence ID is used by the driver for tracking multiple
20065          * commands. This ID is treated as opaque data by the firmware and
20066          * the value is returned in the `hwrm_resp_hdr` upon completion.
20067          */
20068         uint16_t        seq_id;
20069         /*
20070          * The target ID of the command:
20071          * * 0x0-0xFFF8 - The function ID
20072          * * 0xFFF8-0xFFFE - Reserved for internal processors
20073          * * 0xFFFF - HWRM
20074          */
20075         uint16_t        target_id;
20076         /*
20077          * A physical address pointer pointing to a host buffer that the
20078          * command's response data will be written. This can be either a host
20079          * physical address (HPA) or a guest physical address (GPA) and must
20080          * point to a physically contiguous block of memory.
20081          */
20082         uint64_t        resp_addr;
20083 } __attribute__((packed));
20084
20085 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
20086 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
20087         /* The specific error status for the command. */
20088         uint16_t        error_code;
20089         /* The HWRM command request type. */
20090         uint16_t        req_type;
20091         /* The sequence ID from the original command. */
20092         uint16_t        seq_id;
20093         /* The length of the response data in number of bytes. */
20094         uint16_t        resp_len;
20095         /* rss_cos_lb_ctx_id is 16 b */
20096         uint16_t        rss_cos_lb_ctx_id;
20097         uint8_t unused_0[5];
20098         /*
20099          * This field is used in Output records to indicate that the output
20100          * is completely written to RAM.  This field should be read as '1'
20101          * to indicate that the output has been completely written.
20102          * When writing a command completion or response to an internal processor,
20103          * the order of writes has to be such that this field is written last.
20104          */
20105         uint8_t valid;
20106 } __attribute__((packed));
20107
20108 /*********************************
20109  * hwrm_vnic_rss_cos_lb_ctx_free *
20110  *********************************/
20111
20112
20113 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
20114 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
20115         /* The HWRM command request type. */
20116         uint16_t        req_type;
20117         /*
20118          * The completion ring to send the completion event on. This should
20119          * be the NQ ID returned from the `nq_alloc` HWRM command.
20120          */
20121         uint16_t        cmpl_ring;
20122         /*
20123          * The sequence ID is used by the driver for tracking multiple
20124          * commands. This ID is treated as opaque data by the firmware and
20125          * the value is returned in the `hwrm_resp_hdr` upon completion.
20126          */
20127         uint16_t        seq_id;
20128         /*
20129          * The target ID of the command:
20130          * * 0x0-0xFFF8 - The function ID
20131          * * 0xFFF8-0xFFFE - Reserved for internal processors
20132          * * 0xFFFF - HWRM
20133          */
20134         uint16_t        target_id;
20135         /*
20136          * A physical address pointer pointing to a host buffer that the
20137          * command's response data will be written. This can be either a host
20138          * physical address (HPA) or a guest physical address (GPA) and must
20139          * point to a physically contiguous block of memory.
20140          */
20141         uint64_t        resp_addr;
20142         /* rss_cos_lb_ctx_id is 16 b */
20143         uint16_t        rss_cos_lb_ctx_id;
20144         uint8_t unused_0[6];
20145 } __attribute__((packed));
20146
20147 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
20148 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
20149         /* The specific error status for the command. */
20150         uint16_t        error_code;
20151         /* The HWRM command request type. */
20152         uint16_t        req_type;
20153         /* The sequence ID from the original command. */
20154         uint16_t        seq_id;
20155         /* The length of the response data in number of bytes. */
20156         uint16_t        resp_len;
20157         uint8_t unused_0[7];
20158         /*
20159          * This field is used in Output records to indicate that the output
20160          * is completely written to RAM.  This field should be read as '1'
20161          * to indicate that the output has been completely written.
20162          * When writing a command completion or response to an internal processor,
20163          * the order of writes has to be such that this field is written last.
20164          */
20165         uint8_t valid;
20166 } __attribute__((packed));
20167
20168 /*******************
20169  * hwrm_ring_alloc *
20170  *******************/
20171
20172
20173 /* hwrm_ring_alloc_input (size:704b/88B) */
20174 struct hwrm_ring_alloc_input {
20175         /* The HWRM command request type. */
20176         uint16_t        req_type;
20177         /*
20178          * The completion ring to send the completion event on. This should
20179          * be the NQ ID returned from the `nq_alloc` HWRM command.
20180          */
20181         uint16_t        cmpl_ring;
20182         /*
20183          * The sequence ID is used by the driver for tracking multiple
20184          * commands. This ID is treated as opaque data by the firmware and
20185          * the value is returned in the `hwrm_resp_hdr` upon completion.
20186          */
20187         uint16_t        seq_id;
20188         /*
20189          * The target ID of the command:
20190          * * 0x0-0xFFF8 - The function ID
20191          * * 0xFFF8-0xFFFE - Reserved for internal processors
20192          * * 0xFFFF - HWRM
20193          */
20194         uint16_t        target_id;
20195         /*
20196          * A physical address pointer pointing to a host buffer that the
20197          * command's response data will be written. This can be either a host
20198          * physical address (HPA) or a guest physical address (GPA) and must
20199          * point to a physically contiguous block of memory.
20200          */
20201         uint64_t        resp_addr;
20202         uint32_t        enables;
20203         /*
20204          * This bit must be '1' for the ring_arb_cfg field to be
20205          * configured.
20206          */
20207         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
20208                 UINT32_C(0x2)
20209         /*
20210          * This bit must be '1' for the stat_ctx_id_valid field to be
20211          * configured.
20212          */
20213         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
20214                 UINT32_C(0x8)
20215         /*
20216          * This bit must be '1' for the max_bw_valid field to be
20217          * configured.
20218          */
20219         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
20220                 UINT32_C(0x20)
20221         /*
20222          * This bit must be '1' for the rx_ring_id field to be
20223          * configured.
20224          */
20225         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
20226                 UINT32_C(0x40)
20227         /*
20228          * This bit must be '1' for the nq_ring_id field to be
20229          * configured.
20230          */
20231         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
20232                 UINT32_C(0x80)
20233         /*
20234          * This bit must be '1' for the rx_buf_size field to be
20235          * configured.
20236          */
20237         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
20238                 UINT32_C(0x100)
20239         /* Ring Type. */
20240         uint8_t ring_type;
20241         /* L2 Completion Ring (CR) */
20242         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
20243         /* TX Ring (TR) */
20244         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
20245         /* RX Ring (RR) */
20246         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
20247         /* RoCE Notification Completion Ring (ROCE_CR) */
20248         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
20249         /* RX Aggregation Ring */
20250         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
20251         /* Notification Queue */
20252         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
20253         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
20254                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
20255         uint8_t unused_0;
20256         /* Ring allocation flags. */
20257         uint16_t        flags;
20258         /*
20259          * For Rx rings, the incoming packet data can be placed at either
20260          * a 0B or 2B offset from the start of the Rx packet buffer. When
20261          * '1', the received packet will be padded with 2B of zeros at the
20262          * front of the packet. Note that this flag is only used for
20263          * Rx rings and is ignored for all other rings included Rx
20264          * Aggregation rings.
20265          */
20266         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
20267         /*
20268          * This value is a pointer to the page table for the
20269          * Ring.
20270          */
20271         uint64_t        page_tbl_addr;
20272         /* First Byte Offset of the first entry in the first page. */
20273         uint32_t        fbo;
20274         /*
20275          * Actual page size in 2^page_size. The supported range is increments
20276          * in powers of 2 from 16 bytes to 1GB.
20277          * - 4 = 16 B
20278          *     Page size is 16 B.
20279          * - 12 = 4 KB
20280          *     Page size is 4 KB.
20281          * - 13 = 8 KB
20282          *     Page size is 8 KB.
20283          * - 16 = 64 KB
20284          *     Page size is 64 KB.
20285          * - 21 = 2 MB
20286          *     Page size is 2 MB.
20287          * - 22 = 4 MB
20288          *     Page size is 4 MB.
20289          * - 30 = 1 GB
20290          *     Page size is 1 GB.
20291          */
20292         uint8_t page_size;
20293         /*
20294          * This value indicates the depth of page table.
20295          * For this version of the specification, value other than 0 or
20296          * 1 shall be considered as an invalid value.
20297          * When the page_tbl_depth = 0, then it is treated as a
20298          * special case with the following.
20299          * 1. FBO and page size fields are not valid.
20300          * 2. page_tbl_addr is the physical address of the first
20301          *    element of the ring.
20302          */
20303         uint8_t page_tbl_depth;
20304         uint8_t unused_1[2];
20305         /*
20306          * Number of 16B units in the ring.  Minimum size for
20307          * a ring is 16 16B entries.
20308          */
20309         uint32_t        length;
20310         /*
20311          * Logical ring number for the ring to be allocated.
20312          * This value determines the position in the doorbell
20313          * area where the update to the ring will be made.
20314          *
20315          * For completion rings, this value is also the MSI-X
20316          * vector number for the function the completion ring is
20317          * associated with.
20318          */
20319         uint16_t        logical_id;
20320         /*
20321          * This field is used only when ring_type is a TX ring.
20322          * This value indicates what completion ring the TX ring
20323          * is associated with.
20324          */
20325         uint16_t        cmpl_ring_id;
20326         /*
20327          * This field is used only when ring_type is a TX ring.
20328          * This value indicates what CoS queue the TX ring
20329          * is associated with.
20330          */
20331         uint16_t        queue_id;
20332         /*
20333          * When allocating a Rx ring or Rx aggregation ring, this field
20334          * specifies the size of the buffer descriptors posted to the ring.
20335          */
20336         uint16_t        rx_buf_size;
20337         /*
20338          * When allocating an Rx aggregation ring, this field
20339          * specifies the associated Rx ring ID.
20340          */
20341         uint16_t        rx_ring_id;
20342         /*
20343          * When allocating a completion ring, this field
20344          * specifies the associated NQ ring ID.
20345          */
20346         uint16_t        nq_ring_id;
20347         /*
20348          * This field is used only when ring_type is a TX ring.
20349          * This field is used to configure arbitration related
20350          * parameters for a TX ring.
20351          */
20352         uint16_t        ring_arb_cfg;
20353         /* Arbitration policy used for the ring. */
20354         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
20355                 UINT32_C(0xf)
20356         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
20357         /*
20358          * Use strict priority for the TX ring.
20359          * Priority value is specified in arb_policy_param
20360          */
20361         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
20362                 UINT32_C(0x1)
20363         /*
20364          * Use weighted fair queue arbitration for the TX ring.
20365          * Weight is specified in arb_policy_param
20366          */
20367         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
20368                 UINT32_C(0x2)
20369         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
20370                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
20371         /* Reserved field. */
20372         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
20373                 UINT32_C(0xf0)
20374         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
20375         /*
20376          * Arbitration policy specific parameter.
20377          * # For strict priority arbitration policy, this field
20378          * represents a priority value. If set to 0, then the priority
20379          * is not specified and the HWRM is allowed to select
20380          * any priority for this TX ring.
20381          * # For weighted fair queue arbitration policy, this field
20382          * represents a weight value. If set to 0, then the weight
20383          * is not specified and the HWRM is allowed to select
20384          * any weight for this TX ring.
20385          */
20386         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
20387                 UINT32_C(0xff00)
20388         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
20389         uint16_t        unused_3;
20390         /*
20391          * This field is reserved for the future use.
20392          * It shall be set to 0.
20393          */
20394         uint32_t        reserved3;
20395         /*
20396          * This field is used only when ring_type is a TX ring.
20397          * This input indicates what statistics context this ring
20398          * should be associated with.
20399          */
20400         uint32_t        stat_ctx_id;
20401         /*
20402          * This field is reserved for the future use.
20403          * It shall be set to 0.
20404          */
20405         uint32_t        reserved4;
20406         /*
20407          * This field is used only when ring_type is a TX ring
20408          * to specify maximum BW allocated to the TX ring.
20409          * The HWRM will translate this value into byte counter and
20410          * time interval used for this ring inside the device.
20411          */
20412         uint32_t        max_bw;
20413         /* The bandwidth value. */
20414         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
20415                 UINT32_C(0xfffffff)
20416         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
20417         /* The granularity of the value (bits or bytes). */
20418         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
20419                 UINT32_C(0x10000000)
20420         /* Value is in bits. */
20421         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
20422                 (UINT32_C(0x0) << 28)
20423         /* Value is in bytes. */
20424         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
20425                 (UINT32_C(0x1) << 28)
20426         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
20427                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
20428         /* bw_value_unit is 3 b */
20429         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
20430                 UINT32_C(0xe0000000)
20431         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
20432         /* Value is in Mb or MB (base 10). */
20433         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
20434                 (UINT32_C(0x0) << 29)
20435         /* Value is in Kb or KB (base 10). */
20436         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
20437                 (UINT32_C(0x2) << 29)
20438         /* Value is in bits or bytes. */
20439         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
20440                 (UINT32_C(0x4) << 29)
20441         /* Value is in Gb or GB (base 10). */
20442         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
20443                 (UINT32_C(0x6) << 29)
20444         /* Value is in 1/100th of a percentage of total bandwidth. */
20445         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20446                 (UINT32_C(0x1) << 29)
20447         /* Invalid unit */
20448         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
20449                 (UINT32_C(0x7) << 29)
20450         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
20451                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
20452         /*
20453          * This field is used only when ring_type is a Completion ring.
20454          * This value indicates what interrupt mode should be used
20455          * on this completion ring.
20456          * Note: In the legacy interrupt mode, no more than 16
20457          * completion rings are allowed.
20458          */
20459         uint8_t int_mode;
20460         /* Legacy INTA */
20461         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
20462         /* Reserved */
20463         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
20464         /* MSI-X */
20465         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
20466         /* No Interrupt - Polled mode */
20467         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
20468         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
20469                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
20470         uint8_t unused_4[3];
20471         /*
20472          * The cq_handle is specified when allocating a completion ring. For
20473          * devices that support NQs, this cq_handle will be included in the
20474          * NQE to specify which CQ should be read to retrieve the completion
20475          * record.
20476          */
20477         uint64_t        cq_handle;
20478 } __attribute__((packed));
20479
20480 /* hwrm_ring_alloc_output (size:128b/16B) */
20481 struct hwrm_ring_alloc_output {
20482         /* The specific error status for the command. */
20483         uint16_t        error_code;
20484         /* The HWRM command request type. */
20485         uint16_t        req_type;
20486         /* The sequence ID from the original command. */
20487         uint16_t        seq_id;
20488         /* The length of the response data in number of bytes. */
20489         uint16_t        resp_len;
20490         /*
20491          * Physical number of ring allocated.
20492          * This value shall be unique for a ring type.
20493          */
20494         uint16_t        ring_id;
20495         /* Logical number of ring allocated. */
20496         uint16_t        logical_ring_id;
20497         uint8_t unused_0[3];
20498         /*
20499          * This field is used in Output records to indicate that the output
20500          * is completely written to RAM.  This field should be read as '1'
20501          * to indicate that the output has been completely written.
20502          * When writing a command completion or response to an internal processor,
20503          * the order of writes has to be such that this field is written last.
20504          */
20505         uint8_t valid;
20506 } __attribute__((packed));
20507
20508 /******************
20509  * hwrm_ring_free *
20510  ******************/
20511
20512
20513 /* hwrm_ring_free_input (size:192b/24B) */
20514 struct hwrm_ring_free_input {
20515         /* The HWRM command request type. */
20516         uint16_t        req_type;
20517         /*
20518          * The completion ring to send the completion event on. This should
20519          * be the NQ ID returned from the `nq_alloc` HWRM command.
20520          */
20521         uint16_t        cmpl_ring;
20522         /*
20523          * The sequence ID is used by the driver for tracking multiple
20524          * commands. This ID is treated as opaque data by the firmware and
20525          * the value is returned in the `hwrm_resp_hdr` upon completion.
20526          */
20527         uint16_t        seq_id;
20528         /*
20529          * The target ID of the command:
20530          * * 0x0-0xFFF8 - The function ID
20531          * * 0xFFF8-0xFFFE - Reserved for internal processors
20532          * * 0xFFFF - HWRM
20533          */
20534         uint16_t        target_id;
20535         /*
20536          * A physical address pointer pointing to a host buffer that the
20537          * command's response data will be written. This can be either a host
20538          * physical address (HPA) or a guest physical address (GPA) and must
20539          * point to a physically contiguous block of memory.
20540          */
20541         uint64_t        resp_addr;
20542         /* Ring Type. */
20543         uint8_t ring_type;
20544         /* L2 Completion Ring (CR) */
20545         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
20546         /* TX Ring (TR) */
20547         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
20548         /* RX Ring (RR) */
20549         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
20550         /* RoCE Notification Completion Ring (ROCE_CR) */
20551         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
20552         /* RX Aggregation Ring */
20553         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
20554         /* Notification Queue */
20555         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
20556         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
20557                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
20558         uint8_t unused_0;
20559         /* Physical number of ring allocated. */
20560         uint16_t        ring_id;
20561         uint8_t unused_1[4];
20562 } __attribute__((packed));
20563
20564 /* hwrm_ring_free_output (size:128b/16B) */
20565 struct hwrm_ring_free_output {
20566         /* The specific error status for the command. */
20567         uint16_t        error_code;
20568         /* The HWRM command request type. */
20569         uint16_t        req_type;
20570         /* The sequence ID from the original command. */
20571         uint16_t        seq_id;
20572         /* The length of the response data in number of bytes. */
20573         uint16_t        resp_len;
20574         uint8_t unused_0[7];
20575         /*
20576          * This field is used in Output records to indicate that the output
20577          * is completely written to RAM.  This field should be read as '1'
20578          * to indicate that the output has been completely written.
20579          * When writing a command completion or response to an internal processor,
20580          * the order of writes has to be such that this field is written last.
20581          */
20582         uint8_t valid;
20583 } __attribute__((packed));
20584
20585 /*******************
20586  * hwrm_ring_reset *
20587  *******************/
20588
20589
20590 /* hwrm_ring_reset_input (size:192b/24B) */
20591 struct hwrm_ring_reset_input {
20592         /* The HWRM command request type. */
20593         uint16_t        req_type;
20594         /*
20595          * The completion ring to send the completion event on. This should
20596          * be the NQ ID returned from the `nq_alloc` HWRM command.
20597          */
20598         uint16_t        cmpl_ring;
20599         /*
20600          * The sequence ID is used by the driver for tracking multiple
20601          * commands. This ID is treated as opaque data by the firmware and
20602          * the value is returned in the `hwrm_resp_hdr` upon completion.
20603          */
20604         uint16_t        seq_id;
20605         /*
20606          * The target ID of the command:
20607          * * 0x0-0xFFF8 - The function ID
20608          * * 0xFFF8-0xFFFE - Reserved for internal processors
20609          * * 0xFFFF - HWRM
20610          */
20611         uint16_t        target_id;
20612         /*
20613          * A physical address pointer pointing to a host buffer that the
20614          * command's response data will be written. This can be either a host
20615          * physical address (HPA) or a guest physical address (GPA) and must
20616          * point to a physically contiguous block of memory.
20617          */
20618         uint64_t        resp_addr;
20619         /* Ring Type. */
20620         uint8_t ring_type;
20621         /* L2 Completion Ring (CR) */
20622         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
20623         /* TX Ring (TR) */
20624         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX        UINT32_C(0x1)
20625         /* RX Ring (RR) */
20626         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX        UINT32_C(0x2)
20627         /* RoCE Notification Completion Ring (ROCE_CR) */
20628         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
20629         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
20630                 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL
20631         uint8_t unused_0;
20632         /* Physical number of the ring. */
20633         uint16_t        ring_id;
20634         uint8_t unused_1[4];
20635 } __attribute__((packed));
20636
20637 /* hwrm_ring_reset_output (size:128b/16B) */
20638 struct hwrm_ring_reset_output {
20639         /* The specific error status for the command. */
20640         uint16_t        error_code;
20641         /* The HWRM command request type. */
20642         uint16_t        req_type;
20643         /* The sequence ID from the original command. */
20644         uint16_t        seq_id;
20645         /* The length of the response data in number of bytes. */
20646         uint16_t        resp_len;
20647         uint8_t unused_0[7];
20648         /*
20649          * This field is used in Output records to indicate that the output
20650          * is completely written to RAM.  This field should be read as '1'
20651          * to indicate that the output has been completely written.
20652          * When writing a command completion or response to an internal processor,
20653          * the order of writes has to be such that this field is written last.
20654          */
20655         uint8_t valid;
20656 } __attribute__((packed));
20657
20658 /**************************
20659  * hwrm_ring_aggint_qcaps *
20660  **************************/
20661
20662
20663 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
20664 struct hwrm_ring_aggint_qcaps_input {
20665         /* The HWRM command request type. */
20666         uint16_t        req_type;
20667         /*
20668          * The completion ring to send the completion event on. This should
20669          * be the NQ ID returned from the `nq_alloc` HWRM command.
20670          */
20671         uint16_t        cmpl_ring;
20672         /*
20673          * The sequence ID is used by the driver for tracking multiple
20674          * commands. This ID is treated as opaque data by the firmware and
20675          * the value is returned in the `hwrm_resp_hdr` upon completion.
20676          */
20677         uint16_t        seq_id;
20678         /*
20679          * The target ID of the command:
20680          * * 0x0-0xFFF8 - The function ID
20681          * * 0xFFF8-0xFFFE - Reserved for internal processors
20682          * * 0xFFFF - HWRM
20683          */
20684         uint16_t        target_id;
20685         /*
20686          * A physical address pointer pointing to a host buffer that the
20687          * command's response data will be written. This can be either a host
20688          * physical address (HPA) or a guest physical address (GPA) and must
20689          * point to a physically contiguous block of memory.
20690          */
20691         uint64_t        resp_addr;
20692 } __attribute__((packed));
20693
20694 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
20695 struct hwrm_ring_aggint_qcaps_output {
20696         /* The specific error status for the command. */
20697         uint16_t        error_code;
20698         /* The HWRM command request type. */
20699         uint16_t        req_type;
20700         /* The sequence ID from the original command. */
20701         uint16_t        seq_id;
20702         /* The length of the response data in number of bytes. */
20703         uint16_t        resp_len;
20704         uint32_t        cmpl_params;
20705         /*
20706          * When this bit is set to '1', int_lat_tmr_min can be configured
20707          * on completion rings.
20708          */
20709         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
20710                 UINT32_C(0x1)
20711         /*
20712          * When this bit is set to '1', int_lat_tmr_max can be configured
20713          * on completion rings.
20714          */
20715         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
20716                 UINT32_C(0x2)
20717         /*
20718          * When this bit is set to '1', timer_reset can be enabled
20719          * on completion rings.
20720          */
20721         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
20722                 UINT32_C(0x4)
20723         /*
20724          * When this bit is set to '1', ring_idle can be enabled
20725          * on completion rings.
20726          */
20727         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
20728                 UINT32_C(0x8)
20729         /*
20730          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
20731          * on completion rings.
20732          */
20733         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
20734                 UINT32_C(0x10)
20735         /*
20736          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
20737          * on completion rings.
20738          */
20739         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
20740                 UINT32_C(0x20)
20741         /*
20742          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
20743          * on completion rings.
20744          */
20745         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
20746                 UINT32_C(0x40)
20747         /*
20748          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
20749          * on completion rings.
20750          */
20751         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
20752                 UINT32_C(0x80)
20753         /*
20754          * When this bit is set to '1', num_cmpl_aggr_int can be configured
20755          * on completion rings.
20756          */
20757         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
20758                 UINT32_C(0x100)
20759         uint32_t        nq_params;
20760         /*
20761          * When this bit is set to '1', int_lat_tmr_min can be configured
20762          * on notification queues.
20763          */
20764         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
20765                 UINT32_C(0x1)
20766         /* Minimum value for num_cmpl_dma_aggr */
20767         uint16_t        num_cmpl_dma_aggr_min;
20768         /* Maximum value for num_cmpl_dma_aggr */
20769         uint16_t        num_cmpl_dma_aggr_max;
20770         /* Minimum value for num_cmpl_dma_aggr_during_int */
20771         uint16_t        num_cmpl_dma_aggr_during_int_min;
20772         /* Maximum value for num_cmpl_dma_aggr_during_int */
20773         uint16_t        num_cmpl_dma_aggr_during_int_max;
20774         /* Minimum value for cmpl_aggr_dma_tmr */
20775         uint16_t        cmpl_aggr_dma_tmr_min;
20776         /* Maximum value for cmpl_aggr_dma_tmr */
20777         uint16_t        cmpl_aggr_dma_tmr_max;
20778         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
20779         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
20780         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
20781         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
20782         /* Minimum value for int_lat_tmr_min */
20783         uint16_t        int_lat_tmr_min_min;
20784         /* Maximum value for int_lat_tmr_min */
20785         uint16_t        int_lat_tmr_min_max;
20786         /* Minimum value for int_lat_tmr_max */
20787         uint16_t        int_lat_tmr_max_min;
20788         /* Maximum value for int_lat_tmr_max */
20789         uint16_t        int_lat_tmr_max_max;
20790         /* Minimum value for num_cmpl_aggr_int */
20791         uint16_t        num_cmpl_aggr_int_min;
20792         /* Maximum value for num_cmpl_aggr_int */
20793         uint16_t        num_cmpl_aggr_int_max;
20794         /* The units for timer parameters, in nanoseconds. */
20795         uint16_t        timer_units;
20796         uint8_t unused_0[1];
20797         /*
20798          * This field is used in Output records to indicate that the output
20799          * is completely written to RAM.  This field should be read as '1'
20800          * to indicate that the output has been completely written.
20801          * When writing a command completion or response to an internal processor,
20802          * the order of writes has to be such that this field is written last.
20803          */
20804         uint8_t valid;
20805 } __attribute__((packed));
20806
20807 /**************************************
20808  * hwrm_ring_cmpl_ring_qaggint_params *
20809  **************************************/
20810
20811
20812 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
20813 struct hwrm_ring_cmpl_ring_qaggint_params_input {
20814         /* The HWRM command request type. */
20815         uint16_t        req_type;
20816         /*
20817          * The completion ring to send the completion event on. This should
20818          * be the NQ ID returned from the `nq_alloc` HWRM command.
20819          */
20820         uint16_t        cmpl_ring;
20821         /*
20822          * The sequence ID is used by the driver for tracking multiple
20823          * commands. This ID is treated as opaque data by the firmware and
20824          * the value is returned in the `hwrm_resp_hdr` upon completion.
20825          */
20826         uint16_t        seq_id;
20827         /*
20828          * The target ID of the command:
20829          * * 0x0-0xFFF8 - The function ID
20830          * * 0xFFF8-0xFFFE - Reserved for internal processors
20831          * * 0xFFFF - HWRM
20832          */
20833         uint16_t        target_id;
20834         /*
20835          * A physical address pointer pointing to a host buffer that the
20836          * command's response data will be written. This can be either a host
20837          * physical address (HPA) or a guest physical address (GPA) and must
20838          * point to a physically contiguous block of memory.
20839          */
20840         uint64_t        resp_addr;
20841         /* Physical number of completion ring. */
20842         uint16_t        ring_id;
20843         uint8_t unused_0[6];
20844 } __attribute__((packed));
20845
20846 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
20847 struct hwrm_ring_cmpl_ring_qaggint_params_output {
20848         /* The specific error status for the command. */
20849         uint16_t        error_code;
20850         /* The HWRM command request type. */
20851         uint16_t        req_type;
20852         /* The sequence ID from the original command. */
20853         uint16_t        seq_id;
20854         /* The length of the response data in number of bytes. */
20855         uint16_t        resp_len;
20856         uint16_t        flags;
20857         /*
20858          * When this bit is set to '1', interrupt max
20859          * timer is reset whenever a completion is received.
20860          */
20861         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
20862                 UINT32_C(0x1)
20863         /*
20864          * When this bit is set to '1', ring idle mode
20865          * aggregation will be enabled.
20866          */
20867         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
20868                 UINT32_C(0x2)
20869         /*
20870          * Number of completions to aggregate before DMA
20871          * during the normal mode.
20872          */
20873         uint16_t        num_cmpl_dma_aggr;
20874         /*
20875          * Number of completions to aggregate before DMA
20876          * during the interrupt mode.
20877          */
20878         uint16_t        num_cmpl_dma_aggr_during_int;
20879         /*
20880          * Timer in unit of 80-nsec used to aggregate completions before
20881          * DMA during the normal mode (not in interrupt mode).
20882          */
20883         uint16_t        cmpl_aggr_dma_tmr;
20884         /*
20885          * Timer in unit of 80-nsec used to aggregate completions before
20886          * DMA during the interrupt mode.
20887          */
20888         uint16_t        cmpl_aggr_dma_tmr_during_int;
20889         /* Minimum time (in unit of 80-nsec) between two interrupts. */
20890         uint16_t        int_lat_tmr_min;
20891         /*
20892          * Maximum wait time (in unit of 80-nsec) spent aggregating
20893          * completions before signaling the interrupt after the
20894          * interrupt is enabled.
20895          */
20896         uint16_t        int_lat_tmr_max;
20897         /*
20898          * Minimum number of completions aggregated before signaling
20899          * an interrupt.
20900          */
20901         uint16_t        num_cmpl_aggr_int;
20902         uint8_t unused_0[7];
20903         /*
20904          * This field is used in Output records to indicate that the output
20905          * is completely written to RAM.  This field should be read as '1'
20906          * to indicate that the output has been completely written.
20907          * When writing a command completion or response to an internal processor,
20908          * the order of writes has to be such that this field is written last.
20909          */
20910         uint8_t valid;
20911 } __attribute__((packed));
20912
20913 /*****************************************
20914  * hwrm_ring_cmpl_ring_cfg_aggint_params *
20915  *****************************************/
20916
20917
20918 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
20919 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
20920         /* The HWRM command request type. */
20921         uint16_t        req_type;
20922         /*
20923          * The completion ring to send the completion event on. This should
20924          * be the NQ ID returned from the `nq_alloc` HWRM command.
20925          */
20926         uint16_t        cmpl_ring;
20927         /*
20928          * The sequence ID is used by the driver for tracking multiple
20929          * commands. This ID is treated as opaque data by the firmware and
20930          * the value is returned in the `hwrm_resp_hdr` upon completion.
20931          */
20932         uint16_t        seq_id;
20933         /*
20934          * The target ID of the command:
20935          * * 0x0-0xFFF8 - The function ID
20936          * * 0xFFF8-0xFFFE - Reserved for internal processors
20937          * * 0xFFFF - HWRM
20938          */
20939         uint16_t        target_id;
20940         /*
20941          * A physical address pointer pointing to a host buffer that the
20942          * command's response data will be written. This can be either a host
20943          * physical address (HPA) or a guest physical address (GPA) and must
20944          * point to a physically contiguous block of memory.
20945          */
20946         uint64_t        resp_addr;
20947         /* Physical number of completion ring. */
20948         uint16_t        ring_id;
20949         uint16_t        flags;
20950         /*
20951          * When this bit is set to '1', interrupt latency max
20952          * timer is reset whenever a completion is received.
20953          */
20954         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
20955                 UINT32_C(0x1)
20956         /*
20957          * When this bit is set to '1', ring idle mode
20958          * aggregation will be enabled.
20959          */
20960         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
20961                 UINT32_C(0x2)
20962         /*
20963          * Set this flag to 1 when configuring parameters on a
20964          * notification queue. Set this flag to 0 when configuring
20965          * parameters on a completion queue.
20966          */
20967         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
20968                 UINT32_C(0x4)
20969         /*
20970          * Number of completions to aggregate before DMA
20971          * during the normal mode.
20972          */
20973         uint16_t        num_cmpl_dma_aggr;
20974         /*
20975          * Number of completions to aggregate before DMA
20976          * during the interrupt mode.
20977          */
20978         uint16_t        num_cmpl_dma_aggr_during_int;
20979         /*
20980          * Timer in unit of 80-nsec used to aggregate completions before
20981          * DMA during the normal mode (not in interrupt mode).
20982          */
20983         uint16_t        cmpl_aggr_dma_tmr;
20984         /*
20985          * Timer in unit of 80-nsec used to aggregate completions before
20986          * DMA during the interrupt mode.
20987          */
20988         uint16_t        cmpl_aggr_dma_tmr_during_int;
20989         /* Minimum time (in unit of 80-nsec) between two interrupts. */
20990         uint16_t        int_lat_tmr_min;
20991         /*
20992          * Maximum wait time (in unit of 80-nsec) spent aggregating
20993          * cmpls before signaling the interrupt after the
20994          * interrupt is enabled.
20995          */
20996         uint16_t        int_lat_tmr_max;
20997         /*
20998          * Minimum number of completions aggregated before signaling
20999          * an interrupt.
21000          */
21001         uint16_t        num_cmpl_aggr_int;
21002         /*
21003          * Bitfield that indicates which parameters are to be applied. Only
21004          * required when configuring devices with notification queues, and
21005          * used in that case to set certain parameters on completion queues
21006          * and others on notification queues.
21007          */
21008         uint16_t        enables;
21009         /*
21010          * This bit must be '1' for the num_cmpl_dma_aggr field to be
21011          * configured.
21012          */
21013         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
21014                 UINT32_C(0x1)
21015         /*
21016          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
21017          * configured.
21018          */
21019         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
21020                 UINT32_C(0x2)
21021         /*
21022          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
21023          * configured.
21024          */
21025         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
21026                 UINT32_C(0x4)
21027         /*
21028          * This bit must be '1' for the int_lat_tmr_min field to be
21029          * configured.
21030          */
21031         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
21032                 UINT32_C(0x8)
21033         /*
21034          * This bit must be '1' for the int_lat_tmr_max field to be
21035          * configured.
21036          */
21037         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
21038                 UINT32_C(0x10)
21039         /*
21040          * This bit must be '1' for the num_cmpl_aggr_int field to be
21041          * configured.
21042          */
21043         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
21044                 UINT32_C(0x20)
21045         uint8_t unused_0[4];
21046 } __attribute__((packed));
21047
21048 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
21049 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
21050         /* The specific error status for the command. */
21051         uint16_t        error_code;
21052         /* The HWRM command request type. */
21053         uint16_t        req_type;
21054         /* The sequence ID from the original command. */
21055         uint16_t        seq_id;
21056         /* The length of the response data in number of bytes. */
21057         uint16_t        resp_len;
21058         uint8_t unused_0[7];
21059         /*
21060          * This field is used in Output records to indicate that the output
21061          * is completely written to RAM.  This field should be read as '1'
21062          * to indicate that the output has been completely written.
21063          * When writing a command completion or response to an internal processor,
21064          * the order of writes has to be such that this field is written last.
21065          */
21066         uint8_t valid;
21067 } __attribute__((packed));
21068
21069 /***********************
21070  * hwrm_ring_grp_alloc *
21071  ***********************/
21072
21073
21074 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
21075 struct hwrm_ring_grp_alloc_input {
21076         /* The HWRM command request type. */
21077         uint16_t        req_type;
21078         /*
21079          * The completion ring to send the completion event on. This should
21080          * be the NQ ID returned from the `nq_alloc` HWRM command.
21081          */
21082         uint16_t        cmpl_ring;
21083         /*
21084          * The sequence ID is used by the driver for tracking multiple
21085          * commands. This ID is treated as opaque data by the firmware and
21086          * the value is returned in the `hwrm_resp_hdr` upon completion.
21087          */
21088         uint16_t        seq_id;
21089         /*
21090          * The target ID of the command:
21091          * * 0x0-0xFFF8 - The function ID
21092          * * 0xFFF8-0xFFFE - Reserved for internal processors
21093          * * 0xFFFF - HWRM
21094          */
21095         uint16_t        target_id;
21096         /*
21097          * A physical address pointer pointing to a host buffer that the
21098          * command's response data will be written. This can be either a host
21099          * physical address (HPA) or a guest physical address (GPA) and must
21100          * point to a physically contiguous block of memory.
21101          */
21102         uint64_t        resp_addr;
21103         /*
21104          * This value identifies the CR associated with the ring
21105          * group.
21106          */
21107         uint16_t        cr;
21108         /*
21109          * This value identifies the main RR associated with the ring
21110          * group.
21111          */
21112         uint16_t        rr;
21113         /*
21114          * This value identifies the aggregation RR associated with
21115          * the ring group.  If this value is 0xFF... (All Fs), then no
21116          * Aggregation ring will be set.
21117          */
21118         uint16_t        ar;
21119         /*
21120          * This value identifies the statistics context associated
21121          * with the ring group.
21122          */
21123         uint16_t        sc;
21124 } __attribute__((packed));
21125
21126 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
21127 struct hwrm_ring_grp_alloc_output {
21128         /* The specific error status for the command. */
21129         uint16_t        error_code;
21130         /* The HWRM command request type. */
21131         uint16_t        req_type;
21132         /* The sequence ID from the original command. */
21133         uint16_t        seq_id;
21134         /* The length of the response data in number of bytes. */
21135         uint16_t        resp_len;
21136         /*
21137          * This is the ring group ID value.  Use this value to program
21138          * the default ring group for the VNIC or as table entries
21139          * in an RSS/COS context.
21140          */
21141         uint32_t        ring_group_id;
21142         uint8_t unused_0[3];
21143         /*
21144          * This field is used in Output records to indicate that the output
21145          * is completely written to RAM.  This field should be read as '1'
21146          * to indicate that the output has been completely written.
21147          * When writing a command completion or response to an internal processor,
21148          * the order of writes has to be such that this field is written last.
21149          */
21150         uint8_t valid;
21151 } __attribute__((packed));
21152
21153 /**********************
21154  * hwrm_ring_grp_free *
21155  **********************/
21156
21157
21158 /* hwrm_ring_grp_free_input (size:192b/24B) */
21159 struct hwrm_ring_grp_free_input {
21160         /* The HWRM command request type. */
21161         uint16_t        req_type;
21162         /*
21163          * The completion ring to send the completion event on. This should
21164          * be the NQ ID returned from the `nq_alloc` HWRM command.
21165          */
21166         uint16_t        cmpl_ring;
21167         /*
21168          * The sequence ID is used by the driver for tracking multiple
21169          * commands. This ID is treated as opaque data by the firmware and
21170          * the value is returned in the `hwrm_resp_hdr` upon completion.
21171          */
21172         uint16_t        seq_id;
21173         /*
21174          * The target ID of the command:
21175          * * 0x0-0xFFF8 - The function ID
21176          * * 0xFFF8-0xFFFE - Reserved for internal processors
21177          * * 0xFFFF - HWRM
21178          */
21179         uint16_t        target_id;
21180         /*
21181          * A physical address pointer pointing to a host buffer that the
21182          * command's response data will be written. This can be either a host
21183          * physical address (HPA) or a guest physical address (GPA) and must
21184          * point to a physically contiguous block of memory.
21185          */
21186         uint64_t        resp_addr;
21187         /* This is the ring group ID value. */
21188         uint32_t        ring_group_id;
21189         uint8_t unused_0[4];
21190 } __attribute__((packed));
21191
21192 /* hwrm_ring_grp_free_output (size:128b/16B) */
21193 struct hwrm_ring_grp_free_output {
21194         /* The specific error status for the command. */
21195         uint16_t        error_code;
21196         /* The HWRM command request type. */
21197         uint16_t        req_type;
21198         /* The sequence ID from the original command. */
21199         uint16_t        seq_id;
21200         /* The length of the response data in number of bytes. */
21201         uint16_t        resp_len;
21202         uint8_t unused_0[7];
21203         /*
21204          * This field is used in Output records to indicate that the output
21205          * is completely written to RAM.  This field should be read as '1'
21206          * to indicate that the output has been completely written.
21207          * When writing a command completion or response to an internal processor,
21208          * the order of writes has to be such that this field is written last.
21209          */
21210         uint8_t valid;
21211 } __attribute__((packed));
21212
21213 /****************************
21214  * hwrm_cfa_l2_filter_alloc *
21215  ****************************/
21216
21217
21218 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
21219 struct hwrm_cfa_l2_filter_alloc_input {
21220         /* The HWRM command request type. */
21221         uint16_t        req_type;
21222         /*
21223          * The completion ring to send the completion event on. This should
21224          * be the NQ ID returned from the `nq_alloc` HWRM command.
21225          */
21226         uint16_t        cmpl_ring;
21227         /*
21228          * The sequence ID is used by the driver for tracking multiple
21229          * commands. This ID is treated as opaque data by the firmware and
21230          * the value is returned in the `hwrm_resp_hdr` upon completion.
21231          */
21232         uint16_t        seq_id;
21233         /*
21234          * The target ID of the command:
21235          * * 0x0-0xFFF8 - The function ID
21236          * * 0xFFF8-0xFFFE - Reserved for internal processors
21237          * * 0xFFFF - HWRM
21238          */
21239         uint16_t        target_id;
21240         /*
21241          * A physical address pointer pointing to a host buffer that the
21242          * command's response data will be written. This can be either a host
21243          * physical address (HPA) or a guest physical address (GPA) and must
21244          * point to a physically contiguous block of memory.
21245          */
21246         uint64_t        resp_addr;
21247         uint32_t        flags;
21248         /*
21249          * Enumeration denoting the RX, TX type of the resource.
21250          * This enumeration is used for resources that are similar for both
21251          * TX and RX paths of the chip.
21252          */
21253         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
21254                 UINT32_C(0x1)
21255         /* tx path */
21256         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
21257                 UINT32_C(0x0)
21258         /* rx path */
21259         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
21260                 UINT32_C(0x1)
21261         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
21262                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
21263         /* Setting of this flag indicates the applicability to the loopback path. */
21264         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
21265                 UINT32_C(0x2)
21266         /*
21267          * Setting of this flag indicates drop action. If this flag is not set,
21268          * then it should be considered accept action.
21269          */
21270         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
21271                 UINT32_C(0x4)
21272         /*
21273          * If this flag is set, all t_l2_* fields are invalid
21274          * and they should not be specified.
21275          * If this flag is set, then l2_* fields refer to
21276          * fields of outermost L2 header.
21277          */
21278         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
21279                 UINT32_C(0x8)
21280         /*
21281          * Enumeration denoting NO_ROCE_L2 to support old drivers.
21282          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
21283          */
21284         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
21285                 UINT32_C(0x30)
21286         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
21287         /* To support old drivers */
21288         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
21289                 (UINT32_C(0x0) << 4)
21290         /* Only L2 traffic */
21291         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
21292                 (UINT32_C(0x1) << 4)
21293         /* Roce & L2 traffic */
21294         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
21295                 (UINT32_C(0x2) << 4)
21296         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
21297                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
21298         uint32_t        enables;
21299         /*
21300          * This bit must be '1' for the l2_addr field to be
21301          * configured.
21302          */
21303         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
21304                 UINT32_C(0x1)
21305         /*
21306          * This bit must be '1' for the l2_addr_mask field to be
21307          * configured.
21308          */
21309         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
21310                 UINT32_C(0x2)
21311         /*
21312          * This bit must be '1' for the l2_ovlan field to be
21313          * configured.
21314          */
21315         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
21316                 UINT32_C(0x4)
21317         /*
21318          * This bit must be '1' for the l2_ovlan_mask field to be
21319          * configured.
21320          */
21321         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
21322                 UINT32_C(0x8)
21323         /*
21324          * This bit must be '1' for the l2_ivlan field to be
21325          * configured.
21326          */
21327         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
21328                 UINT32_C(0x10)
21329         /*
21330          * This bit must be '1' for the l2_ivlan_mask field to be
21331          * configured.
21332          */
21333         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
21334                 UINT32_C(0x20)
21335         /*
21336          * This bit must be '1' for the t_l2_addr field to be
21337          * configured.
21338          */
21339         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
21340                 UINT32_C(0x40)
21341         /*
21342          * This bit must be '1' for the t_l2_addr_mask field to be
21343          * configured.
21344          */
21345         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
21346                 UINT32_C(0x80)
21347         /*
21348          * This bit must be '1' for the t_l2_ovlan field to be
21349          * configured.
21350          */
21351         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
21352                 UINT32_C(0x100)
21353         /*
21354          * This bit must be '1' for the t_l2_ovlan_mask field to be
21355          * configured.
21356          */
21357         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
21358                 UINT32_C(0x200)
21359         /*
21360          * This bit must be '1' for the t_l2_ivlan field to be
21361          * configured.
21362          */
21363         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
21364                 UINT32_C(0x400)
21365         /*
21366          * This bit must be '1' for the t_l2_ivlan_mask field to be
21367          * configured.
21368          */
21369         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
21370                 UINT32_C(0x800)
21371         /*
21372          * This bit must be '1' for the src_type field to be
21373          * configured.
21374          */
21375         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
21376                 UINT32_C(0x1000)
21377         /*
21378          * This bit must be '1' for the src_id field to be
21379          * configured.
21380          */
21381         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
21382                 UINT32_C(0x2000)
21383         /*
21384          * This bit must be '1' for the tunnel_type field to be
21385          * configured.
21386          */
21387         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
21388                 UINT32_C(0x4000)
21389         /*
21390          * This bit must be '1' for the dst_id field to be
21391          * configured.
21392          */
21393         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
21394                 UINT32_C(0x8000)
21395         /*
21396          * This bit must be '1' for the mirror_vnic_id field to be
21397          * configured.
21398          */
21399         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
21400                 UINT32_C(0x10000)
21401         /*
21402          * This value sets the match value for the L2 MAC address.
21403          * Destination MAC address for RX path.
21404          * Source MAC address for TX path.
21405          */
21406         uint8_t l2_addr[6];
21407         uint8_t unused_0[2];
21408         /*
21409          * This value sets the mask value for the L2 address.
21410          * A value of 0 will mask the corresponding bit from
21411          * compare.
21412          */
21413         uint8_t l2_addr_mask[6];
21414         /* This value sets VLAN ID value for outer VLAN. */
21415         uint16_t        l2_ovlan;
21416         /*
21417          * This value sets the mask value for the ovlan id.
21418          * A value of 0 will mask the corresponding bit from
21419          * compare.
21420          */
21421         uint16_t        l2_ovlan_mask;
21422         /* This value sets VLAN ID value for inner VLAN. */
21423         uint16_t        l2_ivlan;
21424         /*
21425          * This value sets the mask value for the ivlan id.
21426          * A value of 0 will mask the corresponding bit from
21427          * compare.
21428          */
21429         uint16_t        l2_ivlan_mask;
21430         uint8_t unused_1[2];
21431         /*
21432          * This value sets the match value for the tunnel
21433          * L2 MAC address.
21434          * Destination MAC address for RX path.
21435          * Source MAC address for TX path.
21436          */
21437         uint8_t t_l2_addr[6];
21438         uint8_t unused_2[2];
21439         /*
21440          * This value sets the mask value for the tunnel L2
21441          * address.
21442          * A value of 0 will mask the corresponding bit from
21443          * compare.
21444          */
21445         uint8_t t_l2_addr_mask[6];
21446         /* This value sets VLAN ID value for tunnel outer VLAN. */
21447         uint16_t        t_l2_ovlan;
21448         /*
21449          * This value sets the mask value for the tunnel ovlan id.
21450          * A value of 0 will mask the corresponding bit from
21451          * compare.
21452          */
21453         uint16_t        t_l2_ovlan_mask;
21454         /* This value sets VLAN ID value for tunnel inner VLAN. */
21455         uint16_t        t_l2_ivlan;
21456         /*
21457          * This value sets the mask value for the tunnel ivlan id.
21458          * A value of 0 will mask the corresponding bit from
21459          * compare.
21460          */
21461         uint16_t        t_l2_ivlan_mask;
21462         /* This value identifies the type of source of the packet. */
21463         uint8_t src_type;
21464         /* Network port */
21465         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
21466         /* Physical function */
21467         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
21468         /* Virtual function */
21469         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
21470         /* Virtual NIC of a function */
21471         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
21472         /* Embedded processor for CFA management */
21473         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
21474         /* Embedded processor for OOB management */
21475         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
21476         /* Embedded processor for RoCE */
21477         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
21478         /* Embedded processor for network proxy functions */
21479         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
21480         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
21481                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
21482         uint8_t unused_3;
21483         /*
21484          * This value is the id of the source.
21485          * For a network port, it represents port_id.
21486          * For a physical function, it represents fid.
21487          * For a virtual function, it represents vf_id.
21488          * For a vnic, it represents vnic_id.
21489          * For embedded processors, this id is not valid.
21490          *
21491          * Notes:
21492          * 1. The function ID is implied if it src_id is
21493          *    not provided for a src_type that is either
21494          */
21495         uint32_t        src_id;
21496         /* Tunnel Type. */
21497         uint8_t tunnel_type;
21498         /* Non-tunnel */
21499         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
21500                 UINT32_C(0x0)
21501         /* Virtual eXtensible Local Area Network (VXLAN) */
21502         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
21503                 UINT32_C(0x1)
21504         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
21505         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
21506                 UINT32_C(0x2)
21507         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
21508         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
21509                 UINT32_C(0x3)
21510         /* IP in IP */
21511         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
21512                 UINT32_C(0x4)
21513         /* Generic Network Virtualization Encapsulation (Geneve) */
21514         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
21515                 UINT32_C(0x5)
21516         /* Multi-Protocol Lable Switching (MPLS) */
21517         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
21518                 UINT32_C(0x6)
21519         /* Stateless Transport Tunnel (STT) */
21520         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
21521                 UINT32_C(0x7)
21522         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
21523         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
21524                 UINT32_C(0x8)
21525         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
21526         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
21527                 UINT32_C(0x9)
21528         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
21529         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
21530                 UINT32_C(0xa)
21531         /* Use fixed layer 2 ether type of 0xFFFF */
21532         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
21533                 UINT32_C(0xb)
21534         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
21535         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
21536                 UINT32_C(0xc)
21537         /* Any tunneled traffic */
21538         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
21539                 UINT32_C(0xff)
21540         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
21541                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
21542         uint8_t unused_4;
21543         /*
21544          * If set, this value shall represent the
21545          * Logical VNIC ID of the destination VNIC for the RX
21546          * path and network port id of the destination port for
21547          * the TX path.
21548          */
21549         uint16_t        dst_id;
21550         /*
21551          * Logical VNIC ID of the VNIC where traffic is
21552          * mirrored.
21553          */
21554         uint16_t        mirror_vnic_id;
21555         /*
21556          * This hint is provided to help in placing
21557          * the filter in the filter table.
21558          */
21559         uint8_t pri_hint;
21560         /* No preference */
21561         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
21562                 UINT32_C(0x0)
21563         /* Above the given filter */
21564         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
21565                 UINT32_C(0x1)
21566         /* Below the given filter */
21567         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
21568                 UINT32_C(0x2)
21569         /* As high as possible */
21570         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
21571                 UINT32_C(0x3)
21572         /* As low as possible */
21573         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
21574                 UINT32_C(0x4)
21575         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
21576                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
21577         uint8_t unused_5;
21578         uint32_t        unused_6;
21579         /*
21580          * This is the ID of the filter that goes along with
21581          * the pri_hint.
21582          *
21583          * This field is valid only for the following values.
21584          * 1 - Above the given filter
21585          * 2 - Below the given filter
21586          */
21587         uint64_t        l2_filter_id_hint;
21588 } __attribute__((packed));
21589
21590 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
21591 struct hwrm_cfa_l2_filter_alloc_output {
21592         /* The specific error status for the command. */
21593         uint16_t        error_code;
21594         /* The HWRM command request type. */
21595         uint16_t        req_type;
21596         /* The sequence ID from the original command. */
21597         uint16_t        seq_id;
21598         /* The length of the response data in number of bytes. */
21599         uint16_t        resp_len;
21600         /*
21601          * This value identifies a set of CFA data structures used for an L2
21602          * context.
21603          */
21604         uint64_t        l2_filter_id;
21605         /*
21606          * This is the ID of the flow associated with this
21607          * filter.
21608          * This value shall be used to match and associate the
21609          * flow identifier returned in completion records.
21610          * A value of 0xFFFFFFFF shall indicate no flow id.
21611          */
21612         uint32_t        flow_id;
21613         uint8_t unused_0[3];
21614         /*
21615          * This field is used in Output records to indicate that the output
21616          * is completely written to RAM.  This field should be read as '1'
21617          * to indicate that the output has been completely written.
21618          * When writing a command completion or response to an internal processor,
21619          * the order of writes has to be such that this field is written last.
21620          */
21621         uint8_t valid;
21622 } __attribute__((packed));
21623
21624 /***************************
21625  * hwrm_cfa_l2_filter_free *
21626  ***************************/
21627
21628
21629 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
21630 struct hwrm_cfa_l2_filter_free_input {
21631         /* The HWRM command request type. */
21632         uint16_t        req_type;
21633         /*
21634          * The completion ring to send the completion event on. This should
21635          * be the NQ ID returned from the `nq_alloc` HWRM command.
21636          */
21637         uint16_t        cmpl_ring;
21638         /*
21639          * The sequence ID is used by the driver for tracking multiple
21640          * commands. This ID is treated as opaque data by the firmware and
21641          * the value is returned in the `hwrm_resp_hdr` upon completion.
21642          */
21643         uint16_t        seq_id;
21644         /*
21645          * The target ID of the command:
21646          * * 0x0-0xFFF8 - The function ID
21647          * * 0xFFF8-0xFFFE - Reserved for internal processors
21648          * * 0xFFFF - HWRM
21649          */
21650         uint16_t        target_id;
21651         /*
21652          * A physical address pointer pointing to a host buffer that the
21653          * command's response data will be written. This can be either a host
21654          * physical address (HPA) or a guest physical address (GPA) and must
21655          * point to a physically contiguous block of memory.
21656          */
21657         uint64_t        resp_addr;
21658         /*
21659          * This value identifies a set of CFA data structures used for an L2
21660          * context.
21661          */
21662         uint64_t        l2_filter_id;
21663 } __attribute__((packed));
21664
21665 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
21666 struct hwrm_cfa_l2_filter_free_output {
21667         /* The specific error status for the command. */
21668         uint16_t        error_code;
21669         /* The HWRM command request type. */
21670         uint16_t        req_type;
21671         /* The sequence ID from the original command. */
21672         uint16_t        seq_id;
21673         /* The length of the response data in number of bytes. */
21674         uint16_t        resp_len;
21675         uint8_t unused_0[7];
21676         /*
21677          * This field is used in Output records to indicate that the output
21678          * is completely written to RAM.  This field should be read as '1'
21679          * to indicate that the output has been completely written.
21680          * When writing a command completion or response to an internal processor,
21681          * the order of writes has to be such that this field is written last.
21682          */
21683         uint8_t valid;
21684 } __attribute__((packed));
21685
21686 /**************************
21687  * hwrm_cfa_l2_filter_cfg *
21688  **************************/
21689
21690
21691 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
21692 struct hwrm_cfa_l2_filter_cfg_input {
21693         /* The HWRM command request type. */
21694         uint16_t        req_type;
21695         /*
21696          * The completion ring to send the completion event on. This should
21697          * be the NQ ID returned from the `nq_alloc` HWRM command.
21698          */
21699         uint16_t        cmpl_ring;
21700         /*
21701          * The sequence ID is used by the driver for tracking multiple
21702          * commands. This ID is treated as opaque data by the firmware and
21703          * the value is returned in the `hwrm_resp_hdr` upon completion.
21704          */
21705         uint16_t        seq_id;
21706         /*
21707          * The target ID of the command:
21708          * * 0x0-0xFFF8 - The function ID
21709          * * 0xFFF8-0xFFFE - Reserved for internal processors
21710          * * 0xFFFF - HWRM
21711          */
21712         uint16_t        target_id;
21713         /*
21714          * A physical address pointer pointing to a host buffer that the
21715          * command's response data will be written. This can be either a host
21716          * physical address (HPA) or a guest physical address (GPA) and must
21717          * point to a physically contiguous block of memory.
21718          */
21719         uint64_t        resp_addr;
21720         uint32_t        flags;
21721         /*
21722          * Enumeration denoting the RX, TX type of the resource.
21723          * This enumeration is used for resources that are similar for both
21724          * TX and RX paths of the chip.
21725          */
21726         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
21727                 UINT32_C(0x1)
21728         /* tx path */
21729         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
21730                 UINT32_C(0x0)
21731         /* rx path */
21732         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
21733                 UINT32_C(0x1)
21734         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
21735                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
21736         /*
21737          * Setting of this flag indicates drop action. If this flag is not set,
21738          * then it should be considered accept action.
21739          */
21740         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
21741                 UINT32_C(0x2)
21742         /*
21743          * Enumeration denoting NO_ROCE_L2 to support old drivers.
21744          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
21745          */
21746         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
21747                 UINT32_C(0xc)
21748         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
21749         /* To support old drivers */
21750         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
21751                 (UINT32_C(0x0) << 2)
21752         /* Only L2 traffic */
21753         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
21754                 (UINT32_C(0x1) << 2)
21755         /* Roce & L2 traffic */
21756         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
21757                 (UINT32_C(0x2) << 2)
21758         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
21759                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
21760         uint32_t        enables;
21761         /*
21762          * This bit must be '1' for the dst_id field to be
21763          * configured.
21764          */
21765         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
21766                 UINT32_C(0x1)
21767         /*
21768          * This bit must be '1' for the new_mirror_vnic_id field to be
21769          * configured.
21770          */
21771         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
21772                 UINT32_C(0x2)
21773         /*
21774          * This value identifies a set of CFA data structures used for an L2
21775          * context.
21776          */
21777         uint64_t        l2_filter_id;
21778         /*
21779          * If set, this value shall represent the
21780          * Logical VNIC ID of the destination VNIC for the RX
21781          * path and network port id of the destination port for
21782          * the TX path.
21783          */
21784         uint32_t        dst_id;
21785         /*
21786          * New Logical VNIC ID of the VNIC where traffic is
21787          * mirrored.
21788          */
21789         uint32_t        new_mirror_vnic_id;
21790 } __attribute__((packed));
21791
21792 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
21793 struct hwrm_cfa_l2_filter_cfg_output {
21794         /* The specific error status for the command. */
21795         uint16_t        error_code;
21796         /* The HWRM command request type. */
21797         uint16_t        req_type;
21798         /* The sequence ID from the original command. */
21799         uint16_t        seq_id;
21800         /* The length of the response data in number of bytes. */
21801         uint16_t        resp_len;
21802         uint8_t unused_0[7];
21803         /*
21804          * This field is used in Output records to indicate that the output
21805          * is completely written to RAM.  This field should be read as '1'
21806          * to indicate that the output has been completely written.
21807          * When writing a command completion or response to an internal processor,
21808          * the order of writes has to be such that this field is written last.
21809          */
21810         uint8_t valid;
21811 } __attribute__((packed));
21812
21813 /***************************
21814  * hwrm_cfa_l2_set_rx_mask *
21815  ***************************/
21816
21817
21818 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
21819 struct hwrm_cfa_l2_set_rx_mask_input {
21820         /* The HWRM command request type. */
21821         uint16_t        req_type;
21822         /*
21823          * The completion ring to send the completion event on. This should
21824          * be the NQ ID returned from the `nq_alloc` HWRM command.
21825          */
21826         uint16_t        cmpl_ring;
21827         /*
21828          * The sequence ID is used by the driver for tracking multiple
21829          * commands. This ID is treated as opaque data by the firmware and
21830          * the value is returned in the `hwrm_resp_hdr` upon completion.
21831          */
21832         uint16_t        seq_id;
21833         /*
21834          * The target ID of the command:
21835          * * 0x0-0xFFF8 - The function ID
21836          * * 0xFFF8-0xFFFE - Reserved for internal processors
21837          * * 0xFFFF - HWRM
21838          */
21839         uint16_t        target_id;
21840         /*
21841          * A physical address pointer pointing to a host buffer that the
21842          * command's response data will be written. This can be either a host
21843          * physical address (HPA) or a guest physical address (GPA) and must
21844          * point to a physically contiguous block of memory.
21845          */
21846         uint64_t        resp_addr;
21847         /* VNIC ID */
21848         uint32_t        vnic_id;
21849         uint32_t        mask;
21850         /*
21851          * When this bit is '1', the function is requested to accept
21852          * multi-cast packets specified by the multicast addr table.
21853          */
21854         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
21855                 UINT32_C(0x2)
21856         /*
21857          * When this bit is '1', the function is requested to accept
21858          * all multi-cast packets.
21859          */
21860         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
21861                 UINT32_C(0x4)
21862         /*
21863          * When this bit is '1', the function is requested to accept
21864          * broadcast packets.
21865          */
21866         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
21867                 UINT32_C(0x8)
21868         /*
21869          * When this bit is '1', the function is requested to be
21870          * put in the promiscuous mode.
21871          *
21872          * The HWRM should accept any function to set up
21873          * promiscuous mode.
21874          *
21875          * The HWRM shall follow the semantics below for the
21876          * promiscuous mode support.
21877          * # When partitioning is not enabled on a port
21878          * (i.e. single PF on the port), then the PF shall
21879          * be allowed to be in the promiscuous mode. When the
21880          * PF is in the promiscuous mode, then it shall
21881          * receive all host bound traffic on that port.
21882          * # When partitioning is enabled on a port
21883          * (i.e. multiple PFs per port) and a PF on that
21884          * port is in the promiscuous mode, then the PF
21885          * receives all traffic within that partition as
21886          * identified by a unique identifier for the
21887          * PF (e.g. S-Tag). If a unique outer VLAN
21888          * for the PF is specified, then the setting of
21889          * promiscuous mode on that PF shall result in the
21890          * PF receiving all host bound traffic with matching
21891          * outer VLAN.
21892          * # A VF shall can be set in the promiscuous mode.
21893          * In the promiscuous mode, the VF does not receive any
21894          * traffic unless a unique outer VLAN for the
21895          * VF is specified. If a unique outer VLAN
21896          * for the VF is specified, then the setting of
21897          * promiscuous mode on that VF shall result in the
21898          * VF receiving all host bound traffic with the
21899          * matching outer VLAN.
21900          * # The HWRM shall allow the setting of promiscuous
21901          * mode on a function independently from the
21902          * promiscuous mode settings on other functions.
21903          */
21904         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
21905                 UINT32_C(0x10)
21906         /*
21907          * If this flag is set, the corresponding RX
21908          * filters shall be set up to cover multicast/broadcast
21909          * filters for the outermost Layer 2 destination MAC
21910          * address field.
21911          */
21912         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
21913                 UINT32_C(0x20)
21914         /*
21915          * If this flag is set, the corresponding RX
21916          * filters shall be set up to cover multicast/broadcast
21917          * filters for the VLAN-tagged packets that match the
21918          * TPID and VID fields of VLAN tags in the VLAN tag
21919          * table specified in this command.
21920          */
21921         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
21922                 UINT32_C(0x40)
21923         /*
21924          * If this flag is set, the corresponding RX
21925          * filters shall be set up to cover multicast/broadcast
21926          * filters for non-VLAN tagged packets and VLAN-tagged
21927          * packets that match the TPID and VID fields of VLAN
21928          * tags in the VLAN tag table specified in this command.
21929          */
21930         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
21931                 UINT32_C(0x80)
21932         /*
21933          * If this flag is set, the corresponding RX
21934          * filters shall be set up to cover multicast/broadcast
21935          * filters for non-VLAN tagged packets and VLAN-tagged
21936          * packets matching any VLAN tag.
21937          *
21938          * If this flag is set, then the HWRM shall ignore
21939          * VLAN tags specified in vlan_tag_tbl.
21940          *
21941          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
21942          * flags is set, then the HWRM shall ignore
21943          * VLAN tags specified in vlan_tag_tbl.
21944          *
21945          * The HWRM client shall set at most one flag out of
21946          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
21947          */
21948         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
21949                 UINT32_C(0x100)
21950         /* This is the address for mcast address tbl. */
21951         uint64_t        mc_tbl_addr;
21952         /*
21953          * This value indicates how many entries in mc_tbl are valid.
21954          * Each entry is 6 bytes.
21955          */
21956         uint32_t        num_mc_entries;
21957         uint8_t unused_0[4];
21958         /*
21959          * This is the address for VLAN tag table.
21960          * Each VLAN entry in the table is 4 bytes of a VLAN tag
21961          * including TPID, PCP, DEI, and VID fields in network byte
21962          * order.
21963          */
21964         uint64_t        vlan_tag_tbl_addr;
21965         /*
21966          * This value indicates how many entries in vlan_tag_tbl are
21967          * valid. Each entry is 4 bytes.
21968          */
21969         uint32_t        num_vlan_tags;
21970         uint8_t unused_1[4];
21971 } __attribute__((packed));
21972
21973 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
21974 struct hwrm_cfa_l2_set_rx_mask_output {
21975         /* The specific error status for the command. */
21976         uint16_t        error_code;
21977         /* The HWRM command request type. */
21978         uint16_t        req_type;
21979         /* The sequence ID from the original command. */
21980         uint16_t        seq_id;
21981         /* The length of the response data in number of bytes. */
21982         uint16_t        resp_len;
21983         uint8_t unused_0[7];
21984         /*
21985          * This field is used in Output records to indicate that the output
21986          * is completely written to RAM.  This field should be read as '1'
21987          * to indicate that the output has been completely written.
21988          * When writing a command completion or response to an internal processor,
21989          * the order of writes has to be such that this field is written last.
21990          */
21991         uint8_t valid;
21992 } __attribute__((packed));
21993
21994 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
21995 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
21996         /*
21997          * command specific error codes that goes to
21998          * the cmd_err field in Common HWRM Error Response.
21999          */
22000         uint8_t code;
22001         /* Unknown error */
22002         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
22003                 UINT32_C(0x0)
22004         /* Unable to complete operation due to conflict with Ntuple Filter */
22005         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
22006                 UINT32_C(0x1)
22007         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
22008                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
22009         uint8_t unused_0[7];
22010 } __attribute__((packed));
22011
22012 /*******************************
22013  * hwrm_cfa_vlan_antispoof_cfg *
22014  *******************************/
22015
22016
22017 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
22018 struct hwrm_cfa_vlan_antispoof_cfg_input {
22019         /* The HWRM command request type. */
22020         uint16_t        req_type;
22021         /*
22022          * The completion ring to send the completion event on. This should
22023          * be the NQ ID returned from the `nq_alloc` HWRM command.
22024          */
22025         uint16_t        cmpl_ring;
22026         /*
22027          * The sequence ID is used by the driver for tracking multiple
22028          * commands. This ID is treated as opaque data by the firmware and
22029          * the value is returned in the `hwrm_resp_hdr` upon completion.
22030          */
22031         uint16_t        seq_id;
22032         /*
22033          * The target ID of the command:
22034          * * 0x0-0xFFF8 - The function ID
22035          * * 0xFFF8-0xFFFE - Reserved for internal processors
22036          * * 0xFFFF - HWRM
22037          */
22038         uint16_t        target_id;
22039         /*
22040          * A physical address pointer pointing to a host buffer that the
22041          * command's response data will be written. This can be either a host
22042          * physical address (HPA) or a guest physical address (GPA) and must
22043          * point to a physically contiguous block of memory.
22044          */
22045         uint64_t        resp_addr;
22046         /*
22047          * Function ID of the function that is being configured.
22048          * Only valid for a VF FID configured by the PF.
22049          */
22050         uint16_t        fid;
22051         uint8_t unused_0[2];
22052         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
22053         uint32_t        num_vlan_entries;
22054         /*
22055          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
22056          * antispoof table. Each table entry contains the 16-bit TPID
22057          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
22058          * all in network order to match hwrm_cfa_l2_set_rx_mask.
22059          * For an individual VLAN entry, the mask value should be 0xfff
22060          * for the 12-bit VLAN ID.
22061          */
22062         uint64_t        vlan_tag_mask_tbl_addr;
22063 } __attribute__((packed));
22064
22065 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
22066 struct hwrm_cfa_vlan_antispoof_cfg_output {
22067         /* The specific error status for the command. */
22068         uint16_t        error_code;
22069         /* The HWRM command request type. */
22070         uint16_t        req_type;
22071         /* The sequence ID from the original command. */
22072         uint16_t        seq_id;
22073         /* The length of the response data in number of bytes. */
22074         uint16_t        resp_len;
22075         uint8_t unused_0[7];
22076         /*
22077          * This field is used in Output records to indicate that the output
22078          * is completely written to RAM.  This field should be read as '1'
22079          * to indicate that the output has been completely written.
22080          * When writing a command completion or response to an internal processor,
22081          * the order of writes has to be such that this field is written last.
22082          */
22083         uint8_t valid;
22084 } __attribute__((packed));
22085
22086 /********************************
22087  * hwrm_cfa_vlan_antispoof_qcfg *
22088  ********************************/
22089
22090
22091 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
22092 struct hwrm_cfa_vlan_antispoof_qcfg_input {
22093         /* The HWRM command request type. */
22094         uint16_t        req_type;
22095         /*
22096          * The completion ring to send the completion event on. This should
22097          * be the NQ ID returned from the `nq_alloc` HWRM command.
22098          */
22099         uint16_t        cmpl_ring;
22100         /*
22101          * The sequence ID is used by the driver for tracking multiple
22102          * commands. This ID is treated as opaque data by the firmware and
22103          * the value is returned in the `hwrm_resp_hdr` upon completion.
22104          */
22105         uint16_t        seq_id;
22106         /*
22107          * The target ID of the command:
22108          * * 0x0-0xFFF8 - The function ID
22109          * * 0xFFF8-0xFFFE - Reserved for internal processors
22110          * * 0xFFFF - HWRM
22111          */
22112         uint16_t        target_id;
22113         /*
22114          * A physical address pointer pointing to a host buffer that the
22115          * command's response data will be written. This can be either a host
22116          * physical address (HPA) or a guest physical address (GPA) and must
22117          * point to a physically contiguous block of memory.
22118          */
22119         uint64_t        resp_addr;
22120         /*
22121          * Function ID of the function that is being queried.
22122          * Only valid for a VF FID queried by the PF.
22123          */
22124         uint16_t        fid;
22125         uint8_t unused_0[2];
22126         /*
22127          * Maximum number of VLAN entries the firmware is allowed to DMA
22128          * to vlan_tag_mask_tbl.
22129          */
22130         uint32_t        max_vlan_entries;
22131         /*
22132          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
22133          * antispoof table to which firmware will DMA to. Each table
22134          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
22135          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
22136          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
22137          * the mask value should be 0xfff for the 12-bit VLAN ID.
22138          */
22139         uint64_t        vlan_tag_mask_tbl_addr;
22140 } __attribute__((packed));
22141
22142 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
22143 struct hwrm_cfa_vlan_antispoof_qcfg_output {
22144         /* The specific error status for the command. */
22145         uint16_t        error_code;
22146         /* The HWRM command request type. */
22147         uint16_t        req_type;
22148         /* The sequence ID from the original command. */
22149         uint16_t        seq_id;
22150         /* The length of the response data in number of bytes. */
22151         uint16_t        resp_len;
22152         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
22153         uint32_t        num_vlan_entries;
22154         uint8_t unused_0[3];
22155         /*
22156          * This field is used in Output records to indicate that the output
22157          * is completely written to RAM.  This field should be read as '1'
22158          * to indicate that the output has been completely written.
22159          * When writing a command completion or response to an internal processor,
22160          * the order of writes has to be such that this field is written last.
22161          */
22162         uint8_t valid;
22163 } __attribute__((packed));
22164
22165 /********************************
22166  * hwrm_cfa_tunnel_filter_alloc *
22167  ********************************/
22168
22169
22170 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
22171 struct hwrm_cfa_tunnel_filter_alloc_input {
22172         /* The HWRM command request type. */
22173         uint16_t        req_type;
22174         /*
22175          * The completion ring to send the completion event on. This should
22176          * be the NQ ID returned from the `nq_alloc` HWRM command.
22177          */
22178         uint16_t        cmpl_ring;
22179         /*
22180          * The sequence ID is used by the driver for tracking multiple
22181          * commands. This ID is treated as opaque data by the firmware and
22182          * the value is returned in the `hwrm_resp_hdr` upon completion.
22183          */
22184         uint16_t        seq_id;
22185         /*
22186          * The target ID of the command:
22187          * * 0x0-0xFFF8 - The function ID
22188          * * 0xFFF8-0xFFFE - Reserved for internal processors
22189          * * 0xFFFF - HWRM
22190          */
22191         uint16_t        target_id;
22192         /*
22193          * A physical address pointer pointing to a host buffer that the
22194          * command's response data will be written. This can be either a host
22195          * physical address (HPA) or a guest physical address (GPA) and must
22196          * point to a physically contiguous block of memory.
22197          */
22198         uint64_t        resp_addr;
22199         uint32_t        flags;
22200         /* Setting of this flag indicates the applicability to the loopback path. */
22201         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
22202                 UINT32_C(0x1)
22203         uint32_t        enables;
22204         /*
22205          * This bit must be '1' for the l2_filter_id field to be
22206          * configured.
22207          */
22208         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
22209                 UINT32_C(0x1)
22210         /*
22211          * This bit must be '1' for the l2_addr field to be
22212          * configured.
22213          */
22214         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
22215                 UINT32_C(0x2)
22216         /*
22217          * This bit must be '1' for the l2_ivlan field to be
22218          * configured.
22219          */
22220         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
22221                 UINT32_C(0x4)
22222         /*
22223          * This bit must be '1' for the l3_addr field to be
22224          * configured.
22225          */
22226         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
22227                 UINT32_C(0x8)
22228         /*
22229          * This bit must be '1' for the l3_addr_type field to be
22230          * configured.
22231          */
22232         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
22233                 UINT32_C(0x10)
22234         /*
22235          * This bit must be '1' for the t_l3_addr_type field to be
22236          * configured.
22237          */
22238         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
22239                 UINT32_C(0x20)
22240         /*
22241          * This bit must be '1' for the t_l3_addr field to be
22242          * configured.
22243          */
22244         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
22245                 UINT32_C(0x40)
22246         /*
22247          * This bit must be '1' for the tunnel_type field to be
22248          * configured.
22249          */
22250         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
22251                 UINT32_C(0x80)
22252         /*
22253          * This bit must be '1' for the vni field to be
22254          * configured.
22255          */
22256         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
22257                 UINT32_C(0x100)
22258         /*
22259          * This bit must be '1' for the dst_vnic_id field to be
22260          * configured.
22261          */
22262         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
22263                 UINT32_C(0x200)
22264         /*
22265          * This bit must be '1' for the mirror_vnic_id field to be
22266          * configured.
22267          */
22268         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
22269                 UINT32_C(0x400)
22270         /*
22271          * This value identifies a set of CFA data structures used for an L2
22272          * context.
22273          */
22274         uint64_t        l2_filter_id;
22275         /*
22276          * This value sets the match value for the inner L2
22277          * MAC address.
22278          * Destination MAC address for RX path.
22279          * Source MAC address for TX path.
22280          */
22281         uint8_t l2_addr[6];
22282         /*
22283          * This value sets VLAN ID value for inner VLAN.
22284          * Only 12-bits of VLAN ID are used in setting the filter.
22285          */
22286         uint16_t        l2_ivlan;
22287         /*
22288          * The value of inner destination IP address to be used in filtering.
22289          * For IPv4, first four bytes represent the IP address.
22290          */
22291         uint32_t        l3_addr[4];
22292         /*
22293          * The value of tunnel destination IP address to be used in filtering.
22294          * For IPv4, first four bytes represent the IP address.
22295          */
22296         uint32_t        t_l3_addr[4];
22297         /*
22298          * This value indicates the type of inner IP address.
22299          * 4 - IPv4
22300          * 6 - IPv6
22301          * All others are invalid.
22302          */
22303         uint8_t l3_addr_type;
22304         /*
22305          * This value indicates the type of tunnel IP address.
22306          * 4 - IPv4
22307          * 6 - IPv6
22308          * All others are invalid.
22309          */
22310         uint8_t t_l3_addr_type;
22311         /* Tunnel Type. */
22312         uint8_t tunnel_type;
22313         /* Non-tunnel */
22314         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
22315                 UINT32_C(0x0)
22316         /* Virtual eXtensible Local Area Network (VXLAN) */
22317         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
22318                 UINT32_C(0x1)
22319         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
22320         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
22321                 UINT32_C(0x2)
22322         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
22323         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
22324                 UINT32_C(0x3)
22325         /* IP in IP */
22326         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
22327                 UINT32_C(0x4)
22328         /* Generic Network Virtualization Encapsulation (Geneve) */
22329         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
22330                 UINT32_C(0x5)
22331         /* Multi-Protocol Lable Switching (MPLS) */
22332         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
22333                 UINT32_C(0x6)
22334         /* Stateless Transport Tunnel (STT) */
22335         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
22336                 UINT32_C(0x7)
22337         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
22338         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
22339                 UINT32_C(0x8)
22340         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
22341         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
22342                 UINT32_C(0x9)
22343         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
22344         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
22345                 UINT32_C(0xa)
22346         /* Use fixed layer 2 ether type of 0xFFFF */
22347         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
22348                 UINT32_C(0xb)
22349         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
22350         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
22351                 UINT32_C(0xc)
22352         /* Any tunneled traffic */
22353         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
22354                 UINT32_C(0xff)
22355         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
22356                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
22357         /*
22358          * tunnel_flags allows the user to indicate the tunnel tag detection
22359          * for the tunnel type specified in tunnel_type.
22360          */
22361         uint8_t tunnel_flags;
22362         /*
22363          * If the tunnel_type is geneve, then this bit indicates if we
22364          * need to match the geneve OAM packet.
22365          * If the tunnel_type is nvgre or gre, then this bit indicates if
22366          * we need to detect checksum present bit in geneve header.
22367          * If the tunnel_type is mpls, then this bit indicates if we need
22368          * to match mpls packet with explicit IPV4/IPV6 null header.
22369          */
22370         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
22371                 UINT32_C(0x1)
22372         /*
22373          * If the tunnel_type is geneve, then this bit indicates if we
22374          * need to detect the critical option bit set in the oam packet.
22375          * If the tunnel_type is nvgre or gre, then this bit indicates
22376          * if we need to match nvgre packets with key present bit set in
22377          * gre header.
22378          * If the tunnel_type is mpls, then this bit indicates if we
22379          * need to match mpls packet with S bit from inner/second label.
22380          */
22381         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
22382                 UINT32_C(0x2)
22383         /*
22384          * If the tunnel_type is geneve, then this bit indicates if we
22385          * need to match geneve packet with extended header bit set in
22386          * geneve header.
22387          * If the tunnel_type is nvgre or gre, then this bit indicates
22388          * if we need to match nvgre packets with sequence number
22389          * present bit set in gre header.
22390          * If the tunnel_type is mpls, then this bit indicates if we
22391          * need to match mpls packet with S bit from out/first label.
22392          */
22393         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
22394                 UINT32_C(0x4)
22395         /*
22396          * Virtual Network Identifier (VNI). Only valid with
22397          * tunnel_types VXLAN, NVGRE, and Geneve.
22398          * Only lower 24-bits of VNI field are used
22399          * in setting up the filter.
22400          */
22401         uint32_t        vni;
22402         /* Logical VNIC ID of the destination VNIC. */
22403         uint32_t        dst_vnic_id;
22404         /*
22405          * Logical VNIC ID of the VNIC where traffic is
22406          * mirrored.
22407          */
22408         uint32_t        mirror_vnic_id;
22409 } __attribute__((packed));
22410
22411 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
22412 struct hwrm_cfa_tunnel_filter_alloc_output {
22413         /* The specific error status for the command. */
22414         uint16_t        error_code;
22415         /* The HWRM command request type. */
22416         uint16_t        req_type;
22417         /* The sequence ID from the original command. */
22418         uint16_t        seq_id;
22419         /* The length of the response data in number of bytes. */
22420         uint16_t        resp_len;
22421         /* This value is an opaque id into CFA data structures. */
22422         uint64_t        tunnel_filter_id;
22423         /*
22424          * This is the ID of the flow associated with this
22425          * filter.
22426          * This value shall be used to match and associate the
22427          * flow identifier returned in completion records.
22428          * A value of 0xFFFFFFFF shall indicate no flow id.
22429          */
22430         uint32_t        flow_id;
22431         uint8_t unused_0[3];
22432         /*
22433          * This field is used in Output records to indicate that the output
22434          * is completely written to RAM.  This field should be read as '1'
22435          * to indicate that the output has been completely written.
22436          * When writing a command completion or response to an internal processor,
22437          * the order of writes has to be such that this field is written last.
22438          */
22439         uint8_t valid;
22440 } __attribute__((packed));
22441
22442 /*******************************
22443  * hwrm_cfa_tunnel_filter_free *
22444  *******************************/
22445
22446
22447 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
22448 struct hwrm_cfa_tunnel_filter_free_input {
22449         /* The HWRM command request type. */
22450         uint16_t        req_type;
22451         /*
22452          * The completion ring to send the completion event on. This should
22453          * be the NQ ID returned from the `nq_alloc` HWRM command.
22454          */
22455         uint16_t        cmpl_ring;
22456         /*
22457          * The sequence ID is used by the driver for tracking multiple
22458          * commands. This ID is treated as opaque data by the firmware and
22459          * the value is returned in the `hwrm_resp_hdr` upon completion.
22460          */
22461         uint16_t        seq_id;
22462         /*
22463          * The target ID of the command:
22464          * * 0x0-0xFFF8 - The function ID
22465          * * 0xFFF8-0xFFFE - Reserved for internal processors
22466          * * 0xFFFF - HWRM
22467          */
22468         uint16_t        target_id;
22469         /*
22470          * A physical address pointer pointing to a host buffer that the
22471          * command's response data will be written. This can be either a host
22472          * physical address (HPA) or a guest physical address (GPA) and must
22473          * point to a physically contiguous block of memory.
22474          */
22475         uint64_t        resp_addr;
22476         /* This value is an opaque id into CFA data structures. */
22477         uint64_t        tunnel_filter_id;
22478 } __attribute__((packed));
22479
22480 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
22481 struct hwrm_cfa_tunnel_filter_free_output {
22482         /* The specific error status for the command. */
22483         uint16_t        error_code;
22484         /* The HWRM command request type. */
22485         uint16_t        req_type;
22486         /* The sequence ID from the original command. */
22487         uint16_t        seq_id;
22488         /* The length of the response data in number of bytes. */
22489         uint16_t        resp_len;
22490         uint8_t unused_0[7];
22491         /*
22492          * This field is used in Output records to indicate that the output
22493          * is completely written to RAM.  This field should be read as '1'
22494          * to indicate that the output has been completely written.
22495          * When writing a command completion or response to an internal processor,
22496          * the order of writes has to be such that this field is written last.
22497          */
22498         uint8_t valid;
22499 } __attribute__((packed));
22500
22501 /***************************************
22502  * hwrm_cfa_redirect_tunnel_type_alloc *
22503  ***************************************/
22504
22505
22506 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
22507 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
22508         /* The HWRM command request type. */
22509         uint16_t        req_type;
22510         /*
22511          * The completion ring to send the completion event on. This should
22512          * be the NQ ID returned from the `nq_alloc` HWRM command.
22513          */
22514         uint16_t        cmpl_ring;
22515         /*
22516          * The sequence ID is used by the driver for tracking multiple
22517          * commands. This ID is treated as opaque data by the firmware and
22518          * the value is returned in the `hwrm_resp_hdr` upon completion.
22519          */
22520         uint16_t        seq_id;
22521         /*
22522          * The target ID of the command:
22523          * * 0x0-0xFFF8 - The function ID
22524          * * 0xFFF8-0xFFFE - Reserved for internal processors
22525          * * 0xFFFF - HWRM
22526          */
22527         uint16_t        target_id;
22528         /*
22529          * A physical address pointer pointing to a host buffer that the
22530          * command's response data will be written. This can be either a host
22531          * physical address (HPA) or a guest physical address (GPA) and must
22532          * point to a physically contiguous block of memory.
22533          */
22534         uint64_t        resp_addr;
22535         /* The destination function id, to whom the traffic is redirected. */
22536         uint16_t        dest_fid;
22537         /* Tunnel Type. */
22538         uint8_t tunnel_type;
22539         /* Non-tunnel */
22540         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
22541                 UINT32_C(0x0)
22542         /* Virtual eXtensible Local Area Network (VXLAN) */
22543         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
22544                 UINT32_C(0x1)
22545         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
22546         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
22547                 UINT32_C(0x2)
22548         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
22549         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
22550                 UINT32_C(0x3)
22551         /* IP in IP */
22552         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
22553                 UINT32_C(0x4)
22554         /* Generic Network Virtualization Encapsulation (Geneve) */
22555         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
22556                 UINT32_C(0x5)
22557         /* Multi-Protocol Lable Switching (MPLS) */
22558         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
22559                 UINT32_C(0x6)
22560         /* Stateless Transport Tunnel (STT) */
22561         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
22562                 UINT32_C(0x7)
22563         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
22564         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
22565                 UINT32_C(0x8)
22566         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
22567         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
22568                 UINT32_C(0x9)
22569         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
22570         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
22571                 UINT32_C(0xa)
22572         /* Use fixed layer 2 ether type of 0xFFFF */
22573         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
22574                 UINT32_C(0xb)
22575         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
22576         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
22577                 UINT32_C(0xc)
22578         /* Any tunneled traffic */
22579         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
22580                 UINT32_C(0xff)
22581         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
22582                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
22583         /* Tunnel alloc flags. */
22584         uint8_t flags;
22585         /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */
22586         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
22587                 UINT32_C(0x1)
22588         uint8_t unused_0[4];
22589 } __attribute__((packed));
22590
22591 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
22592 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
22593         /* The specific error status for the command. */
22594         uint16_t        error_code;
22595         /* The HWRM command request type. */
22596         uint16_t        req_type;
22597         /* The sequence ID from the original command. */
22598         uint16_t        seq_id;
22599         /* The length of the response data in number of bytes. */
22600         uint16_t        resp_len;
22601         uint8_t unused_0[7];
22602         /*
22603          * This field is used in Output records to indicate that the output
22604          * is completely written to RAM.  This field should be read as '1'
22605          * to indicate that the output has been completely written.
22606          * When writing a command completion or response to an internal processor,
22607          * the order of writes has to be such that this field is written last.
22608          */
22609         uint8_t valid;
22610 } __attribute__((packed));
22611
22612 /**************************************
22613  * hwrm_cfa_redirect_tunnel_type_free *
22614  **************************************/
22615
22616
22617 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
22618 struct hwrm_cfa_redirect_tunnel_type_free_input {
22619         /* The HWRM command request type. */
22620         uint16_t        req_type;
22621         /*
22622          * The completion ring to send the completion event on. This should
22623          * be the NQ ID returned from the `nq_alloc` HWRM command.
22624          */
22625         uint16_t        cmpl_ring;
22626         /*
22627          * The sequence ID is used by the driver for tracking multiple
22628          * commands. This ID is treated as opaque data by the firmware and
22629          * the value is returned in the `hwrm_resp_hdr` upon completion.
22630          */
22631         uint16_t        seq_id;
22632         /*
22633          * The target ID of the command:
22634          * * 0x0-0xFFF8 - The function ID
22635          * * 0xFFF8-0xFFFE - Reserved for internal processors
22636          * * 0xFFFF - HWRM
22637          */
22638         uint16_t        target_id;
22639         /*
22640          * A physical address pointer pointing to a host buffer that the
22641          * command's response data will be written. This can be either a host
22642          * physical address (HPA) or a guest physical address (GPA) and must
22643          * point to a physically contiguous block of memory.
22644          */
22645         uint64_t        resp_addr;
22646         /* The destination function id, to whom the traffic is redirected. */
22647         uint16_t        dest_fid;
22648         /* Tunnel Type. */
22649         uint8_t tunnel_type;
22650         /* Non-tunnel */
22651         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
22652                 UINT32_C(0x0)
22653         /* Virtual eXtensible Local Area Network (VXLAN) */
22654         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
22655                 UINT32_C(0x1)
22656         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
22657         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
22658                 UINT32_C(0x2)
22659         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
22660         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
22661                 UINT32_C(0x3)
22662         /* IP in IP */
22663         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
22664                 UINT32_C(0x4)
22665         /* Generic Network Virtualization Encapsulation (Geneve) */
22666         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
22667                 UINT32_C(0x5)
22668         /* Multi-Protocol Lable Switching (MPLS) */
22669         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
22670                 UINT32_C(0x6)
22671         /* Stateless Transport Tunnel (STT) */
22672         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
22673                 UINT32_C(0x7)
22674         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
22675         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
22676                 UINT32_C(0x8)
22677         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
22678         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
22679                 UINT32_C(0x9)
22680         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
22681         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
22682                 UINT32_C(0xa)
22683         /* Use fixed layer 2 ether type of 0xFFFF */
22684         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
22685                 UINT32_C(0xb)
22686         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
22687         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
22688                 UINT32_C(0xc)
22689         /* Any tunneled traffic */
22690         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
22691                 UINT32_C(0xff)
22692         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
22693                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
22694         uint8_t unused_0[5];
22695 } __attribute__((packed));
22696
22697 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
22698 struct hwrm_cfa_redirect_tunnel_type_free_output {
22699         /* The specific error status for the command. */
22700         uint16_t        error_code;
22701         /* The HWRM command request type. */
22702         uint16_t        req_type;
22703         /* The sequence ID from the original command. */
22704         uint16_t        seq_id;
22705         /* The length of the response data in number of bytes. */
22706         uint16_t        resp_len;
22707         uint8_t unused_0[7];
22708         /*
22709          * This field is used in Output records to indicate that the output
22710          * is completely written to RAM.  This field should be read as '1'
22711          * to indicate that the output has been completely written.
22712          * When writing a command completion or response to an internal processor,
22713          * the order of writes has to be such that this field is written last.
22714          */
22715         uint8_t valid;
22716 } __attribute__((packed));
22717
22718 /**************************************
22719  * hwrm_cfa_redirect_tunnel_type_info *
22720  **************************************/
22721
22722
22723 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
22724 struct hwrm_cfa_redirect_tunnel_type_info_input {
22725         /* The HWRM command request type. */
22726         uint16_t        req_type;
22727         /*
22728          * The completion ring to send the completion event on. This should
22729          * be the NQ ID returned from the `nq_alloc` HWRM command.
22730          */
22731         uint16_t        cmpl_ring;
22732         /*
22733          * The sequence ID is used by the driver for tracking multiple
22734          * commands. This ID is treated as opaque data by the firmware and
22735          * the value is returned in the `hwrm_resp_hdr` upon completion.
22736          */
22737         uint16_t        seq_id;
22738         /*
22739          * The target ID of the command:
22740          * * 0x0-0xFFF8 - The function ID
22741          * * 0xFFF8-0xFFFE - Reserved for internal processors
22742          * * 0xFFFF - HWRM
22743          */
22744         uint16_t        target_id;
22745         /*
22746          * A physical address pointer pointing to a host buffer that the
22747          * command's response data will be written. This can be either a host
22748          * physical address (HPA) or a guest physical address (GPA) and must
22749          * point to a physically contiguous block of memory.
22750          */
22751         uint64_t        resp_addr;
22752         /* The source function id. */
22753         uint16_t        src_fid;
22754         /* Tunnel Type. */
22755         uint8_t tunnel_type;
22756         /* Non-tunnel */
22757         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
22758                 UINT32_C(0x0)
22759         /* Virtual eXtensible Local Area Network (VXLAN) */
22760         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
22761                 UINT32_C(0x1)
22762         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
22763         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
22764                 UINT32_C(0x2)
22765         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
22766         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
22767                 UINT32_C(0x3)
22768         /* IP in IP */
22769         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
22770                 UINT32_C(0x4)
22771         /* Generic Network Virtualization Encapsulation (Geneve) */
22772         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
22773                 UINT32_C(0x5)
22774         /* Multi-Protocol Lable Switching (MPLS) */
22775         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
22776                 UINT32_C(0x6)
22777         /* Stateless Transport Tunnel (STT) */
22778         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
22779                 UINT32_C(0x7)
22780         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
22781         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
22782                 UINT32_C(0x8)
22783         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
22784         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
22785                 UINT32_C(0x9)
22786         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
22787         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
22788                 UINT32_C(0xa)
22789         /* Use fixed layer 2 ether type of 0xFFFF */
22790         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
22791                 UINT32_C(0xb)
22792         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
22793         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
22794                 UINT32_C(0xc)
22795         /* Any tunneled traffic */
22796         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
22797                 UINT32_C(0xff)
22798         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
22799                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
22800         uint8_t unused_0[5];
22801 } __attribute__((packed));
22802
22803 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
22804 struct hwrm_cfa_redirect_tunnel_type_info_output {
22805         /* The specific error status for the command. */
22806         uint16_t        error_code;
22807         /* The HWRM command request type. */
22808         uint16_t        req_type;
22809         /* The sequence ID from the original command. */
22810         uint16_t        seq_id;
22811         /* The length of the response data in number of bytes. */
22812         uint16_t        resp_len;
22813         /* The destination function id, to whom the traffic is redirected. */
22814         uint16_t        dest_fid;
22815         uint8_t unused_0[5];
22816         /*
22817          * This field is used in Output records to indicate that the output
22818          * is completely written to RAM.  This field should be read as '1'
22819          * to indicate that the output has been completely written.
22820          * When writing a command completion or response to an internal processor,
22821          * the order of writes has to be such that this field is written last.
22822          */
22823         uint8_t valid;
22824 } __attribute__((packed));
22825
22826 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
22827 struct hwrm_vxlan_ipv4_hdr {
22828         /* IPv4 version and header length. */
22829         uint8_t ver_hlen;
22830         /* IPv4 header length */
22831         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
22832         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
22833         /* Version */
22834         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
22835         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
22836         /* IPv4 type of service. */
22837         uint8_t tos;
22838         /* IPv4 identification. */
22839         uint16_t        ip_id;
22840         /* IPv4 flags and offset. */
22841         uint16_t        flags_frag_offset;
22842         /* IPv4 TTL. */
22843         uint8_t ttl;
22844         /* IPv4 protocol. */
22845         uint8_t protocol;
22846         /* IPv4 source address. */
22847         uint32_t        src_ip_addr;
22848         /* IPv4 destination address. */
22849         uint32_t        dest_ip_addr;
22850 } __attribute__((packed));
22851
22852 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
22853 struct hwrm_vxlan_ipv6_hdr {
22854         /* IPv6 version, traffic class and flow label. */
22855         uint32_t        ver_tc_flow_label;
22856         /* IPv6 version shift */
22857         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
22858                 UINT32_C(0x1c)
22859         /* IPv6 version mask */
22860         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
22861                 UINT32_C(0xf0000000)
22862         /* IPv6 TC shift */
22863         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
22864                 UINT32_C(0x14)
22865         /* IPv6 TC mask */
22866         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
22867                 UINT32_C(0xff00000)
22868         /* IPv6 flow label shift */
22869         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
22870                 UINT32_C(0x0)
22871         /* IPv6 flow label mask */
22872         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
22873                 UINT32_C(0xfffff)
22874         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
22875                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
22876         /* IPv6 payload length. */
22877         uint16_t        payload_len;
22878         /* IPv6 next header. */
22879         uint8_t next_hdr;
22880         /* IPv6 TTL. */
22881         uint8_t ttl;
22882         /* IPv6 source address. */
22883         uint32_t        src_ip_addr[4];
22884         /* IPv6 destination address. */
22885         uint32_t        dest_ip_addr[4];
22886 } __attribute__((packed));
22887
22888 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
22889 struct hwrm_cfa_encap_data_vxlan {
22890         /* Source MAC address. */
22891         uint8_t src_mac_addr[6];
22892         /* reserved. */
22893         uint16_t        unused_0;
22894         /* Destination MAC address. */
22895         uint8_t dst_mac_addr[6];
22896         /* Number of VLAN tags. */
22897         uint8_t num_vlan_tags;
22898         /* reserved. */
22899         uint8_t unused_1;
22900         /* Outer VLAN TPID. */
22901         uint16_t        ovlan_tpid;
22902         /* Outer VLAN TCI. */
22903         uint16_t        ovlan_tci;
22904         /* Inner VLAN TPID. */
22905         uint16_t        ivlan_tpid;
22906         /* Inner VLAN TCI. */
22907         uint16_t        ivlan_tci;
22908         /* L3 header fields. */
22909         uint32_t        l3[10];
22910         /* IP version mask. */
22911         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
22912         /* IP version 4. */
22913         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
22914         /* IP version 6. */
22915         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
22916         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
22917                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
22918         /* UDP source port. */
22919         uint16_t        src_port;
22920         /* UDP destination port. */
22921         uint16_t        dst_port;
22922         /* VXLAN Network Identifier. */
22923         uint32_t        vni;
22924         /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */
22925         uint8_t hdr_rsvd0[3];
22926         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
22927         uint8_t hdr_rsvd1;
22928         /* VXLAN header flags field. */
22929         uint8_t hdr_flags;
22930         uint8_t unused[3];
22931 } __attribute__((packed));
22932
22933 /*******************************
22934  * hwrm_cfa_encap_record_alloc *
22935  *******************************/
22936
22937
22938 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
22939 struct hwrm_cfa_encap_record_alloc_input {
22940         /* The HWRM command request type. */
22941         uint16_t        req_type;
22942         /*
22943          * The completion ring to send the completion event on. This should
22944          * be the NQ ID returned from the `nq_alloc` HWRM command.
22945          */
22946         uint16_t        cmpl_ring;
22947         /*
22948          * The sequence ID is used by the driver for tracking multiple
22949          * commands. This ID is treated as opaque data by the firmware and
22950          * the value is returned in the `hwrm_resp_hdr` upon completion.
22951          */
22952         uint16_t        seq_id;
22953         /*
22954          * The target ID of the command:
22955          * * 0x0-0xFFF8 - The function ID
22956          * * 0xFFF8-0xFFFE - Reserved for internal processors
22957          * * 0xFFFF - HWRM
22958          */
22959         uint16_t        target_id;
22960         /*
22961          * A physical address pointer pointing to a host buffer that the
22962          * command's response data will be written. This can be either a host
22963          * physical address (HPA) or a guest physical address (GPA) and must
22964          * point to a physically contiguous block of memory.
22965          */
22966         uint64_t        resp_addr;
22967         uint32_t        flags;
22968         /* Setting of this flag indicates the applicability to the loopback path. */
22969         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
22970                 UINT32_C(0x1)
22971         /* Encapsulation Type. */
22972         uint8_t encap_type;
22973         /* Virtual eXtensible Local Area Network (VXLAN) */
22974         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
22975                 UINT32_C(0x1)
22976         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
22977         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
22978                 UINT32_C(0x2)
22979         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
22980         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
22981                 UINT32_C(0x3)
22982         /* IP in IP */
22983         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
22984                 UINT32_C(0x4)
22985         /* Generic Network Virtualization Encapsulation (Geneve) */
22986         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
22987                 UINT32_C(0x5)
22988         /* Multi-Protocol Lable Switching (MPLS) */
22989         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
22990                 UINT32_C(0x6)
22991         /* VLAN */
22992         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
22993                 UINT32_C(0x7)
22994         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
22995         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
22996                 UINT32_C(0x8)
22997         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
22998         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
22999                 UINT32_C(0x9)
23000         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
23001         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
23002                 UINT32_C(0xa)
23003         /* Use fixed layer 2 ether type of 0xFFFF */
23004         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
23005                 UINT32_C(0xb)
23006         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
23007                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE
23008         uint8_t unused_0[3];
23009         /* This value is encap data used for the given encap type. */
23010         uint32_t        encap_data[20];
23011 } __attribute__((packed));
23012
23013 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
23014 struct hwrm_cfa_encap_record_alloc_output {
23015         /* The specific error status for the command. */
23016         uint16_t        error_code;
23017         /* The HWRM command request type. */
23018         uint16_t        req_type;
23019         /* The sequence ID from the original command. */
23020         uint16_t        seq_id;
23021         /* The length of the response data in number of bytes. */
23022         uint16_t        resp_len;
23023         /* This value is an opaque id into CFA data structures. */
23024         uint32_t        encap_record_id;
23025         uint8_t unused_0[3];
23026         /*
23027          * This field is used in Output records to indicate that the output
23028          * is completely written to RAM.  This field should be read as '1'
23029          * to indicate that the output has been completely written.
23030          * When writing a command completion or response to an internal processor,
23031          * the order of writes has to be such that this field is written last.
23032          */
23033         uint8_t valid;
23034 } __attribute__((packed));
23035
23036 /******************************
23037  * hwrm_cfa_encap_record_free *
23038  ******************************/
23039
23040
23041 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
23042 struct hwrm_cfa_encap_record_free_input {
23043         /* The HWRM command request type. */
23044         uint16_t        req_type;
23045         /*
23046          * The completion ring to send the completion event on. This should
23047          * be the NQ ID returned from the `nq_alloc` HWRM command.
23048          */
23049         uint16_t        cmpl_ring;
23050         /*
23051          * The sequence ID is used by the driver for tracking multiple
23052          * commands. This ID is treated as opaque data by the firmware and
23053          * the value is returned in the `hwrm_resp_hdr` upon completion.
23054          */
23055         uint16_t        seq_id;
23056         /*
23057          * The target ID of the command:
23058          * * 0x0-0xFFF8 - The function ID
23059          * * 0xFFF8-0xFFFE - Reserved for internal processors
23060          * * 0xFFFF - HWRM
23061          */
23062         uint16_t        target_id;
23063         /*
23064          * A physical address pointer pointing to a host buffer that the
23065          * command's response data will be written. This can be either a host
23066          * physical address (HPA) or a guest physical address (GPA) and must
23067          * point to a physically contiguous block of memory.
23068          */
23069         uint64_t        resp_addr;
23070         /* This value is an opaque id into CFA data structures. */
23071         uint32_t        encap_record_id;
23072         uint8_t unused_0[4];
23073 } __attribute__((packed));
23074
23075 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
23076 struct hwrm_cfa_encap_record_free_output {
23077         /* The specific error status for the command. */
23078         uint16_t        error_code;
23079         /* The HWRM command request type. */
23080         uint16_t        req_type;
23081         /* The sequence ID from the original command. */
23082         uint16_t        seq_id;
23083         /* The length of the response data in number of bytes. */
23084         uint16_t        resp_len;
23085         uint8_t unused_0[7];
23086         /*
23087          * This field is used in Output records to indicate that the output
23088          * is completely written to RAM.  This field should be read as '1'
23089          * to indicate that the output has been completely written.
23090          * When writing a command completion or response to an internal processor,
23091          * the order of writes has to be such that this field is written last.
23092          */
23093         uint8_t valid;
23094 } __attribute__((packed));
23095
23096 /********************************
23097  * hwrm_cfa_ntuple_filter_alloc *
23098  ********************************/
23099
23100
23101 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
23102 struct hwrm_cfa_ntuple_filter_alloc_input {
23103         /* The HWRM command request type. */
23104         uint16_t        req_type;
23105         /*
23106          * The completion ring to send the completion event on. This should
23107          * be the NQ ID returned from the `nq_alloc` HWRM command.
23108          */
23109         uint16_t        cmpl_ring;
23110         /*
23111          * The sequence ID is used by the driver for tracking multiple
23112          * commands. This ID is treated as opaque data by the firmware and
23113          * the value is returned in the `hwrm_resp_hdr` upon completion.
23114          */
23115         uint16_t        seq_id;
23116         /*
23117          * The target ID of the command:
23118          * * 0x0-0xFFF8 - The function ID
23119          * * 0xFFF8-0xFFFE - Reserved for internal processors
23120          * * 0xFFFF - HWRM
23121          */
23122         uint16_t        target_id;
23123         /*
23124          * A physical address pointer pointing to a host buffer that the
23125          * command's response data will be written. This can be either a host
23126          * physical address (HPA) or a guest physical address (GPA) and must
23127          * point to a physically contiguous block of memory.
23128          */
23129         uint64_t        resp_addr;
23130         uint32_t        flags;
23131         /* Setting of this flag indicates the applicability to the loopback path. */
23132         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
23133                 UINT32_C(0x1)
23134         /*
23135          * Setting of this flag indicates drop action. If this flag is not set,
23136          * then it should be considered accept action.
23137          */
23138         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
23139                 UINT32_C(0x2)
23140         /*
23141          * Setting of this flag indicates that a meter is expected to be attached
23142          * to this flow. This hint can be used when choosing the action record
23143          * format required for the flow.
23144          */
23145         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
23146                 UINT32_C(0x4)
23147         uint32_t        enables;
23148         /*
23149          * This bit must be '1' for the l2_filter_id field to be
23150          * configured.
23151          */
23152         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
23153                 UINT32_C(0x1)
23154         /*
23155          * This bit must be '1' for the ethertype field to be
23156          * configured.
23157          */
23158         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
23159                 UINT32_C(0x2)
23160         /*
23161          * This bit must be '1' for the tunnel_type field to be
23162          * configured.
23163          */
23164         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
23165                 UINT32_C(0x4)
23166         /*
23167          * This bit must be '1' for the src_macaddr field to be
23168          * configured.
23169          */
23170         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
23171                 UINT32_C(0x8)
23172         /*
23173          * This bit must be '1' for the ipaddr_type field to be
23174          * configured.
23175          */
23176         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
23177                 UINT32_C(0x10)
23178         /*
23179          * This bit must be '1' for the src_ipaddr field to be
23180          * configured.
23181          */
23182         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
23183                 UINT32_C(0x20)
23184         /*
23185          * This bit must be '1' for the src_ipaddr_mask field to be
23186          * configured.
23187          */
23188         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
23189                 UINT32_C(0x40)
23190         /*
23191          * This bit must be '1' for the dst_ipaddr field to be
23192          * configured.
23193          */
23194         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
23195                 UINT32_C(0x80)
23196         /*
23197          * This bit must be '1' for the dst_ipaddr_mask field to be
23198          * configured.
23199          */
23200         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
23201                 UINT32_C(0x100)
23202         /*
23203          * This bit must be '1' for the ip_protocol field to be
23204          * configured.
23205          */
23206         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
23207                 UINT32_C(0x200)
23208         /*
23209          * This bit must be '1' for the src_port field to be
23210          * configured.
23211          */
23212         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
23213                 UINT32_C(0x400)
23214         /*
23215          * This bit must be '1' for the src_port_mask field to be
23216          * configured.
23217          */
23218         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
23219                 UINT32_C(0x800)
23220         /*
23221          * This bit must be '1' for the dst_port field to be
23222          * configured.
23223          */
23224         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
23225                 UINT32_C(0x1000)
23226         /*
23227          * This bit must be '1' for the dst_port_mask field to be
23228          * configured.
23229          */
23230         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
23231                 UINT32_C(0x2000)
23232         /*
23233          * This bit must be '1' for the pri_hint field to be
23234          * configured.
23235          */
23236         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
23237                 UINT32_C(0x4000)
23238         /*
23239          * This bit must be '1' for the ntuple_filter_id field to be
23240          * configured.
23241          */
23242         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
23243                 UINT32_C(0x8000)
23244         /*
23245          * This bit must be '1' for the dst_id field to be
23246          * configured.
23247          */
23248         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
23249                 UINT32_C(0x10000)
23250         /*
23251          * This bit must be '1' for the mirror_vnic_id field to be
23252          * configured.
23253          */
23254         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
23255                 UINT32_C(0x20000)
23256         /*
23257          * This bit must be '1' for the dst_macaddr field to be
23258          * configured.
23259          */
23260         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
23261                 UINT32_C(0x40000)
23262         /*
23263          * This value identifies a set of CFA data structures used for an L2
23264          * context.
23265          */
23266         uint64_t        l2_filter_id;
23267         /*
23268          * This value indicates the source MAC address in
23269          * the Ethernet header.
23270          */
23271         uint8_t src_macaddr[6];
23272         /* This value indicates the ethertype in the Ethernet header. */
23273         uint16_t        ethertype;
23274         /*
23275          * This value indicates the type of IP address.
23276          * 4 - IPv4
23277          * 6 - IPv6
23278          * All others are invalid.
23279          */
23280         uint8_t ip_addr_type;
23281         /* invalid */
23282         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
23283                 UINT32_C(0x0)
23284         /* IPv4 */
23285         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
23286                 UINT32_C(0x4)
23287         /* IPv6 */
23288         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
23289                 UINT32_C(0x6)
23290         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
23291                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
23292         /*
23293          * The value of protocol filed in IP header.
23294          * Applies to UDP and TCP traffic.
23295          * 6 - TCP
23296          * 17 - UDP
23297          */
23298         uint8_t ip_protocol;
23299         /* invalid */
23300         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
23301                 UINT32_C(0x0)
23302         /* TCP */
23303         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
23304                 UINT32_C(0x6)
23305         /* UDP */
23306         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
23307                 UINT32_C(0x11)
23308         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
23309                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
23310         /*
23311          * If set, this value shall represent the
23312          * Logical VNIC ID of the destination VNIC for the RX
23313          * path and network port id of the destination port for
23314          * the TX path.
23315          */
23316         uint16_t        dst_id;
23317         /*
23318          * Logical VNIC ID of the VNIC where traffic is
23319          * mirrored.
23320          */
23321         uint16_t        mirror_vnic_id;
23322         /*
23323          * This value indicates the tunnel type for this filter.
23324          * If this field is not specified, then the filter shall
23325          * apply to both non-tunneled and tunneled packets.
23326          * If this field conflicts with the tunnel_type specified
23327          * in the l2_filter_id, then the HWRM shall return an
23328          * error for this command.
23329          */
23330         uint8_t tunnel_type;
23331         /* Non-tunnel */
23332         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
23333                 UINT32_C(0x0)
23334         /* Virtual eXtensible Local Area Network (VXLAN) */
23335         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
23336                 UINT32_C(0x1)
23337         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
23338         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
23339                 UINT32_C(0x2)
23340         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
23341         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
23342                 UINT32_C(0x3)
23343         /* IP in IP */
23344         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
23345                 UINT32_C(0x4)
23346         /* Generic Network Virtualization Encapsulation (Geneve) */
23347         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
23348                 UINT32_C(0x5)
23349         /* Multi-Protocol Lable Switching (MPLS) */
23350         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
23351                 UINT32_C(0x6)
23352         /* Stateless Transport Tunnel (STT) */
23353         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
23354                 UINT32_C(0x7)
23355         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
23356         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
23357                 UINT32_C(0x8)
23358         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
23359         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
23360                 UINT32_C(0x9)
23361         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
23362         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
23363                 UINT32_C(0xa)
23364         /* Use fixed layer 2 ether type of 0xFFFF */
23365         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
23366                 UINT32_C(0xb)
23367         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
23368         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
23369                 UINT32_C(0xc)
23370         /* Any tunneled traffic */
23371         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
23372                 UINT32_C(0xff)
23373         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
23374                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
23375         /*
23376          * This hint is provided to help in placing
23377          * the filter in the filter table.
23378          */
23379         uint8_t pri_hint;
23380         /* No preference */
23381         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
23382                 UINT32_C(0x0)
23383         /* Above the given filter */
23384         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
23385                 UINT32_C(0x1)
23386         /* Below the given filter */
23387         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
23388                 UINT32_C(0x2)
23389         /* As high as possible */
23390         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
23391                 UINT32_C(0x3)
23392         /* As low as possible */
23393         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
23394                 UINT32_C(0x4)
23395         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
23396                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
23397         /*
23398          * The value of source IP address to be used in filtering.
23399          * For IPv4, first four bytes represent the IP address.
23400          */
23401         uint32_t        src_ipaddr[4];
23402         /*
23403          * The value of source IP address mask to be used in
23404          * filtering.
23405          * For IPv4, first four bytes represent the IP address mask.
23406          */
23407         uint32_t        src_ipaddr_mask[4];
23408         /*
23409          * The value of destination IP address to be used in filtering.
23410          * For IPv4, first four bytes represent the IP address.
23411          */
23412         uint32_t        dst_ipaddr[4];
23413         /*
23414          * The value of destination IP address mask to be used in
23415          * filtering.
23416          * For IPv4, first four bytes represent the IP address mask.
23417          */
23418         uint32_t        dst_ipaddr_mask[4];
23419         /*
23420          * The value of source port to be used in filtering.
23421          * Applies to UDP and TCP traffic.
23422          */
23423         uint16_t        src_port;
23424         /*
23425          * The value of source port mask to be used in filtering.
23426          * Applies to UDP and TCP traffic.
23427          */
23428         uint16_t        src_port_mask;
23429         /*
23430          * The value of destination port to be used in filtering.
23431          * Applies to UDP and TCP traffic.
23432          */
23433         uint16_t        dst_port;
23434         /*
23435          * The value of destination port mask to be used in
23436          * filtering.
23437          * Applies to UDP and TCP traffic.
23438          */
23439         uint16_t        dst_port_mask;
23440         /*
23441          * This is the ID of the filter that goes along with
23442          * the pri_hint.
23443          */
23444         uint64_t        ntuple_filter_id_hint;
23445 } __attribute__((packed));
23446
23447 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
23448 struct hwrm_cfa_ntuple_filter_alloc_output {
23449         /* The specific error status for the command. */
23450         uint16_t        error_code;
23451         /* The HWRM command request type. */
23452         uint16_t        req_type;
23453         /* The sequence ID from the original command. */
23454         uint16_t        seq_id;
23455         /* The length of the response data in number of bytes. */
23456         uint16_t        resp_len;
23457         /* This value is an opaque id into CFA data structures. */
23458         uint64_t        ntuple_filter_id;
23459         /*
23460          * This is the ID of the flow associated with this
23461          * filter.
23462          * This value shall be used to match and associate the
23463          * flow identifier returned in completion records.
23464          * A value of 0xFFFFFFFF shall indicate no flow id.
23465          */
23466         uint32_t        flow_id;
23467         uint8_t unused_0[3];
23468         /*
23469          * This field is used in Output records to indicate that the output
23470          * is completely written to RAM.  This field should be read as '1'
23471          * to indicate that the output has been completely written.
23472          * When writing a command completion or response to an internal processor,
23473          * the order of writes has to be such that this field is written last.
23474          */
23475         uint8_t valid;
23476 } __attribute__((packed));
23477
23478 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
23479 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
23480         /*
23481          * command specific error codes that goes to
23482          * the cmd_err field in Common HWRM Error Response.
23483          */
23484         uint8_t code;
23485         /* Unknown error */
23486         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
23487                 UINT32_C(0x0)
23488         /* Unable to complete operation due to conflict with Rx Mask VLAN */
23489         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
23490                 UINT32_C(0x1)
23491         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
23492                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
23493         uint8_t unused_0[7];
23494 } __attribute__((packed));
23495
23496 /*******************************
23497  * hwrm_cfa_ntuple_filter_free *
23498  *******************************/
23499
23500
23501 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
23502 struct hwrm_cfa_ntuple_filter_free_input {
23503         /* The HWRM command request type. */
23504         uint16_t        req_type;
23505         /*
23506          * The completion ring to send the completion event on. This should
23507          * be the NQ ID returned from the `nq_alloc` HWRM command.
23508          */
23509         uint16_t        cmpl_ring;
23510         /*
23511          * The sequence ID is used by the driver for tracking multiple
23512          * commands. This ID is treated as opaque data by the firmware and
23513          * the value is returned in the `hwrm_resp_hdr` upon completion.
23514          */
23515         uint16_t        seq_id;
23516         /*
23517          * The target ID of the command:
23518          * * 0x0-0xFFF8 - The function ID
23519          * * 0xFFF8-0xFFFE - Reserved for internal processors
23520          * * 0xFFFF - HWRM
23521          */
23522         uint16_t        target_id;
23523         /*
23524          * A physical address pointer pointing to a host buffer that the
23525          * command's response data will be written. This can be either a host
23526          * physical address (HPA) or a guest physical address (GPA) and must
23527          * point to a physically contiguous block of memory.
23528          */
23529         uint64_t        resp_addr;
23530         /* This value is an opaque id into CFA data structures. */
23531         uint64_t        ntuple_filter_id;
23532 } __attribute__((packed));
23533
23534 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
23535 struct hwrm_cfa_ntuple_filter_free_output {
23536         /* The specific error status for the command. */
23537         uint16_t        error_code;
23538         /* The HWRM command request type. */
23539         uint16_t        req_type;
23540         /* The sequence ID from the original command. */
23541         uint16_t        seq_id;
23542         /* The length of the response data in number of bytes. */
23543         uint16_t        resp_len;
23544         uint8_t unused_0[7];
23545         /*
23546          * This field is used in Output records to indicate that the output
23547          * is completely written to RAM.  This field should be read as '1'
23548          * to indicate that the output has been completely written.
23549          * When writing a command completion or response to an internal processor,
23550          * the order of writes has to be such that this field is written last.
23551          */
23552         uint8_t valid;
23553 } __attribute__((packed));
23554
23555 /******************************
23556  * hwrm_cfa_ntuple_filter_cfg *
23557  ******************************/
23558
23559
23560 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
23561 struct hwrm_cfa_ntuple_filter_cfg_input {
23562         /* The HWRM command request type. */
23563         uint16_t        req_type;
23564         /*
23565          * The completion ring to send the completion event on. This should
23566          * be the NQ ID returned from the `nq_alloc` HWRM command.
23567          */
23568         uint16_t        cmpl_ring;
23569         /*
23570          * The sequence ID is used by the driver for tracking multiple
23571          * commands. This ID is treated as opaque data by the firmware and
23572          * the value is returned in the `hwrm_resp_hdr` upon completion.
23573          */
23574         uint16_t        seq_id;
23575         /*
23576          * The target ID of the command:
23577          * * 0x0-0xFFF8 - The function ID
23578          * * 0xFFF8-0xFFFE - Reserved for internal processors
23579          * * 0xFFFF - HWRM
23580          */
23581         uint16_t        target_id;
23582         /*
23583          * A physical address pointer pointing to a host buffer that the
23584          * command's response data will be written. This can be either a host
23585          * physical address (HPA) or a guest physical address (GPA) and must
23586          * point to a physically contiguous block of memory.
23587          */
23588         uint64_t        resp_addr;
23589         uint32_t        enables;
23590         /*
23591          * This bit must be '1' for the new_dst_id field to be
23592          * configured.
23593          */
23594         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
23595                 UINT32_C(0x1)
23596         /*
23597          * This bit must be '1' for the new_mirror_vnic_id field to be
23598          * configured.
23599          */
23600         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
23601                 UINT32_C(0x2)
23602         /*
23603          * This bit must be '1' for the new_meter_instance_id field to be
23604          * configured.
23605          */
23606         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
23607                 UINT32_C(0x4)
23608         uint8_t unused_0[4];
23609         /* This value is an opaque id into CFA data structures. */
23610         uint64_t        ntuple_filter_id;
23611         /*
23612          * If set, this value shall represent the new
23613          * Logical VNIC ID of the destination VNIC for the RX
23614          * path and new network port id of the destination port for
23615          * the TX path.
23616          */
23617         uint32_t        new_dst_id;
23618         /*
23619          * New Logical VNIC ID of the VNIC where traffic is
23620          * mirrored.
23621          */
23622         uint32_t        new_mirror_vnic_id;
23623         /*
23624          * New meter to attach to the flow. Specifying the
23625          * invalid instance ID is used to remove any existing
23626          * meter from the flow.
23627          */
23628         uint16_t        new_meter_instance_id;
23629         /*
23630          * A value of 0xfff is considered invalid and implies the
23631          * instance is not configured.
23632          */
23633         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
23634                 UINT32_C(0xffff)
23635         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
23636                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
23637         uint8_t unused_1[6];
23638 } __attribute__((packed));
23639
23640 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
23641 struct hwrm_cfa_ntuple_filter_cfg_output {
23642         /* The specific error status for the command. */
23643         uint16_t        error_code;
23644         /* The HWRM command request type. */
23645         uint16_t        req_type;
23646         /* The sequence ID from the original command. */
23647         uint16_t        seq_id;
23648         /* The length of the response data in number of bytes. */
23649         uint16_t        resp_len;
23650         uint8_t unused_0[7];
23651         /*
23652          * This field is used in Output records to indicate that the output
23653          * is completely written to RAM.  This field should be read as '1'
23654          * to indicate that the output has been completely written.
23655          * When writing a command completion or response to an internal processor,
23656          * the order of writes has to be such that this field is written last.
23657          */
23658         uint8_t valid;
23659 } __attribute__((packed));
23660
23661 /**************************
23662  * hwrm_cfa_em_flow_alloc *
23663  **************************/
23664
23665
23666 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
23667 struct hwrm_cfa_em_flow_alloc_input {
23668         /* The HWRM command request type. */
23669         uint16_t        req_type;
23670         /*
23671          * The completion ring to send the completion event on. This should
23672          * be the NQ ID returned from the `nq_alloc` HWRM command.
23673          */
23674         uint16_t        cmpl_ring;
23675         /*
23676          * The sequence ID is used by the driver for tracking multiple
23677          * commands. This ID is treated as opaque data by the firmware and
23678          * the value is returned in the `hwrm_resp_hdr` upon completion.
23679          */
23680         uint16_t        seq_id;
23681         /*
23682          * The target ID of the command:
23683          * * 0x0-0xFFF8 - The function ID
23684          * * 0xFFF8-0xFFFE - Reserved for internal processors
23685          * * 0xFFFF - HWRM
23686          */
23687         uint16_t        target_id;
23688         /*
23689          * A physical address pointer pointing to a host buffer that the
23690          * command's response data will be written. This can be either a host
23691          * physical address (HPA) or a guest physical address (GPA) and must
23692          * point to a physically contiguous block of memory.
23693          */
23694         uint64_t        resp_addr;
23695         uint32_t        flags;
23696         /*
23697          * Enumeration denoting the RX, TX type of the resource.
23698          * This enumeration is used for resources that are similar for both
23699          * TX and RX paths of the chip.
23700          */
23701         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
23702         /* tx path */
23703         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
23704         /* rx path */
23705         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
23706         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
23707                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
23708         /*
23709          * Setting of this flag indicates enabling of a byte counter for a given
23710          * flow.
23711          */
23712         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
23713         /*
23714          * Setting of this flag indicates enabling of a packet counter for a given
23715          * flow.
23716          */
23717         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
23718         /* Setting of this flag indicates de-capsulation action for the given flow. */
23719         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
23720         /* Setting of this flag indicates encapsulation action for the given flow. */
23721         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
23722         /*
23723          * Setting of this flag indicates drop action. If this flag is not set,
23724          * then it should be considered accept action.
23725          */
23726         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
23727         /*
23728          * Setting of this flag indicates that a meter is expected to be attached
23729          * to this flow. This hint can be used when choosing the action record
23730          * format required for the flow.
23731          */
23732         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
23733         uint32_t        enables;
23734         /*
23735          * This bit must be '1' for the l2_filter_id field to be
23736          * configured.
23737          */
23738         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
23739                 UINT32_C(0x1)
23740         /*
23741          * This bit must be '1' for the tunnel_type field to be
23742          * configured.
23743          */
23744         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
23745                 UINT32_C(0x2)
23746         /*
23747          * This bit must be '1' for the tunnel_id field to be
23748          * configured.
23749          */
23750         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
23751                 UINT32_C(0x4)
23752         /*
23753          * This bit must be '1' for the src_macaddr field to be
23754          * configured.
23755          */
23756         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
23757                 UINT32_C(0x8)
23758         /*
23759          * This bit must be '1' for the dst_macaddr field to be
23760          * configured.
23761          */
23762         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
23763                 UINT32_C(0x10)
23764         /*
23765          * This bit must be '1' for the ovlan_vid field to be
23766          * configured.
23767          */
23768         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
23769                 UINT32_C(0x20)
23770         /*
23771          * This bit must be '1' for the ivlan_vid field to be
23772          * configured.
23773          */
23774         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
23775                 UINT32_C(0x40)
23776         /*
23777          * This bit must be '1' for the ethertype field to be
23778          * configured.
23779          */
23780         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
23781                 UINT32_C(0x80)
23782         /*
23783          * This bit must be '1' for the src_ipaddr field to be
23784          * configured.
23785          */
23786         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
23787                 UINT32_C(0x100)
23788         /*
23789          * This bit must be '1' for the dst_ipaddr field to be
23790          * configured.
23791          */
23792         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
23793                 UINT32_C(0x200)
23794         /*
23795          * This bit must be '1' for the ipaddr_type field to be
23796          * configured.
23797          */
23798         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
23799                 UINT32_C(0x400)
23800         /*
23801          * This bit must be '1' for the ip_protocol field to be
23802          * configured.
23803          */
23804         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
23805                 UINT32_C(0x800)
23806         /*
23807          * This bit must be '1' for the src_port field to be
23808          * configured.
23809          */
23810         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
23811                 UINT32_C(0x1000)
23812         /*
23813          * This bit must be '1' for the dst_port field to be
23814          * configured.
23815          */
23816         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
23817                 UINT32_C(0x2000)
23818         /*
23819          * This bit must be '1' for the dst_id field to be
23820          * configured.
23821          */
23822         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
23823                 UINT32_C(0x4000)
23824         /*
23825          * This bit must be '1' for the mirror_vnic_id field to be
23826          * configured.
23827          */
23828         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
23829                 UINT32_C(0x8000)
23830         /*
23831          * This bit must be '1' for the encap_record_id field to be
23832          * configured.
23833          */
23834         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
23835                 UINT32_C(0x10000)
23836         /*
23837          * This bit must be '1' for the meter_instance_id field to be
23838          * configured.
23839          */
23840         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
23841                 UINT32_C(0x20000)
23842         /*
23843          * This value identifies a set of CFA data structures used for an L2
23844          * context.
23845          */
23846         uint64_t        l2_filter_id;
23847         /* Tunnel Type. */
23848         uint8_t tunnel_type;
23849         /* Non-tunnel */
23850         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
23851                 UINT32_C(0x0)
23852         /* Virtual eXtensible Local Area Network (VXLAN) */
23853         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
23854                 UINT32_C(0x1)
23855         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
23856         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
23857                 UINT32_C(0x2)
23858         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
23859         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
23860                 UINT32_C(0x3)
23861         /* IP in IP */
23862         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
23863                 UINT32_C(0x4)
23864         /* Generic Network Virtualization Encapsulation (Geneve) */
23865         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
23866                 UINT32_C(0x5)
23867         /* Multi-Protocol Lable Switching (MPLS) */
23868         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
23869                 UINT32_C(0x6)
23870         /* Stateless Transport Tunnel (STT) */
23871         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
23872                 UINT32_C(0x7)
23873         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
23874         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
23875                 UINT32_C(0x8)
23876         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
23877         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
23878                 UINT32_C(0x9)
23879         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
23880         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
23881                 UINT32_C(0xa)
23882         /* Use fixed layer 2 ether type of 0xFFFF */
23883         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
23884                 UINT32_C(0xb)
23885         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
23886         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
23887                 UINT32_C(0xc)
23888         /* Any tunneled traffic */
23889         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
23890                 UINT32_C(0xff)
23891         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
23892                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
23893         uint8_t unused_0[3];
23894         /*
23895          * Tunnel identifier.
23896          * Virtual Network Identifier (VNI). Only valid with
23897          * tunnel_types VXLAN, NVGRE, and Geneve.
23898          * Only lower 24-bits of VNI field are used
23899          * in setting up the filter.
23900          */
23901         uint32_t        tunnel_id;
23902         /*
23903          * This value indicates the source MAC address in
23904          * the Ethernet header.
23905          */
23906         uint8_t src_macaddr[6];
23907         /* The meter instance to attach to the flow. */
23908         uint16_t        meter_instance_id;
23909         /*
23910          * A value of 0xfff is considered invalid and implies the
23911          * instance is not configured.
23912          */
23913         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
23914                 UINT32_C(0xffff)
23915         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
23916                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
23917         /*
23918          * This value indicates the destination MAC address in
23919          * the Ethernet header.
23920          */
23921         uint8_t dst_macaddr[6];
23922         /*
23923          * This value indicates the VLAN ID of the outer VLAN tag
23924          * in the Ethernet header.
23925          */
23926         uint16_t        ovlan_vid;
23927         /*
23928          * This value indicates the VLAN ID of the inner VLAN tag
23929          * in the Ethernet header.
23930          */
23931         uint16_t        ivlan_vid;
23932         /* This value indicates the ethertype in the Ethernet header. */
23933         uint16_t        ethertype;
23934         /*
23935          * This value indicates the type of IP address.
23936          * 4 - IPv4
23937          * 6 - IPv6
23938          * All others are invalid.
23939          */
23940         uint8_t ip_addr_type;
23941         /* invalid */
23942         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
23943         /* IPv4 */
23944         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
23945         /* IPv6 */
23946         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
23947         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
23948                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
23949         /*
23950          * The value of protocol filed in IP header.
23951          * Applies to UDP and TCP traffic.
23952          * 6 - TCP
23953          * 17 - UDP
23954          */
23955         uint8_t ip_protocol;
23956         /* invalid */
23957         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
23958         /* TCP */
23959         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
23960         /* UDP */
23961         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
23962         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
23963                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
23964         uint8_t unused_1[2];
23965         /*
23966          * The value of source IP address to be used in filtering.
23967          * For IPv4, first four bytes represent the IP address.
23968          */
23969         uint32_t        src_ipaddr[4];
23970         /*
23971          * big_endian = True
23972          *     The value of destination IP address to be used in filtering.
23973          *     For IPv4, first four bytes represent the IP address.
23974          */
23975         uint32_t        dst_ipaddr[4];
23976         /*
23977          * The value of source port to be used in filtering.
23978          * Applies to UDP and TCP traffic.
23979          */
23980         uint16_t        src_port;
23981         /*
23982          * The value of destination port to be used in filtering.
23983          * Applies to UDP and TCP traffic.
23984          */
23985         uint16_t        dst_port;
23986         /*
23987          * If set, this value shall represent the
23988          * Logical VNIC ID of the destination VNIC for the RX
23989          * path and network port id of the destination port for
23990          * the TX path.
23991          */
23992         uint16_t        dst_id;
23993         /*
23994          * Logical VNIC ID of the VNIC where traffic is
23995          * mirrored.
23996          */
23997         uint16_t        mirror_vnic_id;
23998         /* Logical ID of the encapsulation record. */
23999         uint32_t        encap_record_id;
24000         uint8_t unused_2[4];
24001 } __attribute__((packed));
24002
24003 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
24004 struct hwrm_cfa_em_flow_alloc_output {
24005         /* The specific error status for the command. */
24006         uint16_t        error_code;
24007         /* The HWRM command request type. */
24008         uint16_t        req_type;
24009         /* The sequence ID from the original command. */
24010         uint16_t        seq_id;
24011         /* The length of the response data in number of bytes. */
24012         uint16_t        resp_len;
24013         /* This value is an opaque id into CFA data structures. */
24014         uint64_t        em_filter_id;
24015         /*
24016          * This is the ID of the flow associated with this
24017          * filter.
24018          * This value shall be used to match and associate the
24019          * flow identifier returned in completion records.
24020          * A value of 0xFFFFFFFF shall indicate no flow id.
24021          */
24022         uint32_t        flow_id;
24023         uint8_t unused_0[3];
24024         /*
24025          * This field is used in Output records to indicate that the output
24026          * is completely written to RAM.  This field should be read as '1'
24027          * to indicate that the output has been completely written.
24028          * When writing a command completion or response to an internal processor,
24029          * the order of writes has to be such that this field is written last.
24030          */
24031         uint8_t valid;
24032 } __attribute__((packed));
24033
24034 /*************************
24035  * hwrm_cfa_em_flow_free *
24036  *************************/
24037
24038
24039 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
24040 struct hwrm_cfa_em_flow_free_input {
24041         /* The HWRM command request type. */
24042         uint16_t        req_type;
24043         /*
24044          * The completion ring to send the completion event on. This should
24045          * be the NQ ID returned from the `nq_alloc` HWRM command.
24046          */
24047         uint16_t        cmpl_ring;
24048         /*
24049          * The sequence ID is used by the driver for tracking multiple
24050          * commands. This ID is treated as opaque data by the firmware and
24051          * the value is returned in the `hwrm_resp_hdr` upon completion.
24052          */
24053         uint16_t        seq_id;
24054         /*
24055          * The target ID of the command:
24056          * * 0x0-0xFFF8 - The function ID
24057          * * 0xFFF8-0xFFFE - Reserved for internal processors
24058          * * 0xFFFF - HWRM
24059          */
24060         uint16_t        target_id;
24061         /*
24062          * A physical address pointer pointing to a host buffer that the
24063          * command's response data will be written. This can be either a host
24064          * physical address (HPA) or a guest physical address (GPA) and must
24065          * point to a physically contiguous block of memory.
24066          */
24067         uint64_t        resp_addr;
24068         /* This value is an opaque id into CFA data structures. */
24069         uint64_t        em_filter_id;
24070 } __attribute__((packed));
24071
24072 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
24073 struct hwrm_cfa_em_flow_free_output {
24074         /* The specific error status for the command. */
24075         uint16_t        error_code;
24076         /* The HWRM command request type. */
24077         uint16_t        req_type;
24078         /* The sequence ID from the original command. */
24079         uint16_t        seq_id;
24080         /* The length of the response data in number of bytes. */
24081         uint16_t        resp_len;
24082         uint8_t unused_0[7];
24083         /*
24084          * This field is used in Output records to indicate that the output
24085          * is completely written to RAM.  This field should be read as '1'
24086          * to indicate that the output has been completely written.
24087          * When writing a command completion or response to an internal processor,
24088          * the order of writes has to be such that this field is written last.
24089          */
24090         uint8_t valid;
24091 } __attribute__((packed));
24092
24093 /********************************
24094  * hwrm_cfa_meter_profile_alloc *
24095  ********************************/
24096
24097
24098 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
24099 struct hwrm_cfa_meter_profile_alloc_input {
24100         /* The HWRM command request type. */
24101         uint16_t        req_type;
24102         /*
24103          * The completion ring to send the completion event on. This should
24104          * be the NQ ID returned from the `nq_alloc` HWRM command.
24105          */
24106         uint16_t        cmpl_ring;
24107         /*
24108          * The sequence ID is used by the driver for tracking multiple
24109          * commands. This ID is treated as opaque data by the firmware and
24110          * the value is returned in the `hwrm_resp_hdr` upon completion.
24111          */
24112         uint16_t        seq_id;
24113         /*
24114          * The target ID of the command:
24115          * * 0x0-0xFFF8 - The function ID
24116          * * 0xFFF8-0xFFFE - Reserved for internal processors
24117          * * 0xFFFF - HWRM
24118          */
24119         uint16_t        target_id;
24120         /*
24121          * A physical address pointer pointing to a host buffer that the
24122          * command's response data will be written. This can be either a host
24123          * physical address (HPA) or a guest physical address (GPA) and must
24124          * point to a physically contiguous block of memory.
24125          */
24126         uint64_t        resp_addr;
24127         uint8_t flags;
24128         /*
24129          * Enumeration denoting the RX, TX type of the resource.
24130          * This enumeration is used for resources that are similar for both
24131          * TX and RX paths of the chip.
24132          */
24133         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
24134         /* tx path */
24135         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
24136                 UINT32_C(0x0)
24137         /* rx path */
24138         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
24139                 UINT32_C(0x1)
24140         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
24141                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
24142         /* The meter algorithm type. */
24143         uint8_t meter_type;
24144         /* RFC 2697 (srTCM) */
24145         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
24146                 UINT32_C(0x0)
24147         /* RFC 2698 (trTCM) */
24148         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
24149                 UINT32_C(0x1)
24150         /* RFC 4115 (trTCM) */
24151         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
24152                 UINT32_C(0x2)
24153         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
24154                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
24155         /*
24156          * This field is reserved for the future use.
24157          * It shall be set to 0.
24158          */
24159         uint16_t        reserved1;
24160         /*
24161          * This field is reserved for the future use.
24162          * It shall be set to 0.
24163          */
24164         uint32_t        reserved2;
24165         /* A meter rate specified in bytes-per-second. */
24166         uint32_t        commit_rate;
24167         /* The bandwidth value. */
24168         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
24169                 UINT32_C(0xfffffff)
24170         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
24171                 0
24172         /* The granularity of the value (bits or bytes). */
24173         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
24174                 UINT32_C(0x10000000)
24175         /* Value is in bits. */
24176         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
24177                 (UINT32_C(0x0) << 28)
24178         /* Value is in bytes. */
24179         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
24180                 (UINT32_C(0x1) << 28)
24181         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
24182                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
24183         /* bw_value_unit is 3 b */
24184         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
24185                 UINT32_C(0xe0000000)
24186         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
24187                 29
24188         /* Value is in Mb or MB (base 10). */
24189         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
24190                 (UINT32_C(0x0) << 29)
24191         /* Value is in Kb or KB (base 10). */
24192         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
24193                 (UINT32_C(0x2) << 29)
24194         /* Value is in bits or bytes. */
24195         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
24196                 (UINT32_C(0x4) << 29)
24197         /* Value is in Gb or GB (base 10). */
24198         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
24199                 (UINT32_C(0x6) << 29)
24200         /* Value is in 1/100th of a percentage of total bandwidth. */
24201         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
24202                 (UINT32_C(0x1) << 29)
24203         /* Invalid unit */
24204         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID \
24205                 (UINT32_C(0x7) << 29)
24206         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
24207                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID
24208         /* A meter burst size specified in bytes. */
24209         uint32_t        commit_burst;
24210         /* The bandwidth value. */
24211         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
24212                 UINT32_C(0xfffffff)
24213         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
24214                 0
24215         /* The granularity of the value (bits or bytes). */
24216         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
24217                 UINT32_C(0x10000000)
24218         /* Value is in bits. */
24219         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
24220                 (UINT32_C(0x0) << 28)
24221         /* Value is in bytes. */
24222         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
24223                 (UINT32_C(0x1) << 28)
24224         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
24225                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
24226         /* bw_value_unit is 3 b */
24227         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
24228                 UINT32_C(0xe0000000)
24229         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
24230                 29
24231         /* Value is in Mb or MB (base 10). */
24232         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
24233                 (UINT32_C(0x0) << 29)
24234         /* Value is in Kb or KB (base 10). */
24235         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
24236                 (UINT32_C(0x2) << 29)
24237         /* Value is in bits or bytes. */
24238         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
24239                 (UINT32_C(0x4) << 29)
24240         /* Value is in Gb or GB (base 10). */
24241         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
24242                 (UINT32_C(0x6) << 29)
24243         /* Value is in 1/100th of a percentage of total bandwidth. */
24244         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
24245                 (UINT32_C(0x1) << 29)
24246         /* Invalid unit */
24247         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
24248                 (UINT32_C(0x7) << 29)
24249         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
24250                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
24251         /* A meter rate specified in bytes-per-second. */
24252         uint32_t        excess_peak_rate;
24253         /* The bandwidth value. */
24254         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
24255                 UINT32_C(0xfffffff)
24256         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
24257                 0
24258         /* The granularity of the value (bits or bytes). */
24259         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
24260                 UINT32_C(0x10000000)
24261         /* Value is in bits. */
24262         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
24263                 (UINT32_C(0x0) << 28)
24264         /* Value is in bytes. */
24265         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
24266                 (UINT32_C(0x1) << 28)
24267         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
24268                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
24269         /* bw_value_unit is 3 b */
24270         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
24271                 UINT32_C(0xe0000000)
24272         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
24273                 29
24274         /* Value is in Mb or MB (base 10). */
24275         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
24276                 (UINT32_C(0x0) << 29)
24277         /* Value is in Kb or KB (base 10). */
24278         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
24279                 (UINT32_C(0x2) << 29)
24280         /* Value is in bits or bytes. */
24281         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
24282                 (UINT32_C(0x4) << 29)
24283         /* Value is in Gb or GB (base 10). */
24284         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
24285                 (UINT32_C(0x6) << 29)
24286         /* Value is in 1/100th of a percentage of total bandwidth. */
24287         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
24288                 (UINT32_C(0x1) << 29)
24289         /* Invalid unit */
24290         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID \
24291                 (UINT32_C(0x7) << 29)
24292         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
24293                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID
24294         /* A meter burst size specified in bytes. */
24295         uint32_t        excess_peak_burst;
24296         /* The bandwidth value. */
24297         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
24298                 UINT32_C(0xfffffff)
24299         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
24300                 0
24301         /* The granularity of the value (bits or bytes). */
24302         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
24303                 UINT32_C(0x10000000)
24304         /* Value is in bits. */
24305         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
24306                 (UINT32_C(0x0) << 28)
24307         /* Value is in bytes. */
24308         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
24309                 (UINT32_C(0x1) << 28)
24310         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
24311                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
24312         /* bw_value_unit is 3 b */
24313         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
24314                 UINT32_C(0xe0000000)
24315         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
24316                 29
24317         /* Value is in Mb or MB (base 10). */
24318         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
24319                 (UINT32_C(0x0) << 29)
24320         /* Value is in Kb or KB (base 10). */
24321         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
24322                 (UINT32_C(0x2) << 29)
24323         /* Value is in bits or bytes. */
24324         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
24325                 (UINT32_C(0x4) << 29)
24326         /* Value is in Gb or GB (base 10). */
24327         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
24328                 (UINT32_C(0x6) << 29)
24329         /* Value is in 1/100th of a percentage of total bandwidth. */
24330         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
24331                 (UINT32_C(0x1) << 29)
24332         /* Invalid unit */
24333         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
24334                 (UINT32_C(0x7) << 29)
24335         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
24336                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
24337 } __attribute__((packed));
24338
24339 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
24340 struct hwrm_cfa_meter_profile_alloc_output {
24341         /* The specific error status for the command. */
24342         uint16_t        error_code;
24343         /* The HWRM command request type. */
24344         uint16_t        req_type;
24345         /* The sequence ID from the original command. */
24346         uint16_t        seq_id;
24347         /* The length of the response data in number of bytes. */
24348         uint16_t        resp_len;
24349         /* This value identifies a meter profile in CFA. */
24350         uint16_t        meter_profile_id;
24351         /*
24352          * A value of 0xfff is considered invalid and implies the
24353          * profile is not configured.
24354          */
24355         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
24356                 UINT32_C(0xffff)
24357         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
24358                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
24359         uint8_t unused_0[5];
24360         /*
24361          * This field is used in Output records to indicate that the output
24362          * is completely written to RAM.  This field should be read as '1'
24363          * to indicate that the output has been completely written.
24364          * When writing a command completion or response to an internal processor,
24365          * the order of writes has to be such that this field is written last.
24366          */
24367         uint8_t valid;
24368 } __attribute__((packed));
24369
24370 /*******************************
24371  * hwrm_cfa_meter_profile_free *
24372  *******************************/
24373
24374
24375 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
24376 struct hwrm_cfa_meter_profile_free_input {
24377         /* The HWRM command request type. */
24378         uint16_t        req_type;
24379         /*
24380          * The completion ring to send the completion event on. This should
24381          * be the NQ ID returned from the `nq_alloc` HWRM command.
24382          */
24383         uint16_t        cmpl_ring;
24384         /*
24385          * The sequence ID is used by the driver for tracking multiple
24386          * commands. This ID is treated as opaque data by the firmware and
24387          * the value is returned in the `hwrm_resp_hdr` upon completion.
24388          */
24389         uint16_t        seq_id;
24390         /*
24391          * The target ID of the command:
24392          * * 0x0-0xFFF8 - The function ID
24393          * * 0xFFF8-0xFFFE - Reserved for internal processors
24394          * * 0xFFFF - HWRM
24395          */
24396         uint16_t        target_id;
24397         /*
24398          * A physical address pointer pointing to a host buffer that the
24399          * command's response data will be written. This can be either a host
24400          * physical address (HPA) or a guest physical address (GPA) and must
24401          * point to a physically contiguous block of memory.
24402          */
24403         uint64_t        resp_addr;
24404         uint8_t flags;
24405         /*
24406          * Enumeration denoting the RX, TX type of the resource.
24407          * This enumeration is used for resources that are similar for both
24408          * TX and RX paths of the chip.
24409          */
24410         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
24411         /* tx path */
24412         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
24413                 UINT32_C(0x0)
24414         /* rx path */
24415         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
24416                 UINT32_C(0x1)
24417         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
24418                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
24419         uint8_t unused_0;
24420         /* This value identifies a meter profile in CFA. */
24421         uint16_t        meter_profile_id;
24422         /*
24423          * A value of 0xfff is considered invalid and implies the
24424          * profile is not configured.
24425          */
24426         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
24427                 UINT32_C(0xffff)
24428         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
24429                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
24430         uint8_t unused_1[4];
24431 } __attribute__((packed));
24432
24433 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
24434 struct hwrm_cfa_meter_profile_free_output {
24435         /* The specific error status for the command. */
24436         uint16_t        error_code;
24437         /* The HWRM command request type. */
24438         uint16_t        req_type;
24439         /* The sequence ID from the original command. */
24440         uint16_t        seq_id;
24441         /* The length of the response data in number of bytes. */
24442         uint16_t        resp_len;
24443         uint8_t unused_0[7];
24444         /*
24445          * This field is used in Output records to indicate that the output
24446          * is completely written to RAM.  This field should be read as '1'
24447          * to indicate that the output has been completely written.
24448          * When writing a command completion or response to an internal processor,
24449          * the order of writes has to be such that this field is written last.
24450          */
24451         uint8_t valid;
24452 } __attribute__((packed));
24453
24454 /******************************
24455  * hwrm_cfa_meter_profile_cfg *
24456  ******************************/
24457
24458
24459 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
24460 struct hwrm_cfa_meter_profile_cfg_input {
24461         /* The HWRM command request type. */
24462         uint16_t        req_type;
24463         /*
24464          * The completion ring to send the completion event on. This should
24465          * be the NQ ID returned from the `nq_alloc` HWRM command.
24466          */
24467         uint16_t        cmpl_ring;
24468         /*
24469          * The sequence ID is used by the driver for tracking multiple
24470          * commands. This ID is treated as opaque data by the firmware and
24471          * the value is returned in the `hwrm_resp_hdr` upon completion.
24472          */
24473         uint16_t        seq_id;
24474         /*
24475          * The target ID of the command:
24476          * * 0x0-0xFFF8 - The function ID
24477          * * 0xFFF8-0xFFFE - Reserved for internal processors
24478          * * 0xFFFF - HWRM
24479          */
24480         uint16_t        target_id;
24481         /*
24482          * A physical address pointer pointing to a host buffer that the
24483          * command's response data will be written. This can be either a host
24484          * physical address (HPA) or a guest physical address (GPA) and must
24485          * point to a physically contiguous block of memory.
24486          */
24487         uint64_t        resp_addr;
24488         uint8_t flags;
24489         /*
24490          * Enumeration denoting the RX, TX type of the resource.
24491          * This enumeration is used for resources that are similar for both
24492          * TX and RX paths of the chip.
24493          */
24494         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
24495         /* tx path */
24496         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
24497         /* rx path */
24498         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
24499         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
24500                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
24501         /* The meter algorithm type. */
24502         uint8_t meter_type;
24503         /* RFC 2697 (srTCM) */
24504         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
24505                 UINT32_C(0x0)
24506         /* RFC 2698 (trTCM) */
24507         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
24508                 UINT32_C(0x1)
24509         /* RFC 4115 (trTCM) */
24510         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
24511                 UINT32_C(0x2)
24512         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
24513                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
24514         /* This value identifies a meter profile in CFA. */
24515         uint16_t        meter_profile_id;
24516         /*
24517          * A value of 0xfff is considered invalid and implies the
24518          * profile is not configured.
24519          */
24520         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
24521                 UINT32_C(0xffff)
24522         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
24523                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
24524         /*
24525          * This field is reserved for the future use.
24526          * It shall be set to 0.
24527          */
24528         uint32_t        reserved;
24529         /* A meter rate specified in bytes-per-second. */
24530         uint32_t        commit_rate;
24531         /* The bandwidth value. */
24532         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
24533                 UINT32_C(0xfffffff)
24534         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
24535                 0
24536         /* The granularity of the value (bits or bytes). */
24537         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
24538                 UINT32_C(0x10000000)
24539         /* Value is in bits. */
24540         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
24541                 (UINT32_C(0x0) << 28)
24542         /* Value is in bytes. */
24543         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
24544                 (UINT32_C(0x1) << 28)
24545         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
24546                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
24547         /* bw_value_unit is 3 b */
24548         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
24549                 UINT32_C(0xe0000000)
24550         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
24551                 29
24552         /* Value is in Mb or MB (base 10). */
24553         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
24554                 (UINT32_C(0x0) << 29)
24555         /* Value is in Kb or KB (base 10). */
24556         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
24557                 (UINT32_C(0x2) << 29)
24558         /* Value is in bits or bytes. */
24559         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
24560                 (UINT32_C(0x4) << 29)
24561         /* Value is in Gb or GB (base 10). */
24562         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
24563                 (UINT32_C(0x6) << 29)
24564         /* Value is in 1/100th of a percentage of total bandwidth. */
24565         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
24566                 (UINT32_C(0x1) << 29)
24567         /* Invalid unit */
24568         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID \
24569                 (UINT32_C(0x7) << 29)
24570         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
24571                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_INVALID
24572         /* A meter burst size specified in bytes. */
24573         uint32_t        commit_burst;
24574         /* The bandwidth value. */
24575         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
24576                 UINT32_C(0xfffffff)
24577         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
24578                 0
24579         /* The granularity of the value (bits or bytes). */
24580         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
24581                 UINT32_C(0x10000000)
24582         /* Value is in bits. */
24583         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
24584                 (UINT32_C(0x0) << 28)
24585         /* Value is in bytes. */
24586         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
24587                 (UINT32_C(0x1) << 28)
24588         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
24589                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
24590         /* bw_value_unit is 3 b */
24591         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
24592                 UINT32_C(0xe0000000)
24593         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
24594                 29
24595         /* Value is in Mb or MB (base 10). */
24596         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
24597                 (UINT32_C(0x0) << 29)
24598         /* Value is in Kb or KB (base 10). */
24599         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
24600                 (UINT32_C(0x2) << 29)
24601         /* Value is in bits or bytes. */
24602         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
24603                 (UINT32_C(0x4) << 29)
24604         /* Value is in Gb or GB (base 10). */
24605         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
24606                 (UINT32_C(0x6) << 29)
24607         /* Value is in 1/100th of a percentage of total bandwidth. */
24608         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
24609                 (UINT32_C(0x1) << 29)
24610         /* Invalid unit */
24611         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
24612                 (UINT32_C(0x7) << 29)
24613         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
24614                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
24615         /* A meter rate specified in bytes-per-second. */
24616         uint32_t        excess_peak_rate;
24617         /* The bandwidth value. */
24618         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
24619                 UINT32_C(0xfffffff)
24620         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
24621                 0
24622         /* The granularity of the value (bits or bytes). */
24623         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
24624                 UINT32_C(0x10000000)
24625         /* Value is in bits. */
24626         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
24627                 (UINT32_C(0x0) << 28)
24628         /* Value is in bytes. */
24629         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
24630                 (UINT32_C(0x1) << 28)
24631         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
24632                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
24633         /* bw_value_unit is 3 b */
24634         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
24635                 UINT32_C(0xe0000000)
24636         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
24637                 29
24638         /* Value is in Mb or MB (base 10). */
24639         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
24640                 (UINT32_C(0x0) << 29)
24641         /* Value is in Kb or KB (base 10). */
24642         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
24643                 (UINT32_C(0x2) << 29)
24644         /* Value is in bits or bytes. */
24645         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
24646                 (UINT32_C(0x4) << 29)
24647         /* Value is in Gb or GB (base 10). */
24648         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
24649                 (UINT32_C(0x6) << 29)
24650         /* Value is in 1/100th of a percentage of total bandwidth. */
24651         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
24652                 (UINT32_C(0x1) << 29)
24653         /* Invalid unit */
24654         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID \
24655                 (UINT32_C(0x7) << 29)
24656         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
24657                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_INVALID
24658         /* A meter burst size specified in bytes. */
24659         uint32_t        excess_peak_burst;
24660         /* The bandwidth value. */
24661         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
24662                 UINT32_C(0xfffffff)
24663         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
24664                 0
24665         /* The granularity of the value (bits or bytes). */
24666         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
24667                 UINT32_C(0x10000000)
24668         /* Value is in bits. */
24669         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
24670                 (UINT32_C(0x0) << 28)
24671         /* Value is in bytes. */
24672         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
24673                 (UINT32_C(0x1) << 28)
24674         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
24675                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
24676         /* bw_value_unit is 3 b */
24677         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
24678                 UINT32_C(0xe0000000)
24679         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
24680                 29
24681         /* Value is in Mb or MB (base 10). */
24682         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
24683                 (UINT32_C(0x0) << 29)
24684         /* Value is in Kb or KB (base 10). */
24685         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
24686                 (UINT32_C(0x2) << 29)
24687         /* Value is in bits or bytes. */
24688         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
24689                 (UINT32_C(0x4) << 29)
24690         /* Value is in Gb or GB (base 10). */
24691         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
24692                 (UINT32_C(0x6) << 29)
24693         /* Value is in 1/100th of a percentage of total bandwidth. */
24694         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
24695                 (UINT32_C(0x1) << 29)
24696         /* Invalid unit */
24697         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
24698                 (UINT32_C(0x7) << 29)
24699         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
24700                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
24701 } __attribute__((packed));
24702
24703 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
24704 struct hwrm_cfa_meter_profile_cfg_output {
24705         /* The specific error status for the command. */
24706         uint16_t        error_code;
24707         /* The HWRM command request type. */
24708         uint16_t        req_type;
24709         /* The sequence ID from the original command. */
24710         uint16_t        seq_id;
24711         /* The length of the response data in number of bytes. */
24712         uint16_t        resp_len;
24713         uint8_t unused_0[7];
24714         /*
24715          * This field is used in Output records to indicate that the output
24716          * is completely written to RAM.  This field should be read as '1'
24717          * to indicate that the output has been completely written.
24718          * When writing a command completion or response to an internal processor,
24719          * the order of writes has to be such that this field is written last.
24720          */
24721         uint8_t valid;
24722 } __attribute__((packed));
24723
24724 /*********************************
24725  * hwrm_cfa_meter_instance_alloc *
24726  *********************************/
24727
24728
24729 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
24730 struct hwrm_cfa_meter_instance_alloc_input {
24731         /* The HWRM command request type. */
24732         uint16_t        req_type;
24733         /*
24734          * The completion ring to send the completion event on. This should
24735          * be the NQ ID returned from the `nq_alloc` HWRM command.
24736          */
24737         uint16_t        cmpl_ring;
24738         /*
24739          * The sequence ID is used by the driver for tracking multiple
24740          * commands. This ID is treated as opaque data by the firmware and
24741          * the value is returned in the `hwrm_resp_hdr` upon completion.
24742          */
24743         uint16_t        seq_id;
24744         /*
24745          * The target ID of the command:
24746          * * 0x0-0xFFF8 - The function ID
24747          * * 0xFFF8-0xFFFE - Reserved for internal processors
24748          * * 0xFFFF - HWRM
24749          */
24750         uint16_t        target_id;
24751         /*
24752          * A physical address pointer pointing to a host buffer that the
24753          * command's response data will be written. This can be either a host
24754          * physical address (HPA) or a guest physical address (GPA) and must
24755          * point to a physically contiguous block of memory.
24756          */
24757         uint64_t        resp_addr;
24758         uint8_t flags;
24759         /*
24760          * Enumeration denoting the RX, TX type of the resource.
24761          * This enumeration is used for resources that are similar for both
24762          * TX and RX paths of the chip.
24763          */
24764         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
24765                 UINT32_C(0x1)
24766         /* tx path */
24767         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
24768                 UINT32_C(0x0)
24769         /* rx path */
24770         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
24771                 UINT32_C(0x1)
24772         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
24773                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
24774         uint8_t unused_0;
24775         /* This value identifies a meter profile in CFA. */
24776         uint16_t        meter_profile_id;
24777         /*
24778          * A value of 0xfff is considered invalid and implies the
24779          * profile is not configured.
24780          */
24781         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
24782                 UINT32_C(0xffff)
24783         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
24784                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
24785         uint8_t unused_1[4];
24786 } __attribute__((packed));
24787
24788 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
24789 struct hwrm_cfa_meter_instance_alloc_output {
24790         /* The specific error status for the command. */
24791         uint16_t        error_code;
24792         /* The HWRM command request type. */
24793         uint16_t        req_type;
24794         /* The sequence ID from the original command. */
24795         uint16_t        seq_id;
24796         /* The length of the response data in number of bytes. */
24797         uint16_t        resp_len;
24798         /* This value identifies a meter instance in CFA. */
24799         uint16_t        meter_instance_id;
24800         /*
24801          * A value of 0xfff is considered invalid and implies the
24802          * instance is not configured.
24803          */
24804         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
24805                 UINT32_C(0xffff)
24806         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
24807                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
24808         uint8_t unused_0[5];
24809         /*
24810          * This field is used in Output records to indicate that the output
24811          * is completely written to RAM.  This field should be read as '1'
24812          * to indicate that the output has been completely written.
24813          * When writing a command completion or response to an internal processor,
24814          * the order of writes has to be such that this field is written last.
24815          */
24816         uint8_t valid;
24817 } __attribute__((packed));
24818
24819 /********************************
24820  * hwrm_cfa_meter_instance_free *
24821  ********************************/
24822
24823
24824 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
24825 struct hwrm_cfa_meter_instance_free_input {
24826         /* The HWRM command request type. */
24827         uint16_t        req_type;
24828         /*
24829          * The completion ring to send the completion event on. This should
24830          * be the NQ ID returned from the `nq_alloc` HWRM command.
24831          */
24832         uint16_t        cmpl_ring;
24833         /*
24834          * The sequence ID is used by the driver for tracking multiple
24835          * commands. This ID is treated as opaque data by the firmware and
24836          * the value is returned in the `hwrm_resp_hdr` upon completion.
24837          */
24838         uint16_t        seq_id;
24839         /*
24840          * The target ID of the command:
24841          * * 0x0-0xFFF8 - The function ID
24842          * * 0xFFF8-0xFFFE - Reserved for internal processors
24843          * * 0xFFFF - HWRM
24844          */
24845         uint16_t        target_id;
24846         /*
24847          * A physical address pointer pointing to a host buffer that the
24848          * command's response data will be written. This can be either a host
24849          * physical address (HPA) or a guest physical address (GPA) and must
24850          * point to a physically contiguous block of memory.
24851          */
24852         uint64_t        resp_addr;
24853         uint8_t flags;
24854         /*
24855          * Enumeration denoting the RX, TX type of the resource.
24856          * This enumeration is used for resources that are similar for both
24857          * TX and RX paths of the chip.
24858          */
24859         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
24860         /* tx path */
24861         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
24862                 UINT32_C(0x0)
24863         /* rx path */
24864         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
24865                 UINT32_C(0x1)
24866         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
24867                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
24868         uint8_t unused_0;
24869         /* This value identifies a meter instance in CFA. */
24870         uint16_t        meter_instance_id;
24871         /*
24872          * A value of 0xfff is considered invalid and implies the
24873          * instance is not configured.
24874          */
24875         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
24876                 UINT32_C(0xffff)
24877         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
24878                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
24879         uint8_t unused_1[4];
24880 } __attribute__((packed));
24881
24882 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
24883 struct hwrm_cfa_meter_instance_free_output {
24884         /* The specific error status for the command. */
24885         uint16_t        error_code;
24886         /* The HWRM command request type. */
24887         uint16_t        req_type;
24888         /* The sequence ID from the original command. */
24889         uint16_t        seq_id;
24890         /* The length of the response data in number of bytes. */
24891         uint16_t        resp_len;
24892         uint8_t unused_0[7];
24893         /*
24894          * This field is used in Output records to indicate that the output
24895          * is completely written to RAM.  This field should be read as '1'
24896          * to indicate that the output has been completely written.
24897          * When writing a command completion or response to an internal processor,
24898          * the order of writes has to be such that this field is written last.
24899          */
24900         uint8_t valid;
24901 } __attribute__((packed));
24902
24903 /*******************************
24904  * hwrm_cfa_decap_filter_alloc *
24905  *******************************/
24906
24907
24908 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
24909 struct hwrm_cfa_decap_filter_alloc_input {
24910         /* The HWRM command request type. */
24911         uint16_t        req_type;
24912         /*
24913          * The completion ring to send the completion event on. This should
24914          * be the NQ ID returned from the `nq_alloc` HWRM command.
24915          */
24916         uint16_t        cmpl_ring;
24917         /*
24918          * The sequence ID is used by the driver for tracking multiple
24919          * commands. This ID is treated as opaque data by the firmware and
24920          * the value is returned in the `hwrm_resp_hdr` upon completion.
24921          */
24922         uint16_t        seq_id;
24923         /*
24924          * The target ID of the command:
24925          * * 0x0-0xFFF8 - The function ID
24926          * * 0xFFF8-0xFFFE - Reserved for internal processors
24927          * * 0xFFFF - HWRM
24928          */
24929         uint16_t        target_id;
24930         /*
24931          * A physical address pointer pointing to a host buffer that the
24932          * command's response data will be written. This can be either a host
24933          * physical address (HPA) or a guest physical address (GPA) and must
24934          * point to a physically contiguous block of memory.
24935          */
24936         uint64_t        resp_addr;
24937         uint32_t        flags;
24938         /* ovs_tunnel is 1 b */
24939         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
24940                 UINT32_C(0x1)
24941         uint32_t        enables;
24942         /*
24943          * This bit must be '1' for the tunnel_type field to be
24944          * configured.
24945          */
24946         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
24947                 UINT32_C(0x1)
24948         /*
24949          * This bit must be '1' for the tunnel_id field to be
24950          * configured.
24951          */
24952         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
24953                 UINT32_C(0x2)
24954         /*
24955          * This bit must be '1' for the src_macaddr field to be
24956          * configured.
24957          */
24958         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
24959                 UINT32_C(0x4)
24960         /*
24961          * This bit must be '1' for the dst_macaddr field to be
24962          * configured.
24963          */
24964         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
24965                 UINT32_C(0x8)
24966         /*
24967          * This bit must be '1' for the ovlan_vid field to be
24968          * configured.
24969          */
24970         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
24971                 UINT32_C(0x10)
24972         /*
24973          * This bit must be '1' for the ivlan_vid field to be
24974          * configured.
24975          */
24976         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
24977                 UINT32_C(0x20)
24978         /*
24979          * This bit must be '1' for the t_ovlan_vid field to be
24980          * configured.
24981          */
24982         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
24983                 UINT32_C(0x40)
24984         /*
24985          * This bit must be '1' for the t_ivlan_vid field to be
24986          * configured.
24987          */
24988         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
24989                 UINT32_C(0x80)
24990         /*
24991          * This bit must be '1' for the ethertype field to be
24992          * configured.
24993          */
24994         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
24995                 UINT32_C(0x100)
24996         /*
24997          * This bit must be '1' for the src_ipaddr field to be
24998          * configured.
24999          */
25000         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
25001                 UINT32_C(0x200)
25002         /*
25003          * This bit must be '1' for the dst_ipaddr field to be
25004          * configured.
25005          */
25006         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
25007                 UINT32_C(0x400)
25008         /*
25009          * This bit must be '1' for the ipaddr_type field to be
25010          * configured.
25011          */
25012         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
25013                 UINT32_C(0x800)
25014         /*
25015          * This bit must be '1' for the ip_protocol field to be
25016          * configured.
25017          */
25018         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
25019                 UINT32_C(0x1000)
25020         /*
25021          * This bit must be '1' for the src_port field to be
25022          * configured.
25023          */
25024         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
25025                 UINT32_C(0x2000)
25026         /*
25027          * This bit must be '1' for the dst_port field to be
25028          * configured.
25029          */
25030         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
25031                 UINT32_C(0x4000)
25032         /*
25033          * This bit must be '1' for the dst_id field to be
25034          * configured.
25035          */
25036         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
25037                 UINT32_C(0x8000)
25038         /*
25039          * This bit must be '1' for the mirror_vnic_id field to be
25040          * configured.
25041          */
25042         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
25043                 UINT32_C(0x10000)
25044         /*
25045          * Tunnel identifier.
25046          * Virtual Network Identifier (VNI). Only valid with
25047          * tunnel_types VXLAN, NVGRE, and Geneve.
25048          * Only lower 24-bits of VNI field are used
25049          * in setting up the filter.
25050          */
25051         uint32_t        tunnel_id;
25052         /* Tunnel Type. */
25053         uint8_t tunnel_type;
25054         /* Non-tunnel */
25055         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25056                 UINT32_C(0x0)
25057         /* Virtual eXtensible Local Area Network (VXLAN) */
25058         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25059                 UINT32_C(0x1)
25060         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25061         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25062                 UINT32_C(0x2)
25063         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25064         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25065                 UINT32_C(0x3)
25066         /* IP in IP */
25067         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25068                 UINT32_C(0x4)
25069         /* Generic Network Virtualization Encapsulation (Geneve) */
25070         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25071                 UINT32_C(0x5)
25072         /* Multi-Protocol Lable Switching (MPLS) */
25073         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25074                 UINT32_C(0x6)
25075         /* Stateless Transport Tunnel (STT) */
25076         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
25077                 UINT32_C(0x7)
25078         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25079         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25080                 UINT32_C(0x8)
25081         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25082         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25083                 UINT32_C(0x9)
25084         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25085         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25086                 UINT32_C(0xa)
25087         /* Use fixed layer 2 ether type of 0xFFFF */
25088         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25089                 UINT32_C(0xb)
25090         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25091         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25092                 UINT32_C(0xc)
25093         /* Any tunneled traffic */
25094         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25095                 UINT32_C(0xff)
25096         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25097                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25098         uint8_t unused_0;
25099         uint16_t        unused_1;
25100         /*
25101          * This value indicates the source MAC address in
25102          * the Ethernet header.
25103          */
25104         uint8_t src_macaddr[6];
25105         uint8_t unused_2[2];
25106         /*
25107          * This value indicates the destination MAC address in
25108          * the Ethernet header.
25109          */
25110         uint8_t dst_macaddr[6];
25111         /*
25112          * This value indicates the VLAN ID of the outer VLAN tag
25113          * in the Ethernet header.
25114          */
25115         uint16_t        ovlan_vid;
25116         /*
25117          * This value indicates the VLAN ID of the inner VLAN tag
25118          * in the Ethernet header.
25119          */
25120         uint16_t        ivlan_vid;
25121         /*
25122          * This value indicates the VLAN ID of the outer VLAN tag
25123          * in the tunnel Ethernet header.
25124          */
25125         uint16_t        t_ovlan_vid;
25126         /*
25127          * This value indicates the VLAN ID of the inner VLAN tag
25128          * in the tunnel Ethernet header.
25129          */
25130         uint16_t        t_ivlan_vid;
25131         /* This value indicates the ethertype in the Ethernet header. */
25132         uint16_t        ethertype;
25133         /*
25134          * This value indicates the type of IP address.
25135          * 4 - IPv4
25136          * 6 - IPv6
25137          * All others are invalid.
25138          */
25139         uint8_t ip_addr_type;
25140         /* invalid */
25141         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
25142                 UINT32_C(0x0)
25143         /* IPv4 */
25144         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
25145                 UINT32_C(0x4)
25146         /* IPv6 */
25147         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
25148                 UINT32_C(0x6)
25149         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
25150                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
25151         /*
25152          * The value of protocol filed in IP header.
25153          * Applies to UDP and TCP traffic.
25154          * 6 - TCP
25155          * 17 - UDP
25156          */
25157         uint8_t ip_protocol;
25158         /* invalid */
25159         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
25160                 UINT32_C(0x0)
25161         /* TCP */
25162         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
25163                 UINT32_C(0x6)
25164         /* UDP */
25165         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
25166                 UINT32_C(0x11)
25167         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
25168                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
25169         uint16_t        unused_3;
25170         uint32_t        unused_4;
25171         /*
25172          * The value of source IP address to be used in filtering.
25173          * For IPv4, first four bytes represent the IP address.
25174          */
25175         uint32_t        src_ipaddr[4];
25176         /*
25177          * The value of destination IP address to be used in filtering.
25178          * For IPv4, first four bytes represent the IP address.
25179          */
25180         uint32_t        dst_ipaddr[4];
25181         /*
25182          * The value of source port to be used in filtering.
25183          * Applies to UDP and TCP traffic.
25184          */
25185         uint16_t        src_port;
25186         /*
25187          * The value of destination port to be used in filtering.
25188          * Applies to UDP and TCP traffic.
25189          */
25190         uint16_t        dst_port;
25191         /*
25192          * If set, this value shall represent the
25193          * Logical VNIC ID of the destination VNIC for the RX
25194          * path.
25195          */
25196         uint16_t        dst_id;
25197         /*
25198          * If set, this value shall represent the L2 context that matches the L2
25199          * information of the decap filter.
25200          */
25201         uint16_t        l2_ctxt_ref_id;
25202 } __attribute__((packed));
25203
25204 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
25205 struct hwrm_cfa_decap_filter_alloc_output {
25206         /* The specific error status for the command. */
25207         uint16_t        error_code;
25208         /* The HWRM command request type. */
25209         uint16_t        req_type;
25210         /* The sequence ID from the original command. */
25211         uint16_t        seq_id;
25212         /* The length of the response data in number of bytes. */
25213         uint16_t        resp_len;
25214         /* This value is an opaque id into CFA data structures. */
25215         uint32_t        decap_filter_id;
25216         uint8_t unused_0[3];
25217         /*
25218          * This field is used in Output records to indicate that the output
25219          * is completely written to RAM.  This field should be read as '1'
25220          * to indicate that the output has been completely written.
25221          * When writing a command completion or response to an internal processor,
25222          * the order of writes has to be such that this field is written last.
25223          */
25224         uint8_t valid;
25225 } __attribute__((packed));
25226
25227 /******************************
25228  * hwrm_cfa_decap_filter_free *
25229  ******************************/
25230
25231
25232 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
25233 struct hwrm_cfa_decap_filter_free_input {
25234         /* The HWRM command request type. */
25235         uint16_t        req_type;
25236         /*
25237          * The completion ring to send the completion event on. This should
25238          * be the NQ ID returned from the `nq_alloc` HWRM command.
25239          */
25240         uint16_t        cmpl_ring;
25241         /*
25242          * The sequence ID is used by the driver for tracking multiple
25243          * commands. This ID is treated as opaque data by the firmware and
25244          * the value is returned in the `hwrm_resp_hdr` upon completion.
25245          */
25246         uint16_t        seq_id;
25247         /*
25248          * The target ID of the command:
25249          * * 0x0-0xFFF8 - The function ID
25250          * * 0xFFF8-0xFFFE - Reserved for internal processors
25251          * * 0xFFFF - HWRM
25252          */
25253         uint16_t        target_id;
25254         /*
25255          * A physical address pointer pointing to a host buffer that the
25256          * command's response data will be written. This can be either a host
25257          * physical address (HPA) or a guest physical address (GPA) and must
25258          * point to a physically contiguous block of memory.
25259          */
25260         uint64_t        resp_addr;
25261         /* This value is an opaque id into CFA data structures. */
25262         uint32_t        decap_filter_id;
25263         uint8_t unused_0[4];
25264 } __attribute__((packed));
25265
25266 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
25267 struct hwrm_cfa_decap_filter_free_output {
25268         /* The specific error status for the command. */
25269         uint16_t        error_code;
25270         /* The HWRM command request type. */
25271         uint16_t        req_type;
25272         /* The sequence ID from the original command. */
25273         uint16_t        seq_id;
25274         /* The length of the response data in number of bytes. */
25275         uint16_t        resp_len;
25276         uint8_t unused_0[7];
25277         /*
25278          * This field is used in Output records to indicate that the output
25279          * is completely written to RAM.  This field should be read as '1'
25280          * to indicate that the output has been completely written.
25281          * When writing a command completion or response to an internal processor,
25282          * the order of writes has to be such that this field is written last.
25283          */
25284         uint8_t valid;
25285 } __attribute__((packed));
25286
25287 /***********************
25288  * hwrm_cfa_flow_alloc *
25289  ***********************/
25290
25291
25292 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
25293 struct hwrm_cfa_flow_alloc_input {
25294         /* The HWRM command request type. */
25295         uint16_t        req_type;
25296         /*
25297          * The completion ring to send the completion event on. This should
25298          * be the NQ ID returned from the `nq_alloc` HWRM command.
25299          */
25300         uint16_t        cmpl_ring;
25301         /*
25302          * The sequence ID is used by the driver for tracking multiple
25303          * commands. This ID is treated as opaque data by the firmware and
25304          * the value is returned in the `hwrm_resp_hdr` upon completion.
25305          */
25306         uint16_t        seq_id;
25307         /*
25308          * The target ID of the command:
25309          * * 0x0-0xFFF8 - The function ID
25310          * * 0xFFF8-0xFFFE - Reserved for internal processors
25311          * * 0xFFFF - HWRM
25312          */
25313         uint16_t        target_id;
25314         /*
25315          * A physical address pointer pointing to a host buffer that the
25316          * command's response data will be written. This can be either a host
25317          * physical address (HPA) or a guest physical address (GPA) and must
25318          * point to a physically contiguous block of memory.
25319          */
25320         uint64_t        resp_addr;
25321         uint16_t        flags;
25322         /* tunnel is 1 b */
25323         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
25324                 UINT32_C(0x1)
25325         /* num_vlan is 2 b */
25326         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
25327                 UINT32_C(0x6)
25328         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
25329         /* no tags */
25330         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
25331                 (UINT32_C(0x0) << 1)
25332         /* 1 tag */
25333         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
25334                 (UINT32_C(0x1) << 1)
25335         /* 2 tags */
25336         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
25337                 (UINT32_C(0x2) << 1)
25338         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
25339                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
25340         /* Enumeration denoting the Flow Type. */
25341         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
25342                 UINT32_C(0x38)
25343         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
25344         /* L2 flow */
25345         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
25346                 (UINT32_C(0x0) << 3)
25347         /* IPV4 flow */
25348         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
25349                 (UINT32_C(0x1) << 3)
25350         /* IPV6 flow */
25351         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
25352                 (UINT32_C(0x2) << 3)
25353         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
25354                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
25355         /*
25356          * when set to 1, indicates TX flow offload for function specified in src_fid and
25357          * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both
25358          * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload
25359          * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV
25360          * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID
25361          * belong to the children VFs of the same PF to indicate VM to VM flow.
25362          */
25363         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
25364                 UINT32_C(0x40)
25365         /*
25366          * when set to 1, indicates RX flow offload for function specified in dst_fid and
25367          * the src_fid should be set to invalid value.
25368          */
25369         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
25370                 UINT32_C(0x80)
25371         /*
25372          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is
25373          * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field.
25374          * This flag is only valid when the flow direction is RX.
25375          */
25376         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
25377                 UINT32_C(0x100)
25378         /*
25379          * Tx Flow: vf fid.
25380          * Rx Flow: pf fid.
25381          */
25382         uint16_t        src_fid;
25383         /* Tunnel handle valid when tunnel flag is set. */
25384         uint32_t        tunnel_handle;
25385         uint16_t        action_flags;
25386         /*
25387          * Setting of this flag indicates drop action. If this flag is not set,
25388          * then it should be considered accept action.
25389          */
25390         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
25391                 UINT32_C(0x1)
25392         /* recycle is 1 b */
25393         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
25394                 UINT32_C(0x2)
25395         /*
25396          * Setting of this flag indicates drop action. If this flag is not set,
25397          * then it should be considered accept action.
25398          */
25399         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
25400                 UINT32_C(0x4)
25401         /* meter is 1 b */
25402         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
25403                 UINT32_C(0x8)
25404         /* tunnel is 1 b */
25405         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
25406                 UINT32_C(0x10)
25407         /* nat_src is 1 b */
25408         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
25409                 UINT32_C(0x20)
25410         /* nat_dest is 1 b */
25411         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
25412                 UINT32_C(0x40)
25413         /* nat_ipv4_address is 1 b */
25414         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
25415                 UINT32_C(0x80)
25416         /* l2_header_rewrite is 1 b */
25417         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
25418                 UINT32_C(0x100)
25419         /* ttl_decrement is 1 b */
25420         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
25421                 UINT32_C(0x200)
25422         /*
25423          * If set to 1 and flow direction is TX, it indicates decap of L2 header
25424          * and encap of tunnel header. If set to 1 and flow direction is RX, it
25425          * indicates decap of tunnel header and encap L2 header. The type of tunnel
25426          * is specified in the tunnel_type field.
25427          */
25428         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
25429                 UINT32_C(0x400)
25430         /* If set to 1, flow aging is enabled for this flow. */
25431         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
25432                 UINT32_C(0x800)
25433         /*
25434          * Tx Flow: pf or vf fid.
25435          * Rx Flow: vf fid.
25436          */
25437         uint16_t        dst_fid;
25438         /* VLAN tpid, valid when push_vlan flag is set. */
25439         uint16_t        l2_rewrite_vlan_tpid;
25440         /* VLAN tci, valid when push_vlan flag is set. */
25441         uint16_t        l2_rewrite_vlan_tci;
25442         /* Meter id, valid when meter flag is set. */
25443         uint16_t        act_meter_id;
25444         /* Flow with the same l2 context tcam key. */
25445         uint16_t        ref_flow_handle;
25446         /* This value sets the match value for the ethertype. */
25447         uint16_t        ethertype;
25448         /* valid when num tags is 1 or 2. */
25449         uint16_t        outer_vlan_tci;
25450         /* This value sets the match value for the Destination MAC address. */
25451         uint16_t        dmac[3];
25452         /* valid when num tags is 2. */
25453         uint16_t        inner_vlan_tci;
25454         /* This value sets the match value for the Source MAC address. */
25455         uint16_t        smac[3];
25456         /* The bit length of destination IP address mask. */
25457         uint8_t ip_dst_mask_len;
25458         /* The bit length of source IP address mask. */
25459         uint8_t ip_src_mask_len;
25460         /* The value of destination IPv4/IPv6 address. */
25461         uint32_t        ip_dst[4];
25462         /* The source IPv4/IPv6 address. */
25463         uint32_t        ip_src[4];
25464         /*
25465          * The value of source port.
25466          * Applies to UDP and TCP traffic.
25467          */
25468         uint16_t        l4_src_port;
25469         /*
25470          * The value of source port mask.
25471          * Applies to UDP and TCP traffic.
25472          */
25473         uint16_t        l4_src_port_mask;
25474         /*
25475          * The value of destination port.
25476          * Applies to UDP and TCP traffic.
25477          */
25478         uint16_t        l4_dst_port;
25479         /*
25480          * The value of destination port mask.
25481          * Applies to UDP and TCP traffic.
25482          */
25483         uint16_t        l4_dst_port_mask;
25484         /*
25485          * NAT IPv4/6 address based on address type flag.
25486          * 0 values are ignored.
25487          */
25488         uint32_t        nat_ip_address[4];
25489         /* L2 header re-write Destination MAC address. */
25490         uint16_t        l2_rewrite_dmac[3];
25491         /*
25492          * The NAT source/destination port based on direction flag.
25493          * Applies to UDP and TCP traffic.
25494          * 0 values are ignored.
25495          */
25496         uint16_t        nat_port;
25497         /* L2 header re-write Source MAC address. */
25498         uint16_t        l2_rewrite_smac[3];
25499         /* The value of ip protocol. */
25500         uint8_t ip_proto;
25501         /* Tunnel Type. */
25502         uint8_t tunnel_type;
25503         /* Non-tunnel */
25504         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25505                 UINT32_C(0x0)
25506         /* Virtual eXtensible Local Area Network (VXLAN) */
25507         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25508                 UINT32_C(0x1)
25509         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25510         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25511                 UINT32_C(0x2)
25512         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25513         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25514                 UINT32_C(0x3)
25515         /* IP in IP */
25516         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25517                 UINT32_C(0x4)
25518         /* Generic Network Virtualization Encapsulation (Geneve) */
25519         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25520                 UINT32_C(0x5)
25521         /* Multi-Protocol Lable Switching (MPLS) */
25522         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25523                 UINT32_C(0x6)
25524         /* Stateless Transport Tunnel (STT) */
25525         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
25526                 UINT32_C(0x7)
25527         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25528         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25529                 UINT32_C(0x8)
25530         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25531         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25532                 UINT32_C(0x9)
25533         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25534         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25535                 UINT32_C(0xa)
25536         /* Use fixed layer 2 ether type of 0xFFFF */
25537         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25538                 UINT32_C(0xb)
25539         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25540         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25541                 UINT32_C(0xc)
25542         /* Any tunneled traffic */
25543         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25544                 UINT32_C(0xff)
25545         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25546                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25547 } __attribute__((packed));
25548
25549 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
25550 struct hwrm_cfa_flow_alloc_output {
25551         /* The specific error status for the command. */
25552         uint16_t        error_code;
25553         /* The HWRM command request type. */
25554         uint16_t        req_type;
25555         /* The sequence ID from the original command. */
25556         uint16_t        seq_id;
25557         /* The length of the response data in number of bytes. */
25558         uint16_t        resp_len;
25559         /* Flow record index. */
25560         uint16_t        flow_handle;
25561         uint8_t unused_0[2];
25562         /*
25563          * This is the ID of the flow associated with this
25564          * filter.
25565          * This value shall be used to match and associate the
25566          * flow identifier returned in completion records.
25567          * A value of 0xFFFFFFFF shall indicate no flow id.
25568          */
25569         uint32_t        flow_id;
25570         /* This value identifies a set of CFA data structures used for a flow. */
25571         uint64_t        ext_flow_handle;
25572         uint8_t unused_1[7];
25573         /*
25574          * This field is used in Output records to indicate that the output
25575          * is completely written to RAM.  This field should be read as '1'
25576          * to indicate that the output has been completely written.
25577          * When writing a command completion or response to an internal processor,
25578          * the order of writes has to be such that this field is written last.
25579          */
25580         uint8_t valid;
25581 } __attribute__((packed));
25582
25583 /**********************
25584  * hwrm_cfa_flow_free *
25585  **********************/
25586
25587
25588 /* hwrm_cfa_flow_free_input (size:256b/32B) */
25589 struct hwrm_cfa_flow_free_input {
25590         /* The HWRM command request type. */
25591         uint16_t        req_type;
25592         /*
25593          * The completion ring to send the completion event on. This should
25594          * be the NQ ID returned from the `nq_alloc` HWRM command.
25595          */
25596         uint16_t        cmpl_ring;
25597         /*
25598          * The sequence ID is used by the driver for tracking multiple
25599          * commands. This ID is treated as opaque data by the firmware and
25600          * the value is returned in the `hwrm_resp_hdr` upon completion.
25601          */
25602         uint16_t        seq_id;
25603         /*
25604          * The target ID of the command:
25605          * * 0x0-0xFFF8 - The function ID
25606          * * 0xFFF8-0xFFFE - Reserved for internal processors
25607          * * 0xFFFF - HWRM
25608          */
25609         uint16_t        target_id;
25610         /*
25611          * A physical address pointer pointing to a host buffer that the
25612          * command's response data will be written. This can be either a host
25613          * physical address (HPA) or a guest physical address (GPA) and must
25614          * point to a physically contiguous block of memory.
25615          */
25616         uint64_t        resp_addr;
25617         /* Flow record index. */
25618         uint16_t        flow_handle;
25619         uint8_t unused_0[6];
25620         /* This value identifies a set of CFA data structures used for a flow. */
25621         uint64_t        ext_flow_handle;
25622 } __attribute__((packed));
25623
25624 /* hwrm_cfa_flow_free_output (size:256b/32B) */
25625 struct hwrm_cfa_flow_free_output {
25626         /* The specific error status for the command. */
25627         uint16_t        error_code;
25628         /* The HWRM command request type. */
25629         uint16_t        req_type;
25630         /* The sequence ID from the original command. */
25631         uint16_t        seq_id;
25632         /* The length of the response data in number of bytes. */
25633         uint16_t        resp_len;
25634         /* packet is 64 b */
25635         uint64_t        packet;
25636         /* byte is 64 b */
25637         uint64_t        byte;
25638         uint8_t unused_0[7];
25639         /*
25640          * This field is used in Output records to indicate that the output
25641          * is completely written to RAM.  This field should be read as '1'
25642          * to indicate that the output has been completely written.
25643          * When writing a command completion or response to an internal processor,
25644          * the order of writes has to be such that this field is written last.
25645          */
25646         uint8_t valid;
25647 } __attribute__((packed));
25648
25649 /**********************
25650  * hwrm_cfa_flow_info *
25651  **********************/
25652
25653
25654 /* hwrm_cfa_flow_info_input (size:256b/32B) */
25655 struct hwrm_cfa_flow_info_input {
25656         /* The HWRM command request type. */
25657         uint16_t        req_type;
25658         /*
25659          * The completion ring to send the completion event on. This should
25660          * be the NQ ID returned from the `nq_alloc` HWRM command.
25661          */
25662         uint16_t        cmpl_ring;
25663         /*
25664          * The sequence ID is used by the driver for tracking multiple
25665          * commands. This ID is treated as opaque data by the firmware and
25666          * the value is returned in the `hwrm_resp_hdr` upon completion.
25667          */
25668         uint16_t        seq_id;
25669         /*
25670          * The target ID of the command:
25671          * * 0x0-0xFFF8 - The function ID
25672          * * 0xFFF8-0xFFFE - Reserved for internal processors
25673          * * 0xFFFF - HWRM
25674          */
25675         uint16_t        target_id;
25676         /*
25677          * A physical address pointer pointing to a host buffer that the
25678          * command's response data will be written. This can be either a host
25679          * physical address (HPA) or a guest physical address (GPA) and must
25680          * point to a physically contiguous block of memory.
25681          */
25682         uint64_t        resp_addr;
25683         /* Flow record index. */
25684         uint16_t        flow_handle;
25685         /* Max flow handle */
25686         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
25687                 UINT32_C(0xfff)
25688         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
25689         /* CNP flow handle */
25690         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
25691                 UINT32_C(0x1000)
25692         /* RoCEv1 flow handle */
25693         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
25694                 UINT32_C(0x2000)
25695         /* RoCEv2 flow handle */
25696         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
25697                 UINT32_C(0x4000)
25698         /* Direction rx = 1 */
25699         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
25700                 UINT32_C(0x8000)
25701         uint8_t unused_0[6];
25702         /* This value identifies a set of CFA data structures used for a flow. */
25703         uint64_t        ext_flow_handle;
25704 } __attribute__((packed));
25705
25706 /* hwrm_cfa_flow_info_output (size:448b/56B) */
25707 struct hwrm_cfa_flow_info_output {
25708         /* The specific error status for the command. */
25709         uint16_t        error_code;
25710         /* The HWRM command request type. */
25711         uint16_t        req_type;
25712         /* The sequence ID from the original command. */
25713         uint16_t        seq_id;
25714         /* The length of the response data in number of bytes. */
25715         uint16_t        resp_len;
25716         /* flags is 8 b */
25717         uint8_t flags;
25718         /* profile is 8 b */
25719         uint8_t profile;
25720         /* src_fid is 16 b */
25721         uint16_t        src_fid;
25722         /* dst_fid is 16 b */
25723         uint16_t        dst_fid;
25724         /* l2_ctxt_id is 16 b */
25725         uint16_t        l2_ctxt_id;
25726         /* em_info is 64 b */
25727         uint64_t        em_info;
25728         /* tcam_info is 64 b */
25729         uint64_t        tcam_info;
25730         /* vfp_tcam_info is 64 b */
25731         uint64_t        vfp_tcam_info;
25732         /* ar_id is 16 b */
25733         uint16_t        ar_id;
25734         /* flow_handle is 16 b */
25735         uint16_t        flow_handle;
25736         /* tunnel_handle is 32 b */
25737         uint32_t        tunnel_handle;
25738         /* The flow aging timer for the flow, the unit is 100 milliseconds */
25739         uint16_t        flow_timer;
25740         uint8_t unused_0[5];
25741         /*
25742          * This field is used in Output records to indicate that the output
25743          * is completely written to RAM.  This field should be read as '1'
25744          * to indicate that the output has been completely written.
25745          * When writing a command completion or response to an internal processor,
25746          * the order of writes has to be such that this field is written last.
25747          */
25748         uint8_t valid;
25749 } __attribute__((packed));
25750
25751 /***********************
25752  * hwrm_cfa_flow_flush *
25753  ***********************/
25754
25755
25756 /* hwrm_cfa_flow_flush_input (size:192b/24B) */
25757 struct hwrm_cfa_flow_flush_input {
25758         /* The HWRM command request type. */
25759         uint16_t        req_type;
25760         /*
25761          * The completion ring to send the completion event on. This should
25762          * be the NQ ID returned from the `nq_alloc` HWRM command.
25763          */
25764         uint16_t        cmpl_ring;
25765         /*
25766          * The sequence ID is used by the driver for tracking multiple
25767          * commands. This ID is treated as opaque data by the firmware and
25768          * the value is returned in the `hwrm_resp_hdr` upon completion.
25769          */
25770         uint16_t        seq_id;
25771         /*
25772          * The target ID of the command:
25773          * * 0x0-0xFFF8 - The function ID
25774          * * 0xFFF8-0xFFFE - Reserved for internal processors
25775          * * 0xFFFF - HWRM
25776          */
25777         uint16_t        target_id;
25778         /*
25779          * A physical address pointer pointing to a host buffer that the
25780          * command's response data will be written. This can be either a host
25781          * physical address (HPA) or a guest physical address (GPA) and must
25782          * point to a physically contiguous block of memory.
25783          */
25784         uint64_t        resp_addr;
25785         uint32_t        flags;
25786         uint8_t unused_0[4];
25787 } __attribute__((packed));
25788
25789 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
25790 struct hwrm_cfa_flow_flush_output {
25791         /* The specific error status for the command. */
25792         uint16_t        error_code;
25793         /* The HWRM command request type. */
25794         uint16_t        req_type;
25795         /* The sequence ID from the original command. */
25796         uint16_t        seq_id;
25797         /* The length of the response data in number of bytes. */
25798         uint16_t        resp_len;
25799         uint8_t unused_0[7];
25800         /*
25801          * This field is used in Output records to indicate that the output
25802          * is completely written to RAM.  This field should be read as '1'
25803          * to indicate that the output has been completely written.
25804          * When writing a command completion or response to an internal processor,
25805          * the order of writes has to be such that this field is written last.
25806          */
25807         uint8_t valid;
25808 } __attribute__((packed));
25809
25810 /***********************
25811  * hwrm_cfa_flow_stats *
25812  ***********************/
25813
25814
25815 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
25816 struct hwrm_cfa_flow_stats_input {
25817         /* The HWRM command request type. */
25818         uint16_t        req_type;
25819         /*
25820          * The completion ring to send the completion event on. This should
25821          * be the NQ ID returned from the `nq_alloc` HWRM command.
25822          */
25823         uint16_t        cmpl_ring;
25824         /*
25825          * The sequence ID is used by the driver for tracking multiple
25826          * commands. This ID is treated as opaque data by the firmware and
25827          * the value is returned in the `hwrm_resp_hdr` upon completion.
25828          */
25829         uint16_t        seq_id;
25830         /*
25831          * The target ID of the command:
25832          * * 0x0-0xFFF8 - The function ID
25833          * * 0xFFF8-0xFFFE - Reserved for internal processors
25834          * * 0xFFFF - HWRM
25835          */
25836         uint16_t        target_id;
25837         /*
25838          * A physical address pointer pointing to a host buffer that the
25839          * command's response data will be written. This can be either a host
25840          * physical address (HPA) or a guest physical address (GPA) and must
25841          * point to a physically contiguous block of memory.
25842          */
25843         uint64_t        resp_addr;
25844         /* Flow handle. */
25845         uint16_t        num_flows;
25846         /* Flow handle. */
25847         uint16_t        flow_handle_0;
25848         /* Flow handle. */
25849         uint16_t        flow_handle_1;
25850         /* Flow handle. */
25851         uint16_t        flow_handle_2;
25852         /* Flow handle. */
25853         uint16_t        flow_handle_3;
25854         /* Flow handle. */
25855         uint16_t        flow_handle_4;
25856         /* Flow handle. */
25857         uint16_t        flow_handle_5;
25858         /* Flow handle. */
25859         uint16_t        flow_handle_6;
25860         /* Flow handle. */
25861         uint16_t        flow_handle_7;
25862         /* Flow handle. */
25863         uint16_t        flow_handle_8;
25864         /* Flow handle. */
25865         uint16_t        flow_handle_9;
25866         uint8_t unused_0[2];
25867         /* Flow ID of a flow. */
25868         uint32_t        flow_id_0;
25869         /* Flow ID of a flow. */
25870         uint32_t        flow_id_1;
25871         /* Flow ID of a flow. */
25872         uint32_t        flow_id_2;
25873         /* Flow ID of a flow. */
25874         uint32_t        flow_id_3;
25875         /* Flow ID of a flow. */
25876         uint32_t        flow_id_4;
25877         /* Flow ID of a flow. */
25878         uint32_t        flow_id_5;
25879         /* Flow ID of a flow. */
25880         uint32_t        flow_id_6;
25881         /* Flow ID of a flow. */
25882         uint32_t        flow_id_7;
25883         /* Flow ID of a flow. */
25884         uint32_t        flow_id_8;
25885         /* Flow ID of a flow. */
25886         uint32_t        flow_id_9;
25887 } __attribute__((packed));
25888
25889 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
25890 struct hwrm_cfa_flow_stats_output {
25891         /* The specific error status for the command. */
25892         uint16_t        error_code;
25893         /* The HWRM command request type. */
25894         uint16_t        req_type;
25895         /* The sequence ID from the original command. */
25896         uint16_t        seq_id;
25897         /* The length of the response data in number of bytes. */
25898         uint16_t        resp_len;
25899         /* packet_0 is 64 b */
25900         uint64_t        packet_0;
25901         /* packet_1 is 64 b */
25902         uint64_t        packet_1;
25903         /* packet_2 is 64 b */
25904         uint64_t        packet_2;
25905         /* packet_3 is 64 b */
25906         uint64_t        packet_3;
25907         /* packet_4 is 64 b */
25908         uint64_t        packet_4;
25909         /* packet_5 is 64 b */
25910         uint64_t        packet_5;
25911         /* packet_6 is 64 b */
25912         uint64_t        packet_6;
25913         /* packet_7 is 64 b */
25914         uint64_t        packet_7;
25915         /* packet_8 is 64 b */
25916         uint64_t        packet_8;
25917         /* packet_9 is 64 b */
25918         uint64_t        packet_9;
25919         /* byte_0 is 64 b */
25920         uint64_t        byte_0;
25921         /* byte_1 is 64 b */
25922         uint64_t        byte_1;
25923         /* byte_2 is 64 b */
25924         uint64_t        byte_2;
25925         /* byte_3 is 64 b */
25926         uint64_t        byte_3;
25927         /* byte_4 is 64 b */
25928         uint64_t        byte_4;
25929         /* byte_5 is 64 b */
25930         uint64_t        byte_5;
25931         /* byte_6 is 64 b */
25932         uint64_t        byte_6;
25933         /* byte_7 is 64 b */
25934         uint64_t        byte_7;
25935         /* byte_8 is 64 b */
25936         uint64_t        byte_8;
25937         /* byte_9 is 64 b */
25938         uint64_t        byte_9;
25939         uint8_t unused_0[7];
25940         /*
25941          * This field is used in Output records to indicate that the output
25942          * is completely written to RAM.  This field should be read as '1'
25943          * to indicate that the output has been completely written.
25944          * When writing a command completion or response to an internal processor,
25945          * the order of writes has to be such that this field is written last.
25946          */
25947         uint8_t valid;
25948 } __attribute__((packed));
25949
25950 /***********************************
25951  * hwrm_cfa_flow_aging_timer_reset *
25952  ***********************************/
25953
25954
25955 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
25956 struct hwrm_cfa_flow_aging_timer_reset_input {
25957         /* The HWRM command request type. */
25958         uint16_t        req_type;
25959         /*
25960          * The completion ring to send the completion event on. This should
25961          * be the NQ ID returned from the `nq_alloc` HWRM command.
25962          */
25963         uint16_t        cmpl_ring;
25964         /*
25965          * The sequence ID is used by the driver for tracking multiple
25966          * commands. This ID is treated as opaque data by the firmware and
25967          * the value is returned in the `hwrm_resp_hdr` upon completion.
25968          */
25969         uint16_t        seq_id;
25970         /*
25971          * The target ID of the command:
25972          * * 0x0-0xFFF8 - The function ID
25973          * * 0xFFF8-0xFFFE - Reserved for internal processors
25974          * * 0xFFFF - HWRM
25975          */
25976         uint16_t        target_id;
25977         /*
25978          * A physical address pointer pointing to a host buffer that the
25979          * command's response data will be written. This can be either a host
25980          * physical address (HPA) or a guest physical address (GPA) and must
25981          * point to a physically contiguous block of memory.
25982          */
25983         uint64_t        resp_addr;
25984         /* Flow record index. */
25985         uint16_t        flow_handle;
25986         uint8_t unused_0[6];
25987         /* This value identifies a set of CFA data structures used for a flow. */
25988         uint64_t        ext_flow_handle;
25989 } __attribute__((packed));
25990
25991 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
25992 struct hwrm_cfa_flow_aging_timer_reset_output {
25993         /* The specific error status for the command. */
25994         uint16_t        error_code;
25995         /* The HWRM command request type. */
25996         uint16_t        req_type;
25997         /* The sequence ID from the original command. */
25998         uint16_t        seq_id;
25999         /* The length of the response data in number of bytes. */
26000         uint16_t        resp_len;
26001         uint8_t unused_0[7];
26002         /*
26003          * This field is used in Output records to indicate that the output
26004          * is completely written to RAM.  This field should be read as '1'
26005          * to indicate that the output has been completely written.
26006          * When writing a command completion or response to an internal processor,
26007          * the order of writes has to be such that this field is written last.
26008          */
26009         uint8_t valid;
26010 } __attribute__((packed));
26011
26012 /***************************
26013  * hwrm_cfa_flow_aging_cfg *
26014  ***************************/
26015
26016
26017 /* hwrm_cfa_flow_aging_cfg_input (size:256b/32B) */
26018 struct hwrm_cfa_flow_aging_cfg_input {
26019         /* The HWRM command request type. */
26020         uint16_t        req_type;
26021         /*
26022          * The completion ring to send the completion event on. This should
26023          * be the NQ ID returned from the `nq_alloc` HWRM command.
26024          */
26025         uint16_t        cmpl_ring;
26026         /*
26027          * The sequence ID is used by the driver for tracking multiple
26028          * commands. This ID is treated as opaque data by the firmware and
26029          * the value is returned in the `hwrm_resp_hdr` upon completion.
26030          */
26031         uint16_t        seq_id;
26032         /*
26033          * The target ID of the command:
26034          * * 0x0-0xFFF8 - The function ID
26035          * * 0xFFF8-0xFFFE - Reserved for internal processors
26036          * * 0xFFFF - HWRM
26037          */
26038         uint16_t        target_id;
26039         /*
26040          * A physical address pointer pointing to a host buffer that the
26041          * command's response data will be written. This can be either a host
26042          * physical address (HPA) or a guest physical address (GPA) and must
26043          * point to a physically contiguous block of memory.
26044          */
26045         uint64_t        resp_addr;
26046         /* The bit field to enable per flow aging configuration. */
26047         uint16_t        enables;
26048         /* This bit must be '1' for the tcp flow timer field to be configured */
26049         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
26050                 UINT32_C(0x1)
26051         /* This bit must be '1' for the tcp finish timer field to be configured */
26052         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
26053                 UINT32_C(0x2)
26054         /* This bit must be '1' for the udp flow timer field to be configured */
26055         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
26056                 UINT32_C(0x4)
26057         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
26058         uint8_t flags;
26059         /* Enumeration denoting the RX, TX type of the resource. */
26060         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
26061         /* tx path */
26062         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
26063         /* rx path */
26064         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
26065         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
26066                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
26067         uint8_t unused_0;
26068         /* The flow aging timer for all TCP flows, the unit is 100 milliseconds. */
26069         uint32_t        tcp_flow_timer;
26070         /* The TCP finished timer for all TCP flows, the unit is 100 milliseconds. */
26071         uint32_t        tcp_fin_timer;
26072         /* The flow aging timer for all UDP flows, the unit is 100 milliseconds. */
26073         uint32_t        udp_flow_timer;
26074 } __attribute__((packed));
26075
26076 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
26077 struct hwrm_cfa_flow_aging_cfg_output {
26078         /* The specific error status for the command. */
26079         uint16_t        error_code;
26080         /* The HWRM command request type. */
26081         uint16_t        req_type;
26082         /* The sequence ID from the original command. */
26083         uint16_t        seq_id;
26084         /* The length of the response data in number of bytes. */
26085         uint16_t        resp_len;
26086         uint8_t unused_0[7];
26087         /*
26088          * This field is used in Output records to indicate that the output
26089          * is completely written to RAM.  This field should be read as '1'
26090          * to indicate that the output has been completely written.
26091          * When writing a command completion or response to an internal processor,
26092          * the order of writes has to be such that this field is written last.
26093          */
26094         uint8_t valid;
26095 } __attribute__((packed));
26096
26097 /****************************
26098  * hwrm_cfa_flow_aging_qcfg *
26099  ****************************/
26100
26101
26102 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
26103 struct hwrm_cfa_flow_aging_qcfg_input {
26104         /* The HWRM command request type. */
26105         uint16_t        req_type;
26106         /*
26107          * The completion ring to send the completion event on. This should
26108          * be the NQ ID returned from the `nq_alloc` HWRM command.
26109          */
26110         uint16_t        cmpl_ring;
26111         /*
26112          * The sequence ID is used by the driver for tracking multiple
26113          * commands. This ID is treated as opaque data by the firmware and
26114          * the value is returned in the `hwrm_resp_hdr` upon completion.
26115          */
26116         uint16_t        seq_id;
26117         /*
26118          * The target ID of the command:
26119          * * 0x0-0xFFF8 - The function ID
26120          * * 0xFFF8-0xFFFE - Reserved for internal processors
26121          * * 0xFFFF - HWRM
26122          */
26123         uint16_t        target_id;
26124         /*
26125          * A physical address pointer pointing to a host buffer that the
26126          * command's response data will be written. This can be either a host
26127          * physical address (HPA) or a guest physical address (GPA) and must
26128          * point to a physically contiguous block of memory.
26129          */
26130         uint64_t        resp_addr;
26131         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
26132         uint8_t flags;
26133         /* Enumeration denoting the RX, TX type of the resource. */
26134         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
26135         /* tx path */
26136         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
26137         /* rx path */
26138         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
26139         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
26140                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
26141         uint8_t unused_0[7];
26142 } __attribute__((packed));
26143
26144 /* hwrm_cfa_flow_aging_qcfg_output (size:192b/24B) */
26145 struct hwrm_cfa_flow_aging_qcfg_output {
26146         /* The specific error status for the command. */
26147         uint16_t        error_code;
26148         /* The HWRM command request type. */
26149         uint16_t        req_type;
26150         /* The sequence ID from the original command. */
26151         uint16_t        seq_id;
26152         /* The length of the response data in number of bytes. */
26153         uint16_t        resp_len;
26154         /* The current flow aging timer for all TCP flows, the unit is 100 millisecond. */
26155         uint32_t        tcp_flow_timer;
26156         /* The current TCP finished timer for all TCP flows, the unit is 100 millisecond. */
26157         uint32_t        tcp_fin_timer;
26158         /* The current flow aging timer for all UDP flows, the unit is 100 millisecond. */
26159         uint32_t        udp_flow_timer;
26160         uint8_t unused_0[3];
26161         /*
26162          * This field is used in Output records to indicate that the output
26163          * is completely written to RAM.  This field should be read as '1'
26164          * to indicate that the output has been completely written.
26165          * When writing a command completion or response to an internal processor,
26166          * the order of writes has to be such that this field is written last.
26167          */
26168         uint8_t valid;
26169 } __attribute__((packed));
26170
26171 /*****************************
26172  * hwrm_cfa_flow_aging_qcaps *
26173  *****************************/
26174
26175
26176 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
26177 struct hwrm_cfa_flow_aging_qcaps_input {
26178         /* The HWRM command request type. */
26179         uint16_t        req_type;
26180         /*
26181          * The completion ring to send the completion event on. This should
26182          * be the NQ ID returned from the `nq_alloc` HWRM command.
26183          */
26184         uint16_t        cmpl_ring;
26185         /*
26186          * The sequence ID is used by the driver for tracking multiple
26187          * commands. This ID is treated as opaque data by the firmware and
26188          * the value is returned in the `hwrm_resp_hdr` upon completion.
26189          */
26190         uint16_t        seq_id;
26191         /*
26192          * The target ID of the command:
26193          * * 0x0-0xFFF8 - The function ID
26194          * * 0xFFF8-0xFFFE - Reserved for internal processors
26195          * * 0xFFFF - HWRM
26196          */
26197         uint16_t        target_id;
26198         /*
26199          * A physical address pointer pointing to a host buffer that the
26200          * command's response data will be written. This can be either a host
26201          * physical address (HPA) or a guest physical address (GPA) and must
26202          * point to a physically contiguous block of memory.
26203          */
26204         uint64_t        resp_addr;
26205         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
26206         uint8_t flags;
26207         /* Enumeration denoting the RX, TX type of the resource. */
26208         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
26209         /* tx path */
26210         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
26211         /* rx path */
26212         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
26213         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
26214                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
26215         uint8_t unused_0[7];
26216 } __attribute__((packed));
26217
26218 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
26219 struct hwrm_cfa_flow_aging_qcaps_output {
26220         /* The specific error status for the command. */
26221         uint16_t        error_code;
26222         /* The HWRM command request type. */
26223         uint16_t        req_type;
26224         /* The sequence ID from the original command. */
26225         uint16_t        seq_id;
26226         /* The length of the response data in number of bytes. */
26227         uint16_t        resp_len;
26228         /* The maximum flow aging timer for all TCP flows, the unit is 100 millisecond. */
26229         uint32_t        max_tcp_flow_timer;
26230         /* The maximum TCP finished timer for all TCP flows, the unit is 100 millisecond. */
26231         uint32_t        max_tcp_fin_timer;
26232         /* The maximum flow aging timer for all UDP flows, the unit is 100 millisecond. */
26233         uint32_t        max_udp_flow_timer;
26234         /* The maximum aging flows that HW can support. */
26235         uint32_t        max_aging_flows;
26236         uint8_t unused_0[7];
26237         /*
26238          * This field is used in Output records to indicate that the output
26239          * is completely written to RAM.  This field should be read as '1'
26240          * to indicate that the output has been completely written.
26241          * When writing a command completion or response to an internal processor,
26242          * the order of writes has to be such that this field is written last.
26243          */
26244         uint8_t valid;
26245 } __attribute__((packed));
26246
26247 /**********************
26248  * hwrm_cfa_pair_info *
26249  **********************/
26250
26251
26252 /* hwrm_cfa_pair_info_input (size:448b/56B) */
26253 struct hwrm_cfa_pair_info_input {
26254         /* The HWRM command request type. */
26255         uint16_t        req_type;
26256         /*
26257          * The completion ring to send the completion event on. This should
26258          * be the NQ ID returned from the `nq_alloc` HWRM command.
26259          */
26260         uint16_t        cmpl_ring;
26261         /*
26262          * The sequence ID is used by the driver for tracking multiple
26263          * commands. This ID is treated as opaque data by the firmware and
26264          * the value is returned in the `hwrm_resp_hdr` upon completion.
26265          */
26266         uint16_t        seq_id;
26267         /*
26268          * The target ID of the command:
26269          * * 0x0-0xFFF8 - The function ID
26270          * * 0xFFF8-0xFFFE - Reserved for internal processors
26271          * * 0xFFFF - HWRM
26272          */
26273         uint16_t        target_id;
26274         /*
26275          * A physical address pointer pointing to a host buffer that the
26276          * command's response data will be written. This can be either a host
26277          * physical address (HPA) or a guest physical address (GPA) and must
26278          * point to a physically contiguous block of memory.
26279          */
26280         uint64_t        resp_addr;
26281         uint32_t        flags;
26282         /* If this flag is set, lookup by name else lookup by index. */
26283         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
26284         /* If this flag is set, lookup by PF id and VF id. */
26285         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
26286         /* Pair table index. */
26287         uint16_t        pair_index;
26288         /* Pair pf index. */
26289         uint8_t pair_pfid;
26290         /* Pair vf index. */
26291         uint8_t pair_vfid;
26292         /* Pair name (32 byte string). */
26293         char    pair_name[32];
26294 } __attribute__((packed));
26295
26296 /* hwrm_cfa_pair_info_output (size:576b/72B) */
26297 struct hwrm_cfa_pair_info_output {
26298         /* The specific error status for the command. */
26299         uint16_t        error_code;
26300         /* The HWRM command request type. */
26301         uint16_t        req_type;
26302         /* The sequence ID from the original command. */
26303         uint16_t        seq_id;
26304         /* The length of the response data in number of bytes. */
26305         uint16_t        resp_len;
26306         /* Pair table index. */
26307         uint16_t        next_pair_index;
26308         /* Pair member a's fid. */
26309         uint16_t        a_fid;
26310         /* Logical host number. */
26311         uint8_t host_a_index;
26312         /* Logical PF number. */
26313         uint8_t pf_a_index;
26314         /* Pair member a's Linux logical VF number. */
26315         uint16_t        vf_a_index;
26316         /* Rx CFA code. */
26317         uint16_t        rx_cfa_code_a;
26318         /* Tx CFA action. */
26319         uint16_t        tx_cfa_action_a;
26320         /* Pair member b's fid. */
26321         uint16_t        b_fid;
26322         /* Logical host number. */
26323         uint8_t host_b_index;
26324         /* Logical PF number. */
26325         uint8_t pf_b_index;
26326         /* Pair member a's Linux logical VF number. */
26327         uint16_t        vf_b_index;
26328         /* Rx CFA code. */
26329         uint16_t        rx_cfa_code_b;
26330         /* Tx CFA action. */
26331         uint16_t        tx_cfa_action_b;
26332         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
26333         uint8_t pair_mode;
26334         /* Pair between VF on local host with PF or VF on specified host. */
26335         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
26336         /* Pair between REP on local host with PF or VF on specified host. */
26337         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
26338         /* Pair between REP on local host with REP on specified host. */
26339         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
26340         /* Pair for the proxy interface. */
26341         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
26342         /* Pair for the PF interface. */
26343         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
26344         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
26345                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
26346         /* Pair state. */
26347         uint8_t pair_state;
26348         /* Pair has been allocated */
26349         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
26350         /* Both pair members are active */
26351         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
26352         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
26353                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
26354         /* Pair name (32 byte string). */
26355         char    pair_name[32];
26356         uint8_t unused_0[7];
26357         /*
26358          * This field is used in Output records to indicate that the output
26359          * is completely written to RAM.  This field should be read as '1'
26360          * to indicate that the output has been completely written.
26361          * When writing a command completion or response to an internal processor,
26362          * the order of writes has to be such that this field is written last.
26363          */
26364         uint8_t valid;
26365 } __attribute__((packed));
26366
26367 /***************************************
26368  * hwrm_cfa_redirect_query_tunnel_type *
26369  ***************************************/
26370
26371
26372 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
26373 struct hwrm_cfa_redirect_query_tunnel_type_input {
26374         /* The HWRM command request type. */
26375         uint16_t        req_type;
26376         /*
26377          * The completion ring to send the completion event on. This should
26378          * be the NQ ID returned from the `nq_alloc` HWRM command.
26379          */
26380         uint16_t        cmpl_ring;
26381         /*
26382          * The sequence ID is used by the driver for tracking multiple
26383          * commands. This ID is treated as opaque data by the firmware and
26384          * the value is returned in the `hwrm_resp_hdr` upon completion.
26385          */
26386         uint16_t        seq_id;
26387         /*
26388          * The target ID of the command:
26389          * * 0x0-0xFFF8 - The function ID
26390          * * 0xFFF8-0xFFFE - Reserved for internal processors
26391          * * 0xFFFF - HWRM
26392          */
26393         uint16_t        target_id;
26394         /*
26395          * A physical address pointer pointing to a host buffer that the
26396          * command's response data will be written. This can be either a host
26397          * physical address (HPA) or a guest physical address (GPA) and must
26398          * point to a physically contiguous block of memory.
26399          */
26400         uint64_t        resp_addr;
26401         /* The source function id. */
26402         uint16_t        src_fid;
26403         uint8_t unused_0[6];
26404 } __attribute__((packed));
26405
26406 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
26407 struct hwrm_cfa_redirect_query_tunnel_type_output {
26408         /* The specific error status for the command. */
26409         uint16_t        error_code;
26410         /* The HWRM command request type. */
26411         uint16_t        req_type;
26412         /* The sequence ID from the original command. */
26413         uint16_t        seq_id;
26414         /* The length of the response data in number of bytes. */
26415         uint16_t        resp_len;
26416         /* Tunnel Mask. */
26417         uint32_t        tunnel_mask;
26418         /* Non-tunnel */
26419         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
26420                 UINT32_C(0x1)
26421         /* Virtual eXtensible Local Area Network (VXLAN) */
26422         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
26423                 UINT32_C(0x2)
26424         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
26425         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
26426                 UINT32_C(0x4)
26427         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
26428         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
26429                 UINT32_C(0x8)
26430         /* IP in IP */
26431         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
26432                 UINT32_C(0x10)
26433         /* Generic Network Virtualization Encapsulation (Geneve) */
26434         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
26435                 UINT32_C(0x20)
26436         /* Multi-Protocol Lable Switching (MPLS) */
26437         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
26438                 UINT32_C(0x40)
26439         /* Stateless Transport Tunnel (STT) */
26440         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
26441                 UINT32_C(0x80)
26442         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
26443         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
26444                 UINT32_C(0x100)
26445         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26446         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
26447                 UINT32_C(0x200)
26448         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26449         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
26450                 UINT32_C(0x400)
26451         /* Any tunneled traffic */
26452         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
26453                 UINT32_C(0x800)
26454         /* Use fixed layer 2 ether type of 0xFFFF */
26455         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
26456                 UINT32_C(0x1000)
26457         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26458         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
26459                 UINT32_C(0x2000)
26460         uint8_t unused_0[3];
26461         /*
26462          * This field is used in Output records to indicate that the output
26463          * is completely written to RAM.  This field should be read as '1'
26464          * to indicate that the output has been completely written.
26465          * When writing a command completion or response to an internal processor,
26466          * the order of writes has to be such that this field is written last.
26467          */
26468         uint8_t valid;
26469 } __attribute__((packed));
26470
26471 /******************************
26472  * hwrm_tunnel_dst_port_query *
26473  ******************************/
26474
26475
26476 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
26477 struct hwrm_tunnel_dst_port_query_input {
26478         /* The HWRM command request type. */
26479         uint16_t        req_type;
26480         /*
26481          * The completion ring to send the completion event on. This should
26482          * be the NQ ID returned from the `nq_alloc` HWRM command.
26483          */
26484         uint16_t        cmpl_ring;
26485         /*
26486          * The sequence ID is used by the driver for tracking multiple
26487          * commands. This ID is treated as opaque data by the firmware and
26488          * the value is returned in the `hwrm_resp_hdr` upon completion.
26489          */
26490         uint16_t        seq_id;
26491         /*
26492          * The target ID of the command:
26493          * * 0x0-0xFFF8 - The function ID
26494          * * 0xFFF8-0xFFFE - Reserved for internal processors
26495          * * 0xFFFF - HWRM
26496          */
26497         uint16_t        target_id;
26498         /*
26499          * A physical address pointer pointing to a host buffer that the
26500          * command's response data will be written. This can be either a host
26501          * physical address (HPA) or a guest physical address (GPA) and must
26502          * point to a physically contiguous block of memory.
26503          */
26504         uint64_t        resp_addr;
26505         /* Tunnel Type. */
26506         uint8_t tunnel_type;
26507         /* Virtual eXtensible Local Area Network (VXLAN) */
26508         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
26509                 UINT32_C(0x1)
26510         /* Generic Network Virtualization Encapsulation (Geneve) */
26511         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
26512                 UINT32_C(0x5)
26513         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26514         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26515                 UINT32_C(0x9)
26516         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26517         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26518                 UINT32_C(0xa)
26519         /* Use fixed layer 2 ether type of 0xFFFF */
26520         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
26521                 UINT32_C(0xb)
26522         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26523         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26524                 UINT32_C(0xc)
26525         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
26526                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
26527         uint8_t unused_0[7];
26528 } __attribute__((packed));
26529
26530 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
26531 struct hwrm_tunnel_dst_port_query_output {
26532         /* The specific error status for the command. */
26533         uint16_t        error_code;
26534         /* The HWRM command request type. */
26535         uint16_t        req_type;
26536         /* The sequence ID from the original command. */
26537         uint16_t        seq_id;
26538         /* The length of the response data in number of bytes. */
26539         uint16_t        resp_len;
26540         /*
26541          * This field represents the identifier of L4 destination port
26542          * used for the given tunnel type. This field is valid for
26543          * specific tunnel types that use layer 4 (e.g. UDP)
26544          * transports for tunneling.
26545          */
26546         uint16_t        tunnel_dst_port_id;
26547         /*
26548          * This field represents the value of L4 destination port
26549          * identified by tunnel_dst_port_id. This field is valid for
26550          * specific tunnel types that use layer 4 (e.g. UDP)
26551          * transports for tunneling.
26552          * This field is in network byte order.
26553          *
26554          * A value of 0 means that the destination port is not
26555          * configured.
26556          */
26557         uint16_t        tunnel_dst_port_val;
26558         uint8_t unused_0[3];
26559         /*
26560          * This field is used in Output records to indicate that the output
26561          * is completely written to RAM.  This field should be read as '1'
26562          * to indicate that the output has been completely written.
26563          * When writing a command completion or response to an internal processor,
26564          * the order of writes has to be such that this field is written last.
26565          */
26566         uint8_t valid;
26567 } __attribute__((packed));
26568
26569 /******************************
26570  * hwrm_tunnel_dst_port_alloc *
26571  ******************************/
26572
26573
26574 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
26575 struct hwrm_tunnel_dst_port_alloc_input {
26576         /* The HWRM command request type. */
26577         uint16_t        req_type;
26578         /*
26579          * The completion ring to send the completion event on. This should
26580          * be the NQ ID returned from the `nq_alloc` HWRM command.
26581          */
26582         uint16_t        cmpl_ring;
26583         /*
26584          * The sequence ID is used by the driver for tracking multiple
26585          * commands. This ID is treated as opaque data by the firmware and
26586          * the value is returned in the `hwrm_resp_hdr` upon completion.
26587          */
26588         uint16_t        seq_id;
26589         /*
26590          * The target ID of the command:
26591          * * 0x0-0xFFF8 - The function ID
26592          * * 0xFFF8-0xFFFE - Reserved for internal processors
26593          * * 0xFFFF - HWRM
26594          */
26595         uint16_t        target_id;
26596         /*
26597          * A physical address pointer pointing to a host buffer that the
26598          * command's response data will be written. This can be either a host
26599          * physical address (HPA) or a guest physical address (GPA) and must
26600          * point to a physically contiguous block of memory.
26601          */
26602         uint64_t        resp_addr;
26603         /* Tunnel Type. */
26604         uint8_t tunnel_type;
26605         /* Virtual eXtensible Local Area Network (VXLAN) */
26606         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
26607                 UINT32_C(0x1)
26608         /* Generic Network Virtualization Encapsulation (Geneve) */
26609         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
26610                 UINT32_C(0x5)
26611         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26612         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26613                 UINT32_C(0x9)
26614         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26615         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26616                 UINT32_C(0xa)
26617         /* Use fixed layer 2 ether type of 0xFFFF */
26618         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
26619                 UINT32_C(0xb)
26620         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26621         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26622                 UINT32_C(0xc)
26623         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
26624                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
26625         uint8_t unused_0;
26626         /*
26627          * This field represents the value of L4 destination port used
26628          * for the given tunnel type. This field is valid for
26629          * specific tunnel types that use layer 4 (e.g. UDP)
26630          * transports for tunneling.
26631          *
26632          * This field is in network byte order.
26633          *
26634          * A value of 0 shall fail the command.
26635          */
26636         uint16_t        tunnel_dst_port_val;
26637         uint8_t unused_1[4];
26638 } __attribute__((packed));
26639
26640 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
26641 struct hwrm_tunnel_dst_port_alloc_output {
26642         /* The specific error status for the command. */
26643         uint16_t        error_code;
26644         /* The HWRM command request type. */
26645         uint16_t        req_type;
26646         /* The sequence ID from the original command. */
26647         uint16_t        seq_id;
26648         /* The length of the response data in number of bytes. */
26649         uint16_t        resp_len;
26650         /*
26651          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
26652          * types that has l4 destination port parameters.
26653          */
26654         uint16_t        tunnel_dst_port_id;
26655         uint8_t unused_0[5];
26656         /*
26657          * This field is used in Output records to indicate that the output
26658          * is completely written to RAM.  This field should be read as '1'
26659          * to indicate that the output has been completely written.
26660          * When writing a command completion or response to an internal processor,
26661          * the order of writes has to be such that this field is written last.
26662          */
26663         uint8_t valid;
26664 } __attribute__((packed));
26665
26666 /*****************************
26667  * hwrm_tunnel_dst_port_free *
26668  *****************************/
26669
26670
26671 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
26672 struct hwrm_tunnel_dst_port_free_input {
26673         /* The HWRM command request type. */
26674         uint16_t        req_type;
26675         /*
26676          * The completion ring to send the completion event on. This should
26677          * be the NQ ID returned from the `nq_alloc` HWRM command.
26678          */
26679         uint16_t        cmpl_ring;
26680         /*
26681          * The sequence ID is used by the driver for tracking multiple
26682          * commands. This ID is treated as opaque data by the firmware and
26683          * the value is returned in the `hwrm_resp_hdr` upon completion.
26684          */
26685         uint16_t        seq_id;
26686         /*
26687          * The target ID of the command:
26688          * * 0x0-0xFFF8 - The function ID
26689          * * 0xFFF8-0xFFFE - Reserved for internal processors
26690          * * 0xFFFF - HWRM
26691          */
26692         uint16_t        target_id;
26693         /*
26694          * A physical address pointer pointing to a host buffer that the
26695          * command's response data will be written. This can be either a host
26696          * physical address (HPA) or a guest physical address (GPA) and must
26697          * point to a physically contiguous block of memory.
26698          */
26699         uint64_t        resp_addr;
26700         /* Tunnel Type. */
26701         uint8_t tunnel_type;
26702         /* Virtual eXtensible Local Area Network (VXLAN) */
26703         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
26704                 UINT32_C(0x1)
26705         /* Generic Network Virtualization Encapsulation (Geneve) */
26706         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
26707                 UINT32_C(0x5)
26708         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26709         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26710                 UINT32_C(0x9)
26711         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26712         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26713                 UINT32_C(0xa)
26714         /* Use fixed layer 2 ether type of 0xFFFF */
26715         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
26716                 UINT32_C(0xb)
26717         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26718         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26719                 UINT32_C(0xc)
26720         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
26721                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
26722         uint8_t unused_0;
26723         /*
26724          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
26725          * types that has l4 destination port parameters.
26726          */
26727         uint16_t        tunnel_dst_port_id;
26728         uint8_t unused_1[4];
26729 } __attribute__((packed));
26730
26731 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
26732 struct hwrm_tunnel_dst_port_free_output {
26733         /* The specific error status for the command. */
26734         uint16_t        error_code;
26735         /* The HWRM command request type. */
26736         uint16_t        req_type;
26737         /* The sequence ID from the original command. */
26738         uint16_t        seq_id;
26739         /* The length of the response data in number of bytes. */
26740         uint16_t        resp_len;
26741         uint8_t unused_1[7];
26742         /*
26743          * This field is used in Output records to indicate that the output
26744          * is completely written to RAM.  This field should be read as '1'
26745          * to indicate that the output has been completely written.
26746          * When writing a command completion or response to an internal processor,
26747          * the order of writes has to be such that this field is written last.
26748          */
26749         uint8_t valid;
26750 } __attribute__((packed));
26751
26752 /* Periodic statistics context DMA to host. */
26753 /* ctx_hw_stats (size:1280b/160B) */
26754 struct ctx_hw_stats {
26755         /* Number of received unicast packets */
26756         uint64_t        rx_ucast_pkts;
26757         /* Number of received multicast packets */
26758         uint64_t        rx_mcast_pkts;
26759         /* Number of received broadcast packets */
26760         uint64_t        rx_bcast_pkts;
26761         /* Number of discarded packets on received path */
26762         uint64_t        rx_discard_pkts;
26763         /* Number of dropped packets on received path */
26764         uint64_t        rx_drop_pkts;
26765         /* Number of received bytes for unicast traffic */
26766         uint64_t        rx_ucast_bytes;
26767         /* Number of received bytes for multicast traffic */
26768         uint64_t        rx_mcast_bytes;
26769         /* Number of received bytes for broadcast traffic */
26770         uint64_t        rx_bcast_bytes;
26771         /* Number of transmitted unicast packets */
26772         uint64_t        tx_ucast_pkts;
26773         /* Number of transmitted multicast packets */
26774         uint64_t        tx_mcast_pkts;
26775         /* Number of transmitted broadcast packets */
26776         uint64_t        tx_bcast_pkts;
26777         /* Number of discarded packets on transmit path */
26778         uint64_t        tx_discard_pkts;
26779         /* Number of dropped packets on transmit path */
26780         uint64_t        tx_drop_pkts;
26781         /* Number of transmitted bytes for unicast traffic */
26782         uint64_t        tx_ucast_bytes;
26783         /* Number of transmitted bytes for multicast traffic */
26784         uint64_t        tx_mcast_bytes;
26785         /* Number of transmitted bytes for broadcast traffic */
26786         uint64_t        tx_bcast_bytes;
26787         /* Number of TPA packets */
26788         uint64_t        tpa_pkts;
26789         /* Number of TPA bytes */
26790         uint64_t        tpa_bytes;
26791         /* Number of TPA events */
26792         uint64_t        tpa_events;
26793         /* Number of TPA aborts */
26794         uint64_t        tpa_aborts;
26795 } __attribute__((packed));
26796
26797 /* Periodic Engine statistics context DMA to host. */
26798 /* ctx_eng_stats (size:512b/64B) */
26799 struct ctx_eng_stats {
26800         /*
26801          * Count of data bytes into the Engine.
26802          * This includes any user supplied prefix,
26803          * but does not include any predefined
26804          * prefix data.
26805          */
26806         uint64_t        eng_bytes_in;
26807         /* Count of data bytes out of the Engine. */
26808         uint64_t        eng_bytes_out;
26809         /*
26810          * Count, in 4-byte (dword) units, of bytes
26811          * that are input as auxiliary data.
26812          * This includes the aux_cmd data.
26813          */
26814         uint64_t        aux_bytes_in;
26815         /*
26816          * Count, in 4-byte (dword) units, of bytes
26817          * that are output as auxiliary data.
26818          * This count is the buffer space for aux_data
26819          * output provided in the RQE, not the actual
26820          * aux_data written
26821          */
26822         uint64_t        aux_bytes_out;
26823         /* Count of number of commands executed. */
26824         uint64_t        commands;
26825         /*
26826          * Count of number of error commands.
26827          * These are the commands with a
26828          * non-zero status value.
26829          */
26830         uint64_t        error_commands;
26831         /*
26832          * Compression/Encryption Engine usage,
26833          * the unit is count of clock cycles
26834          */
26835         uint64_t        cce_engine_usage;
26836         /*
26837          * De-Compression/De-cryption Engine usage,
26838          * the unit is count of clock cycles
26839          */
26840         uint64_t        cdd_engine_usage;
26841 } __attribute__((packed));
26842
26843 /***********************
26844  * hwrm_stat_ctx_alloc *
26845  ***********************/
26846
26847
26848 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
26849 struct hwrm_stat_ctx_alloc_input {
26850         /* The HWRM command request type. */
26851         uint16_t        req_type;
26852         /*
26853          * The completion ring to send the completion event on. This should
26854          * be the NQ ID returned from the `nq_alloc` HWRM command.
26855          */
26856         uint16_t        cmpl_ring;
26857         /*
26858          * The sequence ID is used by the driver for tracking multiple
26859          * commands. This ID is treated as opaque data by the firmware and
26860          * the value is returned in the `hwrm_resp_hdr` upon completion.
26861          */
26862         uint16_t        seq_id;
26863         /*
26864          * The target ID of the command:
26865          * * 0x0-0xFFF8 - The function ID
26866          * * 0xFFF8-0xFFFE - Reserved for internal processors
26867          * * 0xFFFF - HWRM
26868          */
26869         uint16_t        target_id;
26870         /*
26871          * A physical address pointer pointing to a host buffer that the
26872          * command's response data will be written. This can be either a host
26873          * physical address (HPA) or a guest physical address (GPA) and must
26874          * point to a physically contiguous block of memory.
26875          */
26876         uint64_t        resp_addr;
26877         /* This is the address for statistic block. */
26878         uint64_t        stats_dma_addr;
26879         /*
26880          * The statistic block update period in ms.
26881          * e.g. 250ms, 500ms, 750ms, 1000ms.
26882          * If update_period_ms is 0, then the stats update
26883          * shall be never done and the DMA address shall not be used.
26884          * In this case, the stat block can only be read by
26885          * hwrm_stat_ctx_query command.
26886          */
26887         uint32_t        update_period_ms;
26888         /*
26889          * This field is used to specify statistics context specific
26890          * configuration flags.
26891          */
26892         uint8_t stat_ctx_flags;
26893         /*
26894          * When this bit is set to '1', the statistics context shall be
26895          * allocated for RoCE traffic only. In this case, traffic other
26896          * than offloaded RoCE traffic shall not be included in this
26897          * statistic context.
26898          * When this bit is set to '0', the statistics context shall be
26899          * used for network traffic or engine traffic.
26900          */
26901         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
26902         uint8_t unused_0[3];
26903 } __attribute__((packed));
26904
26905 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
26906 struct hwrm_stat_ctx_alloc_output {
26907         /* The specific error status for the command. */
26908         uint16_t        error_code;
26909         /* The HWRM command request type. */
26910         uint16_t        req_type;
26911         /* The sequence ID from the original command. */
26912         uint16_t        seq_id;
26913         /* The length of the response data in number of bytes. */
26914         uint16_t        resp_len;
26915         /* This is the statistics context ID value. */
26916         uint32_t        stat_ctx_id;
26917         uint8_t unused_0[3];
26918         /*
26919          * This field is used in Output records to indicate that the output
26920          * is completely written to RAM.  This field should be read as '1'
26921          * to indicate that the output has been completely written.
26922          * When writing a command completion or response to an internal processor,
26923          * the order of writes has to be such that this field is written last.
26924          */
26925         uint8_t valid;
26926 } __attribute__((packed));
26927
26928 /**********************
26929  * hwrm_stat_ctx_free *
26930  **********************/
26931
26932
26933 /* hwrm_stat_ctx_free_input (size:192b/24B) */
26934 struct hwrm_stat_ctx_free_input {
26935         /* The HWRM command request type. */
26936         uint16_t        req_type;
26937         /*
26938          * The completion ring to send the completion event on. This should
26939          * be the NQ ID returned from the `nq_alloc` HWRM command.
26940          */
26941         uint16_t        cmpl_ring;
26942         /*
26943          * The sequence ID is used by the driver for tracking multiple
26944          * commands. This ID is treated as opaque data by the firmware and
26945          * the value is returned in the `hwrm_resp_hdr` upon completion.
26946          */
26947         uint16_t        seq_id;
26948         /*
26949          * The target ID of the command:
26950          * * 0x0-0xFFF8 - The function ID
26951          * * 0xFFF8-0xFFFE - Reserved for internal processors
26952          * * 0xFFFF - HWRM
26953          */
26954         uint16_t        target_id;
26955         /*
26956          * A physical address pointer pointing to a host buffer that the
26957          * command's response data will be written. This can be either a host
26958          * physical address (HPA) or a guest physical address (GPA) and must
26959          * point to a physically contiguous block of memory.
26960          */
26961         uint64_t        resp_addr;
26962         /* ID of the statistics context that is being queried. */
26963         uint32_t        stat_ctx_id;
26964         uint8_t unused_0[4];
26965 } __attribute__((packed));
26966
26967 /* hwrm_stat_ctx_free_output (size:128b/16B) */
26968 struct hwrm_stat_ctx_free_output {
26969         /* The specific error status for the command. */
26970         uint16_t        error_code;
26971         /* The HWRM command request type. */
26972         uint16_t        req_type;
26973         /* The sequence ID from the original command. */
26974         uint16_t        seq_id;
26975         /* The length of the response data in number of bytes. */
26976         uint16_t        resp_len;
26977         /* This is the statistics context ID value. */
26978         uint32_t        stat_ctx_id;
26979         uint8_t unused_0[3];
26980         /*
26981          * This field is used in Output records to indicate that the output
26982          * is completely written to RAM.  This field should be read as '1'
26983          * to indicate that the output has been completely written.
26984          * When writing a command completion or response to an internal processor,
26985          * the order of writes has to be such that this field is written last.
26986          */
26987         uint8_t valid;
26988 } __attribute__((packed));
26989
26990 /***********************
26991  * hwrm_stat_ctx_query *
26992  ***********************/
26993
26994
26995 /* hwrm_stat_ctx_query_input (size:192b/24B) */
26996 struct hwrm_stat_ctx_query_input {
26997         /* The HWRM command request type. */
26998         uint16_t        req_type;
26999         /*
27000          * The completion ring to send the completion event on. This should
27001          * be the NQ ID returned from the `nq_alloc` HWRM command.
27002          */
27003         uint16_t        cmpl_ring;
27004         /*
27005          * The sequence ID is used by the driver for tracking multiple
27006          * commands. This ID is treated as opaque data by the firmware and
27007          * the value is returned in the `hwrm_resp_hdr` upon completion.
27008          */
27009         uint16_t        seq_id;
27010         /*
27011          * The target ID of the command:
27012          * * 0x0-0xFFF8 - The function ID
27013          * * 0xFFF8-0xFFFE - Reserved for internal processors
27014          * * 0xFFFF - HWRM
27015          */
27016         uint16_t        target_id;
27017         /*
27018          * A physical address pointer pointing to a host buffer that the
27019          * command's response data will be written. This can be either a host
27020          * physical address (HPA) or a guest physical address (GPA) and must
27021          * point to a physically contiguous block of memory.
27022          */
27023         uint64_t        resp_addr;
27024         /* ID of the statistics context that is being queried. */
27025         uint32_t        stat_ctx_id;
27026         uint8_t unused_0[4];
27027 } __attribute__((packed));
27028
27029 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
27030 struct hwrm_stat_ctx_query_output {
27031         /* The specific error status for the command. */
27032         uint16_t        error_code;
27033         /* The HWRM command request type. */
27034         uint16_t        req_type;
27035         /* The sequence ID from the original command. */
27036         uint16_t        seq_id;
27037         /* The length of the response data in number of bytes. */
27038         uint16_t        resp_len;
27039         /* Number of transmitted unicast packets */
27040         uint64_t        tx_ucast_pkts;
27041         /* Number of transmitted multicast packets */
27042         uint64_t        tx_mcast_pkts;
27043         /* Number of transmitted broadcast packets */
27044         uint64_t        tx_bcast_pkts;
27045         /* Number of transmitted packets with error */
27046         uint64_t        tx_err_pkts;
27047         /* Number of dropped packets on transmit path */
27048         uint64_t        tx_drop_pkts;
27049         /* Number of transmitted bytes for unicast traffic */
27050         uint64_t        tx_ucast_bytes;
27051         /* Number of transmitted bytes for multicast traffic */
27052         uint64_t        tx_mcast_bytes;
27053         /* Number of transmitted bytes for broadcast traffic */
27054         uint64_t        tx_bcast_bytes;
27055         /* Number of received unicast packets */
27056         uint64_t        rx_ucast_pkts;
27057         /* Number of received multicast packets */
27058         uint64_t        rx_mcast_pkts;
27059         /* Number of received broadcast packets */
27060         uint64_t        rx_bcast_pkts;
27061         /* Number of received packets with error */
27062         uint64_t        rx_err_pkts;
27063         /* Number of dropped packets on received path */
27064         uint64_t        rx_drop_pkts;
27065         /* Number of received bytes for unicast traffic */
27066         uint64_t        rx_ucast_bytes;
27067         /* Number of received bytes for multicast traffic */
27068         uint64_t        rx_mcast_bytes;
27069         /* Number of received bytes for broadcast traffic */
27070         uint64_t        rx_bcast_bytes;
27071         /* Number of aggregated unicast packets */
27072         uint64_t        rx_agg_pkts;
27073         /* Number of aggregated unicast bytes */
27074         uint64_t        rx_agg_bytes;
27075         /* Number of aggregation events */
27076         uint64_t        rx_agg_events;
27077         /* Number of aborted aggregations */
27078         uint64_t        rx_agg_aborts;
27079         uint8_t unused_0[7];
27080         /*
27081          * This field is used in Output records to indicate that the output
27082          * is completely written to RAM.  This field should be read as '1'
27083          * to indicate that the output has been completely written.
27084          * When writing a command completion or response to an internal processor,
27085          * the order of writes has to be such that this field is written last.
27086          */
27087         uint8_t valid;
27088 } __attribute__((packed));
27089
27090 /***************************
27091  * hwrm_stat_ctx_eng_query *
27092  ***************************/
27093
27094
27095 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
27096 struct hwrm_stat_ctx_eng_query_input {
27097         /* The HWRM command request type. */
27098         uint16_t        req_type;
27099         /*
27100          * The completion ring to send the completion event on. This should
27101          * be the NQ ID returned from the `nq_alloc` HWRM command.
27102          */
27103         uint16_t        cmpl_ring;
27104         /*
27105          * The sequence ID is used by the driver for tracking multiple
27106          * commands. This ID is treated as opaque data by the firmware and
27107          * the value is returned in the `hwrm_resp_hdr` upon completion.
27108          */
27109         uint16_t        seq_id;
27110         /*
27111          * The target ID of the command:
27112          * * 0x0-0xFFF8 - The function ID
27113          * * 0xFFF8-0xFFFE - Reserved for internal processors
27114          * * 0xFFFF - HWRM
27115          */
27116         uint16_t        target_id;
27117         /*
27118          * A physical address pointer pointing to a host buffer that the
27119          * command's response data will be written. This can be either a host
27120          * physical address (HPA) or a guest physical address (GPA) and must
27121          * point to a physically contiguous block of memory.
27122          */
27123         uint64_t        resp_addr;
27124         /* ID of the statistics context that is being queried. */
27125         uint32_t        stat_ctx_id;
27126         uint8_t unused_0[4];
27127 } __attribute__((packed));
27128
27129 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
27130 struct hwrm_stat_ctx_eng_query_output {
27131         /* The specific error status for the command. */
27132         uint16_t        error_code;
27133         /* The HWRM command request type. */
27134         uint16_t        req_type;
27135         /* The sequence ID from the original command. */
27136         uint16_t        seq_id;
27137         /* The length of the response data in number of bytes. */
27138         uint16_t        resp_len;
27139         /*
27140          * Count of data bytes into the Engine.
27141          * This includes any user supplied prefix,
27142          * but does not include any predefined
27143          * prefix data.
27144          */
27145         uint64_t        eng_bytes_in;
27146         /* Count of data bytes out of the Engine. */
27147         uint64_t        eng_bytes_out;
27148         /*
27149          * Count, in 4-byte (dword) units, of bytes
27150          * that are input as auxiliary data.
27151          * This includes the aux_cmd data.
27152          */
27153         uint64_t        aux_bytes_in;
27154         /*
27155          * Count, in 4-byte (dword) units, of bytes
27156          * that are output as auxiliary data.
27157          * This count is the buffer space for aux_data
27158          * output provided in the RQE, not the actual
27159          * aux_data written
27160          */
27161         uint64_t        aux_bytes_out;
27162         /* Count of number of commands executed. */
27163         uint64_t        commands;
27164         /*
27165          * Count of number of error commands.
27166          * These are the commands with a
27167          * non-zero status value.
27168          */
27169         uint64_t        error_commands;
27170         /*
27171          * Compression/Encryption Engine usage,
27172          * the unit is count of clock cycles
27173          */
27174         uint64_t        cce_engine_usage;
27175         /*
27176          * De-Compression/De-cryption Engine usage,
27177          * the unit is count of clock cycles
27178          */
27179         uint64_t        cdd_engine_usage;
27180         uint8_t unused_0[7];
27181         /*
27182          * This field is used in Output records to indicate that the output
27183          * is completely written to RAM.  This field should be read as '1'
27184          * to indicate that the output has been completely written.
27185          * When writing a command completion or response to an internal processor,
27186          * the order of writes has to be such that this field is written last.
27187          */
27188         uint8_t valid;
27189 } __attribute__((packed));
27190
27191 /***************************
27192  * hwrm_stat_ctx_clr_stats *
27193  ***************************/
27194
27195
27196 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
27197 struct hwrm_stat_ctx_clr_stats_input {
27198         /* The HWRM command request type. */
27199         uint16_t        req_type;
27200         /*
27201          * The completion ring to send the completion event on. This should
27202          * be the NQ ID returned from the `nq_alloc` HWRM command.
27203          */
27204         uint16_t        cmpl_ring;
27205         /*
27206          * The sequence ID is used by the driver for tracking multiple
27207          * commands. This ID is treated as opaque data by the firmware and
27208          * the value is returned in the `hwrm_resp_hdr` upon completion.
27209          */
27210         uint16_t        seq_id;
27211         /*
27212          * The target ID of the command:
27213          * * 0x0-0xFFF8 - The function ID
27214          * * 0xFFF8-0xFFFE - Reserved for internal processors
27215          * * 0xFFFF - HWRM
27216          */
27217         uint16_t        target_id;
27218         /*
27219          * A physical address pointer pointing to a host buffer that the
27220          * command's response data will be written. This can be either a host
27221          * physical address (HPA) or a guest physical address (GPA) and must
27222          * point to a physically contiguous block of memory.
27223          */
27224         uint64_t        resp_addr;
27225         /* ID of the statistics context that is being queried. */
27226         uint32_t        stat_ctx_id;
27227         uint8_t unused_0[4];
27228 } __attribute__((packed));
27229
27230 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
27231 struct hwrm_stat_ctx_clr_stats_output {
27232         /* The specific error status for the command. */
27233         uint16_t        error_code;
27234         /* The HWRM command request type. */
27235         uint16_t        req_type;
27236         /* The sequence ID from the original command. */
27237         uint16_t        seq_id;
27238         /* The length of the response data in number of bytes. */
27239         uint16_t        resp_len;
27240         uint8_t unused_0[7];
27241         /*
27242          * This field is used in Output records to indicate that the output
27243          * is completely written to RAM.  This field should be read as '1'
27244          * to indicate that the output has been completely written.
27245          * When writing a command completion or response to an internal processor,
27246          * the order of writes has to be such that this field is written last.
27247          */
27248         uint8_t valid;
27249 } __attribute__((packed));
27250
27251 /********************
27252  * hwrm_pcie_qstats *
27253  ********************/
27254
27255
27256 /* hwrm_pcie_qstats_input (size:256b/32B) */
27257 struct hwrm_pcie_qstats_input {
27258         /* The HWRM command request type. */
27259         uint16_t        req_type;
27260         /*
27261          * The completion ring to send the completion event on. This should
27262          * be the NQ ID returned from the `nq_alloc` HWRM command.
27263          */
27264         uint16_t        cmpl_ring;
27265         /*
27266          * The sequence ID is used by the driver for tracking multiple
27267          * commands. This ID is treated as opaque data by the firmware and
27268          * the value is returned in the `hwrm_resp_hdr` upon completion.
27269          */
27270         uint16_t        seq_id;
27271         /*
27272          * The target ID of the command:
27273          * * 0x0-0xFFF8 - The function ID
27274          * * 0xFFF8-0xFFFE - Reserved for internal processors
27275          * * 0xFFFF - HWRM
27276          */
27277         uint16_t        target_id;
27278         /*
27279          * A physical address pointer pointing to a host buffer that the
27280          * command's response data will be written. This can be either a host
27281          * physical address (HPA) or a guest physical address (GPA) and must
27282          * point to a physically contiguous block of memory.
27283          */
27284         uint64_t        resp_addr;
27285         /*
27286          * The size of PCIe statistics block in bytes.
27287          * Firmware will DMA the PCIe statistics to
27288          * the host with this field size in the response.
27289          */
27290         uint16_t        pcie_stat_size;
27291         uint8_t unused_0[6];
27292         /*
27293          * This is the host address where
27294          * PCIe statistics will be stored
27295          */
27296         uint64_t        pcie_stat_host_addr;
27297 } __attribute__((packed));
27298
27299 /* hwrm_pcie_qstats_output (size:128b/16B) */
27300 struct hwrm_pcie_qstats_output {
27301         /* The specific error status for the command. */
27302         uint16_t        error_code;
27303         /* The HWRM command request type. */
27304         uint16_t        req_type;
27305         /* The sequence ID from the original command. */
27306         uint16_t        seq_id;
27307         /* The length of the response data in number of bytes. */
27308         uint16_t        resp_len;
27309         /* The size of PCIe statistics block in bytes. */
27310         uint16_t        pcie_stat_size;
27311         uint8_t unused_0[5];
27312         /*
27313          * This field is used in Output records to indicate that the output
27314          * is completely written to RAM.  This field should be read as '1'
27315          * to indicate that the output has been completely written.
27316          * When writing a command completion or response to an internal processor,
27317          * the order of writes has to be such that this field is written last.
27318          */
27319         uint8_t valid;
27320 } __attribute__((packed));
27321
27322 /* PCIe Statistics Formats */
27323 /* pcie_ctx_hw_stats (size:768b/96B) */
27324 struct pcie_ctx_hw_stats {
27325         /* Number of physical layer receiver errors */
27326         uint64_t        pcie_pl_signal_integrity;
27327         /* Number of DLLP CRC errors detected by Data Link Layer */
27328         uint64_t        pcie_dl_signal_integrity;
27329         /*
27330          * Number of TLP LCRC and sequence number errors detected
27331          * by Data Link Layer
27332          */
27333         uint64_t        pcie_tl_signal_integrity;
27334         /* Number of times LTSSM entered Recovery state */
27335         uint64_t        pcie_link_integrity;
27336         /* Number of TLP bytes that have been trasmitted */
27337         uint64_t        pcie_tx_traffic_rate;
27338         /* Number of TLP bytes that have been received */
27339         uint64_t        pcie_rx_traffic_rate;
27340         /* Number of DLLP bytes that have been trasmitted */
27341         uint64_t        pcie_tx_dllp_statistics;
27342         /* Number of DLLP bytes that have been received */
27343         uint64_t        pcie_rx_dllp_statistics;
27344         /*
27345          * Number of times spent in each phase of gen3
27346          * equalization
27347          */
27348         uint64_t        pcie_equalization_time;
27349         /* Records the last 16 transitions of the LTSSM */
27350         uint32_t        pcie_ltssm_histogram[4];
27351         /*
27352          * Record the last 8 reasons on why LTSSM transitioned
27353          * to Recovery
27354          */
27355         uint64_t        pcie_recovery_histogram;
27356 } __attribute__((packed));
27357
27358 /**********************
27359  * hwrm_exec_fwd_resp *
27360  **********************/
27361
27362
27363 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
27364 struct hwrm_exec_fwd_resp_input {
27365         /* The HWRM command request type. */
27366         uint16_t        req_type;
27367         /*
27368          * The completion ring to send the completion event on. This should
27369          * be the NQ ID returned from the `nq_alloc` HWRM command.
27370          */
27371         uint16_t        cmpl_ring;
27372         /*
27373          * The sequence ID is used by the driver for tracking multiple
27374          * commands. This ID is treated as opaque data by the firmware and
27375          * the value is returned in the `hwrm_resp_hdr` upon completion.
27376          */
27377         uint16_t        seq_id;
27378         /*
27379          * The target ID of the command:
27380          * * 0x0-0xFFF8 - The function ID
27381          * * 0xFFF8-0xFFFE - Reserved for internal processors
27382          * * 0xFFFF - HWRM
27383          */
27384         uint16_t        target_id;
27385         /*
27386          * A physical address pointer pointing to a host buffer that the
27387          * command's response data will be written. This can be either a host
27388          * physical address (HPA) or a guest physical address (GPA) and must
27389          * point to a physically contiguous block of memory.
27390          */
27391         uint64_t        resp_addr;
27392         /*
27393          * This is an encapsulated request. This request should
27394          * be executed by the HWRM and the response should be
27395          * provided in the response buffer inside the encapsulated
27396          * request.
27397          */
27398         uint32_t        encap_request[26];
27399         /*
27400          * This value indicates the target id of the response to
27401          * the encapsulated request.
27402          * 0x0 - 0xFFF8 - Used for function ids
27403          * 0xFFF8 - 0xFFFE - Reserved for internal processors
27404          * 0xFFFF - HWRM
27405          */
27406         uint16_t        encap_resp_target_id;
27407         uint8_t unused_0[6];
27408 } __attribute__((packed));
27409
27410 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
27411 struct hwrm_exec_fwd_resp_output {
27412         /* The specific error status for the command. */
27413         uint16_t        error_code;
27414         /* The HWRM command request type. */
27415         uint16_t        req_type;
27416         /* The sequence ID from the original command. */
27417         uint16_t        seq_id;
27418         /* The length of the response data in number of bytes. */
27419         uint16_t        resp_len;
27420         uint8_t unused_0[7];
27421         /*
27422          * This field is used in Output records to indicate that the output
27423          * is completely written to RAM.  This field should be read as '1'
27424          * to indicate that the output has been completely written.
27425          * When writing a command completion or response to an internal processor,
27426          * the order of writes has to be such that this field is written last.
27427          */
27428         uint8_t valid;
27429 } __attribute__((packed));
27430
27431 /************************
27432  * hwrm_reject_fwd_resp *
27433  ************************/
27434
27435
27436 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
27437 struct hwrm_reject_fwd_resp_input {
27438         /* The HWRM command request type. */
27439         uint16_t        req_type;
27440         /*
27441          * The completion ring to send the completion event on. This should
27442          * be the NQ ID returned from the `nq_alloc` HWRM command.
27443          */
27444         uint16_t        cmpl_ring;
27445         /*
27446          * The sequence ID is used by the driver for tracking multiple
27447          * commands. This ID is treated as opaque data by the firmware and
27448          * the value is returned in the `hwrm_resp_hdr` upon completion.
27449          */
27450         uint16_t        seq_id;
27451         /*
27452          * The target ID of the command:
27453          * * 0x0-0xFFF8 - The function ID
27454          * * 0xFFF8-0xFFFE - Reserved for internal processors
27455          * * 0xFFFF - HWRM
27456          */
27457         uint16_t        target_id;
27458         /*
27459          * A physical address pointer pointing to a host buffer that the
27460          * command's response data will be written. This can be either a host
27461          * physical address (HPA) or a guest physical address (GPA) and must
27462          * point to a physically contiguous block of memory.
27463          */
27464         uint64_t        resp_addr;
27465         /*
27466          * This is an encapsulated request. This request should
27467          * be rejected by the HWRM and the error response should be
27468          * provided in the response buffer inside the encapsulated
27469          * request.
27470          */
27471         uint32_t        encap_request[26];
27472         /*
27473          * This value indicates the target id of the response to
27474          * the encapsulated request.
27475          * 0x0 - 0xFFF8 - Used for function ids
27476          * 0xFFF8 - 0xFFFE - Reserved for internal processors
27477          * 0xFFFF - HWRM
27478          */
27479         uint16_t        encap_resp_target_id;
27480         uint8_t unused_0[6];
27481 } __attribute__((packed));
27482
27483 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
27484 struct hwrm_reject_fwd_resp_output {
27485         /* The specific error status for the command. */
27486         uint16_t        error_code;
27487         /* The HWRM command request type. */
27488         uint16_t        req_type;
27489         /* The sequence ID from the original command. */
27490         uint16_t        seq_id;
27491         /* The length of the response data in number of bytes. */
27492         uint16_t        resp_len;
27493         uint8_t unused_0[7];
27494         /*
27495          * This field is used in Output records to indicate that the output
27496          * is completely written to RAM.  This field should be read as '1'
27497          * to indicate that the output has been completely written.
27498          * When writing a command completion or response to an internal processor,
27499          * the order of writes has to be such that this field is written last.
27500          */
27501         uint8_t valid;
27502 } __attribute__((packed));
27503
27504 /*****************
27505  * hwrm_fwd_resp *
27506  *****************/
27507
27508
27509 /* hwrm_fwd_resp_input (size:1024b/128B) */
27510 struct hwrm_fwd_resp_input {
27511         /* The HWRM command request type. */
27512         uint16_t        req_type;
27513         /*
27514          * The completion ring to send the completion event on. This should
27515          * be the NQ ID returned from the `nq_alloc` HWRM command.
27516          */
27517         uint16_t        cmpl_ring;
27518         /*
27519          * The sequence ID is used by the driver for tracking multiple
27520          * commands. This ID is treated as opaque data by the firmware and
27521          * the value is returned in the `hwrm_resp_hdr` upon completion.
27522          */
27523         uint16_t        seq_id;
27524         /*
27525          * The target ID of the command:
27526          * * 0x0-0xFFF8 - The function ID
27527          * * 0xFFF8-0xFFFE - Reserved for internal processors
27528          * * 0xFFFF - HWRM
27529          */
27530         uint16_t        target_id;
27531         /*
27532          * A physical address pointer pointing to a host buffer that the
27533          * command's response data will be written. This can be either a host
27534          * physical address (HPA) or a guest physical address (GPA) and must
27535          * point to a physically contiguous block of memory.
27536          */
27537         uint64_t        resp_addr;
27538         /*
27539          * This value indicates the target id of the encapsulated
27540          * response.
27541          * 0x0 - 0xFFF8 - Used for function ids
27542          * 0xFFF8 - 0xFFFE - Reserved for internal processors
27543          * 0xFFFF - HWRM
27544          */
27545         uint16_t        encap_resp_target_id;
27546         /*
27547          * This value indicates the completion ring the encapsulated
27548          * response will be optionally completed on.  If the value is
27549          * -1, then no CR completion shall be generated for the
27550          * encapsulated response. Any other value must be a
27551          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
27552          * is provided, then a CR completion shall be generated for
27553          * the encapsulated response.
27554          */
27555         uint16_t        encap_resp_cmpl_ring;
27556         /* This field indicates the length of encapsulated response. */
27557         uint16_t        encap_resp_len;
27558         uint8_t unused_0;
27559         uint8_t unused_1;
27560         /*
27561          * This is the host address where the encapsulated response
27562          * will be written.
27563          * This area must be 16B aligned and must be cleared to zero
27564          * before the original request is made.
27565          */
27566         uint64_t        encap_resp_addr;
27567         /* This is an encapsulated response. */
27568         uint32_t        encap_resp[24];
27569 } __attribute__((packed));
27570
27571 /* hwrm_fwd_resp_output (size:128b/16B) */
27572 struct hwrm_fwd_resp_output {
27573         /* The specific error status for the command. */
27574         uint16_t        error_code;
27575         /* The HWRM command request type. */
27576         uint16_t        req_type;
27577         /* The sequence ID from the original command. */
27578         uint16_t        seq_id;
27579         /* The length of the response data in number of bytes. */
27580         uint16_t        resp_len;
27581         uint8_t unused_0[7];
27582         /*
27583          * This field is used in Output records to indicate that the output
27584          * is completely written to RAM.  This field should be read as '1'
27585          * to indicate that the output has been completely written.
27586          * When writing a command completion or response to an internal processor,
27587          * the order of writes has to be such that this field is written last.
27588          */
27589         uint8_t valid;
27590 } __attribute__((packed));
27591
27592 /*****************************
27593  * hwrm_fwd_async_event_cmpl *
27594  *****************************/
27595
27596
27597 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
27598 struct hwrm_fwd_async_event_cmpl_input {
27599         /* The HWRM command request type. */
27600         uint16_t        req_type;
27601         /*
27602          * The completion ring to send the completion event on. This should
27603          * be the NQ ID returned from the `nq_alloc` HWRM command.
27604          */
27605         uint16_t        cmpl_ring;
27606         /*
27607          * The sequence ID is used by the driver for tracking multiple
27608          * commands. This ID is treated as opaque data by the firmware and
27609          * the value is returned in the `hwrm_resp_hdr` upon completion.
27610          */
27611         uint16_t        seq_id;
27612         /*
27613          * The target ID of the command:
27614          * * 0x0-0xFFF8 - The function ID
27615          * * 0xFFF8-0xFFFE - Reserved for internal processors
27616          * * 0xFFFF - HWRM
27617          */
27618         uint16_t        target_id;
27619         /*
27620          * A physical address pointer pointing to a host buffer that the
27621          * command's response data will be written. This can be either a host
27622          * physical address (HPA) or a guest physical address (GPA) and must
27623          * point to a physically contiguous block of memory.
27624          */
27625         uint64_t        resp_addr;
27626         /*
27627          * This value indicates the target id of the encapsulated
27628          * asynchronous event.
27629          * 0x0 - 0xFFF8 - Used for function ids
27630          * 0xFFF8 - 0xFFFE - Reserved for internal processors
27631          * 0xFFFF - Broadcast to all children VFs (only applicable when
27632          * a PF is the requester)
27633          */
27634         uint16_t        encap_async_event_target_id;
27635         uint8_t unused_0[6];
27636         /* This is an encapsulated asynchronous event completion. */
27637         uint32_t        encap_async_event_cmpl[4];
27638 } __attribute__((packed));
27639
27640 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
27641 struct hwrm_fwd_async_event_cmpl_output {
27642         /* The specific error status for the command. */
27643         uint16_t        error_code;
27644         /* The HWRM command request type. */
27645         uint16_t        req_type;
27646         /* The sequence ID from the original command. */
27647         uint16_t        seq_id;
27648         /* The length of the response data in number of bytes. */
27649         uint16_t        resp_len;
27650         uint8_t unused_0[7];
27651         /*
27652          * This field is used in Output records to indicate that the output
27653          * is completely written to RAM.  This field should be read as '1'
27654          * to indicate that the output has been completely written.
27655          * When writing a command completion or response to an internal processor,
27656          * the order of writes has to be such that this field is written last.
27657          */
27658         uint8_t valid;
27659 } __attribute__((packed));
27660
27661 /**************************
27662  * hwrm_nvm_raw_write_blk *
27663  **************************/
27664
27665
27666 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
27667 struct hwrm_nvm_raw_write_blk_input {
27668         /* The HWRM command request type. */
27669         uint16_t        req_type;
27670         /*
27671          * The completion ring to send the completion event on. This should
27672          * be the NQ ID returned from the `nq_alloc` HWRM command.
27673          */
27674         uint16_t        cmpl_ring;
27675         /*
27676          * The sequence ID is used by the driver for tracking multiple
27677          * commands. This ID is treated as opaque data by the firmware and
27678          * the value is returned in the `hwrm_resp_hdr` upon completion.
27679          */
27680         uint16_t        seq_id;
27681         /*
27682          * The target ID of the command:
27683          * * 0x0-0xFFF8 - The function ID
27684          * * 0xFFF8-0xFFFE - Reserved for internal processors
27685          * * 0xFFFF - HWRM
27686          */
27687         uint16_t        target_id;
27688         /*
27689          * A physical address pointer pointing to a host buffer that the
27690          * command's response data will be written. This can be either a host
27691          * physical address (HPA) or a guest physical address (GPA) and must
27692          * point to a physically contiguous block of memory.
27693          */
27694         uint64_t        resp_addr;
27695         /*
27696          * 64-bit Host Source Address.
27697          * This is the loation of the source data to be written.
27698          */
27699         uint64_t        host_src_addr;
27700         /*
27701          * 32-bit Destination Address.
27702          * This is the NVRAM byte-offset where the source data will be written to.
27703          */
27704         uint32_t        dest_addr;
27705         /* Length of data to be written, in bytes. */
27706         uint32_t        len;
27707 } __attribute__((packed));
27708
27709 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
27710 struct hwrm_nvm_raw_write_blk_output {
27711         /* The specific error status for the command. */
27712         uint16_t        error_code;
27713         /* The HWRM command request type. */
27714         uint16_t        req_type;
27715         /* The sequence ID from the original command. */
27716         uint16_t        seq_id;
27717         /* The length of the response data in number of bytes. */
27718         uint16_t        resp_len;
27719         uint8_t unused_0[7];
27720         /*
27721          * This field is used in Output records to indicate that the output
27722          * is completely written to RAM.  This field should be read as '1'
27723          * to indicate that the output has been completely written.
27724          * When writing a command completion or response to an internal processor,
27725          * the order of writes has to be such that this field is written last.
27726          */
27727         uint8_t valid;
27728 } __attribute__((packed));
27729
27730 /*****************
27731  * hwrm_nvm_read *
27732  *****************/
27733
27734
27735 /* hwrm_nvm_read_input (size:320b/40B) */
27736 struct hwrm_nvm_read_input {
27737         /* The HWRM command request type. */
27738         uint16_t        req_type;
27739         /*
27740          * The completion ring to send the completion event on. This should
27741          * be the NQ ID returned from the `nq_alloc` HWRM command.
27742          */
27743         uint16_t        cmpl_ring;
27744         /*
27745          * The sequence ID is used by the driver for tracking multiple
27746          * commands. This ID is treated as opaque data by the firmware and
27747          * the value is returned in the `hwrm_resp_hdr` upon completion.
27748          */
27749         uint16_t        seq_id;
27750         /*
27751          * The target ID of the command:
27752          * * 0x0-0xFFF8 - The function ID
27753          * * 0xFFF8-0xFFFE - Reserved for internal processors
27754          * * 0xFFFF - HWRM
27755          */
27756         uint16_t        target_id;
27757         /*
27758          * A physical address pointer pointing to a host buffer that the
27759          * command's response data will be written. This can be either a host
27760          * physical address (HPA) or a guest physical address (GPA) and must
27761          * point to a physically contiguous block of memory.
27762          */
27763         uint64_t        resp_addr;
27764         /*
27765          * 64-bit Host Destination Address.
27766          * This is the host address where the data will be written to.
27767          */
27768         uint64_t        host_dest_addr;
27769         /* The 0-based index of the directory entry. */
27770         uint16_t        dir_idx;
27771         uint8_t unused_0[2];
27772         /* The NVRAM byte-offset to read from. */
27773         uint32_t        offset;
27774         /* The length of the data to be read, in bytes. */
27775         uint32_t        len;
27776         uint8_t unused_1[4];
27777 } __attribute__((packed));
27778
27779 /* hwrm_nvm_read_output (size:128b/16B) */
27780 struct hwrm_nvm_read_output {
27781         /* The specific error status for the command. */
27782         uint16_t        error_code;
27783         /* The HWRM command request type. */
27784         uint16_t        req_type;
27785         /* The sequence ID from the original command. */
27786         uint16_t        seq_id;
27787         /* The length of the response data in number of bytes. */
27788         uint16_t        resp_len;
27789         uint8_t unused_0[7];
27790         /*
27791          * This field is used in Output records to indicate that the output
27792          * is completely written to RAM.  This field should be read as '1'
27793          * to indicate that the output has been completely written.
27794          * When writing a command completion or response to an internal processor,
27795          * the order of writes has to be such that this field is written last.
27796          */
27797         uint8_t valid;
27798 } __attribute__((packed));
27799
27800 /*********************
27801  * hwrm_nvm_raw_dump *
27802  *********************/
27803
27804
27805 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
27806 struct hwrm_nvm_raw_dump_input {
27807         /* The HWRM command request type. */
27808         uint16_t        req_type;
27809         /*
27810          * The completion ring to send the completion event on. This should
27811          * be the NQ ID returned from the `nq_alloc` HWRM command.
27812          */
27813         uint16_t        cmpl_ring;
27814         /*
27815          * The sequence ID is used by the driver for tracking multiple
27816          * commands. This ID is treated as opaque data by the firmware and
27817          * the value is returned in the `hwrm_resp_hdr` upon completion.
27818          */
27819         uint16_t        seq_id;
27820         /*
27821          * The target ID of the command:
27822          * * 0x0-0xFFF8 - The function ID
27823          * * 0xFFF8-0xFFFE - Reserved for internal processors
27824          * * 0xFFFF - HWRM
27825          */
27826         uint16_t        target_id;
27827         /*
27828          * A physical address pointer pointing to a host buffer that the
27829          * command's response data will be written. This can be either a host
27830          * physical address (HPA) or a guest physical address (GPA) and must
27831          * point to a physically contiguous block of memory.
27832          */
27833         uint64_t        resp_addr;
27834         /*
27835          * 64-bit Host Destination Address.
27836          * This is the host address where the data will be written to.
27837          */
27838         uint64_t        host_dest_addr;
27839         /* 32-bit NVRAM byte-offset to read from. */
27840         uint32_t        offset;
27841         /* Total length of NVRAM contents to be read, in bytes. */
27842         uint32_t        len;
27843 } __attribute__((packed));
27844
27845 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
27846 struct hwrm_nvm_raw_dump_output {
27847         /* The specific error status for the command. */
27848         uint16_t        error_code;
27849         /* The HWRM command request type. */
27850         uint16_t        req_type;
27851         /* The sequence ID from the original command. */
27852         uint16_t        seq_id;
27853         /* The length of the response data in number of bytes. */
27854         uint16_t        resp_len;
27855         uint8_t unused_0[7];
27856         /*
27857          * This field is used in Output records to indicate that the output
27858          * is completely written to RAM.  This field should be read as '1'
27859          * to indicate that the output has been completely written.
27860          * When writing a command completion or response to an internal processor,
27861          * the order of writes has to be such that this field is written last.
27862          */
27863         uint8_t valid;
27864 } __attribute__((packed));
27865
27866 /****************************
27867  * hwrm_nvm_get_dir_entries *
27868  ****************************/
27869
27870
27871 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
27872 struct hwrm_nvm_get_dir_entries_input {
27873         /* The HWRM command request type. */
27874         uint16_t        req_type;
27875         /*
27876          * The completion ring to send the completion event on. This should
27877          * be the NQ ID returned from the `nq_alloc` HWRM command.
27878          */
27879         uint16_t        cmpl_ring;
27880         /*
27881          * The sequence ID is used by the driver for tracking multiple
27882          * commands. This ID is treated as opaque data by the firmware and
27883          * the value is returned in the `hwrm_resp_hdr` upon completion.
27884          */
27885         uint16_t        seq_id;
27886         /*
27887          * The target ID of the command:
27888          * * 0x0-0xFFF8 - The function ID
27889          * * 0xFFF8-0xFFFE - Reserved for internal processors
27890          * * 0xFFFF - HWRM
27891          */
27892         uint16_t        target_id;
27893         /*
27894          * A physical address pointer pointing to a host buffer that the
27895          * command's response data will be written. This can be either a host
27896          * physical address (HPA) or a guest physical address (GPA) and must
27897          * point to a physically contiguous block of memory.
27898          */
27899         uint64_t        resp_addr;
27900         /*
27901          * 64-bit Host Destination Address.
27902          * This is the host address where the directory will be written.
27903          */
27904         uint64_t        host_dest_addr;
27905 } __attribute__((packed));
27906
27907 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
27908 struct hwrm_nvm_get_dir_entries_output {
27909         /* The specific error status for the command. */
27910         uint16_t        error_code;
27911         /* The HWRM command request type. */
27912         uint16_t        req_type;
27913         /* The sequence ID from the original command. */
27914         uint16_t        seq_id;
27915         /* The length of the response data in number of bytes. */
27916         uint16_t        resp_len;
27917         uint8_t unused_0[7];
27918         /*
27919          * This field is used in Output records to indicate that the output
27920          * is completely written to RAM.  This field should be read as '1'
27921          * to indicate that the output has been completely written.
27922          * When writing a command completion or response to an internal processor,
27923          * the order of writes has to be such that this field is written last.
27924          */
27925         uint8_t valid;
27926 } __attribute__((packed));
27927
27928 /*************************
27929  * hwrm_nvm_get_dir_info *
27930  *************************/
27931
27932
27933 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
27934 struct hwrm_nvm_get_dir_info_input {
27935         /* The HWRM command request type. */
27936         uint16_t        req_type;
27937         /*
27938          * The completion ring to send the completion event on. This should
27939          * be the NQ ID returned from the `nq_alloc` HWRM command.
27940          */
27941         uint16_t        cmpl_ring;
27942         /*
27943          * The sequence ID is used by the driver for tracking multiple
27944          * commands. This ID is treated as opaque data by the firmware and
27945          * the value is returned in the `hwrm_resp_hdr` upon completion.
27946          */
27947         uint16_t        seq_id;
27948         /*
27949          * The target ID of the command:
27950          * * 0x0-0xFFF8 - The function ID
27951          * * 0xFFF8-0xFFFE - Reserved for internal processors
27952          * * 0xFFFF - HWRM
27953          */
27954         uint16_t        target_id;
27955         /*
27956          * A physical address pointer pointing to a host buffer that the
27957          * command's response data will be written. This can be either a host
27958          * physical address (HPA) or a guest physical address (GPA) and must
27959          * point to a physically contiguous block of memory.
27960          */
27961         uint64_t        resp_addr;
27962 } __attribute__((packed));
27963
27964 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
27965 struct hwrm_nvm_get_dir_info_output {
27966         /* The specific error status for the command. */
27967         uint16_t        error_code;
27968         /* The HWRM command request type. */
27969         uint16_t        req_type;
27970         /* The sequence ID from the original command. */
27971         uint16_t        seq_id;
27972         /* The length of the response data in number of bytes. */
27973         uint16_t        resp_len;
27974         /* Number of directory entries in the directory. */
27975         uint32_t        entries;
27976         /* Size of each directory entry, in bytes. */
27977         uint32_t        entry_length;
27978         uint8_t unused_0[7];
27979         /*
27980          * This field is used in Output records to indicate that the output
27981          * is completely written to RAM.  This field should be read as '1'
27982          * to indicate that the output has been completely written.
27983          * When writing a command completion or response to an internal processor,
27984          * the order of writes has to be such that this field is written last.
27985          */
27986         uint8_t valid;
27987 } __attribute__((packed));
27988
27989 /******************
27990  * hwrm_nvm_write *
27991  ******************/
27992
27993
27994 /* hwrm_nvm_write_input (size:384b/48B) */
27995 struct hwrm_nvm_write_input {
27996         /* The HWRM command request type. */
27997         uint16_t        req_type;
27998         /*
27999          * The completion ring to send the completion event on. This should
28000          * be the NQ ID returned from the `nq_alloc` HWRM command.
28001          */
28002         uint16_t        cmpl_ring;
28003         /*
28004          * The sequence ID is used by the driver for tracking multiple
28005          * commands. This ID is treated as opaque data by the firmware and
28006          * the value is returned in the `hwrm_resp_hdr` upon completion.
28007          */
28008         uint16_t        seq_id;
28009         /*
28010          * The target ID of the command:
28011          * * 0x0-0xFFF8 - The function ID
28012          * * 0xFFF8-0xFFFE - Reserved for internal processors
28013          * * 0xFFFF - HWRM
28014          */
28015         uint16_t        target_id;
28016         /*
28017          * A physical address pointer pointing to a host buffer that the
28018          * command's response data will be written. This can be either a host
28019          * physical address (HPA) or a guest physical address (GPA) and must
28020          * point to a physically contiguous block of memory.
28021          */
28022         uint64_t        resp_addr;
28023         /*
28024          * 64-bit Host Source Address.
28025          * This is where the source data is.
28026          */
28027         uint64_t        host_src_addr;
28028         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
28029         uint16_t        dir_type;
28030         /*
28031          * Directory ordinal.
28032          * The 0-based instance of the combined Directory Entry Type and Extension.
28033          */
28034         uint16_t        dir_ordinal;
28035         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
28036         uint16_t        dir_ext;
28037         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
28038         uint16_t        dir_attr;
28039         /*
28040          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
28041          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
28042          */
28043         uint32_t        dir_data_length;
28044         /* Option. */
28045         uint16_t        option;
28046         uint16_t        flags;
28047         /*
28048          * When this bit is '1', the original active image
28049          * will not be removed. TBD: what purpose is this?
28050          */
28051         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
28052                 UINT32_C(0x1)
28053         /*
28054          * The requested length of the allocated NVM for the item, in bytes. This value may be greater than or equal to the specified data length (dir_data_length).
28055          * If this value is less than the specified data length, it will be ignored.
28056          * The response will contain the actual allocated item length, which may be greater than the requested item length.
28057          * The purpose for allocating more than the required number of bytes for an item's data is to pre-allocate extra storage (padding) to accomodate
28058          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
28059          */
28060         uint32_t        dir_item_length;
28061         uint32_t        unused_0;
28062 } __attribute__((packed));
28063
28064 /* hwrm_nvm_write_output (size:128b/16B) */
28065 struct hwrm_nvm_write_output {
28066         /* The specific error status for the command. */
28067         uint16_t        error_code;
28068         /* The HWRM command request type. */
28069         uint16_t        req_type;
28070         /* The sequence ID from the original command. */
28071         uint16_t        seq_id;
28072         /* The length of the response data in number of bytes. */
28073         uint16_t        resp_len;
28074         /*
28075          * Length of the allocated NVM for the item, in bytes. The value may be greater than or equal to the specified data length or the requested item length.
28076          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
28077          */
28078         uint32_t        dir_item_length;
28079         /* The directory index of the created or modified item. */
28080         uint16_t        dir_idx;
28081         uint8_t unused_0;
28082         /*
28083          * This field is used in Output records to indicate that the output
28084          * is completely written to RAM.  This field should be read as '1'
28085          * to indicate that the output has been completely written.
28086          * When writing a command completion or response to an internal processor,
28087          * the order of writes has to be such that this field is written last.
28088          */
28089         uint8_t valid;
28090 } __attribute__((packed));
28091
28092 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
28093 struct hwrm_nvm_write_cmd_err {
28094         /*
28095          * command specific error codes that goes to
28096          * the cmd_err field in Common HWRM Error Response.
28097          */
28098         uint8_t code;
28099         /* Unknown error */
28100         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
28101         /* Unable to complete operation due to fragmentation */
28102         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
28103         /* nvm is completely full. */
28104         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
28105         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
28106                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
28107         uint8_t unused_0[7];
28108 } __attribute__((packed));
28109
28110 /*******************
28111  * hwrm_nvm_modify *
28112  *******************/
28113
28114
28115 /* hwrm_nvm_modify_input (size:320b/40B) */
28116 struct hwrm_nvm_modify_input {
28117         /* The HWRM command request type. */
28118         uint16_t        req_type;
28119         /*
28120          * The completion ring to send the completion event on. This should
28121          * be the NQ ID returned from the `nq_alloc` HWRM command.
28122          */
28123         uint16_t        cmpl_ring;
28124         /*
28125          * The sequence ID is used by the driver for tracking multiple
28126          * commands. This ID is treated as opaque data by the firmware and
28127          * the value is returned in the `hwrm_resp_hdr` upon completion.
28128          */
28129         uint16_t        seq_id;
28130         /*
28131          * The target ID of the command:
28132          * * 0x0-0xFFF8 - The function ID
28133          * * 0xFFF8-0xFFFE - Reserved for internal processors
28134          * * 0xFFFF - HWRM
28135          */
28136         uint16_t        target_id;
28137         /*
28138          * A physical address pointer pointing to a host buffer that the
28139          * command's response data will be written. This can be either a host
28140          * physical address (HPA) or a guest physical address (GPA) and must
28141          * point to a physically contiguous block of memory.
28142          */
28143         uint64_t        resp_addr;
28144         /*
28145          * 64-bit Host Source Address.
28146          * This is where the modified data is.
28147          */
28148         uint64_t        host_src_addr;
28149         /* 16-bit directory entry index. */
28150         uint16_t        dir_idx;
28151         uint8_t unused_0[2];
28152         /* 32-bit NVRAM byte-offset to modify content from. */
28153         uint32_t        offset;
28154         /*
28155          * Length of data to be modified, in bytes. The length shall
28156          * be non-zero.
28157          */
28158         uint32_t        len;
28159         uint8_t unused_1[4];
28160 } __attribute__((packed));
28161
28162 /* hwrm_nvm_modify_output (size:128b/16B) */
28163 struct hwrm_nvm_modify_output {
28164         /* The specific error status for the command. */
28165         uint16_t        error_code;
28166         /* The HWRM command request type. */
28167         uint16_t        req_type;
28168         /* The sequence ID from the original command. */
28169         uint16_t        seq_id;
28170         /* The length of the response data in number of bytes. */
28171         uint16_t        resp_len;
28172         uint8_t unused_0[7];
28173         /*
28174          * This field is used in Output records to indicate that the output
28175          * is completely written to RAM.  This field should be read as '1'
28176          * to indicate that the output has been completely written.
28177          * When writing a command completion or response to an internal processor,
28178          * the order of writes has to be such that this field is written last.
28179          */
28180         uint8_t valid;
28181 } __attribute__((packed));
28182
28183 /***************************
28184  * hwrm_nvm_find_dir_entry *
28185  ***************************/
28186
28187
28188 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
28189 struct hwrm_nvm_find_dir_entry_input {
28190         /* The HWRM command request type. */
28191         uint16_t        req_type;
28192         /*
28193          * The completion ring to send the completion event on. This should
28194          * be the NQ ID returned from the `nq_alloc` HWRM command.
28195          */
28196         uint16_t        cmpl_ring;
28197         /*
28198          * The sequence ID is used by the driver for tracking multiple
28199          * commands. This ID is treated as opaque data by the firmware and
28200          * the value is returned in the `hwrm_resp_hdr` upon completion.
28201          */
28202         uint16_t        seq_id;
28203         /*
28204          * The target ID of the command:
28205          * * 0x0-0xFFF8 - The function ID
28206          * * 0xFFF8-0xFFFE - Reserved for internal processors
28207          * * 0xFFFF - HWRM
28208          */
28209         uint16_t        target_id;
28210         /*
28211          * A physical address pointer pointing to a host buffer that the
28212          * command's response data will be written. This can be either a host
28213          * physical address (HPA) or a guest physical address (GPA) and must
28214          * point to a physically contiguous block of memory.
28215          */
28216         uint64_t        resp_addr;
28217         uint32_t        enables;
28218         /*
28219          * This bit must be '1' for the dir_idx_valid field to be
28220          * configured.
28221          */
28222         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
28223                 UINT32_C(0x1)
28224         /* Directory Entry Index */
28225         uint16_t        dir_idx;
28226         /* Directory Entry (Image) Type */
28227         uint16_t        dir_type;
28228         /*
28229          * Directory ordinal.
28230          * The instance of this Directory Type
28231          */
28232         uint16_t        dir_ordinal;
28233         /* The Directory Entry Extension flags. */
28234         uint16_t        dir_ext;
28235         /* This value indicates the search option using dir_ordinal. */
28236         uint8_t opt_ordinal;
28237         /* This value indicates the search option using dir_ordinal. */
28238         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
28239         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
28240         /* Equal to specified ordinal value. */
28241         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
28242         /* Greater than or equal to specified ordinal value */
28243         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
28244         /* Greater than specified ordinal value */
28245         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
28246         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
28247                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
28248         uint8_t unused_0[3];
28249 } __attribute__((packed));
28250
28251 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
28252 struct hwrm_nvm_find_dir_entry_output {
28253         /* The specific error status for the command. */
28254         uint16_t        error_code;
28255         /* The HWRM command request type. */
28256         uint16_t        req_type;
28257         /* The sequence ID from the original command. */
28258         uint16_t        seq_id;
28259         /* The length of the response data in number of bytes. */
28260         uint16_t        resp_len;
28261         /* Allocated NVRAM for this directory entry, in bytes. */
28262         uint32_t        dir_item_length;
28263         /* Size of the stored data for this directory entry, in bytes. */
28264         uint32_t        dir_data_length;
28265         /*
28266          * Firmware version.
28267          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
28268          */
28269         uint32_t        fw_ver;
28270         /* Directory ordinal. */
28271         uint16_t        dir_ordinal;
28272         /* Directory Entry Index */
28273         uint16_t        dir_idx;
28274         uint8_t unused_0[7];
28275         /*
28276          * This field is used in Output records to indicate that the output
28277          * is completely written to RAM.  This field should be read as '1'
28278          * to indicate that the output has been completely written.
28279          * When writing a command completion or response to an internal processor,
28280          * the order of writes has to be such that this field is written last.
28281          */
28282         uint8_t valid;
28283 } __attribute__((packed));
28284
28285 /****************************
28286  * hwrm_nvm_erase_dir_entry *
28287  ****************************/
28288
28289
28290 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
28291 struct hwrm_nvm_erase_dir_entry_input {
28292         /* The HWRM command request type. */
28293         uint16_t        req_type;
28294         /*
28295          * The completion ring to send the completion event on. This should
28296          * be the NQ ID returned from the `nq_alloc` HWRM command.
28297          */
28298         uint16_t        cmpl_ring;
28299         /*
28300          * The sequence ID is used by the driver for tracking multiple
28301          * commands. This ID is treated as opaque data by the firmware and
28302          * the value is returned in the `hwrm_resp_hdr` upon completion.
28303          */
28304         uint16_t        seq_id;
28305         /*
28306          * The target ID of the command:
28307          * * 0x0-0xFFF8 - The function ID
28308          * * 0xFFF8-0xFFFE - Reserved for internal processors
28309          * * 0xFFFF - HWRM
28310          */
28311         uint16_t        target_id;
28312         /*
28313          * A physical address pointer pointing to a host buffer that the
28314          * command's response data will be written. This can be either a host
28315          * physical address (HPA) or a guest physical address (GPA) and must
28316          * point to a physically contiguous block of memory.
28317          */
28318         uint64_t        resp_addr;
28319         /* Directory Entry Index */
28320         uint16_t        dir_idx;
28321         uint8_t unused_0[6];
28322 } __attribute__((packed));
28323
28324 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
28325 struct hwrm_nvm_erase_dir_entry_output {
28326         /* The specific error status for the command. */
28327         uint16_t        error_code;
28328         /* The HWRM command request type. */
28329         uint16_t        req_type;
28330         /* The sequence ID from the original command. */
28331         uint16_t        seq_id;
28332         /* The length of the response data in number of bytes. */
28333         uint16_t        resp_len;
28334         uint8_t unused_0[7];
28335         /*
28336          * This field is used in Output records to indicate that the output
28337          * is completely written to RAM.  This field should be read as '1'
28338          * to indicate that the output has been completely written.
28339          * When writing a command completion or response to an internal processor,
28340          * the order of writes has to be such that this field is written last.
28341          */
28342         uint8_t valid;
28343 } __attribute__((packed));
28344
28345 /*************************
28346  * hwrm_nvm_get_dev_info *
28347  *************************/
28348
28349
28350 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
28351 struct hwrm_nvm_get_dev_info_input {
28352         /* The HWRM command request type. */
28353         uint16_t        req_type;
28354         /*
28355          * The completion ring to send the completion event on. This should
28356          * be the NQ ID returned from the `nq_alloc` HWRM command.
28357          */
28358         uint16_t        cmpl_ring;
28359         /*
28360          * The sequence ID is used by the driver for tracking multiple
28361          * commands. This ID is treated as opaque data by the firmware and
28362          * the value is returned in the `hwrm_resp_hdr` upon completion.
28363          */
28364         uint16_t        seq_id;
28365         /*
28366          * The target ID of the command:
28367          * * 0x0-0xFFF8 - The function ID
28368          * * 0xFFF8-0xFFFE - Reserved for internal processors
28369          * * 0xFFFF - HWRM
28370          */
28371         uint16_t        target_id;
28372         /*
28373          * A physical address pointer pointing to a host buffer that the
28374          * command's response data will be written. This can be either a host
28375          * physical address (HPA) or a guest physical address (GPA) and must
28376          * point to a physically contiguous block of memory.
28377          */
28378         uint64_t        resp_addr;
28379 } __attribute__((packed));
28380
28381 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
28382 struct hwrm_nvm_get_dev_info_output {
28383         /* The specific error status for the command. */
28384         uint16_t        error_code;
28385         /* The HWRM command request type. */
28386         uint16_t        req_type;
28387         /* The sequence ID from the original command. */
28388         uint16_t        seq_id;
28389         /* The length of the response data in number of bytes. */
28390         uint16_t        resp_len;
28391         /* Manufacturer ID. */
28392         uint16_t        manufacturer_id;
28393         /* Device ID. */
28394         uint16_t        device_id;
28395         /* Sector size of the NVRAM device. */
28396         uint32_t        sector_size;
28397         /* Total size, in bytes of the NVRAM device. */
28398         uint32_t        nvram_size;
28399         uint32_t        reserved_size;
28400         /* Available size that can be used, in bytes.  Available size is the NVRAM size take away the used size and reserved size. */
28401         uint32_t        available_size;
28402         uint8_t unused_0[3];
28403         /*
28404          * This field is used in Output records to indicate that the output
28405          * is completely written to RAM.  This field should be read as '1'
28406          * to indicate that the output has been completely written.
28407          * When writing a command completion or response to an internal processor,
28408          * the order of writes has to be such that this field is written last.
28409          */
28410         uint8_t valid;
28411 } __attribute__((packed));
28412
28413 /**************************
28414  * hwrm_nvm_mod_dir_entry *
28415  **************************/
28416
28417
28418 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
28419 struct hwrm_nvm_mod_dir_entry_input {
28420         /* The HWRM command request type. */
28421         uint16_t        req_type;
28422         /*
28423          * The completion ring to send the completion event on. This should
28424          * be the NQ ID returned from the `nq_alloc` HWRM command.
28425          */
28426         uint16_t        cmpl_ring;
28427         /*
28428          * The sequence ID is used by the driver for tracking multiple
28429          * commands. This ID is treated as opaque data by the firmware and
28430          * the value is returned in the `hwrm_resp_hdr` upon completion.
28431          */
28432         uint16_t        seq_id;
28433         /*
28434          * The target ID of the command:
28435          * * 0x0-0xFFF8 - The function ID
28436          * * 0xFFF8-0xFFFE - Reserved for internal processors
28437          * * 0xFFFF - HWRM
28438          */
28439         uint16_t        target_id;
28440         /*
28441          * A physical address pointer pointing to a host buffer that the
28442          * command's response data will be written. This can be either a host
28443          * physical address (HPA) or a guest physical address (GPA) and must
28444          * point to a physically contiguous block of memory.
28445          */
28446         uint64_t        resp_addr;
28447         uint32_t        enables;
28448         /*
28449          * This bit must be '1' for the checksum field to be
28450          * configured.
28451          */
28452         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
28453         /* Directory Entry Index */
28454         uint16_t        dir_idx;
28455         /*
28456          * Directory ordinal.
28457          * The (0-based) instance of this Directory Type.
28458          */
28459         uint16_t        dir_ordinal;
28460         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
28461         uint16_t        dir_ext;
28462         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
28463         uint16_t        dir_attr;
28464         /*
28465          * If valid, then this field updates the checksum
28466          * value of the content in the directory entry.
28467          */
28468         uint32_t        checksum;
28469 } __attribute__((packed));
28470
28471 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
28472 struct hwrm_nvm_mod_dir_entry_output {
28473         /* The specific error status for the command. */
28474         uint16_t        error_code;
28475         /* The HWRM command request type. */
28476         uint16_t        req_type;
28477         /* The sequence ID from the original command. */
28478         uint16_t        seq_id;
28479         /* The length of the response data in number of bytes. */
28480         uint16_t        resp_len;
28481         uint8_t unused_0[7];
28482         /*
28483          * This field is used in Output records to indicate that the output
28484          * is completely written to RAM.  This field should be read as '1'
28485          * to indicate that the output has been completely written.
28486          * When writing a command completion or response to an internal processor,
28487          * the order of writes has to be such that this field is written last.
28488          */
28489         uint8_t valid;
28490 } __attribute__((packed));
28491
28492 /**************************
28493  * hwrm_nvm_verify_update *
28494  **************************/
28495
28496
28497 /* hwrm_nvm_verify_update_input (size:192b/24B) */
28498 struct hwrm_nvm_verify_update_input {
28499         /* The HWRM command request type. */
28500         uint16_t        req_type;
28501         /*
28502          * The completion ring to send the completion event on. This should
28503          * be the NQ ID returned from the `nq_alloc` HWRM command.
28504          */
28505         uint16_t        cmpl_ring;
28506         /*
28507          * The sequence ID is used by the driver for tracking multiple
28508          * commands. This ID is treated as opaque data by the firmware and
28509          * the value is returned in the `hwrm_resp_hdr` upon completion.
28510          */
28511         uint16_t        seq_id;
28512         /*
28513          * The target ID of the command:
28514          * * 0x0-0xFFF8 - The function ID
28515          * * 0xFFF8-0xFFFE - Reserved for internal processors
28516          * * 0xFFFF - HWRM
28517          */
28518         uint16_t        target_id;
28519         /*
28520          * A physical address pointer pointing to a host buffer that the
28521          * command's response data will be written. This can be either a host
28522          * physical address (HPA) or a guest physical address (GPA) and must
28523          * point to a physically contiguous block of memory.
28524          */
28525         uint64_t        resp_addr;
28526         /* Directory Entry Type, to be verified. */
28527         uint16_t        dir_type;
28528         /*
28529          * Directory ordinal.
28530          * The instance of the Directory Type to be verified.
28531          */
28532         uint16_t        dir_ordinal;
28533         /*
28534          * The Directory Entry Extension flags.
28535          * The "UPDATE" extension flag must be set in this value.
28536          * A corresponding directory entry with the same type and ordinal values but *without*
28537          * the "UPDATE" extension flag must also exist. The other flags of the extension must
28538          * be identical between the active and update entries.
28539          */
28540         uint16_t        dir_ext;
28541         uint8_t unused_0[2];
28542 } __attribute__((packed));
28543
28544 /* hwrm_nvm_verify_update_output (size:128b/16B) */
28545 struct hwrm_nvm_verify_update_output {
28546         /* The specific error status for the command. */
28547         uint16_t        error_code;
28548         /* The HWRM command request type. */
28549         uint16_t        req_type;
28550         /* The sequence ID from the original command. */
28551         uint16_t        seq_id;
28552         /* The length of the response data in number of bytes. */
28553         uint16_t        resp_len;
28554         uint8_t unused_0[7];
28555         /*
28556          * This field is used in Output records to indicate that the output
28557          * is completely written to RAM.  This field should be read as '1'
28558          * to indicate that the output has been completely written.
28559          * When writing a command completion or response to an internal processor,
28560          * the order of writes has to be such that this field is written last.
28561          */
28562         uint8_t valid;
28563 } __attribute__((packed));
28564
28565 /***************************
28566  * hwrm_nvm_install_update *
28567  ***************************/
28568
28569
28570 /* hwrm_nvm_install_update_input (size:192b/24B) */
28571 struct hwrm_nvm_install_update_input {
28572         /* The HWRM command request type. */
28573         uint16_t        req_type;
28574         /*
28575          * The completion ring to send the completion event on. This should
28576          * be the NQ ID returned from the `nq_alloc` HWRM command.
28577          */
28578         uint16_t        cmpl_ring;
28579         /*
28580          * The sequence ID is used by the driver for tracking multiple
28581          * commands. This ID is treated as opaque data by the firmware and
28582          * the value is returned in the `hwrm_resp_hdr` upon completion.
28583          */
28584         uint16_t        seq_id;
28585         /*
28586          * The target ID of the command:
28587          * * 0x0-0xFFF8 - The function ID
28588          * * 0xFFF8-0xFFFE - Reserved for internal processors
28589          * * 0xFFFF - HWRM
28590          */
28591         uint16_t        target_id;
28592         /*
28593          * A physical address pointer pointing to a host buffer that the
28594          * command's response data will be written. This can be either a host
28595          * physical address (HPA) or a guest physical address (GPA) and must
28596          * point to a physically contiguous block of memory.
28597          */
28598         uint64_t        resp_addr;
28599         /*
28600          * Installation type. If the value 3 through 0xffff is used,
28601          * only packaged items with that type value will be installed and
28602          * conditional installation directives for those packaged items
28603          * will be over-ridden (i.e. 'create' or 'replace' will be treated
28604          * as 'install').
28605          */
28606         uint32_t        install_type;
28607         /*
28608          * Perform a normal package installation. Conditional installation
28609          * directives (e.g. 'create' and 'replace') of packaged items
28610          * will be followed.
28611          */
28612         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
28613         /*
28614          * Install all packaged items regardless of installation directive
28615          * (i.e. treat all packaged items as though they have an installation
28616          * directive of 'install').
28617          */
28618         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
28619                 UINT32_C(0xffffffff)
28620         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
28621                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
28622         uint16_t        flags;
28623         /* If set to 1, then securely erase all unused locations in persistent storage. */
28624         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
28625                 UINT32_C(0x1)
28626         /*
28627          * If set to 1, then unspecifed images, images not in the package file, will be safely deleted.
28628          * When combined with erase_unused_space then unspecified images will be securely erased.
28629          */
28630         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
28631                 UINT32_C(0x2)
28632         /*
28633          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
28634          * Allow additional time for this command to complete if this bit is set to 1.
28635          */
28636         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
28637                 UINT32_C(0x4)
28638         uint8_t unused_0[2];
28639 } __attribute__((packed));
28640
28641 /* hwrm_nvm_install_update_output (size:192b/24B) */
28642 struct hwrm_nvm_install_update_output {
28643         /* The specific error status for the command. */
28644         uint16_t        error_code;
28645         /* The HWRM command request type. */
28646         uint16_t        req_type;
28647         /* The sequence ID from the original command. */
28648         uint16_t        seq_id;
28649         /* The length of the response data in number of bytes. */
28650         uint16_t        resp_len;
28651         /*
28652          * Bit-mask of successfully installed items.
28653          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
28654          * A value of 0 indicates that no items were successfully installed.
28655          */
28656         uint64_t        installed_items;
28657         /* result is 8 b */
28658         uint8_t result;
28659         /* There was no problem with the package installation. */
28660         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
28661         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
28662                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
28663         /* problem_item is 8 b */
28664         uint8_t problem_item;
28665         /* There was no problem with any packaged items. */
28666         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
28667                 UINT32_C(0x0)
28668         /* There was a problem with the NVM package itself. */
28669         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
28670                 UINT32_C(0xff)
28671         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
28672                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
28673         /* reset_required is 8 b */
28674         uint8_t reset_required;
28675         /*
28676          * No reset is required for installed/updated firmware or
28677          * microcode to take effect.
28678          */
28679         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
28680                 UINT32_C(0x0)
28681         /*
28682          * A PCIe reset (e.g. system reboot) is
28683          * required for newly installed/updated firmware or
28684          * microcode to take effect.
28685          */
28686         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
28687                 UINT32_C(0x1)
28688         /*
28689          * A controller power reset (e.g. system power-cycle) is
28690          * required for newly installed/updated firmware or
28691          * microcode to take effect. Some newly installed/updated
28692          * firmware or microcode may still take effect upon the
28693          * next PCIe reset.
28694          */
28695         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
28696                 UINT32_C(0x2)
28697         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
28698                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
28699         uint8_t unused_0[4];
28700         /*
28701          * This field is used in Output records to indicate that the output
28702          * is completely written to RAM.  This field should be read as '1'
28703          * to indicate that the output has been completely written.
28704          * When writing a command completion or response to an internal processor,
28705          * the order of writes has to be such that this field is written last.
28706          */
28707         uint8_t valid;
28708 } __attribute__((packed));
28709
28710 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
28711 struct hwrm_nvm_install_update_cmd_err {
28712         /*
28713          * command specific error codes that goes to
28714          * the cmd_err field in Common HWRM Error Response.
28715          */
28716         uint8_t code;
28717         /* Unknown error */
28718         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
28719         /* Unable to complete operation due to fragmentation */
28720         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
28721         /* nvm is completely full. */
28722         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
28723         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
28724                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
28725         uint8_t unused_0[7];
28726 } __attribute__((packed));
28727
28728 /******************
28729  * hwrm_nvm_flush *
28730  ******************/
28731
28732
28733 /* hwrm_nvm_flush_input (size:128b/16B) */
28734 struct hwrm_nvm_flush_input {
28735         /* The HWRM command request type. */
28736         uint16_t        req_type;
28737         /*
28738          * The completion ring to send the completion event on. This should
28739          * be the NQ ID returned from the `nq_alloc` HWRM command.
28740          */
28741         uint16_t        cmpl_ring;
28742         /*
28743          * The sequence ID is used by the driver for tracking multiple
28744          * commands. This ID is treated as opaque data by the firmware and
28745          * the value is returned in the `hwrm_resp_hdr` upon completion.
28746          */
28747         uint16_t        seq_id;
28748         /*
28749          * The target ID of the command:
28750          * * 0x0-0xFFF8 - The function ID
28751          * * 0xFFF8-0xFFFE - Reserved for internal processors
28752          * * 0xFFFF - HWRM
28753          */
28754         uint16_t        target_id;
28755         /*
28756          * A physical address pointer pointing to a host buffer that the
28757          * command's response data will be written. This can be either a host
28758          * physical address (HPA) or a guest physical address (GPA) and must
28759          * point to a physically contiguous block of memory.
28760          */
28761         uint64_t        resp_addr;
28762 } __attribute__((packed));
28763
28764 /* hwrm_nvm_flush_output (size:128b/16B) */
28765 struct hwrm_nvm_flush_output {
28766         /* The specific error status for the command. */
28767         uint16_t        error_code;
28768         /* The HWRM command request type. */
28769         uint16_t        req_type;
28770         /* The sequence ID from the original command. */
28771         uint16_t        seq_id;
28772         /* The length of the response data in number of bytes. */
28773         uint16_t        resp_len;
28774         uint8_t unused_0[7];
28775         /*
28776          * This field is used in Output records to indicate that the output
28777          * is completely written to RAM.  This field should be read as '1'
28778          * to indicate that the output has been completely written.
28779          * When writing a command completion or response to an internal processor,
28780          * the order of writes has to be such that this field is written last.
28781          */
28782         uint8_t valid;
28783 } __attribute__((packed));
28784
28785 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
28786 struct hwrm_nvm_flush_cmd_err {
28787         /*
28788          * command specific error codes that goes to
28789          * the cmd_err field in Common HWRM Error Response.
28790          */
28791         uint8_t code;
28792         /* Unknown error */
28793         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
28794         /* flush could not be performed */
28795         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
28796         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
28797                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
28798         uint8_t unused_0[7];
28799 } __attribute__((packed));
28800
28801 /*************************
28802  * hwrm_nvm_get_variable *
28803  *************************/
28804
28805
28806 /* hwrm_nvm_get_variable_input (size:320b/40B) */
28807 struct hwrm_nvm_get_variable_input {
28808         /* The HWRM command request type. */
28809         uint16_t        req_type;
28810         /*
28811          * The completion ring to send the completion event on. This should
28812          * be the NQ ID returned from the `nq_alloc` HWRM command.
28813          */
28814         uint16_t        cmpl_ring;
28815         /*
28816          * The sequence ID is used by the driver for tracking multiple
28817          * commands. This ID is treated as opaque data by the firmware and
28818          * the value is returned in the `hwrm_resp_hdr` upon completion.
28819          */
28820         uint16_t        seq_id;
28821         /*
28822          * The target ID of the command:
28823          * * 0x0-0xFFF8 - The function ID
28824          * * 0xFFF8-0xFFFE - Reserved for internal processors
28825          * * 0xFFFF - HWRM
28826          */
28827         uint16_t        target_id;
28828         /*
28829          * A physical address pointer pointing to a host buffer that the
28830          * command's response data will be written. This can be either a host
28831          * physical address (HPA) or a guest physical address (GPA) and must
28832          * point to a physically contiguous block of memory.
28833          */
28834         uint64_t        resp_addr;
28835         /*
28836          * This is the host address where
28837          * nvm variable will be stored
28838          */
28839         uint64_t        dest_data_addr;
28840         /* size of data in bits */
28841         uint16_t        data_len;
28842         /* nvm cfg option number */
28843         uint16_t        option_num;
28844         /* reserved. */
28845         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
28846         /* reserved. */
28847         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
28848                 UINT32_C(0xffff)
28849         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
28850                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
28851         /*
28852          * Number of dimensions for this nvm configuration variable.
28853          * This value indicates how many of the indexN values to use.
28854          * A value of 0 means that none of the indexN values are valid.
28855          * A value of 1 requires at index0 is valued, a value of 2
28856          * requires that index0 and index1 are valid, and so forth
28857          */
28858         uint16_t        dimensions;
28859         /* index for the 1st dimensions */
28860         uint16_t        index_0;
28861         /* index for the 2nd dimensions */
28862         uint16_t        index_1;
28863         /* index for the 3rd dimensions */
28864         uint16_t        index_2;
28865         /* index for the 4th dimensions */
28866         uint16_t        index_3;
28867         uint8_t flags;
28868         /*
28869          * When this bit is set to 1, the factory default value will be returned,
28870          * 0 returns the operational value.
28871          */
28872         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
28873                 UINT32_C(0x1)
28874         uint8_t unused_0;
28875 } __attribute__((packed));
28876
28877 /* hwrm_nvm_get_variable_output (size:128b/16B) */
28878 struct hwrm_nvm_get_variable_output {
28879         /* The specific error status for the command. */
28880         uint16_t        error_code;
28881         /* The HWRM command request type. */
28882         uint16_t        req_type;
28883         /* The sequence ID from the original command. */
28884         uint16_t        seq_id;
28885         /* The length of the response data in number of bytes. */
28886         uint16_t        resp_len;
28887         /* size of data of the actual variable retrieved in bits */
28888         uint16_t        data_len;
28889         /*
28890          * option_num is the option number for the data retrieved.  It is possible in the
28891          * future that the option number returned would be different than requested.  This
28892          * condition could occur if an option is deprecated and a new option id is defined
28893          * with similar characteristics, but has a slightly different definition.  This
28894          * also makes it convenient for the caller to identify the variable result with
28895          * the option id from the response.
28896          */
28897         uint16_t        option_num;
28898         /* reserved. */
28899         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
28900         /* reserved. */
28901         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
28902                 UINT32_C(0xffff)
28903         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
28904                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
28905         uint8_t unused_0[3];
28906         /*
28907          * This field is used in Output records to indicate that the output
28908          * is completely written to RAM.  This field should be read as '1'
28909          * to indicate that the output has been completely written.
28910          * When writing a command completion or response to an internal processor,
28911          * the order of writes has to be such that this field is written last.
28912          */
28913         uint8_t valid;
28914 } __attribute__((packed));
28915
28916 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
28917 struct hwrm_nvm_get_variable_cmd_err {
28918         /*
28919          * command specific error codes that goes to
28920          * the cmd_err field in Common HWRM Error Response.
28921          */
28922         uint8_t code;
28923         /* Unknown error */
28924         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
28925         /* variable does not exist */
28926         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
28927         /* configuration is corrupted and the variable cannot be saved */
28928         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
28929         /* length specified is too small */
28930         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
28931         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
28932                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
28933         uint8_t unused_0[7];
28934 } __attribute__((packed));
28935
28936 /*************************
28937  * hwrm_nvm_set_variable *
28938  *************************/
28939
28940
28941 /* hwrm_nvm_set_variable_input (size:320b/40B) */
28942 struct hwrm_nvm_set_variable_input {
28943         /* The HWRM command request type. */
28944         uint16_t        req_type;
28945         /*
28946          * The completion ring to send the completion event on. This should
28947          * be the NQ ID returned from the `nq_alloc` HWRM command.
28948          */
28949         uint16_t        cmpl_ring;
28950         /*
28951          * The sequence ID is used by the driver for tracking multiple
28952          * commands. This ID is treated as opaque data by the firmware and
28953          * the value is returned in the `hwrm_resp_hdr` upon completion.
28954          */
28955         uint16_t        seq_id;
28956         /*
28957          * The target ID of the command:
28958          * * 0x0-0xFFF8 - The function ID
28959          * * 0xFFF8-0xFFFE - Reserved for internal processors
28960          * * 0xFFFF - HWRM
28961          */
28962         uint16_t        target_id;
28963         /*
28964          * A physical address pointer pointing to a host buffer that the
28965          * command's response data will be written. This can be either a host
28966          * physical address (HPA) or a guest physical address (GPA) and must
28967          * point to a physically contiguous block of memory.
28968          */
28969         uint64_t        resp_addr;
28970         /*
28971          * This is the host address where
28972          * nvm variable will be copied from
28973          */
28974         uint64_t        src_data_addr;
28975         /* size of data in bits */
28976         uint16_t        data_len;
28977         /* nvm cfg option number */
28978         uint16_t        option_num;
28979         /* reserved. */
28980         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
28981         /* reserved. */
28982         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
28983                 UINT32_C(0xffff)
28984         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
28985                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
28986         /*
28987          * Number of dimensions for this nvm configuration variable.
28988          * This value indicates how many of the indexN values to use.
28989          * A value of 0 means that none of the indexN values are valid.
28990          * A value of 1 requires at index0 is valued, a value of 2
28991          * requires that index0 and index1 are valid, and so forth
28992          */
28993         uint16_t        dimensions;
28994         /* index for the 1st dimensions */
28995         uint16_t        index_0;
28996         /* index for the 2nd dimensions */
28997         uint16_t        index_1;
28998         /* index for the 3rd dimensions */
28999         uint16_t        index_2;
29000         /* index for the 4th dimensions */
29001         uint16_t        index_3;
29002         uint8_t flags;
29003         /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
29004         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
29005                 UINT32_C(0x1)
29006         /* encryption method */
29007         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
29008                 UINT32_C(0xe)
29009         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
29010         /* No encryption. */
29011         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
29012                 (UINT32_C(0x0) << 1)
29013         /* one-way encryption. */
29014         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
29015                 (UINT32_C(0x1) << 1)
29016         /* symmetric AES256 encryption. */
29017         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
29018                 (UINT32_C(0x2) << 1)
29019         /* SHA1 digest appended to plaintext contents, for authentication */
29020         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
29021                 (UINT32_C(0x3) << 1)
29022         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
29023                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
29024         uint8_t unused_0;
29025 } __attribute__((packed));
29026
29027 /* hwrm_nvm_set_variable_output (size:128b/16B) */
29028 struct hwrm_nvm_set_variable_output {
29029         /* The specific error status for the command. */
29030         uint16_t        error_code;
29031         /* The HWRM command request type. */
29032         uint16_t        req_type;
29033         /* The sequence ID from the original command. */
29034         uint16_t        seq_id;
29035         /* The length of the response data in number of bytes. */
29036         uint16_t        resp_len;
29037         uint8_t unused_0[7];
29038         /*
29039          * This field is used in Output records to indicate that the output
29040          * is completely written to RAM.  This field should be read as '1'
29041          * to indicate that the output has been completely written.
29042          * When writing a command completion or response to an internal processor,
29043          * the order of writes has to be such that this field is written last.
29044          */
29045         uint8_t valid;
29046 } __attribute__((packed));
29047
29048 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
29049 struct hwrm_nvm_set_variable_cmd_err {
29050         /*
29051          * command specific error codes that goes to
29052          * the cmd_err field in Common HWRM Error Response.
29053          */
29054         uint8_t code;
29055         /* Unknown error */
29056         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
29057         /* variable does not exist */
29058         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
29059         /* configuration is corrupted and the variable cannot be saved */
29060         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
29061         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
29062                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
29063         uint8_t unused_0[7];
29064 } __attribute__((packed));
29065
29066 /****************************
29067  * hwrm_nvm_validate_option *
29068  ****************************/
29069
29070
29071 /* hwrm_nvm_validate_option_input (size:320b/40B) */
29072 struct hwrm_nvm_validate_option_input {
29073         /* The HWRM command request type. */
29074         uint16_t        req_type;
29075         /*
29076          * The completion ring to send the completion event on. This should
29077          * be the NQ ID returned from the `nq_alloc` HWRM command.
29078          */
29079         uint16_t        cmpl_ring;
29080         /*
29081          * The sequence ID is used by the driver for tracking multiple
29082          * commands. This ID is treated as opaque data by the firmware and
29083          * the value is returned in the `hwrm_resp_hdr` upon completion.
29084          */
29085         uint16_t        seq_id;
29086         /*
29087          * The target ID of the command:
29088          * * 0x0-0xFFF8 - The function ID
29089          * * 0xFFF8-0xFFFE - Reserved for internal processors
29090          * * 0xFFFF - HWRM
29091          */
29092         uint16_t        target_id;
29093         /*
29094          * A physical address pointer pointing to a host buffer that the
29095          * command's response data will be written. This can be either a host
29096          * physical address (HPA) or a guest physical address (GPA) and must
29097          * point to a physically contiguous block of memory.
29098          */
29099         uint64_t        resp_addr;
29100         /*
29101          * This is the host address where
29102          * nvm variable will be copied from
29103          */
29104         uint64_t        src_data_addr;
29105         /* size of data in bits */
29106         uint16_t        data_len;
29107         /* nvm cfg option number */
29108         uint16_t        option_num;
29109         /* reserved. */
29110         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
29111                 UINT32_C(0x0)
29112         /* reserved. */
29113         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
29114                 UINT32_C(0xffff)
29115         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
29116                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
29117         /*
29118          * Number of dimensions for this nvm configuration variable.
29119          * This value indicates how many of the indexN values to use.
29120          * A value of 0 means that none of the indexN values are valid.
29121          * A value of 1 requires at index0 is valued, a value of 2
29122          * requires that index0 and index1 are valid, and so forth
29123          */
29124         uint16_t        dimensions;
29125         /* index for the 1st dimensions */
29126         uint16_t        index_0;
29127         /* index for the 2nd dimensions */
29128         uint16_t        index_1;
29129         /* index for the 3rd dimensions */
29130         uint16_t        index_2;
29131         /* index for the 4th dimensions */
29132         uint16_t        index_3;
29133         uint8_t unused_0[2];
29134 } __attribute__((packed));
29135
29136 /* hwrm_nvm_validate_option_output (size:128b/16B) */
29137 struct hwrm_nvm_validate_option_output {
29138         /* The specific error status for the command. */
29139         uint16_t        error_code;
29140         /* The HWRM command request type. */
29141         uint16_t        req_type;
29142         /* The sequence ID from the original command. */
29143         uint16_t        seq_id;
29144         /* The length of the response data in number of bytes. */
29145         uint16_t        resp_len;
29146         uint8_t result;
29147         /* indicates that the value provided for the option is not matching with the saved data. */
29148         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
29149         /* indicates that the value provided for the option is matching the saved data. */
29150         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
29151         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
29152                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
29153         uint8_t unused_0[6];
29154         /*
29155          * This field is used in Output records to indicate that the output
29156          * is completely written to RAM.  This field should be read as '1'
29157          * to indicate that the output has been completely written.
29158          * When writing a command completion or response to an internal processor,
29159          * the order of writes has to be such that this field is written last.
29160          */
29161         uint8_t valid;
29162 } __attribute__((packed));
29163
29164 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
29165 struct hwrm_nvm_validate_option_cmd_err {
29166         /*
29167          * command specific error codes that goes to
29168          * the cmd_err field in Common HWRM Error Response.
29169          */
29170         uint8_t code;
29171         /* Unknown error */
29172         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
29173         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
29174                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
29175         uint8_t unused_0[7];
29176 } __attribute__((packed));
29177
29178 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */