net/bnxt: update HWRM to version 1.9.2
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2018 Broadcom Limited
3  * All rights reserved.
4  *
5  * DO NOT MODIFY!!! This file is automatically generated.
6  */
7
8 #ifndef _HSI_STRUCT_DEF_DPDK_H_
9 #define _HSI_STRUCT_DEF_DPDK_H_
10
11 /* This is the HWRM command header. */
12 /* hwrm_cmd_hdr (size:128b/16B) */
13 struct hwrm_cmd_hdr {
14         /* The HWRM command request type. */
15         uint16_t        req_type;
16         /*
17          * The completion ring to send the completion event on. This should
18          * be the NQ ID returned from the `nq_alloc` HWRM command.
19          */
20         uint16_t        cmpl_ring;
21         /*
22          * The sequence ID is used by the driver for tracking multiple
23          * commands. This ID is treated as opaque data by the firmware and
24          * the value is returned in the `hwrm_resp_hdr` upon completion.
25          */
26         uint16_t        seq_id;
27         /*
28          * The target ID of the command:
29          * * 0x0-0xFFF8 - The function ID
30          * * 0xFFF8-0xFFFE - Reserved for internal processors
31          * * 0xFFFF - HWRM
32          */
33         uint16_t        target_id;
34         /*
35          * A physical address pointer pointing to a host buffer that the
36          * command's response data will be written. This can be either a host
37          * physical address (HPA) or a guest physical address (GPA) and must
38          * point to a physically contiguous block of memory.
39          */
40         uint64_t        resp_addr;
41 } __attribute__((packed));
42
43 /* This is the HWRM response header. */
44 /* hwrm_resp_hdr (size:64b/8B) */
45 struct hwrm_resp_hdr {
46         /* The specific error status for the command. */
47         uint16_t        error_code;
48         /* The HWRM command request type. */
49         uint16_t        req_type;
50         /* The sequence ID from the original command. */
51         uint16_t        seq_id;
52         /* The length of the response data in number of bytes. */
53         uint16_t        resp_len;
54 } __attribute__((packed));
55
56 /*
57  * TLV encapsulated message. Use the TLV type field of the
58  * TLV to determine the type of message encapsulated.
59  */
60 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
61 #define CMD_DISCR_LAST     CMD_DISCR_TLV_ENCAP
62
63
64 /* HWRM request message */
65 #define TLV_TYPE_HWRM_REQUEST                    UINT32_C(0x1)
66 /* HWRM response message */
67 #define TLV_TYPE_HWRM_RESPONSE                   UINT32_C(0x2)
68 /* RoCE slow path command */
69 #define TLV_TYPE_ROCE_SP_COMMAND                 UINT32_C(0x3)
70 /* Engine CKV - The device's serial number. */
71 #define TLV_TYPE_ENGINE_CKV_DEVICE_SERIAL_NUMBER UINT32_C(0x8001)
72 /* Engine CKV - Per-function random nonce data. */
73 #define TLV_TYPE_ENGINE_CKV_NONCE                UINT32_C(0x8002)
74 /* Engine CKV - Initialization vector. */
75 #define TLV_TYPE_ENGINE_CKV_IV                   UINT32_C(0x8003)
76 /* Engine CKV - Authentication tag. */
77 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG             UINT32_C(0x8004)
78 /* Engine CKV - The encrypted data. */
79 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT           UINT32_C(0x8005)
80 /* Engine CKV - Supported algorithms. */
81 #define TLV_TYPE_ENGINE_CKV_ALGORITHMS           UINT32_C(0x8006)
82 /* Engine CKV - The EC curve name and ECC public key information. */
83 #define TLV_TYPE_ENGINE_CKV_ECC_PUBLIC_KEY       UINT32_C(0x8007)
84 /* Engine CKV - The ECDSA signature. */
85 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE      UINT32_C(0x8008)
86 #define TLV_TYPE_LAST \
87         TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE
88
89
90 /* tlv (size:64b/8B) */
91 struct tlv {
92         /*
93          * The command discriminator is used to differentiate between various
94          * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
95          * command messages as well as newer TLV encapsulated HWRM commands.
96          *
97          * For TLV encapsulated messages this field must be 0x8000.
98          */
99         uint16_t        cmd_discr;
100         uint8_t reserved_8b;
101         uint8_t flags;
102         /*
103          * Indicates the presence of additional TLV encapsulated data
104          * follows this TLV.
105          */
106         #define TLV_FLAGS_MORE         UINT32_C(0x1)
107         /* Last TLV in a sequence of TLVs. */
108         #define TLV_FLAGS_MORE_LAST      UINT32_C(0x0)
109         /* More TLVs follow this TLV. */
110         #define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
111         /*
112          * When an HWRM receiver detects a TLV type that it does not
113          * support with the TLV required flag set, the receiver must
114          * reject the HWRM message with an error code indicating an
115          * unsupported TLV type.
116          */
117         #define TLV_FLAGS_REQUIRED     UINT32_C(0x2)
118         /* No */
119         #define TLV_FLAGS_REQUIRED_NO    (UINT32_C(0x0) << 1)
120         /* Yes */
121         #define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
122         #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
123         /*
124          * This field defines the TLV type value which is divided into
125          * two ranges to differentiate between global and local TLV types.
126          * Global TLV types must be unique across all defined TLV types.
127          * Local TLV types are valid only for extensions to a given
128          * HWRM message and may be repeated across different HWRM message
129          * types. There is a direct correlation of each HWRM message type
130          * to a single global TLV type value.
131          *
132          * Global TLV range: `0 - (63k-1)`
133          *
134          * Local TLV range: `63k - (64k-1)`
135          */
136         uint16_t        tlv_type;
137         /*
138          * Length of the message data encapsulated by this TLV in bytes.
139          * This length does not include the size of the TLV header itself
140          * and it must be an integer multiple of 8B.
141          */
142         uint16_t        length;
143 } __attribute__((packed));
144
145 /* Input */
146 /* input (size:128b/16B) */
147 struct input {
148         /*
149          * This value indicates what type of request this is.  The format
150          * for the rest of the command is determined by this field.
151          */
152         uint16_t        req_type;
153         /*
154          * This value indicates the what completion ring the request will
155          * be optionally completed on.  If the value is -1, then no
156          * CR completion will be generated.  Any other value must be a
157          * valid CR ring_id value for this function.
158          */
159         uint16_t        cmpl_ring;
160         /* This value indicates the command sequence number. */
161         uint16_t        seq_id;
162         /*
163          * Target ID of this command.
164          *
165          * 0x0 - 0xFFF8 - Used for function ids
166          * 0xFFF8 - 0xFFFE - Reserved for internal processors
167          * 0xFFFF - HWRM
168          */
169         uint16_t        target_id;
170         /*
171          * This is the host address where the response will be written
172          * when the request is complete.  This area must be 16B aligned
173          * and must be cleared to zero before the request is made.
174          */
175         uint64_t        resp_addr;
176 } __attribute__((packed));
177
178 /* Output */
179 /* output (size:64b/8B) */
180 struct output {
181         /*
182          * Pass/Fail or error type
183          *
184          * Note: receiver to verify the in parameters, and fail the call
185          * with an error when appropriate
186          */
187         uint16_t        error_code;
188         /* This field returns the type of original request. */
189         uint16_t        req_type;
190         /* This field provides original sequence number of the command. */
191         uint16_t        seq_id;
192         /*
193          * This field is the length of the response in bytes.  The
194          * last byte of the response is a valid flag that will read
195          * as '1' when the command has been completely written to
196          * memory.
197          */
198         uint16_t        resp_len;
199 } __attribute__((packed));
200
201 /* Short Command Structure */
202 /* hwrm_short_input (size:128b/16B) */
203 struct hwrm_short_input {
204         /*
205          * This field indicates the type of request in the request buffer.
206          * The format for the rest of the command (request) is determined
207          * by this field.
208          */
209         uint16_t        req_type;
210         /*
211          * This field indicates a signature that is used to identify short
212          * form of the command listed here. This field shall be set to
213          * 17185 (0x4321).
214          */
215         uint16_t        signature;
216         /* Signature indicating this is a short form of HWRM command */
217         #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
218         #define HWRM_SHORT_INPUT_SIGNATURE_LAST \
219                 HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
220         /* Reserved for future use. */
221         uint16_t        unused_0;
222         /* This value indicates the length of the request. */
223         uint16_t        size;
224         /*
225          * This is the host address where the request was written.
226          * This area must be 16B aligned.
227          */
228         uint64_t        req_addr;
229 } __attribute__((packed));
230
231 /*
232  * Command numbering
233  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
234  * #        So only structure definition is provided here.
235  */
236 /* cmd_nums (size:64b/8B) */
237 struct cmd_nums {
238         /*
239          * This version of the specification defines the commands listed in
240          * the table below. The following are general implementation
241          * requirements for these commands:
242          *
243          * # All commands listed below that are marked neither
244          * reserved nor experimental shall be implemented by the HWRM.
245          * # A HWRM client compliant to this specification should not use
246          * commands outside of the list below.
247          * # A HWRM client compliant to this specification should not use
248          * command numbers marked reserved below.
249          * # A command marked experimental below may not be implemented
250          * by the HWRM.
251          * # A command marked experimental may change in the
252          * future version of the HWRM specification.
253          * # A command not listed below may be implemented by the HWRM.
254          * The behavior of commands that are not listed below is outside
255          * the scope of this specification.
256          */
257         uint16_t        req_type;
258         #define HWRM_VER_GET                              UINT32_C(0x0)
259         #define HWRM_FUNC_BUF_UNRGTR                      UINT32_C(0xe)
260         #define HWRM_FUNC_VF_CFG                          UINT32_C(0xf)
261         /* Reserved for future use. */
262         #define HWRM_RESERVED1                            UINT32_C(0x10)
263         #define HWRM_FUNC_RESET                           UINT32_C(0x11)
264         #define HWRM_FUNC_GETFID                          UINT32_C(0x12)
265         #define HWRM_FUNC_VF_ALLOC                        UINT32_C(0x13)
266         #define HWRM_FUNC_VF_FREE                         UINT32_C(0x14)
267         #define HWRM_FUNC_QCAPS                           UINT32_C(0x15)
268         #define HWRM_FUNC_QCFG                            UINT32_C(0x16)
269         #define HWRM_FUNC_CFG                             UINT32_C(0x17)
270         #define HWRM_FUNC_QSTATS                          UINT32_C(0x18)
271         #define HWRM_FUNC_CLR_STATS                       UINT32_C(0x19)
272         #define HWRM_FUNC_DRV_UNRGTR                      UINT32_C(0x1a)
273         #define HWRM_FUNC_VF_RESC_FREE                    UINT32_C(0x1b)
274         #define HWRM_FUNC_VF_VNIC_IDS_QUERY               UINT32_C(0x1c)
275         #define HWRM_FUNC_DRV_RGTR                        UINT32_C(0x1d)
276         #define HWRM_FUNC_DRV_QVER                        UINT32_C(0x1e)
277         #define HWRM_FUNC_BUF_RGTR                        UINT32_C(0x1f)
278         #define HWRM_PORT_PHY_CFG                         UINT32_C(0x20)
279         #define HWRM_PORT_MAC_CFG                         UINT32_C(0x21)
280         /* Experimental */
281         #define HWRM_PORT_TS_QUERY                        UINT32_C(0x22)
282         #define HWRM_PORT_QSTATS                          UINT32_C(0x23)
283         #define HWRM_PORT_LPBK_QSTATS                     UINT32_C(0x24)
284         /* Experimental */
285         #define HWRM_PORT_CLR_STATS                       UINT32_C(0x25)
286         /* Experimental */
287         #define HWRM_PORT_LPBK_CLR_STATS                  UINT32_C(0x26)
288         #define HWRM_PORT_PHY_QCFG                        UINT32_C(0x27)
289         #define HWRM_PORT_MAC_QCFG                        UINT32_C(0x28)
290         /* Experimental */
291         #define HWRM_PORT_MAC_PTP_QCFG                    UINT32_C(0x29)
292         #define HWRM_PORT_PHY_QCAPS                       UINT32_C(0x2a)
293         #define HWRM_PORT_PHY_I2C_WRITE                   UINT32_C(0x2b)
294         #define HWRM_PORT_PHY_I2C_READ                    UINT32_C(0x2c)
295         #define HWRM_PORT_LED_CFG                         UINT32_C(0x2d)
296         #define HWRM_PORT_LED_QCFG                        UINT32_C(0x2e)
297         #define HWRM_PORT_LED_QCAPS                       UINT32_C(0x2f)
298         #define HWRM_QUEUE_QPORTCFG                       UINT32_C(0x30)
299         #define HWRM_QUEUE_QCFG                           UINT32_C(0x31)
300         #define HWRM_QUEUE_CFG                            UINT32_C(0x32)
301         #define HWRM_FUNC_VLAN_CFG                        UINT32_C(0x33)
302         #define HWRM_FUNC_VLAN_QCFG                       UINT32_C(0x34)
303         #define HWRM_QUEUE_PFCENABLE_QCFG                 UINT32_C(0x35)
304         #define HWRM_QUEUE_PFCENABLE_CFG                  UINT32_C(0x36)
305         #define HWRM_QUEUE_PRI2COS_QCFG                   UINT32_C(0x37)
306         #define HWRM_QUEUE_PRI2COS_CFG                    UINT32_C(0x38)
307         #define HWRM_QUEUE_COS2BW_QCFG                    UINT32_C(0x39)
308         #define HWRM_QUEUE_COS2BW_CFG                     UINT32_C(0x3a)
309         /* Experimental */
310         #define HWRM_QUEUE_DSCP_QCAPS                     UINT32_C(0x3b)
311         /* Experimental */
312         #define HWRM_QUEUE_DSCP2PRI_QCFG                  UINT32_C(0x3c)
313         /* Experimental */
314         #define HWRM_QUEUE_DSCP2PRI_CFG                   UINT32_C(0x3d)
315         #define HWRM_VNIC_ALLOC                           UINT32_C(0x40)
316         #define HWRM_VNIC_FREE                            UINT32_C(0x41)
317         #define HWRM_VNIC_CFG                             UINT32_C(0x42)
318         #define HWRM_VNIC_QCFG                            UINT32_C(0x43)
319         #define HWRM_VNIC_TPA_CFG                         UINT32_C(0x44)
320         /* Experimental */
321         #define HWRM_VNIC_TPA_QCFG                        UINT32_C(0x45)
322         #define HWRM_VNIC_RSS_CFG                         UINT32_C(0x46)
323         #define HWRM_VNIC_RSS_QCFG                        UINT32_C(0x47)
324         #define HWRM_VNIC_PLCMODES_CFG                    UINT32_C(0x48)
325         #define HWRM_VNIC_PLCMODES_QCFG                   UINT32_C(0x49)
326         #define HWRM_VNIC_QCAPS                           UINT32_C(0x4a)
327         #define HWRM_RING_ALLOC                           UINT32_C(0x50)
328         #define HWRM_RING_FREE                            UINT32_C(0x51)
329         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS        UINT32_C(0x52)
330         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS     UINT32_C(0x53)
331         #define HWRM_RING_RESET                           UINT32_C(0x5e)
332         #define HWRM_RING_GRP_ALLOC                       UINT32_C(0x60)
333         #define HWRM_RING_GRP_FREE                        UINT32_C(0x61)
334         /* Reserved for future use. */
335         #define HWRM_RESERVED5                            UINT32_C(0x64)
336         /* Reserved for future use. */
337         #define HWRM_RESERVED6                            UINT32_C(0x65)
338         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC            UINT32_C(0x70)
339         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE             UINT32_C(0x71)
340         #define HWRM_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
341         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
342         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
343         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
344         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
345         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
346         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
347         /* Experimental */
348         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
349         /* Experimental */
350         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
351         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
352         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
353         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
354         /* Experimental */
355         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
356         /* Experimental */
357         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
358         /* Experimental */
359         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
360         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
361         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
362         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
363         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
364         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
365         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
366         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
367         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
368         #define HWRM_FW_RESET                             UINT32_C(0xc0)
369         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
370         /* Experimental */
371         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
372         /* Experimental */
373         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
374         /* Experimental */
375         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
376         /* Experimental */
377         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
378         /* Experimental */
379         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
380         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
381         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
382         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
383         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
384         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
385         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
386         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
387         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
388         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
389         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
390         /* Experimental */
391         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
392         /* Experimental */
393         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
394         /* Experimental */
395         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
396         /* Experimental */
397         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
398         /* Experimental */
399         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
400         /* Experimental */
401         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
402         /* Experimental */
403         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
404         /* Experimental */
405         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
406         /* Experimental */
407         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
408         /* Experimental */
409         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
410         /* Experimental */
411         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
412         /* Experimental */
413         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
414         /* Experimental */
415         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
416         /* Experimental */
417         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
418         /* Experimental */
419         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
420         /* Experimental */
421         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
422         /* Experimental */
423         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
424         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
425         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
426         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
427         /* Experimental */
428         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
429         /* Experimental */
430         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
431         /* Experimental */
432         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
433         /* Experimental */
434         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
435         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
436         /* Engine CKV - Ping the device and SRT firmware to get the public key. */
437         #define HWRM_ENGINE_CKV_HELLO                     UINT32_C(0x12d)
438         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
439         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
440         /* Engine CKV - Add a new CKEK used to encrypt keys. */
441         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
442         /* Engine CKV - Delete a previously added CKEK. */
443         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
444         /* Engine CKV - Add a new key to the key vault. */
445         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
446         /* Engine CKV - Delete a key from the key vault. */
447         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
448         /* Engine CKV - Delete all keys from the key vault. */
449         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
450         /* Engine CKV - Get random data. */
451         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
452         /* Engine CKV - Generate and encrypt a new AES key. */
453         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
454         /* Engine - Query the available queue groups configuration. */
455         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
456         /* Engine - Query the queue groups assigned to a function. */
457         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
458         /* Engine - Query the available queue group meter profile configuration. */
459         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
460         /* Engine - Query the configuration of a queue group meter profile. */
461         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
462         /* Engine - Allocate a queue group meter profile. */
463         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
464         /* Engine - Free a queue group meter profile. */
465         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
466         /* Engine - Query the meters assigned to a queue group. */
467         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
468         /* Engine - Bind a queue group meter profile to a queue group. */
469         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
470         /* Engine - Unbind a queue group meter profile from a queue group. */
471         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
472         /* Engine - Bind a queue group to a function. */
473         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
474         /* Engine - Query the scheduling group configuration. */
475         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
476         /* Engine - Query the queue groups assigned to a scheduling group. */
477         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
478         /* Engine - Query the configuration of a scheduling group's meter profiles. */
479         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
480         /* Engine - Configure a scheduling group's meter profiles. */
481         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
482         /* Engine - Bind a queue group to a scheduling group. */
483         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
484         /* Engine - Unbind a queue group from its scheduling group. */
485         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
486         /* Engine - Query the Engine configuration. */
487         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
488         /* Engine - Configure the statistics accumulator for an Engine. */
489         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
490         /* Engine - Clear the statistics accumulator for an Engine. */
491         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
492         /* Engine - Query the statistics accumulator for an Engine. */
493         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
494         /* Engine - Allocate an Engine RQ. */
495         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
496         /* Engine - Free an Engine RQ. */
497         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
498         /* Engine - Allocate an Engine CQ. */
499         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
500         /* Engine - Free an Engine CQ. */
501         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
502         /* Engine - Allocate an NQ. */
503         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
504         /* Engine - Free an NQ. */
505         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
506         /* Engine - Set the on-die RQE credit update location. */
507         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
508         /* Experimental */
509         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
510         /* Experimental */
511         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
512         /* Experimental */
513         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
514         /* Experimental */
515         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
516         /* Experimental */
517         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
518         /* Experimental */
519         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
520         /* Experimental */
521         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
522         /* Experimental */
523         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
524         /* Experimental */
525         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
526         /* Experimental */
527         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
528         /* Experimental */
529         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
530         /* Experimental */
531         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
532         /* Experimental */
533         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
534         /* Experimental */
535         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
536         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
537         /* Experimental */
538         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
539         /* Experimental */
540         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
541         /* Experimental */
542         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
543         /* Experimental */
544         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
545         /* Experimental */
546         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
547         /*  */
548         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
549         /* Experimental */
550         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
551         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
552         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
553         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
554         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
555         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
556         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
557         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
558         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
559         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
560         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
561         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
562         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
563         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
564         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
565         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
566         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
567         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
568         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
569         uint16_t        unused_0[3];
570 } __attribute__((packed));
571
572 /* Return Codes */
573 /* ret_codes (size:64b/8B) */
574 struct ret_codes {
575         uint16_t        error_code;
576         /* Request was successfully executed by the HWRM. */
577         #define HWRM_ERR_CODE_SUCCESS                UINT32_C(0x0)
578         /* The HWRM failed to execute the request. */
579         #define HWRM_ERR_CODE_FAIL                   UINT32_C(0x1)
580         /*
581          * The request contains invalid argument(s) or input
582          * parameters.
583          */
584         #define HWRM_ERR_CODE_INVALID_PARAMS         UINT32_C(0x2)
585         /*
586          * The requester is not allowed to access the requested
587          * resource. This error code shall be provided in a
588          * response to a request to query or modify an existing
589          * resource that is not accessible by the requester.
590          */
591         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED UINT32_C(0x3)
592         /*
593          * The HWRM is unable to allocate the requested resource.
594          * This code only applies to requests for HWRM resource
595          * allocations.
596          */
597         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR   UINT32_C(0x4)
598         /*
599          * Invalid combination of flags is specified in the
600          * request.
601          */
602         #define HWRM_ERR_CODE_INVALID_FLAGS          UINT32_C(0x5)
603         /*
604          * Invalid combination of enables fields is specified in
605          * the request.
606          */
607         #define HWRM_ERR_CODE_INVALID_ENABLES        UINT32_C(0x6)
608         /*
609          * Request contains a required TLV that is not supported by
610          * the installed version of firmware.
611          */
612         #define HWRM_ERR_CODE_UNSUPPORTED_TLV        UINT32_C(0x7)
613         /*
614          * No firmware buffer available to accept the request. Driver
615          * should retry the request.
616          */
617         #define HWRM_ERR_CODE_NO_BUFFER              UINT32_C(0x8)
618         /*
619          * Generic HWRM execution error that represents an
620          * internal error.
621          */
622         #define HWRM_ERR_CODE_HWRM_ERROR             UINT32_C(0xf)
623         /* Unknown error */
624         #define HWRM_ERR_CODE_UNKNOWN_ERR            UINT32_C(0xfffe)
625         /* Unsupported or invalid command */
626         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED      UINT32_C(0xffff)
627         #define HWRM_ERR_CODE_LAST \
628                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
629         uint16_t        unused_0[3];
630 } __attribute__((packed));
631
632 /* Output */
633 /* hwrm_err_output (size:128b/16B) */
634 struct hwrm_err_output {
635         /*
636          * Pass/Fail or error type
637          *
638          * Note: receiver to verify the in parameters, and fail the call
639          * with an error when appropriate
640          */
641         uint16_t        error_code;
642         /* This field returns the type of original request. */
643         uint16_t        req_type;
644         /* This field provides original sequence number of the command. */
645         uint16_t        seq_id;
646         /*
647          * This field is the length of the response in bytes.  The
648          * last byte of the response is a valid flag that will read
649          * as '1' when the command has been completely written to
650          * memory.
651          */
652         uint16_t        resp_len;
653         /* debug info for this error response. */
654         uint32_t        opaque_0;
655         /* debug info for this error response. */
656         uint16_t        opaque_1;
657         /*
658          * In the case of an error response, command specific error
659          * code is returned in this field.
660          */
661         uint8_t cmd_err;
662         /*
663          * This field is used in Output records to indicate that the output
664          * is completely written to RAM.  This field should be read as '1'
665          * to indicate that the output has been completely written.
666          * When writing a command completion or response to an internal processor,
667          * the order of writes has to be such that this field is written last.
668          */
669         uint8_t valid;
670 } __attribute__((packed));
671 /*
672  * Following is the signature for HWRM message field that indicates not
673  * applicable (All F's). Need to cast it the size of the field if needed.
674  */
675 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
676 /* hwrm_func_buf_rgtr */
677 #define HWRM_MAX_REQ_LEN 128
678 /* hwrm_selftest_qlist */
679 #define HWRM_MAX_RESP_LEN 280
680 /* 7 bit indirection table index. */
681 #define HW_HASH_INDEX_SIZE 0x80
682 #define HW_HASH_KEY_SIZE 40
683 /* valid key for HWRM response */
684 #define HWRM_RESP_VALID_KEY 1
685 #define HWRM_VERSION_MAJOR 1
686 #define HWRM_VERSION_MINOR 9
687 #define HWRM_VERSION_UPDATE 2
688 /* non-zero means beta version */
689 #define HWRM_VERSION_RSVD 6
690 #define HWRM_VERSION_STR "1.9.2.6"
691
692 /****************
693  * hwrm_ver_get *
694  ****************/
695
696
697 /* hwrm_ver_get_input (size:192b/24B) */
698 struct hwrm_ver_get_input {
699         /* The HWRM command request type. */
700         uint16_t        req_type;
701         /*
702          * The completion ring to send the completion event on. This should
703          * be the NQ ID returned from the `nq_alloc` HWRM command.
704          */
705         uint16_t        cmpl_ring;
706         /*
707          * The sequence ID is used by the driver for tracking multiple
708          * commands. This ID is treated as opaque data by the firmware and
709          * the value is returned in the `hwrm_resp_hdr` upon completion.
710          */
711         uint16_t        seq_id;
712         /*
713          * The target ID of the command:
714          * * 0x0-0xFFF8 - The function ID
715          * * 0xFFF8-0xFFFE - Reserved for internal processors
716          * * 0xFFFF - HWRM
717          */
718         uint16_t        target_id;
719         /*
720          * A physical address pointer pointing to a host buffer that the
721          * command's response data will be written. This can be either a host
722          * physical address (HPA) or a guest physical address (GPA) and must
723          * point to a physically contiguous block of memory.
724          */
725         uint64_t        resp_addr;
726         /*
727          * This field represents the major version of HWRM interface
728          * specification supported by the driver HWRM implementation.
729          * The interface major version is intended to change only when
730          * non backward compatible changes are made to the HWRM
731          * interface specification.
732          */
733         uint8_t hwrm_intf_maj;
734         /*
735          * This field represents the minor version of HWRM interface
736          * specification supported by the driver HWRM implementation.
737          * A change in interface minor version is used to reflect
738          * significant backward compatible modification to HWRM
739          * interface specification.
740          * This can be due to addition or removal of functionality.
741          * HWRM interface specifications with the same major version
742          * but different minor versions are compatible.
743          */
744         uint8_t hwrm_intf_min;
745         /*
746          * This field represents the update version of HWRM interface
747          * specification supported by the driver HWRM implementation.
748          * The interface update version is used to reflect minor
749          * changes or bug fixes to a released HWRM interface
750          * specification.
751          */
752         uint8_t hwrm_intf_upd;
753         uint8_t unused_0[5];
754 } __attribute__((packed));
755
756 /* hwrm_ver_get_output (size:1408b/176B) */
757 struct hwrm_ver_get_output {
758         /* The specific error status for the command. */
759         uint16_t        error_code;
760         /* The HWRM command request type. */
761         uint16_t        req_type;
762         /* The sequence ID from the original command. */
763         uint16_t        seq_id;
764         /* The length of the response data in number of bytes. */
765         uint16_t        resp_len;
766         /*
767          * This field represents the major version of HWRM interface
768          * specification supported by the HWRM implementation.
769          * The interface major version is intended to change only when
770          * non backward compatible changes are made to the HWRM
771          * interface specification.
772          * A HWRM implementation that is compliant with this
773          * specification shall provide value of 1 in this field.
774          */
775         uint8_t hwrm_intf_maj_8b;
776         /*
777          * This field represents the minor version of HWRM interface
778          * specification supported by the HWRM implementation.
779          * A change in interface minor version is used to reflect
780          * significant backward compatible modification to HWRM
781          * interface specification.
782          * This can be due to addition or removal of functionality.
783          * HWRM interface specifications with the same major version
784          * but different minor versions are compatible.
785          * A HWRM implementation that is compliant with this
786          * specification shall provide value of 2 in this field.
787          */
788         uint8_t hwrm_intf_min_8b;
789         /*
790          * This field represents the update version of HWRM interface
791          * specification supported by the HWRM implementation.
792          * The interface update version is used to reflect minor
793          * changes or bug fixes to a released HWRM interface
794          * specification.
795          * A HWRM implementation that is compliant with this
796          * specification shall provide value of 2 in this field.
797          */
798         uint8_t hwrm_intf_upd_8b;
799         uint8_t hwrm_intf_rsvd_8b;
800         /*
801          * This field represents the major version of HWRM firmware.
802          * A change in firmware major version represents a major
803          * firmware release.
804          */
805         uint8_t hwrm_fw_maj_8b;
806         /*
807          * This field represents the minor version of HWRM firmware.
808          * A change in firmware minor version represents significant
809          * firmware functionality changes.
810          */
811         uint8_t hwrm_fw_min_8b;
812         /*
813          * This field represents the build version of HWRM firmware.
814          * A change in firmware build version represents bug fixes
815          * to a released firmware.
816          */
817         uint8_t hwrm_fw_bld_8b;
818         /*
819          * This field is a reserved field. This field can be used to
820          * represent firmware branches or customer specific releases
821          * tied to a specific (major,minor,update) version of the
822          * HWRM firmware.
823          */
824         uint8_t hwrm_fw_rsvd_8b;
825         /*
826          * This field represents the major version of mgmt firmware.
827          * A change in major version represents a major release.
828          */
829         uint8_t mgmt_fw_maj_8b;
830         /*
831          * This field represents the minor version of mgmt firmware.
832          * A change in minor version represents significant
833          * functionality changes.
834          */
835         uint8_t mgmt_fw_min_8b;
836         /*
837          * This field represents the build version of mgmt firmware.
838          * A change in update version represents bug fixes.
839          */
840         uint8_t mgmt_fw_bld_8b;
841         /*
842          * This field is a reserved field. This field can be used to
843          * represent firmware branches or customer specific releases
844          * tied to a specific (major,minor,update) version
845          */
846         uint8_t mgmt_fw_rsvd_8b;
847         /*
848          * This field represents the major version of network
849          * control firmware.
850          * A change in major version represents a major release.
851          */
852         uint8_t netctrl_fw_maj_8b;
853         /*
854          * This field represents the minor version of network
855          * control firmware.
856          * A change in minor version represents significant
857          * functionality changes.
858          */
859         uint8_t netctrl_fw_min_8b;
860         /*
861          * This field represents the build version of network
862          * control firmware.
863          * A change in update version represents bug fixes.
864          */
865         uint8_t netctrl_fw_bld_8b;
866         /*
867          * This field is a reserved field. This field can be used to
868          * represent firmware branches or customer specific releases
869          * tied to a specific (major,minor,update) version
870          */
871         uint8_t netctrl_fw_rsvd_8b;
872         /*
873          * This field is used to indicate device's capabilities and
874          * configurations.
875          */
876         uint32_t        dev_caps_cfg;
877         /*
878          * If set to 1, then secure firmware update behavior
879          * is supported.
880          * If set to 0, then secure firmware update behavior is
881          * not supported.
882          */
883         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
884                 UINT32_C(0x1)
885         /*
886          * If set to 1, then firmware based DCBX agent is supported.
887          * If set to 0, then firmware based DCBX agent capability
888          * is not supported on this device.
889          */
890         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
891                 UINT32_C(0x2)
892         /*
893          * If set to 1, then HWRM short command format is supported.
894          * If set to 0, then HWRM short command format is not supported.
895          */
896         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
897                 UINT32_C(0x4)
898         /*
899          * If set to 1, then HWRM short command format is required.
900          * If set to 0, then HWRM short command format is not required.
901          */
902         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
903                 UINT32_C(0x8)
904         /*
905          * This field represents the major version of RoCE firmware.
906          * A change in major version represents a major release.
907          */
908         uint8_t roce_fw_maj_8b;
909         /*
910          * This field represents the minor version of RoCE firmware.
911          * A change in minor version represents significant
912          * functionality changes.
913          */
914         uint8_t roce_fw_min_8b;
915         /*
916          * This field represents the build version of RoCE firmware.
917          * A change in update version represents bug fixes.
918          */
919         uint8_t roce_fw_bld_8b;
920         /*
921          * This field is a reserved field. This field can be used to
922          * represent firmware branches or customer specific releases
923          * tied to a specific (major,minor,update) version
924          */
925         uint8_t roce_fw_rsvd_8b;
926         /*
927          * This field represents the name of HWRM FW (ASCII chars
928          * with NULL at the end).
929          */
930         char    hwrm_fw_name[16];
931         /*
932          * This field represents the name of mgmt FW (ASCII chars
933          * with NULL at the end).
934          */
935         char    mgmt_fw_name[16];
936         /*
937          * This field represents the name of network control
938          * firmware (ASCII chars with NULL at the end).
939          */
940         char    netctrl_fw_name[16];
941         /*
942          * This field is reserved for future use.
943          * The responder should set it to 0.
944          * The requester should ignore this field.
945          */
946         uint8_t reserved2[16];
947         /*
948          * This field represents the name of RoCE FW (ASCII chars
949          * with NULL at the end).
950          */
951         char    roce_fw_name[16];
952         /* This field returns the chip number. */
953         uint16_t        chip_num;
954         /* This field returns the revision of chip. */
955         uint8_t chip_rev;
956         /* This field returns the chip metal number. */
957         uint8_t chip_metal;
958         /* This field returns the bond id of the chip. */
959         uint8_t chip_bond_id;
960         /* This value indicates the type of platform used for chip implementation. */
961         uint8_t chip_platform_type;
962         /* ASIC */
963         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
964         /* FPGA platform of the chip. */
965         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
966         /* Palladium platform of the chip. */
967         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
968         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
969                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
970         /*
971          * This field returns the maximum value of request window that
972          * is supported by the HWRM. The request window is mapped
973          * into device address space using MMIO.
974          */
975         uint16_t        max_req_win_len;
976         /*
977          * This field returns the maximum value of response buffer in
978          * bytes.
979          */
980         uint16_t        max_resp_len;
981         /*
982          * This field returns the default request timeout value in
983          * milliseconds.
984          */
985         uint16_t        def_req_timeout;
986         /*
987          * This field will indicate if any subsystems is not fully
988          * initialized.
989          */
990         uint8_t flags;
991         /*
992          * If set to 1, device is not ready.
993          * If set to 0, device is ready to accept all HWRM commands.
994          */
995         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY       UINT32_C(0x1)
996         /*
997          * If set to 1, external version present.
998          * If set to 0, external version not present.
999          */
1000         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL     UINT32_C(0x2)
1001         uint8_t unused_0[2];
1002         /*
1003          * For backward compatibility this field must be set to 1.
1004          * Older drivers might look for this field to be 1 before
1005          * processing the message.
1006          */
1007         uint8_t always_1;
1008         /*
1009          * This field represents the major version of HWRM interface
1010          * specification supported by the HWRM implementation.
1011          * The interface major version is intended to change only when
1012          * non backward compatible changes are made to the HWRM
1013          * interface specification. A HWRM implementation that is
1014          * compliant with this specification shall provide value of 1
1015          * in this field.
1016          */
1017         uint16_t        hwrm_intf_major;
1018         /*
1019          * This field represents the minor version of HWRM interface
1020          * specification supported by the HWRM implementation.
1021          * A change in interface minor version is used to reflect
1022          * significant backward compatible modification to HWRM
1023          * interface specification. This can be due to addition or
1024          * removal of functionality. HWRM interface specifications
1025          * with the same major version but different minor versions are
1026          * compatible. A HWRM implementation that is compliant with
1027          * this specification shall provide value of 2 in this field.
1028          */
1029         uint16_t        hwrm_intf_minor;
1030         /*
1031          * This field represents the update version of HWRM interface
1032          * specification supported by the HWRM implementation. The
1033          * interface update version is used to reflect minor changes or
1034          * bug fixes to a released HWRM interface specification.
1035          * A HWRM implementation that is compliant with this
1036          * specification shall provide value of 2 in this field.
1037          */
1038         uint16_t        hwrm_intf_build;
1039         /*
1040          * This field represents the patch version of HWRM interface
1041          * specification supported by the HWRM implementation.
1042          */
1043         uint16_t        hwrm_intf_patch;
1044         /*
1045          * This field represents the major version of HWRM firmware.
1046          * A change in firmware major version represents a major
1047          * firmware release.
1048          */
1049         uint16_t        hwrm_fw_major;
1050         /*
1051          * This field represents the minor version of HWRM firmware.
1052          * A change in firmware minor version represents significant
1053          * firmware functionality changes.
1054          */
1055         uint16_t        hwrm_fw_minor;
1056         /*
1057          * This field represents the build version of HWRM firmware.
1058          * A change in firmware build version represents bug fixes to
1059          * a released firmware.
1060          */
1061         uint16_t        hwrm_fw_build;
1062         /*
1063          * This field is a reserved field.
1064          * This field can be used to represent firmware branches or customer
1065          * specific releases tied to a specific (major,minor,update) version
1066          * of the HWRM firmware.
1067          */
1068         uint16_t        hwrm_fw_patch;
1069         /*
1070          * This field represents the major version of mgmt firmware.
1071          * A change in major version represents a major release.
1072          */
1073         uint16_t        mgmt_fw_major;
1074         /*
1075          * This field represents the minor version of HWRM firmware.
1076          * A change in firmware minor version represents significant
1077          * firmware functionality changes.
1078          */
1079         uint16_t        mgmt_fw_minor;
1080         /*
1081          * This field represents the build version of mgmt firmware.
1082          * A change in update version represents bug fixes.
1083          */
1084         uint16_t        mgmt_fw_build;
1085         /*
1086          * This field is a reserved field. This field can be used to
1087          * represent firmware branches or customer specific releases
1088          * tied to a specific (major,minor,update) version.
1089          */
1090         uint16_t        mgmt_fw_patch;
1091         /*
1092          * This field represents the major version of network control
1093          * firmware. A change in major version represents
1094          * a major release.
1095          */
1096         uint16_t        netctrl_fw_major;
1097         /*
1098          * This field represents the minor version of network control
1099          * firmware. A change in minor version represents significant
1100          * functionality changes.
1101          */
1102         uint16_t        netctrl_fw_minor;
1103         /*
1104          * This field represents the build version of network control
1105          * firmware. A change in update version represents bug fixes.
1106          */
1107         uint16_t        netctrl_fw_build;
1108         /*
1109          * This field is a reserved field. This field can be used to
1110          * represent firmware branches or customer specific releases
1111          * tied to a specific (major,minor,update) version
1112          */
1113         uint16_t        netctrl_fw_patch;
1114         /*
1115          * This field represents the major version of RoCE firmware.
1116          * A change in major version represents a major release.
1117          */
1118         uint16_t        roce_fw_major;
1119         /*
1120          * This field represents the minor version of RoCE firmware.
1121          * A change in minor version represents significant
1122          * functionality changes.
1123          */
1124         uint16_t        roce_fw_minor;
1125         /*
1126          * This field represents the build version of RoCE firmware.
1127          * A change in update version represents bug fixes.
1128          */
1129         uint16_t        roce_fw_build;
1130         /*
1131          * This field is a reserved field. This field can be used to
1132          * represent firmware branches or customer specific releases
1133          * tied to a specific (major,minor,update) version
1134          */
1135         uint16_t        roce_fw_patch;
1136         /*
1137          * This field returns the maximum extended request length acceptable
1138          * by the device which allows requests greater than mailbox size when
1139          * used with the short cmd request format.
1140          */
1141         uint16_t        max_ext_req_len;
1142         uint8_t unused_1[5];
1143         /*
1144          * This field is used in Output records to indicate that the output
1145          * is completely written to RAM.  This field should be read as '1'
1146          * to indicate that the output has been completely written.
1147          * When writing a command completion or response to an internal processor,
1148          * the order of writes has to be such that this field is written last.
1149          */
1150         uint8_t valid;
1151 } __attribute__((packed));
1152
1153 /* bd_base (size:64b/8B) */
1154 struct bd_base {
1155         uint8_t type;
1156         /* This value identifies the type of buffer descriptor. */
1157         #define BD_BASE_TYPE_MASK       UINT32_C(0x3f)
1158         #define BD_BASE_TYPE_SFT        0
1159         /*
1160          * Indicates that this BD is 16B long and is used for
1161          * normal L2 packet transmission.
1162          */
1163         #define BD_BASE_TYPE_TX_BD_SHORT  UINT32_C(0x0)
1164         /*
1165          * Indicates that this BD is 1BB long and is an empty
1166          * TX BD.  Not valid for use by the driver.
1167          */
1168         #define BD_BASE_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
1169         /*
1170          * Indicates that this BD is 16B long and is an RX Producer
1171          * (ie. empty) buffer descriptor.
1172          */
1173         #define BD_BASE_TYPE_RX_PROD_PKT  UINT32_C(0x4)
1174         /*
1175          * Indicates that this BD is 16B long and is an RX
1176          * Producer Buffer BD.
1177          */
1178         #define BD_BASE_TYPE_RX_PROD_BFR  UINT32_C(0x5)
1179         /*
1180          * Indicates that this BD is 16B long and is an
1181          * RX Producer Assembly Buffer Descriptor.
1182          */
1183         #define BD_BASE_TYPE_RX_PROD_AGG  UINT32_C(0x6)
1184         /*
1185          * Indicates that this BD is 32B long and is used for
1186          * normal L2 packet transmission.
1187          */
1188         #define BD_BASE_TYPE_TX_BD_LONG   UINT32_C(0x10)
1189         #define BD_BASE_TYPE_LAST        BD_BASE_TYPE_TX_BD_LONG
1190         uint8_t unused_1[7];
1191 } __attribute__((packed));
1192
1193 /* tx_bd_short (size:128b/16B) */
1194 struct tx_bd_short {
1195         /*
1196          * All bits in this field must be valid on the first BD of a packet.
1197          * Only the packet_end bit must be valid for the remaining BDs
1198          * of a packet.
1199          */
1200         uint16_t        flags_type;
1201         /* This value identifies the type of buffer descriptor. */
1202         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
1203         #define TX_BD_SHORT_TYPE_SFT             0
1204         /*
1205          * Indicates that this BD is 16B long and is used for
1206          * normal L2 packet transmission.
1207          */
1208         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
1209         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
1210         /*
1211          * All bits in this field must be valid on the first BD of a packet.
1212          * Only the packet_end bit must be valid for the remaining BDs
1213          * of a packet.
1214          */
1215         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
1216         #define TX_BD_SHORT_FLAGS_SFT            6
1217         /*
1218          * If set to 1, the packet ends with the data in the buffer
1219          * pointed to by this descriptor.  This flag must be
1220          * valid on every BD.
1221          */
1222         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
1223         /*
1224          * If set to 1, the device will not generate a completion for
1225          * this transmit packet unless there is an error in it's
1226          * processing.
1227          * If this bit
1228          * is set to 0, then the packet will be completed normally.
1229          *
1230          * This bit must be valid only on the first BD of a packet.
1231          */
1232         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
1233         /*
1234          * This value indicates how many 16B BD locations are consumed
1235          * in the ring by this packet.
1236          * A value of 1 indicates that this BD is the only BD (and that
1237          * the it is a short BD).  A value
1238          * of 3 indicates either 3 short BDs or 1 long BD and one short
1239          * BD in the packet.  A value of 0 indicates
1240          * that there are 32 BD locations in the packet (the maximum).
1241          *
1242          * This field is valid only on the first BD of a packet.
1243          */
1244         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1245         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
1246         /*
1247          * This value is a hint for the length of the entire packet.
1248          * It is used by the chip to optimize internal processing.
1249          *
1250          * The packet will be dropped if the hint is too short.
1251          *
1252          * This field is valid only on the first BD of a packet.
1253          */
1254         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1255         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
1256         /* indicates packet length < 512B */
1257         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1258         /* indicates 512 <= packet length < 1KB */
1259         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1260         /* indicates 1KB <= packet length < 2KB */
1261         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1262         /* indicates packet length >= 2KB */
1263         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1264         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
1265                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
1266         /*
1267          * If set to 1, the device immediately updates the Send Consumer
1268          * Index after the buffer associated with this descriptor has
1269          * been transferred via DMA to NIC memory from host memory. An
1270          * interrupt may or may not be generated according to the state
1271          * of the interrupt avoidance mechanisms. If this bit
1272          * is set to 0, then the Consumer Index is only updated as soon
1273          * as one of the host interrupt coalescing conditions has been met.
1274          *
1275          * This bit must be valid on the first BD of a packet.
1276          */
1277         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
1278         /*
1279          * This is the length of the host physical buffer this BD describes
1280          * in bytes.
1281          *
1282          * This field must be valid on all BDs of a packet.
1283          */
1284         uint16_t        len;
1285         /*
1286          * The opaque data field is pass through to the completion and can be
1287          * used for any data that the driver wants to associate with the
1288          * transmit BD.
1289          *
1290          * This field must be valid on the first BD of a packet.
1291          */
1292         uint32_t        opaque;
1293         /*
1294          * This is the host physical address for the portion of the packet
1295          * described by this TX BD.
1296          *
1297          * This value must be valid on all BDs of a packet.
1298          */
1299         uint64_t        address;
1300 } __attribute__((packed));
1301
1302 /* tx_bd_long (size:128b/16B) */
1303 struct tx_bd_long {
1304         /* This value identifies the type of buffer descriptor. */
1305         uint16_t        flags_type;
1306         /*
1307          * This value indicates the type of buffer descriptor.
1308          * packet.
1309          */
1310         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
1311         #define TX_BD_LONG_TYPE_SFT             0
1312         /*
1313          * Indicates that this BD is 32B long and is used for
1314          * normal L2 packet transmission.
1315          */
1316         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
1317         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
1318         /*
1319          * All bits in this field must be valid on the first BD of a packet.
1320          * Only the packet_end bit must be valid for the remaining BDs
1321          * of a packet.
1322          */
1323         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
1324         #define TX_BD_LONG_FLAGS_SFT            6
1325         /*
1326          * If set to 1, the packet ends with the data in the buffer
1327          * pointed to by this descriptor.  This flag must be
1328          * valid on every BD.
1329          */
1330         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
1331         /*
1332          * If set to 1, the device will not generate a completion for
1333          * this transmit packet unless there is an error in it's
1334          * processing.
1335          * If this bit
1336          * is set to 0, then the packet will be completed normally.
1337          *
1338          * This bit must be valid only on the first BD of a packet.
1339          */
1340         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
1341         /*
1342          * This value indicates how many 16B BD locations are consumed
1343          * in the ring by this packet.
1344          * A value of 1 indicates that this BD is the only BD (and that
1345          * the it is a short BD).  A value
1346          * of 3 indicates either 3 short BDs or 1 long BD and one short
1347          * BD in the packet.  A value of 0 indicates
1348          * that there are 32 BD locations in the packet (the maximum).
1349          *
1350          * This field is valid only on the first BD of a packet.
1351          */
1352         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1353         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
1354         /*
1355          * This value is a hint for the length of the entire packet.
1356          * It is used by the chip to optimize internal processing.
1357          *
1358          * The packet will be dropped if the hint is too short.
1359          *
1360          * This field is valid only on the first BD of a packet.
1361          */
1362         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1363         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
1364         /* indicates packet length < 512B */
1365         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1366         /* indicates 512 <= packet length < 1KB */
1367         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1368         /* indicates 1KB <= packet length < 2KB */
1369         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1370         /* indicates packet length >= 2KB */
1371         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1372         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
1373         /*
1374          * If set to 1, the device immediately updates the Send Consumer
1375          * Index after the buffer associated with this descriptor has
1376          * been transferred via DMA to NIC memory from host memory. An
1377          * interrupt may or may not be generated according to the state
1378          * of the interrupt avoidance mechanisms. If this bit
1379          * is set to 0, then the Consumer Index is only updated as soon
1380          * as one of the host interrupt coalescing conditions has been met.
1381          *
1382          * This bit must be valid on the first BD of a packet.
1383          */
1384         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
1385         /*
1386          * This is the length of the host physical buffer this BD describes
1387          * in bytes.
1388          *
1389          * This field must be valid on all BDs of a packet.
1390          */
1391         uint16_t        len;
1392         /*
1393          * The opaque data field is pass through to the completion and can be
1394          * used for any data that the driver wants to associate with the
1395          * transmit BD.
1396          *
1397          * This field must be valid on the first BD of a packet.
1398          */
1399         uint32_t        opaque;
1400         /*
1401          * This is the host physical address for the portion of the packet
1402          * described by this TX BD.
1403          *
1404          * This value must be valid on all BDs of a packet.
1405          */
1406         uint64_t        address;
1407 } __attribute__((packed));
1408
1409 /* tx_bd_long_hi (size:128b/16B) */
1410 struct tx_bd_long_hi {
1411         /*
1412          * All bits in this field must be valid on the first BD of a packet.
1413          * Their value on other BDs of the packet will be ignored.
1414          */
1415         uint16_t        lflags;
1416         /*
1417          * If set to 1, the controller replaces the TCP/UPD checksum
1418          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1419          * checksum field of the encapsulated TCP/UDP packets with the
1420          * hardware calculated TCP/UDP checksum for the packet associated
1421          * with this descriptor. The flag is ignored if the LSO flag is set.
1422          *
1423          * This bit must be valid on the first BD of a packet.
1424          */
1425         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1426         /*
1427          * If set to 1,  the controller replaces the IP checksum of the
1428          * normal packets, or the inner IP checksum of the encapsulated
1429          * packets with the hardware calculated IP checksum for the
1430          * packet associated with this descriptor.
1431          *
1432          * This bit must be valid on the first BD of a packet.
1433          */
1434         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1435         /*
1436          * If set to 1, the controller will not append an Ethernet CRC
1437          * to the end of the frame.
1438          *
1439          * This bit must be valid on the first BD of a packet.
1440          *
1441          * Packet must be 64B or longer when this flag is set.  It is not
1442          * useful to use this bit with any form of TX offload such as
1443          * CSO or LSO.  The intent is that the packet from the host already
1444          * has a valid Ethernet CRC on the packet.
1445          */
1446         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
1447         /*
1448          * If set to 1, the device will record the time at which the packet
1449          * was actually transmitted at the TX MAC.
1450          *
1451          * This bit must be valid on the first BD of a packet.
1452          */
1453         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
1454         /*
1455          * If set to 1, The controller replaces the tunnel IP checksum
1456          * field with hardware calculated IP checksum for the IP header
1457          * of the packet associated with this descriptor.
1458          *
1459          * For outer UDP checksum, global outer UDP checksum TE_NIC register
1460          * needs to be enabled. If the global outer UDP checksum TE_NIC register
1461          * bit is set, outer UDP checksum will be calculated for the following
1462          * cases:
1463          * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
1464          * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
1465          * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
1466          * checksum will not be calculated.
1467          * 2. Packets with lso flag set which implies inner TCP checksum calculation
1468          * as part of LSO operation.
1469          */
1470         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1471         /*
1472          * If set to 1,  the device will treat this packet with LSO(Large
1473          * Send Offload) processing for both normal or encapsulated
1474          * packets, which is a form of TCP segmentation.  When this bit
1475          * is 1, the hdr_size and mss fields must be valid. The driver
1476          * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
1477          * flags since the controller will replace the appropriate
1478          * checksum fields for segmented packets.
1479          *
1480          * When this bit is 1, the hdr_size and mss fields must be valid.
1481          */
1482         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
1483         /*
1484          * If set to zero when LSO is '1', then the IPID will be treated
1485          * as a 16b number and will be wrapped if it exceeds a value of
1486          * 0xffff.
1487          *
1488          * If set to one when LSO is '1', then the IPID will be treated
1489          * as a 15b number and will be wrapped if it exceeds a value 0f
1490          * 0x7fff.
1491          */
1492         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
1493         /*
1494          * If set to zero when LSO is '1', then the IPID of the tunnel
1495          * IP header will not be modified during LSO operations.
1496          *
1497          * If set to one when LSO is '1', then the IPID of the tunnel
1498          * IP header will be incremented for each subsequent segment of an
1499          * LSO operation.
1500          *
1501          * The flag is ignored if the LSO packet is a normal (non-tunneled)
1502          * TCP packet.
1503          */
1504         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
1505         /*
1506          * If set to '1', then the RoCE ICRC will be appended to the
1507          * packet.  Packet must be a valid RoCE format packet.
1508          */
1509         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1510         /*
1511          * If set to '1', then the FCoE CRC will be appended to the
1512          * packet.  Packet must be a valid FCoE format packet.
1513          */
1514         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1515         uint16_t        hdr_size;
1516         /*
1517          * When LSO is '1', this field must contain the offset of the
1518          * TCP payload from the beginning of the packet in as
1519          * 16b words. In case of encapsulated/tunneling packet, this  field
1520          * contains the offset of the inner TCP payload from beginning of the
1521          * packet as 16-bit words.
1522          *
1523          * This value must be valid on the first BD of a packet.
1524          */
1525         #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
1526         #define TX_BD_LONG_HDR_SIZE_SFT 0
1527         uint32_t        mss;
1528         /*
1529          * This is the MSS value that will be used to do the LSO processing.
1530          * The value is the length in bytes of the TCP payload for each
1531          * segment generated by the LSO operation.
1532          *
1533          * This value must be valid on the first BD of a packet.
1534          */
1535         #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
1536         #define TX_BD_LONG_MSS_SFT 0
1537         uint16_t        unused2;
1538         /*
1539          * This value selects a CFA action to perform on the packet.
1540          * Set this value to zero if no CFA action is desired.
1541          *
1542          * This value must be valid on the first BD of a packet.
1543          */
1544         uint16_t        cfa_action;
1545         /*
1546          * This value is action meta-data that defines CFA edit operations
1547          * that are done in addition to any action editing.
1548          */
1549         uint32_t        cfa_meta;
1550         /* When key=1, This is the VLAN tag VID value. */
1551         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1552         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT      0
1553         /* When key=1, This is the VLAN tag DE value. */
1554         #define TX_BD_LONG_CFA_META_VLAN_DE           UINT32_C(0x1000)
1555         /* When key=1, This is the VLAN tag PRI value. */
1556         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
1557         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT      13
1558         /* When key=1, This is the VLAN tag TPID select value. */
1559         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
1560         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT     16
1561         /* 0x88a8 */
1562         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
1563         /* 0x8100 */
1564         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
1565         /* 0x9100 */
1566         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
1567         /* 0x9200 */
1568         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
1569         /* 0x9300 */
1570         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
1571         /* Value programmed in CFA VLANTPID register. */
1572         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
1573         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
1574                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
1575         /* When key=1, This is the VLAN tag TPID select value. */
1576         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
1577         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
1578         /*
1579          * This field identifies the type of edit to be performed
1580          * on the packet.
1581          *
1582          * This value must be valid on the first BD of a packet.
1583          */
1584         #define TX_BD_LONG_CFA_META_KEY_MASK          UINT32_C(0xf0000000)
1585         #define TX_BD_LONG_CFA_META_KEY_SFT           28
1586         /* No editing */
1587         #define TX_BD_LONG_CFA_META_KEY_NONE            (UINT32_C(0x0) << 28)
1588         /*
1589          * - meta[17:16] - TPID select value (0 = 0x8100).
1590          * - meta[15:12] - PRI/DE value.
1591          * - meta[11:0] - VID value.
1592          */
1593         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG        (UINT32_C(0x1) << 28)
1594         #define TX_BD_LONG_CFA_META_KEY_LAST \
1595                 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
1596 } __attribute__((packed));
1597
1598 /* tx_bd_empty (size:128b/16B) */
1599 struct tx_bd_empty {
1600         /* This value identifies the type of buffer descriptor. */
1601         uint8_t type;
1602         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
1603         #define TX_BD_EMPTY_TYPE_SFT        0
1604         /*
1605          * Indicates that this BD is 1BB long and is an empty
1606          * TX BD.  Not valid for use by the driver.
1607          */
1608         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
1609         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
1610         uint8_t unused_1[3];
1611         uint8_t unused_2;
1612         uint8_t unused_3[3];
1613         uint8_t unused_4[8];
1614 } __attribute__((packed));
1615
1616 /* rx_prod_pkt_bd (size:128b/16B) */
1617 struct rx_prod_pkt_bd {
1618         /* This value identifies the type of buffer descriptor. */
1619         uint16_t        flags_type;
1620         /* This value identifies the type of buffer descriptor. */
1621         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
1622         #define RX_PROD_PKT_BD_TYPE_SFT          0
1623         /*
1624          * Indicates that this BD is 16B long and is an RX Producer
1625          * (ie. empty) buffer descriptor.
1626          */
1627         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
1628         #define RX_PROD_PKT_BD_TYPE_LAST \
1629                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
1630         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
1631         #define RX_PROD_PKT_BD_FLAGS_SFT         6
1632         /*
1633          * If set to 1, the packet will be placed at the address plus
1634          * 2B.  The 2 Bytes of padding will be written as zero.
1635          */
1636         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
1637         /*
1638          * If set to 1, the packet write will be padded out to the
1639          * nearest cache-line with zero value padding.
1640          */
1641         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
1642         /*
1643          * This value is the number of additional buffers in the ring that
1644          * describe the buffer space to be consumed for the this packet.
1645          * If the value is zero, then the packet must fit within the
1646          * space described by this BD.  If this value is 1 or more, it
1647          * indicates how many additional "buffer" BDs are in the ring
1648          * immediately following this BD to be used for the same
1649          * network packet.
1650          *
1651          * Even if the packet to be placed does not need all the
1652          * additional buffers, they will be consumed anyway.
1653          */
1654         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
1655         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
1656         /*
1657          * This is the length in Bytes of the host physical buffer where
1658          * data for the packet may be placed in host memory.
1659          */
1660         uint16_t        len;
1661         /*
1662          * The opaque data field is pass through to the completion and can be
1663          * used for any data that the driver wants to associate with this
1664          * receive buffer set.
1665          */
1666         uint32_t        opaque;
1667         /*
1668          * This is the host physical address where data for the packet may
1669          * by placed in host memory.
1670          */
1671         uint64_t        address;
1672 } __attribute__((packed));
1673
1674 /* rx_prod_bfr_bd (size:128b/16B) */
1675 struct rx_prod_bfr_bd {
1676         /* This value identifies the type of buffer descriptor. */
1677         uint16_t        flags_type;
1678         /* This value identifies the type of buffer descriptor. */
1679         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
1680         #define RX_PROD_BFR_BD_TYPE_SFT        0
1681         /*
1682          * Indicates that this BD is 16B long and is an RX
1683          * Producer Buffer BD.
1684          */
1685         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
1686         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
1687         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
1688         #define RX_PROD_BFR_BD_FLAGS_SFT       6
1689         /*
1690          * This is the length in Bytes of the host physical buffer where
1691          * data for the packet may be placed in host memory.
1692          */
1693         uint16_t        len;
1694         /* This field is not used. */
1695         uint32_t        opaque;
1696         /*
1697          * This is the host physical address where data for the packet may
1698          * by placed in host memory.
1699          */
1700         uint64_t        address;
1701 } __attribute__((packed));
1702
1703 /* rx_prod_agg_bd (size:128b/16B) */
1704 struct rx_prod_agg_bd {
1705         /* This value identifies the type of buffer descriptor. */
1706         uint16_t        flags_type;
1707         /* This value identifies the type of buffer descriptor. */
1708         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
1709         #define RX_PROD_AGG_BD_TYPE_SFT          0
1710         /*
1711          * Indicates that this BD is 16B long and is an
1712          * RX Producer Assembly Buffer Descriptor.
1713          */
1714         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
1715         #define RX_PROD_AGG_BD_TYPE_LAST \
1716                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
1717         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
1718         #define RX_PROD_AGG_BD_FLAGS_SFT         6
1719         /*
1720          * If set to 1, the packet write will be padded out to the
1721          * nearest cache-line with zero value padding.
1722          */
1723         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
1724         /*
1725          * This is the length in Bytes of the host physical buffer where
1726          * data for the packet may be placed in host memory.
1727          */
1728         uint16_t        len;
1729         /*
1730          * The opaque data field is pass through to the completion and can be
1731          * used for any data that the driver wants to associate with this
1732          * receive assembly buffer.
1733          */
1734         uint32_t        opaque;
1735         /*
1736          * This is the host physical address where data for the packet may
1737          * by placed in host memory.
1738          */
1739         uint64_t        address;
1740 } __attribute__((packed));
1741
1742 /* cmpl_base (size:128b/16B) */
1743 struct cmpl_base {
1744         uint16_t        type;
1745         /*
1746          * This field indicates the exact type of the completion.
1747          * By convention, the LSB identifies the length of the
1748          * record in 16B units.  Even values indicate 16B
1749          * records.  Odd values indicate 32B
1750          * records.
1751          */
1752         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
1753         #define CMPL_BASE_TYPE_SFT             0
1754         /*
1755          * TX L2 completion:
1756          *  Completion of TX packet.  Length = 16B
1757          */
1758         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
1759         /*
1760          * RX L2 completion:
1761          * Completion of and L2 RX packet. Length = 32B
1762          */
1763         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
1764         /*
1765          * RX Aggregation Buffer completion :
1766          * Completion of an L2 aggregation buffer in support of
1767          * TPA, HDS, or Jumbo packet completion.  Length = 16B
1768          */
1769         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
1770         /*
1771          * RX L2 TPA Start Completion:
1772          * Completion at the beginning of a TPA operation.
1773          * Length = 32B
1774          */
1775         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
1776         /*
1777          * RX L2 TPA End Completion:
1778          * Completion at the end of a TPA operation.
1779          * Length = 32B
1780          */
1781         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
1782         /*
1783          * Statistics Ejection Completion:
1784          * Completion of statistics data ejection buffer.
1785          * Length = 16B
1786          */
1787         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
1788         /*
1789          * HWRM Command Completion:
1790          * Completion of an HWRM command.
1791          */
1792         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
1793         /* Forwarded HWRM Request */
1794         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
1795         /* Forwarded HWRM Response */
1796         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
1797         /* HWRM Asynchronous Event Information */
1798         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
1799         /* CQ Notification */
1800         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
1801         /* SRQ Threshold Event */
1802         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
1803         /* DBQ Threshold Event */
1804         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
1805         /* QP Async Notification */
1806         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
1807         /* Function Async Notification */
1808         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
1809         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
1810         /* info1 is 16 b */
1811         uint16_t        info1;
1812         /* info2 is 32 b */
1813         uint32_t        info2;
1814         /*
1815          * This value is written by the NIC such that it will be different
1816          * for each pass through the completion queue.   The even passes
1817          * will write 1.  The odd passes will write 0.
1818          */
1819         uint32_t        info3_v;
1820         #define CMPL_BASE_V         UINT32_C(0x1)
1821         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
1822         #define CMPL_BASE_INFO3_SFT 1
1823         /* info4 is 32 b */
1824         uint32_t        info4;
1825 } __attribute__((packed));
1826
1827 /* tx_cmpl (size:128b/16B) */
1828 struct tx_cmpl {
1829         uint16_t        flags_type;
1830         /*
1831          * This field indicates the exact type of the completion.
1832          * By convention, the LSB identifies the length of the
1833          * record in 16B units.  Even values indicate 16B
1834          * records.  Odd values indicate 32B
1835          * records.
1836          */
1837         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
1838         #define TX_CMPL_TYPE_SFT        0
1839         /*
1840          * TX L2 completion:
1841          *  Completion of TX packet.  Length = 16B
1842          */
1843         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
1844         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
1845         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
1846         #define TX_CMPL_FLAGS_SFT       6
1847         /*
1848          * When this bit is '1', it indicates a packet that has an
1849          * error of some type.  Type of error is indicated in
1850          * error_flags.
1851          */
1852         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
1853         /*
1854          * When this bit is '1', it indicates that the packet completed
1855          * was transmitted using the push acceleration data provided
1856          * by the driver.  When this bit is '0', it indicates that the
1857          * packet had not push acceleration data written or was executed
1858          * as a normal packet even though push data was provided.
1859          */
1860         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
1861         /* unused1 is 16 b */
1862         uint16_t        unused_0;
1863         /*
1864          * This is a copy of the opaque field from the first TX BD of this
1865          * transmitted packet.
1866          */
1867         uint32_t        opaque;
1868         uint16_t        errors_v;
1869         /*
1870          * This value is written by the NIC such that it will be different
1871          * for each pass through the completion queue.   The even passes
1872          * will write 1.  The odd passes will write 0.
1873          */
1874         #define TX_CMPL_V                              UINT32_C(0x1)
1875         #define TX_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
1876         #define TX_CMPL_ERRORS_SFT                     1
1877         /*
1878          * This error indicates that there was some sort of problem
1879          * with the BDs for the packet.
1880          */
1881         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
1882         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT         1
1883         /* No error */
1884         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR      (UINT32_C(0x0) << 1)
1885         /*
1886          * Bad Format:
1887          * BDs were not formatted correctly.
1888          */
1889         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT       (UINT32_C(0x2) << 1)
1890         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
1891                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
1892         /*
1893          * When this bit is '1', it indicates that the length of
1894          * the packet was zero.  No packet was transmitted.
1895          */
1896         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT          UINT32_C(0x10)
1897         /*
1898          * When this bit is '1', it indicates that the packet
1899          * was longer than the programmed limit in TDI. No
1900          * packet was transmitted.
1901          */
1902         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH      UINT32_C(0x20)
1903         /*
1904          * When this bit is '1', it indicates that one or more of the
1905          * BDs associated with this packet generated a PCI error.
1906          * This probably means the address was not valid.
1907          */
1908         #define TX_CMPL_ERRORS_DMA_ERROR                UINT32_C(0x40)
1909         /*
1910          * When this bit is '1', it indicates that the packet was longer
1911          * than indicated by the hint.  No packet was transmitted.
1912          */
1913         #define TX_CMPL_ERRORS_HINT_TOO_SHORT           UINT32_C(0x80)
1914         /*
1915          * When this bit is '1', it indicates that the packet was
1916          * dropped due to Poison TLP error on one or more of the
1917          * TLPs in the PXP completion.
1918          */
1919         #define TX_CMPL_ERRORS_POISON_TLP_ERROR         UINT32_C(0x100)
1920         /* unused2 is 16 b */
1921         uint16_t        unused_1;
1922         /* unused3 is 32 b */
1923         uint32_t        unused_2;
1924 } __attribute__((packed));
1925
1926 /* rx_pkt_cmpl (size:128b/16B) */
1927 struct rx_pkt_cmpl {
1928         uint16_t        flags_type;
1929         /*
1930          * This field indicates the exact type of the completion.
1931          * By convention, the LSB identifies the length of the
1932          * record in 16B units.  Even values indicate 16B
1933          * records.  Odd values indicate 32B
1934          * records.
1935          */
1936         #define RX_PKT_CMPL_TYPE_MASK                   UINT32_C(0x3f)
1937         #define RX_PKT_CMPL_TYPE_SFT                    0
1938         /*
1939          * RX L2 completion:
1940          * Completion of and L2 RX packet. Length = 32B
1941          */
1942         #define RX_PKT_CMPL_TYPE_RX_L2                    UINT32_C(0x11)
1943         #define RX_PKT_CMPL_TYPE_LAST                    RX_PKT_CMPL_TYPE_RX_L2
1944         #define RX_PKT_CMPL_FLAGS_MASK                  UINT32_C(0xffc0)
1945         #define RX_PKT_CMPL_FLAGS_SFT                   6
1946         /*
1947          * When this bit is '1', it indicates a packet that has an
1948          * error of some type.  Type of error is indicated in
1949          * error_flags.
1950          */
1951         #define RX_PKT_CMPL_FLAGS_ERROR                  UINT32_C(0x40)
1952         /* This field indicates how the packet was placed in the buffer. */
1953         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK         UINT32_C(0x380)
1954         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT          7
1955         /*
1956          * Normal:
1957          * Packet was placed using normal algorithm.
1958          */
1959         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL         (UINT32_C(0x0) << 7)
1960         /*
1961          * Jumbo:
1962          * Packet was placed using jumbo algorithm.
1963          */
1964         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO          (UINT32_C(0x1) << 7)
1965         /*
1966          * Header/Data Separation:
1967          * Packet was placed using Header/Data separation algorithm.
1968          * The separation location is indicated by the itype field.
1969          */
1970         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS            (UINT32_C(0x2) << 7)
1971         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
1972                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
1973         /* This bit is '1' if the RSS field in this completion is valid. */
1974         #define RX_PKT_CMPL_FLAGS_RSS_VALID              UINT32_C(0x400)
1975         /* unused is 1 b */
1976         #define RX_PKT_CMPL_FLAGS_UNUSED                 UINT32_C(0x800)
1977         /*
1978          * This value indicates what the inner packet determined for the
1979          * packet was.
1980          */
1981         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK             UINT32_C(0xf000)
1982         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT              12
1983         /*
1984          * Not Known:
1985          * Indicates that the packet type was not known.
1986          */
1987         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
1988                 (UINT32_C(0x0) << 12)
1989         /*
1990          * IP Packet:
1991          * Indicates that the packet was an IP packet, but further
1992          * classification was not possible.
1993          */
1994         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
1995                 (UINT32_C(0x1) << 12)
1996         /*
1997          * TCP Packet:
1998          * Indicates that the packet was IP and TCP.
1999          * This indicates that the payload_offset field is valid.
2000          */
2001         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
2002                 (UINT32_C(0x2) << 12)
2003         /*
2004          * UDP Packet:
2005          * Indicates that the packet was IP and UDP.
2006          * This indicates that the payload_offset field is valid.
2007          */
2008         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
2009                 (UINT32_C(0x3) << 12)
2010         /*
2011          * FCoE Packet:
2012          * Indicates that the packet was recognized as a FCoE.
2013          * This also indicates that the payload_offset field is valid.
2014          */
2015         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
2016                 (UINT32_C(0x4) << 12)
2017         /*
2018          * RoCE Packet:
2019          * Indicates that the packet was recognized as a RoCE.
2020          * This also indicates that the payload_offset field is valid.
2021          */
2022         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
2023                 (UINT32_C(0x5) << 12)
2024         /*
2025          * ICMP Packet:
2026          * Indicates that the packet was recognized as ICMP.
2027          * This indicates that the payload_offset field is valid.
2028          */
2029         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
2030                 (UINT32_C(0x7) << 12)
2031         /*
2032          * PtP packet wo/timestamp:
2033          * Indicates that the packet was recognized as a PtP
2034          * packet.
2035          */
2036         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
2037                 (UINT32_C(0x8) << 12)
2038         /*
2039          * PtP packet w/timestamp:
2040          * Indicates that the packet was recognized as a PtP
2041          * packet and that a timestamp was taken for the packet.
2042          */
2043         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
2044                 (UINT32_C(0x9) << 12)
2045         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
2046                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
2047         /*
2048          * This is the length of the data for the packet stored in the
2049          * buffer(s) identified by the opaque value.  This includes
2050          * the packet BD and any associated buffer BDs.  This does not include
2051          * the the length of any data places in aggregation BDs.
2052          */
2053         uint16_t        len;
2054         /*
2055          * This is a copy of the opaque field from the RX BD this completion
2056          * corresponds to.
2057          */
2058         uint32_t        opaque;
2059         uint8_t agg_bufs_v1;
2060         /*
2061          * This value is written by the NIC such that it will be different
2062          * for each pass through the completion queue.   The even passes
2063          * will write 1.  The odd passes will write 0.
2064          */
2065         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
2066         /*
2067          * This value is the number of aggregation buffers that follow this
2068          * entry in the completion ring that are a part of this packet.
2069          * If the value is zero, then the packet is completely contained
2070          * in the buffer space provided for the packet in the RX ring.
2071          */
2072         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
2073         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
2074         /* unused1 is 2 b */
2075         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
2076         #define RX_PKT_CMPL_UNUSED1_SFT  6
2077         /*
2078          * This is the RSS hash type for the packet.  The value is packed
2079          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2080          *
2081          * The value of tuple_extrac_op provides the information about
2082          * what fields the hash was computed on.
2083          * * 0: The RSS hash was computed over source IP address,
2084          * destination IP address, source port, and destination port of inner
2085          * IP and TCP or UDP headers. Note: For non-tunneled packets,
2086          * the packet headers are considered inner packet headers for the RSS
2087          * hash computation purpose.
2088          * * 1: The RSS hash was computed over source IP address and destination
2089          * IP address of inner IP header. Note: For non-tunneled packets,
2090          * the packet headers are considered inner packet headers for the RSS
2091          * hash computation purpose.
2092          * * 2: The RSS hash was computed over source IP address,
2093          * destination IP address, source port, and destination port of
2094          * IP and TCP or UDP headers of outer tunnel headers.
2095          * Note: For non-tunneled packets, this value is not applicable.
2096          * * 3: The RSS hash was computed over source IP address and
2097          * destination IP address of IP header of outer tunnel headers.
2098          * Note: For non-tunneled packets, this value is not applicable.
2099          *
2100          * Note that 4-tuples values listed above are applicable
2101          * for layer 4 protocols supported and enabled for RSS in the hardware,
2102          * HWRM firmware, and drivers. For example, if RSS hash is supported and
2103          * enabled for TCP traffic only, then the values of tuple_extract_op
2104          * corresponding to 4-tuples are only valid for TCP traffic.
2105          */
2106         uint8_t rss_hash_type;
2107         /*
2108          * This value indicates the offset in bytes from the beginning of the packet
2109          * where the inner payload starts.  This value is valid for TCP, UDP,
2110          * FCoE, and RoCE packets.
2111          *
2112          * A value of zero indicates that header is 256B into the packet.
2113          */
2114         uint8_t payload_offset;
2115         /* unused2 is 8 b */
2116         uint8_t unused1;
2117         /*
2118          * This value is the RSS hash value calculated for the packet
2119          * based on the mode bits and key value in the VNIC.
2120          */
2121         uint32_t        rss_hash;
2122 } __attribute__((packed));
2123
2124 /* rx_pkt_cmpl_hi (size:128b/16B) */
2125 struct rx_pkt_cmpl_hi {
2126         uint32_t        flags2;
2127         /*
2128          * This indicates that the ip checksum was calculated for the
2129          * inner packet and that the ip_cs_error field indicates if there
2130          * was an error.
2131          */
2132         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
2133         /*
2134          * This indicates that the TCP, UDP or ICMP checksum was
2135          * calculated for the inner packet and that the l4_cs_error field
2136          * indicates if there was an error.
2137          */
2138         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
2139         /*
2140          * This indicates that the ip checksum was calculated for the
2141          * tunnel header and that the t_ip_cs_error field indicates if there
2142          * was an error.
2143          */
2144         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
2145         /*
2146          * This indicates that the UDP checksum was
2147          * calculated for the tunnel packet and that the t_l4_cs_error field
2148          * indicates if there was an error.
2149          */
2150         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
2151         /* This value indicates what format the metadata field is. */
2152         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
2153         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT  4
2154         /* No metadata informtaion.  Value is zero. */
2155         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE   (UINT32_C(0x0) << 4)
2156         /*
2157          * The metadata field contains the VLAN tag and TPID value.
2158          * - metadata[11:0] contains the vlan VID value.
2159          * - metadata[12] contains the vlan DE value.
2160          * - metadata[15:13] contains the vlan PRI value.
2161          * - metadata[31:16] contains the vlan TPID value.
2162          */
2163         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN   (UINT32_C(0x1) << 4)
2164         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
2165                 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
2166         /*
2167          * This field indicates the IP type for the inner-most IP header.
2168          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
2169          * This value is only valid if itype indicates a packet
2170          * with an IP header.
2171          */
2172         #define RX_PKT_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
2173         /*
2174          * This is data from the CFA block as indicated by the meta_format
2175          * field.
2176          */
2177         uint32_t        metadata;
2178         /* When meta_format=1, this value is the VLAN VID. */
2179         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
2180         #define RX_PKT_CMPL_METADATA_VID_SFT  0
2181         /* When meta_format=1, this value is the VLAN DE. */
2182         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
2183         /* When meta_format=1, this value is the VLAN PRI. */
2184         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
2185         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
2186         /* When meta_format=1, this value is the VLAN TPID. */
2187         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
2188         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
2189         uint16_t        errors_v2;
2190         /*
2191          * This value is written by the NIC such that it will be different
2192          * for each pass through the completion queue.   The even passes
2193          * will write 1.  The odd passes will write 0.
2194          */
2195         #define RX_PKT_CMPL_V2 \
2196                 UINT32_C(0x1)
2197         #define RX_PKT_CMPL_ERRORS_MASK \
2198                 UINT32_C(0xfffe)
2199         #define RX_PKT_CMPL_ERRORS_SFT                               1
2200         /*
2201          * This error indicates that there was some sort of problem with
2202          * the BDs for the packet that was found after part of the
2203          * packet was already placed.  The packet should be treated as
2204          * invalid.
2205          */
2206         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
2207                 UINT32_C(0xe)
2208         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
2209         /* No buffer error */
2210         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
2211                 (UINT32_C(0x0) << 1)
2212         /*
2213          * Did Not Fit:
2214          * Packet did not fit into packet buffer provided.
2215          * For regular placement, this means the packet did not fit
2216          * in the buffer provided.  For HDS and jumbo placement, this
2217          * means that the packet could not be placed into 7 physical
2218          * buffers or less.
2219          */
2220         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
2221                 (UINT32_C(0x1) << 1)
2222         /*
2223          * Not On Chip:
2224          * All BDs needed for the packet were not on-chip when
2225          * the packet arrived.
2226          */
2227         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
2228                 (UINT32_C(0x2) << 1)
2229         /*
2230          * Bad Format:
2231          * BDs were not formatted correctly.
2232          */
2233         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
2234                 (UINT32_C(0x3) << 1)
2235         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
2236                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
2237         /*
2238          * This indicates that there was an error in the IP header
2239          * checksum.
2240          */
2241         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
2242                 UINT32_C(0x10)
2243         /*
2244          * This indicates that there was an error in the TCP, UDP
2245          * or ICMP checksum.
2246          */
2247         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
2248                 UINT32_C(0x20)
2249         /*
2250          * This indicates that there was an error in the tunnel
2251          * IP header checksum.
2252          */
2253         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
2254                 UINT32_C(0x40)
2255         /*
2256          * This indicates that there was an error in the tunnel
2257          * UDP checksum.
2258          */
2259         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
2260                 UINT32_C(0x80)
2261         /*
2262          * This indicates that there was a CRC error on either an FCoE
2263          * or RoCE packet.  The itype indicates the packet type.
2264          */
2265         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
2266                 UINT32_C(0x100)
2267         /*
2268          * This indicates that there was an error in the tunnel
2269          * portion of the packet when this
2270          * field is non-zero.
2271          */
2272         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
2273                 UINT32_C(0xe00)
2274         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
2275         /*
2276          * No additional error occurred on the tunnel portion
2277          * of the packet of the packet does not have a tunnel.
2278          */
2279         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
2280                 (UINT32_C(0x0) << 9)
2281         /*
2282          * Indicates that IP header version does not match
2283          * expectation from L2 Ethertype for IPv4 and IPv6
2284          * in the tunnel header.
2285          */
2286         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
2287                 (UINT32_C(0x1) << 9)
2288         /*
2289          * Indicates that header length is out of range in the
2290          * tunnel header. Valid for
2291          * IPv4.
2292          */
2293         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
2294                 (UINT32_C(0x2) << 9)
2295         /*
2296          * Indicates that the physical packet is shorter than that
2297          * claimed by the PPPoE header length for a tunnel PPPoE
2298          * packet.
2299          */
2300         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
2301                 (UINT32_C(0x3) << 9)
2302         /*
2303          * Indicates that physical packet is shorter than that claimed
2304          * by the tunnel l3 header length. Valid for IPv4, or IPv6
2305          * tunnel packet packets.
2306          */
2307         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
2308                 (UINT32_C(0x4) << 9)
2309         /*
2310          * Indicates that the physical packet is shorter than that
2311          * claimed by the tunnel UDP header length for a tunnel
2312          * UDP packet that is not fragmented.
2313          */
2314         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
2315                 (UINT32_C(0x5) << 9)
2316         /*
2317          * indicates that the IPv4 TTL or IPv6 hop limit check
2318          * have failed (e.g. TTL = 0) in the tunnel header. Valid
2319          * for IPv4, and IPv6.
2320          */
2321         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
2322                 (UINT32_C(0x6) << 9)
2323         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
2324                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
2325         /*
2326          * This indicates that there was an error in the inner
2327          * portion of the packet when this
2328          * field is non-zero.
2329          */
2330         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
2331                 UINT32_C(0xf000)
2332         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
2333         /*
2334          * No additional error occurred on the tunnel portion
2335          * of the packet of the packet does not have a tunnel.
2336          */
2337         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
2338                 (UINT32_C(0x0) << 12)
2339         /*
2340          * Indicates that IP header version does not match
2341          * expectation from L2 Ethertype for IPv4 and IPv6 or that
2342          * option other than VFT was parsed on
2343          * FCoE packet.
2344          */
2345         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
2346                 (UINT32_C(0x1) << 12)
2347         /*
2348          * indicates that header length is out of range. Valid for
2349          * IPv4 and RoCE
2350          */
2351         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
2352                 (UINT32_C(0x2) << 12)
2353         /*
2354          * indicates that the IPv4 TTL or IPv6 hop limit check
2355          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
2356          */
2357         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
2358                 (UINT32_C(0x3) << 12)
2359         /*
2360          * Indicates that physical packet is shorter than that
2361          * claimed by the l3 header length. Valid for IPv4,
2362          * IPv6 packet or RoCE packets.
2363          */
2364         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
2365                 (UINT32_C(0x4) << 12)
2366         /*
2367          * Indicates that the physical packet is shorter than that
2368          * claimed by the UDP header length for a UDP packet that is
2369          * not fragmented.
2370          */
2371         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
2372                 (UINT32_C(0x5) << 12)
2373         /*
2374          * Indicates that TCP header length > IP payload. Valid for
2375          * TCP packets only.
2376          */
2377         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
2378                 (UINT32_C(0x6) << 12)
2379         /* Indicates that TCP header length < 5. Valid for TCP. */
2380         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
2381                 (UINT32_C(0x7) << 12)
2382         /*
2383          * Indicates that TCP option headers result in a TCP header
2384          * size that does not match data offset in TCP header. Valid
2385          * for TCP.
2386          */
2387         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
2388                 (UINT32_C(0x8) << 12)
2389         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
2390                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
2391         /*
2392          * This field identifies the CFA action rule that was used for this
2393          * packet.
2394          */
2395         uint16_t        cfa_code;
2396         uint32_t        reorder;
2397         /*
2398          * This value holds the reordering sequence number for the packet.
2399          * If the reordering sequence is not valid, then this value is zero.
2400          * The reordering domain for the packet is in the bottom 8 to 10b of
2401          * the rss_hash value.  The bottom 20b of this value contain the
2402          * ordering domain value for the packet.
2403          */
2404         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
2405         #define RX_PKT_CMPL_REORDER_SFT 0
2406 } __attribute__((packed));
2407
2408 /* rx_tpa_start_cmpl (size:128b/16B) */
2409 struct rx_tpa_start_cmpl {
2410         uint16_t        flags_type;
2411         /*
2412          * This field indicates the exact type of the completion.
2413          * By convention, the LSB identifies the length of the
2414          * record in 16B units.  Even values indicate 16B
2415          * records.  Odd values indicate 32B
2416          * records.
2417          */
2418         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
2419         #define RX_TPA_START_CMPL_TYPE_SFT                 0
2420         /*
2421          * RX L2 TPA Start Completion:
2422          * Completion at the beginning of a TPA operation.
2423          * Length = 32B
2424          */
2425         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
2426         #define RX_TPA_START_CMPL_TYPE_LAST \
2427                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
2428         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
2429         #define RX_TPA_START_CMPL_FLAGS_SFT                6
2430         /* This bit will always be '0' for TPA start completions. */
2431         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
2432         /* This field indicates how the packet was placed in the buffer. */
2433         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
2434         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
2435         /*
2436          * Jumbo:
2437          * TPA Packet was placed using jumbo algorithm.  This means
2438          * that the first buffer will be filled with data before
2439          * moving to aggregation buffers.  Each aggregation buffer
2440          * will be filled before moving to the next aggregation
2441          * buffer.
2442          */
2443         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
2444                 (UINT32_C(0x1) << 7)
2445         /*
2446          * Header/Data Separation:
2447          * Packet was placed using Header/Data separation algorithm.
2448          * The separation location is indicated by the itype field.
2449          */
2450         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
2451                 (UINT32_C(0x2) << 7)
2452         /*
2453          * GRO/Jumbo:
2454          * Packet will be placed using GRO/Jumbo where the first
2455          * packet is filled with data. Subsequent packets will be
2456          * placed such that any one packet does not span two
2457          * aggregation buffers unless it starts at the beginning of
2458          * an aggregation buffer.
2459          */
2460         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
2461                 (UINT32_C(0x5) << 7)
2462         /*
2463          * GRO/Header-Data Separation:
2464          * Packet will be placed using GRO/HDS where the header
2465          * is in the first packet.
2466          * Payload of each packet will be
2467          * placed such that any one packet does not span two
2468          * aggregation buffers unless it starts at the beginning of
2469          * an aggregation buffer.
2470          */
2471         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
2472                 (UINT32_C(0x6) << 7)
2473         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
2474                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
2475         /* This bit is '1' if the RSS field in this completion is valid. */
2476         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
2477         /* unused is 1 b */
2478         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
2479         /*
2480          * This value indicates what the inner packet determined for the
2481          * packet was.
2482          */
2483         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
2484         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
2485         /*
2486          * TCP Packet:
2487          * Indicates that the packet was IP and TCP.
2488          */
2489         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
2490                 (UINT32_C(0x2) << 12)
2491         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
2492                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
2493         /*
2494          * This value indicates the amount of packet data written to the
2495          * buffer the opaque field in this completion corresponds to.
2496          */
2497         uint16_t        len;
2498         /*
2499          * This is a copy of the opaque field from the RX BD this completion
2500          * corresponds to.
2501          */
2502         uint32_t        opaque;
2503         /*
2504          * This value is written by the NIC such that it will be different
2505          * for each pass through the completion queue.   The even passes
2506          * will write 1.  The odd passes will write 0.
2507          */
2508         uint8_t v1;
2509         /*
2510          * This value is written by the NIC such that it will be different
2511          * for each pass through the completion queue.   The even passes
2512          * will write 1.  The odd passes will write 0.
2513          */
2514         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
2515         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
2516         /*
2517          * This is the RSS hash type for the packet.  The value is packed
2518          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2519          *
2520          * The value of tuple_extrac_op provides the information about
2521          * what fields the hash was computed on.
2522          * * 0: The RSS hash was computed over source IP address,
2523          * destination IP address, source port, and destination port of inner
2524          * IP and TCP or UDP headers. Note: For non-tunneled packets,
2525          * the packet headers are considered inner packet headers for the RSS
2526          * hash computation purpose.
2527          * * 1: The RSS hash was computed over source IP address and destination
2528          * IP address of inner IP header. Note: For non-tunneled packets,
2529          * the packet headers are considered inner packet headers for the RSS
2530          * hash computation purpose.
2531          * * 2: The RSS hash was computed over source IP address,
2532          * destination IP address, source port, and destination port of
2533          * IP and TCP or UDP headers of outer tunnel headers.
2534          * Note: For non-tunneled packets, this value is not applicable.
2535          * * 3: The RSS hash was computed over source IP address and
2536          * destination IP address of IP header of outer tunnel headers.
2537          * Note: For non-tunneled packets, this value is not applicable.
2538          *
2539          * Note that 4-tuples values listed above are applicable
2540          * for layer 4 protocols supported and enabled for RSS in the hardware,
2541          * HWRM firmware, and drivers. For example, if RSS hash is supported and
2542          * enabled for TCP traffic only, then the values of tuple_extract_op
2543          * corresponding to 4-tuples are only valid for TCP traffic.
2544          */
2545         uint8_t rss_hash_type;
2546         /*
2547          * This is the aggregation ID that the completion is associated
2548          * with.  Use this number to correlate the TPA start completion
2549          * with the TPA end completion.
2550          */
2551         uint16_t        agg_id;
2552         /* unused2 is 9 b */
2553         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
2554         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
2555         /*
2556          * This is the aggregation ID that the completion is associated
2557          * with.  Use this number to correlate the TPA start completion
2558          * with the TPA end completion.
2559          */
2560         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
2561         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
2562         /*
2563          * This value is the RSS hash value calculated for the packet
2564          * based on the mode bits and key value in the VNIC.
2565          */
2566         uint32_t        rss_hash;
2567 } __attribute__((packed));
2568
2569 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
2570 struct rx_tpa_start_cmpl_hi {
2571         uint32_t        flags2;
2572         /*
2573          * This indicates that the ip checksum was calculated for the
2574          * inner packet and that the sum passed for all segments
2575          * included in the aggregation.
2576          */
2577         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
2578         /*
2579          * This indicates that the TCP, UDP or ICMP checksum was
2580          * calculated for the inner packet and that the sum passed
2581          * for all segments included in the aggregation.
2582          */
2583         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
2584         /*
2585          * This indicates that the ip checksum was calculated for the
2586          * tunnel header and that the sum passed for all segments
2587          * included in the aggregation.
2588          */
2589         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
2590         /*
2591          * This indicates that the UDP checksum was
2592          * calculated for the tunnel packet and that the sum passed for
2593          * all segments included in the aggregation.
2594          */
2595         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
2596         /* This value indicates what format the metadata field is. */
2597         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
2598         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
2599         /* No metadata informtaion.  Value is zero. */
2600         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
2601                 (UINT32_C(0x0) << 4)
2602         /*
2603          * The metadata field contains the VLAN tag and TPID value.
2604          * - metadata[11:0] contains the vlan VID value.
2605          * - metadata[12] contains the vlan DE value.
2606          * - metadata[15:13] contains the vlan PRI value.
2607          * - metadata[31:16] contains the vlan TPID value.
2608          */
2609         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
2610                 (UINT32_C(0x1) << 4)
2611         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
2612                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
2613         /*
2614          * This field indicates the IP type for the inner-most IP header.
2615          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
2616          */
2617         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
2618         /*
2619          * This is data from the CFA block as indicated by the meta_format
2620          * field.
2621          */
2622         uint32_t        metadata;
2623         /* When meta_format=1, this value is the VLAN VID. */
2624         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
2625         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
2626         /* When meta_format=1, this value is the VLAN DE. */
2627         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
2628         /* When meta_format=1, this value is the VLAN PRI. */
2629         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
2630         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
2631         /* When meta_format=1, this value is the VLAN TPID. */
2632         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
2633         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
2634         uint16_t        v2;
2635         /*
2636          * This value is written by the NIC such that it will be different
2637          * for each pass through the completion queue.   The even passes
2638          * will write 1.  The odd passes will write 0.
2639          */
2640         #define RX_TPA_START_CMPL_V2     UINT32_C(0x1)
2641         /*
2642          * This field identifies the CFA action rule that was used for this
2643          * packet.
2644          */
2645         uint16_t        cfa_code;
2646         /*
2647          * This is the size in bytes of the inner most L4 header.
2648          * This can be subtracted from the payload_offset to determine
2649          * the start of the inner most L4 header.
2650          */
2651         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
2652         /*
2653          * This is the offset from the beginning of the packet in bytes for
2654          * the outer L3 header.  If there is no outer L3 header, then this
2655          * value is zero.
2656          */
2657         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
2658         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
2659         /*
2660          * This is the offset from the beginning of the packet in bytes for
2661          * the inner most L2 header.
2662          */
2663         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
2664         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
2665         /*
2666          * This is the offset from the beginning of the packet in bytes for
2667          * the inner most L3 header.
2668          */
2669         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
2670         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
2671         /*
2672          * This is the size in bytes of the inner most L4 header.
2673          * This can be subtracted from the payload_offset to determine
2674          * the start of the inner most L4 header.
2675          */
2676         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
2677         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
2678 } __attribute__((packed));
2679
2680 /* rx_tpa_end_cmpl (size:128b/16B) */
2681 struct rx_tpa_end_cmpl {
2682         uint16_t        flags_type;
2683         /*
2684          * This field indicates the exact type of the completion.
2685          * By convention, the LSB identifies the length of the
2686          * record in 16B units.  Even values indicate 16B
2687          * records.  Odd values indicate 32B
2688          * records.
2689          */
2690         #define RX_TPA_END_CMPL_TYPE_MASK                UINT32_C(0x3f)
2691         #define RX_TPA_END_CMPL_TYPE_SFT                 0
2692         /*
2693          * RX L2 TPA End Completion:
2694          * Completion at the end of a TPA operation.
2695          * Length = 32B
2696          */
2697         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END            UINT32_C(0x15)
2698         #define RX_TPA_END_CMPL_TYPE_LAST \
2699                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
2700         #define RX_TPA_END_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
2701         #define RX_TPA_END_CMPL_FLAGS_SFT                6
2702         /*
2703          * When this bit is '1', it indicates a packet that has an
2704          * error of some type.  Type of error is indicated in
2705          * error_flags.
2706          */
2707         #define RX_TPA_END_CMPL_FLAGS_ERROR               UINT32_C(0x40)
2708         /* This field indicates how the packet was placed in the buffer. */
2709         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
2710         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT       7
2711         /*
2712          * Jumbo:
2713          * TPA Packet was placed using jumbo algorithm.  This means
2714          * that the first buffer will be filled with data before
2715          * moving to aggregation buffers.  Each aggregation buffer
2716          * will be filled before moving to the next aggregation
2717          * buffer.
2718          */
2719         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
2720                 (UINT32_C(0x1) << 7)
2721         /*
2722          * Header/Data Separation:
2723          * Packet was placed using Header/Data separation algorithm.
2724          * The separation location is indicated by the itype field.
2725          */
2726         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
2727                 (UINT32_C(0x2) << 7)
2728         /*
2729          * GRO/Jumbo:
2730          * Packet will be placed using GRO/Jumbo where the first
2731          * packet is filled with data. Subsequent packets will be
2732          * placed such that any one packet does not span two
2733          * aggregation buffers unless it starts at the beginning of
2734          * an aggregation buffer.
2735          */
2736         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
2737                 (UINT32_C(0x5) << 7)
2738         /*
2739          * GRO/Header-Data Separation:
2740          * Packet will be placed using GRO/HDS where the header
2741          * is in the first packet.
2742          * Payload of each packet will be
2743          * placed such that any one packet does not span two
2744          * aggregation buffers unless it starts at the beginning of
2745          * an aggregation buffer.
2746          */
2747         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
2748                 (UINT32_C(0x6) << 7)
2749         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
2750                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
2751         /* unused is 2 b */
2752         #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK         UINT32_C(0xc00)
2753         #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT          10
2754         /*
2755          * This value indicates what the inner packet determined for the
2756          * packet was.
2757          *  - 2 TCP Packet
2758          *      Indicates that the packet was IP and TCP.  This indicates
2759          *      that the ip_cs field is valid and that the tcp_udp_cs
2760          *      field is valid and contains the TCP checksum.
2761          *      This also indicates that the payload_offset field is valid.
2762          */
2763         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
2764         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT           12
2765         /*
2766          * This value is zero for TPA End completions.
2767          * There is no data in the buffer that corresponds to the opaque
2768          * value in this completion.
2769          */
2770         uint16_t        len;
2771         /*
2772          * This is a copy of the opaque field from the RX BD this completion
2773          * corresponds to.
2774          */
2775         uint32_t        opaque;
2776         /*
2777          * This value is written by the NIC such that it will be different
2778          * for each pass through the completion queue.   The even passes
2779          * will write 1.  The odd passes will write 0.
2780          */
2781         uint8_t agg_bufs_v1;
2782         /*
2783          * This value is written by the NIC such that it will be different
2784          * for each pass through the completion queue.   The even passes
2785          * will write 1.  The odd passes will write 0.
2786          */
2787         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
2788         /*
2789          * This value is the number of aggregation buffers that follow this
2790          * entry in the completion ring that are a part of this aggregation
2791          * packet.
2792          * If the value is zero, then the packet is completely contained
2793          * in the buffer space provided in the aggregation start completion.
2794          */
2795         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
2796         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
2797         /* This value is the number of segments in the TPA operation. */
2798         uint8_t tpa_segs;
2799         /*
2800          * This value indicates the offset in bytes from the beginning of the packet
2801          * where the inner payload starts.  This value is valid for TCP, UDP,
2802          * FCoE, and RoCE packets.
2803          *
2804          * A value of zero indicates an offset of 256 bytes.
2805          */
2806         uint8_t payload_offset;
2807         uint8_t agg_id;
2808         /* unused2 is 1 b */
2809         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
2810         /*
2811          * This is the aggregation ID that the completion is associated
2812          * with.  Use this number to correlate the TPA start completion
2813          * with the TPA end completion.
2814          */
2815         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
2816         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
2817         /*
2818          * For non-GRO packets, this value is the
2819          * timestamp delta between earliest and latest timestamp values for
2820          * TPA packet. If packets were not time stamped, then delta will be
2821          * zero.
2822          *
2823          * For GRO packets, this field is zero except for the following
2824          * sub-fields.
2825          * - tsdelta[31]
2826          *     Timestamp present indication.  When '0', no Timestamp
2827          *     option is in the packet.  When '1', then a Timestamp
2828          *     option is present in the packet.
2829          */
2830         uint32_t        tsdelta;
2831 } __attribute__((packed));
2832
2833 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
2834 struct rx_tpa_end_cmpl_hi {
2835         /*
2836          * This value is the number of duplicate ACKs that have been
2837          * received as part of the TPA operation.
2838          */
2839         uint32_t        tpa_dup_acks;
2840         /*
2841          * This value is the number of duplicate ACKs that have been
2842          * received as part of the TPA operation.
2843          */
2844         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
2845         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
2846         /*
2847          * This value is the valid when TPA completion is active.  It
2848          * indicates the length of the longest segment of the TPA operation
2849          * for LRO mode and the length of the first segment in GRO mode.
2850          *
2851          * This value may be used by GRO software to re-construct the original
2852          * packet stream from the TPA packet.  This is the length of all
2853          * but the last segment for GRO.  In LRO mode this value may be used
2854          * to indicate MSS size to the stack.
2855          */
2856         uint16_t        tpa_seg_len;
2857         /* unused4 is 16 b */
2858         uint16_t        unused3;
2859         uint16_t        errors_v2;
2860         /*
2861          * This value is written by the NIC such that it will be different
2862          * for each pass through the completion queue.   The even passes
2863          * will write 1.  The odd passes will write 0.
2864          */
2865         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
2866         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
2867         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
2868         /*
2869          * This error indicates that there was some sort of problem with
2870          * the BDs for the packet that was found after part of the
2871          * packet was already placed.  The packet should be treated as
2872          * invalid.
2873          */
2874         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
2875         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
2876         /*
2877          * This error occurs when there is a fatal HW problem in
2878          * the chip only.  It indicates that there were not
2879          * BDs on chip but that there was adequate reservation.
2880          * provided by the TPA block.
2881          */
2882         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
2883                 (UINT32_C(0x2) << 1)
2884         /*
2885          * This error occurs when TPA block was not configured to
2886          * reserve adequate BDs for TPA operations on this RX
2887          * ring.  All data for the TPA operation was not placed.
2888          *
2889          * This error can also be generated when the number of
2890          * segments is not programmed correctly in TPA and the
2891          * 33 total aggregation buffers allowed for the TPA
2892          * operation has been exceeded.
2893          */
2894         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
2895                 (UINT32_C(0x4) << 1)
2896         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
2897                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
2898         /* unused5 is 16 b */
2899         uint16_t        unused_4;
2900         /*
2901          * This is the opaque value that was completed for the TPA start
2902          * completion that corresponds to this TPA end completion.
2903          */
2904         uint32_t        start_opaque;
2905 } __attribute__((packed));
2906
2907 /* rx_abuf_cmpl (size:128b/16B) */
2908 struct rx_abuf_cmpl {
2909         uint16_t        type;
2910         /*
2911          * This field indicates the exact type of the completion.
2912          * By convention, the LSB identifies the length of the
2913          * record in 16B units.  Even values indicate 16B
2914          * records.  Odd values indicate 32B
2915          * records.
2916          */
2917         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
2918         #define RX_ABUF_CMPL_TYPE_SFT   0
2919         /*
2920          * RX Aggregation Buffer completion :
2921          * Completion of an L2 aggregation buffer in support of
2922          * TPA, HDS, or Jumbo packet completion.  Length = 16B
2923          */
2924         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
2925         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
2926         /*
2927          * This is the length of the data for the packet stored in this
2928          * aggregation buffer identified by the opaque value.  This does not
2929          * include the length of any
2930          * data placed in other aggregation BDs or in the packet or buffer
2931          * BDs.   This length does not include any space added due to
2932          * hdr_offset register during HDS placement mode.
2933          */
2934         uint16_t        len;
2935         /*
2936          * This is a copy of the opaque field from the RX BD this aggregation
2937          * buffer corresponds to.
2938          */
2939         uint32_t        opaque;
2940         uint32_t        v;
2941         /*
2942          * This value is written by the NIC such that it will be different
2943          * for each pass through the completion queue.   The even passes
2944          * will write 1.  The odd passes will write 0.
2945          */
2946         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
2947         /* unused3 is 32 b */
2948         uint32_t        unused_2;
2949 } __attribute__((packed));
2950
2951 /* eject_cmpl (size:128b/16B) */
2952 struct eject_cmpl {
2953         uint16_t        type;
2954         /*
2955          * This field indicates the exact type of the completion.
2956          * By convention, the LSB identifies the length of the
2957          * record in 16B units.  Even values indicate 16B
2958          * records.  Odd values indicate 32B
2959          * records.
2960          */
2961         #define EJECT_CMPL_TYPE_MASK      UINT32_C(0x3f)
2962         #define EJECT_CMPL_TYPE_SFT       0
2963         /*
2964          * Statistics Ejection Completion:
2965          * Completion of statistics data ejection buffer.
2966          * Length = 16B
2967          */
2968         #define EJECT_CMPL_TYPE_STAT_EJECT  UINT32_C(0x1a)
2969         #define EJECT_CMPL_TYPE_LAST       EJECT_CMPL_TYPE_STAT_EJECT
2970         /*
2971          * This is the length of the statistics data stored in this
2972          * buffer.
2973          */
2974         uint16_t        len;
2975         /*
2976          * This is a copy of the opaque field from the RX BD this ejection
2977          * buffer corresponds to.
2978          */
2979         uint32_t        opaque;
2980         uint32_t        v;
2981         /*
2982          * This value is written by the NIC such that it will be different
2983          * for each pass through the completion queue.   The even passes
2984          * will write 1.  The odd passes will write 0.
2985          */
2986         #define EJECT_CMPL_V     UINT32_C(0x1)
2987         /* unused3 is 32 b */
2988         uint32_t        unused_2;
2989 } __attribute__((packed));
2990
2991 /* hwrm_cmpl (size:128b/16B) */
2992 struct hwrm_cmpl {
2993         uint16_t        type;
2994         /*
2995          * This field indicates the exact type of the completion.
2996          * By convention, the LSB identifies the length of the
2997          * record in 16B units.  Even values indicate 16B
2998          * records.  Odd values indicate 32B
2999          * records.
3000          */
3001         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
3002         #define HWRM_CMPL_TYPE_SFT      0
3003         /*
3004          * HWRM Command Completion:
3005          * Completion of an HWRM command.
3006          */
3007         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
3008         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
3009         /* This is the sequence_id of the HWRM command that has completed. */
3010         uint16_t        sequence_id;
3011         /* unused2 is 32 b */
3012         uint32_t        unused_1;
3013         uint32_t        v;
3014         /*
3015          * This value is written by the NIC such that it will be different
3016          * for each pass through the completion queue.   The even passes
3017          * will write 1.  The odd passes will write 0.
3018          */
3019         #define HWRM_CMPL_V     UINT32_C(0x1)
3020         /* unused4 is 32 b */
3021         uint32_t        unused_3;
3022 } __attribute__((packed));
3023
3024 /* hwrm_fwd_req_cmpl (size:128b/16B) */
3025 struct hwrm_fwd_req_cmpl {
3026         /*
3027          * This field indicates the exact type of the completion.
3028          * By convention, the LSB identifies the length of the
3029          * record in 16B units.  Even values indicate 16B
3030          * records.  Odd values indicate 32B
3031          * records.
3032          */
3033         uint16_t        req_len_type;
3034         /*
3035          * This field indicates the exact type of the completion.
3036          * By convention, the LSB identifies the length of the
3037          * record in 16B units.  Even values indicate 16B
3038          * records.  Odd values indicate 32B
3039          * records.
3040          */
3041         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
3042         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
3043         /* Forwarded HWRM Request */
3044         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
3045         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
3046                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
3047         /* Length of forwarded request in bytes. */
3048         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
3049         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
3050         /*
3051          * Source ID of this request.
3052          * Typically used in forwarding requests and responses.
3053          * 0x0 - 0xFFF8 - Used for function ids
3054          * 0xFFF8 - 0xFFFE - Reserved for internal processors
3055          * 0xFFFF - HWRM
3056          */
3057         uint16_t        source_id;
3058         /* unused1 is 32 b */
3059         uint32_t        unused0;
3060         /* Address of forwarded request. */
3061         uint32_t        req_buf_addr_v[2];
3062         /*
3063          * This value is written by the NIC such that it will be different
3064          * for each pass through the completion queue.   The even passes
3065          * will write 1.  The odd passes will write 0.
3066          */
3067         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
3068         /* Address of forwarded request. */
3069         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
3070         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
3071 } __attribute__((packed));
3072
3073 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
3074 struct hwrm_fwd_resp_cmpl {
3075         uint16_t        type;
3076         /*
3077          * This field indicates the exact type of the completion.
3078          * By convention, the LSB identifies the length of the
3079          * record in 16B units.  Even values indicate 16B
3080          * records.  Odd values indicate 32B
3081          * records.
3082          */
3083         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
3084         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
3085         /* Forwarded HWRM Response */
3086         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
3087         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
3088                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
3089         /*
3090          * Source ID of this response.
3091          * Typically used in forwarding requests and responses.
3092          * 0x0 - 0xFFF8 - Used for function ids
3093          * 0xFFF8 - 0xFFFE - Reserved for internal processors
3094          * 0xFFFF - HWRM
3095          */
3096         uint16_t        source_id;
3097         /* Length of forwarded response in bytes. */
3098         uint16_t        resp_len;
3099         /* unused2 is 16 b */
3100         uint16_t        unused_1;
3101         /* Address of forwarded request. */
3102         uint32_t        resp_buf_addr_v[2];
3103         /*
3104          * This value is written by the NIC such that it will be different
3105          * for each pass through the completion queue.   The even passes
3106          * will write 1.  The odd passes will write 0.
3107          */
3108         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
3109         /* Address of forwarded request. */
3110         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
3111         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
3112 } __attribute__((packed));
3113
3114 /* hwrm_async_event_cmpl (size:128b/16B) */
3115 struct hwrm_async_event_cmpl {
3116         uint16_t        type;
3117         /*
3118          * This field indicates the exact type of the completion.
3119          * By convention, the LSB identifies the length of the
3120          * record in 16B units.  Even values indicate 16B
3121          * records.  Odd values indicate 32B
3122          * records.
3123          */
3124         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
3125         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
3126         /* HWRM Asynchronous Event Information */
3127         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
3128         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
3129                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
3130         /* Identifiers of events. */
3131         uint16_t        event_id;
3132         /* Link status changed */
3133         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
3134                 UINT32_C(0x0)
3135         /* Link MTU changed */
3136         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
3137                 UINT32_C(0x1)
3138         /* Link speed changed */
3139         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
3140                 UINT32_C(0x2)
3141         /* DCB Configuration changed */
3142         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
3143                 UINT32_C(0x3)
3144         /* Port connection not allowed */
3145         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
3146                 UINT32_C(0x4)
3147         /* Link speed configuration was not allowed */
3148         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
3149                 UINT32_C(0x5)
3150         /* Link speed configuration change */
3151         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
3152                 UINT32_C(0x6)
3153         /* Port PHY configuration change */
3154         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
3155                 UINT32_C(0x7)
3156         /* Function driver unloaded */
3157         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
3158                 UINT32_C(0x10)
3159         /* Function driver loaded */
3160         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
3161                 UINT32_C(0x11)
3162         /* Function FLR related processing has completed */
3163         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
3164                 UINT32_C(0x12)
3165         /* PF driver unloaded */
3166         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
3167                 UINT32_C(0x20)
3168         /* PF driver loaded */
3169         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
3170                 UINT32_C(0x21)
3171         /* VF Function Level Reset (FLR) */
3172         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
3173                 UINT32_C(0x30)
3174         /* VF MAC Address Change */
3175         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
3176                 UINT32_C(0x31)
3177         /* PF-VF communication channel status change. */
3178         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
3179                 UINT32_C(0x32)
3180         /* VF Configuration Change */
3181         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
3182                 UINT32_C(0x33)
3183         /* LLFC/PFC Configuration Change */
3184         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
3185                 UINT32_C(0x34)
3186         /* HWRM Error */
3187         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
3188                 UINT32_C(0xff)
3189         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
3190                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
3191         /* Event specific data */
3192         uint32_t        event_data2;
3193         uint8_t opaque_v;
3194         /*
3195          * This value is written by the NIC such that it will be different
3196          * for each pass through the completion queue.   The even passes
3197          * will write 1.  The odd passes will write 0.
3198          */
3199         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
3200         /* opaque is 7 b */
3201         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
3202         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
3203         /* 8-lsb timestamp from POR (100-msec resolution) */
3204         uint8_t timestamp_lo;
3205         /* 16-lsb timestamp from POR (100-msec resolution) */
3206         uint16_t        timestamp_hi;
3207         /* Event specific data */
3208         uint32_t        event_data1;
3209 } __attribute__((packed));
3210
3211 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
3212 struct hwrm_async_event_cmpl_link_status_change {
3213         uint16_t        type;
3214         /*
3215          * This field indicates the exact type of the completion.
3216          * By convention, the LSB identifies the length of the
3217          * record in 16B units.  Even values indicate 16B
3218          * records.  Odd values indicate 32B
3219          * records.
3220          */
3221         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
3222                 UINT32_C(0x3f)
3223         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
3224         /* HWRM Asynchronous Event Information */
3225         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
3226                 UINT32_C(0x2e)
3227         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
3228                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
3229         /* Identifiers of events. */
3230         uint16_t        event_id;
3231         /* Link status changed */
3232         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
3233                 UINT32_C(0x0)
3234         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
3235                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
3236         /* Event specific data */
3237         uint32_t        event_data2;
3238         uint8_t opaque_v;
3239         /*
3240          * This value is written by the NIC such that it will be different
3241          * for each pass through the completion queue.   The even passes
3242          * will write 1.  The odd passes will write 0.
3243          */
3244         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
3245                 UINT32_C(0x1)
3246         /* opaque is 7 b */
3247         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
3248                 UINT32_C(0xfe)
3249         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
3250         /* 8-lsb timestamp from POR (100-msec resolution) */
3251         uint8_t timestamp_lo;
3252         /* 16-lsb timestamp from POR (100-msec resolution) */
3253         uint16_t        timestamp_hi;
3254         /* Event specific data */
3255         uint32_t        event_data1;
3256         /* Indicates link status change */
3257         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
3258                 UINT32_C(0x1)
3259         /*
3260          * If this bit set to 0, then it indicates that the link
3261          * was up and it went down.
3262          */
3263         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
3264                 UINT32_C(0x0)
3265         /*
3266          * If this bit is set to 1, then it indicates that the link
3267          * was down and it went up.
3268          */
3269         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
3270                 UINT32_C(0x1)
3271         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
3272                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
3273         /* Indicates the physical port this link status change occur */
3274         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
3275                 UINT32_C(0xe)
3276         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
3277                 1
3278         /* PORT ID */
3279         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
3280                 UINT32_C(0xffff0)
3281         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
3282                 4
3283 } __attribute__((packed));
3284
3285 /*******************
3286  * hwrm_func_reset *
3287  *******************/
3288
3289
3290 /* hwrm_func_reset_input (size:192b/24B) */
3291 struct hwrm_func_reset_input {
3292         /* The HWRM command request type. */
3293         uint16_t        req_type;
3294         /*
3295          * The completion ring to send the completion event on. This should
3296          * be the NQ ID returned from the `nq_alloc` HWRM command.
3297          */
3298         uint16_t        cmpl_ring;
3299         /*
3300          * The sequence ID is used by the driver for tracking multiple
3301          * commands. This ID is treated as opaque data by the firmware and
3302          * the value is returned in the `hwrm_resp_hdr` upon completion.
3303          */
3304         uint16_t        seq_id;
3305         /*
3306          * The target ID of the command:
3307          * * 0x0-0xFFF8 - The function ID
3308          * * 0xFFF8-0xFFFE - Reserved for internal processors
3309          * * 0xFFFF - HWRM
3310          */
3311         uint16_t        target_id;
3312         /*
3313          * A physical address pointer pointing to a host buffer that the
3314          * command's response data will be written. This can be either a host
3315          * physical address (HPA) or a guest physical address (GPA) and must
3316          * point to a physically contiguous block of memory.
3317          */
3318         uint64_t        resp_addr;
3319         uint32_t        enables;
3320         /*
3321          * This bit must be '1' for the vf_id_valid field to be
3322          * configured.
3323          */
3324         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
3325         /*
3326          * The ID of the VF that this PF is trying to reset.
3327          * Only the parent PF shall be allowed to reset a child VF.
3328          *
3329          * A parent PF driver shall use this field only when a specific child VF
3330          * is requested to be reset.
3331          */
3332         uint16_t        vf_id;
3333         /* This value indicates the level of a function reset. */
3334         uint8_t func_reset_level;
3335         /*
3336          * Reset the caller function and its children VFs (if any). If no
3337          * children functions exist, then reset the caller function only.
3338          */
3339         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
3340                 UINT32_C(0x0)
3341         /* Reset the caller function only */
3342         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
3343                 UINT32_C(0x1)
3344         /*
3345          * Reset all children VFs of the caller function driver if the
3346          * caller is a PF driver.
3347          * It is an error to specify this level by a VF driver.
3348          * It is an error to specify this level by a PF driver with
3349          * no children VFs.
3350          */
3351         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
3352                 UINT32_C(0x2)
3353         /*
3354          * Reset a specific VF of the caller function driver if the caller
3355          * is the parent PF driver.
3356          * It is an error to specify this level by a VF driver.
3357          * It is an error to specify this level by a PF driver that is not
3358          * the parent of the VF that is being requested to reset.
3359          */
3360         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
3361                 UINT32_C(0x3)
3362         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
3363                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
3364         uint8_t unused_0;
3365 } __attribute__((packed));
3366
3367 /* hwrm_func_reset_output (size:128b/16B) */
3368 struct hwrm_func_reset_output {
3369         /* The specific error status for the command. */
3370         uint16_t        error_code;
3371         /* The HWRM command request type. */
3372         uint16_t        req_type;
3373         /* The sequence ID from the original command. */
3374         uint16_t        seq_id;
3375         /* The length of the response data in number of bytes. */
3376         uint16_t        resp_len;
3377         uint8_t unused_0[7];
3378         /*
3379          * This field is used in Output records to indicate that the output
3380          * is completely written to RAM.  This field should be read as '1'
3381          * to indicate that the output has been completely written.
3382          * When writing a command completion or response to an internal processor,
3383          * the order of writes has to be such that this field is written last.
3384          */
3385         uint8_t valid;
3386 } __attribute__((packed));
3387
3388 /********************
3389  * hwrm_func_getfid *
3390  ********************/
3391
3392
3393 /* hwrm_func_getfid_input (size:192b/24B) */
3394 struct hwrm_func_getfid_input {
3395         /* The HWRM command request type. */
3396         uint16_t        req_type;
3397         /*
3398          * The completion ring to send the completion event on. This should
3399          * be the NQ ID returned from the `nq_alloc` HWRM command.
3400          */
3401         uint16_t        cmpl_ring;
3402         /*
3403          * The sequence ID is used by the driver for tracking multiple
3404          * commands. This ID is treated as opaque data by the firmware and
3405          * the value is returned in the `hwrm_resp_hdr` upon completion.
3406          */
3407         uint16_t        seq_id;
3408         /*
3409          * The target ID of the command:
3410          * * 0x0-0xFFF8 - The function ID
3411          * * 0xFFF8-0xFFFE - Reserved for internal processors
3412          * * 0xFFFF - HWRM
3413          */
3414         uint16_t        target_id;
3415         /*
3416          * A physical address pointer pointing to a host buffer that the
3417          * command's response data will be written. This can be either a host
3418          * physical address (HPA) or a guest physical address (GPA) and must
3419          * point to a physically contiguous block of memory.
3420          */
3421         uint64_t        resp_addr;
3422         uint32_t        enables;
3423         /*
3424          * This bit must be '1' for the pci_id field to be
3425          * configured.
3426          */
3427         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
3428         /*
3429          * This value is the PCI ID of the queried function.
3430          * If ARI is enabled, then it is
3431          * Bus Number (8b):Function Number(8b). Otherwise, it is
3432          * Bus Number (8b):Device Number (5b):Function Number(3b).
3433          */
3434         uint16_t        pci_id;
3435         uint8_t unused_0[2];
3436 } __attribute__((packed));
3437
3438 /* hwrm_func_getfid_output (size:128b/16B) */
3439 struct hwrm_func_getfid_output {
3440         /* The specific error status for the command. */
3441         uint16_t        error_code;
3442         /* The HWRM command request type. */
3443         uint16_t        req_type;
3444         /* The sequence ID from the original command. */
3445         uint16_t        seq_id;
3446         /* The length of the response data in number of bytes. */
3447         uint16_t        resp_len;
3448         /*
3449          * FID value.  This value is used to identify operations on the PCI
3450          * bus as belonging to a particular PCI function.
3451          */
3452         uint16_t        fid;
3453         uint8_t unused_0[5];
3454         /*
3455          * This field is used in Output records to indicate that the output
3456          * is completely written to RAM.  This field should be read as '1'
3457          * to indicate that the output has been completely written.
3458          * When writing a command completion or response to an internal processor,
3459          * the order of writes has to be such that this field is written last.
3460          */
3461         uint8_t valid;
3462 } __attribute__((packed));
3463
3464 /**********************
3465  * hwrm_func_vf_alloc *
3466  **********************/
3467
3468
3469 /* hwrm_func_vf_alloc_input (size:192b/24B) */
3470 struct hwrm_func_vf_alloc_input {
3471         /* The HWRM command request type. */
3472         uint16_t        req_type;
3473         /*
3474          * The completion ring to send the completion event on. This should
3475          * be the NQ ID returned from the `nq_alloc` HWRM command.
3476          */
3477         uint16_t        cmpl_ring;
3478         /*
3479          * The sequence ID is used by the driver for tracking multiple
3480          * commands. This ID is treated as opaque data by the firmware and
3481          * the value is returned in the `hwrm_resp_hdr` upon completion.
3482          */
3483         uint16_t        seq_id;
3484         /*
3485          * The target ID of the command:
3486          * * 0x0-0xFFF8 - The function ID
3487          * * 0xFFF8-0xFFFE - Reserved for internal processors
3488          * * 0xFFFF - HWRM
3489          */
3490         uint16_t        target_id;
3491         /*
3492          * A physical address pointer pointing to a host buffer that the
3493          * command's response data will be written. This can be either a host
3494          * physical address (HPA) or a guest physical address (GPA) and must
3495          * point to a physically contiguous block of memory.
3496          */
3497         uint64_t        resp_addr;
3498         uint32_t        enables;
3499         /*
3500          * This bit must be '1' for the first_vf_id field to be
3501          * configured.
3502          */
3503         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
3504         /*
3505          * This value is used to identify a Virtual Function (VF).
3506          * The scope of VF ID is local within a PF.
3507          */
3508         uint16_t        first_vf_id;
3509         /* The number of virtual functions requested. */
3510         uint16_t        num_vfs;
3511 } __attribute__((packed));
3512
3513 /* hwrm_func_vf_alloc_output (size:128b/16B) */
3514 struct hwrm_func_vf_alloc_output {
3515         /* The specific error status for the command. */
3516         uint16_t        error_code;
3517         /* The HWRM command request type. */
3518         uint16_t        req_type;
3519         /* The sequence ID from the original command. */
3520         uint16_t        seq_id;
3521         /* The length of the response data in number of bytes. */
3522         uint16_t        resp_len;
3523         /* The ID of the first VF allocated. */
3524         uint16_t        first_vf_id;
3525         uint8_t unused_0[5];
3526         /*
3527          * This field is used in Output records to indicate that the output
3528          * is completely written to RAM.  This field should be read as '1'
3529          * to indicate that the output has been completely written.
3530          * When writing a command completion or response to an internal processor,
3531          * the order of writes has to be such that this field is written last.
3532          */
3533         uint8_t valid;
3534 } __attribute__((packed));
3535
3536 /*********************
3537  * hwrm_func_vf_free *
3538  *********************/
3539
3540
3541 /* hwrm_func_vf_free_input (size:192b/24B) */
3542 struct hwrm_func_vf_free_input {
3543         /* The HWRM command request type. */
3544         uint16_t        req_type;
3545         /*
3546          * The completion ring to send the completion event on. This should
3547          * be the NQ ID returned from the `nq_alloc` HWRM command.
3548          */
3549         uint16_t        cmpl_ring;
3550         /*
3551          * The sequence ID is used by the driver for tracking multiple
3552          * commands. This ID is treated as opaque data by the firmware and
3553          * the value is returned in the `hwrm_resp_hdr` upon completion.
3554          */
3555         uint16_t        seq_id;
3556         /*
3557          * The target ID of the command:
3558          * * 0x0-0xFFF8 - The function ID
3559          * * 0xFFF8-0xFFFE - Reserved for internal processors
3560          * * 0xFFFF - HWRM
3561          */
3562         uint16_t        target_id;
3563         /*
3564          * A physical address pointer pointing to a host buffer that the
3565          * command's response data will be written. This can be either a host
3566          * physical address (HPA) or a guest physical address (GPA) and must
3567          * point to a physically contiguous block of memory.
3568          */
3569         uint64_t        resp_addr;
3570         uint32_t        enables;
3571         /*
3572          * This bit must be '1' for the first_vf_id field to be
3573          * configured.
3574          */
3575         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
3576         /*
3577          * This value is used to identify a Virtual Function (VF).
3578          * The scope of VF ID is local within a PF.
3579          */
3580         uint16_t        first_vf_id;
3581         /*
3582          * The number of virtual functions requested.
3583          * 0xFFFF - Cleanup all children of this PF.
3584          */
3585         uint16_t        num_vfs;
3586 } __attribute__((packed));
3587
3588 /* hwrm_func_vf_free_output (size:128b/16B) */
3589 struct hwrm_func_vf_free_output {
3590         /* The specific error status for the command. */
3591         uint16_t        error_code;
3592         /* The HWRM command request type. */
3593         uint16_t        req_type;
3594         /* The sequence ID from the original command. */
3595         uint16_t        seq_id;
3596         /* The length of the response data in number of bytes. */
3597         uint16_t        resp_len;
3598         uint8_t unused_0[7];
3599         /*
3600          * This field is used in Output records to indicate that the output
3601          * is completely written to RAM.  This field should be read as '1'
3602          * to indicate that the output has been completely written.
3603          * When writing a command completion or response to an internal processor,
3604          * the order of writes has to be such that this field is written last.
3605          */
3606         uint8_t valid;
3607 } __attribute__((packed));
3608
3609 /********************
3610  * hwrm_func_vf_cfg *
3611  ********************/
3612
3613
3614 /* hwrm_func_vf_cfg_input (size:448b/56B) */
3615 struct hwrm_func_vf_cfg_input {
3616         /* The HWRM command request type. */
3617         uint16_t        req_type;
3618         /*
3619          * The completion ring to send the completion event on. This should
3620          * be the NQ ID returned from the `nq_alloc` HWRM command.
3621          */
3622         uint16_t        cmpl_ring;
3623         /*
3624          * The sequence ID is used by the driver for tracking multiple
3625          * commands. This ID is treated as opaque data by the firmware and
3626          * the value is returned in the `hwrm_resp_hdr` upon completion.
3627          */
3628         uint16_t        seq_id;
3629         /*
3630          * The target ID of the command:
3631          * * 0x0-0xFFF8 - The function ID
3632          * * 0xFFF8-0xFFFE - Reserved for internal processors
3633          * * 0xFFFF - HWRM
3634          */
3635         uint16_t        target_id;
3636         /*
3637          * A physical address pointer pointing to a host buffer that the
3638          * command's response data will be written. This can be either a host
3639          * physical address (HPA) or a guest physical address (GPA) and must
3640          * point to a physically contiguous block of memory.
3641          */
3642         uint64_t        resp_addr;
3643         uint32_t        enables;
3644         /*
3645          * This bit must be '1' for the mtu field to be
3646          * configured.
3647          */
3648         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
3649                 UINT32_C(0x1)
3650         /*
3651          * This bit must be '1' for the guest_vlan field to be
3652          * configured.
3653          */
3654         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
3655                 UINT32_C(0x2)
3656         /*
3657          * This bit must be '1' for the async_event_cr field to be
3658          * configured.
3659          */
3660         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
3661                 UINT32_C(0x4)
3662         /*
3663          * This bit must be '1' for the dflt_mac_addr field to be
3664          * configured.
3665          */
3666         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
3667                 UINT32_C(0x8)
3668         /*
3669          * This bit must be '1' for the num_rsscos_ctxs field to be
3670          * configured.
3671          */
3672         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
3673                 UINT32_C(0x10)
3674         /*
3675          * This bit must be '1' for the num_cmpl_rings field to be
3676          * configured.
3677          */
3678         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
3679                 UINT32_C(0x20)
3680         /*
3681          * This bit must be '1' for the num_tx_rings field to be
3682          * configured.
3683          */
3684         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
3685                 UINT32_C(0x40)
3686         /*
3687          * This bit must be '1' for the num_rx_rings field to be
3688          * configured.
3689          */
3690         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
3691                 UINT32_C(0x80)
3692         /*
3693          * This bit must be '1' for the num_l2_ctxs field to be
3694          * configured.
3695          */
3696         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
3697                 UINT32_C(0x100)
3698         /*
3699          * This bit must be '1' for the num_vnics field to be
3700          * configured.
3701          */
3702         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
3703                 UINT32_C(0x200)
3704         /*
3705          * This bit must be '1' for the num_stat_ctxs field to be
3706          * configured.
3707          */
3708         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
3709                 UINT32_C(0x400)
3710         /*
3711          * This bit must be '1' for the num_hw_ring_grps field to be
3712          * configured.
3713          */
3714         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
3715                 UINT32_C(0x800)
3716         /*
3717          * The maximum transmission unit requested on the function.
3718          * The HWRM should make sure that the mtu of
3719          * the function does not exceed the mtu of the physical
3720          * port that this function is associated with.
3721          *
3722          * In addition to requesting mtu per function, it is
3723          * possible to configure mtu per transmit ring.
3724          * By default, the mtu of each transmit ring associated
3725          * with a function is equal to the mtu of the function.
3726          * The HWRM should make sure that the mtu of each transmit
3727          * ring that is assigned to a function has a valid mtu.
3728          */
3729         uint16_t        mtu;
3730         /*
3731          * The guest VLAN for the function being configured.
3732          * This field's format is same as 802.1Q Tag's
3733          * Tag Control Information (TCI) format that includes both
3734          * Priority Code Point (PCP) and VLAN Identifier (VID).
3735          */
3736         uint16_t        guest_vlan;
3737         /*
3738          * ID of the target completion ring for receiving asynchronous
3739          * event completions. If this field is not valid, then the
3740          * HWRM shall use the default completion ring of the function
3741          * that is being configured as the target completion ring for
3742          * providing any asynchronous event completions for that
3743          * function.
3744          * If this field is valid, then the HWRM shall use the
3745          * completion ring identified by this ID as the target
3746          * completion ring for providing any asynchronous event
3747          * completions for the function that is being configured.
3748          */
3749         uint16_t        async_event_cr;
3750         /*
3751          * This value is the current MAC address requested by the VF
3752          * driver to be configured on this VF. A value of
3753          * 00-00-00-00-00-00 indicates no MAC address configuration
3754          * is requested by the VF driver.
3755          * The parent PF driver may reject or overwrite this
3756          * MAC address.
3757          */
3758         uint8_t dflt_mac_addr[6];
3759         uint32_t        flags;
3760         /*
3761          * This bit requests that the firmware test to see if all the assets
3762          * requested in this command (i.e. number of TX rings) are available.
3763          * The firmware will return an error if the requested assets are
3764          * not available. The firwmare will NOT reserve the assets if they
3765          * are available.
3766          */
3767         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
3768                 UINT32_C(0x1)
3769         /*
3770          * This bit requests that the firmware test to see if all the assets
3771          * requested in this command (i.e. number of RX rings) are available.
3772          * The firmware will return an error if the requested assets are
3773          * not available. The firwmare will NOT reserve the assets if they
3774          * are available.
3775          */
3776         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
3777                 UINT32_C(0x2)
3778         /*
3779          * This bit requests that the firmware test to see if all the assets
3780          * requested in this command (i.e. number of CMPL rings) are available.
3781          * The firmware will return an error if the requested assets are
3782          * not available. The firwmare will NOT reserve the assets if they
3783          * are available.
3784          */
3785         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
3786                 UINT32_C(0x4)
3787         /*
3788          * This bit requests that the firmware test to see if all the assets
3789          * requested in this command (i.e. number of RSS ctx) are available.
3790          * The firmware will return an error if the requested assets are
3791          * not available. The firwmare will NOT reserve the assets if they
3792          * are available.
3793          */
3794         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
3795                 UINT32_C(0x8)
3796         /*
3797          * This bit requests that the firmware test to see if all the assets
3798          * requested in this command (i.e. number of ring groups) are available.
3799          * The firmware will return an error if the requested assets are
3800          * not available. The firwmare will NOT reserve the assets if they
3801          * are available.
3802          */
3803         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
3804                 UINT32_C(0x10)
3805         /*
3806          * This bit requests that the firmware test to see if all the assets
3807          * requested in this command (i.e. number of stat ctx) are available.
3808          * The firmware will return an error if the requested assets are
3809          * not available. The firwmare will NOT reserve the assets if they
3810          * are available.
3811          */
3812         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
3813                 UINT32_C(0x20)
3814         /*
3815          * This bit requests that the firmware test to see if all the assets
3816          * requested in this command (i.e. number of VNICs) are available.
3817          * The firmware will return an error if the requested assets are
3818          * not available. The firwmare will NOT reserve the assets if they
3819          * are available.
3820          */
3821         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
3822                 UINT32_C(0x40)
3823         /*
3824          * This bit requests that the firmware test to see if all the assets
3825          * requested in this command (i.e. number of L2 ctx) are available.
3826          * The firmware will return an error if the requested assets are
3827          * not available. The firwmare will NOT reserve the assets if they
3828          * are available.
3829          */
3830         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
3831                 UINT32_C(0x80)
3832         /* The number of RSS/COS contexts requested for the VF. */
3833         uint16_t        num_rsscos_ctxs;
3834         /* The number of completion rings requested for the VF. */
3835         uint16_t        num_cmpl_rings;
3836         /* The number of transmit rings requested for the VF. */
3837         uint16_t        num_tx_rings;
3838         /* The number of receive rings requested for the VF. */
3839         uint16_t        num_rx_rings;
3840         /* The number of L2 contexts requested for the VF. */
3841         uint16_t        num_l2_ctxs;
3842         /* The number of vnics requested for the VF. */
3843         uint16_t        num_vnics;
3844         /* The number of statistic contexts requested for the VF. */
3845         uint16_t        num_stat_ctxs;
3846         /* The number of HW ring groups requested for the VF. */
3847         uint16_t        num_hw_ring_grps;
3848         uint8_t unused_0[4];
3849 } __attribute__((packed));
3850
3851 /* hwrm_func_vf_cfg_output (size:128b/16B) */
3852 struct hwrm_func_vf_cfg_output {
3853         /* The specific error status for the command. */
3854         uint16_t        error_code;
3855         /* The HWRM command request type. */
3856         uint16_t        req_type;
3857         /* The sequence ID from the original command. */
3858         uint16_t        seq_id;
3859         /* The length of the response data in number of bytes. */
3860         uint16_t        resp_len;
3861         uint8_t unused_0[7];
3862         /*
3863          * This field is used in Output records to indicate that the output
3864          * is completely written to RAM.  This field should be read as '1'
3865          * to indicate that the output has been completely written.
3866          * When writing a command completion or response to an internal processor,
3867          * the order of writes has to be such that this field is written last.
3868          */
3869         uint8_t valid;
3870 } __attribute__((packed));
3871
3872 /*******************
3873  * hwrm_func_qcaps *
3874  *******************/
3875
3876
3877 /* hwrm_func_qcaps_input (size:192b/24B) */
3878 struct hwrm_func_qcaps_input {
3879         /* The HWRM command request type. */
3880         uint16_t        req_type;
3881         /*
3882          * The completion ring to send the completion event on. This should
3883          * be the NQ ID returned from the `nq_alloc` HWRM command.
3884          */
3885         uint16_t        cmpl_ring;
3886         /*
3887          * The sequence ID is used by the driver for tracking multiple
3888          * commands. This ID is treated as opaque data by the firmware and
3889          * the value is returned in the `hwrm_resp_hdr` upon completion.
3890          */
3891         uint16_t        seq_id;
3892         /*
3893          * The target ID of the command:
3894          * * 0x0-0xFFF8 - The function ID
3895          * * 0xFFF8-0xFFFE - Reserved for internal processors
3896          * * 0xFFFF - HWRM
3897          */
3898         uint16_t        target_id;
3899         /*
3900          * A physical address pointer pointing to a host buffer that the
3901          * command's response data will be written. This can be either a host
3902          * physical address (HPA) or a guest physical address (GPA) and must
3903          * point to a physically contiguous block of memory.
3904          */
3905         uint64_t        resp_addr;
3906         /*
3907          * Function ID of the function that is being queried.
3908          * 0xFF... (All Fs) if the query is for the requesting
3909          * function.
3910          */
3911         uint16_t        fid;
3912         uint8_t unused_0[6];
3913 } __attribute__((packed));
3914
3915 /* hwrm_func_qcaps_output (size:640b/80B) */
3916 struct hwrm_func_qcaps_output {
3917         /* The specific error status for the command. */
3918         uint16_t        error_code;
3919         /* The HWRM command request type. */
3920         uint16_t        req_type;
3921         /* The sequence ID from the original command. */
3922         uint16_t        seq_id;
3923         /* The length of the response data in number of bytes. */
3924         uint16_t        resp_len;
3925         /*
3926          * FID value.  This value is used to identify operations on the PCI
3927          * bus as belonging to a particular PCI function.
3928          */
3929         uint16_t        fid;
3930         /*
3931          * Port ID of port that this function is associated with.
3932          * Valid only for the PF.
3933          * 0xFF... (All Fs) if this function is not associated with
3934          * any port.
3935          * 0xFF... (All Fs) if this function is called from a VF.
3936          */
3937         uint16_t        port_id;
3938         uint32_t        flags;
3939         /* If 1, then Push mode is supported on this function. */
3940         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
3941                 UINT32_C(0x1)
3942         /*
3943          * If 1, then the global MSI-X auto-masking is enabled for the
3944          * device.
3945          */
3946         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
3947                 UINT32_C(0x2)
3948         /*
3949          * If 1, then the Precision Time Protocol (PTP) processing
3950          * is supported on this function.
3951          * The HWRM should enable PTP on only a single Physical
3952          * Function (PF) per port.
3953          */
3954         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
3955                 UINT32_C(0x4)
3956         /*
3957          * If 1, then RDMA over Converged Ethernet (RoCE) v1
3958          * is supported on this function.
3959          */
3960         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
3961                 UINT32_C(0x8)
3962         /*
3963          * If 1, then RDMA over Converged Ethernet (RoCE) v2
3964          * is supported on this function.
3965          */
3966         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
3967                 UINT32_C(0x10)
3968         /*
3969          * If 1, then control and configuration of WoL magic packet
3970          * are supported on this function.
3971          */
3972         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
3973                 UINT32_C(0x20)
3974         /*
3975          * If 1, then control and configuration of bitmap pattern
3976          * packet are supported on this function.
3977          */
3978         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
3979                 UINT32_C(0x40)
3980         /*
3981          * If set to 1, then the control and configuration of rate limit
3982          * of an allocated TX ring on the queried function is supported.
3983          */
3984         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
3985                 UINT32_C(0x80)
3986         /*
3987          * If 1, then control and configuration of minimum and
3988          * maximum bandwidths are supported on the queried function.
3989          */
3990         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
3991                 UINT32_C(0x100)
3992         /*
3993          * If the query is for a VF, then this flag shall be ignored.
3994          * If this query is for a PF and this flag is set to 1,
3995          * then the PF has the capability to set the rate limits
3996          * on the TX rings of its children VFs.
3997          * If this query is for a PF and this flag is set to 0, then
3998          * the PF does not have the capability to set the rate limits
3999          * on the TX rings of its children VFs.
4000          */
4001         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
4002                 UINT32_C(0x200)
4003         /*
4004          * If the query is for a VF, then this flag shall be ignored.
4005          * If this query is for a PF and this flag is set to 1,
4006          * then the PF has the capability to set the minimum and/or
4007          * maximum bandwidths for its children VFs.
4008          * If this query is for a PF and this flag is set to 0, then
4009          * the PF does not have the capability to set the minimum or
4010          * maximum bandwidths for its children VFs.
4011          */
4012         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
4013                 UINT32_C(0x400)
4014         /*
4015          * Standard TX Ring mode is used for the allocation of TX ring
4016          * and underlying scheduling resources that allow bandwidth
4017          * reservation and limit settings on the queried function.
4018          * If set to 1, then standard TX ring mode is supported
4019          * on the queried function.
4020          * If set to 0, then standard TX ring mode is not available
4021          * on the queried function.
4022          */
4023         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
4024                 UINT32_C(0x800)
4025         /*
4026          * If the query is for a VF, then this flag shall be ignored,
4027          * If this query is for a PF and this flag is set to 1,
4028          * then the PF has the capability to detect GENEVE tunnel
4029          * flags.
4030          */
4031         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
4032                 UINT32_C(0x1000)
4033         /*
4034          * If the query is for a VF, then this flag shall be ignored,
4035          * If this query is for a PF and this flag is set to 1,
4036          * then the PF has the capability to detect NVGRE tunnel
4037          * flags.
4038          */
4039         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
4040                 UINT32_C(0x2000)
4041         /*
4042          * If the query is for a VF, then this flag shall be ignored,
4043          * If this query is for a PF and this flag is set to 1,
4044          * then the PF has the capability to detect GRE tunnel
4045          * flags.
4046          */
4047         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
4048                 UINT32_C(0x4000)
4049         /*
4050          * If the query is for a VF, then this flag shall be ignored,
4051          * If this query is for a PF and this flag is set to 1,
4052          * then the PF has the capability to detect MPLS tunnel
4053          * flags.
4054          */
4055         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
4056                 UINT32_C(0x8000)
4057         /*
4058          * If the query is for a VF, then this flag shall be ignored,
4059          * If this query is for a PF and this flag is set to 1,
4060          * then the PF has the capability to support pcie stats.
4061          */
4062         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
4063                 UINT32_C(0x10000)
4064         /*
4065          * This value is current MAC address configured for this
4066          * function. A value of 00-00-00-00-00-00 indicates no
4067          * MAC address is currently configured.
4068          */
4069         uint8_t mac_address[6];
4070         /*
4071          * The maximum number of RSS/COS contexts that can be
4072          * allocated to the function.
4073          */
4074         uint16_t        max_rsscos_ctx;
4075         /*
4076          * The maximum number of completion rings that can be
4077          * allocated to the function.
4078          */
4079         uint16_t        max_cmpl_rings;
4080         /*
4081          * The maximum number of transmit rings that can be
4082          * allocated to the function.
4083          */
4084         uint16_t        max_tx_rings;
4085         /*
4086          * The maximum number of receive rings that can be
4087          * allocated to the function.
4088          */
4089         uint16_t        max_rx_rings;
4090         /*
4091          * The maximum number of L2 contexts that can be
4092          * allocated to the function.
4093          */
4094         uint16_t        max_l2_ctxs;
4095         /*
4096          * The maximum number of VNICs that can be
4097          * allocated to the function.
4098          */
4099         uint16_t        max_vnics;
4100         /*
4101          * The identifier for the first VF enabled on a PF. This
4102          * is valid only on the PF with SR-IOV enabled.
4103          * 0xFF... (All Fs) if this command is called on a PF with
4104          * SR-IOV disabled or on a VF.
4105          */
4106         uint16_t        first_vf_id;
4107         /*
4108          * The maximum number of VFs that can be
4109          * allocated to the function. This is valid only on the
4110          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
4111          * command is called on a PF with SR-IOV disabled or
4112          * on a VF.
4113          */
4114         uint16_t        max_vfs;
4115         /*
4116          * The maximum number of statistic contexts that can be
4117          * allocated to the function.
4118          */
4119         uint16_t        max_stat_ctx;
4120         /*
4121          * The maximum number of Encapsulation records that can be
4122          * offloaded by this function.
4123          */
4124         uint32_t        max_encap_records;
4125         /*
4126          * The maximum number of decapsulation records that can
4127          * be offloaded by this function.
4128          */
4129         uint32_t        max_decap_records;
4130         /*
4131          * The maximum number of Exact Match (EM) flows that can be
4132          * offloaded by this function on the TX side.
4133          */
4134         uint32_t        max_tx_em_flows;
4135         /*
4136          * The maximum number of Wildcard Match (WM) flows that can
4137          * be offloaded by this function on the TX side.
4138          */
4139         uint32_t        max_tx_wm_flows;
4140         /*
4141          * The maximum number of Exact Match (EM) flows that can be
4142          * offloaded by this function on the RX side.
4143          */
4144         uint32_t        max_rx_em_flows;
4145         /*
4146          * The maximum number of Wildcard Match (WM) flows that can
4147          * be offloaded by this function on the RX side.
4148          */
4149         uint32_t        max_rx_wm_flows;
4150         /*
4151          * The maximum number of multicast filters that can
4152          * be supported by this function on the RX side.
4153          */
4154         uint32_t        max_mcast_filters;
4155         /*
4156          * The maximum value of flow_id that can be supported
4157          * in completion records.
4158          */
4159         uint32_t        max_flow_id;
4160         /*
4161          * The maximum number of HW ring groups that can be
4162          * supported on this function.
4163          */
4164         uint32_t        max_hw_ring_grps;
4165         /*
4166          * The maximum number of strict priority transmit rings
4167          * that can be allocated to the function.
4168          * This number indicates the maximum number of TX rings
4169          * that can be assigned strict priorities out of the
4170          * maximum number of TX rings that can be allocated
4171          * (max_tx_rings) to the function.
4172          */
4173         uint16_t        max_sp_tx_rings;
4174         uint8_t unused_0;
4175         /*
4176          * This field is used in Output records to indicate that the output
4177          * is completely written to RAM.  This field should be read as '1'
4178          * to indicate that the output has been completely written.
4179          * When writing a command completion or response to an internal processor,
4180          * the order of writes has to be such that this field is written last.
4181          */
4182         uint8_t valid;
4183 } __attribute__((packed));
4184
4185 /******************
4186  * hwrm_func_qcfg *
4187  ******************/
4188
4189
4190 /* hwrm_func_qcfg_input (size:192b/24B) */
4191 struct hwrm_func_qcfg_input {
4192         /* The HWRM command request type. */
4193         uint16_t        req_type;
4194         /*
4195          * The completion ring to send the completion event on. This should
4196          * be the NQ ID returned from the `nq_alloc` HWRM command.
4197          */
4198         uint16_t        cmpl_ring;
4199         /*
4200          * The sequence ID is used by the driver for tracking multiple
4201          * commands. This ID is treated as opaque data by the firmware and
4202          * the value is returned in the `hwrm_resp_hdr` upon completion.
4203          */
4204         uint16_t        seq_id;
4205         /*
4206          * The target ID of the command:
4207          * * 0x0-0xFFF8 - The function ID
4208          * * 0xFFF8-0xFFFE - Reserved for internal processors
4209          * * 0xFFFF - HWRM
4210          */
4211         uint16_t        target_id;
4212         /*
4213          * A physical address pointer pointing to a host buffer that the
4214          * command's response data will be written. This can be either a host
4215          * physical address (HPA) or a guest physical address (GPA) and must
4216          * point to a physically contiguous block of memory.
4217          */
4218         uint64_t        resp_addr;
4219         /*
4220          * Function ID of the function that is being queried.
4221          * 0xFF... (All Fs) if the query is for the requesting
4222          * function.
4223          */
4224         uint16_t        fid;
4225         uint8_t unused_0[6];
4226 } __attribute__((packed));
4227
4228 /* hwrm_func_qcfg_output (size:640b/80B) */
4229 struct hwrm_func_qcfg_output {
4230         /* The specific error status for the command. */
4231         uint16_t        error_code;
4232         /* The HWRM command request type. */
4233         uint16_t        req_type;
4234         /* The sequence ID from the original command. */
4235         uint16_t        seq_id;
4236         /* The length of the response data in number of bytes. */
4237         uint16_t        resp_len;
4238         /*
4239          * FID value.  This value is used to identify operations on the PCI
4240          * bus as belonging to a particular PCI function.
4241          */
4242         uint16_t        fid;
4243         /*
4244          * Port ID of port that this function is associated with.
4245          * 0xFF... (All Fs) if this function is not associated with
4246          * any port.
4247          */
4248         uint16_t        port_id;
4249         /*
4250          * This value is the current VLAN setting for this
4251          * function. The value of 0 for this field indicates
4252          * no priority tagging or VLAN is used.
4253          * This field's format is same as 802.1Q Tag's
4254          * Tag Control Information (TCI) format that includes both
4255          * Priority Code Point (PCP) and VLAN Identifier (VID).
4256          */
4257         uint16_t        vlan;
4258         uint16_t        flags;
4259         /*
4260          * If 1, then magic packet based Out-Of-Box WoL is enabled on
4261          * the port associated with this function.
4262          */
4263         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
4264                 UINT32_C(0x1)
4265         /*
4266          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
4267          * on the port associated with this function.
4268          */
4269         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
4270                 UINT32_C(0x2)
4271         /*
4272          * If set to 1, then FW based DCBX agent is enabled and running on
4273          * the port associated with this function.
4274          * If set to 0, then DCBX agent is not running in the firmware.
4275          */
4276         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
4277                 UINT32_C(0x4)
4278         /*
4279          * Standard TX Ring mode is used for the allocation of TX ring
4280          * and underlying scheduling resources that allow bandwidth
4281          * reservation and limit settings on the queried function.
4282          * If set to 1, then standard TX ring mode is enabled
4283          * on the queried function.
4284          * If set to 0, then the standard TX ring mode is disabled
4285          * on the queried function. In this extended TX ring resource
4286          * mode, the minimum and maximum bandwidth settings are not
4287          * supported to allow the allocation of TX rings to span multiple
4288          * scheduler nodes.
4289          */
4290         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
4291                 UINT32_C(0x8)
4292         /*
4293          * If set to 1 then FW based LLDP agent is enabled and running on
4294          * the port associated with this function.
4295          * If set to 0 then the LLDP agent is not running in the firmware.
4296          */
4297         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
4298                 UINT32_C(0x10)
4299         /*
4300          * If set to 1, then multi-host mode is active for this function.
4301          * If set to 0, then multi-host mode is inactive for this function
4302          * or not applicable for this device.
4303          */
4304         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
4305                 UINT32_C(0x20)
4306         /*
4307          * This value is current MAC address configured for this
4308          * function. A value of 00-00-00-00-00-00 indicates no
4309          * MAC address is currently configured.
4310          */
4311         uint8_t mac_address[6];
4312         /*
4313          * This value is current PCI ID of this
4314          * function. If ARI is enabled, then it is
4315          * Bus Number (8b):Function Number(8b). Otherwise, it is
4316          * Bus Number (8b):Device Number (4b):Function Number(4b).
4317          * If multi-host mode is active, the 4 lsb will indicate
4318          * the PF index for this function.
4319          */
4320         uint16_t        pci_id;
4321         /*
4322          * The number of RSS/COS contexts currently
4323          * allocated to the function.
4324          */
4325         uint16_t        alloc_rsscos_ctx;
4326         /*
4327          * The number of completion rings currently allocated to
4328          * the function. This does not include the rings allocated
4329          * to any children functions if any.
4330          */
4331         uint16_t        alloc_cmpl_rings;
4332         /*
4333          * The number of transmit rings currently allocated to
4334          * the function. This does not include the rings allocated
4335          * to any children functions if any.
4336          */
4337         uint16_t        alloc_tx_rings;
4338         /*
4339          * The number of receive rings currently allocated to
4340          * the function. This does not include the rings allocated
4341          * to any children functions if any.
4342          */
4343         uint16_t        alloc_rx_rings;
4344         /* The allocated number of L2 contexts to the function. */
4345         uint16_t        alloc_l2_ctx;
4346         /* The allocated number of vnics to the function. */
4347         uint16_t        alloc_vnics;
4348         /*
4349          * The maximum transmission unit of the function.
4350          * For rings allocated on this function, this default
4351          * value is used if ring MTU is not specified.
4352          */
4353         uint16_t        mtu;
4354         /*
4355          * The maximum receive unit of the function.
4356          * For vnics allocated on this function, this default
4357          * value is used if vnic MRU is not specified.
4358          */
4359         uint16_t        mru;
4360         /* The statistics context assigned to a function. */
4361         uint16_t        stat_ctx_id;
4362         /*
4363          * The HWRM shall return Unknown value for this field
4364          * when this command is used to query VF's configuration.
4365          */
4366         uint8_t port_partition_type;
4367         /* Single physical function */
4368         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
4369         /* Multiple physical functions */
4370         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
4371         /* Network Partitioning 1.0 */
4372         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
4373         /* Network Partitioning 1.5 */
4374         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
4375         /* Network Partitioning 2.0 */
4376         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
4377         /* Unknown */
4378         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
4379                 UINT32_C(0xff)
4380         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
4381                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
4382         /*
4383          * This field will indicate number of physical functions on this port_partition.
4384          * HWRM shall return unavail (i.e. value of 0) for this field
4385          * when this command is used to query VF's configuration or
4386          * from older firmware that doesn't support this field.
4387          */
4388         uint8_t port_pf_cnt;
4389         /* number of PFs is not available */
4390         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
4391         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
4392                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
4393         /*
4394          * The default VNIC ID assigned to a function that is
4395          * being queried.
4396          */
4397         uint16_t        dflt_vnic_id;
4398         uint16_t        max_mtu_configured;
4399         /*
4400          * Minimum BW allocated for this function.
4401          * The HWRM will translate this value into byte counter and
4402          * time interval used for the scheduler inside the device.
4403          * A value of 0 indicates the minimum bandwidth is not
4404          * configured.
4405          */
4406         uint32_t        min_bw;
4407         /* The bandwidth value. */
4408         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
4409                 UINT32_C(0xfffffff)
4410         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
4411         /* The granularity of the value (bits or bytes). */
4412         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
4413                 UINT32_C(0x10000000)
4414         /* Value is in bits. */
4415         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
4416                 (UINT32_C(0x0) << 28)
4417         /* Value is in bytes. */
4418         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
4419                 (UINT32_C(0x1) << 28)
4420         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
4421                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
4422         /* bw_value_unit is 3 b */
4423         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
4424                 UINT32_C(0xe0000000)
4425         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
4426         /* Value is in Mb or MB (base 10). */
4427         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
4428                 (UINT32_C(0x0) << 29)
4429         /* Value is in Kb or KB (base 10). */
4430         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
4431                 (UINT32_C(0x2) << 29)
4432         /* Value is in bits or bytes. */
4433         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
4434                 (UINT32_C(0x4) << 29)
4435         /* Value is in Gb or GB (base 10). */
4436         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
4437                 (UINT32_C(0x6) << 29)
4438         /* Value is in 1/100th of a percentage of total bandwidth. */
4439         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
4440                 (UINT32_C(0x1) << 29)
4441         /* Invalid unit */
4442         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
4443                 (UINT32_C(0x7) << 29)
4444         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
4445                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
4446         /*
4447          * Maximum BW allocated for this function.
4448          * The HWRM will translate this value into byte counter and
4449          * time interval used for the scheduler inside the device.
4450          * A value of 0 indicates that the maximum bandwidth is not
4451          * configured.
4452          */
4453         uint32_t        max_bw;
4454         /* The bandwidth value. */
4455         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
4456                 UINT32_C(0xfffffff)
4457         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
4458         /* The granularity of the value (bits or bytes). */
4459         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
4460                 UINT32_C(0x10000000)
4461         /* Value is in bits. */
4462         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
4463                 (UINT32_C(0x0) << 28)
4464         /* Value is in bytes. */
4465         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
4466                 (UINT32_C(0x1) << 28)
4467         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
4468                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
4469         /* bw_value_unit is 3 b */
4470         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
4471                 UINT32_C(0xe0000000)
4472         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
4473         /* Value is in Mb or MB (base 10). */
4474         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
4475                 (UINT32_C(0x0) << 29)
4476         /* Value is in Kb or KB (base 10). */
4477         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
4478                 (UINT32_C(0x2) << 29)
4479         /* Value is in bits or bytes. */
4480         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
4481                 (UINT32_C(0x4) << 29)
4482         /* Value is in Gb or GB (base 10). */
4483         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
4484                 (UINT32_C(0x6) << 29)
4485         /* Value is in 1/100th of a percentage of total bandwidth. */
4486         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
4487                 (UINT32_C(0x1) << 29)
4488         /* Invalid unit */
4489         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
4490                 (UINT32_C(0x7) << 29)
4491         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
4492                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
4493         /*
4494          * This value indicates the Edge virtual bridge mode for the
4495          * domain that this function belongs to.
4496          */
4497         uint8_t evb_mode;
4498         /* No Edge Virtual Bridging (EVB) */
4499         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
4500         /* Virtual Ethernet Bridge (VEB) */
4501         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
4502         /* Virtual Ethernet Port Aggregator (VEPA) */
4503         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
4504         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
4505                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
4506         uint8_t options;
4507         /*
4508          * This value indicates the PCIE device cache line size.
4509          * The cache line size allows the DMA writes to terminate and
4510          * start at the cache boundary.
4511          */
4512         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
4513                 UINT32_C(0x3)
4514         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT     0
4515         /* Cache Line Size 64 bytes */
4516         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
4517                 UINT32_C(0x0)
4518         /* Cache Line Size 128 bytes */
4519         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
4520                 UINT32_C(0x1)
4521         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
4522                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
4523         /* Reserved for future. */
4524         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
4525                 UINT32_C(0xfc)
4526         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT               2
4527         /*
4528          * The number of VFs that are allocated to the function.
4529          * This is valid only on the PF with SR-IOV enabled.
4530          * 0xFF... (All Fs) if this command is called on a PF with
4531          * SR-IOV disabled or on a VF.
4532          */
4533         uint16_t        alloc_vfs;
4534         /*
4535          * The number of allocated multicast filters for this
4536          * function on the RX side.
4537          */
4538         uint32_t        alloc_mcast_filters;
4539         /*
4540          * The number of allocated HW ring groups for this
4541          * function.
4542          */
4543         uint32_t        alloc_hw_ring_grps;
4544         /*
4545          * The number of strict priority transmit rings out of
4546          * currently allocated TX rings to the function
4547          * (alloc_tx_rings).
4548          */
4549         uint16_t        alloc_sp_tx_rings;
4550         /*
4551          * The number of statistics contexts
4552          * currently reserved for the function.
4553          */
4554         uint16_t        alloc_stat_ctx;
4555         /*
4556          * This field specifies how many NQs are reserved for the PF.
4557          * Remaining NQs that belong to the PF are available for VFs.
4558          * Once a PF has created VFs, it cannot change how many NQs are
4559          * reserved for itself (since the NQs must be contiguous in HW).
4560          */
4561         uint16_t        alloc_msix;
4562         uint8_t unused_2[5];
4563         /*
4564          * This field is used in Output records to indicate that the output
4565          * is completely written to RAM.  This field should be read as '1'
4566          * to indicate that the output has been completely written.
4567          * When writing a command completion or response to an internal processor,
4568          * the order of writes has to be such that this field is written last.
4569          */
4570         uint8_t valid;
4571 } __attribute__((packed));
4572
4573 /***********************
4574  * hwrm_func_vlan_qcfg *
4575  ***********************/
4576
4577
4578 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
4579 struct hwrm_func_vlan_qcfg_input {
4580         /* The HWRM command request type. */
4581         uint16_t        req_type;
4582         /*
4583          * The completion ring to send the completion event on. This should
4584          * be the NQ ID returned from the `nq_alloc` HWRM command.
4585          */
4586         uint16_t        cmpl_ring;
4587         /*
4588          * The sequence ID is used by the driver for tracking multiple
4589          * commands. This ID is treated as opaque data by the firmware and
4590          * the value is returned in the `hwrm_resp_hdr` upon completion.
4591          */
4592         uint16_t        seq_id;
4593         /*
4594          * The target ID of the command:
4595          * * 0x0-0xFFF8 - The function ID
4596          * * 0xFFF8-0xFFFE - Reserved for internal processors
4597          * * 0xFFFF - HWRM
4598          */
4599         uint16_t        target_id;
4600         /*
4601          * A physical address pointer pointing to a host buffer that the
4602          * command's response data will be written. This can be either a host
4603          * physical address (HPA) or a guest physical address (GPA) and must
4604          * point to a physically contiguous block of memory.
4605          */
4606         uint64_t        resp_addr;
4607         /*
4608          * Function ID of the function that is being
4609          * configured.
4610          * If set to 0xFF... (All Fs), then the configuration is
4611          * for the requesting function.
4612          */
4613         uint16_t        fid;
4614         uint8_t unused_0[6];
4615 } __attribute__((packed));
4616
4617 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
4618 struct hwrm_func_vlan_qcfg_output {
4619         /* The specific error status for the command. */
4620         uint16_t        error_code;
4621         /* The HWRM command request type. */
4622         uint16_t        req_type;
4623         /* The sequence ID from the original command. */
4624         uint16_t        seq_id;
4625         /* The length of the response data in number of bytes. */
4626         uint16_t        resp_len;
4627         uint8_t unused_0[7];
4628         /*
4629          * This field is used in Output records to indicate that the output
4630          * is completely written to RAM.  This field should be read as '1'
4631          * to indicate that the output has been completely written.
4632          * When writing a command completion or response to an internal processor,
4633          * the order of writes has to be such that this field is written last.
4634          */
4635         uint8_t valid;
4636         /* S-TAG VLAN identifier configured for the function. */
4637         uint16_t        stag_vid;
4638         /* S-TAG PCP value configured for the function. */
4639         uint8_t stag_pcp;
4640         uint8_t unused_1;
4641         /*
4642          * S-TAG TPID value configured for the function. This field is specified in
4643          * network byte order.
4644          */
4645         uint16_t        stag_tpid;
4646         /* C-TAG VLAN identifier configured for the function. */
4647         uint16_t        ctag_vid;
4648         /* C-TAG PCP value configured for the function. */
4649         uint8_t ctag_pcp;
4650         uint8_t unused_2;
4651         /*
4652          * C-TAG TPID value configured for the function. This field is specified in
4653          * network byte order.
4654          */
4655         uint16_t        ctag_tpid;
4656         /* Future use. */
4657         uint32_t        rsvd2;
4658         /* Future use. */
4659         uint32_t        rsvd3;
4660         uint32_t        unused_3;
4661 } __attribute__((packed));
4662
4663 /**********************
4664  * hwrm_func_vlan_cfg *
4665  **********************/
4666
4667
4668 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
4669 struct hwrm_func_vlan_cfg_input {
4670         /* The HWRM command request type. */
4671         uint16_t        req_type;
4672         /*
4673          * The completion ring to send the completion event on. This should
4674          * be the NQ ID returned from the `nq_alloc` HWRM command.
4675          */
4676         uint16_t        cmpl_ring;
4677         /*
4678          * The sequence ID is used by the driver for tracking multiple
4679          * commands. This ID is treated as opaque data by the firmware and
4680          * the value is returned in the `hwrm_resp_hdr` upon completion.
4681          */
4682         uint16_t        seq_id;
4683         /*
4684          * The target ID of the command:
4685          * * 0x0-0xFFF8 - The function ID
4686          * * 0xFFF8-0xFFFE - Reserved for internal processors
4687          * * 0xFFFF - HWRM
4688          */
4689         uint16_t        target_id;
4690         /*
4691          * A physical address pointer pointing to a host buffer that the
4692          * command's response data will be written. This can be either a host
4693          * physical address (HPA) or a guest physical address (GPA) and must
4694          * point to a physically contiguous block of memory.
4695          */
4696         uint64_t        resp_addr;
4697         /*
4698          * Function ID of the function that is being
4699          * configured.
4700          * If set to 0xFF... (All Fs), then the configuration is
4701          * for the requesting function.
4702          */
4703         uint16_t        fid;
4704         uint8_t unused_0[2];
4705         uint32_t        enables;
4706         /*
4707          * This bit must be '1' for the stag_vid field to be
4708          * configured.
4709          */
4710         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
4711         /*
4712          * This bit must be '1' for the ctag_vid field to be
4713          * configured.
4714          */
4715         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
4716         /*
4717          * This bit must be '1' for the stag_pcp field to be
4718          * configured.
4719          */
4720         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
4721         /*
4722          * This bit must be '1' for the ctag_pcp field to be
4723          * configured.
4724          */
4725         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
4726         /*
4727          * This bit must be '1' for the stag_tpid field to be
4728          * configured.
4729          */
4730         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
4731         /*
4732          * This bit must be '1' for the ctag_tpid field to be
4733          * configured.
4734          */
4735         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
4736         /* S-TAG VLAN identifier configured for the function. */
4737         uint16_t        stag_vid;
4738         /* S-TAG PCP value configured for the function. */
4739         uint8_t stag_pcp;
4740         uint8_t unused_1;
4741         /*
4742          * S-TAG TPID value configured for the function. This field is specified in
4743          * network byte order.
4744          */
4745         uint16_t        stag_tpid;
4746         /* C-TAG VLAN identifier configured for the function. */
4747         uint16_t        ctag_vid;
4748         /* C-TAG PCP value configured for the function. */
4749         uint8_t ctag_pcp;
4750         uint8_t unused_2;
4751         /*
4752          * C-TAG TPID value configured for the function. This field is specified in
4753          * network byte order.
4754          */
4755         uint16_t        ctag_tpid;
4756         /* Future use. */
4757         uint32_t        rsvd1;
4758         /* Future use. */
4759         uint32_t        rsvd2;
4760         uint8_t unused_3[4];
4761 } __attribute__((packed));
4762
4763 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
4764 struct hwrm_func_vlan_cfg_output {
4765         /* The specific error status for the command. */
4766         uint16_t        error_code;
4767         /* The HWRM command request type. */
4768         uint16_t        req_type;
4769         /* The sequence ID from the original command. */
4770         uint16_t        seq_id;
4771         /* The length of the response data in number of bytes. */
4772         uint16_t        resp_len;
4773         uint8_t unused_0[7];
4774         /*
4775          * This field is used in Output records to indicate that the output
4776          * is completely written to RAM.  This field should be read as '1'
4777          * to indicate that the output has been completely written.
4778          * When writing a command completion or response to an internal processor,
4779          * the order of writes has to be such that this field is written last.
4780          */
4781         uint8_t valid;
4782 } __attribute__((packed));
4783
4784 /*****************
4785  * hwrm_func_cfg *
4786  *****************/
4787
4788
4789 /* hwrm_func_cfg_input (size:704b/88B) */
4790 struct hwrm_func_cfg_input {
4791         /* The HWRM command request type. */
4792         uint16_t        req_type;
4793         /*
4794          * The completion ring to send the completion event on. This should
4795          * be the NQ ID returned from the `nq_alloc` HWRM command.
4796          */
4797         uint16_t        cmpl_ring;
4798         /*
4799          * The sequence ID is used by the driver for tracking multiple
4800          * commands. This ID is treated as opaque data by the firmware and
4801          * the value is returned in the `hwrm_resp_hdr` upon completion.
4802          */
4803         uint16_t        seq_id;
4804         /*
4805          * The target ID of the command:
4806          * * 0x0-0xFFF8 - The function ID
4807          * * 0xFFF8-0xFFFE - Reserved for internal processors
4808          * * 0xFFFF - HWRM
4809          */
4810         uint16_t        target_id;
4811         /*
4812          * A physical address pointer pointing to a host buffer that the
4813          * command's response data will be written. This can be either a host
4814          * physical address (HPA) or a guest physical address (GPA) and must
4815          * point to a physically contiguous block of memory.
4816          */
4817         uint64_t        resp_addr;
4818         /*
4819          * Function ID of the function that is being
4820          * configured.
4821          * If set to 0xFF... (All Fs), then the the configuration is
4822          * for the requesting function.
4823          */
4824         uint16_t        fid;
4825         /*
4826          * This field specifies how many NQs will be reserved for the PF.
4827          * Remaining NQs that belong to the PF become available for VFs.
4828          * Once a PF has created VFs, it cannot change how many NQs are
4829          * reserved for itself (since the NQs must be contiguous in HW).
4830          */
4831         uint16_t        num_msix;
4832         uint32_t        flags;
4833         /*
4834          * When this bit is '1', the function is disabled with
4835          * source MAC address check.
4836          * This is an anti-spoofing check. If this flag is set,
4837          * then the function shall be configured to disallow
4838          * transmission of frames with the source MAC address that
4839          * is configured for this function.
4840          */
4841         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
4842                 UINT32_C(0x1)
4843         /*
4844          * When this bit is '1', the function is enabled with
4845          * source MAC address check.
4846          * This is an anti-spoofing check. If this flag is set,
4847          * then the function shall be configured to allow
4848          * transmission of frames with the source MAC address that
4849          * is configured for this function.
4850          */
4851         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
4852                 UINT32_C(0x2)
4853         /* reserved. */
4854         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
4855                 UINT32_C(0x1fc)
4856         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
4857         /*
4858          * Standard TX Ring mode is used for the allocation of TX ring
4859          * and underlying scheduling resources that allow bandwidth
4860          * reservation and limit settings on the queried function.
4861          * If set to 1, then standard TX ring mode is requested to be
4862          * enabled on the function being configured.
4863          */
4864         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
4865                 UINT32_C(0x200)
4866         /*
4867          * Standard TX Ring mode is used for the allocation of TX ring
4868          * and underlying scheduling resources that allow bandwidth
4869          * reservation and limit settings on the queried function.
4870          * If set to 1, then the standard TX ring mode is requested to
4871          * be disabled on the function being configured. In this extended
4872          * TX ring resource mode, the minimum and maximum bandwidth settings
4873          * are not supported to allow the allocation of TX rings to
4874          * span multiple scheduler nodes.
4875          */
4876         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
4877                 UINT32_C(0x400)
4878         /*
4879          * If this bit is set, virtual mac address configured
4880          * in this command will be persistent over warm boot.
4881          */
4882         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
4883                 UINT32_C(0x800)
4884         /*
4885          * This bit only applies to the VF. If this bit is set, the statistic
4886          * context counters will not be cleared when the statistic context is freed
4887          * or a function reset is called on VF. This bit will be cleared when the PF
4888          * is unloaded or a function reset is called on the PF.
4889          */
4890         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
4891                 UINT32_C(0x1000)
4892         /*
4893          * This bit requests that the firmware test to see if all the assets
4894          * requested in this command (i.e. number of TX rings) are available.
4895          * The firmware will return an error if the requested assets are
4896          * not available. The firwmare will NOT reserve the assets if they
4897          * are available.
4898          */
4899         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
4900                 UINT32_C(0x2000)
4901         /*
4902          * This bit requests that the firmware test to see if all the assets
4903          * requested in this command (i.e. number of RX rings) are available.
4904          * The firmware will return an error if the requested assets are
4905          * not available. The firwmare will NOT reserve the assets if they
4906          * are available.
4907          */
4908         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
4909                 UINT32_C(0x4000)
4910         /*
4911          * This bit requests that the firmware test to see if all the assets
4912          * requested in this command (i.e. number of CMPL rings) are available.
4913          * The firmware will return an error if the requested assets are
4914          * not available. The firwmare will NOT reserve the assets if they
4915          * are available.
4916          */
4917         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
4918                 UINT32_C(0x8000)
4919         /*
4920          * This bit requests that the firmware test to see if all the assets
4921          * requested in this command (i.e. number of RSS ctx) are available.
4922          * The firmware will return an error if the requested assets are
4923          * not available. The firwmare will NOT reserve the assets if they
4924          * are available.
4925          */
4926         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
4927                 UINT32_C(0x10000)
4928         /*
4929          * This bit requests that the firmware test to see if all the assets
4930          * requested in this command (i.e. number of ring groups) are available.
4931          * The firmware will return an error if the requested assets are
4932          * not available. The firwmare will NOT reserve the assets if they
4933          * are available.
4934          */
4935         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
4936                 UINT32_C(0x20000)
4937         /*
4938          * This bit requests that the firmware test to see if all the assets
4939          * requested in this command (i.e. number of stat ctx) are available.
4940          * The firmware will return an error if the requested assets are
4941          * not available. The firwmare will NOT reserve the assets if they
4942          * are available.
4943          */
4944         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
4945                 UINT32_C(0x40000)
4946         /*
4947          * This bit requests that the firmware test to see if all the assets
4948          * requested in this command (i.e. number of VNICs) are available.
4949          * The firmware will return an error if the requested assets are
4950          * not available. The firwmare will NOT reserve the assets if they
4951          * are available.
4952          */
4953         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
4954                 UINT32_C(0x80000)
4955         /*
4956          * This bit requests that the firmware test to see if all the assets
4957          * requested in this command (i.e. number of L2 ctx) are available.
4958          * The firmware will return an error if the requested assets are
4959          * not available. The firwmare will NOT reserve the assets if they
4960          * are available.
4961          */
4962         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
4963                 UINT32_C(0x100000)
4964         uint32_t        enables;
4965         /*
4966          * This bit must be '1' for the mtu field to be
4967          * configured.
4968          */
4969         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
4970                 UINT32_C(0x1)
4971         /*
4972          * This bit must be '1' for the mru field to be
4973          * configured.
4974          */
4975         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
4976                 UINT32_C(0x2)
4977         /*
4978          * This bit must be '1' for the num_rsscos_ctxs field to be
4979          * configured.
4980          */
4981         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
4982                 UINT32_C(0x4)
4983         /*
4984          * This bit must be '1' for the num_cmpl_rings field to be
4985          * configured.
4986          */
4987         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
4988                 UINT32_C(0x8)
4989         /*
4990          * This bit must be '1' for the num_tx_rings field to be
4991          * configured.
4992          */
4993         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
4994                 UINT32_C(0x10)
4995         /*
4996          * This bit must be '1' for the num_rx_rings field to be
4997          * configured.
4998          */
4999         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
5000                 UINT32_C(0x20)
5001         /*
5002          * This bit must be '1' for the num_l2_ctxs field to be
5003          * configured.
5004          */
5005         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
5006                 UINT32_C(0x40)
5007         /*
5008          * This bit must be '1' for the num_vnics field to be
5009          * configured.
5010          */
5011         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
5012                 UINT32_C(0x80)
5013         /*
5014          * This bit must be '1' for the num_stat_ctxs field to be
5015          * configured.
5016          */
5017         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
5018                 UINT32_C(0x100)
5019         /*
5020          * This bit must be '1' for the dflt_mac_addr field to be
5021          * configured.
5022          */
5023         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
5024                 UINT32_C(0x200)
5025         /*
5026          * This bit must be '1' for the dflt_vlan field to be
5027          * configured.
5028          */
5029         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
5030                 UINT32_C(0x400)
5031         /*
5032          * This bit must be '1' for the dflt_ip_addr field to be
5033          * configured.
5034          */
5035         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
5036                 UINT32_C(0x800)
5037         /*
5038          * This bit must be '1' for the min_bw field to be
5039          * configured.
5040          */
5041         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
5042                 UINT32_C(0x1000)
5043         /*
5044          * This bit must be '1' for the max_bw field to be
5045          * configured.
5046          */
5047         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
5048                 UINT32_C(0x2000)
5049         /*
5050          * This bit must be '1' for the async_event_cr field to be
5051          * configured.
5052          */
5053         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
5054                 UINT32_C(0x4000)
5055         /*
5056          * This bit must be '1' for the vlan_antispoof_mode field to be
5057          * configured.
5058          */
5059         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
5060                 UINT32_C(0x8000)
5061         /*
5062          * This bit must be '1' for the allowed_vlan_pris field to be
5063          * configured.
5064          */
5065         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
5066                 UINT32_C(0x10000)
5067         /*
5068          * This bit must be '1' for the evb_mode field to be
5069          * configured.
5070          */
5071         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
5072                 UINT32_C(0x20000)
5073         /*
5074          * This bit must be '1' for the num_mcast_filters field to be
5075          * configured.
5076          */
5077         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
5078                 UINT32_C(0x40000)
5079         /*
5080          * This bit must be '1' for the num_hw_ring_grps field to be
5081          * configured.
5082          */
5083         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
5084                 UINT32_C(0x80000)
5085         /*
5086          * This bit must be '1' for the cache_linesize field to be
5087          * configured.
5088          */
5089         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
5090                 UINT32_C(0x100000)
5091         /*
5092          * This bit must be '1' for the num_msix field to be
5093          * configured.
5094          */
5095         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
5096                 UINT32_C(0x200000)
5097         /*
5098          * The maximum transmission unit of the function.
5099          * The HWRM should make sure that the mtu of
5100          * the function does not exceed the mtu of the physical
5101          * port that this function is associated with.
5102          *
5103          * In addition to configuring mtu per function, it is
5104          * possible to configure mtu per transmit ring.
5105          * By default, the mtu of each transmit ring associated
5106          * with a function is equal to the mtu of the function.
5107          * The HWRM should make sure that the mtu of each transmit
5108          * ring that is assigned to a function has a valid mtu.
5109          */
5110         uint16_t        mtu;
5111         /*
5112          * The maximum receive unit of the function.
5113          * The HWRM should make sure that the mru of
5114          * the function does not exceed the mru of the physical
5115          * port that this function is associated with.
5116          *
5117          * In addition to configuring mru per function, it is
5118          * possible to configure mru per vnic.
5119          * By default, the mru of each vnic associated
5120          * with a function is equal to the mru of the function.
5121          * The HWRM should make sure that the mru of each vnic
5122          * that is assigned to a function has a valid mru.
5123          */
5124         uint16_t        mru;
5125         /*
5126          * The number of RSS/COS contexts requested for the
5127          * function.
5128          */
5129         uint16_t        num_rsscos_ctxs;
5130         /*
5131          * The number of completion rings requested for the
5132          * function. This does not include the rings allocated
5133          * to any children functions if any.
5134          */
5135         uint16_t        num_cmpl_rings;
5136         /*
5137          * The number of transmit rings requested for the function.
5138          * This does not include the rings allocated to any
5139          * children functions if any.
5140          */
5141         uint16_t        num_tx_rings;
5142         /*
5143          * The number of receive rings requested for the function.
5144          * This does not include the rings allocated
5145          * to any children functions if any.
5146          */
5147         uint16_t        num_rx_rings;
5148         /* The requested number of L2 contexts for the function. */
5149         uint16_t        num_l2_ctxs;
5150         /* The requested number of vnics for the function. */
5151         uint16_t        num_vnics;
5152         /* The requested number of statistic contexts for the function. */
5153         uint16_t        num_stat_ctxs;
5154         /*
5155          * The number of HW ring groups that should
5156          * be reserved for this function.
5157          */
5158         uint16_t        num_hw_ring_grps;
5159         /* The default MAC address for the function being configured. */
5160         uint8_t dflt_mac_addr[6];
5161         /*
5162          * The default VLAN for the function being configured.
5163          * This field's format is same as 802.1Q Tag's
5164          * Tag Control Information (TCI) format that includes both
5165          * Priority Code Point (PCP) and VLAN Identifier (VID).
5166          */
5167         uint16_t        dflt_vlan;
5168         /*
5169          * The default IP address for the function being configured.
5170          * This address is only used in enabling source property check.
5171          */
5172         uint32_t        dflt_ip_addr[4];
5173         /*
5174          * Minimum BW allocated for this function.
5175          * The HWRM will translate this value into byte counter and
5176          * time interval used for the scheduler inside the device.
5177          */
5178         uint32_t        min_bw;
5179         /* The bandwidth value. */
5180         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
5181                 UINT32_C(0xfffffff)
5182         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
5183         /* The granularity of the value (bits or bytes). */
5184         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
5185                 UINT32_C(0x10000000)
5186         /* Value is in bits. */
5187         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
5188                 (UINT32_C(0x0) << 28)
5189         /* Value is in bytes. */
5190         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
5191                 (UINT32_C(0x1) << 28)
5192         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
5193                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
5194         /* bw_value_unit is 3 b */
5195         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
5196                 UINT32_C(0xe0000000)
5197         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
5198         /* Value is in Mb or MB (base 10). */
5199         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
5200                 (UINT32_C(0x0) << 29)
5201         /* Value is in Kb or KB (base 10). */
5202         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
5203                 (UINT32_C(0x2) << 29)
5204         /* Value is in bits or bytes. */
5205         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
5206                 (UINT32_C(0x4) << 29)
5207         /* Value is in Gb or GB (base 10). */
5208         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
5209                 (UINT32_C(0x6) << 29)
5210         /* Value is in 1/100th of a percentage of total bandwidth. */
5211         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
5212                 (UINT32_C(0x1) << 29)
5213         /* Invalid unit */
5214         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
5215                 (UINT32_C(0x7) << 29)
5216         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
5217                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
5218         /*
5219          * Maximum BW allocated for this function.
5220          * The HWRM will translate this value into byte counter and
5221          * time interval used for the scheduler inside the device.
5222          */
5223         uint32_t        max_bw;
5224         /* The bandwidth value. */
5225         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
5226                 UINT32_C(0xfffffff)
5227         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
5228         /* The granularity of the value (bits or bytes). */
5229         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
5230                 UINT32_C(0x10000000)
5231         /* Value is in bits. */
5232         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
5233                 (UINT32_C(0x0) << 28)
5234         /* Value is in bytes. */
5235         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
5236                 (UINT32_C(0x1) << 28)
5237         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
5238                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
5239         /* bw_value_unit is 3 b */
5240         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
5241                 UINT32_C(0xe0000000)
5242         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
5243         /* Value is in Mb or MB (base 10). */
5244         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
5245                 (UINT32_C(0x0) << 29)
5246         /* Value is in Kb or KB (base 10). */
5247         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
5248                 (UINT32_C(0x2) << 29)
5249         /* Value is in bits or bytes. */
5250         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
5251                 (UINT32_C(0x4) << 29)
5252         /* Value is in Gb or GB (base 10). */
5253         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
5254                 (UINT32_C(0x6) << 29)
5255         /* Value is in 1/100th of a percentage of total bandwidth. */
5256         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
5257                 (UINT32_C(0x1) << 29)
5258         /* Invalid unit */
5259         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
5260                 (UINT32_C(0x7) << 29)
5261         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
5262                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
5263         /*
5264          * ID of the target completion ring for receiving asynchronous
5265          * event completions. If this field is not valid, then the
5266          * HWRM shall use the default completion ring of the function
5267          * that is being configured as the target completion ring for
5268          * providing any asynchronous event completions for that
5269          * function.
5270          * If this field is valid, then the HWRM shall use the
5271          * completion ring identified by this ID as the target
5272          * completion ring for providing any asynchronous event
5273          * completions for the function that is being configured.
5274          */
5275         uint16_t        async_event_cr;
5276         /* VLAN Anti-spoofing mode. */
5277         uint8_t vlan_antispoof_mode;
5278         /* No VLAN anti-spoofing checks are enabled */
5279         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
5280                 UINT32_C(0x0)
5281         /* Validate VLAN against the configured VLAN(s) */
5282         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
5283                 UINT32_C(0x1)
5284         /* Insert VLAN if it does not exist, otherwise discard */
5285         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
5286                 UINT32_C(0x2)
5287         /* Insert VLAN if it does not exist, override VLAN if it exists */
5288         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
5289                 UINT32_C(0x3)
5290         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
5291                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
5292         /*
5293          * This bit field defines VLAN PRIs that are allowed on
5294          * this function.
5295          * If nth bit is set, then VLAN PRI n is allowed on this
5296          * function.
5297          */
5298         uint8_t allowed_vlan_pris;
5299         /*
5300          * The HWRM shall allow a PF driver to change EVB mode for the
5301          * partition it belongs to.
5302          * The HWRM shall not allow a VF driver to change the EVB mode.
5303          * The HWRM shall take into account the switching of EVB mode
5304          * from one to another and reconfigure hardware resources as
5305          * appropriately.
5306          * The switching from VEB to VEPA mode requires
5307          * the disabling of the loopback traffic. Additionally,
5308          * source knock outs are handled differently in VEB and VEPA
5309          * modes.
5310          */
5311         uint8_t evb_mode;
5312         /* No Edge Virtual Bridging (EVB) */
5313         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
5314         /* Virtual Ethernet Bridge (VEB) */
5315         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
5316         /* Virtual Ethernet Port Aggregator (VEPA) */
5317         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
5318         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
5319                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
5320         uint8_t options;
5321         /*
5322          * This value indicates the PCIE device cache line size.
5323          * The cache line size allows the DMA writes to terminate and
5324          * start at the cache boundary.
5325          */
5326         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
5327                 UINT32_C(0x3)
5328         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT     0
5329         /* Cache Line Size 64 bytes */
5330         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
5331                 UINT32_C(0x0)
5332         /* Cache Line Size 128 bytes */
5333         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
5334                 UINT32_C(0x1)
5335         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
5336                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
5337         /* Reserved for future. */
5338         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
5339                 UINT32_C(0xfc)
5340         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT               2
5341         /*
5342          * The number of multicast filters that should
5343          * be reserved for this function on the RX side.
5344          */
5345         uint16_t        num_mcast_filters;
5346 } __attribute__((packed));
5347
5348 /* hwrm_func_cfg_output (size:128b/16B) */
5349 struct hwrm_func_cfg_output {
5350         /* The specific error status for the command. */
5351         uint16_t        error_code;
5352         /* The HWRM command request type. */
5353         uint16_t        req_type;
5354         /* The sequence ID from the original command. */
5355         uint16_t        seq_id;
5356         /* The length of the response data in number of bytes. */
5357         uint16_t        resp_len;
5358         uint8_t unused_0[7];
5359         /*
5360          * This field is used in Output records to indicate that the output
5361          * is completely written to RAM.  This field should be read as '1'
5362          * to indicate that the output has been completely written.
5363          * When writing a command completion or response to an internal processor,
5364          * the order of writes has to be such that this field is written last.
5365          */
5366         uint8_t valid;
5367 } __attribute__((packed));
5368
5369 /********************
5370  * hwrm_func_qstats *
5371  ********************/
5372
5373
5374 /* hwrm_func_qstats_input (size:192b/24B) */
5375 struct hwrm_func_qstats_input {
5376         /* The HWRM command request type. */
5377         uint16_t        req_type;
5378         /*
5379          * The completion ring to send the completion event on. This should
5380          * be the NQ ID returned from the `nq_alloc` HWRM command.
5381          */
5382         uint16_t        cmpl_ring;
5383         /*
5384          * The sequence ID is used by the driver for tracking multiple
5385          * commands. This ID is treated as opaque data by the firmware and
5386          * the value is returned in the `hwrm_resp_hdr` upon completion.
5387          */
5388         uint16_t        seq_id;
5389         /*
5390          * The target ID of the command:
5391          * * 0x0-0xFFF8 - The function ID
5392          * * 0xFFF8-0xFFFE - Reserved for internal processors
5393          * * 0xFFFF - HWRM
5394          */
5395         uint16_t        target_id;
5396         /*
5397          * A physical address pointer pointing to a host buffer that the
5398          * command's response data will be written. This can be either a host
5399          * physical address (HPA) or a guest physical address (GPA) and must
5400          * point to a physically contiguous block of memory.
5401          */
5402         uint64_t        resp_addr;
5403         /*
5404          * Function ID of the function that is being queried.
5405          * 0xFF... (All Fs) if the query is for the requesting
5406          * function.
5407          */
5408         uint16_t        fid;
5409         uint8_t unused_0[6];
5410 } __attribute__((packed));
5411
5412 /* hwrm_func_qstats_output (size:1408b/176B) */
5413 struct hwrm_func_qstats_output {
5414         /* The specific error status for the command. */
5415         uint16_t        error_code;
5416         /* The HWRM command request type. */
5417         uint16_t        req_type;
5418         /* The sequence ID from the original command. */
5419         uint16_t        seq_id;
5420         /* The length of the response data in number of bytes. */
5421         uint16_t        resp_len;
5422         /* Number of transmitted unicast packets on the function. */
5423         uint64_t        tx_ucast_pkts;
5424         /* Number of transmitted multicast packets on the function. */
5425         uint64_t        tx_mcast_pkts;
5426         /* Number of transmitted broadcast packets on the function. */
5427         uint64_t        tx_bcast_pkts;
5428         /*
5429          * Number of transmitted packets that were discarded due to
5430          * internal NIC resource problems.  For transmit, this
5431          * can only happen if TMP is configured to allow dropping
5432          * in HOL blocking conditions, which is not a normal
5433          * configuration.
5434          */
5435         uint64_t        tx_discard_pkts;
5436         /*
5437          * Number of dropped packets on transmit path on the function.
5438          * These are packets that have been marked for drop by
5439          * the TE CFA block or are packets that exceeded the
5440          * transmit MTU limit for the function.
5441          */
5442         uint64_t        tx_drop_pkts;
5443         /* Number of transmitted bytes for unicast traffic on the function. */
5444         uint64_t        tx_ucast_bytes;
5445         /* Number of transmitted bytes for multicast traffic on the function. */
5446         uint64_t        tx_mcast_bytes;
5447         /* Number of transmitted bytes for broadcast traffic on the function. */
5448         uint64_t        tx_bcast_bytes;
5449         /* Number of received unicast packets on the function. */
5450         uint64_t        rx_ucast_pkts;
5451         /* Number of received multicast packets on the function. */
5452         uint64_t        rx_mcast_pkts;
5453         /* Number of received broadcast packets on the function. */
5454         uint64_t        rx_bcast_pkts;
5455         /*
5456          * Number of received packets that were discarded on the function
5457          * due to resource limitations.  This can happen for 3 reasons.
5458          * # The BD used for the packet has a bad format.
5459          * # There were no BDs available in the ring for the packet.
5460          * # There were no BDs available on-chip for the packet.
5461          */
5462         uint64_t        rx_discard_pkts;
5463         /*
5464          * Number of dropped packets on received path on the function.
5465          * These are packets that have been marked for drop by the
5466          * RE CFA.
5467          */
5468         uint64_t        rx_drop_pkts;
5469         /* Number of received bytes for unicast traffic on the function. */
5470         uint64_t        rx_ucast_bytes;
5471         /* Number of received bytes for multicast traffic on the function. */
5472         uint64_t        rx_mcast_bytes;
5473         /* Number of received bytes for broadcast traffic on the function. */
5474         uint64_t        rx_bcast_bytes;
5475         /* Number of aggregated unicast packets on the function. */
5476         uint64_t        rx_agg_pkts;
5477         /* Number of aggregated unicast bytes on the function. */
5478         uint64_t        rx_agg_bytes;
5479         /* Number of aggregation events on the function. */
5480         uint64_t        rx_agg_events;
5481         /* Number of aborted aggregations on the function. */
5482         uint64_t        rx_agg_aborts;
5483         uint8_t unused_0[7];
5484         /*
5485          * This field is used in Output records to indicate that the output
5486          * is completely written to RAM.  This field should be read as '1'
5487          * to indicate that the output has been completely written.
5488          * When writing a command completion or response to an internal processor,
5489          * the order of writes has to be such that this field is written last.
5490          */
5491         uint8_t valid;
5492 } __attribute__((packed));
5493
5494 /***********************
5495  * hwrm_func_clr_stats *
5496  ***********************/
5497
5498
5499 /* hwrm_func_clr_stats_input (size:192b/24B) */
5500 struct hwrm_func_clr_stats_input {
5501         /* The HWRM command request type. */
5502         uint16_t        req_type;
5503         /*
5504          * The completion ring to send the completion event on. This should
5505          * be the NQ ID returned from the `nq_alloc` HWRM command.
5506          */
5507         uint16_t        cmpl_ring;
5508         /*
5509          * The sequence ID is used by the driver for tracking multiple
5510          * commands. This ID is treated as opaque data by the firmware and
5511          * the value is returned in the `hwrm_resp_hdr` upon completion.
5512          */
5513         uint16_t        seq_id;
5514         /*
5515          * The target ID of the command:
5516          * * 0x0-0xFFF8 - The function ID
5517          * * 0xFFF8-0xFFFE - Reserved for internal processors
5518          * * 0xFFFF - HWRM
5519          */
5520         uint16_t        target_id;
5521         /*
5522          * A physical address pointer pointing to a host buffer that the
5523          * command's response data will be written. This can be either a host
5524          * physical address (HPA) or a guest physical address (GPA) and must
5525          * point to a physically contiguous block of memory.
5526          */
5527         uint64_t        resp_addr;
5528         /*
5529          * Function ID of the function.
5530          * 0xFF... (All Fs) if the query is for the requesting
5531          * function.
5532          */
5533         uint16_t        fid;
5534         uint8_t unused_0[6];
5535 } __attribute__((packed));
5536
5537 /* hwrm_func_clr_stats_output (size:128b/16B) */
5538 struct hwrm_func_clr_stats_output {
5539         /* The specific error status for the command. */
5540         uint16_t        error_code;
5541         /* The HWRM command request type. */
5542         uint16_t        req_type;
5543         /* The sequence ID from the original command. */
5544         uint16_t        seq_id;
5545         /* The length of the response data in number of bytes. */
5546         uint16_t        resp_len;
5547         uint8_t unused_0[7];
5548         /*
5549          * This field is used in Output records to indicate that the output
5550          * is completely written to RAM.  This field should be read as '1'
5551          * to indicate that the output has been completely written.
5552          * When writing a command completion or response to an internal processor,
5553          * the order of writes has to be such that this field is written last.
5554          */
5555         uint8_t valid;
5556 } __attribute__((packed));
5557
5558 /**************************
5559  * hwrm_func_vf_resc_free *
5560  **************************/
5561
5562
5563 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
5564 struct hwrm_func_vf_resc_free_input {
5565         /* The HWRM command request type. */
5566         uint16_t        req_type;
5567         /*
5568          * The completion ring to send the completion event on. This should
5569          * be the NQ ID returned from the `nq_alloc` HWRM command.
5570          */
5571         uint16_t        cmpl_ring;
5572         /*
5573          * The sequence ID is used by the driver for tracking multiple
5574          * commands. This ID is treated as opaque data by the firmware and
5575          * the value is returned in the `hwrm_resp_hdr` upon completion.
5576          */
5577         uint16_t        seq_id;
5578         /*
5579          * The target ID of the command:
5580          * * 0x0-0xFFF8 - The function ID
5581          * * 0xFFF8-0xFFFE - Reserved for internal processors
5582          * * 0xFFFF - HWRM
5583          */
5584         uint16_t        target_id;
5585         /*
5586          * A physical address pointer pointing to a host buffer that the
5587          * command's response data will be written. This can be either a host
5588          * physical address (HPA) or a guest physical address (GPA) and must
5589          * point to a physically contiguous block of memory.
5590          */
5591         uint64_t        resp_addr;
5592         /*
5593          * This value is used to identify a Virtual Function (VF).
5594          * The scope of VF ID is local within a PF.
5595          */
5596         uint16_t        vf_id;
5597         uint8_t unused_0[6];
5598 } __attribute__((packed));
5599
5600 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
5601 struct hwrm_func_vf_resc_free_output {
5602         /* The specific error status for the command. */
5603         uint16_t        error_code;
5604         /* The HWRM command request type. */
5605         uint16_t        req_type;
5606         /* The sequence ID from the original command. */
5607         uint16_t        seq_id;
5608         /* The length of the response data in number of bytes. */
5609         uint16_t        resp_len;
5610         uint8_t unused_0[7];
5611         /*
5612          * This field is used in Output records to indicate that the output
5613          * is completely written to RAM.  This field should be read as '1'
5614          * to indicate that the output has been completely written.
5615          * When writing a command completion or response to an internal processor,
5616          * the order of writes has to be such that this field is written last.
5617          */
5618         uint8_t valid;
5619 } __attribute__((packed));
5620
5621 /*******************************
5622  * hwrm_func_vf_vnic_ids_query *
5623  *******************************/
5624
5625
5626 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
5627 struct hwrm_func_vf_vnic_ids_query_input {
5628         /* The HWRM command request type. */
5629         uint16_t        req_type;
5630         /*
5631          * The completion ring to send the completion event on. This should
5632          * be the NQ ID returned from the `nq_alloc` HWRM command.
5633          */
5634         uint16_t        cmpl_ring;
5635         /*
5636          * The sequence ID is used by the driver for tracking multiple
5637          * commands. This ID is treated as opaque data by the firmware and
5638          * the value is returned in the `hwrm_resp_hdr` upon completion.
5639          */
5640         uint16_t        seq_id;
5641         /*
5642          * The target ID of the command:
5643          * * 0x0-0xFFF8 - The function ID
5644          * * 0xFFF8-0xFFFE - Reserved for internal processors
5645          * * 0xFFFF - HWRM
5646          */
5647         uint16_t        target_id;
5648         /*
5649          * A physical address pointer pointing to a host buffer that the
5650          * command's response data will be written. This can be either a host
5651          * physical address (HPA) or a guest physical address (GPA) and must
5652          * point to a physically contiguous block of memory.
5653          */
5654         uint64_t        resp_addr;
5655         /*
5656          * This value is used to identify a Virtual Function (VF).
5657          * The scope of VF ID is local within a PF.
5658          */
5659         uint16_t        vf_id;
5660         uint8_t unused_0[2];
5661         /* Max number of vnic ids in vnic id table */
5662         uint32_t        max_vnic_id_cnt;
5663         /* This is the address for VF VNIC ID table */
5664         uint64_t        vnic_id_tbl_addr;
5665 } __attribute__((packed));
5666
5667 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
5668 struct hwrm_func_vf_vnic_ids_query_output {
5669         /* The specific error status for the command. */
5670         uint16_t        error_code;
5671         /* The HWRM command request type. */
5672         uint16_t        req_type;
5673         /* The sequence ID from the original command. */
5674         uint16_t        seq_id;
5675         /* The length of the response data in number of bytes. */
5676         uint16_t        resp_len;
5677         /*
5678          * Actual number of vnic ids
5679          *
5680          * Each VNIC ID is written as a 32-bit number.
5681          */
5682         uint32_t        vnic_id_cnt;
5683         uint8_t unused_0[3];
5684         /*
5685          * This field is used in Output records to indicate that the output
5686          * is completely written to RAM.  This field should be read as '1'
5687          * to indicate that the output has been completely written.
5688          * When writing a command completion or response to an internal processor,
5689          * the order of writes has to be such that this field is written last.
5690          */
5691         uint8_t valid;
5692 } __attribute__((packed));
5693
5694 /**********************
5695  * hwrm_func_drv_rgtr *
5696  **********************/
5697
5698
5699 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
5700 struct hwrm_func_drv_rgtr_input {
5701         /* The HWRM command request type. */
5702         uint16_t        req_type;
5703         /*
5704          * The completion ring to send the completion event on. This should
5705          * be the NQ ID returned from the `nq_alloc` HWRM command.
5706          */
5707         uint16_t        cmpl_ring;
5708         /*
5709          * The sequence ID is used by the driver for tracking multiple
5710          * commands. This ID is treated as opaque data by the firmware and
5711          * the value is returned in the `hwrm_resp_hdr` upon completion.
5712          */
5713         uint16_t        seq_id;
5714         /*
5715          * The target ID of the command:
5716          * * 0x0-0xFFF8 - The function ID
5717          * * 0xFFF8-0xFFFE - Reserved for internal processors
5718          * * 0xFFFF - HWRM
5719          */
5720         uint16_t        target_id;
5721         /*
5722          * A physical address pointer pointing to a host buffer that the
5723          * command's response data will be written. This can be either a host
5724          * physical address (HPA) or a guest physical address (GPA) and must
5725          * point to a physically contiguous block of memory.
5726          */
5727         uint64_t        resp_addr;
5728         uint32_t        flags;
5729         /*
5730          * When this bit is '1', the function driver is requesting
5731          * all requests from its children VF drivers to be
5732          * forwarded to itself.
5733          * This flag can only be set by the PF driver.
5734          * If a VF driver sets this flag, it should be ignored
5735          * by the HWRM.
5736          */
5737         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE       UINT32_C(0x1)
5738         /*
5739          * When this bit is '1', the function is requesting none of
5740          * the requests from its children VF drivers to be
5741          * forwarded to itself.
5742          * This flag can only be set by the PF driver.
5743          * If a VF driver sets this flag, it should be ignored
5744          * by the HWRM.
5745          */
5746         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE      UINT32_C(0x2)
5747         /*
5748          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
5749          * fields shall be ignored and ver_maj, ver_min, ver_upd
5750          * and ver_patch shall be used for the driver version information.
5751          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
5752          * fields shall be used for the driver version information and
5753          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
5754          */
5755         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE     UINT32_C(0x4)
5756         uint32_t        enables;
5757         /*
5758          * This bit must be '1' for the os_type field to be
5759          * configured.
5760          */
5761         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
5762                 UINT32_C(0x1)
5763         /*
5764          * This bit must be '1' for the ver field to be
5765          * configured.
5766          */
5767         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
5768                 UINT32_C(0x2)
5769         /*
5770          * This bit must be '1' for the timestamp field to be
5771          * configured.
5772          */
5773         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
5774                 UINT32_C(0x4)
5775         /*
5776          * This bit must be '1' for the vf_req_fwd field to be
5777          * configured.
5778          */
5779         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
5780                 UINT32_C(0x8)
5781         /*
5782          * This bit must be '1' for the async_event_fwd field to be
5783          * configured.
5784          */
5785         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
5786                 UINT32_C(0x10)
5787         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
5788         uint16_t        os_type;
5789         /* Unknown */
5790         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
5791         /* Other OS not listed below. */
5792         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
5793         /* MSDOS OS. */
5794         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
5795         /* Windows OS. */
5796         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
5797         /* Solaris OS. */
5798         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
5799         /* Linux OS. */
5800         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
5801         /* FreeBSD OS. */
5802         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
5803         /* VMware ESXi OS. */
5804         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
5805         /* Microsoft Windows 8 64-bit OS. */
5806         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
5807         /* Microsoft Windows Server 2012 R2 OS. */
5808         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
5809         /* UEFI driver. */
5810         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
5811         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
5812                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
5813         /* This is the 8bit major version of the driver. */
5814         uint8_t ver_maj_8b;
5815         /* This is the 8bit minor version of the driver. */
5816         uint8_t ver_min_8b;
5817         /* This is the 8bit update version of the driver. */
5818         uint8_t ver_upd_8b;
5819         uint8_t unused_0[3];
5820         /*
5821          * This is a 32-bit timestamp provided by the driver for
5822          * keep alive.
5823          * The timestamp is in multiples of 1ms.
5824          */
5825         uint32_t        timestamp;
5826         uint8_t unused_1[4];
5827         /*
5828          * This is a 256-bit bit mask provided by the PF driver for
5829          * letting the HWRM know what commands issued by the VF driver
5830          * to the HWRM should be forwarded to the PF driver.
5831          * Nth bit refers to the Nth req_type.
5832          *
5833          * Setting Nth bit to 1 indicates that requests from the
5834          * VF driver with req_type equal to N shall be forwarded to
5835          * the parent PF driver.
5836          *
5837          * This field is not valid for the VF driver.
5838          */
5839         uint32_t        vf_req_fwd[8];
5840         /*
5841          * This is a 256-bit bit mask provided by the function driver
5842          * (PF or VF driver) to indicate the list of asynchronous event
5843          * completions to be forwarded.
5844          *
5845          * Nth bit refers to the Nth event_id.
5846          *
5847          * Setting Nth bit to 1 by the function driver shall result in
5848          * the HWRM forwarding asynchronous event completion with
5849          * event_id equal to N.
5850          *
5851          * If all bits are set to 0 (value of 0), then the HWRM shall
5852          * not forward any asynchronous event completion to this
5853          * function driver.
5854          */
5855         uint32_t        async_event_fwd[8];
5856         /* This is the 16bit major version of the driver. */
5857         uint16_t        ver_maj;
5858         /* This is the 16bit minor version of the driver. */
5859         uint16_t        ver_min;
5860         /* This is the 16bit update version of the driver. */
5861         uint16_t        ver_upd;
5862         /* This is the 16bit patch version of the driver. */
5863         uint16_t        ver_patch;
5864 } __attribute__((packed));
5865
5866 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
5867 struct hwrm_func_drv_rgtr_output {
5868         /* The specific error status for the command. */
5869         uint16_t        error_code;
5870         /* The HWRM command request type. */
5871         uint16_t        req_type;
5872         /* The sequence ID from the original command. */
5873         uint16_t        seq_id;
5874         /* The length of the response data in number of bytes. */
5875         uint16_t        resp_len;
5876         uint8_t unused_0[7];
5877         /*
5878          * This field is used in Output records to indicate that the output
5879          * is completely written to RAM.  This field should be read as '1'
5880          * to indicate that the output has been completely written.
5881          * When writing a command completion or response to an internal processor,
5882          * the order of writes has to be such that this field is written last.
5883          */
5884         uint8_t valid;
5885 } __attribute__((packed));
5886
5887 /************************
5888  * hwrm_func_drv_unrgtr *
5889  ************************/
5890
5891
5892 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
5893 struct hwrm_func_drv_unrgtr_input {
5894         /* The HWRM command request type. */
5895         uint16_t        req_type;
5896         /*
5897          * The completion ring to send the completion event on. This should
5898          * be the NQ ID returned from the `nq_alloc` HWRM command.
5899          */
5900         uint16_t        cmpl_ring;
5901         /*
5902          * The sequence ID is used by the driver for tracking multiple
5903          * commands. This ID is treated as opaque data by the firmware and
5904          * the value is returned in the `hwrm_resp_hdr` upon completion.
5905          */
5906         uint16_t        seq_id;
5907         /*
5908          * The target ID of the command:
5909          * * 0x0-0xFFF8 - The function ID
5910          * * 0xFFF8-0xFFFE - Reserved for internal processors
5911          * * 0xFFFF - HWRM
5912          */
5913         uint16_t        target_id;
5914         /*
5915          * A physical address pointer pointing to a host buffer that the
5916          * command's response data will be written. This can be either a host
5917          * physical address (HPA) or a guest physical address (GPA) and must
5918          * point to a physically contiguous block of memory.
5919          */
5920         uint64_t        resp_addr;
5921         uint32_t        flags;
5922         /*
5923          * When this bit is '1', the function driver is notifying
5924          * the HWRM to prepare for the shutdown.
5925          */
5926         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
5927                 UINT32_C(0x1)
5928         uint8_t unused_0[4];
5929 } __attribute__((packed));
5930
5931 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
5932 struct hwrm_func_drv_unrgtr_output {
5933         /* The specific error status for the command. */
5934         uint16_t        error_code;
5935         /* The HWRM command request type. */
5936         uint16_t        req_type;
5937         /* The sequence ID from the original command. */
5938         uint16_t        seq_id;
5939         /* The length of the response data in number of bytes. */
5940         uint16_t        resp_len;
5941         uint8_t unused_0[7];
5942         /*
5943          * This field is used in Output records to indicate that the output
5944          * is completely written to RAM.  This field should be read as '1'
5945          * to indicate that the output has been completely written.
5946          * When writing a command completion or response to an internal processor,
5947          * the order of writes has to be such that this field is written last.
5948          */
5949         uint8_t valid;
5950 } __attribute__((packed));
5951
5952 /**********************
5953  * hwrm_func_buf_rgtr *
5954  **********************/
5955
5956
5957 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
5958 struct hwrm_func_buf_rgtr_input {
5959         /* The HWRM command request type. */
5960         uint16_t        req_type;
5961         /*
5962          * The completion ring to send the completion event on. This should
5963          * be the NQ ID returned from the `nq_alloc` HWRM command.
5964          */
5965         uint16_t        cmpl_ring;
5966         /*
5967          * The sequence ID is used by the driver for tracking multiple
5968          * commands. This ID is treated as opaque data by the firmware and
5969          * the value is returned in the `hwrm_resp_hdr` upon completion.
5970          */
5971         uint16_t        seq_id;
5972         /*
5973          * The target ID of the command:
5974          * * 0x0-0xFFF8 - The function ID
5975          * * 0xFFF8-0xFFFE - Reserved for internal processors
5976          * * 0xFFFF - HWRM
5977          */
5978         uint16_t        target_id;
5979         /*
5980          * A physical address pointer pointing to a host buffer that the
5981          * command's response data will be written. This can be either a host
5982          * physical address (HPA) or a guest physical address (GPA) and must
5983          * point to a physically contiguous block of memory.
5984          */
5985         uint64_t        resp_addr;
5986         uint32_t        enables;
5987         /*
5988          * This bit must be '1' for the vf_id field to be
5989          * configured.
5990          */
5991         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
5992         /*
5993          * This bit must be '1' for the err_buf_addr field to be
5994          * configured.
5995          */
5996         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
5997         /*
5998          * This value is used to identify a Virtual Function (VF).
5999          * The scope of VF ID is local within a PF.
6000          */
6001         uint16_t        vf_id;
6002         /*
6003          * This field represents the number of pages used for request
6004          * buffer(s).
6005          */
6006         uint16_t        req_buf_num_pages;
6007         /*
6008          * This field represents the page size used for request
6009          * buffer(s).
6010          */
6011         uint16_t        req_buf_page_size;
6012         /* 16 bytes */
6013         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
6014         /* 4 Kbytes */
6015         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
6016         /* 8 Kbytes */
6017         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
6018         /* 64 Kbytes */
6019         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
6020         /* 2 Mbytes */
6021         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
6022         /* 4 Mbytes */
6023         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
6024         /* 1 Gbytes */
6025         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
6026         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
6027                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
6028         /* The length of the request buffer per VF in bytes. */
6029         uint16_t        req_buf_len;
6030         /* The length of the response buffer in bytes. */
6031         uint16_t        resp_buf_len;
6032         uint8_t unused_0[2];
6033         /* This field represents the page address of page #0. */
6034         uint64_t        req_buf_page_addr0;
6035         /* This field represents the page address of page #1. */
6036         uint64_t        req_buf_page_addr1;
6037         /* This field represents the page address of page #2. */
6038         uint64_t        req_buf_page_addr2;
6039         /* This field represents the page address of page #3. */
6040         uint64_t        req_buf_page_addr3;
6041         /* This field represents the page address of page #4. */
6042         uint64_t        req_buf_page_addr4;
6043         /* This field represents the page address of page #5. */
6044         uint64_t        req_buf_page_addr5;
6045         /* This field represents the page address of page #6. */
6046         uint64_t        req_buf_page_addr6;
6047         /* This field represents the page address of page #7. */
6048         uint64_t        req_buf_page_addr7;
6049         /* This field represents the page address of page #8. */
6050         uint64_t        req_buf_page_addr8;
6051         /* This field represents the page address of page #9. */
6052         uint64_t        req_buf_page_addr9;
6053         /*
6054          * This field is used to receive the error reporting from
6055          * the chipset. Only applicable for PFs.
6056          */
6057         uint64_t        error_buf_addr;
6058         /*
6059          * This field is used to receive the response forwarded by the
6060          * HWRM.
6061          */
6062         uint64_t        resp_buf_addr;
6063 } __attribute__((packed));
6064
6065 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
6066 struct hwrm_func_buf_rgtr_output {
6067         /* The specific error status for the command. */
6068         uint16_t        error_code;
6069         /* The HWRM command request type. */
6070         uint16_t        req_type;
6071         /* The sequence ID from the original command. */
6072         uint16_t        seq_id;
6073         /* The length of the response data in number of bytes. */
6074         uint16_t        resp_len;
6075         uint8_t unused_0[7];
6076         /*
6077          * This field is used in Output records to indicate that the output
6078          * is completely written to RAM.  This field should be read as '1'
6079          * to indicate that the output has been completely written.
6080          * When writing a command completion or response to an internal processor,
6081          * the order of writes has to be such that this field is written last.
6082          */
6083         uint8_t valid;
6084 } __attribute__((packed));
6085
6086 /************************
6087  * hwrm_func_buf_unrgtr *
6088  ************************/
6089
6090
6091 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
6092 struct hwrm_func_buf_unrgtr_input {
6093         /* The HWRM command request type. */
6094         uint16_t        req_type;
6095         /*
6096          * The completion ring to send the completion event on. This should
6097          * be the NQ ID returned from the `nq_alloc` HWRM command.
6098          */
6099         uint16_t        cmpl_ring;
6100         /*
6101          * The sequence ID is used by the driver for tracking multiple
6102          * commands. This ID is treated as opaque data by the firmware and
6103          * the value is returned in the `hwrm_resp_hdr` upon completion.
6104          */
6105         uint16_t        seq_id;
6106         /*
6107          * The target ID of the command:
6108          * * 0x0-0xFFF8 - The function ID
6109          * * 0xFFF8-0xFFFE - Reserved for internal processors
6110          * * 0xFFFF - HWRM
6111          */
6112         uint16_t        target_id;
6113         /*
6114          * A physical address pointer pointing to a host buffer that the
6115          * command's response data will be written. This can be either a host
6116          * physical address (HPA) or a guest physical address (GPA) and must
6117          * point to a physically contiguous block of memory.
6118          */
6119         uint64_t        resp_addr;
6120         uint32_t        enables;
6121         /*
6122          * This bit must be '1' for the vf_id field to be
6123          * configured.
6124          */
6125         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
6126         /*
6127          * This value is used to identify a Virtual Function (VF).
6128          * The scope of VF ID is local within a PF.
6129          */
6130         uint16_t        vf_id;
6131         uint8_t unused_0[2];
6132 } __attribute__((packed));
6133
6134 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
6135 struct hwrm_func_buf_unrgtr_output {
6136         /* The specific error status for the command. */
6137         uint16_t        error_code;
6138         /* The HWRM command request type. */
6139         uint16_t        req_type;
6140         /* The sequence ID from the original command. */
6141         uint16_t        seq_id;
6142         /* The length of the response data in number of bytes. */
6143         uint16_t        resp_len;
6144         uint8_t unused_0[7];
6145         /*
6146          * This field is used in Output records to indicate that the output
6147          * is completely written to RAM.  This field should be read as '1'
6148          * to indicate that the output has been completely written.
6149          * When writing a command completion or response to an internal processor,
6150          * the order of writes has to be such that this field is written last.
6151          */
6152         uint8_t valid;
6153 } __attribute__((packed));
6154
6155 /**********************
6156  * hwrm_func_drv_qver *
6157  **********************/
6158
6159
6160 /* hwrm_func_drv_qver_input (size:192b/24B) */
6161 struct hwrm_func_drv_qver_input {
6162         /* The HWRM command request type. */
6163         uint16_t        req_type;
6164         /*
6165          * The completion ring to send the completion event on. This should
6166          * be the NQ ID returned from the `nq_alloc` HWRM command.
6167          */
6168         uint16_t        cmpl_ring;
6169         /*
6170          * The sequence ID is used by the driver for tracking multiple
6171          * commands. This ID is treated as opaque data by the firmware and
6172          * the value is returned in the `hwrm_resp_hdr` upon completion.
6173          */
6174         uint16_t        seq_id;
6175         /*
6176          * The target ID of the command:
6177          * * 0x0-0xFFF8 - The function ID
6178          * * 0xFFF8-0xFFFE - Reserved for internal processors
6179          * * 0xFFFF - HWRM
6180          */
6181         uint16_t        target_id;
6182         /*
6183          * A physical address pointer pointing to a host buffer that the
6184          * command's response data will be written. This can be either a host
6185          * physical address (HPA) or a guest physical address (GPA) and must
6186          * point to a physically contiguous block of memory.
6187          */
6188         uint64_t        resp_addr;
6189         /* Reserved for future use. */
6190         uint32_t        reserved;
6191         /*
6192          * Function ID of the function that is being queried.
6193          * 0xFF... (All Fs) if the query is for the requesting
6194          * function.
6195          */
6196         uint16_t        fid;
6197         uint8_t unused_0[2];
6198 } __attribute__((packed));
6199
6200 /* hwrm_func_drv_qver_output (size:192b/24B) */
6201 struct hwrm_func_drv_qver_output {
6202         /* The specific error status for the command. */
6203         uint16_t        error_code;
6204         /* The HWRM command request type. */
6205         uint16_t        req_type;
6206         /* The sequence ID from the original command. */
6207         uint16_t        seq_id;
6208         /* The length of the response data in number of bytes. */
6209         uint16_t        resp_len;
6210         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
6211         uint16_t        os_type;
6212         /* Unknown */
6213         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
6214         /* Other OS not listed below. */
6215         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
6216         /* MSDOS OS. */
6217         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
6218         /* Windows OS. */
6219         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
6220         /* Solaris OS. */
6221         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
6222         /* Linux OS. */
6223         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
6224         /* FreeBSD OS. */
6225         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
6226         /* VMware ESXi OS. */
6227         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
6228         /* Microsoft Windows 8 64-bit OS. */
6229         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
6230         /* Microsoft Windows Server 2012 R2 OS. */
6231         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
6232         /* UEFI driver. */
6233         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
6234         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
6235                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
6236         /* This is the 8bit major version of the driver. */
6237         uint8_t ver_maj_8b;
6238         /* This is the 8bit minor version of the driver. */
6239         uint8_t ver_min_8b;
6240         /* This is the 8bit update version of the driver. */
6241         uint8_t ver_upd_8b;
6242         uint8_t unused_0[2];
6243         /*
6244          * This field is used in Output records to indicate that the output
6245          * is completely written to RAM.  This field should be read as '1'
6246          * to indicate that the output has been completely written.
6247          * When writing a command completion or response to an internal processor,
6248          * the order of writes has to be such that this field is written last.
6249          */
6250         uint8_t valid;
6251         /* This is the 16bit major version of the driver. */
6252         uint16_t        ver_maj;
6253         /* This is the 16bit minor version of the driver. */
6254         uint16_t        ver_min;
6255         /* This is the 16bit update version of the driver. */
6256         uint16_t        ver_upd;
6257         /* This is the 16bit patch version of the driver. */
6258         uint16_t        ver_patch;
6259 } __attribute__((packed));
6260
6261 /****************************
6262  * hwrm_func_resource_qcaps *
6263  ****************************/
6264
6265
6266 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
6267 struct hwrm_func_resource_qcaps_input {
6268         /* The HWRM command request type. */
6269         uint16_t        req_type;
6270         /*
6271          * The completion ring to send the completion event on. This should
6272          * be the NQ ID returned from the `nq_alloc` HWRM command.
6273          */
6274         uint16_t        cmpl_ring;
6275         /*
6276          * The sequence ID is used by the driver for tracking multiple
6277          * commands. This ID is treated as opaque data by the firmware and
6278          * the value is returned in the `hwrm_resp_hdr` upon completion.
6279          */
6280         uint16_t        seq_id;
6281         /*
6282          * The target ID of the command:
6283          * * 0x0-0xFFF8 - The function ID
6284          * * 0xFFF8-0xFFFE - Reserved for internal processors
6285          * * 0xFFFF - HWRM
6286          */
6287         uint16_t        target_id;
6288         /*
6289          * A physical address pointer pointing to a host buffer that the
6290          * command's response data will be written. This can be either a host
6291          * physical address (HPA) or a guest physical address (GPA) and must
6292          * point to a physically contiguous block of memory.
6293          */
6294         uint64_t        resp_addr;
6295         /*
6296          * Function ID of the function that is being queried.
6297          * 0xFF... (All Fs) if the query is for the requesting
6298          * function.
6299          */
6300         uint16_t        fid;
6301         uint8_t unused_0[6];
6302 } __attribute__((packed));
6303
6304 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
6305 struct hwrm_func_resource_qcaps_output {
6306         /* The specific error status for the command. */
6307         uint16_t        error_code;
6308         /* The HWRM command request type. */
6309         uint16_t        req_type;
6310         /* The sequence ID from the original command. */
6311         uint16_t        seq_id;
6312         /* The length of the response data in number of bytes. */
6313         uint16_t        resp_len;
6314         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
6315         uint16_t        max_vfs;
6316         /* Maximum guaranteed number of MSI-X vectors supported by function */
6317         uint16_t        max_msix;
6318         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
6319         uint16_t        vf_reservation_strategy;
6320         /* The PF driver should evenly divide its remaining resources among all VFs. */
6321         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
6322                 UINT32_C(0x0)
6323         /* The PF driver should only reserve minimal resources for each VF. */
6324         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
6325                 UINT32_C(0x1)
6326         /*
6327          * The PF driver should not reserve any resources for each VF until the
6328          * the VF interface is brought up.
6329          */
6330         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
6331                 UINT32_C(0x2)
6332         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
6333                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
6334         /* Minimum guaranteed number of RSS/COS contexts */
6335         uint16_t        min_rsscos_ctx;
6336         /* Maximum non-guaranteed number of RSS/COS contexts */
6337         uint16_t        max_rsscos_ctx;
6338         /* Minimum guaranteed number of completion rings */
6339         uint16_t        min_cmpl_rings;
6340         /* Maximum non-guaranteed number of completion rings */
6341         uint16_t        max_cmpl_rings;
6342         /* Minimum guaranteed number of transmit rings */
6343         uint16_t        min_tx_rings;
6344         /* Maximum non-guaranteed number of transmit rings */
6345         uint16_t        max_tx_rings;
6346         /* Minimum guaranteed number of receive rings */
6347         uint16_t        min_rx_rings;
6348         /* Maximum non-guaranteed number of receive rings */
6349         uint16_t        max_rx_rings;
6350         /* Minimum guaranteed number of L2 contexts */
6351         uint16_t        min_l2_ctxs;
6352         /* Maximum non-guaranteed number of L2 contexts */
6353         uint16_t        max_l2_ctxs;
6354         /* Minimum guaranteed number of VNICs */
6355         uint16_t        min_vnics;
6356         /* Maximum non-guaranteed number of VNICs */
6357         uint16_t        max_vnics;
6358         /* Minimum guaranteed number of statistic contexts */
6359         uint16_t        min_stat_ctx;
6360         /* Maximum non-guaranteed number of statistic contexts */
6361         uint16_t        max_stat_ctx;
6362         /* Minimum guaranteed number of ring groups */
6363         uint16_t        min_hw_ring_grps;
6364         /* Maximum non-guaranteed number of ring groups */
6365         uint16_t        max_hw_ring_grps;
6366         /*
6367          * Maximum number of inputs into the transmit scheduler for this function.
6368          * The number of TX rings assigned to the function cannot exceed this value.
6369          */
6370         uint16_t        max_tx_scheduler_inputs;
6371         uint8_t unused_0[7];
6372         /*
6373          * This field is used in Output records to indicate that the output
6374          * is completely written to RAM.  This field should be read as '1'
6375          * to indicate that the output has been completely written.
6376          * When writing a command completion or response to an internal processor,
6377          * the order of writes has to be such that this field is written last.
6378          */
6379         uint8_t valid;
6380 } __attribute__((packed));
6381
6382 /*****************************
6383  * hwrm_func_vf_resource_cfg *
6384  *****************************/
6385
6386
6387 /* hwrm_func_vf_resource_cfg_input (size:448b/56B) */
6388 struct hwrm_func_vf_resource_cfg_input {
6389         /* The HWRM command request type. */
6390         uint16_t        req_type;
6391         /*
6392          * The completion ring to send the completion event on. This should
6393          * be the NQ ID returned from the `nq_alloc` HWRM command.
6394          */
6395         uint16_t        cmpl_ring;
6396         /*
6397          * The sequence ID is used by the driver for tracking multiple
6398          * commands. This ID is treated as opaque data by the firmware and
6399          * the value is returned in the `hwrm_resp_hdr` upon completion.
6400          */
6401         uint16_t        seq_id;
6402         /*
6403          * The target ID of the command:
6404          * * 0x0-0xFFF8 - The function ID
6405          * * 0xFFF8-0xFFFE - Reserved for internal processors
6406          * * 0xFFFF - HWRM
6407          */
6408         uint16_t        target_id;
6409         /*
6410          * A physical address pointer pointing to a host buffer that the
6411          * command's response data will be written. This can be either a host
6412          * physical address (HPA) or a guest physical address (GPA) and must
6413          * point to a physically contiguous block of memory.
6414          */
6415         uint64_t        resp_addr;
6416         /* VF ID that is being configured by PF */
6417         uint16_t        vf_id;
6418         /* Maximum guaranteed number of MSI-X vectors for the function */
6419         uint16_t        max_msix;
6420         /* Minimum guaranteed number of RSS/COS contexts */
6421         uint16_t        min_rsscos_ctx;
6422         /* Maximum non-guaranteed number of RSS/COS contexts */
6423         uint16_t        max_rsscos_ctx;
6424         /* Minimum guaranteed number of completion rings */
6425         uint16_t        min_cmpl_rings;
6426         /* Maximum non-guaranteed number of completion rings */
6427         uint16_t        max_cmpl_rings;
6428         /* Minimum guaranteed number of transmit rings */
6429         uint16_t        min_tx_rings;
6430         /* Maximum non-guaranteed number of transmit rings */
6431         uint16_t        max_tx_rings;
6432         /* Minimum guaranteed number of receive rings */
6433         uint16_t        min_rx_rings;
6434         /* Maximum non-guaranteed number of receive rings */
6435         uint16_t        max_rx_rings;
6436         /* Minimum guaranteed number of L2 contexts */
6437         uint16_t        min_l2_ctxs;
6438         /* Maximum non-guaranteed number of L2 contexts */
6439         uint16_t        max_l2_ctxs;
6440         /* Minimum guaranteed number of VNICs */
6441         uint16_t        min_vnics;
6442         /* Maximum non-guaranteed number of VNICs */
6443         uint16_t        max_vnics;
6444         /* Minimum guaranteed number of statistic contexts */
6445         uint16_t        min_stat_ctx;
6446         /* Maximum non-guaranteed number of statistic contexts */
6447         uint16_t        max_stat_ctx;
6448         /* Minimum guaranteed number of ring groups */
6449         uint16_t        min_hw_ring_grps;
6450         /* Maximum non-guaranteed number of ring groups */
6451         uint16_t        max_hw_ring_grps;
6452         uint8_t unused_0[4];
6453 } __attribute__((packed));
6454
6455 /* hwrm_func_vf_resource_cfg_output (size:256b/32B) */
6456 struct hwrm_func_vf_resource_cfg_output {
6457         /* The specific error status for the command. */
6458         uint16_t        error_code;
6459         /* The HWRM command request type. */
6460         uint16_t        req_type;
6461         /* The sequence ID from the original command. */
6462         uint16_t        seq_id;
6463         /* The length of the response data in number of bytes. */
6464         uint16_t        resp_len;
6465         /* Reserved number of RSS/COS contexts */
6466         uint16_t        reserved_rsscos_ctx;
6467         /* Reserved number of completion rings */
6468         uint16_t        reserved_cmpl_rings;
6469         /* Reserved number of transmit rings */
6470         uint16_t        reserved_tx_rings;
6471         /* Reserved number of receive rings */
6472         uint16_t        reserved_rx_rings;
6473         /* Reserved number of L2 contexts */
6474         uint16_t        reserved_l2_ctxs;
6475         /* Reserved number of VNICs */
6476         uint16_t        reserved_vnics;
6477         /* Reserved number of statistic contexts */
6478         uint16_t        reserved_stat_ctx;
6479         /* Reserved number of ring groups */
6480         uint16_t        reserved_hw_ring_grps;
6481         uint8_t unused_0[7];
6482         /*
6483          * This field is used in Output records to indicate that the output
6484          * is completely written to RAM.  This field should be read as '1'
6485          * to indicate that the output has been completely written.
6486          * When writing a command completion or response to an internal processor,
6487          * the order of writes has to be such that this field is written last.
6488          */
6489         uint8_t valid;
6490 } __attribute__((packed));
6491
6492 /*********************************
6493  * hwrm_func_backing_store_qcaps *
6494  *********************************/
6495
6496
6497 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
6498 struct hwrm_func_backing_store_qcaps_input {
6499         /* The HWRM command request type. */
6500         uint16_t        req_type;
6501         /*
6502          * The completion ring to send the completion event on. This should
6503          * be the NQ ID returned from the `nq_alloc` HWRM command.
6504          */
6505         uint16_t        cmpl_ring;
6506         /*
6507          * The sequence ID is used by the driver for tracking multiple
6508          * commands. This ID is treated as opaque data by the firmware and
6509          * the value is returned in the `hwrm_resp_hdr` upon completion.
6510          */
6511         uint16_t        seq_id;
6512         /*
6513          * The target ID of the command:
6514          * * 0x0-0xFFF8 - The function ID
6515          * * 0xFFF8-0xFFFE - Reserved for internal processors
6516          * * 0xFFFF - HWRM
6517          */
6518         uint16_t        target_id;
6519         /*
6520          * A physical address pointer pointing to a host buffer that the
6521          * command's response data will be written. This can be either a host
6522          * physical address (HPA) or a guest physical address (GPA) and must
6523          * point to a physically contiguous block of memory.
6524          */
6525         uint64_t        resp_addr;
6526 } __attribute__((packed));
6527
6528 /* hwrm_func_backing_store_qcaps_output (size:512b/64B) */
6529 struct hwrm_func_backing_store_qcaps_output {
6530         /* The specific error status for the command. */
6531         uint16_t        error_code;
6532         /* The HWRM command request type. */
6533         uint16_t        req_type;
6534         /* The sequence ID from the original command. */
6535         uint16_t        seq_id;
6536         /* The length of the response data in number of bytes. */
6537         uint16_t        resp_len;
6538         /* Maximum number of QP context entries supported for this function. */
6539         uint32_t        qp_max_entries;
6540         /*
6541          * Minimum number of QP context entries that are needed to be reserved
6542          * for QP1 for the PF and its VFs. PF drivers must allocate at least
6543          * this many QP context entries, even if RoCE will not be used.
6544          */
6545         uint16_t        qp_min_qp1_entries;
6546         /* Maximum number of QP context entries that can be used for L2. */
6547         uint16_t        qp_max_l2_entries;
6548         /* Number of bytes that must be allocated for each context entry. */
6549         uint16_t        qp_entry_size;
6550         /* Maximum number of SRQ context entries that can be used for L2. */
6551         uint16_t        srq_max_l2_entries;
6552         /* Maximum number of SRQ context entries supported for this function. */
6553         uint32_t        srq_max_entries;
6554         /* Number of bytes that must be allocated for each context entry. */
6555         uint16_t        srq_entry_size;
6556         /* Maximum number of CQ context entries that can be used for L2. */
6557         uint16_t        cq_max_l2_entries;
6558         /* Maximum number of CQ context entries supported for this function. */
6559         uint32_t        cq_max_entries;
6560         /* Number of bytes that must be allocated for each context entry. */
6561         uint16_t        cq_entry_size;
6562         /* Maximum number of VNIC context entries supported for this function. */
6563         uint16_t        vnic_max_vnic_entries;
6564         /* Maximum number of Ring table context entries supported for this function. */
6565         uint16_t        vnic_max_ring_table_entries;
6566         /* Number of bytes that must be allocated for each context entry. */
6567         uint16_t        vnic_entry_size;
6568         /* Maximum number of statistic context entries supported for this function. */
6569         uint32_t        stat_max_entries;
6570         /* Number of bytes that must be allocated for each context entry. */
6571         uint16_t        stat_entry_size;
6572         /* Maximum number of TQM context entries supported per ring. */
6573         uint16_t        tqm_max_entries_per_ring;
6574         /* Number of bytes that must be allocated for each context entry. */
6575         uint16_t        tqm_entry_size;
6576         /* Number of bytes that must be allocated for each context entry. */
6577         uint16_t        mrav_entry_size;
6578         /* Maximum number of MR/AV context entries supported for this function. */
6579         uint32_t        mrav_max_entries;
6580         /* Maximum number of Timer context entries supported for this function. */
6581         uint32_t        tim_max_entries;
6582         /* Number of bytes that must be allocated for each context entry. */
6583         uint16_t        tim_entry_size;
6584         uint8_t unused_0;
6585         /*
6586          * This field is used in Output records to indicate that the output
6587          * is completely written to RAM.  This field should be read as '1'
6588          * to indicate that the output has been completely written.
6589          * When writing a command completion or response to an internal processor,
6590          * the order of writes has to be such that this field is written last.
6591          */
6592         uint8_t valid;
6593 } __attribute__((packed));
6594
6595 /*******************************
6596  * hwrm_func_backing_store_cfg *
6597  *******************************/
6598
6599
6600 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
6601 struct hwrm_func_backing_store_cfg_input {
6602         /* The HWRM command request type. */
6603         uint16_t        req_type;
6604         /*
6605          * The completion ring to send the completion event on. This should
6606          * be the NQ ID returned from the `nq_alloc` HWRM command.
6607          */
6608         uint16_t        cmpl_ring;
6609         /*
6610          * The sequence ID is used by the driver for tracking multiple
6611          * commands. This ID is treated as opaque data by the firmware and
6612          * the value is returned in the `hwrm_resp_hdr` upon completion.
6613          */
6614         uint16_t        seq_id;
6615         /*
6616          * The target ID of the command:
6617          * * 0x0-0xFFF8 - The function ID
6618          * * 0xFFF8-0xFFFE - Reserved for internal processors
6619          * * 0xFFFF - HWRM
6620          */
6621         uint16_t        target_id;
6622         /*
6623          * A physical address pointer pointing to a host buffer that the
6624          * command's response data will be written. This can be either a host
6625          * physical address (HPA) or a guest physical address (GPA) and must
6626          * point to a physically contiguous block of memory.
6627          */
6628         uint64_t        resp_addr;
6629         uint32_t        flags;
6630         /*
6631          * When set, the firmware only uses on-chip resources and does not
6632          * expect any backing store to be provided by the host driver. This
6633          * mode provides minimal L2 functionality (e.g. limited L2 resources,
6634          * no RoCE).
6635          */
6636         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
6637                 UINT32_C(0x1)
6638         uint32_t        enables;
6639         /*
6640          * This bit must be '1' for the qp fields to be
6641          * configured.
6642          */
6643         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
6644                 UINT32_C(0x1)
6645         /*
6646          * This bit must be '1' for the srq fields to be
6647          * configured.
6648          */
6649         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
6650                 UINT32_C(0x2)
6651         /*
6652          * This bit must be '1' for the cq fields to be
6653          * configured.
6654          */
6655         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
6656                 UINT32_C(0x4)
6657         /*
6658          * This bit must be '1' for the vnic fields to be
6659          * configured.
6660          */
6661         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
6662                 UINT32_C(0x8)
6663         /*
6664          * This bit must be '1' for the stat fields to be
6665          * configured.
6666          */
6667         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
6668                 UINT32_C(0x10)
6669         /*
6670          * This bit must be '1' for the tqm_sp fields to be
6671          * configured.
6672          */
6673         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
6674                 UINT32_C(0x20)
6675         /*
6676          * This bit must be '1' for the tqm_ring0 fields to be
6677          * configured.
6678          */
6679         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
6680                 UINT32_C(0x40)
6681         /*
6682          * This bit must be '1' for the tqm_ring1 fields to be
6683          * configured.
6684          */
6685         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
6686                 UINT32_C(0x80)
6687         /*
6688          * This bit must be '1' for the tqm_ring2 fields to be
6689          * configured.
6690          */
6691         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
6692                 UINT32_C(0x100)
6693         /*
6694          * This bit must be '1' for the tqm_ring3 fields to be
6695          * configured.
6696          */
6697         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
6698                 UINT32_C(0x200)
6699         /*
6700          * This bit must be '1' for the tqm_ring4 fields to be
6701          * configured.
6702          */
6703         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
6704                 UINT32_C(0x400)
6705         /*
6706          * This bit must be '1' for the tqm_ring5 fields to be
6707          * configured.
6708          */
6709         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
6710                 UINT32_C(0x800)
6711         /*
6712          * This bit must be '1' for the tqm_ring6 fields to be
6713          * configured.
6714          */
6715         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
6716                 UINT32_C(0x1000)
6717         /*
6718          * This bit must be '1' for the tqm_ring7 fields to be
6719          * configured.
6720          */
6721         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
6722                 UINT32_C(0x2000)
6723         /*
6724          * This bit must be '1' for the mrav fields to be
6725          * configured.
6726          */
6727         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
6728                 UINT32_C(0x4000)
6729         /*
6730          * This bit must be '1' for the tim fields to be
6731          * configured.
6732          */
6733         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
6734                 UINT32_C(0x8000)
6735         /* QPC page size and level. */
6736         uint8_t qpc_pg_size_qpc_lvl;
6737         /* QPC PBL indirect levels. */
6738         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
6739                 UINT32_C(0xf)
6740         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
6741         /* PBL pointer is physical start address. */
6742         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
6743                 UINT32_C(0x0)
6744         /* PBL pointer points to PTE table. */
6745         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
6746                 UINT32_C(0x1)
6747         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6748         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
6749                 UINT32_C(0x2)
6750         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
6751                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
6752         /* QPC page size. */
6753         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
6754                 UINT32_C(0xf0)
6755         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
6756         /* 4KB. */
6757         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
6758                 (UINT32_C(0x0) << 4)
6759         /* 8KB. */
6760         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
6761                 (UINT32_C(0x1) << 4)
6762         /* 64KB. */
6763         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
6764                 (UINT32_C(0x2) << 4)
6765         /* 2MB. */
6766         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
6767                 (UINT32_C(0x3) << 4)
6768         /* 8MB. */
6769         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
6770                 (UINT32_C(0x4) << 4)
6771         /* 1GB. */
6772         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
6773                 (UINT32_C(0x5) << 4)
6774         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
6775                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
6776         /* SRQ page size and level. */
6777         uint8_t srq_pg_size_srq_lvl;
6778         /* SRQ PBL indirect levels. */
6779         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
6780                 UINT32_C(0xf)
6781         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
6782         /* PBL pointer is physical start address. */
6783         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
6784                 UINT32_C(0x0)
6785         /* PBL pointer points to PTE table. */
6786         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
6787                 UINT32_C(0x1)
6788         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6789         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
6790                 UINT32_C(0x2)
6791         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
6792                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
6793         /* SRQ page size. */
6794         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
6795                 UINT32_C(0xf0)
6796         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
6797         /* 4KB. */
6798         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
6799                 (UINT32_C(0x0) << 4)
6800         /* 8KB. */
6801         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
6802                 (UINT32_C(0x1) << 4)
6803         /* 64KB. */
6804         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
6805                 (UINT32_C(0x2) << 4)
6806         /* 2MB. */
6807         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
6808                 (UINT32_C(0x3) << 4)
6809         /* 8MB. */
6810         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
6811                 (UINT32_C(0x4) << 4)
6812         /* 1GB. */
6813         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
6814                 (UINT32_C(0x5) << 4)
6815         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
6816                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
6817         /* CQ page size and level. */
6818         uint8_t cq_pg_size_cq_lvl;
6819         /* CQ PBL indirect levels. */
6820         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
6821                 UINT32_C(0xf)
6822         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
6823         /* PBL pointer is physical start address. */
6824         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
6825                 UINT32_C(0x0)
6826         /* PBL pointer points to PTE table. */
6827         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
6828                 UINT32_C(0x1)
6829         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6830         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
6831                 UINT32_C(0x2)
6832         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
6833                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
6834         /* CQ page size. */
6835         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
6836                 UINT32_C(0xf0)
6837         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
6838         /* 4KB. */
6839         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
6840                 (UINT32_C(0x0) << 4)
6841         /* 8KB. */
6842         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
6843                 (UINT32_C(0x1) << 4)
6844         /* 64KB. */
6845         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
6846                 (UINT32_C(0x2) << 4)
6847         /* 2MB. */
6848         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
6849                 (UINT32_C(0x3) << 4)
6850         /* 8MB. */
6851         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
6852                 (UINT32_C(0x4) << 4)
6853         /* 1GB. */
6854         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
6855                 (UINT32_C(0x5) << 4)
6856         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
6857                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
6858         /* VNIC page size and level. */
6859         uint8_t vnic_pg_size_vnic_lvl;
6860         /* VNIC PBL indirect levels. */
6861         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
6862                 UINT32_C(0xf)
6863         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
6864         /* PBL pointer is physical start address. */
6865         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
6866                 UINT32_C(0x0)
6867         /* PBL pointer points to PTE table. */
6868         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
6869                 UINT32_C(0x1)
6870         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6871         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
6872                 UINT32_C(0x2)
6873         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
6874                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
6875         /* VNIC page size. */
6876         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
6877                 UINT32_C(0xf0)
6878         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
6879         /* 4KB. */
6880         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
6881                 (UINT32_C(0x0) << 4)
6882         /* 8KB. */
6883         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
6884                 (UINT32_C(0x1) << 4)
6885         /* 64KB. */
6886         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
6887                 (UINT32_C(0x2) << 4)
6888         /* 2MB. */
6889         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
6890                 (UINT32_C(0x3) << 4)
6891         /* 8MB. */
6892         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
6893                 (UINT32_C(0x4) << 4)
6894         /* 1GB. */
6895         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
6896                 (UINT32_C(0x5) << 4)
6897         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
6898                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
6899         /* Stat page size and level. */
6900         uint8_t stat_pg_size_stat_lvl;
6901         /* Stat PBL indirect levels. */
6902         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
6903                 UINT32_C(0xf)
6904         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
6905         /* PBL pointer is physical start address. */
6906         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
6907                 UINT32_C(0x0)
6908         /* PBL pointer points to PTE table. */
6909         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
6910                 UINT32_C(0x1)
6911         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6912         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
6913                 UINT32_C(0x2)
6914         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
6915                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
6916         /* Stat page size. */
6917         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
6918                 UINT32_C(0xf0)
6919         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
6920         /* 4KB. */
6921         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
6922                 (UINT32_C(0x0) << 4)
6923         /* 8KB. */
6924         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
6925                 (UINT32_C(0x1) << 4)
6926         /* 64KB. */
6927         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
6928                 (UINT32_C(0x2) << 4)
6929         /* 2MB. */
6930         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
6931                 (UINT32_C(0x3) << 4)
6932         /* 8MB. */
6933         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
6934                 (UINT32_C(0x4) << 4)
6935         /* 1GB. */
6936         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
6937                 (UINT32_C(0x5) << 4)
6938         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
6939                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
6940         /* TQM slow path page size and level. */
6941         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
6942         /* TQM slow path PBL indirect levels. */
6943         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
6944                 UINT32_C(0xf)
6945         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
6946         /* PBL pointer is physical start address. */
6947         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
6948                 UINT32_C(0x0)
6949         /* PBL pointer points to PTE table. */
6950         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
6951                 UINT32_C(0x1)
6952         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6953         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
6954                 UINT32_C(0x2)
6955         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
6956                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
6957         /* TQM slow path page size. */
6958         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
6959                 UINT32_C(0xf0)
6960         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
6961         /* 4KB. */
6962         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
6963                 (UINT32_C(0x0) << 4)
6964         /* 8KB. */
6965         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
6966                 (UINT32_C(0x1) << 4)
6967         /* 64KB. */
6968         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
6969                 (UINT32_C(0x2) << 4)
6970         /* 2MB. */
6971         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
6972                 (UINT32_C(0x3) << 4)
6973         /* 8MB. */
6974         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
6975                 (UINT32_C(0x4) << 4)
6976         /* 1GB. */
6977         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
6978                 (UINT32_C(0x5) << 4)
6979         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
6980                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
6981         /* TQM ring 0 page size and level. */
6982         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
6983         /* TQM ring 0 PBL indirect levels. */
6984         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
6985                 UINT32_C(0xf)
6986         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
6987         /* PBL pointer is physical start address. */
6988         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
6989                 UINT32_C(0x0)
6990         /* PBL pointer points to PTE table. */
6991         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
6992                 UINT32_C(0x1)
6993         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
6994         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
6995                 UINT32_C(0x2)
6996         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
6997                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
6998         /* TQM ring 0 page size. */
6999         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
7000                 UINT32_C(0xf0)
7001         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
7002         /* 4KB. */
7003         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
7004                 (UINT32_C(0x0) << 4)
7005         /* 8KB. */
7006         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
7007                 (UINT32_C(0x1) << 4)
7008         /* 64KB. */
7009         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
7010                 (UINT32_C(0x2) << 4)
7011         /* 2MB. */
7012         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
7013                 (UINT32_C(0x3) << 4)
7014         /* 8MB. */
7015         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
7016                 (UINT32_C(0x4) << 4)
7017         /* 1GB. */
7018         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
7019                 (UINT32_C(0x5) << 4)
7020         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
7021                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
7022         /* TQM ring 1 page size and level. */
7023         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
7024         /* TQM ring 1 PBL indirect levels. */
7025         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
7026                 UINT32_C(0xf)
7027         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
7028         /* PBL pointer is physical start address. */
7029         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
7030                 UINT32_C(0x0)
7031         /* PBL pointer points to PTE table. */
7032         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
7033                 UINT32_C(0x1)
7034         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7035         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
7036                 UINT32_C(0x2)
7037         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
7038                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
7039         /* TQM ring 1 page size. */
7040         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
7041                 UINT32_C(0xf0)
7042         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
7043         /* 4KB. */
7044         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
7045                 (UINT32_C(0x0) << 4)
7046         /* 8KB. */
7047         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
7048                 (UINT32_C(0x1) << 4)
7049         /* 64KB. */
7050         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
7051                 (UINT32_C(0x2) << 4)
7052         /* 2MB. */
7053         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
7054                 (UINT32_C(0x3) << 4)
7055         /* 8MB. */
7056         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
7057                 (UINT32_C(0x4) << 4)
7058         /* 1GB. */
7059         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
7060                 (UINT32_C(0x5) << 4)
7061         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
7062                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
7063         /* TQM ring 2 page size and level. */
7064         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
7065         /* TQM ring 2 PBL indirect levels. */
7066         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
7067                 UINT32_C(0xf)
7068         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
7069         /* PBL pointer is physical start address. */
7070         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
7071                 UINT32_C(0x0)
7072         /* PBL pointer points to PTE table. */
7073         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
7074                 UINT32_C(0x1)
7075         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7076         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
7077                 UINT32_C(0x2)
7078         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
7079                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
7080         /* TQM ring 2 page size. */
7081         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
7082                 UINT32_C(0xf0)
7083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
7084         /* 4KB. */
7085         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
7086                 (UINT32_C(0x0) << 4)
7087         /* 8KB. */
7088         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
7089                 (UINT32_C(0x1) << 4)
7090         /* 64KB. */
7091         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
7092                 (UINT32_C(0x2) << 4)
7093         /* 2MB. */
7094         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
7095                 (UINT32_C(0x3) << 4)
7096         /* 8MB. */
7097         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
7098                 (UINT32_C(0x4) << 4)
7099         /* 1GB. */
7100         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
7101                 (UINT32_C(0x5) << 4)
7102         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
7103                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
7104         /* TQM ring 3 page size and level. */
7105         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
7106         /* TQM ring 3 PBL indirect levels. */
7107         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
7108                 UINT32_C(0xf)
7109         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
7110         /* PBL pointer is physical start address. */
7111         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
7112                 UINT32_C(0x0)
7113         /* PBL pointer points to PTE table. */
7114         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
7115                 UINT32_C(0x1)
7116         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7117         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
7118                 UINT32_C(0x2)
7119         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
7120                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
7121         /* TQM ring 3 page size. */
7122         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
7123                 UINT32_C(0xf0)
7124         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
7125         /* 4KB. */
7126         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
7127                 (UINT32_C(0x0) << 4)
7128         /* 8KB. */
7129         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
7130                 (UINT32_C(0x1) << 4)
7131         /* 64KB. */
7132         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
7133                 (UINT32_C(0x2) << 4)
7134         /* 2MB. */
7135         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
7136                 (UINT32_C(0x3) << 4)
7137         /* 8MB. */
7138         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
7139                 (UINT32_C(0x4) << 4)
7140         /* 1GB. */
7141         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
7142                 (UINT32_C(0x5) << 4)
7143         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
7144                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
7145         /* TQM ring 4 page size and level. */
7146         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
7147         /* TQM ring 4 PBL indirect levels. */
7148         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
7149                 UINT32_C(0xf)
7150         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
7151         /* PBL pointer is physical start address. */
7152         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
7153                 UINT32_C(0x0)
7154         /* PBL pointer points to PTE table. */
7155         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
7156                 UINT32_C(0x1)
7157         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7158         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
7159                 UINT32_C(0x2)
7160         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
7161                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
7162         /* TQM ring 4 page size. */
7163         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
7164                 UINT32_C(0xf0)
7165         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
7166         /* 4KB. */
7167         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
7168                 (UINT32_C(0x0) << 4)
7169         /* 8KB. */
7170         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
7171                 (UINT32_C(0x1) << 4)
7172         /* 64KB. */
7173         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
7174                 (UINT32_C(0x2) << 4)
7175         /* 2MB. */
7176         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
7177                 (UINT32_C(0x3) << 4)
7178         /* 8MB. */
7179         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
7180                 (UINT32_C(0x4) << 4)
7181         /* 1GB. */
7182         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
7183                 (UINT32_C(0x5) << 4)
7184         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
7185                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
7186         /* TQM ring 5 page size and level. */
7187         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
7188         /* TQM ring 5 PBL indirect levels. */
7189         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
7190                 UINT32_C(0xf)
7191         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
7192         /* PBL pointer is physical start address. */
7193         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
7194                 UINT32_C(0x0)
7195         /* PBL pointer points to PTE table. */
7196         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
7197                 UINT32_C(0x1)
7198         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7199         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
7200                 UINT32_C(0x2)
7201         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
7202                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
7203         /* TQM ring 5 page size. */
7204         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
7205                 UINT32_C(0xf0)
7206         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
7207         /* 4KB. */
7208         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
7209                 (UINT32_C(0x0) << 4)
7210         /* 8KB. */
7211         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
7212                 (UINT32_C(0x1) << 4)
7213         /* 64KB. */
7214         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
7215                 (UINT32_C(0x2) << 4)
7216         /* 2MB. */
7217         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
7218                 (UINT32_C(0x3) << 4)
7219         /* 8MB. */
7220         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
7221                 (UINT32_C(0x4) << 4)
7222         /* 1GB. */
7223         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
7224                 (UINT32_C(0x5) << 4)
7225         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
7226                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
7227         /* TQM ring 6 page size and level. */
7228         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
7229         /* TQM ring 6 PBL indirect levels. */
7230         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
7231                 UINT32_C(0xf)
7232         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
7233         /* PBL pointer is physical start address. */
7234         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
7235                 UINT32_C(0x0)
7236         /* PBL pointer points to PTE table. */
7237         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
7238                 UINT32_C(0x1)
7239         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7240         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
7241                 UINT32_C(0x2)
7242         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
7243                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
7244         /* TQM ring 6 page size. */
7245         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
7246                 UINT32_C(0xf0)
7247         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
7248         /* 4KB. */
7249         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
7250                 (UINT32_C(0x0) << 4)
7251         /* 8KB. */
7252         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
7253                 (UINT32_C(0x1) << 4)
7254         /* 64KB. */
7255         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
7256                 (UINT32_C(0x2) << 4)
7257         /* 2MB. */
7258         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
7259                 (UINT32_C(0x3) << 4)
7260         /* 8MB. */
7261         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
7262                 (UINT32_C(0x4) << 4)
7263         /* 1GB. */
7264         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
7265                 (UINT32_C(0x5) << 4)
7266         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
7267                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
7268         /* TQM ring 7 page size and level. */
7269         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
7270         /* TQM ring 7 PBL indirect levels. */
7271         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
7272                 UINT32_C(0xf)
7273         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
7274         /* PBL pointer is physical start address. */
7275         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
7276                 UINT32_C(0x0)
7277         /* PBL pointer points to PTE table. */
7278         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
7279                 UINT32_C(0x1)
7280         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7281         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
7282                 UINT32_C(0x2)
7283         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
7284                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
7285         /* TQM ring 7 page size. */
7286         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
7287                 UINT32_C(0xf0)
7288         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
7289         /* 4KB. */
7290         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
7291                 (UINT32_C(0x0) << 4)
7292         /* 8KB. */
7293         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
7294                 (UINT32_C(0x1) << 4)
7295         /* 64KB. */
7296         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
7297                 (UINT32_C(0x2) << 4)
7298         /* 2MB. */
7299         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
7300                 (UINT32_C(0x3) << 4)
7301         /* 8MB. */
7302         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
7303                 (UINT32_C(0x4) << 4)
7304         /* 1GB. */
7305         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
7306                 (UINT32_C(0x5) << 4)
7307         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
7308                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
7309         /* MR/AV page size and level. */
7310         uint8_t mrav_pg_size_mrav_lvl;
7311         /* MR/AV PBL indirect levels. */
7312         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
7313                 UINT32_C(0xf)
7314         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
7315         /* PBL pointer is physical start address. */
7316         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
7317                 UINT32_C(0x0)
7318         /* PBL pointer points to PTE table. */
7319         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
7320                 UINT32_C(0x1)
7321         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7322         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
7323                 UINT32_C(0x2)
7324         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
7325                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
7326         /* MR/AV page size. */
7327         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
7328                 UINT32_C(0xf0)
7329         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
7330         /* 4KB. */
7331         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
7332                 (UINT32_C(0x0) << 4)
7333         /* 8KB. */
7334         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
7335                 (UINT32_C(0x1) << 4)
7336         /* 64KB. */
7337         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
7338                 (UINT32_C(0x2) << 4)
7339         /* 2MB. */
7340         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
7341                 (UINT32_C(0x3) << 4)
7342         /* 8MB. */
7343         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
7344                 (UINT32_C(0x4) << 4)
7345         /* 1GB. */
7346         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
7347                 (UINT32_C(0x5) << 4)
7348         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
7349                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
7350         /* Timer page size and level. */
7351         uint8_t tim_pg_size_tim_lvl;
7352         /* Timer PBL indirect levels. */
7353         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
7354                 UINT32_C(0xf)
7355         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
7356         /* PBL pointer is physical start address. */
7357         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
7358                 UINT32_C(0x0)
7359         /* PBL pointer points to PTE table. */
7360         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
7361                 UINT32_C(0x1)
7362         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7363         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
7364                 UINT32_C(0x2)
7365         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
7366                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
7367         /* Timer page size. */
7368         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
7369                 UINT32_C(0xf0)
7370         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
7371         /* 4KB. */
7372         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
7373                 (UINT32_C(0x0) << 4)
7374         /* 8KB. */
7375         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
7376                 (UINT32_C(0x1) << 4)
7377         /* 64KB. */
7378         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
7379                 (UINT32_C(0x2) << 4)
7380         /* 2MB. */
7381         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
7382                 (UINT32_C(0x3) << 4)
7383         /* 8MB. */
7384         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
7385                 (UINT32_C(0x4) << 4)
7386         /* 1GB. */
7387         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
7388                 (UINT32_C(0x5) << 4)
7389         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
7390                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
7391         /* QP page directory. */
7392         uint64_t        qpc_page_dir;
7393         /* SRQ page directory. */
7394         uint64_t        srq_page_dir;
7395         /* CQ page directory. */
7396         uint64_t        cq_page_dir;
7397         /* VNIC page directory. */
7398         uint64_t        vnic_page_dir;
7399         /* Stat page directory. */
7400         uint64_t        stat_page_dir;
7401         /* TQM slowpath page directory. */
7402         uint64_t        tqm_sp_page_dir;
7403         /* TQM ring 0 page directory. */
7404         uint64_t        tqm_ring0_page_dir;
7405         /* TQM ring 1 page directory. */
7406         uint64_t        tqm_ring1_page_dir;
7407         /* TQM ring 2 page directory. */
7408         uint64_t        tqm_ring2_page_dir;
7409         /* TQM ring 3 page directory. */
7410         uint64_t        tqm_ring3_page_dir;
7411         /* TQM ring 4 page directory. */
7412         uint64_t        tqm_ring4_page_dir;
7413         /* TQM ring 5 page directory. */
7414         uint64_t        tqm_ring5_page_dir;
7415         /* TQM ring 6 page directory. */
7416         uint64_t        tqm_ring6_page_dir;
7417         /* TQM ring 7 page directory. */
7418         uint64_t        tqm_ring7_page_dir;
7419         /* MR/AV page directory. */
7420         uint64_t        mrav_page_dir;
7421         /* Timer page directory. */
7422         uint64_t        tim_page_dir;
7423         /* Number of QPs. */
7424         uint32_t        qp_num_entries;
7425         /* Number of SRQs. */
7426         uint32_t        srq_num_entries;
7427         /* Number of CQs. */
7428         uint32_t        cq_num_entries;
7429         /* Number of Stats. */
7430         uint32_t        stat_num_entries;
7431         /* Number of TQM slowpath entries. */
7432         uint32_t        tqm_sp_num_entries;
7433         /* Number of TQM ring 0 entries. */
7434         uint32_t        tqm_ring0_num_entries;
7435         /* Number of TQM ring 1 entries. */
7436         uint32_t        tqm_ring1_num_entries;
7437         /* Number of TQM ring 2 entries. */
7438         uint32_t        tqm_ring2_num_entries;
7439         /* Number of TQM ring 3 entries. */
7440         uint32_t        tqm_ring3_num_entries;
7441         /* Number of TQM ring 4 entries. */
7442         uint32_t        tqm_ring4_num_entries;
7443         /* Number of TQM ring 5 entries. */
7444         uint32_t        tqm_ring5_num_entries;
7445         /* Number of TQM ring 6 entries. */
7446         uint32_t        tqm_ring6_num_entries;
7447         /* Number of TQM ring 7 entries. */
7448         uint32_t        tqm_ring7_num_entries;
7449         /* Number of MR/AV entries. */
7450         uint32_t        mrav_num_entries;
7451         /* Number of Timer entries. */
7452         uint32_t        tim_num_entries;
7453         /* Number of entries to reserve for QP1 */
7454         uint16_t        qp_num_qp1_entries;
7455         /* Number of entries to reserve for L2 */
7456         uint16_t        qp_num_l2_entries;
7457         /* Number of bytes that have been allocated for each context entry. */
7458         uint16_t        qp_entry_size;
7459         /* Number of entries to reserve for L2 */
7460         uint16_t        srq_num_l2_entries;
7461         /* Number of bytes that have been allocated for each context entry. */
7462         uint16_t        srq_entry_size;
7463         /* Number of entries to reserve for L2 */
7464         uint16_t        cq_num_l2_entries;
7465         /* Number of bytes that have been allocated for each context entry. */
7466         uint16_t        cq_entry_size;
7467         /* Number of entries to reserve for VNIC entries */
7468         uint16_t        vnic_num_vnic_entries;
7469         /* Number of entries to reserve for Ring table entries */
7470         uint16_t        vnic_num_ring_table_entries;
7471         /* Number of bytes that have been allocated for each context entry. */
7472         uint16_t        vnic_entry_size;
7473         /* Number of bytes that have been allocated for each context entry. */
7474         uint16_t        stat_entry_size;
7475         /* Number of bytes that have been allocated for each context entry. */
7476         uint16_t        tqm_entry_size;
7477         /* Number of bytes that have been allocated for each context entry. */
7478         uint16_t        mrav_entry_size;
7479         /* Number of bytes that have been allocated for each context entry. */
7480         uint16_t        tim_entry_size;
7481 } __attribute__((packed));
7482
7483 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
7484 struct hwrm_func_backing_store_cfg_output {
7485         /* The specific error status for the command. */
7486         uint16_t        error_code;
7487         /* The HWRM command request type. */
7488         uint16_t        req_type;
7489         /* The sequence ID from the original command. */
7490         uint16_t        seq_id;
7491         /* The length of the response data in number of bytes. */
7492         uint16_t        resp_len;
7493         uint8_t unused_0[7];
7494         /*
7495          * This field is used in Output records to indicate that the output
7496          * is completely written to RAM.  This field should be read as '1'
7497          * to indicate that the output has been completely written.
7498          * When writing a command completion or response to an internal processor,
7499          * the order of writes has to be such that this field is written last.
7500          */
7501         uint8_t valid;
7502 } __attribute__((packed));
7503
7504 /********************************
7505  * hwrm_func_backing_store_qcfg *
7506  ********************************/
7507
7508
7509 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
7510 struct hwrm_func_backing_store_qcfg_input {
7511         /* The HWRM command request type. */
7512         uint16_t        req_type;
7513         /*
7514          * The completion ring to send the completion event on. This should
7515          * be the NQ ID returned from the `nq_alloc` HWRM command.
7516          */
7517         uint16_t        cmpl_ring;
7518         /*
7519          * The sequence ID is used by the driver for tracking multiple
7520          * commands. This ID is treated as opaque data by the firmware and
7521          * the value is returned in the `hwrm_resp_hdr` upon completion.
7522          */
7523         uint16_t        seq_id;
7524         /*
7525          * The target ID of the command:
7526          * * 0x0-0xFFF8 - The function ID
7527          * * 0xFFF8-0xFFFE - Reserved for internal processors
7528          * * 0xFFFF - HWRM
7529          */
7530         uint16_t        target_id;
7531         /*
7532          * A physical address pointer pointing to a host buffer that the
7533          * command's response data will be written. This can be either a host
7534          * physical address (HPA) or a guest physical address (GPA) and must
7535          * point to a physically contiguous block of memory.
7536          */
7537         uint64_t        resp_addr;
7538 } __attribute__((packed));
7539
7540 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
7541 struct hwrm_func_backing_store_qcfg_output {
7542         /* The specific error status for the command. */
7543         uint16_t        error_code;
7544         /* The HWRM command request type. */
7545         uint16_t        req_type;
7546         /* The sequence ID from the original command. */
7547         uint16_t        seq_id;
7548         /* The length of the response data in number of bytes. */
7549         uint16_t        resp_len;
7550         uint32_t        flags;
7551         /*
7552          * When set, the firmware only uses on-chip resources and does not
7553          * expect any backing store to be provided by the host driver. This
7554          * mode provides minimal L2 functionality (e.g. limited L2 resources,
7555          * no RoCE).
7556          */
7557         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
7558                 UINT32_C(0x1)
7559         uint8_t unused_0[4];
7560         /*
7561          * This bit must be '1' for the qp fields to be
7562          * configured.
7563          */
7564         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
7565                 UINT32_C(0x1)
7566         /*
7567          * This bit must be '1' for the srq fields to be
7568          * configured.
7569          */
7570         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
7571                 UINT32_C(0x2)
7572         /*
7573          * This bit must be '1' for the cq fields to be
7574          * configured.
7575          */
7576         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
7577                 UINT32_C(0x4)
7578         /*
7579          * This bit must be '1' for the vnic fields to be
7580          * configured.
7581          */
7582         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
7583                 UINT32_C(0x8)
7584         /*
7585          * This bit must be '1' for the stat fields to be
7586          * configured.
7587          */
7588         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
7589                 UINT32_C(0x10)
7590         /*
7591          * This bit must be '1' for the tqm_sp fields to be
7592          * configured.
7593          */
7594         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
7595                 UINT32_C(0x20)
7596         /*
7597          * This bit must be '1' for the tqm_ring0 fields to be
7598          * configured.
7599          */
7600         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
7601                 UINT32_C(0x40)
7602         /*
7603          * This bit must be '1' for the tqm_ring1 fields to be
7604          * configured.
7605          */
7606         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
7607                 UINT32_C(0x80)
7608         /*
7609          * This bit must be '1' for the tqm_ring2 fields to be
7610          * configured.
7611          */
7612         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
7613                 UINT32_C(0x100)
7614         /*
7615          * This bit must be '1' for the tqm_ring3 fields to be
7616          * configured.
7617          */
7618         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
7619                 UINT32_C(0x200)
7620         /*
7621          * This bit must be '1' for the tqm_ring4 fields to be
7622          * configured.
7623          */
7624         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
7625                 UINT32_C(0x400)
7626         /*
7627          * This bit must be '1' for the tqm_ring5 fields to be
7628          * configured.
7629          */
7630         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
7631                 UINT32_C(0x800)
7632         /*
7633          * This bit must be '1' for the tqm_ring6 fields to be
7634          * configured.
7635          */
7636         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
7637                 UINT32_C(0x1000)
7638         /*
7639          * This bit must be '1' for the tqm_ring7 fields to be
7640          * configured.
7641          */
7642         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
7643                 UINT32_C(0x2000)
7644         /*
7645          * This bit must be '1' for the mrav fields to be
7646          * configured.
7647          */
7648         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
7649                 UINT32_C(0x4000)
7650         /*
7651          * This bit must be '1' for the tim fields to be
7652          * configured.
7653          */
7654         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
7655                 UINT32_C(0x8000)
7656         /* QPC page size and level. */
7657         uint8_t qpc_pg_size_qpc_lvl;
7658         /* QPC PBL indirect levels. */
7659         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
7660                 UINT32_C(0xf)
7661         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
7662         /* PBL pointer is physical start address. */
7663         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
7664                 UINT32_C(0x0)
7665         /* PBL pointer points to PTE table. */
7666         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
7667                 UINT32_C(0x1)
7668         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7669         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
7670                 UINT32_C(0x2)
7671         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
7672                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
7673         /* QPC page size. */
7674         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
7675                 UINT32_C(0xf0)
7676         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
7677         /* 4KB. */
7678         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
7679                 (UINT32_C(0x0) << 4)
7680         /* 8KB. */
7681         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
7682                 (UINT32_C(0x1) << 4)
7683         /* 64KB. */
7684         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
7685                 (UINT32_C(0x2) << 4)
7686         /* 2MB. */
7687         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
7688                 (UINT32_C(0x3) << 4)
7689         /* 8MB. */
7690         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
7691                 (UINT32_C(0x4) << 4)
7692         /* 1GB. */
7693         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
7694                 (UINT32_C(0x5) << 4)
7695         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
7696                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
7697         /* SRQ page size and level. */
7698         uint8_t srq_pg_size_srq_lvl;
7699         /* SRQ PBL indirect levels. */
7700         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
7701                 UINT32_C(0xf)
7702         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
7703         /* PBL pointer is physical start address. */
7704         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
7705                 UINT32_C(0x0)
7706         /* PBL pointer points to PTE table. */
7707         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
7708                 UINT32_C(0x1)
7709         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7710         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
7711                 UINT32_C(0x2)
7712         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
7713                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
7714         /* SRQ page size. */
7715         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
7716                 UINT32_C(0xf0)
7717         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
7718         /* 4KB. */
7719         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
7720                 (UINT32_C(0x0) << 4)
7721         /* 8KB. */
7722         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
7723                 (UINT32_C(0x1) << 4)
7724         /* 64KB. */
7725         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
7726                 (UINT32_C(0x2) << 4)
7727         /* 2MB. */
7728         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
7729                 (UINT32_C(0x3) << 4)
7730         /* 8MB. */
7731         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
7732                 (UINT32_C(0x4) << 4)
7733         /* 1GB. */
7734         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
7735                 (UINT32_C(0x5) << 4)
7736         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
7737                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
7738         /* CQ page size and level. */
7739         uint8_t cq_pg_size_cq_lvl;
7740         /* CQ PBL indirect levels. */
7741         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
7742                 UINT32_C(0xf)
7743         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
7744         /* PBL pointer is physical start address. */
7745         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
7746                 UINT32_C(0x0)
7747         /* PBL pointer points to PTE table. */
7748         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
7749                 UINT32_C(0x1)
7750         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7751         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
7752                 UINT32_C(0x2)
7753         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
7754                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
7755         /* CQ page size. */
7756         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
7757                 UINT32_C(0xf0)
7758         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
7759         /* 4KB. */
7760         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
7761                 (UINT32_C(0x0) << 4)
7762         /* 8KB. */
7763         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
7764                 (UINT32_C(0x1) << 4)
7765         /* 64KB. */
7766         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
7767                 (UINT32_C(0x2) << 4)
7768         /* 2MB. */
7769         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
7770                 (UINT32_C(0x3) << 4)
7771         /* 8MB. */
7772         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
7773                 (UINT32_C(0x4) << 4)
7774         /* 1GB. */
7775         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
7776                 (UINT32_C(0x5) << 4)
7777         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
7778                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
7779         /* VNIC page size and level. */
7780         uint8_t vnic_pg_size_vnic_lvl;
7781         /* VNIC PBL indirect levels. */
7782         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
7783                 UINT32_C(0xf)
7784         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
7785         /* PBL pointer is physical start address. */
7786         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
7787                 UINT32_C(0x0)
7788         /* PBL pointer points to PTE table. */
7789         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
7790                 UINT32_C(0x1)
7791         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7792         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
7793                 UINT32_C(0x2)
7794         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
7795                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
7796         /* VNIC page size. */
7797         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
7798                 UINT32_C(0xf0)
7799         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
7800         /* 4KB. */
7801         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
7802                 (UINT32_C(0x0) << 4)
7803         /* 8KB. */
7804         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
7805                 (UINT32_C(0x1) << 4)
7806         /* 64KB. */
7807         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
7808                 (UINT32_C(0x2) << 4)
7809         /* 2MB. */
7810         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
7811                 (UINT32_C(0x3) << 4)
7812         /* 8MB. */
7813         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
7814                 (UINT32_C(0x4) << 4)
7815         /* 1GB. */
7816         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
7817                 (UINT32_C(0x5) << 4)
7818         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
7819                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
7820         /* Stat page size and level. */
7821         uint8_t stat_pg_size_stat_lvl;
7822         /* Stat PBL indirect levels. */
7823         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
7824                 UINT32_C(0xf)
7825         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
7826         /* PBL pointer is physical start address. */
7827         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
7828                 UINT32_C(0x0)
7829         /* PBL pointer points to PTE table. */
7830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
7831                 UINT32_C(0x1)
7832         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7833         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
7834                 UINT32_C(0x2)
7835         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
7836                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
7837         /* Stat page size. */
7838         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
7839                 UINT32_C(0xf0)
7840         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
7841         /* 4KB. */
7842         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
7843                 (UINT32_C(0x0) << 4)
7844         /* 8KB. */
7845         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
7846                 (UINT32_C(0x1) << 4)
7847         /* 64KB. */
7848         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
7849                 (UINT32_C(0x2) << 4)
7850         /* 2MB. */
7851         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
7852                 (UINT32_C(0x3) << 4)
7853         /* 8MB. */
7854         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
7855                 (UINT32_C(0x4) << 4)
7856         /* 1GB. */
7857         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
7858                 (UINT32_C(0x5) << 4)
7859         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
7860                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
7861         /* TQM slow path page size and level. */
7862         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
7863         /* TQM slow path PBL indirect levels. */
7864         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
7865                 UINT32_C(0xf)
7866         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
7867         /* PBL pointer is physical start address. */
7868         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
7869                 UINT32_C(0x0)
7870         /* PBL pointer points to PTE table. */
7871         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
7872                 UINT32_C(0x1)
7873         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7874         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
7875                 UINT32_C(0x2)
7876         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
7877                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
7878         /* TQM slow path page size. */
7879         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
7880                 UINT32_C(0xf0)
7881         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
7882         /* 4KB. */
7883         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
7884                 (UINT32_C(0x0) << 4)
7885         /* 8KB. */
7886         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
7887                 (UINT32_C(0x1) << 4)
7888         /* 64KB. */
7889         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
7890                 (UINT32_C(0x2) << 4)
7891         /* 2MB. */
7892         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
7893                 (UINT32_C(0x3) << 4)
7894         /* 8MB. */
7895         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
7896                 (UINT32_C(0x4) << 4)
7897         /* 1GB. */
7898         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
7899                 (UINT32_C(0x5) << 4)
7900         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
7901                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
7902         /* TQM ring 0 page size and level. */
7903         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
7904         /* TQM ring 0 PBL indirect levels. */
7905         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
7906                 UINT32_C(0xf)
7907         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
7908         /* PBL pointer is physical start address. */
7909         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
7910                 UINT32_C(0x0)
7911         /* PBL pointer points to PTE table. */
7912         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
7913                 UINT32_C(0x1)
7914         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7915         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
7916                 UINT32_C(0x2)
7917         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
7918                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
7919         /* TQM ring 0 page size. */
7920         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
7921                 UINT32_C(0xf0)
7922         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
7923         /* 4KB. */
7924         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
7925                 (UINT32_C(0x0) << 4)
7926         /* 8KB. */
7927         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
7928                 (UINT32_C(0x1) << 4)
7929         /* 64KB. */
7930         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
7931                 (UINT32_C(0x2) << 4)
7932         /* 2MB. */
7933         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
7934                 (UINT32_C(0x3) << 4)
7935         /* 8MB. */
7936         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
7937                 (UINT32_C(0x4) << 4)
7938         /* 1GB. */
7939         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
7940                 (UINT32_C(0x5) << 4)
7941         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
7942                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
7943         /* TQM ring 1 page size and level. */
7944         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
7945         /* TQM ring 1 PBL indirect levels. */
7946         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
7947                 UINT32_C(0xf)
7948         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
7949         /* PBL pointer is physical start address. */
7950         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
7951                 UINT32_C(0x0)
7952         /* PBL pointer points to PTE table. */
7953         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
7954                 UINT32_C(0x1)
7955         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7956         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
7957                 UINT32_C(0x2)
7958         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
7959                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
7960         /* TQM ring 1 page size. */
7961         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
7962                 UINT32_C(0xf0)
7963         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
7964         /* 4KB. */
7965         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
7966                 (UINT32_C(0x0) << 4)
7967         /* 8KB. */
7968         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
7969                 (UINT32_C(0x1) << 4)
7970         /* 64KB. */
7971         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
7972                 (UINT32_C(0x2) << 4)
7973         /* 2MB. */
7974         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
7975                 (UINT32_C(0x3) << 4)
7976         /* 8MB. */
7977         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
7978                 (UINT32_C(0x4) << 4)
7979         /* 1GB. */
7980         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
7981                 (UINT32_C(0x5) << 4)
7982         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
7983                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
7984         /* TQM ring 2 page size and level. */
7985         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
7986         /* TQM ring 2 PBL indirect levels. */
7987         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
7988                 UINT32_C(0xf)
7989         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
7990         /* PBL pointer is physical start address. */
7991         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
7992                 UINT32_C(0x0)
7993         /* PBL pointer points to PTE table. */
7994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
7995                 UINT32_C(0x1)
7996         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
7997         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
7998                 UINT32_C(0x2)
7999         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
8000                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
8001         /* TQM ring 2 page size. */
8002         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
8003                 UINT32_C(0xf0)
8004         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
8005         /* 4KB. */
8006         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
8007                 (UINT32_C(0x0) << 4)
8008         /* 8KB. */
8009         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
8010                 (UINT32_C(0x1) << 4)
8011         /* 64KB. */
8012         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
8013                 (UINT32_C(0x2) << 4)
8014         /* 2MB. */
8015         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
8016                 (UINT32_C(0x3) << 4)
8017         /* 8MB. */
8018         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
8019                 (UINT32_C(0x4) << 4)
8020         /* 1GB. */
8021         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
8022                 (UINT32_C(0x5) << 4)
8023         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
8024                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
8025         /* TQM ring 3 page size and level. */
8026         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
8027         /* TQM ring 3 PBL indirect levels. */
8028         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
8029                 UINT32_C(0xf)
8030         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
8031         /* PBL pointer is physical start address. */
8032         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
8033                 UINT32_C(0x0)
8034         /* PBL pointer points to PTE table. */
8035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
8036                 UINT32_C(0x1)
8037         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8038         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
8039                 UINT32_C(0x2)
8040         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
8041                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
8042         /* TQM ring 3 page size. */
8043         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
8044                 UINT32_C(0xf0)
8045         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
8046         /* 4KB. */
8047         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
8048                 (UINT32_C(0x0) << 4)
8049         /* 8KB. */
8050         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
8051                 (UINT32_C(0x1) << 4)
8052         /* 64KB. */
8053         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
8054                 (UINT32_C(0x2) << 4)
8055         /* 2MB. */
8056         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
8057                 (UINT32_C(0x3) << 4)
8058         /* 8MB. */
8059         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
8060                 (UINT32_C(0x4) << 4)
8061         /* 1GB. */
8062         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
8063                 (UINT32_C(0x5) << 4)
8064         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
8065                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
8066         /* TQM ring 4 page size and level. */
8067         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
8068         /* TQM ring 4 PBL indirect levels. */
8069         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
8070                 UINT32_C(0xf)
8071         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
8072         /* PBL pointer is physical start address. */
8073         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
8074                 UINT32_C(0x0)
8075         /* PBL pointer points to PTE table. */
8076         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
8077                 UINT32_C(0x1)
8078         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8079         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
8080                 UINT32_C(0x2)
8081         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
8082                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
8083         /* TQM ring 4 page size. */
8084         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
8085                 UINT32_C(0xf0)
8086         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
8087         /* 4KB. */
8088         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
8089                 (UINT32_C(0x0) << 4)
8090         /* 8KB. */
8091         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
8092                 (UINT32_C(0x1) << 4)
8093         /* 64KB. */
8094         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
8095                 (UINT32_C(0x2) << 4)
8096         /* 2MB. */
8097         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
8098                 (UINT32_C(0x3) << 4)
8099         /* 8MB. */
8100         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
8101                 (UINT32_C(0x4) << 4)
8102         /* 1GB. */
8103         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
8104                 (UINT32_C(0x5) << 4)
8105         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
8106                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
8107         /* TQM ring 5 page size and level. */
8108         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
8109         /* TQM ring 5 PBL indirect levels. */
8110         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
8111                 UINT32_C(0xf)
8112         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
8113         /* PBL pointer is physical start address. */
8114         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
8115                 UINT32_C(0x0)
8116         /* PBL pointer points to PTE table. */
8117         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
8118                 UINT32_C(0x1)
8119         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8120         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
8121                 UINT32_C(0x2)
8122         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
8123                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
8124         /* TQM ring 5 page size. */
8125         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
8126                 UINT32_C(0xf0)
8127         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
8128         /* 4KB. */
8129         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
8130                 (UINT32_C(0x0) << 4)
8131         /* 8KB. */
8132         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
8133                 (UINT32_C(0x1) << 4)
8134         /* 64KB. */
8135         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
8136                 (UINT32_C(0x2) << 4)
8137         /* 2MB. */
8138         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
8139                 (UINT32_C(0x3) << 4)
8140         /* 8MB. */
8141         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
8142                 (UINT32_C(0x4) << 4)
8143         /* 1GB. */
8144         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
8145                 (UINT32_C(0x5) << 4)
8146         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
8147                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
8148         /* TQM ring 6 page size and level. */
8149         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
8150         /* TQM ring 6 PBL indirect levels. */
8151         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
8152                 UINT32_C(0xf)
8153         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
8154         /* PBL pointer is physical start address. */
8155         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
8156                 UINT32_C(0x0)
8157         /* PBL pointer points to PTE table. */
8158         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
8159                 UINT32_C(0x1)
8160         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8161         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
8162                 UINT32_C(0x2)
8163         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
8164                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
8165         /* TQM ring 6 page size. */
8166         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
8167                 UINT32_C(0xf0)
8168         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
8169         /* 4KB. */
8170         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
8171                 (UINT32_C(0x0) << 4)
8172         /* 8KB. */
8173         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
8174                 (UINT32_C(0x1) << 4)
8175         /* 64KB. */
8176         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
8177                 (UINT32_C(0x2) << 4)
8178         /* 2MB. */
8179         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
8180                 (UINT32_C(0x3) << 4)
8181         /* 8MB. */
8182         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
8183                 (UINT32_C(0x4) << 4)
8184         /* 1GB. */
8185         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
8186                 (UINT32_C(0x5) << 4)
8187         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
8188                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
8189         /* TQM ring 7 page size and level. */
8190         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
8191         /* TQM ring 7 PBL indirect levels. */
8192         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
8193                 UINT32_C(0xf)
8194         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
8195         /* PBL pointer is physical start address. */
8196         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
8197                 UINT32_C(0x0)
8198         /* PBL pointer points to PTE table. */
8199         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
8200                 UINT32_C(0x1)
8201         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8202         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
8203                 UINT32_C(0x2)
8204         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
8205                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
8206         /* TQM ring 7 page size. */
8207         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
8208                 UINT32_C(0xf0)
8209         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
8210         /* 4KB. */
8211         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
8212                 (UINT32_C(0x0) << 4)
8213         /* 8KB. */
8214         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
8215                 (UINT32_C(0x1) << 4)
8216         /* 64KB. */
8217         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
8218                 (UINT32_C(0x2) << 4)
8219         /* 2MB. */
8220         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
8221                 (UINT32_C(0x3) << 4)
8222         /* 8MB. */
8223         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
8224                 (UINT32_C(0x4) << 4)
8225         /* 1GB. */
8226         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
8227                 (UINT32_C(0x5) << 4)
8228         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
8229                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
8230         /* MR/AV page size and level. */
8231         uint8_t mrav_pg_size_mrav_lvl;
8232         /* MR/AV PBL indirect levels. */
8233         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
8234                 UINT32_C(0xf)
8235         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
8236         /* PBL pointer is physical start address. */
8237         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
8238                 UINT32_C(0x0)
8239         /* PBL pointer points to PTE table. */
8240         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
8241                 UINT32_C(0x1)
8242         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8243         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
8244                 UINT32_C(0x2)
8245         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
8246                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
8247         /* MR/AV page size. */
8248         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
8249                 UINT32_C(0xf0)
8250         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
8251         /* 4KB. */
8252         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
8253                 (UINT32_C(0x0) << 4)
8254         /* 8KB. */
8255         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
8256                 (UINT32_C(0x1) << 4)
8257         /* 64KB. */
8258         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
8259                 (UINT32_C(0x2) << 4)
8260         /* 2MB. */
8261         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
8262                 (UINT32_C(0x3) << 4)
8263         /* 8MB. */
8264         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
8265                 (UINT32_C(0x4) << 4)
8266         /* 1GB. */
8267         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
8268                 (UINT32_C(0x5) << 4)
8269         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
8270                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
8271         /* Timer page size and level. */
8272         uint8_t tim_pg_size_tim_lvl;
8273         /* Timer PBL indirect levels. */
8274         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
8275                 UINT32_C(0xf)
8276         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
8277         /* PBL pointer is physical start address. */
8278         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
8279                 UINT32_C(0x0)
8280         /* PBL pointer points to PTE table. */
8281         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
8282                 UINT32_C(0x1)
8283         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
8284         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
8285                 UINT32_C(0x2)
8286         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
8287                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
8288         /* Timer page size. */
8289         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
8290                 UINT32_C(0xf0)
8291         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
8292         /* 4KB. */
8293         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
8294                 (UINT32_C(0x0) << 4)
8295         /* 8KB. */
8296         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
8297                 (UINT32_C(0x1) << 4)
8298         /* 64KB. */
8299         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
8300                 (UINT32_C(0x2) << 4)
8301         /* 2MB. */
8302         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
8303                 (UINT32_C(0x3) << 4)
8304         /* 8MB. */
8305         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
8306                 (UINT32_C(0x4) << 4)
8307         /* 1GB. */
8308         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
8309                 (UINT32_C(0x5) << 4)
8310         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
8311                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
8312         /* QP page directory. */
8313         uint64_t        qpc_page_dir;
8314         /* SRQ page directory. */
8315         uint64_t        srq_page_dir;
8316         /* CQ page directory. */
8317         uint64_t        cq_page_dir;
8318         /* VNIC page directory. */
8319         uint64_t        vnic_page_dir;
8320         /* Stat page directory. */
8321         uint64_t        stat_page_dir;
8322         /* TQM slowpath page directory. */
8323         uint64_t        tqm_sp_page_dir;
8324         /* TQM ring 0 page directory. */
8325         uint64_t        tqm_ring0_page_dir;
8326         /* TQM ring 1 page directory. */
8327         uint64_t        tqm_ring1_page_dir;
8328         /* TQM ring 2 page directory. */
8329         uint64_t        tqm_ring2_page_dir;
8330         /* TQM ring 3 page directory. */
8331         uint64_t        tqm_ring3_page_dir;
8332         /* TQM ring 4 page directory. */
8333         uint64_t        tqm_ring4_page_dir;
8334         /* TQM ring 5 page directory. */
8335         uint64_t        tqm_ring5_page_dir;
8336         /* TQM ring 6 page directory. */
8337         uint64_t        tqm_ring6_page_dir;
8338         /* TQM ring 7 page directory. */
8339         uint64_t        tqm_ring7_page_dir;
8340         /* MR/AV page directory. */
8341         uint64_t        mrav_page_dir;
8342         /* Timer page directory. */
8343         uint64_t        tim_page_dir;
8344         /* Number of entries to reserve for QP1 */
8345         uint16_t        qp_num_qp1_entries;
8346         /* Number of entries to reserve for L2 */
8347         uint16_t        qp_num_l2_entries;
8348         /* Number of QPs. */
8349         uint32_t        qp_num_entries;
8350         /* Number of SRQs. */
8351         uint32_t        srq_num_entries;
8352         /* Number of entries to reserve for L2 */
8353         uint16_t        srq_num_l2_entries;
8354         /* Number of entries to reserve for L2 */
8355         uint16_t        cq_num_l2_entries;
8356         /* Number of CQs. */
8357         uint32_t        cq_num_entries;
8358         /* Number of entries to reserve for VNIC entries */
8359         uint16_t        vnic_num_vnic_entries;
8360         /* Number of entries to reserve for Ring table entries */
8361         uint16_t        vnic_num_ring_table_entries;
8362         /* Number of Stats. */
8363         uint32_t        stat_num_entries;
8364         /* Number of TQM slowpath entries. */
8365         uint32_t        tqm_sp_num_entries;
8366         /* Number of TQM ring 0 entries. */
8367         uint32_t        tqm_ring0_num_entries;
8368         /* Number of TQM ring 1 entries. */
8369         uint32_t        tqm_ring1_num_entries;
8370         /* Number of TQM ring 2 entries. */
8371         uint32_t        tqm_ring2_num_entries;
8372         /* Number of TQM ring 3 entries. */
8373         uint32_t        tqm_ring3_num_entries;
8374         /* Number of TQM ring 4 entries. */
8375         uint32_t        tqm_ring4_num_entries;
8376         /* Number of TQM ring 5 entries. */
8377         uint32_t        tqm_ring5_num_entries;
8378         /* Number of TQM ring 6 entries. */
8379         uint32_t        tqm_ring6_num_entries;
8380         /* Number of TQM ring 7 entries. */
8381         uint32_t        tqm_ring7_num_entries;
8382         /* Number of MR/AV entries. */
8383         uint32_t        mrav_num_entries;
8384         /* Number of Timer entries. */
8385         uint32_t        tim_num_entries;
8386         uint8_t unused_1[7];
8387         /*
8388          * This field is used in Output records to indicate that the output
8389          * is completely written to RAM.  This field should be read as '1'
8390          * to indicate that the output has been completely written.
8391          * When writing a command completion or response to an internal processor,
8392          * the order of writes has to be such that this field is written last.
8393          */
8394         uint8_t valid;
8395 } __attribute__((packed));
8396
8397 /*********************
8398  * hwrm_port_phy_cfg *
8399  *********************/
8400
8401
8402 /* hwrm_port_phy_cfg_input (size:448b/56B) */
8403 struct hwrm_port_phy_cfg_input {
8404         /* The HWRM command request type. */
8405         uint16_t        req_type;
8406         /*
8407          * The completion ring to send the completion event on. This should
8408          * be the NQ ID returned from the `nq_alloc` HWRM command.
8409          */
8410         uint16_t        cmpl_ring;
8411         /*
8412          * The sequence ID is used by the driver for tracking multiple
8413          * commands. This ID is treated as opaque data by the firmware and
8414          * the value is returned in the `hwrm_resp_hdr` upon completion.
8415          */
8416         uint16_t        seq_id;
8417         /*
8418          * The target ID of the command:
8419          * * 0x0-0xFFF8 - The function ID
8420          * * 0xFFF8-0xFFFE - Reserved for internal processors
8421          * * 0xFFFF - HWRM
8422          */
8423         uint16_t        target_id;
8424         /*
8425          * A physical address pointer pointing to a host buffer that the
8426          * command's response data will be written. This can be either a host
8427          * physical address (HPA) or a guest physical address (GPA) and must
8428          * point to a physically contiguous block of memory.
8429          */
8430         uint64_t        resp_addr;
8431         uint32_t        flags;
8432         /*
8433          * When this bit is set to '1', the PHY for the port shall
8434          * be reset.
8435          *
8436          * # If this bit is set to 1, then the HWRM shall reset the
8437          * PHY after applying PHY configuration changes specified
8438          * in this command.
8439          * # In order to guarantee that PHY configuration changes
8440          * specified in this command take effect, the HWRM
8441          * client should set this flag to 1.
8442          * # If this bit is not set to 1, then the HWRM may reset
8443          * the PHY depending on the current PHY configuration and
8444          * settings specified in this command.
8445          */
8446         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
8447                 UINT32_C(0x1)
8448         /* deprecated bit.  Do not use!!! */
8449         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
8450                 UINT32_C(0x2)
8451         /*
8452          * When this bit is set to '1', the link shall be forced to
8453          * the force_link_speed value.
8454          *
8455          * When this bit is set to '1', the HWRM client should
8456          * not enable any of the auto negotiation related
8457          * fields represented by auto_XXX fields in this command.
8458          * When this bit is set to '1' and the HWRM client has
8459          * enabled a auto_XXX field in this command, then the
8460          * HWRM shall ignore the enabled auto_XXX field.
8461          *
8462          * When this bit is set to zero, the link
8463          * shall be allowed to autoneg.
8464          */
8465         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
8466                 UINT32_C(0x4)
8467         /*
8468          * When this bit is set to '1', the auto-negotiation process
8469          * shall be restarted on the link.
8470          */
8471         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
8472                 UINT32_C(0x8)
8473         /*
8474          * When this bit is set to '1', Energy Efficient Ethernet
8475          * (EEE) is requested to be enabled on this link.
8476          * If EEE is not supported on this port, then this flag
8477          * shall be ignored by the HWRM.
8478          */
8479         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
8480                 UINT32_C(0x10)
8481         /*
8482          * When this bit is set to '1', Energy Efficient Ethernet
8483          * (EEE) is requested to be disabled on this link.
8484          * If EEE is not supported on this port, then this flag
8485          * shall be ignored by the HWRM.
8486          */
8487         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
8488                 UINT32_C(0x20)
8489         /*
8490          * When this bit is set to '1' and EEE is enabled on this
8491          * link, then TX LPI is requested to be enabled on the link.
8492          * If EEE is not supported on this port, then this flag
8493          * shall be ignored by the HWRM.
8494          * If EEE is disabled on this port, then this flag shall be
8495          * ignored by the HWRM.
8496          */
8497         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
8498                 UINT32_C(0x40)
8499         /*
8500          * When this bit is set to '1' and EEE is enabled on this
8501          * link, then TX LPI is requested to be disabled on the link.
8502          * If EEE is not supported on this port, then this flag
8503          * shall be ignored by the HWRM.
8504          * If EEE is disabled on this port, then this flag shall be
8505          * ignored by the HWRM.
8506          */
8507         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
8508                 UINT32_C(0x80)
8509         /*
8510          * When set to 1, then the HWRM shall enable FEC autonegotitation
8511          * on this port if supported.
8512          * When set to 0, then this flag shall be ignored.
8513          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
8514          * flag.
8515          */
8516         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
8517                 UINT32_C(0x100)
8518         /*
8519          * When set to 1, then the HWRM shall disable FEC autonegotiation
8520          * on this port if supported.
8521          * When set to 0, then this flag shall be ignored.
8522          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
8523          * flag.
8524          */
8525         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
8526                 UINT32_C(0x200)
8527         /*
8528          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
8529          * on this port if supported.
8530          * When set to 0, then this flag shall be ignored.
8531          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
8532          * flag.
8533          */
8534         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
8535                 UINT32_C(0x400)
8536         /*
8537          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
8538          * on this port if supported.
8539          * When set to 0, then this flag shall be ignored.
8540          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
8541          * flag.
8542          */
8543         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
8544                 UINT32_C(0x800)
8545         /*
8546          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
8547          * on this port if supported.
8548          * When set to 0, then this flag shall be ignored.
8549          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
8550          * flag.
8551          */
8552         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
8553                 UINT32_C(0x1000)
8554         /*
8555          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
8556          * on this port if supported.
8557          * When set to 0, then this flag shall be ignored.
8558          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
8559          * flag.
8560          */
8561         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
8562                 UINT32_C(0x2000)
8563         /*
8564          * When this bit is set to '1', the link shall be forced to
8565          * be taken down.
8566          *
8567          * # When this bit is set to '1", all other
8568          * command input settings related to the link speed shall
8569          * be ignored.
8570          * Once the link state is forced down, it can be
8571          * explicitly cleared from that state by setting this flag
8572          * to '0'.
8573          * # If this flag is set to '0', then the link shall be
8574          * cleared from forced down state if the link is in forced
8575          * down state.
8576          * There may be conditions (e.g. out-of-band or sideband
8577          * configuration changes for the link) outside the scope
8578          * of the HWRM implementation that may clear forced down
8579          * link state.
8580          */
8581         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
8582                 UINT32_C(0x4000)
8583         uint32_t        enables;
8584         /*
8585          * This bit must be '1' for the auto_mode field to be
8586          * configured.
8587          */
8588         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
8589                 UINT32_C(0x1)
8590         /*
8591          * This bit must be '1' for the auto_duplex field to be
8592          * configured.
8593          */
8594         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
8595                 UINT32_C(0x2)
8596         /*
8597          * This bit must be '1' for the auto_pause field to be
8598          * configured.
8599          */
8600         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
8601                 UINT32_C(0x4)
8602         /*
8603          * This bit must be '1' for the auto_link_speed field to be
8604          * configured.
8605          */
8606         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
8607                 UINT32_C(0x8)
8608         /*
8609          * This bit must be '1' for the auto_link_speed_mask field to be
8610          * configured.
8611          */
8612         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
8613                 UINT32_C(0x10)
8614         /*
8615          * This bit must be '1' for the wirespeed field to be
8616          * configured.
8617          */
8618         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
8619                 UINT32_C(0x20)
8620         /*
8621          * This bit must be '1' for the lpbk field to be
8622          * configured.
8623          */
8624         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
8625                 UINT32_C(0x40)
8626         /*
8627          * This bit must be '1' for the preemphasis field to be
8628          * configured.
8629          */
8630         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
8631                 UINT32_C(0x80)
8632         /*
8633          * This bit must be '1' for the force_pause field to be
8634          * configured.
8635          */
8636         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
8637                 UINT32_C(0x100)
8638         /*
8639          * This bit must be '1' for the eee_link_speed_mask field to be
8640          * configured.
8641          */
8642         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
8643                 UINT32_C(0x200)
8644         /*
8645          * This bit must be '1' for the tx_lpi_timer field to be
8646          * configured.
8647          */
8648         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
8649                 UINT32_C(0x400)
8650         /* Port ID of port that is to be configured. */
8651         uint16_t        port_id;
8652         /*
8653          * This is the speed that will be used if the force
8654          * bit is '1'.  If unsupported speed is selected, an error
8655          * will be generated.
8656          */
8657         uint16_t        force_link_speed;
8658         /* 100Mb link speed */
8659         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
8660         /* 1Gb link speed */
8661         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
8662         /* 2Gb link speed */
8663         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
8664         /* 25Gb link speed */
8665         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
8666         /* 10Gb link speed */
8667         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
8668         /* 20Mb link speed */
8669         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
8670         /* 25Gb link speed */
8671         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
8672         /* 40Gb link speed */
8673         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
8674         /* 50Gb link speed */
8675         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
8676         /* 100Gb link speed */
8677         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
8678         /* 10Mb link speed */
8679         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
8680         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
8681                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
8682         /*
8683          * This value is used to identify what autoneg mode is
8684          * used when the link speed is not being forced.
8685          */
8686         uint8_t auto_mode;
8687         /* Disable autoneg or autoneg disabled. No speeds are selected. */
8688         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
8689         /* Select all possible speeds for autoneg mode. */
8690         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
8691         /*
8692          * Select only the auto_link_speed speed for autoneg mode. This mode has
8693          * been DEPRECATED. An HWRM client should not use this mode.
8694          */
8695         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
8696         /*
8697          * Select the auto_link_speed or any speed below that speed for autoneg.
8698          * This mode has been DEPRECATED. An HWRM client should not use this mode.
8699          */
8700         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
8701         /*
8702          * Select the speeds based on the corresponding link speed mask value
8703          * that is provided.
8704          */
8705         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
8706         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
8707                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
8708         /*
8709          * This is the duplex setting that will be used if the autoneg_mode
8710          * is "one_speed" or "one_or_below".
8711          */
8712         uint8_t auto_duplex;
8713         /* Half Duplex will be requested. */
8714         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
8715         /* Full duplex will be requested. */
8716         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
8717         /* Both Half and Full dupex will be requested. */
8718         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
8719         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
8720                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
8721         /*
8722          * This value is used to configure the pause that will be
8723          * used for autonegotiation.
8724          * Add text on the usage of auto_pause and force_pause.
8725          */
8726         uint8_t auto_pause;
8727         /*
8728          * When this bit is '1', Generation of tx pause messages
8729          * has been requested. Disabled otherwise.
8730          */
8731         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
8732                 UINT32_C(0x1)
8733         /*
8734          * When this bit is '1', Reception of rx pause messages
8735          * has been requested. Disabled otherwise.
8736          */
8737         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
8738                 UINT32_C(0x2)
8739         /*
8740          * When set to 1, the advertisement of pause is enabled.
8741          *
8742          * # When the auto_mode is not set to none and this flag is
8743          * set to 1, then the auto_pause bits on this port are being
8744          * advertised and autoneg pause results are being interpreted.
8745          * # When the auto_mode is not set to none and this
8746          * flag is set to 0, the pause is forced as indicated in
8747          * force_pause, and also advertised as auto_pause bits, but
8748          * the autoneg results are not interpreted since the pause
8749          * configuration is being forced.
8750          * # When the auto_mode is set to none and this flag is set to
8751          * 1, auto_pause bits should be ignored and should be set to 0.
8752          */
8753         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
8754                 UINT32_C(0x4)
8755         uint8_t unused_0;
8756         /*
8757          * This is the speed that will be used if the autoneg_mode
8758          * is "one_speed" or "one_or_below".  If an unsupported speed
8759          * is selected, an error will be generated.
8760          */
8761         uint16_t        auto_link_speed;
8762         /* 100Mb link speed */
8763         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
8764         /* 1Gb link speed */
8765         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
8766         /* 2Gb link speed */
8767         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
8768         /* 25Gb link speed */
8769         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
8770         /* 10Gb link speed */
8771         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
8772         /* 20Mb link speed */
8773         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
8774         /* 25Gb link speed */
8775         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
8776         /* 40Gb link speed */
8777         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
8778         /* 50Gb link speed */
8779         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
8780         /* 100Gb link speed */
8781         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
8782         /* 10Mb link speed */
8783         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
8784         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
8785                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
8786         /*
8787          * This is a mask of link speeds that will be used if
8788          * autoneg_mode is "mask".  If unsupported speed is enabled
8789          * an error will be generated.
8790          */
8791         uint16_t        auto_link_speed_mask;
8792         /* 100Mb link speed (Half-duplex) */
8793         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
8794                 UINT32_C(0x1)
8795         /* 100Mb link speed (Full-duplex) */
8796         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
8797                 UINT32_C(0x2)
8798         /* 1Gb link speed (Half-duplex) */
8799         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
8800                 UINT32_C(0x4)
8801         /* 1Gb link speed (Full-duplex) */
8802         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
8803                 UINT32_C(0x8)
8804         /* 2Gb link speed */
8805         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
8806                 UINT32_C(0x10)
8807         /* 25Gb link speed */
8808         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
8809                 UINT32_C(0x20)
8810         /* 10Gb link speed */
8811         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
8812                 UINT32_C(0x40)
8813         /* 20Gb link speed */
8814         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
8815                 UINT32_C(0x80)
8816         /* 25Gb link speed */
8817         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
8818                 UINT32_C(0x100)
8819         /* 40Gb link speed */
8820         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
8821                 UINT32_C(0x200)
8822         /* 50Gb link speed */
8823         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
8824                 UINT32_C(0x400)
8825         /* 100Gb link speed */
8826         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
8827                 UINT32_C(0x800)
8828         /* 10Mb link speed (Half-duplex) */
8829         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
8830                 UINT32_C(0x1000)
8831         /* 10Mb link speed (Full-duplex) */
8832         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
8833                 UINT32_C(0x2000)
8834         /* This value controls the wirespeed feature. */
8835         uint8_t wirespeed;
8836         /* Wirespeed feature is disabled. */
8837         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
8838         /* Wirespeed feature is enabled. */
8839         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
8840         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
8841                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
8842         /* This value controls the loopback setting for the PHY. */
8843         uint8_t lpbk;
8844         /* No loopback is selected.  Normal operation. */
8845         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
8846         /*
8847          * The HW will be configured with local loopback such that
8848          * host data is sent back to the host without modification.
8849          */
8850         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
8851         /*
8852          * The HW will be configured with remote loopback such that
8853          * port logic will send packets back out the transmitter that
8854          * are received.
8855          */
8856         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
8857         /*
8858          * The HW will be configured with external loopback such that
8859          * host data is sent on the trasmitter and based on the external
8860          * loopback connection the data will be received without modification.
8861          */
8862         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
8863         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
8864                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
8865         /*
8866          * This value is used to configure the pause that will be
8867          * used for force mode.
8868          */
8869         uint8_t force_pause;
8870         /*
8871          * When this bit is '1', Generation of tx pause messages
8872          * is supported. Disabled otherwise.
8873          */
8874         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
8875         /*
8876          * When this bit is '1', Reception of rx pause messages
8877          * is supported. Disabled otherwise.
8878          */
8879         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
8880         uint8_t unused_1;
8881         /*
8882          * This value controls the pre-emphasis to be used for the
8883          * link.  Driver should not set this value (use
8884          * enable.preemphasis = 0) unless driver is sure of setting.
8885          * Normally HWRM FW will determine proper pre-emphasis.
8886          */
8887         uint32_t        preemphasis;
8888         /*
8889          * Setting for link speed mask that is used to
8890          * advertise speeds during autonegotiation when EEE is enabled.
8891          * This field is valid only when EEE is enabled.
8892          * The speeds specified in this field shall be a subset of
8893          * speeds specified in auto_link_speed_mask.
8894          * If EEE is enabled,then at least one speed shall be provided
8895          * in this mask.
8896          */
8897         uint16_t        eee_link_speed_mask;
8898         /* Reserved */
8899         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
8900                 UINT32_C(0x1)
8901         /* 100Mb link speed (Full-duplex) */
8902         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
8903                 UINT32_C(0x2)
8904         /* Reserved */
8905         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
8906                 UINT32_C(0x4)
8907         /* 1Gb link speed (Full-duplex) */
8908         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
8909                 UINT32_C(0x8)
8910         /* Reserved */
8911         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
8912                 UINT32_C(0x10)
8913         /* Reserved */
8914         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
8915                 UINT32_C(0x20)
8916         /* 10Gb link speed */
8917         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
8918                 UINT32_C(0x40)
8919         uint8_t unused_2[2];
8920         /*
8921          * Reuested setting of TX LPI timer in microseconds.
8922          * This field is valid only when EEE is enabled and TX LPI is
8923          * enabled.
8924          */
8925         uint32_t        tx_lpi_timer;
8926         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
8927         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
8928         uint32_t        unused_3;
8929 } __attribute__((packed));
8930
8931 /* hwrm_port_phy_cfg_output (size:128b/16B) */
8932 struct hwrm_port_phy_cfg_output {
8933         /* The specific error status for the command. */
8934         uint16_t        error_code;
8935         /* The HWRM command request type. */
8936         uint16_t        req_type;
8937         /* The sequence ID from the original command. */
8938         uint16_t        seq_id;
8939         /* The length of the response data in number of bytes. */
8940         uint16_t        resp_len;
8941         uint8_t unused_0[7];
8942         /*
8943          * This field is used in Output records to indicate that the output
8944          * is completely written to RAM.  This field should be read as '1'
8945          * to indicate that the output has been completely written.
8946          * When writing a command completion or response to an internal processor,
8947          * the order of writes has to be such that this field is written last.
8948          */
8949         uint8_t valid;
8950 } __attribute__((packed));
8951
8952 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
8953 struct hwrm_port_phy_cfg_cmd_err {
8954         /*
8955          * command specific error codes that goes to
8956          * the cmd_err field in Common HWRM Error Response.
8957          */
8958         uint8_t code;
8959         /* Unknown error */
8960         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
8961         /* Unable to complete operation due to invalid speed */
8962         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
8963         /*
8964          * retry the command since the phy is not ready.
8965          * retry count is returned in opaque_0.
8966          * This is only valid for the first command and
8967          * this value will not change for successive calls.
8968          * but if a 0 is returned at any time then this should
8969          * be treated as an un recoverable failure,
8970          *
8971          * retry interval in milli seconds is returned in opaque_1.
8972          * This specifies the time that user should wait before
8973          * issuing the next port_phy_cfg command.
8974          */
8975         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
8976         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
8977                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
8978         uint8_t unused_0[7];
8979 } __attribute__((packed));
8980
8981 /**********************
8982  * hwrm_port_phy_qcfg *
8983  **********************/
8984
8985
8986 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
8987 struct hwrm_port_phy_qcfg_input {
8988         /* The HWRM command request type. */
8989         uint16_t        req_type;
8990         /*
8991          * The completion ring to send the completion event on. This should
8992          * be the NQ ID returned from the `nq_alloc` HWRM command.
8993          */
8994         uint16_t        cmpl_ring;
8995         /*
8996          * The sequence ID is used by the driver for tracking multiple
8997          * commands. This ID is treated as opaque data by the firmware and
8998          * the value is returned in the `hwrm_resp_hdr` upon completion.
8999          */
9000         uint16_t        seq_id;
9001         /*
9002          * The target ID of the command:
9003          * * 0x0-0xFFF8 - The function ID
9004          * * 0xFFF8-0xFFFE - Reserved for internal processors
9005          * * 0xFFFF - HWRM
9006          */
9007         uint16_t        target_id;
9008         /*
9009          * A physical address pointer pointing to a host buffer that the
9010          * command's response data will be written. This can be either a host
9011          * physical address (HPA) or a guest physical address (GPA) and must
9012          * point to a physically contiguous block of memory.
9013          */
9014         uint64_t        resp_addr;
9015         /* Port ID of port that is to be queried. */
9016         uint16_t        port_id;
9017         uint8_t unused_0[6];
9018 } __attribute__((packed));
9019
9020 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
9021 struct hwrm_port_phy_qcfg_output {
9022         /* The specific error status for the command. */
9023         uint16_t        error_code;
9024         /* The HWRM command request type. */
9025         uint16_t        req_type;
9026         /* The sequence ID from the original command. */
9027         uint16_t        seq_id;
9028         /* The length of the response data in number of bytes. */
9029         uint16_t        resp_len;
9030         /* This value indicates the current link status. */
9031         uint8_t link;
9032         /* There is no link or cable detected. */
9033         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
9034         /* There is no link, but a cable has been detected. */
9035         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
9036         /* There is a link. */
9037         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
9038         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
9039                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
9040         uint8_t unused_0;
9041         /* This value indicates the current link speed of the connection. */
9042         uint16_t        link_speed;
9043         /* 100Mb link speed */
9044         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
9045         /* 1Gb link speed */
9046         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
9047         /* 2Gb link speed */
9048         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
9049         /* 25Gb link speed */
9050         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
9051         /* 10Gb link speed */
9052         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
9053         /* 20Mb link speed */
9054         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
9055         /* 25Gb link speed */
9056         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
9057         /* 40Gb link speed */
9058         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
9059         /* 50Gb link speed */
9060         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
9061         /* 100Gb link speed */
9062         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
9063         /* 10Mb link speed */
9064         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
9065         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
9066                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
9067         /*
9068          * This value is indicates the duplex of the current
9069          * configuration.
9070          */
9071         uint8_t duplex_cfg;
9072         /* Half Duplex connection. */
9073         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
9074         /* Full duplex connection. */
9075         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
9076         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
9077                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
9078         /*
9079          * This value is used to indicate the current
9080          * pause configuration. When autoneg is enabled, this value
9081          * represents the autoneg results of pause configuration.
9082          */
9083         uint8_t pause;
9084         /*
9085          * When this bit is '1', Generation of tx pause messages
9086          * is supported. Disabled otherwise.
9087          */
9088         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
9089         /*
9090          * When this bit is '1', Reception of rx pause messages
9091          * is supported. Disabled otherwise.
9092          */
9093         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
9094         /*
9095          * The supported speeds for the port. This is a bit mask.
9096          * For each speed that is supported, the corrresponding
9097          * bit will be set to '1'.
9098          */
9099         uint16_t        support_speeds;
9100         /* 100Mb link speed (Half-duplex) */
9101         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
9102                 UINT32_C(0x1)
9103         /* 100Mb link speed (Full-duplex) */
9104         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
9105                 UINT32_C(0x2)
9106         /* 1Gb link speed (Half-duplex) */
9107         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
9108                 UINT32_C(0x4)
9109         /* 1Gb link speed (Full-duplex) */
9110         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
9111                 UINT32_C(0x8)
9112         /* 2Gb link speed */
9113         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
9114                 UINT32_C(0x10)
9115         /* 25Gb link speed */
9116         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
9117                 UINT32_C(0x20)
9118         /* 10Gb link speed */
9119         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
9120                 UINT32_C(0x40)
9121         /* 20Gb link speed */
9122         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
9123                 UINT32_C(0x80)
9124         /* 25Gb link speed */
9125         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
9126                 UINT32_C(0x100)
9127         /* 40Gb link speed */
9128         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
9129                 UINT32_C(0x200)
9130         /* 50Gb link speed */
9131         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
9132                 UINT32_C(0x400)
9133         /* 100Gb link speed */
9134         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
9135                 UINT32_C(0x800)
9136         /* 10Mb link speed (Half-duplex) */
9137         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
9138                 UINT32_C(0x1000)
9139         /* 10Mb link speed (Full-duplex) */
9140         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
9141                 UINT32_C(0x2000)
9142         /*
9143          * Current setting of forced link speed.
9144          * When the link speed is not being forced, this
9145          * value shall be set to 0.
9146          */
9147         uint16_t        force_link_speed;
9148         /* 100Mb link speed */
9149         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
9150         /* 1Gb link speed */
9151         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
9152         /* 2Gb link speed */
9153         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
9154         /* 25Gb link speed */
9155         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
9156         /* 10Gb link speed */
9157         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
9158         /* 20Mb link speed */
9159         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
9160         /* 25Gb link speed */
9161         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
9162         /* 40Gb link speed */
9163         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
9164                 UINT32_C(0x190)
9165         /* 50Gb link speed */
9166         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
9167                 UINT32_C(0x1f4)
9168         /* 100Gb link speed */
9169         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
9170                 UINT32_C(0x3e8)
9171         /* 10Mb link speed */
9172         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
9173                 UINT32_C(0xffff)
9174         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
9175                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
9176         /* Current setting of auto negotiation mode. */
9177         uint8_t auto_mode;
9178         /* Disable autoneg or autoneg disabled. No speeds are selected. */
9179         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
9180         /* Select all possible speeds for autoneg mode. */
9181         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
9182         /*
9183          * Select only the auto_link_speed speed for autoneg mode. This mode has
9184          * been DEPRECATED. An HWRM client should not use this mode.
9185          */
9186         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
9187         /*
9188          * Select the auto_link_speed or any speed below that speed for autoneg.
9189          * This mode has been DEPRECATED. An HWRM client should not use this mode.
9190          */
9191         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
9192         /*
9193          * Select the speeds based on the corresponding link speed mask value
9194          * that is provided.
9195          */
9196         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
9197         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
9198                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
9199         /*
9200          * Current setting of pause autonegotiation.
9201          * Move autoneg_pause flag here.
9202          */
9203         uint8_t auto_pause;
9204         /*
9205          * When this bit is '1', Generation of tx pause messages
9206          * has been requested. Disabled otherwise.
9207          */
9208         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
9209                 UINT32_C(0x1)
9210         /*
9211          * When this bit is '1', Reception of rx pause messages
9212          * has been requested. Disabled otherwise.
9213          */
9214         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
9215                 UINT32_C(0x2)
9216         /*
9217          * When set to 1, the advertisement of pause is enabled.
9218          *
9219          * # When the auto_mode is not set to none and this flag is
9220          * set to 1, then the auto_pause bits on this port are being
9221          * advertised and autoneg pause results are being interpreted.
9222          * # When the auto_mode is not set to none and this
9223          * flag is set to 0, the pause is forced as indicated in
9224          * force_pause, and also advertised as auto_pause bits, but
9225          * the autoneg results are not interpreted since the pause
9226          * configuration is being forced.
9227          * # When the auto_mode is set to none and this flag is set to
9228          * 1, auto_pause bits should be ignored and should be set to 0.
9229          */
9230         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
9231                 UINT32_C(0x4)
9232         /*
9233          * Current setting for auto_link_speed. This field is only
9234          * valid when auto_mode is set to "one_speed" or "one_or_below".
9235          */
9236         uint16_t        auto_link_speed;
9237         /* 100Mb link speed */
9238         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
9239         /* 1Gb link speed */
9240         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
9241         /* 2Gb link speed */
9242         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
9243         /* 25Gb link speed */
9244         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
9245         /* 10Gb link speed */
9246         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
9247         /* 20Mb link speed */
9248         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
9249         /* 25Gb link speed */
9250         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
9251         /* 40Gb link speed */
9252         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
9253         /* 50Gb link speed */
9254         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
9255         /* 100Gb link speed */
9256         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
9257         /* 10Mb link speed */
9258         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
9259                 UINT32_C(0xffff)
9260         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
9261                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
9262         /*
9263          * Current setting for auto_link_speed_mask that is used to
9264          * advertise speeds during autonegotiation.
9265          * This field is only valid when auto_mode is set to "mask".
9266          * The speeds specified in this field shall be a subset of
9267          * supported speeds on this port.
9268          */
9269         uint16_t        auto_link_speed_mask;
9270         /* 100Mb link speed (Half-duplex) */
9271         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
9272                 UINT32_C(0x1)
9273         /* 100Mb link speed (Full-duplex) */
9274         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
9275                 UINT32_C(0x2)
9276         /* 1Gb link speed (Half-duplex) */
9277         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
9278                 UINT32_C(0x4)
9279         /* 1Gb link speed (Full-duplex) */
9280         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
9281                 UINT32_C(0x8)
9282         /* 2Gb link speed */
9283         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
9284                 UINT32_C(0x10)
9285         /* 25Gb link speed */
9286         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
9287                 UINT32_C(0x20)
9288         /* 10Gb link speed */
9289         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
9290                 UINT32_C(0x40)
9291         /* 20Gb link speed */
9292         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
9293                 UINT32_C(0x80)
9294         /* 25Gb link speed */
9295         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
9296                 UINT32_C(0x100)
9297         /* 40Gb link speed */
9298         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
9299                 UINT32_C(0x200)
9300         /* 50Gb link speed */
9301         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
9302                 UINT32_C(0x400)
9303         /* 100Gb link speed */
9304         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
9305                 UINT32_C(0x800)
9306         /* 10Mb link speed (Half-duplex) */
9307         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
9308                 UINT32_C(0x1000)
9309         /* 10Mb link speed (Full-duplex) */
9310         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
9311                 UINT32_C(0x2000)
9312         /* Current setting for wirespeed. */
9313         uint8_t wirespeed;
9314         /* Wirespeed feature is disabled. */
9315         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
9316         /* Wirespeed feature is enabled. */
9317         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
9318         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
9319                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
9320         /* Current setting for loopback. */
9321         uint8_t lpbk;
9322         /* No loopback is selected.  Normal operation. */
9323         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
9324         /*
9325          * The HW will be configured with local loopback such that
9326          * host data is sent back to the host without modification.
9327          */
9328         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
9329         /*
9330          * The HW will be configured with remote loopback such that
9331          * port logic will send packets back out the transmitter that
9332          * are received.
9333          */
9334         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
9335         /*
9336          * The HW will be configured with external loopback such that
9337          * host data is sent on the trasmitter and based on the external
9338          * loopback connection the data will be received without modification.
9339          */
9340         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
9341         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
9342                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
9343         /*
9344          * Current setting of forced pause.
9345          * When the pause configuration is not being forced, then
9346          * this value shall be set to 0.
9347          */
9348         uint8_t force_pause;
9349         /*
9350          * When this bit is '1', Generation of tx pause messages
9351          * is supported. Disabled otherwise.
9352          */
9353         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
9354         /*
9355          * When this bit is '1', Reception of rx pause messages
9356          * is supported. Disabled otherwise.
9357          */
9358         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
9359         /*
9360          * This value indicates the current status of the optics module on
9361          * this port.
9362          */
9363         uint8_t module_status;
9364         /* Module is inserted and accepted */
9365         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
9366                 UINT32_C(0x0)
9367         /* Module is rejected and transmit side Laser is disabled. */
9368         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
9369                 UINT32_C(0x1)
9370         /* Module mismatch warning. */
9371         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
9372                 UINT32_C(0x2)
9373         /* Module is rejected and powered down. */
9374         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
9375                 UINT32_C(0x3)
9376         /* Module is not inserted. */
9377         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
9378                 UINT32_C(0x4)
9379         /* Module status is not applicable. */
9380         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
9381                 UINT32_C(0xff)
9382         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
9383                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
9384         /* Current setting for preemphasis. */
9385         uint32_t        preemphasis;
9386         /* This field represents the major version of the PHY. */
9387         uint8_t phy_maj;
9388         /* This field represents the minor version of the PHY. */
9389         uint8_t phy_min;
9390         /* This field represents the build version of the PHY. */
9391         uint8_t phy_bld;
9392         /* This value represents a PHY type. */
9393         uint8_t phy_type;
9394         /* Unknown */
9395         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
9396                 UINT32_C(0x0)
9397         /* BASE-CR */
9398         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
9399                 UINT32_C(0x1)
9400         /* BASE-KR4 (Deprecated) */
9401         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
9402                 UINT32_C(0x2)
9403         /* BASE-LR */
9404         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
9405                 UINT32_C(0x3)
9406         /* BASE-SR */
9407         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
9408                 UINT32_C(0x4)
9409         /* BASE-KR2 (Deprecated) */
9410         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
9411                 UINT32_C(0x5)
9412         /* BASE-KX */
9413         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
9414                 UINT32_C(0x6)
9415         /* BASE-KR */
9416         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
9417                 UINT32_C(0x7)
9418         /* BASE-T */
9419         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
9420                 UINT32_C(0x8)
9421         /* EEE capable BASE-T */
9422         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
9423                 UINT32_C(0x9)
9424         /* SGMII connected external PHY */
9425         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
9426                 UINT32_C(0xa)
9427         /* 25G_BASECR_CA_L */
9428         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
9429                 UINT32_C(0xb)
9430         /* 25G_BASECR_CA_S */
9431         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
9432                 UINT32_C(0xc)
9433         /* 25G_BASECR_CA_N */
9434         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
9435                 UINT32_C(0xd)
9436         /* 25G_BASESR */
9437         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
9438                 UINT32_C(0xe)
9439         /* 100G_BASECR4 */
9440         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
9441                 UINT32_C(0xf)
9442         /* 100G_BASESR4 */
9443         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
9444                 UINT32_C(0x10)
9445         /* 100G_BASELR4 */
9446         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
9447                 UINT32_C(0x11)
9448         /* 100G_BASEER4 */
9449         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
9450                 UINT32_C(0x12)
9451         /* 100G_BASESR10 */
9452         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
9453                 UINT32_C(0x13)
9454         /* 40G_BASECR4 */
9455         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
9456                 UINT32_C(0x14)
9457         /* 40G_BASESR4 */
9458         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
9459                 UINT32_C(0x15)
9460         /* 40G_BASELR4 */
9461         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
9462                 UINT32_C(0x16)
9463         /* 40G_BASEER4 */
9464         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
9465                 UINT32_C(0x17)
9466         /* 40G_ACTIVE_CABLE */
9467         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
9468                 UINT32_C(0x18)
9469         /* 1G_baseT */
9470         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
9471                 UINT32_C(0x19)
9472         /* 1G_baseSX */
9473         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
9474                 UINT32_C(0x1a)
9475         /* 1G_baseCX */
9476         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
9477                 UINT32_C(0x1b)
9478         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
9479                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX
9480         /* This value represents a media type. */
9481         uint8_t media_type;
9482         /* Unknown */
9483         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
9484         /* Twisted Pair */
9485         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
9486         /* Direct Attached Copper */
9487         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
9488         /* Fiber */
9489         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
9490         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
9491                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
9492         /* This value represents a transceiver type. */
9493         uint8_t xcvr_pkg_type;
9494         /* PHY and MAC are in the same package */
9495         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
9496                 UINT32_C(0x1)
9497         /* PHY and MAC are in different packages */
9498         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
9499                 UINT32_C(0x2)
9500         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
9501                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
9502         uint8_t eee_config_phy_addr;
9503         /* This field represents PHY address. */
9504         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
9505                 UINT32_C(0x1f)
9506         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
9507         /*
9508          * This field represents flags related to EEE configuration.
9509          * These EEE configuration flags are valid only when the
9510          * auto_mode is not set to none (in other words autonegotiation
9511          * is enabled).
9512          */
9513         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
9514                 UINT32_C(0xe0)
9515         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
9516         /*
9517          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
9518          * Speeds for autoneg with EEE mode enabled
9519          * are based on eee_link_speed_mask.
9520          */
9521         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
9522                 UINT32_C(0x20)
9523         /*
9524          * This flag is valid only when eee_enabled is set to 1.
9525          *
9526          * # If eee_enabled is set to 0, then EEE mode is disabled
9527          * and this flag shall be ignored.
9528          * # If eee_enabled is set to 1 and this flag is set to 1,
9529          * then Energy Efficient Ethernet (EEE) mode is enabled
9530          * and in use.
9531          * # If eee_enabled is set to 1 and this flag is set to 0,
9532          * then Energy Efficient Ethernet (EEE) mode is enabled
9533          * but is currently not in use.
9534          */
9535         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
9536                 UINT32_C(0x40)
9537         /*
9538          * This flag is valid only when eee_enabled is set to 1.
9539          *
9540          * # If eee_enabled is set to 0, then EEE mode is disabled
9541          * and this flag shall be ignored.
9542          * # If eee_enabled is set to 1 and this flag is set to 1,
9543          * then Energy Efficient Ethernet (EEE) mode is enabled
9544          * and TX LPI is enabled.
9545          * # If eee_enabled is set to 1 and this flag is set to 0,
9546          * then Energy Efficient Ethernet (EEE) mode is enabled
9547          * but TX LPI is disabled.
9548          */
9549         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
9550                 UINT32_C(0x80)
9551         /*
9552          * When set to 1, the parallel detection is used to determine
9553          * the speed of the link partner.
9554          *
9555          * Parallel detection is used when a autonegotiation capable
9556          * device is connected to a link parter that is not capable
9557          * of autonegotiation.
9558          */
9559         uint8_t parallel_detect;
9560         /*
9561          * When set to 1, the parallel detection is used to determine
9562          * the speed of the link partner.
9563          *
9564          * Parallel detection is used when a autonegotiation capable
9565          * device is connected to a link parter that is not capable
9566          * of autonegotiation.
9567          */
9568         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
9569         /*
9570          * The advertised speeds for the port by the link partner.
9571          * Each advertised speed will be set to '1'.
9572          */
9573         uint16_t        link_partner_adv_speeds;
9574         /* 100Mb link speed (Half-duplex) */
9575         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
9576                 UINT32_C(0x1)
9577         /* 100Mb link speed (Full-duplex) */
9578         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
9579                 UINT32_C(0x2)
9580         /* 1Gb link speed (Half-duplex) */
9581         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
9582                 UINT32_C(0x4)
9583         /* 1Gb link speed (Full-duplex) */
9584         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
9585                 UINT32_C(0x8)
9586         /* 2Gb link speed */
9587         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
9588                 UINT32_C(0x10)
9589         /* 25Gb link speed */
9590         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
9591                 UINT32_C(0x20)
9592         /* 10Gb link speed */
9593         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
9594                 UINT32_C(0x40)
9595         /* 20Gb link speed */
9596         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
9597                 UINT32_C(0x80)
9598         /* 25Gb link speed */
9599         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
9600                 UINT32_C(0x100)
9601         /* 40Gb link speed */
9602         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
9603                 UINT32_C(0x200)
9604         /* 50Gb link speed */
9605         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
9606                 UINT32_C(0x400)
9607         /* 100Gb link speed */
9608         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
9609                 UINT32_C(0x800)
9610         /* 10Mb link speed (Half-duplex) */
9611         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
9612                 UINT32_C(0x1000)
9613         /* 10Mb link speed (Full-duplex) */
9614         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
9615                 UINT32_C(0x2000)
9616         /*
9617          * The advertised autoneg for the port by the link partner.
9618          * This field is deprecated and should be set to 0.
9619          */
9620         uint8_t link_partner_adv_auto_mode;
9621         /* Disable autoneg or autoneg disabled. No speeds are selected. */
9622         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
9623                 UINT32_C(0x0)
9624         /* Select all possible speeds for autoneg mode. */
9625         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
9626                 UINT32_C(0x1)
9627         /*
9628          * Select only the auto_link_speed speed for autoneg mode. This mode has
9629          * been DEPRECATED. An HWRM client should not use this mode.
9630          */
9631         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
9632                 UINT32_C(0x2)
9633         /*
9634          * Select the auto_link_speed or any speed below that speed for autoneg.
9635          * This mode has been DEPRECATED. An HWRM client should not use this mode.
9636          */
9637         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
9638                 UINT32_C(0x3)
9639         /*
9640          * Select the speeds based on the corresponding link speed mask value
9641          * that is provided.
9642          */
9643         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
9644                 UINT32_C(0x4)
9645         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
9646                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
9647         /* The advertised pause settings on the port by the link partner. */
9648         uint8_t link_partner_adv_pause;
9649         /*
9650          * When this bit is '1', Generation of tx pause messages
9651          * is supported. Disabled otherwise.
9652          */
9653         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
9654                 UINT32_C(0x1)
9655         /*
9656          * When this bit is '1', Reception of rx pause messages
9657          * is supported. Disabled otherwise.
9658          */
9659         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
9660                 UINT32_C(0x2)
9661         /*
9662          * Current setting for link speed mask that is used to
9663          * advertise speeds during autonegotiation when EEE is enabled.
9664          * This field is valid only when eee_enabled flags is set to 1.
9665          * The speeds specified in this field shall be a subset of
9666          * speeds specified in auto_link_speed_mask.
9667          */
9668         uint16_t        adv_eee_link_speed_mask;
9669         /* Reserved */
9670         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
9671                 UINT32_C(0x1)
9672         /* 100Mb link speed (Full-duplex) */
9673         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
9674                 UINT32_C(0x2)
9675         /* Reserved */
9676         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
9677                 UINT32_C(0x4)
9678         /* 1Gb link speed (Full-duplex) */
9679         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
9680                 UINT32_C(0x8)
9681         /* Reserved */
9682         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
9683                 UINT32_C(0x10)
9684         /* Reserved */
9685         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
9686                 UINT32_C(0x20)
9687         /* 10Gb link speed */
9688         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
9689                 UINT32_C(0x40)
9690         /*
9691          * Current setting for link speed mask that is advertised by
9692          * the link partner when EEE is enabled.
9693          * This field is valid only when eee_enabled flags is set to 1.
9694          */
9695         uint16_t        link_partner_adv_eee_link_speed_mask;
9696         /* Reserved */
9697         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
9698                 UINT32_C(0x1)
9699         /* 100Mb link speed (Full-duplex) */
9700         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
9701                 UINT32_C(0x2)
9702         /* Reserved */
9703         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
9704                 UINT32_C(0x4)
9705         /* 1Gb link speed (Full-duplex) */
9706         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
9707                 UINT32_C(0x8)
9708         /* Reserved */
9709         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
9710                 UINT32_C(0x10)
9711         /* Reserved */
9712         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
9713                 UINT32_C(0x20)
9714         /* 10Gb link speed */
9715         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
9716                 UINT32_C(0x40)
9717         uint32_t        xcvr_identifier_type_tx_lpi_timer;
9718         /*
9719          * Current setting of TX LPI timer in microseconds.
9720          * This field is valid only when_eee_enabled flag is set to 1
9721          * and tx_lpi_enabled is set to 1.
9722          */
9723         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
9724                 UINT32_C(0xffffff)
9725         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
9726         /* This value represents transceiver identifier type. */
9727         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
9728                 UINT32_C(0xff000000)
9729         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
9730         /* Unknown */
9731         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
9732                 (UINT32_C(0x0) << 24)
9733         /* SFP/SFP+/SFP28 */
9734         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
9735                 (UINT32_C(0x3) << 24)
9736         /* QSFP+ */
9737         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
9738                 (UINT32_C(0xc) << 24)
9739         /* QSFP+ */
9740         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
9741                 (UINT32_C(0xd) << 24)
9742         /* QSFP28 */
9743         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
9744                 (UINT32_C(0x11) << 24)
9745         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
9746                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
9747         /*
9748          * This value represents the current configuration of
9749          * Forward Error Correction (FEC) on the port.
9750          */
9751         uint16_t        fec_cfg;
9752         /*
9753          * When set to 1, then FEC is not supported on this port. If this flag
9754          * is set to 1, then all other FEC configuration flags shall be ignored.
9755          * When set to 0, then FEC is supported as indicated by other
9756          * configuration flags.
9757          * If no cable is attached and the HWRM does not yet know the FEC
9758          * capability, then the HWRM shall set this flag to 1 when reporting
9759          * FEC capability.
9760          */
9761         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
9762                 UINT32_C(0x1)
9763         /*
9764          * When set to 1, then FEC autonegotiation is supported on this port.
9765          * When set to 0, then FEC autonegotiation is not supported on this port.
9766          */
9767         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
9768                 UINT32_C(0x2)
9769         /*
9770          * When set to 1, then FEC autonegotiation is enabled on this port.
9771          * When set to 0, then FEC autonegotiation is disabled if supported.
9772          * This flag should be ignored if FEC autonegotiation is not supported on this port.
9773          */
9774         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
9775                 UINT32_C(0x4)
9776         /*
9777          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
9778          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
9779          */
9780         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
9781                 UINT32_C(0x8)
9782         /*
9783          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port.
9784          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
9785          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
9786          */
9787         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
9788                 UINT32_C(0x10)
9789         /*
9790          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
9791          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
9792          */
9793         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
9794                 UINT32_C(0x20)
9795         /*
9796          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port.
9797          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
9798          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
9799          */
9800         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
9801                 UINT32_C(0x40)
9802         /*
9803          * This value is indicates the duplex of the current
9804          * connection state.
9805          */
9806         uint8_t duplex_state;
9807         /* Half Duplex connection. */
9808         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
9809         /* Full duplex connection. */
9810         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
9811         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
9812                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
9813         /* Option flags fields. */
9814         uint8_t option_flags;
9815         /* When this bit is '1', Media auto detect is enabled. */
9816         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
9817                 UINT32_C(0x1)
9818         /*
9819          * Up to 16 bytes of null padded ASCII string representing
9820          * PHY vendor.
9821          * If the string is set to null, then the vendor name is not
9822          * available.
9823          */
9824         char    phy_vendor_name[16];
9825         /*
9826          * Up to 16 bytes of null padded ASCII string that
9827          * identifies vendor specific part number of the PHY.
9828          * If the string is set to null, then the vendor specific
9829          * part number is not available.
9830          */
9831         char    phy_vendor_partnumber[16];
9832         uint8_t unused_2[7];
9833         /*
9834          * This field is used in Output records to indicate that the output
9835          * is completely written to RAM.  This field should be read as '1'
9836          * to indicate that the output has been completely written.
9837          * When writing a command completion or response to an internal processor,
9838          * the order of writes has to be such that this field is written last.
9839          */
9840         uint8_t valid;
9841 } __attribute__((packed));
9842
9843 /*********************
9844  * hwrm_port_mac_cfg *
9845  *********************/
9846
9847
9848 /* hwrm_port_mac_cfg_input (size:320b/40B) */
9849 struct hwrm_port_mac_cfg_input {
9850         /* The HWRM command request type. */
9851         uint16_t        req_type;
9852         /*
9853          * The completion ring to send the completion event on. This should
9854          * be the NQ ID returned from the `nq_alloc` HWRM command.
9855          */
9856         uint16_t        cmpl_ring;
9857         /*
9858          * The sequence ID is used by the driver for tracking multiple
9859          * commands. This ID is treated as opaque data by the firmware and
9860          * the value is returned in the `hwrm_resp_hdr` upon completion.
9861          */
9862         uint16_t        seq_id;
9863         /*
9864          * The target ID of the command:
9865          * * 0x0-0xFFF8 - The function ID
9866          * * 0xFFF8-0xFFFE - Reserved for internal processors
9867          * * 0xFFFF - HWRM
9868          */
9869         uint16_t        target_id;
9870         /*
9871          * A physical address pointer pointing to a host buffer that the
9872          * command's response data will be written. This can be either a host
9873          * physical address (HPA) or a guest physical address (GPA) and must
9874          * point to a physically contiguous block of memory.
9875          */
9876         uint64_t        resp_addr;
9877         /*
9878          * In this field, there are a number of CoS mappings related flags
9879          * that are used to configure CoS mappings and their corresponding
9880          * priorities in the hardware.
9881          * For the priorities of CoS mappings, the HWRM uses the following
9882          * priority order (high to low) by default:
9883          * # vlan pri
9884          * # ip_dscp
9885          * # tunnel_vlan_pri
9886          * # default cos
9887          *
9888          * A subset of CoS mappings can be enabled.
9889          * If a priority is not specified for an enabled CoS mapping, the
9890          * priority will be assigned in the above order for the enabled CoS
9891          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
9892          * enabled and their priorities are not specified, the following
9893          * priority order (high to low) will be used by the HWRM:
9894          * # vlan_pri
9895          * # ip_dscp
9896          * # default cos
9897          *
9898          * vlan_pri CoS mapping together with default CoS with lower priority
9899          * are enabled by default by the HWRM.
9900          */
9901         uint32_t        flags;
9902         /*
9903          * When this bit is '1', this command will configure
9904          * the MAC to match the current link state of the PHY.
9905          * If the link is not established on the PHY, then this
9906          * bit has no effect.
9907          */
9908         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
9909                 UINT32_C(0x1)
9910         /*
9911          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
9912          * is requested to be enabled.
9913          */
9914         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
9915                 UINT32_C(0x2)
9916         /*
9917          * When this bit is set to '1', tunnel VLAN PRI field to
9918          * CoS mapping is requested to be enabled.
9919          */
9920         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
9921                 UINT32_C(0x4)
9922         /*
9923          * When this bit is set to '1', the IP DSCP to CoS mapping is
9924          * requested to be enabled.
9925          */
9926         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
9927                 UINT32_C(0x8)
9928         /*
9929          * When this bit is '1', the HWRM is requested to
9930          * enable timestamp capture capability on the receive side
9931          * of this port.
9932          */
9933         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
9934                 UINT32_C(0x10)
9935         /*
9936          * When this bit is '1', the HWRM is requested to
9937          * disable timestamp capture capability on the receive side
9938          * of this port.
9939          */
9940         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
9941                 UINT32_C(0x20)
9942         /*
9943          * When this bit is '1', the HWRM is requested to
9944          * enable timestamp capture capability on the transmit side
9945          * of this port.
9946          */
9947         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
9948                 UINT32_C(0x40)
9949         /*
9950          * When this bit is '1', the HWRM is requested to
9951          * disable timestamp capture capability on the transmit side
9952          * of this port.
9953          */
9954         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
9955                 UINT32_C(0x80)
9956         /*
9957          * When this bit is '1', the Out-Of-Box WoL is requested to
9958          * be enabled on this port.
9959          */
9960         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
9961                 UINT32_C(0x100)
9962         /*
9963          * When this bit is '1', the the Out-Of-Box WoL is requested to
9964          * be disabled on this port.
9965          */
9966         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
9967                 UINT32_C(0x200)
9968         /*
9969          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
9970          * is requested to be disabled.
9971          */
9972         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
9973                 UINT32_C(0x400)
9974         /*
9975          * When this bit is set to '1', tunnel VLAN PRI field to
9976          * CoS mapping is requested to be disabled.
9977          */
9978         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
9979                 UINT32_C(0x800)
9980         /*
9981          * When this bit is set to '1', the IP DSCP to CoS mapping is
9982          * requested to be disabled.
9983          */
9984         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
9985                 UINT32_C(0x1000)
9986         uint32_t        enables;
9987         /*
9988          * This bit must be '1' for the ipg field to be
9989          * configured.
9990          */
9991         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
9992                 UINT32_C(0x1)
9993         /*
9994          * This bit must be '1' for the lpbk field to be
9995          * configured.
9996          */
9997         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
9998                 UINT32_C(0x2)
9999         /*
10000          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
10001          * configured.
10002          */
10003         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
10004                 UINT32_C(0x4)
10005         /*
10006          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
10007          * configured.
10008          */
10009         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
10010                 UINT32_C(0x10)
10011         /*
10012          * This bit must be '1' for the dscp2cos_map_pri field to be
10013          * configured.
10014          */
10015         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
10016                 UINT32_C(0x20)
10017         /*
10018          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
10019          * configured.
10020          */
10021         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
10022                 UINT32_C(0x40)
10023         /*
10024          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
10025          * configured.
10026          */
10027         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
10028                 UINT32_C(0x80)
10029         /*
10030          * This bit must be '1' for the cos_field_cfg field to be
10031          * configured.
10032          */
10033         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
10034                 UINT32_C(0x100)
10035         /* Port ID of port that is to be configured. */
10036         uint16_t        port_id;
10037         /*
10038          * This value is used to configure the minimum IPG that will
10039          * be sent between packets by this port.
10040          */
10041         uint8_t ipg;
10042         /* This value controls the loopback setting for the MAC. */
10043         uint8_t lpbk;
10044         /* No loopback is selected.  Normal operation. */
10045         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
10046         /*
10047          * The HW will be configured with local loopback such that
10048          * host data is sent back to the host without modification.
10049          */
10050         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
10051         /*
10052          * The HW will be configured with remote loopback such that
10053          * port logic will send packets back out the transmitter that
10054          * are received.
10055          */
10056         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
10057         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
10058                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
10059         /*
10060          * This value controls the priority setting of VLAN PRI to CoS
10061          * mapping based on VLAN Tags of inner packet headers of
10062          * tunneled packets or packet headers of non-tunneled packets.
10063          *
10064          * # Each XXX_pri variable shall have a unique priority value
10065          * when it is being specified.
10066          * # When comparing priorities of mappings, higher value
10067          * indicates higher priority.
10068          * For example, a value of 0-3 is returned where 0 is being
10069          * the lowest priority and 3 is being the highest priority.
10070          */
10071         uint8_t vlan_pri2cos_map_pri;
10072         /* Reserved field. */
10073         uint8_t reserved1;
10074         /*
10075          * This value controls the priority setting of VLAN PRI to CoS
10076          * mapping based on VLAN Tags of tunneled header.
10077          * This mapping only applies when tunneled headers
10078          * are present.
10079          *
10080          * # Each XXX_pri variable shall have a unique priority value
10081          * when it is being specified.
10082          * # When comparing priorities of mappings, higher value
10083          * indicates higher priority.
10084          * For example, a value of 0-3 is returned where 0 is being
10085          * the lowest priority and 3 is being the highest priority.
10086          */
10087         uint8_t tunnel_pri2cos_map_pri;
10088         /*
10089          * This value controls the priority setting of IP DSCP to CoS
10090          * mapping based on inner IP header of tunneled packets or
10091          * IP header of non-tunneled packets.
10092          *
10093          * # Each XXX_pri variable shall have a unique priority value
10094          * when it is being specified.
10095          * # When comparing priorities of mappings, higher value
10096          * indicates higher priority.
10097          * For example, a value of 0-3 is returned where 0 is being
10098          * the lowest priority and 3 is being the highest priority.
10099          */
10100         uint8_t dscp2pri_map_pri;
10101         /*
10102          * This is a 16-bit bit mask that is used to request a
10103          * specific configuration of time stamp capture of PTP messages
10104          * on the receive side of this port.
10105          * This field shall be ignored if the ptp_rx_ts_capture_enable
10106          * flag is not set in this command.
10107          * Otherwise, if bit 'i' is set, then the HWRM is being
10108          * requested to configure the receive side of the port to
10109          * capture the time stamp of every received PTP message
10110          * with messageType field value set to i.
10111          */
10112         uint16_t        rx_ts_capture_ptp_msg_type;
10113         /*
10114          * This is a 16-bit bit mask that is used to request a
10115          * specific configuration of time stamp capture of PTP messages
10116          * on the transmit side of this port.
10117          * This field shall be ignored if the ptp_tx_ts_capture_enable
10118          * flag is not set in this command.
10119          * Otherwise, if bit 'i' is set, then the HWRM is being
10120          * requested to configure the transmit sied of the port to
10121          * capture the time stamp of every transmitted PTP message
10122          * with messageType field value set to i.
10123          */
10124         uint16_t        tx_ts_capture_ptp_msg_type;
10125         /* Configuration of CoS fields. */
10126         uint8_t cos_field_cfg;
10127         /* Reserved */
10128         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
10129                 UINT32_C(0x1)
10130         /*
10131          * This field is used to specify selection of VLAN PRI value
10132          * based on whether one or two VLAN Tags are present in
10133          * the inner packet headers of tunneled packets or
10134          * non-tunneled packets.
10135          * This field is valid only if inner VLAN PRI to CoS mapping
10136          * is enabled.
10137          * If VLAN PRI to CoS mapping is not enabled, then this
10138          * field shall be ignored.
10139          */
10140         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
10141                 UINT32_C(0x6)
10142         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
10143                 1
10144         /*
10145          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
10146          * present in the inner packet headers
10147          */
10148         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
10149                 (UINT32_C(0x0) << 1)
10150         /*
10151          * Select outer VLAN Tag PRI when 2 VLAN Tags are
10152          * present in the inner packet headers.
10153          * No VLAN PRI shall be selected for this configuration
10154          * if only one VLAN Tag is present in the inner
10155          * packet headers.
10156          */
10157         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
10158                 (UINT32_C(0x1) << 1)
10159         /*
10160          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
10161          * are present in the inner packet headers
10162          */
10163         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
10164                 (UINT32_C(0x2) << 1)
10165         /* Unspecified */
10166         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
10167                 (UINT32_C(0x3) << 1)
10168         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
10169                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
10170         /*
10171          * This field is used to specify selection of tunnel VLAN
10172          * PRI value based on whether one or two VLAN Tags are
10173          * present in tunnel headers.
10174          * This field is valid only if tunnel VLAN PRI to CoS mapping
10175          * is enabled.
10176          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
10177          * field shall be ignored.
10178          */
10179         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
10180                 UINT32_C(0x18)
10181         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
10182                 3
10183         /*
10184          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
10185          * present in the tunnel packet headers
10186          */
10187         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
10188                 (UINT32_C(0x0) << 3)
10189         /*
10190          * Select outer VLAN Tag PRI when 2 VLAN Tags are
10191          * present in the tunnel packet headers.
10192          * No tunnel VLAN PRI shall be selected for this
10193          * configuration if only one VLAN Tag is present in
10194          * the tunnel packet headers.
10195          */
10196         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
10197                 (UINT32_C(0x1) << 3)
10198         /*
10199          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
10200          * are present in the tunnel packet headers
10201          */
10202         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
10203                 (UINT32_C(0x2) << 3)
10204         /* Unspecified */
10205         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
10206                 (UINT32_C(0x3) << 3)
10207         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
10208                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
10209         /*
10210          * This field shall be used to provide default CoS value
10211          * that has been configured on this port.
10212          * This field is valid only if default CoS mapping
10213          * is enabled.
10214          * If default CoS mapping is not enabled, then this
10215          * field shall be ignored.
10216          */
10217         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
10218                 UINT32_C(0xe0)
10219         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
10220                 5
10221         uint8_t unused_0[3];
10222 } __attribute__((packed));
10223
10224 /* hwrm_port_mac_cfg_output (size:128b/16B) */
10225 struct hwrm_port_mac_cfg_output {
10226         /* The specific error status for the command. */
10227         uint16_t        error_code;
10228         /* The HWRM command request type. */
10229         uint16_t        req_type;
10230         /* The sequence ID from the original command. */
10231         uint16_t        seq_id;
10232         /* The length of the response data in number of bytes. */
10233         uint16_t        resp_len;
10234         /*
10235          * This is the configured maximum length of Ethernet packet
10236          * payload that is allowed to be received on the port.
10237          * This value does not include the number of bytes used by
10238          * Ethernet header and trailer (CRC).
10239          */
10240         uint16_t        mru;
10241         /*
10242          * This is the configured maximum length of Ethernet packet
10243          * payload that is allowed to be transmitted on the port.
10244          * This value does not include the number of bytes used by
10245          * Ethernet header and trailer (CRC).
10246          */
10247         uint16_t        mtu;
10248         /* Current configuration of the IPG value. */
10249         uint8_t ipg;
10250         /* Current value of the loopback value. */
10251         uint8_t lpbk;
10252         /* No loopback is selected.  Normal operation. */
10253         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
10254         /*
10255          * The HW will be configured with local loopback such that
10256          * host data is sent back to the host without modification.
10257          */
10258         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
10259         /*
10260          * The HW will be configured with remote loopback such that
10261          * port logic will send packets back out the transmitter that
10262          * are received.
10263          */
10264         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
10265         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
10266                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
10267         uint8_t unused_0;
10268         /*
10269          * This field is used in Output records to indicate that the output
10270          * is completely written to RAM.  This field should be read as '1'
10271          * to indicate that the output has been completely written.
10272          * When writing a command completion or response to an internal processor,
10273          * the order of writes has to be such that this field is written last.
10274          */
10275         uint8_t valid;
10276 } __attribute__((packed));
10277
10278 /**********************
10279  * hwrm_port_mac_qcfg *
10280  **********************/
10281
10282
10283 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
10284 struct hwrm_port_mac_qcfg_input {
10285         /* The HWRM command request type. */
10286         uint16_t        req_type;
10287         /*
10288          * The completion ring to send the completion event on. This should
10289          * be the NQ ID returned from the `nq_alloc` HWRM command.
10290          */
10291         uint16_t        cmpl_ring;
10292         /*
10293          * The sequence ID is used by the driver for tracking multiple
10294          * commands. This ID is treated as opaque data by the firmware and
10295          * the value is returned in the `hwrm_resp_hdr` upon completion.
10296          */
10297         uint16_t        seq_id;
10298         /*
10299          * The target ID of the command:
10300          * * 0x0-0xFFF8 - The function ID
10301          * * 0xFFF8-0xFFFE - Reserved for internal processors
10302          * * 0xFFFF - HWRM
10303          */
10304         uint16_t        target_id;
10305         /*
10306          * A physical address pointer pointing to a host buffer that the
10307          * command's response data will be written. This can be either a host
10308          * physical address (HPA) or a guest physical address (GPA) and must
10309          * point to a physically contiguous block of memory.
10310          */
10311         uint64_t        resp_addr;
10312         /* Port ID of port that is to be configured. */
10313         uint16_t        port_id;
10314         uint8_t unused_0[6];
10315 } __attribute__((packed));
10316
10317 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
10318 struct hwrm_port_mac_qcfg_output {
10319         /* The specific error status for the command. */
10320         uint16_t        error_code;
10321         /* The HWRM command request type. */
10322         uint16_t        req_type;
10323         /* The sequence ID from the original command. */
10324         uint16_t        seq_id;
10325         /* The length of the response data in number of bytes. */
10326         uint16_t        resp_len;
10327         /*
10328          * This is the configured maximum length of Ethernet packet
10329          * payload that is allowed to be received on the port.
10330          * This value does not include the number of bytes used by the
10331          * Ethernet header and trailer (CRC).
10332          */
10333         uint16_t        mru;
10334         /*
10335          * This is the configured maximum length of Ethernet packet
10336          * payload that is allowed to be transmitted on the port.
10337          * This value does not include the number of bytes used by the
10338          * Ethernet header and trailer (CRC).
10339          */
10340         uint16_t        mtu;
10341         /*
10342          * The minimum IPG that will
10343          * be sent between packets by this port.
10344          */
10345         uint8_t ipg;
10346         /* The loopback setting for the MAC. */
10347         uint8_t lpbk;
10348         /* No loopback is selected.  Normal operation. */
10349         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
10350         /*
10351          * The HW will be configured with local loopback such that
10352          * host data is sent back to the host without modification.
10353          */
10354         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
10355         /*
10356          * The HW will be configured with remote loopback such that
10357          * port logic will send packets back out the transmitter that
10358          * are received.
10359          */
10360         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
10361         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
10362                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
10363         /*
10364          * Priority setting for VLAN PRI to CoS mapping.
10365          * # Each XXX_pri variable shall have a unique priority value
10366          * when it is being used.
10367          * # When comparing priorities of mappings, higher value
10368          * indicates higher priority.
10369          * For example, a value of 0-3 is returned where 0 is being
10370          * the lowest priority and 3 is being the highest priority.
10371          * # If the correspoding CoS mapping is not enabled, then this
10372          * field should be ignored.
10373          * # This value indicates the normalized priority value retained
10374          * in the HWRM.
10375          */
10376         uint8_t vlan_pri2cos_map_pri;
10377         /*
10378          * In this field, a number of CoS mappings related flags
10379          * are used to indicate configured CoS mappings.
10380          */
10381         uint8_t flags;
10382         /*
10383          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
10384          * is enabled.
10385          */
10386         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
10387                 UINT32_C(0x1)
10388         /*
10389          * When this bit is set to '1', tunnel VLAN PRI field to
10390          * CoS mapping is enabled.
10391          */
10392         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
10393                 UINT32_C(0x2)
10394         /*
10395          * When this bit is set to '1', the IP DSCP to CoS mapping is
10396          * enabled.
10397          */
10398         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
10399                 UINT32_C(0x4)
10400         /*
10401          * When this bit is '1', the Out-Of-Box WoL is enabled on this
10402          * port.
10403          */
10404         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
10405                 UINT32_C(0x8)
10406         /* When this bit is '1', PTP is enabled for RX on this port. */
10407         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
10408                 UINT32_C(0x10)
10409         /* When this bit is '1', PTP is enabled for TX on this port. */
10410         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
10411                 UINT32_C(0x20)
10412         /*
10413          * Priority setting for tunnel VLAN PRI to CoS mapping.
10414          * # Each XXX_pri variable shall have a unique priority value
10415          * when it is being used.
10416          * # When comparing priorities of mappings, higher value
10417          * indicates higher priority.
10418          * For example, a value of 0-3 is returned where 0 is being
10419          * the lowest priority and 3 is being the highest priority.
10420          * # If the correspoding CoS mapping is not enabled, then this
10421          * field should be ignored.
10422          * # This value indicates the normalized priority value retained
10423          * in the HWRM.
10424          */
10425         uint8_t tunnel_pri2cos_map_pri;
10426         /*
10427          * Priority setting for DSCP to PRI mapping.
10428          * # Each XXX_pri variable shall have a unique priority value
10429          * when it is being used.
10430          * # When comparing priorities of mappings, higher value
10431          * indicates higher priority.
10432          * For example, a value of 0-3 is returned where 0 is being
10433          * the lowest priority and 3 is being the highest priority.
10434          * # If the correspoding CoS mapping is not enabled, then this
10435          * field should be ignored.
10436          * # This value indicates the normalized priority value retained
10437          * in the HWRM.
10438          */
10439         uint8_t dscp2pri_map_pri;
10440         /*
10441          * This is a 16-bit bit mask that represents the
10442          * current configuration of time stamp capture of PTP messages
10443          * on the receive side of this port.
10444          * If bit 'i' is set, then the receive side of the port
10445          * is configured to capture the time stamp of every
10446          * received PTP message with messageType field value set
10447          * to i.
10448          * If all bits are set to 0 (i.e. field value set 0),
10449          * then the receive side of the port is not configured
10450          * to capture timestamp for PTP messages.
10451          * If all bits are set to 1, then the receive side of the
10452          * port is configured to capture timestamp for all PTP
10453          * messages.
10454          */
10455         uint16_t        rx_ts_capture_ptp_msg_type;
10456         /*
10457          * This is a 16-bit bit mask that represents the
10458          * current configuration of time stamp capture of PTP messages
10459          * on the transmit side of this port.
10460          * If bit 'i' is set, then the transmit side of the port
10461          * is configured to capture the time stamp of every
10462          * received PTP message with messageType field value set
10463          * to i.
10464          * If all bits are set to 0 (i.e. field value set 0),
10465          * then the transmit side of the port is not configured
10466          * to capture timestamp for PTP messages.
10467          * If all bits are set to 1, then the transmit side of the
10468          * port is configured to capture timestamp for all PTP
10469          * messages.
10470          */
10471         uint16_t        tx_ts_capture_ptp_msg_type;
10472         /* Configuration of CoS fields. */
10473         uint8_t cos_field_cfg;
10474         /* Reserved */
10475         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
10476                 UINT32_C(0x1)
10477         /*
10478          * This field is used for selecting VLAN PRI value
10479          * based on whether one or two VLAN Tags are present in
10480          * the inner packet headers of tunneled packets or
10481          * non-tunneled packets.
10482          */
10483         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
10484                 UINT32_C(0x6)
10485         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
10486                 1
10487         /*
10488          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
10489          * present in the inner packet headers
10490          */
10491         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
10492                 (UINT32_C(0x0) << 1)
10493         /*
10494          * Select outer VLAN Tag PRI when 2 VLAN Tags are
10495          * present in the inner packet headers.
10496          * No VLAN PRI is selected for this configuration
10497          * if only one VLAN Tag is present in the inner
10498          * packet headers.
10499          */
10500         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
10501                 (UINT32_C(0x1) << 1)
10502         /*
10503          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
10504          * are present in the inner packet headers
10505          */
10506         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
10507                 (UINT32_C(0x2) << 1)
10508         /* Unspecified */
10509         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
10510                 (UINT32_C(0x3) << 1)
10511         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
10512                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
10513         /*
10514          * This field is used for selecting tunnel VLAN PRI value
10515          * based on whether one or two VLAN Tags are present in
10516          * the tunnel headers of tunneled packets. This selection
10517          * does not apply to non-tunneled packets.
10518          */
10519         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
10520                 UINT32_C(0x18)
10521         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
10522                 3
10523         /*
10524          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
10525          * present in the tunnel packet headers
10526          */
10527         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
10528                 (UINT32_C(0x0) << 3)
10529         /*
10530          * Select outer VLAN Tag PRI when 2 VLAN Tags are
10531          * present in the tunnel packet headers.
10532          * No VLAN PRI is selected for this configuration
10533          * if only one VLAN Tag is present in the tunnel
10534          * packet headers.
10535          */
10536         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
10537                 (UINT32_C(0x1) << 3)
10538         /*
10539          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
10540          * are present in the tunnel packet headers
10541          */
10542         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
10543                 (UINT32_C(0x2) << 3)
10544         /* Unspecified */
10545         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
10546                 (UINT32_C(0x3) << 3)
10547         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
10548                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
10549         /*
10550          * This field is used to provide default CoS value that
10551          * has been configured on this port.
10552          */
10553         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
10554                 UINT32_C(0xe0)
10555         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
10556                 5
10557         /*
10558          * This field is used in Output records to indicate that the output
10559          * is completely written to RAM.  This field should be read as '1'
10560          * to indicate that the output has been completely written.
10561          * When writing a command completion or response to an internal processor,
10562          * the order of writes has to be such that this field is written last.
10563          */
10564         uint8_t valid;
10565 } __attribute__((packed));
10566
10567 /**************************
10568  * hwrm_port_mac_ptp_qcfg *
10569  **************************/
10570
10571
10572 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
10573 struct hwrm_port_mac_ptp_qcfg_input {
10574         /* The HWRM command request type. */
10575         uint16_t        req_type;
10576         /*
10577          * The completion ring to send the completion event on. This should
10578          * be the NQ ID returned from the `nq_alloc` HWRM command.
10579          */
10580         uint16_t        cmpl_ring;
10581         /*
10582          * The sequence ID is used by the driver for tracking multiple
10583          * commands. This ID is treated as opaque data by the firmware and
10584          * the value is returned in the `hwrm_resp_hdr` upon completion.
10585          */
10586         uint16_t        seq_id;
10587         /*
10588          * The target ID of the command:
10589          * * 0x0-0xFFF8 - The function ID
10590          * * 0xFFF8-0xFFFE - Reserved for internal processors
10591          * * 0xFFFF - HWRM
10592          */
10593         uint16_t        target_id;
10594         /*
10595          * A physical address pointer pointing to a host buffer that the
10596          * command's response data will be written. This can be either a host
10597          * physical address (HPA) or a guest physical address (GPA) and must
10598          * point to a physically contiguous block of memory.
10599          */
10600         uint64_t        resp_addr;
10601         /* Port ID of port that is being queried. */
10602         uint16_t        port_id;
10603         uint8_t unused_0[6];
10604 } __attribute__((packed));
10605
10606 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
10607 struct hwrm_port_mac_ptp_qcfg_output {
10608         /* The specific error status for the command. */
10609         uint16_t        error_code;
10610         /* The HWRM command request type. */
10611         uint16_t        req_type;
10612         /* The sequence ID from the original command. */
10613         uint16_t        seq_id;
10614         /* The length of the response data in number of bytes. */
10615         uint16_t        resp_len;
10616         /*
10617          * In this field, a number of PTP related flags
10618          * are used to indicate configured PTP capabilities.
10619          */
10620         uint8_t flags;
10621         /*
10622          * When this bit is set to '1', the PTP related registers are
10623          * directly accessible by the host.
10624          */
10625         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
10626                 UINT32_C(0x1)
10627         /*
10628          * When this bit is set to '1', the PTP information is accessible
10629          * via HWRM commands.
10630          */
10631         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
10632                 UINT32_C(0x2)
10633         uint8_t unused_0[3];
10634         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
10635         uint32_t        rx_ts_reg_off_lower;
10636         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
10637         uint32_t        rx_ts_reg_off_upper;
10638         /* Offset of the PTP register for the sequence ID for RX. */
10639         uint32_t        rx_ts_reg_off_seq_id;
10640         /* Offset of the first PTP source ID for RX. */
10641         uint32_t        rx_ts_reg_off_src_id_0;
10642         /* Offset of the second PTP source ID for RX. */
10643         uint32_t        rx_ts_reg_off_src_id_1;
10644         /* Offset of the third PTP source ID for RX. */
10645         uint32_t        rx_ts_reg_off_src_id_2;
10646         /* Offset of the domain ID for RX. */
10647         uint32_t        rx_ts_reg_off_domain_id;
10648         /* Offset of the PTP FIFO register for RX. */
10649         uint32_t        rx_ts_reg_off_fifo;
10650         /* Offset of the PTP advance FIFO register for RX. */
10651         uint32_t        rx_ts_reg_off_fifo_adv;
10652         /* PTP timestamp granularity for RX. */
10653         uint32_t        rx_ts_reg_off_granularity;
10654         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
10655         uint32_t        tx_ts_reg_off_lower;
10656         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
10657         uint32_t        tx_ts_reg_off_upper;
10658         /* Offset of the PTP register for the sequence ID for TX. */
10659         uint32_t        tx_ts_reg_off_seq_id;
10660         /* Offset of the PTP FIFO register for TX. */
10661         uint32_t        tx_ts_reg_off_fifo;
10662         /* PTP timestamp granularity for TX. */
10663         uint32_t        tx_ts_reg_off_granularity;
10664         uint8_t unused_1[7];
10665         /*
10666          * This field is used in Output records to indicate that the output
10667          * is completely written to RAM.  This field should be read as '1'
10668          * to indicate that the output has been completely written.
10669          * When writing a command completion or response to an internal processor,
10670          * the order of writes has to be such that this field is written last.
10671          */
10672         uint8_t valid;
10673 } __attribute__((packed));
10674
10675 /********************
10676  * hwrm_port_qstats *
10677  ********************/
10678
10679
10680 /* hwrm_port_qstats_input (size:320b/40B) */
10681 struct hwrm_port_qstats_input {
10682         /* The HWRM command request type. */
10683         uint16_t        req_type;
10684         /*
10685          * The completion ring to send the completion event on. This should
10686          * be the NQ ID returned from the `nq_alloc` HWRM command.
10687          */
10688         uint16_t        cmpl_ring;
10689         /*
10690          * The sequence ID is used by the driver for tracking multiple
10691          * commands. This ID is treated as opaque data by the firmware and
10692          * the value is returned in the `hwrm_resp_hdr` upon completion.
10693          */
10694         uint16_t        seq_id;
10695         /*
10696          * The target ID of the command:
10697          * * 0x0-0xFFF8 - The function ID
10698          * * 0xFFF8-0xFFFE - Reserved for internal processors
10699          * * 0xFFFF - HWRM
10700          */
10701         uint16_t        target_id;
10702         /*
10703          * A physical address pointer pointing to a host buffer that the
10704          * command's response data will be written. This can be either a host
10705          * physical address (HPA) or a guest physical address (GPA) and must
10706          * point to a physically contiguous block of memory.
10707          */
10708         uint64_t        resp_addr;
10709         /* Port ID of port that is being queried. */
10710         uint16_t        port_id;
10711         uint8_t unused_0[6];
10712         /*
10713          * This is the host address where
10714          * Tx port statistics will be stored
10715          */
10716         uint64_t        tx_stat_host_addr;
10717         /*
10718          * This is the host address where
10719          * Rx port statistics will be stored
10720          */
10721         uint64_t        rx_stat_host_addr;
10722 } __attribute__((packed));
10723
10724 /* hwrm_port_qstats_output (size:128b/16B) */
10725 struct hwrm_port_qstats_output {
10726         /* The specific error status for the command. */
10727         uint16_t        error_code;
10728         /* The HWRM command request type. */
10729         uint16_t        req_type;
10730         /* The sequence ID from the original command. */
10731         uint16_t        seq_id;
10732         /* The length of the response data in number of bytes. */
10733         uint16_t        resp_len;
10734         /* The size of TX port statistics block in bytes. */
10735         uint16_t        tx_stat_size;
10736         /* The size of RX port statistics block in bytes. */
10737         uint16_t        rx_stat_size;
10738         uint8_t unused_0[3];
10739         /*
10740          * This field is used in Output records to indicate that the output
10741          * is completely written to RAM.  This field should be read as '1'
10742          * to indicate that the output has been completely written.
10743          * When writing a command completion or response to an internal processor,
10744          * the order of writes has to be such that this field is written last.
10745          */
10746         uint8_t valid;
10747 } __attribute__((packed));
10748
10749 /************************
10750  * hwrm_port_qstats_ext *
10751  ************************/
10752
10753
10754 /* hwrm_port_qstats_ext_input (size:320b/40B) */
10755 struct hwrm_port_qstats_ext_input {
10756         /* The HWRM command request type. */
10757         uint16_t        req_type;
10758         /*
10759          * The completion ring to send the completion event on. This should
10760          * be the NQ ID returned from the `nq_alloc` HWRM command.
10761          */
10762         uint16_t        cmpl_ring;
10763         /*
10764          * The sequence ID is used by the driver for tracking multiple
10765          * commands. This ID is treated as opaque data by the firmware and
10766          * the value is returned in the `hwrm_resp_hdr` upon completion.
10767          */
10768         uint16_t        seq_id;
10769         /*
10770          * The target ID of the command:
10771          * * 0x0-0xFFF8 - The function ID
10772          * * 0xFFF8-0xFFFE - Reserved for internal processors
10773          * * 0xFFFF - HWRM
10774          */
10775         uint16_t        target_id;
10776         /*
10777          * A physical address pointer pointing to a host buffer that the
10778          * command's response data will be written. This can be either a host
10779          * physical address (HPA) or a guest physical address (GPA) and must
10780          * point to a physically contiguous block of memory.
10781          */
10782         uint64_t        resp_addr;
10783         /* Port ID of port that is being queried. */
10784         uint16_t        port_id;
10785         /*
10786          * The size of TX port extended
10787          * statistics block in bytes.
10788          */
10789         uint16_t        tx_stat_size;
10790         /*
10791          * The size of RX port extended
10792          * statistics block in bytes
10793          */
10794         uint16_t        rx_stat_size;
10795         uint8_t unused_0[2];
10796         /*
10797          * This is the host address where
10798          * Tx port statistics will be stored
10799          */
10800         uint64_t        tx_stat_host_addr;
10801         /*
10802          * This is the host address where
10803          * Rx port statistics will be stored
10804          */
10805         uint64_t        rx_stat_host_addr;
10806 } __attribute__((packed));
10807
10808 /* hwrm_port_qstats_ext_output (size:128b/16B) */
10809 struct hwrm_port_qstats_ext_output {
10810         /* The specific error status for the command. */
10811         uint16_t        error_code;
10812         /* The HWRM command request type. */
10813         uint16_t        req_type;
10814         /* The sequence ID from the original command. */
10815         uint16_t        seq_id;
10816         /* The length of the response data in number of bytes. */
10817         uint16_t        resp_len;
10818         /* The size of TX port statistics block in bytes. */
10819         uint16_t        tx_stat_size;
10820         /* The size of RX port statistics block in bytes. */
10821         uint16_t        rx_stat_size;
10822         uint8_t unused_0[3];
10823         /*
10824          * This field is used in Output records to indicate that the output
10825          * is completely written to RAM.  This field should be read as '1'
10826          * to indicate that the output has been completely written.
10827          * When writing a command completion or response to an internal processor,
10828          * the order of writes has to be such that this field is written last.
10829          */
10830         uint8_t valid;
10831 } __attribute__((packed));
10832
10833 /*************************
10834  * hwrm_port_lpbk_qstats *
10835  *************************/
10836
10837
10838 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
10839 struct hwrm_port_lpbk_qstats_input {
10840         /* The HWRM command request type. */
10841         uint16_t        req_type;
10842         /*
10843          * The completion ring to send the completion event on. This should
10844          * be the NQ ID returned from the `nq_alloc` HWRM command.
10845          */
10846         uint16_t        cmpl_ring;
10847         /*
10848          * The sequence ID is used by the driver for tracking multiple
10849          * commands. This ID is treated as opaque data by the firmware and
10850          * the value is returned in the `hwrm_resp_hdr` upon completion.
10851          */
10852         uint16_t        seq_id;
10853         /*
10854          * The target ID of the command:
10855          * * 0x0-0xFFF8 - The function ID
10856          * * 0xFFF8-0xFFFE - Reserved for internal processors
10857          * * 0xFFFF - HWRM
10858          */
10859         uint16_t        target_id;
10860         /*
10861          * A physical address pointer pointing to a host buffer that the
10862          * command's response data will be written. This can be either a host
10863          * physical address (HPA) or a guest physical address (GPA) and must
10864          * point to a physically contiguous block of memory.
10865          */
10866         uint64_t        resp_addr;
10867 } __attribute__((packed));
10868
10869 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
10870 struct hwrm_port_lpbk_qstats_output {
10871         /* The specific error status for the command. */
10872         uint16_t        error_code;
10873         /* The HWRM command request type. */
10874         uint16_t        req_type;
10875         /* The sequence ID from the original command. */
10876         uint16_t        seq_id;
10877         /* The length of the response data in number of bytes. */
10878         uint16_t        resp_len;
10879         /* Number of transmitted unicast frames */
10880         uint64_t        lpbk_ucast_frames;
10881         /* Number of transmitted multicast frames */
10882         uint64_t        lpbk_mcast_frames;
10883         /* Number of transmitted broadcast frames */
10884         uint64_t        lpbk_bcast_frames;
10885         /* Number of transmitted bytes for unicast traffic */
10886         uint64_t        lpbk_ucast_bytes;
10887         /* Number of transmitted bytes for multicast traffic */
10888         uint64_t        lpbk_mcast_bytes;
10889         /* Number of transmitted bytes for broadcast traffic */
10890         uint64_t        lpbk_bcast_bytes;
10891         /* Total Tx Drops for loopback traffic reported by STATS block */
10892         uint64_t        tx_stat_discard;
10893         /* Total Tx Error Drops for loopback traffic reported by STATS block */
10894         uint64_t        tx_stat_error;
10895         /* Total Rx Drops for loopback traffic reported by STATS block */
10896         uint64_t        rx_stat_discard;
10897         /* Total Rx Error Drops for loopback traffic reported by STATS block */
10898         uint64_t        rx_stat_error;
10899         uint8_t unused_0[7];
10900         /*
10901          * This field is used in Output records to indicate that the output
10902          * is completely written to RAM.  This field should be read as '1'
10903          * to indicate that the output has been completely written.
10904          * When writing a command completion or response to an internal processor,
10905          * the order of writes has to be such that this field is written last.
10906          */
10907         uint8_t valid;
10908 } __attribute__((packed));
10909
10910 /***********************
10911  * hwrm_port_clr_stats *
10912  ***********************/
10913
10914
10915 /* hwrm_port_clr_stats_input (size:192b/24B) */
10916 struct hwrm_port_clr_stats_input {
10917         /* The HWRM command request type. */
10918         uint16_t        req_type;
10919         /*
10920          * The completion ring to send the completion event on. This should
10921          * be the NQ ID returned from the `nq_alloc` HWRM command.
10922          */
10923         uint16_t        cmpl_ring;
10924         /*
10925          * The sequence ID is used by the driver for tracking multiple
10926          * commands. This ID is treated as opaque data by the firmware and
10927          * the value is returned in the `hwrm_resp_hdr` upon completion.
10928          */
10929         uint16_t        seq_id;
10930         /*
10931          * The target ID of the command:
10932          * * 0x0-0xFFF8 - The function ID
10933          * * 0xFFF8-0xFFFE - Reserved for internal processors
10934          * * 0xFFFF - HWRM
10935          */
10936         uint16_t        target_id;
10937         /*
10938          * A physical address pointer pointing to a host buffer that the
10939          * command's response data will be written. This can be either a host
10940          * physical address (HPA) or a guest physical address (GPA) and must
10941          * point to a physically contiguous block of memory.
10942          */
10943         uint64_t        resp_addr;
10944         /* Port ID of port that is being queried. */
10945         uint16_t        port_id;
10946         uint8_t unused_0[6];
10947 } __attribute__((packed));
10948
10949 /* hwrm_port_clr_stats_output (size:128b/16B) */
10950 struct hwrm_port_clr_stats_output {
10951         /* The specific error status for the command. */
10952         uint16_t        error_code;
10953         /* The HWRM command request type. */
10954         uint16_t        req_type;
10955         /* The sequence ID from the original command. */
10956         uint16_t        seq_id;
10957         /* The length of the response data in number of bytes. */
10958         uint16_t        resp_len;
10959         uint8_t unused_0[7];
10960         /*
10961          * This field is used in Output records to indicate that the output
10962          * is completely written to RAM.  This field should be read as '1'
10963          * to indicate that the output has been completely written.
10964          * When writing a command completion or response to an internal processor,
10965          * the order of writes has to be such that this field is written last.
10966          */
10967         uint8_t valid;
10968 } __attribute__((packed));
10969
10970 /****************************
10971  * hwrm_port_lpbk_clr_stats *
10972  ****************************/
10973
10974
10975 /* hwrm_port_lpbk_clr_stats_input (size:128b/16B) */
10976 struct hwrm_port_lpbk_clr_stats_input {
10977         /* The HWRM command request type. */
10978         uint16_t        req_type;
10979         /*
10980          * The completion ring to send the completion event on. This should
10981          * be the NQ ID returned from the `nq_alloc` HWRM command.
10982          */
10983         uint16_t        cmpl_ring;
10984         /*
10985          * The sequence ID is used by the driver for tracking multiple
10986          * commands. This ID is treated as opaque data by the firmware and
10987          * the value is returned in the `hwrm_resp_hdr` upon completion.
10988          */
10989         uint16_t        seq_id;
10990         /*
10991          * The target ID of the command:
10992          * * 0x0-0xFFF8 - The function ID
10993          * * 0xFFF8-0xFFFE - Reserved for internal processors
10994          * * 0xFFFF - HWRM
10995          */
10996         uint16_t        target_id;
10997         /*
10998          * A physical address pointer pointing to a host buffer that the
10999          * command's response data will be written. This can be either a host
11000          * physical address (HPA) or a guest physical address (GPA) and must
11001          * point to a physically contiguous block of memory.
11002          */
11003         uint64_t        resp_addr;
11004 } __attribute__((packed));
11005
11006 /* hwrm_port_lpbk_clr_stats_output (size:128b/16B) */
11007 struct hwrm_port_lpbk_clr_stats_output {
11008         /* The specific error status for the command. */
11009         uint16_t        error_code;
11010         /* The HWRM command request type. */
11011         uint16_t        req_type;
11012         /* The sequence ID from the original command. */
11013         uint16_t        seq_id;
11014         /* The length of the response data in number of bytes. */
11015         uint16_t        resp_len;
11016         uint8_t unused_0[7];
11017         /*
11018          * This field is used in Output records to indicate that the output
11019          * is completely written to RAM.  This field should be read as '1'
11020          * to indicate that the output has been completely written.
11021          * When writing a command completion or response to an internal processor,
11022          * the order of writes has to be such that this field is written last.
11023          */
11024         uint8_t valid;
11025 } __attribute__((packed));
11026
11027 /**********************
11028  * hwrm_port_ts_query *
11029  **********************/
11030
11031
11032 /* hwrm_port_ts_query_input (size:192b/24B) */
11033 struct hwrm_port_ts_query_input {
11034         /* The HWRM command request type. */
11035         uint16_t        req_type;
11036         /*
11037          * The completion ring to send the completion event on. This should
11038          * be the NQ ID returned from the `nq_alloc` HWRM command.
11039          */
11040         uint16_t        cmpl_ring;
11041         /*
11042          * The sequence ID is used by the driver for tracking multiple
11043          * commands. This ID is treated as opaque data by the firmware and
11044          * the value is returned in the `hwrm_resp_hdr` upon completion.
11045          */
11046         uint16_t        seq_id;
11047         /*
11048          * The target ID of the command:
11049          * * 0x0-0xFFF8 - The function ID
11050          * * 0xFFF8-0xFFFE - Reserved for internal processors
11051          * * 0xFFFF - HWRM
11052          */
11053         uint16_t        target_id;
11054         /*
11055          * A physical address pointer pointing to a host buffer that the
11056          * command's response data will be written. This can be either a host
11057          * physical address (HPA) or a guest physical address (GPA) and must
11058          * point to a physically contiguous block of memory.
11059          */
11060         uint64_t        resp_addr;
11061         uint32_t        flags;
11062         /*
11063          * Enumeration denoting the RX, TX type of the resource.
11064          * This enumeration is used for resources that are similar for both
11065          * TX and RX paths of the chip.
11066          */
11067         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH     UINT32_C(0x1)
11068         /* tx path */
11069         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
11070         /* rx path */
11071         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
11072         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST \
11073                 HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
11074         /* Port ID of port that is being queried. */
11075         uint16_t        port_id;
11076         uint8_t unused_0[2];
11077 } __attribute__((packed));
11078
11079 /* hwrm_port_ts_query_output (size:192b/24B) */
11080 struct hwrm_port_ts_query_output {
11081         /* The specific error status for the command. */
11082         uint16_t        error_code;
11083         /* The HWRM command request type. */
11084         uint16_t        req_type;
11085         /* The sequence ID from the original command. */
11086         uint16_t        seq_id;
11087         /* The length of the response data in number of bytes. */
11088         uint16_t        resp_len;
11089         /* Timestamp value of PTP message captured. */
11090         uint64_t        ptp_msg_ts;
11091         /* Sequence ID of the PTP message captured. */
11092         uint16_t        ptp_msg_seqid;
11093         uint8_t unused_0[5];
11094         /*
11095          * This field is used in Output records to indicate that the output
11096          * is completely written to RAM.  This field should be read as '1'
11097          * to indicate that the output has been completely written.
11098          * When writing a command completion or response to an internal processor,
11099          * the order of writes has to be such that this field is written last.
11100          */
11101         uint8_t valid;
11102 } __attribute__((packed));
11103
11104 /***********************
11105  * hwrm_port_phy_qcaps *
11106  ***********************/
11107
11108
11109 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
11110 struct hwrm_port_phy_qcaps_input {
11111         /* The HWRM command request type. */
11112         uint16_t        req_type;
11113         /*
11114          * The completion ring to send the completion event on. This should
11115          * be the NQ ID returned from the `nq_alloc` HWRM command.
11116          */
11117         uint16_t        cmpl_ring;
11118         /*
11119          * The sequence ID is used by the driver for tracking multiple
11120          * commands. This ID is treated as opaque data by the firmware and
11121          * the value is returned in the `hwrm_resp_hdr` upon completion.
11122          */
11123         uint16_t        seq_id;
11124         /*
11125          * The target ID of the command:
11126          * * 0x0-0xFFF8 - The function ID
11127          * * 0xFFF8-0xFFFE - Reserved for internal processors
11128          * * 0xFFFF - HWRM
11129          */
11130         uint16_t        target_id;
11131         /*
11132          * A physical address pointer pointing to a host buffer that the
11133          * command's response data will be written. This can be either a host
11134          * physical address (HPA) or a guest physical address (GPA) and must
11135          * point to a physically contiguous block of memory.
11136          */
11137         uint64_t        resp_addr;
11138         /* Port ID of port that is being queried. */
11139         uint16_t        port_id;
11140         uint8_t unused_0[6];
11141 } __attribute__((packed));
11142
11143 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
11144 struct hwrm_port_phy_qcaps_output {
11145         /* The specific error status for the command. */
11146         uint16_t        error_code;
11147         /* The HWRM command request type. */
11148         uint16_t        req_type;
11149         /* The sequence ID from the original command. */
11150         uint16_t        seq_id;
11151         /* The length of the response data in number of bytes. */
11152         uint16_t        resp_len;
11153         /* PHY capability flags */
11154         uint8_t flags;
11155         /*
11156          * If set to 1, then this field indicates that the
11157          * link is capable of supporting EEE.
11158          */
11159         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
11160                 UINT32_C(0x1)
11161         /*
11162          * If set to 1, then this field indicates that the
11163          * PHY is capable of supporting external loopback.
11164          */
11165         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
11166                 UINT32_C(0x2)
11167         /*
11168          * Reserved field. The HWRM shall set this field to 0.
11169          * An HWRM client shall ignore this field.
11170          */
11171         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
11172                 UINT32_C(0xfc)
11173         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT                   2
11174         /* Number of front panel ports for this device. */
11175         uint8_t port_cnt;
11176         /* Not supported or unknown */
11177         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
11178         /* single port device */
11179         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
11180         /* 2-port device */
11181         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
11182         /* 3-port device */
11183         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
11184         /* 4-port device */
11185         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
11186         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
11187                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
11188         /*
11189          * This is a bit mask to indicate what speeds are supported
11190          * as forced speeds on this link.
11191          * For each speed that can be forced on this link, the
11192          * corresponding mask bit shall be set to '1'.
11193          */
11194         uint16_t        supported_speeds_force_mode;
11195         /* 100Mb link speed (Half-duplex) */
11196         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
11197                 UINT32_C(0x1)
11198         /* 100Mb link speed (Full-duplex) */
11199         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
11200                 UINT32_C(0x2)
11201         /* 1Gb link speed (Half-duplex) */
11202         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
11203                 UINT32_C(0x4)
11204         /* 1Gb link speed (Full-duplex) */
11205         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
11206                 UINT32_C(0x8)
11207         /* 2Gb link speed */
11208         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
11209                 UINT32_C(0x10)
11210         /* 25Gb link speed */
11211         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
11212                 UINT32_C(0x20)
11213         /* 10Gb link speed */
11214         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
11215                 UINT32_C(0x40)
11216         /* 20Gb link speed */
11217         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
11218                 UINT32_C(0x80)
11219         /* 25Gb link speed */
11220         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
11221                 UINT32_C(0x100)
11222         /* 40Gb link speed */
11223         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
11224                 UINT32_C(0x200)
11225         /* 50Gb link speed */
11226         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
11227                 UINT32_C(0x400)
11228         /* 100Gb link speed */
11229         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
11230                 UINT32_C(0x800)
11231         /* 10Mb link speed (Half-duplex) */
11232         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
11233                 UINT32_C(0x1000)
11234         /* 10Mb link speed (Full-duplex) */
11235         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
11236                 UINT32_C(0x2000)
11237         /*
11238          * This is a bit mask to indicate what speeds are supported
11239          * for autonegotiation on this link.
11240          * For each speed that can be autonegotiated on this link, the
11241          * corresponding mask bit shall be set to '1'.
11242          */
11243         uint16_t        supported_speeds_auto_mode;
11244         /* 100Mb link speed (Half-duplex) */
11245         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
11246                 UINT32_C(0x1)
11247         /* 100Mb link speed (Full-duplex) */
11248         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
11249                 UINT32_C(0x2)
11250         /* 1Gb link speed (Half-duplex) */
11251         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
11252                 UINT32_C(0x4)
11253         /* 1Gb link speed (Full-duplex) */
11254         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
11255                 UINT32_C(0x8)
11256         /* 2Gb link speed */
11257         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
11258                 UINT32_C(0x10)
11259         /* 25Gb link speed */
11260         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
11261                 UINT32_C(0x20)
11262         /* 10Gb link speed */
11263         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
11264                 UINT32_C(0x40)
11265         /* 20Gb link speed */
11266         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
11267                 UINT32_C(0x80)
11268         /* 25Gb link speed */
11269         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
11270                 UINT32_C(0x100)
11271         /* 40Gb link speed */
11272         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
11273                 UINT32_C(0x200)
11274         /* 50Gb link speed */
11275         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
11276                 UINT32_C(0x400)
11277         /* 100Gb link speed */
11278         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
11279                 UINT32_C(0x800)
11280         /* 10Mb link speed (Half-duplex) */
11281         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
11282                 UINT32_C(0x1000)
11283         /* 10Mb link speed (Full-duplex) */
11284         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
11285                 UINT32_C(0x2000)
11286         /*
11287          * This is a bit mask to indicate what speeds are supported
11288          * for EEE on this link.
11289          * For each speed that can be autonegotiated when EEE is enabled
11290          * on this link, the corresponding mask bit shall be set to '1'.
11291          * This field is only valid when the eee_suppotred is set to '1'.
11292          */
11293         uint16_t        supported_speeds_eee_mode;
11294         /* Reserved */
11295         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
11296                 UINT32_C(0x1)
11297         /* 100Mb link speed (Full-duplex) */
11298         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
11299                 UINT32_C(0x2)
11300         /* Reserved */
11301         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
11302                 UINT32_C(0x4)
11303         /* 1Gb link speed (Full-duplex) */
11304         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
11305                 UINT32_C(0x8)
11306         /* Reserved */
11307         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
11308                 UINT32_C(0x10)
11309         /* Reserved */
11310         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
11311                 UINT32_C(0x20)
11312         /* 10Gb link speed */
11313         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
11314                 UINT32_C(0x40)
11315         uint32_t        tx_lpi_timer_low;
11316         /*
11317          * The lowest value of TX LPI timer that can be set on this link
11318          * when EEE is enabled. This value is in microseconds.
11319          * This field is valid only when_eee_supported is set to '1'.
11320          */
11321         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
11322                 UINT32_C(0xffffff)
11323         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
11324         /*
11325          * Reserved field. The HWRM shall set this field to 0.
11326          * An HWRM client shall ignore this field.
11327          */
11328         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
11329                 UINT32_C(0xff000000)
11330         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
11331         uint32_t        valid_tx_lpi_timer_high;
11332         /*
11333          * The highest value of TX LPI timer that can be set on this link
11334          * when EEE is enabled. This value is in microseconds.
11335          * This field is valid only when_eee_supported is set to '1'.
11336          */
11337         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
11338                 UINT32_C(0xffffff)
11339         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
11340         /*
11341          * This field is used in Output records to indicate that the output
11342          * is completely written to RAM.  This field should be read as '1'
11343          * to indicate that the output has been completely written.
11344          * When writing a command completion or response to an internal processor,
11345          * the order of writes has to be such that this field is written last.
11346          */
11347         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
11348                 UINT32_C(0xff000000)
11349         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
11350 } __attribute__((packed));
11351
11352 /***************************
11353  * hwrm_port_phy_i2c_write *
11354  ***************************/
11355
11356
11357 /* hwrm_port_phy_i2c_write_input (size:832b/104B) */
11358 struct hwrm_port_phy_i2c_write_input {
11359         /* The HWRM command request type. */
11360         uint16_t        req_type;
11361         /*
11362          * The completion ring to send the completion event on. This should
11363          * be the NQ ID returned from the `nq_alloc` HWRM command.
11364          */
11365         uint16_t        cmpl_ring;
11366         /*
11367          * The sequence ID is used by the driver for tracking multiple
11368          * commands. This ID is treated as opaque data by the firmware and
11369          * the value is returned in the `hwrm_resp_hdr` upon completion.
11370          */
11371         uint16_t        seq_id;
11372         /*
11373          * The target ID of the command:
11374          * * 0x0-0xFFF8 - The function ID
11375          * * 0xFFF8-0xFFFE - Reserved for internal processors
11376          * * 0xFFFF - HWRM
11377          */
11378         uint16_t        target_id;
11379         /*
11380          * A physical address pointer pointing to a host buffer that the
11381          * command's response data will be written. This can be either a host
11382          * physical address (HPA) or a guest physical address (GPA) and must
11383          * point to a physically contiguous block of memory.
11384          */
11385         uint64_t        resp_addr;
11386         uint32_t        flags;
11387         uint32_t        enables;
11388         /*
11389          * This bit must be '1' for the page_offset field to be
11390          * configured.
11391          */
11392         #define HWRM_PORT_PHY_I2C_WRITE_INPUT_ENABLES_PAGE_OFFSET \
11393                 UINT32_C(0x1)
11394         /* Port ID of port. */
11395         uint16_t        port_id;
11396         /* 8-bit I2C slave address. */
11397         uint8_t i2c_slave_addr;
11398         uint8_t unused_0;
11399         /* The page number that is being accessed over I2C. */
11400         uint16_t        page_number;
11401         /* Offset within the page that is being accessed over I2C. */
11402         uint16_t        page_offset;
11403         /*
11404          * Length of data to write, in bytes starting at the offset
11405          * specified above. If the offset is not specified, then
11406          * the data shall be written from the beginning of the page.
11407          */
11408         uint8_t data_length;
11409         uint8_t unused_1[7];
11410         /* Up to 64B of data. */
11411         uint32_t        data[16];
11412 } __attribute__((packed));
11413
11414 /* hwrm_port_phy_i2c_write_output (size:128b/16B) */
11415 struct hwrm_port_phy_i2c_write_output {
11416         /* The specific error status for the command. */
11417         uint16_t        error_code;
11418         /* The HWRM command request type. */
11419         uint16_t        req_type;
11420         /* The sequence ID from the original command. */
11421         uint16_t        seq_id;
11422         /* The length of the response data in number of bytes. */
11423         uint16_t        resp_len;
11424         uint8_t unused_0[7];
11425         /*
11426          * This field is used in Output records to indicate that the output
11427          * is completely written to RAM.  This field should be read as '1'
11428          * to indicate that the output has been completely written.
11429          * When writing a command completion or response to an internal processor,
11430          * the order of writes has to be such that this field is written last.
11431          */
11432         uint8_t valid;
11433 } __attribute__((packed));
11434
11435 /**************************
11436  * hwrm_port_phy_i2c_read *
11437  **************************/
11438
11439
11440 /* hwrm_port_phy_i2c_read_input (size:320b/40B) */
11441 struct hwrm_port_phy_i2c_read_input {
11442         /* The HWRM command request type. */
11443         uint16_t        req_type;
11444         /*
11445          * The completion ring to send the completion event on. This should
11446          * be the NQ ID returned from the `nq_alloc` HWRM command.
11447          */
11448         uint16_t        cmpl_ring;
11449         /*
11450          * The sequence ID is used by the driver for tracking multiple
11451          * commands. This ID is treated as opaque data by the firmware and
11452          * the value is returned in the `hwrm_resp_hdr` upon completion.
11453          */
11454         uint16_t        seq_id;
11455         /*
11456          * The target ID of the command:
11457          * * 0x0-0xFFF8 - The function ID
11458          * * 0xFFF8-0xFFFE - Reserved for internal processors
11459          * * 0xFFFF - HWRM
11460          */
11461         uint16_t        target_id;
11462         /*
11463          * A physical address pointer pointing to a host buffer that the
11464          * command's response data will be written. This can be either a host
11465          * physical address (HPA) or a guest physical address (GPA) and must
11466          * point to a physically contiguous block of memory.
11467          */
11468         uint64_t        resp_addr;
11469         uint32_t        flags;
11470         uint32_t        enables;
11471         /*
11472          * This bit must be '1' for the page_offset field to be
11473          * configured.
11474          */
11475         #define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_PAGE_OFFSET \
11476                 UINT32_C(0x1)
11477         /* Port ID of port. */
11478         uint16_t        port_id;
11479         /* 8-bit I2C slave address. */
11480         uint8_t i2c_slave_addr;
11481         uint8_t unused_0;
11482         /* The page number that is being accessed over I2C. */
11483         uint16_t        page_number;
11484         /* Offset within the page that is being accessed over I2C. */
11485         uint16_t        page_offset;
11486         /*
11487          * Length of data to read, in bytes starting at the offset
11488          * specified above. If the offset is not specified, then
11489          * the data shall be read from the beginning of the page.
11490          */
11491         uint8_t data_length;
11492         uint8_t unused_1[7];
11493 } __attribute__((packed));
11494
11495 /* hwrm_port_phy_i2c_read_output (size:640b/80B) */
11496 struct hwrm_port_phy_i2c_read_output {
11497         /* The specific error status for the command. */
11498         uint16_t        error_code;
11499         /* The HWRM command request type. */
11500         uint16_t        req_type;
11501         /* The sequence ID from the original command. */
11502         uint16_t        seq_id;
11503         /* The length of the response data in number of bytes. */
11504         uint16_t        resp_len;
11505         /* Up to 64B of data. */
11506         uint32_t        data[16];
11507         uint8_t unused_0[7];
11508         /*
11509          * This field is used in Output records to indicate that the output
11510          * is completely written to RAM.  This field should be read as '1'
11511          * to indicate that the output has been completely written.
11512          * When writing a command completion or response to an internal processor,
11513          * the order of writes has to be such that this field is written last.
11514          */
11515         uint8_t valid;
11516 } __attribute__((packed));
11517
11518 /*********************
11519  * hwrm_port_led_cfg *
11520  *********************/
11521
11522
11523 /* hwrm_port_led_cfg_input (size:512b/64B) */
11524 struct hwrm_port_led_cfg_input {
11525         /* The HWRM command request type. */
11526         uint16_t        req_type;
11527         /*
11528          * The completion ring to send the completion event on. This should
11529          * be the NQ ID returned from the `nq_alloc` HWRM command.
11530          */
11531         uint16_t        cmpl_ring;
11532         /*
11533          * The sequence ID is used by the driver for tracking multiple
11534          * commands. This ID is treated as opaque data by the firmware and
11535          * the value is returned in the `hwrm_resp_hdr` upon completion.
11536          */
11537         uint16_t        seq_id;
11538         /*
11539          * The target ID of the command:
11540          * * 0x0-0xFFF8 - The function ID
11541          * * 0xFFF8-0xFFFE - Reserved for internal processors
11542          * * 0xFFFF - HWRM
11543          */
11544         uint16_t        target_id;
11545         /*
11546          * A physical address pointer pointing to a host buffer that the
11547          * command's response data will be written. This can be either a host
11548          * physical address (HPA) or a guest physical address (GPA) and must
11549          * point to a physically contiguous block of memory.
11550          */
11551         uint64_t        resp_addr;
11552         uint32_t        enables;
11553         /*
11554          * This bit must be '1' for the led0_id field to be
11555          * configured.
11556          */
11557         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
11558                 UINT32_C(0x1)
11559         /*
11560          * This bit must be '1' for the led0_state field to be
11561          * configured.
11562          */
11563         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
11564                 UINT32_C(0x2)
11565         /*
11566          * This bit must be '1' for the led0_color field to be
11567          * configured.
11568          */
11569         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
11570                 UINT32_C(0x4)
11571         /*
11572          * This bit must be '1' for the led0_blink_on field to be
11573          * configured.
11574          */
11575         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
11576                 UINT32_C(0x8)
11577         /*
11578          * This bit must be '1' for the led0_blink_off field to be
11579          * configured.
11580          */
11581         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
11582                 UINT32_C(0x10)
11583         /*
11584          * This bit must be '1' for the led0_group_id field to be
11585          * configured.
11586          */
11587         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
11588                 UINT32_C(0x20)
11589         /*
11590          * This bit must be '1' for the led1_id field to be
11591          * configured.
11592          */
11593         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
11594                 UINT32_C(0x40)
11595         /*
11596          * This bit must be '1' for the led1_state field to be
11597          * configured.
11598          */
11599         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
11600                 UINT32_C(0x80)
11601         /*
11602          * This bit must be '1' for the led1_color field to be
11603          * configured.
11604          */
11605         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
11606                 UINT32_C(0x100)
11607         /*
11608          * This bit must be '1' for the led1_blink_on field to be
11609          * configured.
11610          */
11611         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
11612                 UINT32_C(0x200)
11613         /*
11614          * This bit must be '1' for the led1_blink_off field to be
11615          * configured.
11616          */
11617         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
11618                 UINT32_C(0x400)
11619         /*
11620          * This bit must be '1' for the led1_group_id field to be
11621          * configured.
11622          */
11623         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
11624                 UINT32_C(0x800)
11625         /*
11626          * This bit must be '1' for the led2_id field to be
11627          * configured.
11628          */
11629         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
11630                 UINT32_C(0x1000)
11631         /*
11632          * This bit must be '1' for the led2_state field to be
11633          * configured.
11634          */
11635         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
11636                 UINT32_C(0x2000)
11637         /*
11638          * This bit must be '1' for the led2_color field to be
11639          * configured.
11640          */
11641         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
11642                 UINT32_C(0x4000)
11643         /*
11644          * This bit must be '1' for the led2_blink_on field to be
11645          * configured.
11646          */
11647         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
11648                 UINT32_C(0x8000)
11649         /*
11650          * This bit must be '1' for the led2_blink_off field to be
11651          * configured.
11652          */
11653         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
11654                 UINT32_C(0x10000)
11655         /*
11656          * This bit must be '1' for the led2_group_id field to be
11657          * configured.
11658          */
11659         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
11660                 UINT32_C(0x20000)
11661         /*
11662          * This bit must be '1' for the led3_id field to be
11663          * configured.
11664          */
11665         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
11666                 UINT32_C(0x40000)
11667         /*
11668          * This bit must be '1' for the led3_state field to be
11669          * configured.
11670          */
11671         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
11672                 UINT32_C(0x80000)
11673         /*
11674          * This bit must be '1' for the led3_color field to be
11675          * configured.
11676          */
11677         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
11678                 UINT32_C(0x100000)
11679         /*
11680          * This bit must be '1' for the led3_blink_on field to be
11681          * configured.
11682          */
11683         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
11684                 UINT32_C(0x200000)
11685         /*
11686          * This bit must be '1' for the led3_blink_off field to be
11687          * configured.
11688          */
11689         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
11690                 UINT32_C(0x400000)
11691         /*
11692          * This bit must be '1' for the led3_group_id field to be
11693          * configured.
11694          */
11695         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
11696                 UINT32_C(0x800000)
11697         /* Port ID of port whose LEDs are configured. */
11698         uint16_t        port_id;
11699         /*
11700          * The number of LEDs that are being configured.
11701          * Up to 4 LEDs can be configured with this command.
11702          */
11703         uint8_t num_leds;
11704         /* Reserved field. */
11705         uint8_t rsvd;
11706         /* An identifier for the LED #0. */
11707         uint8_t led0_id;
11708         /* The requested state of the LED #0. */
11709         uint8_t led0_state;
11710         /* Default state of the LED */
11711         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
11712         /* Off */
11713         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
11714         /* On */
11715         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
11716         /* Blink */
11717         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
11718         /* Blink Alternately */
11719         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
11720         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
11721                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
11722         /* The requested color of LED #0. */
11723         uint8_t led0_color;
11724         /* Default */
11725         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
11726         /* Amber */
11727         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
11728         /* Green */
11729         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
11730         /* Green or Amber */
11731         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
11732         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
11733                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
11734         uint8_t unused_0;
11735         /*
11736          * If the LED #0 state is "blink" or "blinkalt", then
11737          * this field represents the requested time in milliseconds
11738          * to keep LED on between cycles.
11739          */
11740         uint16_t        led0_blink_on;
11741         /*
11742          * If the LED #0 state is "blink" or "blinkalt", then
11743          * this field represents the requested time in milliseconds
11744          * to keep LED off between cycles.
11745          */
11746         uint16_t        led0_blink_off;
11747         /*
11748          * An identifier for the group of LEDs that LED #0 belongs
11749          * to.
11750          * If set to 0, then the LED #0 shall not be grouped and
11751          * shall be treated as an individual resource.
11752          * For all other non-zero values of this field, LED #0 shall
11753          * be grouped together with the LEDs with the same group ID
11754          * value.
11755          */
11756         uint8_t led0_group_id;
11757         /* Reserved field. */
11758         uint8_t rsvd0;
11759         /* An identifier for the LED #1. */
11760         uint8_t led1_id;
11761         /* The requested state of the LED #1. */
11762         uint8_t led1_state;
11763         /* Default state of the LED */
11764         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
11765         /* Off */
11766         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
11767         /* On */
11768         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
11769         /* Blink */
11770         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
11771         /* Blink Alternately */
11772         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
11773         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
11774                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
11775         /* The requested color of LED #1. */
11776         uint8_t led1_color;
11777         /* Default */
11778         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
11779         /* Amber */
11780         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
11781         /* Green */
11782         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
11783         /* Green or Amber */
11784         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
11785         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
11786                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
11787         uint8_t unused_1;
11788         /*
11789          * If the LED #1 state is "blink" or "blinkalt", then
11790          * this field represents the requested time in milliseconds
11791          * to keep LED on between cycles.
11792          */
11793         uint16_t        led1_blink_on;
11794         /*
11795          * If the LED #1 state is "blink" or "blinkalt", then
11796          * this field represents the requested time in milliseconds
11797          * to keep LED off between cycles.
11798          */
11799         uint16_t        led1_blink_off;
11800         /*
11801          * An identifier for the group of LEDs that LED #1 belongs
11802          * to.
11803          * If set to 0, then the LED #1 shall not be grouped and
11804          * shall be treated as an individual resource.
11805          * For all other non-zero values of this field, LED #1 shall
11806          * be grouped together with the LEDs with the same group ID
11807          * value.
11808          */
11809         uint8_t led1_group_id;
11810         /* Reserved field. */
11811         uint8_t rsvd1;
11812         /* An identifier for the LED #2. */
11813         uint8_t led2_id;
11814         /* The requested state of the LED #2. */
11815         uint8_t led2_state;
11816         /* Default state of the LED */
11817         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
11818         /* Off */
11819         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
11820         /* On */
11821         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
11822         /* Blink */
11823         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
11824         /* Blink Alternately */
11825         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
11826         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
11827                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
11828         /* The requested color of LED #2. */
11829         uint8_t led2_color;
11830         /* Default */
11831         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
11832         /* Amber */
11833         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
11834         /* Green */
11835         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
11836         /* Green or Amber */
11837         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
11838         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
11839                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
11840         uint8_t unused_2;
11841         /*
11842          * If the LED #2 state is "blink" or "blinkalt", then
11843          * this field represents the requested time in milliseconds
11844          * to keep LED on between cycles.
11845          */
11846         uint16_t        led2_blink_on;
11847         /*
11848          * If the LED #2 state is "blink" or "blinkalt", then
11849          * this field represents the requested time in milliseconds
11850          * to keep LED off between cycles.
11851          */
11852         uint16_t        led2_blink_off;
11853         /*
11854          * An identifier for the group of LEDs that LED #2 belongs
11855          * to.
11856          * If set to 0, then the LED #2 shall not be grouped and
11857          * shall be treated as an individual resource.
11858          * For all other non-zero values of this field, LED #2 shall
11859          * be grouped together with the LEDs with the same group ID
11860          * value.
11861          */
11862         uint8_t led2_group_id;
11863         /* Reserved field. */
11864         uint8_t rsvd2;
11865         /* An identifier for the LED #3. */
11866         uint8_t led3_id;
11867         /* The requested state of the LED #3. */
11868         uint8_t led3_state;
11869         /* Default state of the LED */
11870         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
11871         /* Off */
11872         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
11873         /* On */
11874         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
11875         /* Blink */
11876         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
11877         /* Blink Alternately */
11878         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
11879         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
11880                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
11881         /* The requested color of LED #3. */
11882         uint8_t led3_color;
11883         /* Default */
11884         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
11885         /* Amber */
11886         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
11887         /* Green */
11888         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
11889         /* Green or Amber */
11890         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
11891         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
11892                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
11893         uint8_t unused_3;
11894         /*
11895          * If the LED #3 state is "blink" or "blinkalt", then
11896          * this field represents the requested time in milliseconds
11897          * to keep LED on between cycles.
11898          */
11899         uint16_t        led3_blink_on;
11900         /*
11901          * If the LED #3 state is "blink" or "blinkalt", then
11902          * this field represents the requested time in milliseconds
11903          * to keep LED off between cycles.
11904          */
11905         uint16_t        led3_blink_off;
11906         /*
11907          * An identifier for the group of LEDs that LED #3 belongs
11908          * to.
11909          * If set to 0, then the LED #3 shall not be grouped and
11910          * shall be treated as an individual resource.
11911          * For all other non-zero values of this field, LED #3 shall
11912          * be grouped together with the LEDs with the same group ID
11913          * value.
11914          */
11915         uint8_t led3_group_id;
11916         /* Reserved field. */
11917         uint8_t rsvd3;
11918 } __attribute__((packed));
11919
11920 /* hwrm_port_led_cfg_output (size:128b/16B) */
11921 struct hwrm_port_led_cfg_output {
11922         /* The specific error status for the command. */
11923         uint16_t        error_code;
11924         /* The HWRM command request type. */
11925         uint16_t        req_type;
11926         /* The sequence ID from the original command. */
11927         uint16_t        seq_id;
11928         /* The length of the response data in number of bytes. */
11929         uint16_t        resp_len;
11930         uint8_t unused_0[7];
11931         /*
11932          * This field is used in Output records to indicate that the output
11933          * is completely written to RAM.  This field should be read as '1'
11934          * to indicate that the output has been completely written.
11935          * When writing a command completion or response to an internal processor,
11936          * the order of writes has to be such that this field is written last.
11937          */
11938         uint8_t valid;
11939 } __attribute__((packed));
11940
11941 /**********************
11942  * hwrm_port_led_qcfg *
11943  **********************/
11944
11945
11946 /* hwrm_port_led_qcfg_input (size:192b/24B) */
11947 struct hwrm_port_led_qcfg_input {
11948         /* The HWRM command request type. */
11949         uint16_t        req_type;
11950         /*
11951          * The completion ring to send the completion event on. This should
11952          * be the NQ ID returned from the `nq_alloc` HWRM command.
11953          */
11954         uint16_t        cmpl_ring;
11955         /*
11956          * The sequence ID is used by the driver for tracking multiple
11957          * commands. This ID is treated as opaque data by the firmware and
11958          * the value is returned in the `hwrm_resp_hdr` upon completion.
11959          */
11960         uint16_t        seq_id;
11961         /*
11962          * The target ID of the command:
11963          * * 0x0-0xFFF8 - The function ID
11964          * * 0xFFF8-0xFFFE - Reserved for internal processors
11965          * * 0xFFFF - HWRM
11966          */
11967         uint16_t        target_id;
11968         /*
11969          * A physical address pointer pointing to a host buffer that the
11970          * command's response data will be written. This can be either a host
11971          * physical address (HPA) or a guest physical address (GPA) and must
11972          * point to a physically contiguous block of memory.
11973          */
11974         uint64_t        resp_addr;
11975         /* Port ID of port whose LED configuration is being queried. */
11976         uint16_t        port_id;
11977         uint8_t unused_0[6];
11978 } __attribute__((packed));
11979
11980 /* hwrm_port_led_qcfg_output (size:448b/56B) */
11981 struct hwrm_port_led_qcfg_output {
11982         /* The specific error status for the command. */
11983         uint16_t        error_code;
11984         /* The HWRM command request type. */
11985         uint16_t        req_type;
11986         /* The sequence ID from the original command. */
11987         uint16_t        seq_id;
11988         /* The length of the response data in number of bytes. */
11989         uint16_t        resp_len;
11990         /*
11991          * The number of LEDs that are configured on this port.
11992          * Up to 4 LEDs can be returned in the response.
11993          */
11994         uint8_t num_leds;
11995         /* An identifier for the LED #0. */
11996         uint8_t led0_id;
11997         /* The type of LED #0. */
11998         uint8_t led0_type;
11999         /* Speed LED */
12000         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
12001         /* Activity LED */
12002         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
12003         /* Invalid */
12004         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
12005         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
12006                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
12007         /* The current state of the LED #0. */
12008         uint8_t led0_state;
12009         /* Default state of the LED */
12010         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
12011         /* Off */
12012         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
12013         /* On */
12014         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
12015         /* Blink */
12016         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
12017         /* Blink Alternately */
12018         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
12019         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
12020                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
12021         /* The color of LED #0. */
12022         uint8_t led0_color;
12023         /* Default */
12024         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
12025         /* Amber */
12026         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
12027         /* Green */
12028         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
12029         /* Green or Amber */
12030         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
12031         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
12032                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
12033         uint8_t unused_0;
12034         /*
12035          * If the LED #0 state is "blink" or "blinkalt", then
12036          * this field represents the requested time in milliseconds
12037          * to keep LED on between cycles.
12038          */
12039         uint16_t        led0_blink_on;
12040         /*
12041          * If the LED #0 state is "blink" or "blinkalt", then
12042          * this field represents the requested time in milliseconds
12043          * to keep LED off between cycles.
12044          */
12045         uint16_t        led0_blink_off;
12046         /*
12047          * An identifier for the group of LEDs that LED #0 belongs
12048          * to.
12049          * If set to 0, then the LED #0 is not grouped.
12050          * For all other non-zero values of this field, LED #0 is
12051          * grouped together with the LEDs with the same group ID
12052          * value.
12053          */
12054         uint8_t led0_group_id;
12055         /* An identifier for the LED #1. */
12056         uint8_t led1_id;
12057         /* The type of LED #1. */
12058         uint8_t led1_type;
12059         /* Speed LED */
12060         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
12061         /* Activity LED */
12062         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
12063         /* Invalid */
12064         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
12065         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
12066                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
12067         /* The current state of the LED #1. */
12068         uint8_t led1_state;
12069         /* Default state of the LED */
12070         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
12071         /* Off */
12072         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
12073         /* On */
12074         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
12075         /* Blink */
12076         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
12077         /* Blink Alternately */
12078         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
12079         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
12080                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
12081         /* The color of LED #1. */
12082         uint8_t led1_color;
12083         /* Default */
12084         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
12085         /* Amber */
12086         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
12087         /* Green */
12088         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
12089         /* Green or Amber */
12090         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
12091         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
12092                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
12093         uint8_t unused_1;
12094         /*
12095          * If the LED #1 state is "blink" or "blinkalt", then
12096          * this field represents the requested time in milliseconds
12097          * to keep LED on between cycles.
12098          */
12099         uint16_t        led1_blink_on;
12100         /*
12101          * If the LED #1 state is "blink" or "blinkalt", then
12102          * this field represents the requested time in milliseconds
12103          * to keep LED off between cycles.
12104          */
12105         uint16_t        led1_blink_off;
12106         /*
12107          * An identifier for the group of LEDs that LED #1 belongs
12108          * to.
12109          * If set to 0, then the LED #1 is not grouped.
12110          * For all other non-zero values of this field, LED #1 is
12111          * grouped together with the LEDs with the same group ID
12112          * value.
12113          */
12114         uint8_t led1_group_id;
12115         /* An identifier for the LED #2. */
12116         uint8_t led2_id;
12117         /* The type of LED #2. */
12118         uint8_t led2_type;
12119         /* Speed LED */
12120         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
12121         /* Activity LED */
12122         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
12123         /* Invalid */
12124         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
12125         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
12126                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
12127         /* The current state of the LED #2. */
12128         uint8_t led2_state;
12129         /* Default state of the LED */
12130         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
12131         /* Off */
12132         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
12133         /* On */
12134         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
12135         /* Blink */
12136         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
12137         /* Blink Alternately */
12138         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
12139         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
12140                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
12141         /* The color of LED #2. */
12142         uint8_t led2_color;
12143         /* Default */
12144         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
12145         /* Amber */
12146         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
12147         /* Green */
12148         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
12149         /* Green or Amber */
12150         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
12151         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
12152                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
12153         uint8_t unused_2;
12154         /*
12155          * If the LED #2 state is "blink" or "blinkalt", then
12156          * this field represents the requested time in milliseconds
12157          * to keep LED on between cycles.
12158          */
12159         uint16_t        led2_blink_on;
12160         /*
12161          * If the LED #2 state is "blink" or "blinkalt", then
12162          * this field represents the requested time in milliseconds
12163          * to keep LED off between cycles.
12164          */
12165         uint16_t        led2_blink_off;
12166         /*
12167          * An identifier for the group of LEDs that LED #2 belongs
12168          * to.
12169          * If set to 0, then the LED #2 is not grouped.
12170          * For all other non-zero values of this field, LED #2 is
12171          * grouped together with the LEDs with the same group ID
12172          * value.
12173          */
12174         uint8_t led2_group_id;
12175         /* An identifier for the LED #3. */
12176         uint8_t led3_id;
12177         /* The type of LED #3. */
12178         uint8_t led3_type;
12179         /* Speed LED */
12180         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
12181         /* Activity LED */
12182         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
12183         /* Invalid */
12184         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
12185         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
12186                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
12187         /* The current state of the LED #3. */
12188         uint8_t led3_state;
12189         /* Default state of the LED */
12190         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
12191         /* Off */
12192         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
12193         /* On */
12194         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
12195         /* Blink */
12196         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
12197         /* Blink Alternately */
12198         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
12199         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
12200                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
12201         /* The color of LED #3. */
12202         uint8_t led3_color;
12203         /* Default */
12204         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
12205         /* Amber */
12206         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
12207         /* Green */
12208         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
12209         /* Green or Amber */
12210         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
12211         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
12212                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
12213         uint8_t unused_3;
12214         /*
12215          * If the LED #3 state is "blink" or "blinkalt", then
12216          * this field represents the requested time in milliseconds
12217          * to keep LED on between cycles.
12218          */
12219         uint16_t        led3_blink_on;
12220         /*
12221          * If the LED #3 state is "blink" or "blinkalt", then
12222          * this field represents the requested time in milliseconds
12223          * to keep LED off between cycles.
12224          */
12225         uint16_t        led3_blink_off;
12226         /*
12227          * An identifier for the group of LEDs that LED #3 belongs
12228          * to.
12229          * If set to 0, then the LED #3 is not grouped.
12230          * For all other non-zero values of this field, LED #3 is
12231          * grouped together with the LEDs with the same group ID
12232          * value.
12233          */
12234         uint8_t led3_group_id;
12235         uint8_t unused_4[6];
12236         /*
12237          * This field is used in Output records to indicate that the output
12238          * is completely written to RAM.  This field should be read as '1'
12239          * to indicate that the output has been completely written.
12240          * When writing a command completion or response to an internal processor,
12241          * the order of writes has to be such that this field is written last.
12242          */
12243         uint8_t valid;
12244 } __attribute__((packed));
12245
12246 /***********************
12247  * hwrm_port_led_qcaps *
12248  ***********************/
12249
12250
12251 /* hwrm_port_led_qcaps_input (size:192b/24B) */
12252 struct hwrm_port_led_qcaps_input {
12253         /* The HWRM command request type. */
12254         uint16_t        req_type;
12255         /*
12256          * The completion ring to send the completion event on. This should
12257          * be the NQ ID returned from the `nq_alloc` HWRM command.
12258          */
12259         uint16_t        cmpl_ring;
12260         /*
12261          * The sequence ID is used by the driver for tracking multiple
12262          * commands. This ID is treated as opaque data by the firmware and
12263          * the value is returned in the `hwrm_resp_hdr` upon completion.
12264          */
12265         uint16_t        seq_id;
12266         /*
12267          * The target ID of the command:
12268          * * 0x0-0xFFF8 - The function ID
12269          * * 0xFFF8-0xFFFE - Reserved for internal processors
12270          * * 0xFFFF - HWRM
12271          */
12272         uint16_t        target_id;
12273         /*
12274          * A physical address pointer pointing to a host buffer that the
12275          * command's response data will be written. This can be either a host
12276          * physical address (HPA) or a guest physical address (GPA) and must
12277          * point to a physically contiguous block of memory.
12278          */
12279         uint64_t        resp_addr;
12280         /* Port ID of port whose LED configuration is being queried. */
12281         uint16_t        port_id;
12282         uint8_t unused_0[6];
12283 } __attribute__((packed));
12284
12285 /* hwrm_port_led_qcaps_output (size:384b/48B) */
12286 struct hwrm_port_led_qcaps_output {
12287         /* The specific error status for the command. */
12288         uint16_t        error_code;
12289         /* The HWRM command request type. */
12290         uint16_t        req_type;
12291         /* The sequence ID from the original command. */
12292         uint16_t        seq_id;
12293         /* The length of the response data in number of bytes. */
12294         uint16_t        resp_len;
12295         /*
12296          * The number of LEDs that are configured on this port.
12297          * Up to 4 LEDs can be returned in the response.
12298          */
12299         uint8_t num_leds;
12300         /* Reserved for future use. */
12301         uint8_t unused[3];
12302         /* An identifier for the LED #0. */
12303         uint8_t led0_id;
12304         /* The type of LED #0. */
12305         uint8_t led0_type;
12306         /* Speed LED */
12307         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
12308         /* Activity LED */
12309         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
12310         /* Invalid */
12311         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
12312         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
12313                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
12314         /*
12315          * An identifier for the group of LEDs that LED #0 belongs
12316          * to.
12317          * If set to 0, then the LED #0 cannot be grouped.
12318          * For all other non-zero values of this field, LED #0 is
12319          * grouped together with the LEDs with the same group ID
12320          * value.
12321          */
12322         uint8_t led0_group_id;
12323         uint8_t unused_0;
12324         /* The states supported by LED #0. */
12325         uint16_t        led0_state_caps;
12326         /*
12327          * If set to 1, this LED is enabled.
12328          * If set to 0, this LED is disabled.
12329          */
12330         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
12331                 UINT32_C(0x1)
12332         /*
12333          * If set to 1, off state is supported on this LED.
12334          * If set to 0, off state is not supported on this LED.
12335          */
12336         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
12337                 UINT32_C(0x2)
12338         /*
12339          * If set to 1, on state is supported on this LED.
12340          * If set to 0, on state is not supported on this LED.
12341          */
12342         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
12343                 UINT32_C(0x4)
12344         /*
12345          * If set to 1, blink state is supported on this LED.
12346          * If set to 0, blink state is not supported on this LED.
12347          */
12348         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
12349                 UINT32_C(0x8)
12350         /*
12351          * If set to 1, blink_alt state is supported on this LED.
12352          * If set to 0, blink_alt state is not supported on this LED.
12353          */
12354         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
12355                 UINT32_C(0x10)
12356         /* The colors supported by LED #0. */
12357         uint16_t        led0_color_caps;
12358         /* reserved. */
12359         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
12360                 UINT32_C(0x1)
12361         /*
12362          * If set to 1, Amber color is supported on this LED.
12363          * If set to 0, Amber color is not supported on this LED.
12364          */
12365         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
12366                 UINT32_C(0x2)
12367         /*
12368          * If set to 1, Green color is supported on this LED.
12369          * If set to 0, Green color is not supported on this LED.
12370          */
12371         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
12372                 UINT32_C(0x4)
12373         /* An identifier for the LED #1. */
12374         uint8_t led1_id;
12375         /* The type of LED #1. */
12376         uint8_t led1_type;
12377         /* Speed LED */
12378         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
12379         /* Activity LED */
12380         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
12381         /* Invalid */
12382         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
12383         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
12384                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
12385         /*
12386          * An identifier for the group of LEDs that LED #1 belongs
12387          * to.
12388          * If set to 0, then the LED #0 cannot be grouped.
12389          * For all other non-zero values of this field, LED #0 is
12390          * grouped together with the LEDs with the same group ID
12391          * value.
12392          */
12393         uint8_t led1_group_id;
12394         uint8_t unused_1;
12395         /* The states supported by LED #1. */
12396         uint16_t        led1_state_caps;
12397         /*
12398          * If set to 1, this LED is enabled.
12399          * If set to 0, this LED is disabled.
12400          */
12401         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
12402                 UINT32_C(0x1)
12403         /*
12404          * If set to 1, off state is supported on this LED.
12405          * If set to 0, off state is not supported on this LED.
12406          */
12407         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
12408                 UINT32_C(0x2)
12409         /*
12410          * If set to 1, on state is supported on this LED.
12411          * If set to 0, on state is not supported on this LED.
12412          */
12413         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
12414                 UINT32_C(0x4)
12415         /*
12416          * If set to 1, blink state is supported on this LED.
12417          * If set to 0, blink state is not supported on this LED.
12418          */
12419         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
12420                 UINT32_C(0x8)
12421         /*
12422          * If set to 1, blink_alt state is supported on this LED.
12423          * If set to 0, blink_alt state is not supported on this LED.
12424          */
12425         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
12426                 UINT32_C(0x10)
12427         /* The colors supported by LED #1. */
12428         uint16_t        led1_color_caps;
12429         /* reserved. */
12430         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
12431                 UINT32_C(0x1)
12432         /*
12433          * If set to 1, Amber color is supported on this LED.
12434          * If set to 0, Amber color is not supported on this LED.
12435          */
12436         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
12437                 UINT32_C(0x2)
12438         /*
12439          * If set to 1, Green color is supported on this LED.
12440          * If set to 0, Green color is not supported on this LED.
12441          */
12442         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
12443                 UINT32_C(0x4)
12444         /* An identifier for the LED #2. */
12445         uint8_t led2_id;
12446         /* The type of LED #2. */
12447         uint8_t led2_type;
12448         /* Speed LED */
12449         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
12450         /* Activity LED */
12451         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
12452         /* Invalid */
12453         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
12454         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
12455                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
12456         /*
12457          * An identifier for the group of LEDs that LED #0 belongs
12458          * to.
12459          * If set to 0, then the LED #0 cannot be grouped.
12460          * For all other non-zero values of this field, LED #0 is
12461          * grouped together with the LEDs with the same group ID
12462          * value.
12463          */
12464         uint8_t led2_group_id;
12465         uint8_t unused_2;
12466         /* The states supported by LED #2. */
12467         uint16_t        led2_state_caps;
12468         /*
12469          * If set to 1, this LED is enabled.
12470          * If set to 0, this LED is disabled.
12471          */
12472         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
12473                 UINT32_C(0x1)
12474         /*
12475          * If set to 1, off state is supported on this LED.
12476          * If set to 0, off state is not supported on this LED.
12477          */
12478         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
12479                 UINT32_C(0x2)
12480         /*
12481          * If set to 1, on state is supported on this LED.
12482          * If set to 0, on state is not supported on this LED.
12483          */
12484         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
12485                 UINT32_C(0x4)
12486         /*
12487          * If set to 1, blink state is supported on this LED.
12488          * If set to 0, blink state is not supported on this LED.
12489          */
12490         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
12491                 UINT32_C(0x8)
12492         /*
12493          * If set to 1, blink_alt state is supported on this LED.
12494          * If set to 0, blink_alt state is not supported on this LED.
12495          */
12496         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
12497                 UINT32_C(0x10)
12498         /* The colors supported by LED #2. */
12499         uint16_t        led2_color_caps;
12500         /* reserved. */
12501         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
12502                 UINT32_C(0x1)
12503         /*
12504          * If set to 1, Amber color is supported on this LED.
12505          * If set to 0, Amber color is not supported on this LED.
12506          */
12507         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
12508                 UINT32_C(0x2)
12509         /*
12510          * If set to 1, Green color is supported on this LED.
12511          * If set to 0, Green color is not supported on this LED.
12512          */
12513         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
12514                 UINT32_C(0x4)
12515         /* An identifier for the LED #3. */
12516         uint8_t led3_id;
12517         /* The type of LED #3. */
12518         uint8_t led3_type;
12519         /* Speed LED */
12520         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
12521         /* Activity LED */
12522         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
12523         /* Invalid */
12524         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
12525         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
12526                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
12527         /*
12528          * An identifier for the group of LEDs that LED #3 belongs
12529          * to.
12530          * If set to 0, then the LED #0 cannot be grouped.
12531          * For all other non-zero values of this field, LED #0 is
12532          * grouped together with the LEDs with the same group ID
12533          * value.
12534          */
12535         uint8_t led3_group_id;
12536         uint8_t unused_3;
12537         /* The states supported by LED #3. */
12538         uint16_t        led3_state_caps;
12539         /*
12540          * If set to 1, this LED is enabled.
12541          * If set to 0, this LED is disabled.
12542          */
12543         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
12544                 UINT32_C(0x1)
12545         /*
12546          * If set to 1, off state is supported on this LED.
12547          * If set to 0, off state is not supported on this LED.
12548          */
12549         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
12550                 UINT32_C(0x2)
12551         /*
12552          * If set to 1, on state is supported on this LED.
12553          * If set to 0, on state is not supported on this LED.
12554          */
12555         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
12556                 UINT32_C(0x4)
12557         /*
12558          * If set to 1, blink state is supported on this LED.
12559          * If set to 0, blink state is not supported on this LED.
12560          */
12561         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
12562                 UINT32_C(0x8)
12563         /*
12564          * If set to 1, blink_alt state is supported on this LED.
12565          * If set to 0, blink_alt state is not supported on this LED.
12566          */
12567         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
12568                 UINT32_C(0x10)
12569         /* The colors supported by LED #3. */
12570         uint16_t        led3_color_caps;
12571         /* reserved. */
12572         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
12573                 UINT32_C(0x1)
12574         /*
12575          * If set to 1, Amber color is supported on this LED.
12576          * If set to 0, Amber color is not supported on this LED.
12577          */
12578         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
12579                 UINT32_C(0x2)
12580         /*
12581          * If set to 1, Green color is supported on this LED.
12582          * If set to 0, Green color is not supported on this LED.
12583          */
12584         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
12585                 UINT32_C(0x4)
12586         uint8_t unused_4[3];
12587         /*
12588          * This field is used in Output records to indicate that the output
12589          * is completely written to RAM.  This field should be read as '1'
12590          * to indicate that the output has been completely written.
12591          * When writing a command completion or response to an internal processor,
12592          * the order of writes has to be such that this field is written last.
12593          */
12594         uint8_t valid;
12595 } __attribute__((packed));
12596
12597 /***********************
12598  * hwrm_queue_qportcfg *
12599  ***********************/
12600
12601
12602 /* hwrm_queue_qportcfg_input (size:192b/24B) */
12603 struct hwrm_queue_qportcfg_input {
12604         /* The HWRM command request type. */
12605         uint16_t        req_type;
12606         /*
12607          * The completion ring to send the completion event on. This should
12608          * be the NQ ID returned from the `nq_alloc` HWRM command.
12609          */
12610         uint16_t        cmpl_ring;
12611         /*
12612          * The sequence ID is used by the driver for tracking multiple
12613          * commands. This ID is treated as opaque data by the firmware and
12614          * the value is returned in the `hwrm_resp_hdr` upon completion.
12615          */
12616         uint16_t        seq_id;
12617         /*
12618          * The target ID of the command:
12619          * * 0x0-0xFFF8 - The function ID
12620          * * 0xFFF8-0xFFFE - Reserved for internal processors
12621          * * 0xFFFF - HWRM
12622          */
12623         uint16_t        target_id;
12624         /*
12625          * A physical address pointer pointing to a host buffer that the
12626          * command's response data will be written. This can be either a host
12627          * physical address (HPA) or a guest physical address (GPA) and must
12628          * point to a physically contiguous block of memory.
12629          */
12630         uint64_t        resp_addr;
12631         uint32_t        flags;
12632         /*
12633          * Enumeration denoting the RX, TX type of the resource.
12634          * This enumeration is used for resources that are similar for both
12635          * TX and RX paths of the chip.
12636          */
12637         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
12638         /* tx path */
12639         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
12640         /* rx path */
12641         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
12642         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
12643                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
12644         /*
12645          * Port ID of port for which the queue configuration is being
12646          * queried.  This field is only required when sent by IPC.
12647          */
12648         uint16_t        port_id;
12649         /*
12650          * Drivers will set this capability when it can use
12651          * queue_idx_service_profile to map the queues to application.
12652          */
12653         uint8_t drv_qmap_cap;
12654         /* disabled */
12655         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
12656         /* enabled */
12657         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
12658         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
12659                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
12660         uint8_t unused_0;
12661 } __attribute__((packed));
12662
12663 /* hwrm_queue_qportcfg_output (size:256b/32B) */
12664 struct hwrm_queue_qportcfg_output {
12665         /* The specific error status for the command. */
12666         uint16_t        error_code;
12667         /* The HWRM command request type. */
12668         uint16_t        req_type;
12669         /* The sequence ID from the original command. */
12670         uint16_t        seq_id;
12671         /* The length of the response data in number of bytes. */
12672         uint16_t        resp_len;
12673         /*
12674          * The maximum number of queues that can be configured on this
12675          * port.
12676          * Valid values range from 1 through 8.
12677          */
12678         uint8_t max_configurable_queues;
12679         /*
12680          * The maximum number of lossless queues that can be configured
12681          * on this port.
12682          * Valid values range from 0 through 8.
12683          */
12684         uint8_t max_configurable_lossless_queues;
12685         /*
12686          * Bitmask indicating which queues can be configured by the
12687          * hwrm_queue_cfg command.
12688          *
12689          * Each bit represents a specific queue where bit 0 represents
12690          * queue 0 and bit 7 represents queue 7.
12691          * # A value of 0 indicates that the queue is not configurable
12692          * by the hwrm_queue_cfg command.
12693          * # A value of 1 indicates that the queue is configurable.
12694          * # A hwrm_queue_cfg command shall return error when trying to
12695          * configure a queue not configurable.
12696          */
12697         uint8_t queue_cfg_allowed;
12698         /* Information about queue configuration. */
12699         uint8_t queue_cfg_info;
12700         /*
12701          * If this flag is set to '1', then the queues are
12702          * configured asymmetrically on TX and RX sides.
12703          * If this flag is set to '0', then the queues are
12704          * configured symmetrically on TX and RX sides. For
12705          * symmetric configuration, the queue configuration
12706          * including queue ids and service profiles on the
12707          * TX side is the same as the corresponding queue
12708          * configuration on the RX side.
12709          */
12710         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
12711                 UINT32_C(0x1)
12712         /*
12713          * Bitmask indicating which queues can be configured by the
12714          * hwrm_queue_pfcenable_cfg command.
12715          *
12716          * Each bit represents a specific priority where bit 0 represents
12717          * priority 0 and bit 7 represents priority 7.
12718          * # A value of 0 indicates that the priority is not configurable by
12719          * the hwrm_queue_pfcenable_cfg command.
12720          * # A value of 1 indicates that the priority is configurable.
12721          * # A hwrm_queue_pfcenable_cfg command shall return error when
12722          * trying to configure a priority that is not configurable.
12723          */
12724         uint8_t queue_pfcenable_cfg_allowed;
12725         /*
12726          * Bitmask indicating which queues can be configured by the
12727          * hwrm_queue_pri2cos_cfg command.
12728          *
12729          * Each bit represents a specific queue where bit 0 represents
12730          * queue 0 and bit 7 represents queue 7.
12731          * # A value of 0 indicates that the queue is not configurable
12732          * by the hwrm_queue_pri2cos_cfg command.
12733          * # A value of 1 indicates that the queue is configurable.
12734          * # A hwrm_queue_pri2cos_cfg command shall return error when
12735          * trying to configure a queue that is not configurable.
12736          */
12737         uint8_t queue_pri2cos_cfg_allowed;
12738         /*
12739          * Bitmask indicating which queues can be configured by the
12740          * hwrm_queue_pri2cos_cfg command.
12741          *
12742          * Each bit represents a specific queue where bit 0 represents
12743          * queue 0 and bit 7 represents queue 7.
12744          * # A value of 0 indicates that the queue is not configurable
12745          * by the hwrm_queue_pri2cos_cfg command.
12746          * # A value of 1 indicates that the queue is configurable.
12747          * # A hwrm_queue_pri2cos_cfg command shall return error when
12748          * trying to configure a queue not configurable.
12749          */
12750         uint8_t queue_cos2bw_cfg_allowed;
12751         /*
12752          * ID of CoS Queue 0.
12753          * FF - Invalid id
12754          *
12755          * # This ID can be used on any subsequent call to an hwrm command
12756          * that takes a queue id.
12757          * # IDs must always be queried by this command before any use
12758          * by the driver or software.
12759          * # Any driver or software should not make any assumptions about
12760          * queue IDs.
12761          * # A value of 0xff indicates that the queue is not available.
12762          * # Available queues may not be in sequential order.
12763          */
12764         uint8_t queue_id0;
12765         /* This value is applicable to CoS queues only. */
12766         uint8_t queue_id0_service_profile;
12767         /* Lossy (best-effort) */
12768         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
12769                 UINT32_C(0x0)
12770         /* Lossless (legacy) */
12771         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
12772                 UINT32_C(0x1)
12773         /* Lossless RoCE */
12774         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
12775                 UINT32_C(0x1)
12776         /* Lossy RoCE CNP */
12777         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12778                 UINT32_C(0x2)
12779         /* Lossless NIC */
12780         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
12781                 UINT32_C(0x3)
12782         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12783         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
12784                 UINT32_C(0xff)
12785         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
12786                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
12787         /*
12788          * ID of CoS Queue 1.
12789          * FF - Invalid id
12790          *
12791          * # This ID can be used on any subsequent call to an hwrm command
12792          * that takes a queue id.
12793          * # IDs must always be queried by this command before any use
12794          * by the driver or software.
12795          * # Any driver or software should not make any assumptions about
12796          * queue IDs.
12797          * # A value of 0xff indicates that the queue is not available.
12798          * # Available queues may not be in sequential order.
12799          */
12800         uint8_t queue_id1;
12801         /* This value is applicable to CoS queues only. */
12802         uint8_t queue_id1_service_profile;
12803         /* Lossy (best-effort) */
12804         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
12805                 UINT32_C(0x0)
12806         /* Lossless (legacy) */
12807         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
12808                 UINT32_C(0x1)
12809         /* Lossless RoCE */
12810         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
12811                 UINT32_C(0x1)
12812         /* Lossy RoCE CNP */
12813         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12814                 UINT32_C(0x2)
12815         /* Lossless NIC */
12816         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
12817                 UINT32_C(0x3)
12818         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12819         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
12820                 UINT32_C(0xff)
12821         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
12822                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
12823         /*
12824          * ID of CoS Queue 2.
12825          * FF - Invalid id
12826          *
12827          * # This ID can be used on any subsequent call to an hwrm command
12828          * that takes a queue id.
12829          * # IDs must always be queried by this command before any use
12830          * by the driver or software.
12831          * # Any driver or software should not make any assumptions about
12832          * queue IDs.
12833          * # A value of 0xff indicates that the queue is not available.
12834          * # Available queues may not be in sequential order.
12835          */
12836         uint8_t queue_id2;
12837         /* This value is applicable to CoS queues only. */
12838         uint8_t queue_id2_service_profile;
12839         /* Lossy (best-effort) */
12840         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
12841                 UINT32_C(0x0)
12842         /* Lossless (legacy) */
12843         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
12844                 UINT32_C(0x1)
12845         /* Lossless RoCE */
12846         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
12847                 UINT32_C(0x1)
12848         /* Lossy RoCE CNP */
12849         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12850                 UINT32_C(0x2)
12851         /* Lossless NIC */
12852         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
12853                 UINT32_C(0x3)
12854         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12855         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
12856                 UINT32_C(0xff)
12857         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
12858                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
12859         /*
12860          * ID of CoS Queue 3.
12861          * FF - Invalid id
12862          *
12863          * # This ID can be used on any subsequent call to an hwrm command
12864          * that takes a queue id.
12865          * # IDs must always be queried by this command before any use
12866          * by the driver or software.
12867          * # Any driver or software should not make any assumptions about
12868          * queue IDs.
12869          * # A value of 0xff indicates that the queue is not available.
12870          * # Available queues may not be in sequential order.
12871          */
12872         uint8_t queue_id3;
12873         /* This value is applicable to CoS queues only. */
12874         uint8_t queue_id3_service_profile;
12875         /* Lossy (best-effort) */
12876         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
12877                 UINT32_C(0x0)
12878         /* Lossless (legacy) */
12879         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
12880                 UINT32_C(0x1)
12881         /* Lossless RoCE */
12882         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
12883                 UINT32_C(0x1)
12884         /* Lossy RoCE CNP */
12885         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12886                 UINT32_C(0x2)
12887         /* Lossless NIC */
12888         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
12889                 UINT32_C(0x3)
12890         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12891         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
12892                 UINT32_C(0xff)
12893         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
12894                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
12895         /*
12896          * ID of CoS Queue 4.
12897          * FF - Invalid id
12898          *
12899          * # This ID can be used on any subsequent call to an hwrm command
12900          * that takes a queue id.
12901          * # IDs must always be queried by this command before any use
12902          * by the driver or software.
12903          * # Any driver or software should not make any assumptions about
12904          * queue IDs.
12905          * # A value of 0xff indicates that the queue is not available.
12906          * # Available queues may not be in sequential order.
12907          */
12908         uint8_t queue_id4;
12909         /* This value is applicable to CoS queues only. */
12910         uint8_t queue_id4_service_profile;
12911         /* Lossy (best-effort) */
12912         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
12913                 UINT32_C(0x0)
12914         /* Lossless (legacy) */
12915         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
12916                 UINT32_C(0x1)
12917         /* Lossless RoCE */
12918         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
12919                 UINT32_C(0x1)
12920         /* Lossy RoCE CNP */
12921         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12922                 UINT32_C(0x2)
12923         /* Lossless NIC */
12924         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
12925                 UINT32_C(0x3)
12926         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12927         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
12928                 UINT32_C(0xff)
12929         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
12930                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
12931         /*
12932          * ID of CoS Queue 5.
12933          * FF - Invalid id
12934          *
12935          * # This ID can be used on any subsequent call to an hwrm command
12936          * that takes a queue id.
12937          * # IDs must always be queried by this command before any use
12938          * by the driver or software.
12939          * # Any driver or software should not make any assumptions about
12940          * queue IDs.
12941          * # A value of 0xff indicates that the queue is not available.
12942          * # Available queues may not be in sequential order.
12943          */
12944         uint8_t queue_id5;
12945         /* This value is applicable to CoS queues only. */
12946         uint8_t queue_id5_service_profile;
12947         /* Lossy (best-effort) */
12948         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
12949                 UINT32_C(0x0)
12950         /* Lossless (legacy) */
12951         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
12952                 UINT32_C(0x1)
12953         /* Lossless RoCE */
12954         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
12955                 UINT32_C(0x1)
12956         /* Lossy RoCE CNP */
12957         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12958                 UINT32_C(0x2)
12959         /* Lossless NIC */
12960         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
12961                 UINT32_C(0x3)
12962         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12963         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
12964                 UINT32_C(0xff)
12965         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
12966                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
12967         /*
12968          * ID of CoS Queue 6.
12969          * FF - Invalid id
12970          *
12971          * # This ID can be used on any subsequent call to an hwrm command
12972          * that takes a queue id.
12973          * # IDs must always be queried by this command before any use
12974          * by the driver or software.
12975          * # Any driver or software should not make any assumptions about
12976          * queue IDs.
12977          * # A value of 0xff indicates that the queue is not available.
12978          * # Available queues may not be in sequential order.
12979          */
12980         uint8_t queue_id6;
12981         /* This value is applicable to CoS queues only. */
12982         uint8_t queue_id6_service_profile;
12983         /* Lossy (best-effort) */
12984         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
12985                 UINT32_C(0x0)
12986         /* Lossless (legacy) */
12987         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
12988                 UINT32_C(0x1)
12989         /* Lossless RoCE */
12990         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
12991                 UINT32_C(0x1)
12992         /* Lossy RoCE CNP */
12993         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
12994                 UINT32_C(0x2)
12995         /* Lossless NIC */
12996         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
12997                 UINT32_C(0x3)
12998         /* Set to 0xFF... (All Fs) if there is no service profile specified */
12999         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
13000                 UINT32_C(0xff)
13001         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
13002                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
13003         /*
13004          * ID of CoS Queue 7.
13005          * FF - Invalid id
13006          *
13007          * # This ID can be used on any subsequent call to an hwrm command
13008          * that takes a queue id.
13009          * # IDs must always be queried by this command before any use
13010          * by the driver or software.
13011          * # Any driver or software should not make any assumptions about
13012          * queue IDs.
13013          * # A value of 0xff indicates that the queue is not available.
13014          * # Available queues may not be in sequential order.
13015          */
13016         uint8_t queue_id7;
13017         /* This value is applicable to CoS queues only. */
13018         uint8_t queue_id7_service_profile;
13019         /* Lossy (best-effort) */
13020         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
13021                 UINT32_C(0x0)
13022         /* Lossless (legacy) */
13023         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
13024                 UINT32_C(0x1)
13025         /* Lossless RoCE */
13026         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
13027                 UINT32_C(0x1)
13028         /* Lossy RoCE CNP */
13029         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
13030                 UINT32_C(0x2)
13031         /* Lossless NIC */
13032         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
13033                 UINT32_C(0x3)
13034         /* Set to 0xFF... (All Fs) if there is no service profile specified */
13035         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
13036                 UINT32_C(0xff)
13037         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
13038                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
13039         /*
13040          * This field is used in Output records to indicate that the output
13041          * is completely written to RAM.  This field should be read as '1'
13042          * to indicate that the output has been completely written.
13043          * When writing a command completion or response to an internal processor,
13044          * the order of writes has to be such that this field is written last.
13045          */
13046         uint8_t valid;
13047 } __attribute__((packed));
13048
13049 /*******************
13050  * hwrm_queue_qcfg *
13051  *******************/
13052
13053
13054 /* hwrm_queue_qcfg_input (size:192b/24B) */
13055 struct hwrm_queue_qcfg_input {
13056         /* The HWRM command request type. */
13057         uint16_t        req_type;
13058         /*
13059          * The completion ring to send the completion event on. This should
13060          * be the NQ ID returned from the `nq_alloc` HWRM command.
13061          */
13062         uint16_t        cmpl_ring;
13063         /*
13064          * The sequence ID is used by the driver for tracking multiple
13065          * commands. This ID is treated as opaque data by the firmware and
13066          * the value is returned in the `hwrm_resp_hdr` upon completion.
13067          */
13068         uint16_t        seq_id;
13069         /*
13070          * The target ID of the command:
13071          * * 0x0-0xFFF8 - The function ID
13072          * * 0xFFF8-0xFFFE - Reserved for internal processors
13073          * * 0xFFFF - HWRM
13074          */
13075         uint16_t        target_id;
13076         /*
13077          * A physical address pointer pointing to a host buffer that the
13078          * command's response data will be written. This can be either a host
13079          * physical address (HPA) or a guest physical address (GPA) and must
13080          * point to a physically contiguous block of memory.
13081          */
13082         uint64_t        resp_addr;
13083         uint32_t        flags;
13084         /*
13085          * Enumeration denoting the RX, TX type of the resource.
13086          * This enumeration is used for resources that are similar for both
13087          * TX and RX paths of the chip.
13088          */
13089         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
13090         /* tx path */
13091         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
13092         /* rx path */
13093         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
13094         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
13095                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
13096         /* Queue ID of the queue. */
13097         uint32_t        queue_id;
13098 } __attribute__((packed));
13099
13100 /* hwrm_queue_qcfg_output (size:128b/16B) */
13101 struct hwrm_queue_qcfg_output {
13102         /* The specific error status for the command. */
13103         uint16_t        error_code;
13104         /* The HWRM command request type. */
13105         uint16_t        req_type;
13106         /* The sequence ID from the original command. */
13107         uint16_t        seq_id;
13108         /* The length of the response data in number of bytes. */
13109         uint16_t        resp_len;
13110         /*
13111          * This value is a the estimate packet length used in the
13112          * TX arbiter.
13113          */
13114         uint32_t        queue_len;
13115         /* This value is applicable to CoS queues only. */
13116         uint8_t service_profile;
13117         /* Lossy (best-effort) */
13118         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
13119         /* Lossless */
13120         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
13121         /* Set to 0xFF... (All Fs) if there is no service profile specified */
13122         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
13123         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
13124                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
13125         /* Information about queue configuration. */
13126         uint8_t queue_cfg_info;
13127         /*
13128          * If this flag is set to '1', then the queue is
13129          * configured asymmetrically on TX and RX sides.
13130          * If this flag is set to '0', then this queue is
13131          * configured symmetrically on TX and RX sides.
13132          */
13133         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
13134                 UINT32_C(0x1)
13135         uint8_t unused_0;
13136         /*
13137          * This field is used in Output records to indicate that the output
13138          * is completely written to RAM.  This field should be read as '1'
13139          * to indicate that the output has been completely written.
13140          * When writing a command completion or response to an internal processor,
13141          * the order of writes has to be such that this field is written last.
13142          */
13143         uint8_t valid;
13144 } __attribute__((packed));
13145
13146 /******************
13147  * hwrm_queue_cfg *
13148  ******************/
13149
13150
13151 /* hwrm_queue_cfg_input (size:320b/40B) */
13152 struct hwrm_queue_cfg_input {
13153         /* The HWRM command request type. */
13154         uint16_t        req_type;
13155         /*
13156          * The completion ring to send the completion event on. This should
13157          * be the NQ ID returned from the `nq_alloc` HWRM command.
13158          */
13159         uint16_t        cmpl_ring;
13160         /*
13161          * The sequence ID is used by the driver for tracking multiple
13162          * commands. This ID is treated as opaque data by the firmware and
13163          * the value is returned in the `hwrm_resp_hdr` upon completion.
13164          */
13165         uint16_t        seq_id;
13166         /*
13167          * The target ID of the command:
13168          * * 0x0-0xFFF8 - The function ID
13169          * * 0xFFF8-0xFFFE - Reserved for internal processors
13170          * * 0xFFFF - HWRM
13171          */
13172         uint16_t        target_id;
13173         /*
13174          * A physical address pointer pointing to a host buffer that the
13175          * command's response data will be written. This can be either a host
13176          * physical address (HPA) or a guest physical address (GPA) and must
13177          * point to a physically contiguous block of memory.
13178          */
13179         uint64_t        resp_addr;
13180         uint32_t        flags;
13181         /*
13182          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
13183          * This enumeration is used for resources that are similar for both
13184          * TX and RX paths of the chip.
13185          */
13186         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
13187         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
13188         /* tx path */
13189         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
13190         /* rx path */
13191         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
13192         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
13193         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
13194         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
13195                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
13196         uint32_t        enables;
13197         /*
13198          * This bit must be '1' for the dflt_len field to be
13199          * configured.
13200          */
13201         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
13202         /*
13203          * This bit must be '1' for the service_profile field to be
13204          * configured.
13205          */
13206         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
13207         /* Queue ID of queue that is to be configured by this function. */
13208         uint32_t        queue_id;
13209         /*
13210          * This value is a the estimate packet length used in the
13211          * TX arbiter.
13212          * Set to 0xFF... (All Fs) to not adjust this value.
13213          */
13214         uint32_t        dflt_len;
13215         /* This value is applicable to CoS queues only. */
13216         uint8_t service_profile;
13217         /* Lossy (best-effort) */
13218         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
13219         /* Lossless */
13220         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
13221         /* Set to 0xFF... (All Fs) if there is no service profile specified */
13222         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
13223         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
13224                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
13225         uint8_t unused_0[7];
13226 } __attribute__((packed));
13227
13228 /* hwrm_queue_cfg_output (size:128b/16B) */
13229 struct hwrm_queue_cfg_output {
13230         /* The specific error status for the command. */
13231         uint16_t        error_code;
13232         /* The HWRM command request type. */
13233         uint16_t        req_type;
13234         /* The sequence ID from the original command. */
13235         uint16_t        seq_id;
13236         /* The length of the response data in number of bytes. */
13237         uint16_t        resp_len;
13238         uint8_t unused_0[7];
13239         /*
13240          * This field is used in Output records to indicate that the output
13241          * is completely written to RAM.  This field should be read as '1'
13242          * to indicate that the output has been completely written.
13243          * When writing a command completion or response to an internal processor,
13244          * the order of writes has to be such that this field is written last.
13245          */
13246         uint8_t valid;
13247 } __attribute__((packed));
13248
13249 /*****************************
13250  * hwrm_queue_pfcenable_qcfg *
13251  *****************************/
13252
13253
13254 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
13255 struct hwrm_queue_pfcenable_qcfg_input {
13256         /* The HWRM command request type. */
13257         uint16_t        req_type;
13258         /*
13259          * The completion ring to send the completion event on. This should
13260          * be the NQ ID returned from the `nq_alloc` HWRM command.
13261          */
13262         uint16_t        cmpl_ring;
13263         /*
13264          * The sequence ID is used by the driver for tracking multiple
13265          * commands. This ID is treated as opaque data by the firmware and
13266          * the value is returned in the `hwrm_resp_hdr` upon completion.
13267          */
13268         uint16_t        seq_id;
13269         /*
13270          * The target ID of the command:
13271          * * 0x0-0xFFF8 - The function ID
13272          * * 0xFFF8-0xFFFE - Reserved for internal processors
13273          * * 0xFFFF - HWRM
13274          */
13275         uint16_t        target_id;
13276         /*
13277          * A physical address pointer pointing to a host buffer that the
13278          * command's response data will be written. This can be either a host
13279          * physical address (HPA) or a guest physical address (GPA) and must
13280          * point to a physically contiguous block of memory.
13281          */
13282         uint64_t        resp_addr;
13283         /*
13284          * Port ID of port for which the table is being configured.
13285          * The HWRM needs to check whether this function is allowed
13286          * to configure pri2cos mapping on this port.
13287          */
13288         uint16_t        port_id;
13289         uint8_t unused_0[6];
13290 } __attribute__((packed));
13291
13292 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
13293 struct hwrm_queue_pfcenable_qcfg_output {
13294         /* The specific error status for the command. */
13295         uint16_t        error_code;
13296         /* The HWRM command request type. */
13297         uint16_t        req_type;
13298         /* The sequence ID from the original command. */
13299         uint16_t        seq_id;
13300         /* The length of the response data in number of bytes. */
13301         uint16_t        resp_len;
13302         uint32_t        flags;
13303         /* If set to 1, then PFC is enabled on PRI 0. */
13304         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
13305                 UINT32_C(0x1)
13306         /* If set to 1, then PFC is enabled on PRI 1. */
13307         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
13308                 UINT32_C(0x2)
13309         /* If set to 1, then PFC is enabled on PRI 2. */
13310         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
13311                 UINT32_C(0x4)
13312         /* If set to 1, then PFC is enabled on PRI 3. */
13313         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
13314                 UINT32_C(0x8)
13315         /* If set to 1, then PFC is enabled on PRI 4. */
13316         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
13317                 UINT32_C(0x10)
13318         /* If set to 1, then PFC is enabled on PRI 5. */
13319         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
13320                 UINT32_C(0x20)
13321         /* If set to 1, then PFC is enabled on PRI 6. */
13322         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
13323                 UINT32_C(0x40)
13324         /* If set to 1, then PFC is enabled on PRI 7. */
13325         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
13326                 UINT32_C(0x80)
13327         uint8_t unused_0[3];
13328         /*
13329          * This field is used in Output records to indicate that the output
13330          * is completely written to RAM.  This field should be read as '1'
13331          * to indicate that the output has been completely written.
13332          * When writing a command completion or response to an internal processor,
13333          * the order of writes has to be such that this field is written last.
13334          */
13335         uint8_t valid;
13336 } __attribute__((packed));
13337
13338 /****************************
13339  * hwrm_queue_pfcenable_cfg *
13340  ****************************/
13341
13342
13343 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
13344 struct hwrm_queue_pfcenable_cfg_input {
13345         /* The HWRM command request type. */
13346         uint16_t        req_type;
13347         /*
13348          * The completion ring to send the completion event on. This should
13349          * be the NQ ID returned from the `nq_alloc` HWRM command.
13350          */
13351         uint16_t        cmpl_ring;
13352         /*
13353          * The sequence ID is used by the driver for tracking multiple
13354          * commands. This ID is treated as opaque data by the firmware and
13355          * the value is returned in the `hwrm_resp_hdr` upon completion.
13356          */
13357         uint16_t        seq_id;
13358         /*
13359          * The target ID of the command:
13360          * * 0x0-0xFFF8 - The function ID
13361          * * 0xFFF8-0xFFFE - Reserved for internal processors
13362          * * 0xFFFF - HWRM
13363          */
13364         uint16_t        target_id;
13365         /*
13366          * A physical address pointer pointing to a host buffer that the
13367          * command's response data will be written. This can be either a host
13368          * physical address (HPA) or a guest physical address (GPA) and must
13369          * point to a physically contiguous block of memory.
13370          */
13371         uint64_t        resp_addr;
13372         uint32_t        flags;
13373         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
13374         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
13375                 UINT32_C(0x1)
13376         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
13377         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
13378                 UINT32_C(0x2)
13379         /* If set to 1, then PFC is requested to  be enabled on PRI 2. */
13380         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
13381                 UINT32_C(0x4)
13382         /* If set to 1, then PFC is requested to  be enabled on PRI 3. */
13383         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
13384                 UINT32_C(0x8)
13385         /* If set to 1, then PFC is requested to  be enabled on PRI 4. */
13386         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
13387                 UINT32_C(0x10)
13388         /* If set to 1, then PFC is requested to  be enabled on PRI 5. */
13389         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
13390                 UINT32_C(0x20)
13391         /* If set to 1, then PFC is requested to  be enabled on PRI 6. */
13392         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
13393                 UINT32_C(0x40)
13394         /* If set to 1, then PFC is requested to  be enabled on PRI 7. */
13395         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
13396                 UINT32_C(0x80)
13397         /*
13398          * Port ID of port for which the table is being configured.
13399          * The HWRM needs to check whether this function is allowed
13400          * to configure pri2cos mapping on this port.
13401          */
13402         uint16_t        port_id;
13403         uint8_t unused_0[2];
13404 } __attribute__((packed));
13405
13406 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
13407 struct hwrm_queue_pfcenable_cfg_output {
13408         /* The specific error status for the command. */
13409         uint16_t        error_code;
13410         /* The HWRM command request type. */
13411         uint16_t        req_type;
13412         /* The sequence ID from the original command. */
13413         uint16_t        seq_id;
13414         /* The length of the response data in number of bytes. */
13415         uint16_t        resp_len;
13416         uint8_t unused_0[7];
13417         /*
13418          * This field is used in Output records to indicate that the output
13419          * is completely written to RAM.  This field should be read as '1'
13420          * to indicate that the output has been completely written.
13421          * When writing a command completion or response to an internal processor,
13422          * the order of writes has to be such that this field is written last.
13423          */
13424         uint8_t valid;
13425 } __attribute__((packed));
13426
13427 /***************************
13428  * hwrm_queue_pri2cos_qcfg *
13429  ***************************/
13430
13431
13432 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
13433 struct hwrm_queue_pri2cos_qcfg_input {
13434         /* The HWRM command request type. */
13435         uint16_t        req_type;
13436         /*
13437          * The completion ring to send the completion event on. This should
13438          * be the NQ ID returned from the `nq_alloc` HWRM command.
13439          */
13440         uint16_t        cmpl_ring;
13441         /*
13442          * The sequence ID is used by the driver for tracking multiple
13443          * commands. This ID is treated as opaque data by the firmware and
13444          * the value is returned in the `hwrm_resp_hdr` upon completion.
13445          */
13446         uint16_t        seq_id;
13447         /*
13448          * The target ID of the command:
13449          * * 0x0-0xFFF8 - The function ID
13450          * * 0xFFF8-0xFFFE - Reserved for internal processors
13451          * * 0xFFFF - HWRM
13452          */
13453         uint16_t        target_id;
13454         /*
13455          * A physical address pointer pointing to a host buffer that the
13456          * command's response data will be written. This can be either a host
13457          * physical address (HPA) or a guest physical address (GPA) and must
13458          * point to a physically contiguous block of memory.
13459          */
13460         uint64_t        resp_addr;
13461         uint32_t        flags;
13462         /*
13463          * Enumeration denoting the RX, TX type of the resource.
13464          * This enumeration is used for resources that are similar for both
13465          * TX and RX paths of the chip.
13466          */
13467         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
13468         /* tx path */
13469         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
13470         /* rx path */
13471         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
13472         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
13473                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
13474         /*
13475          * When this bit is set to '0', the query is
13476          * for VLAN PRI field in tunnel headers.
13477          * When this bit is set to '1', the query is
13478          * for VLAN PRI field in inner packet headers.
13479          */
13480         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
13481         /*
13482          * Port ID of port for which the table is being configured.
13483          * The HWRM needs to check whether this function is allowed
13484          * to configure pri2cos mapping on this port.
13485          */
13486         uint8_t port_id;
13487         uint8_t unused_0[3];
13488 } __attribute__((packed));
13489
13490 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
13491 struct hwrm_queue_pri2cos_qcfg_output {
13492         /* The specific error status for the command. */
13493         uint16_t        error_code;
13494         /* The HWRM command request type. */
13495         uint16_t        req_type;
13496         /* The sequence ID from the original command. */
13497         uint16_t        seq_id;
13498         /* The length of the response data in number of bytes. */
13499         uint16_t        resp_len;
13500         /*
13501          * CoS Queue assigned to priority 0.  This value can only
13502          * be changed before traffic has started.
13503          * A value of 0xff indicates that no CoS queue is assigned to the
13504          * specified priority.
13505          */
13506         uint8_t pri0_cos_queue_id;
13507         /*
13508          * CoS Queue assigned to priority 1.  This value can only
13509          * be changed before traffic has started.
13510          * A value of 0xff indicates that no CoS queue is assigned to the
13511          * specified priority.
13512          */
13513         uint8_t pri1_cos_queue_id;
13514         /*
13515          * CoS Queue assigned to priority 2  This value can only
13516          * be changed before traffic has started.
13517          * A value of 0xff indicates that no CoS queue is assigned to the
13518          * specified priority.
13519          */
13520         uint8_t pri2_cos_queue_id;
13521         /*
13522          * CoS Queue assigned to priority 3.  This value can only
13523          * be changed before traffic has started.
13524          * A value of 0xff indicates that no CoS queue is assigned to the
13525          * specified priority.
13526          */
13527         uint8_t pri3_cos_queue_id;
13528         /*
13529          * CoS Queue assigned to priority 4.  This value can only
13530          * be changed before traffic has started.
13531          * A value of 0xff indicates that no CoS queue is assigned to the
13532          * specified priority.
13533          */
13534         uint8_t pri4_cos_queue_id;
13535         /*
13536          * CoS Queue assigned to priority 5.  This value can only
13537          * be changed before traffic has started.
13538          * A value of 0xff indicates that no CoS queue is assigned to the
13539          * specified priority.
13540          */
13541         uint8_t pri5_cos_queue_id;
13542         /*
13543          * CoS Queue assigned to priority 6.  This value can only
13544          * be changed before traffic has started.
13545          * A value of 0xff indicates that no CoS queue is assigned to the
13546          * specified priority.
13547          */
13548         uint8_t pri6_cos_queue_id;
13549         /*
13550          * CoS Queue assigned to priority 7.  This value can only
13551          * be changed before traffic has started.
13552          * A value of 0xff indicates that no CoS queue is assigned to the
13553          * specified priority.
13554          */
13555         uint8_t pri7_cos_queue_id;
13556         /* Information about queue configuration. */
13557         uint8_t queue_cfg_info;
13558         /*
13559          * If this flag is set to '1', then the PRI to CoS
13560          * configuration is asymmetric on TX and RX sides.
13561          * If this flag is set to '0', then PRI to CoS configuration
13562          * is symmetric on TX and RX sides.
13563          */
13564         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
13565                 UINT32_C(0x1)
13566         uint8_t unused_0[6];
13567         /*
13568          * This field is used in Output records to indicate that the output
13569          * is completely written to RAM.  This field should be read as '1'
13570          * to indicate that the output has been completely written.
13571          * When writing a command completion or response to an internal processor,
13572          * the order of writes has to be such that this field is written last.
13573          */
13574         uint8_t valid;
13575 } __attribute__((packed));
13576
13577 /**************************
13578  * hwrm_queue_pri2cos_cfg *
13579  **************************/
13580
13581
13582 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
13583 struct hwrm_queue_pri2cos_cfg_input {
13584         /* The HWRM command request type. */
13585         uint16_t        req_type;
13586         /*
13587          * The completion ring to send the completion event on. This should
13588          * be the NQ ID returned from the `nq_alloc` HWRM command.
13589          */
13590         uint16_t        cmpl_ring;
13591         /*
13592          * The sequence ID is used by the driver for tracking multiple
13593          * commands. This ID is treated as opaque data by the firmware and
13594          * the value is returned in the `hwrm_resp_hdr` upon completion.
13595          */
13596         uint16_t        seq_id;
13597         /*
13598          * The target ID of the command:
13599          * * 0x0-0xFFF8 - The function ID
13600          * * 0xFFF8-0xFFFE - Reserved for internal processors
13601          * * 0xFFFF - HWRM
13602          */
13603         uint16_t        target_id;
13604         /*
13605          * A physical address pointer pointing to a host buffer that the
13606          * command's response data will be written. This can be either a host
13607          * physical address (HPA) or a guest physical address (GPA) and must
13608          * point to a physically contiguous block of memory.
13609          */
13610         uint64_t        resp_addr;
13611         uint32_t        flags;
13612         /*
13613          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
13614          * This enumeration is used for resources that are similar for both
13615          * TX and RX paths of the chip.
13616          */
13617         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
13618         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
13619         /* tx path */
13620         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
13621         /* rx path */
13622         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
13623         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
13624         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
13625         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
13626                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
13627         /*
13628          * When this bit is set to '0', the mapping is requested
13629          * for VLAN PRI field in tunnel headers.
13630          * When this bit is set to '1', the mapping is requested
13631          * for VLAN PRI field in inner packet headers.
13632          */
13633         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
13634         uint32_t        enables;
13635         /*
13636          * This bit must be '1' for the pri0_cos_queue_id field to be
13637          * configured.
13638          */
13639         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
13640                 UINT32_C(0x1)
13641         /*
13642          * This bit must be '1' for the pri1_cos_queue_id field to be
13643          * configured.
13644          */
13645         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
13646                 UINT32_C(0x2)
13647         /*
13648          * This bit must be '1' for the pri2_cos_queue_id field to be
13649          * configured.
13650          */
13651         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
13652                 UINT32_C(0x4)
13653         /*
13654          * This bit must be '1' for the pri3_cos_queue_id field to be
13655          * configured.
13656          */
13657         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
13658                 UINT32_C(0x8)
13659         /*
13660          * This bit must be '1' for the pri4_cos_queue_id field to be
13661          * configured.
13662          */
13663         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
13664                 UINT32_C(0x10)
13665         /*
13666          * This bit must be '1' for the pri5_cos_queue_id field to be
13667          * configured.
13668          */
13669         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
13670                 UINT32_C(0x20)
13671         /*
13672          * This bit must be '1' for the pri6_cos_queue_id field to be
13673          * configured.
13674          */
13675         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
13676                 UINT32_C(0x40)
13677         /*
13678          * This bit must be '1' for the pri7_cos_queue_id field to be
13679          * configured.
13680          */
13681         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
13682                 UINT32_C(0x80)
13683         /*
13684          * Port ID of port for which the table is being configured.
13685          * The HWRM needs to check whether this function is allowed
13686          * to configure pri2cos mapping on this port.
13687          */
13688         uint8_t port_id;
13689         /*
13690          * CoS Queue assigned to priority 0.  This value can only
13691          * be changed before traffic has started.
13692          */
13693         uint8_t pri0_cos_queue_id;
13694         /*
13695          * CoS Queue assigned to priority 1.  This value can only
13696          * be changed before traffic has started.
13697          */
13698         uint8_t pri1_cos_queue_id;
13699         /*
13700          * CoS Queue assigned to priority 2  This value can only
13701          * be changed before traffic has started.
13702          */
13703         uint8_t pri2_cos_queue_id;
13704         /*
13705          * CoS Queue assigned to priority 3.  This value can only
13706          * be changed before traffic has started.
13707          */
13708         uint8_t pri3_cos_queue_id;
13709         /*
13710          * CoS Queue assigned to priority 4.  This value can only
13711          * be changed before traffic has started.
13712          */
13713         uint8_t pri4_cos_queue_id;
13714         /*
13715          * CoS Queue assigned to priority 5.  This value can only
13716          * be changed before traffic has started.
13717          */
13718         uint8_t pri5_cos_queue_id;
13719         /*
13720          * CoS Queue assigned to priority 6.  This value can only
13721          * be changed before traffic has started.
13722          */
13723         uint8_t pri6_cos_queue_id;
13724         /*
13725          * CoS Queue assigned to priority 7.  This value can only
13726          * be changed before traffic has started.
13727          */
13728         uint8_t pri7_cos_queue_id;
13729         uint8_t unused_0[7];
13730 } __attribute__((packed));
13731
13732 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
13733 struct hwrm_queue_pri2cos_cfg_output {
13734         /* The specific error status for the command. */
13735         uint16_t        error_code;
13736         /* The HWRM command request type. */
13737         uint16_t        req_type;
13738         /* The sequence ID from the original command. */
13739         uint16_t        seq_id;
13740         /* The length of the response data in number of bytes. */
13741         uint16_t        resp_len;
13742         uint8_t unused_0[7];
13743         /*
13744          * This field is used in Output records to indicate that the output
13745          * is completely written to RAM.  This field should be read as '1'
13746          * to indicate that the output has been completely written.
13747          * When writing a command completion or response to an internal processor,
13748          * the order of writes has to be such that this field is written last.
13749          */
13750         uint8_t valid;
13751 } __attribute__((packed));
13752
13753 /**************************
13754  * hwrm_queue_cos2bw_qcfg *
13755  **************************/
13756
13757
13758 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
13759 struct hwrm_queue_cos2bw_qcfg_input {
13760         /* The HWRM command request type. */
13761         uint16_t        req_type;
13762         /*
13763          * The completion ring to send the completion event on. This should
13764          * be the NQ ID returned from the `nq_alloc` HWRM command.
13765          */
13766         uint16_t        cmpl_ring;
13767         /*
13768          * The sequence ID is used by the driver for tracking multiple
13769          * commands. This ID is treated as opaque data by the firmware and
13770          * the value is returned in the `hwrm_resp_hdr` upon completion.
13771          */
13772         uint16_t        seq_id;
13773         /*
13774          * The target ID of the command:
13775          * * 0x0-0xFFF8 - The function ID
13776          * * 0xFFF8-0xFFFE - Reserved for internal processors
13777          * * 0xFFFF - HWRM
13778          */
13779         uint16_t        target_id;
13780         /*
13781          * A physical address pointer pointing to a host buffer that the
13782          * command's response data will be written. This can be either a host
13783          * physical address (HPA) or a guest physical address (GPA) and must
13784          * point to a physically contiguous block of memory.
13785          */
13786         uint64_t        resp_addr;
13787         /*
13788          * Port ID of port for which the table is being configured.
13789          * The HWRM needs to check whether this function is allowed
13790          * to configure TC BW assignment on this port.
13791          */
13792         uint16_t        port_id;
13793         uint8_t unused_0[6];
13794 } __attribute__((packed));
13795
13796 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
13797 struct hwrm_queue_cos2bw_qcfg_output {
13798         /* The specific error status for the command. */
13799         uint16_t        error_code;
13800         /* The HWRM command request type. */
13801         uint16_t        req_type;
13802         /* The sequence ID from the original command. */
13803         uint16_t        seq_id;
13804         /* The length of the response data in number of bytes. */
13805         uint16_t        resp_len;
13806         /* ID of CoS Queue 0. */
13807         uint8_t queue_id0;
13808         uint8_t unused_0;
13809         uint16_t        unused_1;
13810         /*
13811          * Minimum BW allocated to CoS Queue.
13812          * The HWRM will translate this value into byte counter and
13813          * time interval used for this COS inside the device.
13814          */
13815         uint32_t        queue_id0_min_bw;
13816         /* The bandwidth value. */
13817         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
13818                 UINT32_C(0xfffffff)
13819         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
13820                 0
13821         /* The granularity of the value (bits or bytes). */
13822         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
13823                 UINT32_C(0x10000000)
13824         /* Value is in bits. */
13825         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
13826                 (UINT32_C(0x0) << 28)
13827         /* Value is in bytes. */
13828         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
13829                 (UINT32_C(0x1) << 28)
13830         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
13831                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
13832         /* bw_value_unit is 3 b */
13833         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
13834                 UINT32_C(0xe0000000)
13835         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
13836                 29
13837         /* Value is in Mb or MB (base 10). */
13838         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
13839                 (UINT32_C(0x0) << 29)
13840         /* Value is in Kb or KB (base 10). */
13841         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
13842                 (UINT32_C(0x2) << 29)
13843         /* Value is in bits or bytes. */
13844         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
13845                 (UINT32_C(0x4) << 29)
13846         /* Value is in Gb or GB (base 10). */
13847         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
13848                 (UINT32_C(0x6) << 29)
13849         /* Value is in 1/100th of a percentage of total bandwidth. */
13850         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
13851                 (UINT32_C(0x1) << 29)
13852         /* Invalid unit */
13853         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
13854                 (UINT32_C(0x7) << 29)
13855         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
13856                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
13857         /*
13858          * Maximum BW allocated to CoS Queue.
13859          * The HWRM will translate this value into byte counter and
13860          * time interval used for this COS inside the device.
13861          */
13862         uint32_t        queue_id0_max_bw;
13863         /* The bandwidth value. */
13864         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
13865                 UINT32_C(0xfffffff)
13866         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
13867                 0
13868         /* The granularity of the value (bits or bytes). */
13869         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
13870                 UINT32_C(0x10000000)
13871         /* Value is in bits. */
13872         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
13873                 (UINT32_C(0x0) << 28)
13874         /* Value is in bytes. */
13875         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
13876                 (UINT32_C(0x1) << 28)
13877         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
13878                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
13879         /* bw_value_unit is 3 b */
13880         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
13881                 UINT32_C(0xe0000000)
13882         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
13883                 29
13884         /* Value is in Mb or MB (base 10). */
13885         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
13886                 (UINT32_C(0x0) << 29)
13887         /* Value is in Kb or KB (base 10). */
13888         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
13889                 (UINT32_C(0x2) << 29)
13890         /* Value is in bits or bytes. */
13891         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
13892                 (UINT32_C(0x4) << 29)
13893         /* Value is in Gb or GB (base 10). */
13894         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
13895                 (UINT32_C(0x6) << 29)
13896         /* Value is in 1/100th of a percentage of total bandwidth. */
13897         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
13898                 (UINT32_C(0x1) << 29)
13899         /* Invalid unit */
13900         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
13901                 (UINT32_C(0x7) << 29)
13902         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
13903                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
13904         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
13905         uint8_t queue_id0_tsa_assign;
13906         /* Strict Priority */
13907         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
13908                 UINT32_C(0x0)
13909         /* Enhanced Transmission Selection */
13910         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
13911                 UINT32_C(0x1)
13912         /* reserved. */
13913         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
13914                 UINT32_C(0x2)
13915         /* reserved. */
13916         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
13917                 UINT32_C(0xff)
13918         /*
13919          * Priority level for strict priority. Valid only when the
13920          * tsa_assign is 0 - Strict Priority (SP)
13921          * 0..7 - Valid values.
13922          * 8..255 - Reserved.
13923          */
13924         uint8_t queue_id0_pri_lvl;
13925         /*
13926          * Weight used to allocate remaining BW for this COS after
13927          * servicing guaranteed bandwidths for all COS.
13928          */
13929         uint8_t queue_id0_bw_weight;
13930         /* ID of CoS Queue 1. */
13931         uint8_t queue_id1;
13932         /*
13933          * Minimum BW allocated to CoS Queue.
13934          * The HWRM will translate this value into byte counter and
13935          * time interval used for this COS inside the device.
13936          */
13937         uint32_t        queue_id1_min_bw;
13938         /* The bandwidth value. */
13939         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
13940                 UINT32_C(0xfffffff)
13941         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
13942                 0
13943         /* The granularity of the value (bits or bytes). */
13944         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
13945                 UINT32_C(0x10000000)
13946         /* Value is in bits. */
13947         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
13948                 (UINT32_C(0x0) << 28)
13949         /* Value is in bytes. */
13950         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
13951                 (UINT32_C(0x1) << 28)
13952         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
13953                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
13954         /* bw_value_unit is 3 b */
13955         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
13956                 UINT32_C(0xe0000000)
13957         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
13958                 29
13959         /* Value is in Mb or MB (base 10). */
13960         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
13961                 (UINT32_C(0x0) << 29)
13962         /* Value is in Kb or KB (base 10). */
13963         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
13964                 (UINT32_C(0x2) << 29)
13965         /* Value is in bits or bytes. */
13966         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
13967                 (UINT32_C(0x4) << 29)
13968         /* Value is in Gb or GB (base 10). */
13969         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
13970                 (UINT32_C(0x6) << 29)
13971         /* Value is in 1/100th of a percentage of total bandwidth. */
13972         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
13973                 (UINT32_C(0x1) << 29)
13974         /* Invalid unit */
13975         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
13976                 (UINT32_C(0x7) << 29)
13977         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
13978                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
13979         /*
13980          * Maximum BW allocated to CoS queue.
13981          * The HWRM will translate this value into byte counter and
13982          * time interval used for this COS inside the device.
13983          */
13984         uint32_t        queue_id1_max_bw;
13985         /* The bandwidth value. */
13986         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
13987                 UINT32_C(0xfffffff)
13988         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
13989                 0
13990         /* The granularity of the value (bits or bytes). */
13991         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
13992                 UINT32_C(0x10000000)
13993         /* Value is in bits. */
13994         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
13995                 (UINT32_C(0x0) << 28)
13996         /* Value is in bytes. */
13997         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
13998                 (UINT32_C(0x1) << 28)
13999         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
14000                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
14001         /* bw_value_unit is 3 b */
14002         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
14003                 UINT32_C(0xe0000000)
14004         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
14005                 29
14006         /* Value is in Mb or MB (base 10). */
14007         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
14008                 (UINT32_C(0x0) << 29)
14009         /* Value is in Kb or KB (base 10). */
14010         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
14011                 (UINT32_C(0x2) << 29)
14012         /* Value is in bits or bytes. */
14013         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
14014                 (UINT32_C(0x4) << 29)
14015         /* Value is in Gb or GB (base 10). */
14016         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
14017                 (UINT32_C(0x6) << 29)
14018         /* Value is in 1/100th of a percentage of total bandwidth. */
14019         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14020                 (UINT32_C(0x1) << 29)
14021         /* Invalid unit */
14022         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
14023                 (UINT32_C(0x7) << 29)
14024         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
14025                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
14026         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14027         uint8_t queue_id1_tsa_assign;
14028         /* Strict Priority */
14029         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
14030                 UINT32_C(0x0)
14031         /* Enhanced Transmission Selection */
14032         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
14033                 UINT32_C(0x1)
14034         /* reserved. */
14035         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
14036                 UINT32_C(0x2)
14037         /* reserved. */
14038         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
14039                 UINT32_C(0xff)
14040         /*
14041          * Priority level for strict priority. Valid only when the
14042          * tsa_assign is 0 - Strict Priority (SP)
14043          * 0..7 - Valid values.
14044          * 8..255 - Reserved.
14045          */
14046         uint8_t queue_id1_pri_lvl;
14047         /*
14048          * Weight used to allocate remaining BW for this COS after
14049          * servicing guaranteed bandwidths for all COS.
14050          */
14051         uint8_t queue_id1_bw_weight;
14052         /* ID of CoS Queue 2. */
14053         uint8_t queue_id2;
14054         /*
14055          * Minimum BW allocated to CoS Queue.
14056          * The HWRM will translate this value into byte counter and
14057          * time interval used for this COS inside the device.
14058          */
14059         uint32_t        queue_id2_min_bw;
14060         /* The bandwidth value. */
14061         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
14062                 UINT32_C(0xfffffff)
14063         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
14064                 0
14065         /* The granularity of the value (bits or bytes). */
14066         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
14067                 UINT32_C(0x10000000)
14068         /* Value is in bits. */
14069         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
14070                 (UINT32_C(0x0) << 28)
14071         /* Value is in bytes. */
14072         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
14073                 (UINT32_C(0x1) << 28)
14074         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
14075                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
14076         /* bw_value_unit is 3 b */
14077         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
14078                 UINT32_C(0xe0000000)
14079         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
14080                 29
14081         /* Value is in Mb or MB (base 10). */
14082         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
14083                 (UINT32_C(0x0) << 29)
14084         /* Value is in Kb or KB (base 10). */
14085         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
14086                 (UINT32_C(0x2) << 29)
14087         /* Value is in bits or bytes. */
14088         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
14089                 (UINT32_C(0x4) << 29)
14090         /* Value is in Gb or GB (base 10). */
14091         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
14092                 (UINT32_C(0x6) << 29)
14093         /* Value is in 1/100th of a percentage of total bandwidth. */
14094         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14095                 (UINT32_C(0x1) << 29)
14096         /* Invalid unit */
14097         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
14098                 (UINT32_C(0x7) << 29)
14099         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
14100                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
14101         /*
14102          * Maximum BW allocated to CoS queue.
14103          * The HWRM will translate this value into byte counter and
14104          * time interval used for this COS inside the device.
14105          */
14106         uint32_t        queue_id2_max_bw;
14107         /* The bandwidth value. */
14108         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
14109                 UINT32_C(0xfffffff)
14110         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
14111                 0
14112         /* The granularity of the value (bits or bytes). */
14113         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
14114                 UINT32_C(0x10000000)
14115         /* Value is in bits. */
14116         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
14117                 (UINT32_C(0x0) << 28)
14118         /* Value is in bytes. */
14119         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
14120                 (UINT32_C(0x1) << 28)
14121         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
14122                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
14123         /* bw_value_unit is 3 b */
14124         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
14125                 UINT32_C(0xe0000000)
14126         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
14127                 29
14128         /* Value is in Mb or MB (base 10). */
14129         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
14130                 (UINT32_C(0x0) << 29)
14131         /* Value is in Kb or KB (base 10). */
14132         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
14133                 (UINT32_C(0x2) << 29)
14134         /* Value is in bits or bytes. */
14135         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
14136                 (UINT32_C(0x4) << 29)
14137         /* Value is in Gb or GB (base 10). */
14138         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
14139                 (UINT32_C(0x6) << 29)
14140         /* Value is in 1/100th of a percentage of total bandwidth. */
14141         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14142                 (UINT32_C(0x1) << 29)
14143         /* Invalid unit */
14144         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
14145                 (UINT32_C(0x7) << 29)
14146         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
14147                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
14148         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14149         uint8_t queue_id2_tsa_assign;
14150         /* Strict Priority */
14151         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
14152                 UINT32_C(0x0)
14153         /* Enhanced Transmission Selection */
14154         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
14155                 UINT32_C(0x1)
14156         /* reserved. */
14157         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
14158                 UINT32_C(0x2)
14159         /* reserved. */
14160         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
14161                 UINT32_C(0xff)
14162         /*
14163          * Priority level for strict priority. Valid only when the
14164          * tsa_assign is 0 - Strict Priority (SP)
14165          * 0..7 - Valid values.
14166          * 8..255 - Reserved.
14167          */
14168         uint8_t queue_id2_pri_lvl;
14169         /*
14170          * Weight used to allocate remaining BW for this COS after
14171          * servicing guaranteed bandwidths for all COS.
14172          */
14173         uint8_t queue_id2_bw_weight;
14174         /* ID of CoS Queue 3. */
14175         uint8_t queue_id3;
14176         /*
14177          * Minimum BW allocated to CoS Queue.
14178          * The HWRM will translate this value into byte counter and
14179          * time interval used for this COS inside the device.
14180          */
14181         uint32_t        queue_id3_min_bw;
14182         /* The bandwidth value. */
14183         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
14184                 UINT32_C(0xfffffff)
14185         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
14186                 0
14187         /* The granularity of the value (bits or bytes). */
14188         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
14189                 UINT32_C(0x10000000)
14190         /* Value is in bits. */
14191         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
14192                 (UINT32_C(0x0) << 28)
14193         /* Value is in bytes. */
14194         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
14195                 (UINT32_C(0x1) << 28)
14196         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
14197                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
14198         /* bw_value_unit is 3 b */
14199         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
14200                 UINT32_C(0xe0000000)
14201         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
14202                 29
14203         /* Value is in Mb or MB (base 10). */
14204         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
14205                 (UINT32_C(0x0) << 29)
14206         /* Value is in Kb or KB (base 10). */
14207         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
14208                 (UINT32_C(0x2) << 29)
14209         /* Value is in bits or bytes. */
14210         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
14211                 (UINT32_C(0x4) << 29)
14212         /* Value is in Gb or GB (base 10). */
14213         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
14214                 (UINT32_C(0x6) << 29)
14215         /* Value is in 1/100th of a percentage of total bandwidth. */
14216         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14217                 (UINT32_C(0x1) << 29)
14218         /* Invalid unit */
14219         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
14220                 (UINT32_C(0x7) << 29)
14221         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
14222                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
14223         /*
14224          * Maximum BW allocated to CoS queue.
14225          * The HWRM will translate this value into byte counter and
14226          * time interval used for this COS inside the device.
14227          */
14228         uint32_t        queue_id3_max_bw;
14229         /* The bandwidth value. */
14230         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
14231                 UINT32_C(0xfffffff)
14232         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
14233                 0
14234         /* The granularity of the value (bits or bytes). */
14235         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
14236                 UINT32_C(0x10000000)
14237         /* Value is in bits. */
14238         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
14239                 (UINT32_C(0x0) << 28)
14240         /* Value is in bytes. */
14241         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
14242                 (UINT32_C(0x1) << 28)
14243         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
14244                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
14245         /* bw_value_unit is 3 b */
14246         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
14247                 UINT32_C(0xe0000000)
14248         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
14249                 29
14250         /* Value is in Mb or MB (base 10). */
14251         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
14252                 (UINT32_C(0x0) << 29)
14253         /* Value is in Kb or KB (base 10). */
14254         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
14255                 (UINT32_C(0x2) << 29)
14256         /* Value is in bits or bytes. */
14257         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
14258                 (UINT32_C(0x4) << 29)
14259         /* Value is in Gb or GB (base 10). */
14260         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
14261                 (UINT32_C(0x6) << 29)
14262         /* Value is in 1/100th of a percentage of total bandwidth. */
14263         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14264                 (UINT32_C(0x1) << 29)
14265         /* Invalid unit */
14266         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
14267                 (UINT32_C(0x7) << 29)
14268         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
14269                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
14270         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14271         uint8_t queue_id3_tsa_assign;
14272         /* Strict Priority */
14273         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
14274                 UINT32_C(0x0)
14275         /* Enhanced Transmission Selection */
14276         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
14277                 UINT32_C(0x1)
14278         /* reserved. */
14279         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
14280                 UINT32_C(0x2)
14281         /* reserved. */
14282         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
14283                 UINT32_C(0xff)
14284         /*
14285          * Priority level for strict priority. Valid only when the
14286          * tsa_assign is 0 - Strict Priority (SP)
14287          * 0..7 - Valid values.
14288          * 8..255 - Reserved.
14289          */
14290         uint8_t queue_id3_pri_lvl;
14291         /*
14292          * Weight used to allocate remaining BW for this COS after
14293          * servicing guaranteed bandwidths for all COS.
14294          */
14295         uint8_t queue_id3_bw_weight;
14296         /* ID of CoS Queue 4. */
14297         uint8_t queue_id4;
14298         /*
14299          * Minimum BW allocated to CoS Queue.
14300          * The HWRM will translate this value into byte counter and
14301          * time interval used for this COS inside the device.
14302          */
14303         uint32_t        queue_id4_min_bw;
14304         /* The bandwidth value. */
14305         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
14306                 UINT32_C(0xfffffff)
14307         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
14308                 0
14309         /* The granularity of the value (bits or bytes). */
14310         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
14311                 UINT32_C(0x10000000)
14312         /* Value is in bits. */
14313         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
14314                 (UINT32_C(0x0) << 28)
14315         /* Value is in bytes. */
14316         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
14317                 (UINT32_C(0x1) << 28)
14318         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
14319                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
14320         /* bw_value_unit is 3 b */
14321         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
14322                 UINT32_C(0xe0000000)
14323         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
14324                 29
14325         /* Value is in Mb or MB (base 10). */
14326         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
14327                 (UINT32_C(0x0) << 29)
14328         /* Value is in Kb or KB (base 10). */
14329         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
14330                 (UINT32_C(0x2) << 29)
14331         /* Value is in bits or bytes. */
14332         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
14333                 (UINT32_C(0x4) << 29)
14334         /* Value is in Gb or GB (base 10). */
14335         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
14336                 (UINT32_C(0x6) << 29)
14337         /* Value is in 1/100th of a percentage of total bandwidth. */
14338         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14339                 (UINT32_C(0x1) << 29)
14340         /* Invalid unit */
14341         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
14342                 (UINT32_C(0x7) << 29)
14343         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
14344                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
14345         /*
14346          * Maximum BW allocated to CoS queue.
14347          * The HWRM will translate this value into byte counter and
14348          * time interval used for this COS inside the device.
14349          */
14350         uint32_t        queue_id4_max_bw;
14351         /* The bandwidth value. */
14352         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
14353                 UINT32_C(0xfffffff)
14354         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
14355                 0
14356         /* The granularity of the value (bits or bytes). */
14357         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
14358                 UINT32_C(0x10000000)
14359         /* Value is in bits. */
14360         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
14361                 (UINT32_C(0x0) << 28)
14362         /* Value is in bytes. */
14363         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
14364                 (UINT32_C(0x1) << 28)
14365         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
14366                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
14367         /* bw_value_unit is 3 b */
14368         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
14369                 UINT32_C(0xe0000000)
14370         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
14371                 29
14372         /* Value is in Mb or MB (base 10). */
14373         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
14374                 (UINT32_C(0x0) << 29)
14375         /* Value is in Kb or KB (base 10). */
14376         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
14377                 (UINT32_C(0x2) << 29)
14378         /* Value is in bits or bytes. */
14379         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
14380                 (UINT32_C(0x4) << 29)
14381         /* Value is in Gb or GB (base 10). */
14382         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
14383                 (UINT32_C(0x6) << 29)
14384         /* Value is in 1/100th of a percentage of total bandwidth. */
14385         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14386                 (UINT32_C(0x1) << 29)
14387         /* Invalid unit */
14388         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
14389                 (UINT32_C(0x7) << 29)
14390         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
14391                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
14392         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14393         uint8_t queue_id4_tsa_assign;
14394         /* Strict Priority */
14395         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
14396                 UINT32_C(0x0)
14397         /* Enhanced Transmission Selection */
14398         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
14399                 UINT32_C(0x1)
14400         /* reserved. */
14401         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
14402                 UINT32_C(0x2)
14403         /* reserved. */
14404         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
14405                 UINT32_C(0xff)
14406         /*
14407          * Priority level for strict priority. Valid only when the
14408          * tsa_assign is 0 - Strict Priority (SP)
14409          * 0..7 - Valid values.
14410          * 8..255 - Reserved.
14411          */
14412         uint8_t queue_id4_pri_lvl;
14413         /*
14414          * Weight used to allocate remaining BW for this COS after
14415          * servicing guaranteed bandwidths for all COS.
14416          */
14417         uint8_t queue_id4_bw_weight;
14418         /* ID of CoS Queue 5. */
14419         uint8_t queue_id5;
14420         /*
14421          * Minimum BW allocated to CoS Queue.
14422          * The HWRM will translate this value into byte counter and
14423          * time interval used for this COS inside the device.
14424          */
14425         uint32_t        queue_id5_min_bw;
14426         /* The bandwidth value. */
14427         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
14428                 UINT32_C(0xfffffff)
14429         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
14430                 0
14431         /* The granularity of the value (bits or bytes). */
14432         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
14433                 UINT32_C(0x10000000)
14434         /* Value is in bits. */
14435         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
14436                 (UINT32_C(0x0) << 28)
14437         /* Value is in bytes. */
14438         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
14439                 (UINT32_C(0x1) << 28)
14440         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
14441                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
14442         /* bw_value_unit is 3 b */
14443         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
14444                 UINT32_C(0xe0000000)
14445         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
14446                 29
14447         /* Value is in Mb or MB (base 10). */
14448         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
14449                 (UINT32_C(0x0) << 29)
14450         /* Value is in Kb or KB (base 10). */
14451         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
14452                 (UINT32_C(0x2) << 29)
14453         /* Value is in bits or bytes. */
14454         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
14455                 (UINT32_C(0x4) << 29)
14456         /* Value is in Gb or GB (base 10). */
14457         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
14458                 (UINT32_C(0x6) << 29)
14459         /* Value is in 1/100th of a percentage of total bandwidth. */
14460         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14461                 (UINT32_C(0x1) << 29)
14462         /* Invalid unit */
14463         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
14464                 (UINT32_C(0x7) << 29)
14465         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
14466                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
14467         /*
14468          * Maximum BW allocated to CoS queue.
14469          * The HWRM will translate this value into byte counter and
14470          * time interval used for this COS inside the device.
14471          */
14472         uint32_t        queue_id5_max_bw;
14473         /* The bandwidth value. */
14474         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
14475                 UINT32_C(0xfffffff)
14476         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
14477                 0
14478         /* The granularity of the value (bits or bytes). */
14479         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
14480                 UINT32_C(0x10000000)
14481         /* Value is in bits. */
14482         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
14483                 (UINT32_C(0x0) << 28)
14484         /* Value is in bytes. */
14485         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
14486                 (UINT32_C(0x1) << 28)
14487         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
14488                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
14489         /* bw_value_unit is 3 b */
14490         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
14491                 UINT32_C(0xe0000000)
14492         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
14493                 29
14494         /* Value is in Mb or MB (base 10). */
14495         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
14496                 (UINT32_C(0x0) << 29)
14497         /* Value is in Kb or KB (base 10). */
14498         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
14499                 (UINT32_C(0x2) << 29)
14500         /* Value is in bits or bytes. */
14501         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
14502                 (UINT32_C(0x4) << 29)
14503         /* Value is in Gb or GB (base 10). */
14504         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
14505                 (UINT32_C(0x6) << 29)
14506         /* Value is in 1/100th of a percentage of total bandwidth. */
14507         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14508                 (UINT32_C(0x1) << 29)
14509         /* Invalid unit */
14510         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
14511                 (UINT32_C(0x7) << 29)
14512         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
14513                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
14514         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14515         uint8_t queue_id5_tsa_assign;
14516         /* Strict Priority */
14517         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
14518                 UINT32_C(0x0)
14519         /* Enhanced Transmission Selection */
14520         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
14521                 UINT32_C(0x1)
14522         /* reserved. */
14523         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
14524                 UINT32_C(0x2)
14525         /* reserved. */
14526         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
14527                 UINT32_C(0xff)
14528         /*
14529          * Priority level for strict priority. Valid only when the
14530          * tsa_assign is 0 - Strict Priority (SP)
14531          * 0..7 - Valid values.
14532          * 8..255 - Reserved.
14533          */
14534         uint8_t queue_id5_pri_lvl;
14535         /*
14536          * Weight used to allocate remaining BW for this COS after
14537          * servicing guaranteed bandwidths for all COS.
14538          */
14539         uint8_t queue_id5_bw_weight;
14540         /* ID of CoS Queue 6. */
14541         uint8_t queue_id6;
14542         /*
14543          * Minimum BW allocated to CoS Queue.
14544          * The HWRM will translate this value into byte counter and
14545          * time interval used for this COS inside the device.
14546          */
14547         uint32_t        queue_id6_min_bw;
14548         /* The bandwidth value. */
14549         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
14550                 UINT32_C(0xfffffff)
14551         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
14552                 0
14553         /* The granularity of the value (bits or bytes). */
14554         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
14555                 UINT32_C(0x10000000)
14556         /* Value is in bits. */
14557         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
14558                 (UINT32_C(0x0) << 28)
14559         /* Value is in bytes. */
14560         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
14561                 (UINT32_C(0x1) << 28)
14562         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
14563                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
14564         /* bw_value_unit is 3 b */
14565         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
14566                 UINT32_C(0xe0000000)
14567         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
14568                 29
14569         /* Value is in Mb or MB (base 10). */
14570         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
14571                 (UINT32_C(0x0) << 29)
14572         /* Value is in Kb or KB (base 10). */
14573         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
14574                 (UINT32_C(0x2) << 29)
14575         /* Value is in bits or bytes. */
14576         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
14577                 (UINT32_C(0x4) << 29)
14578         /* Value is in Gb or GB (base 10). */
14579         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
14580                 (UINT32_C(0x6) << 29)
14581         /* Value is in 1/100th of a percentage of total bandwidth. */
14582         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14583                 (UINT32_C(0x1) << 29)
14584         /* Invalid unit */
14585         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
14586                 (UINT32_C(0x7) << 29)
14587         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
14588                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
14589         /*
14590          * Maximum BW allocated to CoS queue.
14591          * The HWRM will translate this value into byte counter and
14592          * time interval used for this COS inside the device.
14593          */
14594         uint32_t        queue_id6_max_bw;
14595         /* The bandwidth value. */
14596         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
14597                 UINT32_C(0xfffffff)
14598         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
14599                 0
14600         /* The granularity of the value (bits or bytes). */
14601         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
14602                 UINT32_C(0x10000000)
14603         /* Value is in bits. */
14604         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
14605                 (UINT32_C(0x0) << 28)
14606         /* Value is in bytes. */
14607         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
14608                 (UINT32_C(0x1) << 28)
14609         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
14610                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
14611         /* bw_value_unit is 3 b */
14612         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
14613                 UINT32_C(0xe0000000)
14614         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
14615                 29
14616         /* Value is in Mb or MB (base 10). */
14617         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
14618                 (UINT32_C(0x0) << 29)
14619         /* Value is in Kb or KB (base 10). */
14620         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
14621                 (UINT32_C(0x2) << 29)
14622         /* Value is in bits or bytes. */
14623         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
14624                 (UINT32_C(0x4) << 29)
14625         /* Value is in Gb or GB (base 10). */
14626         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
14627                 (UINT32_C(0x6) << 29)
14628         /* Value is in 1/100th of a percentage of total bandwidth. */
14629         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14630                 (UINT32_C(0x1) << 29)
14631         /* Invalid unit */
14632         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
14633                 (UINT32_C(0x7) << 29)
14634         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
14635                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
14636         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14637         uint8_t queue_id6_tsa_assign;
14638         /* Strict Priority */
14639         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
14640                 UINT32_C(0x0)
14641         /* Enhanced Transmission Selection */
14642         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
14643                 UINT32_C(0x1)
14644         /* reserved. */
14645         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
14646                 UINT32_C(0x2)
14647         /* reserved. */
14648         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
14649                 UINT32_C(0xff)
14650         /*
14651          * Priority level for strict priority. Valid only when the
14652          * tsa_assign is 0 - Strict Priority (SP)
14653          * 0..7 - Valid values.
14654          * 8..255 - Reserved.
14655          */
14656         uint8_t queue_id6_pri_lvl;
14657         /*
14658          * Weight used to allocate remaining BW for this COS after
14659          * servicing guaranteed bandwidths for all COS.
14660          */
14661         uint8_t queue_id6_bw_weight;
14662         /* ID of CoS Queue 7. */
14663         uint8_t queue_id7;
14664         /*
14665          * Minimum BW allocated to CoS Queue.
14666          * The HWRM will translate this value into byte counter and
14667          * time interval used for this COS inside the device.
14668          */
14669         uint32_t        queue_id7_min_bw;
14670         /* The bandwidth value. */
14671         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
14672                 UINT32_C(0xfffffff)
14673         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
14674                 0
14675         /* The granularity of the value (bits or bytes). */
14676         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
14677                 UINT32_C(0x10000000)
14678         /* Value is in bits. */
14679         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
14680                 (UINT32_C(0x0) << 28)
14681         /* Value is in bytes. */
14682         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
14683                 (UINT32_C(0x1) << 28)
14684         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
14685                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
14686         /* bw_value_unit is 3 b */
14687         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
14688                 UINT32_C(0xe0000000)
14689         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
14690                 29
14691         /* Value is in Mb or MB (base 10). */
14692         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
14693                 (UINT32_C(0x0) << 29)
14694         /* Value is in Kb or KB (base 10). */
14695         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
14696                 (UINT32_C(0x2) << 29)
14697         /* Value is in bits or bytes. */
14698         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
14699                 (UINT32_C(0x4) << 29)
14700         /* Value is in Gb or GB (base 10). */
14701         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
14702                 (UINT32_C(0x6) << 29)
14703         /* Value is in 1/100th of a percentage of total bandwidth. */
14704         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14705                 (UINT32_C(0x1) << 29)
14706         /* Invalid unit */
14707         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
14708                 (UINT32_C(0x7) << 29)
14709         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
14710                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
14711         /*
14712          * Maximum BW allocated to CoS queue.
14713          * The HWRM will translate this value into byte counter and
14714          * time interval used for this COS inside the device.
14715          */
14716         uint32_t        queue_id7_max_bw;
14717         /* The bandwidth value. */
14718         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
14719                 UINT32_C(0xfffffff)
14720         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
14721                 0
14722         /* The granularity of the value (bits or bytes). */
14723         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
14724                 UINT32_C(0x10000000)
14725         /* Value is in bits. */
14726         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
14727                 (UINT32_C(0x0) << 28)
14728         /* Value is in bytes. */
14729         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
14730                 (UINT32_C(0x1) << 28)
14731         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
14732                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
14733         /* bw_value_unit is 3 b */
14734         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
14735                 UINT32_C(0xe0000000)
14736         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
14737                 29
14738         /* Value is in Mb or MB (base 10). */
14739         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
14740                 (UINT32_C(0x0) << 29)
14741         /* Value is in Kb or KB (base 10). */
14742         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
14743                 (UINT32_C(0x2) << 29)
14744         /* Value is in bits or bytes. */
14745         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
14746                 (UINT32_C(0x4) << 29)
14747         /* Value is in Gb or GB (base 10). */
14748         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
14749                 (UINT32_C(0x6) << 29)
14750         /* Value is in 1/100th of a percentage of total bandwidth. */
14751         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14752                 (UINT32_C(0x1) << 29)
14753         /* Invalid unit */
14754         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
14755                 (UINT32_C(0x7) << 29)
14756         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
14757                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
14758         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14759         uint8_t queue_id7_tsa_assign;
14760         /* Strict Priority */
14761         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
14762                 UINT32_C(0x0)
14763         /* Enhanced Transmission Selection */
14764         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
14765                 UINT32_C(0x1)
14766         /* reserved. */
14767         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
14768                 UINT32_C(0x2)
14769         /* reserved. */
14770         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
14771                 UINT32_C(0xff)
14772         /*
14773          * Priority level for strict priority. Valid only when the
14774          * tsa_assign is 0 - Strict Priority (SP)
14775          * 0..7 - Valid values.
14776          * 8..255 - Reserved.
14777          */
14778         uint8_t queue_id7_pri_lvl;
14779         /*
14780          * Weight used to allocate remaining BW for this COS after
14781          * servicing guaranteed bandwidths for all COS.
14782          */
14783         uint8_t queue_id7_bw_weight;
14784         uint8_t unused_2[4];
14785         /*
14786          * This field is used in Output records to indicate that the output
14787          * is completely written to RAM.  This field should be read as '1'
14788          * to indicate that the output has been completely written.
14789          * When writing a command completion or response to an internal processor,
14790          * the order of writes has to be such that this field is written last.
14791          */
14792         uint8_t valid;
14793 } __attribute__((packed));
14794
14795 /*************************
14796  * hwrm_queue_cos2bw_cfg *
14797  *************************/
14798
14799
14800 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
14801 struct hwrm_queue_cos2bw_cfg_input {
14802         /* The HWRM command request type. */
14803         uint16_t        req_type;
14804         /*
14805          * The completion ring to send the completion event on. This should
14806          * be the NQ ID returned from the `nq_alloc` HWRM command.
14807          */
14808         uint16_t        cmpl_ring;
14809         /*
14810          * The sequence ID is used by the driver for tracking multiple
14811          * commands. This ID is treated as opaque data by the firmware and
14812          * the value is returned in the `hwrm_resp_hdr` upon completion.
14813          */
14814         uint16_t        seq_id;
14815         /*
14816          * The target ID of the command:
14817          * * 0x0-0xFFF8 - The function ID
14818          * * 0xFFF8-0xFFFE - Reserved for internal processors
14819          * * 0xFFFF - HWRM
14820          */
14821         uint16_t        target_id;
14822         /*
14823          * A physical address pointer pointing to a host buffer that the
14824          * command's response data will be written. This can be either a host
14825          * physical address (HPA) or a guest physical address (GPA) and must
14826          * point to a physically contiguous block of memory.
14827          */
14828         uint64_t        resp_addr;
14829         uint32_t        flags;
14830         uint32_t        enables;
14831         /*
14832          * If this bit is set to 1, then all queue_id0 related
14833          * parameters in this command are valid.
14834          */
14835         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
14836                 UINT32_C(0x1)
14837         /*
14838          * If this bit is set to 1, then all queue_id1 related
14839          * parameters in this command are valid.
14840          */
14841         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
14842                 UINT32_C(0x2)
14843         /*
14844          * If this bit is set to 1, then all queue_id2 related
14845          * parameters in this command are valid.
14846          */
14847         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
14848                 UINT32_C(0x4)
14849         /*
14850          * If this bit is set to 1, then all queue_id3 related
14851          * parameters in this command are valid.
14852          */
14853         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
14854                 UINT32_C(0x8)
14855         /*
14856          * If this bit is set to 1, then all queue_id4 related
14857          * parameters in this command are valid.
14858          */
14859         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
14860                 UINT32_C(0x10)
14861         /*
14862          * If this bit is set to 1, then all queue_id5 related
14863          * parameters in this command are valid.
14864          */
14865         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
14866                 UINT32_C(0x20)
14867         /*
14868          * If this bit is set to 1, then all queue_id6 related
14869          * parameters in this command are valid.
14870          */
14871         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
14872                 UINT32_C(0x40)
14873         /*
14874          * If this bit is set to 1, then all queue_id7 related
14875          * parameters in this command are valid.
14876          */
14877         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
14878                 UINT32_C(0x80)
14879         /*
14880          * Port ID of port for which the table is being configured.
14881          * The HWRM needs to check whether this function is allowed
14882          * to configure TC BW assignment on this port.
14883          */
14884         uint16_t        port_id;
14885         /* ID of CoS Queue 0. */
14886         uint8_t queue_id0;
14887         uint8_t unused_0;
14888         /*
14889          * Minimum BW allocated to CoS Queue.
14890          * The HWRM will translate this value into byte counter and
14891          * time interval used for this COS inside the device.
14892          */
14893         uint32_t        queue_id0_min_bw;
14894         /* The bandwidth value. */
14895         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
14896                 UINT32_C(0xfffffff)
14897         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
14898                 0
14899         /* The granularity of the value (bits or bytes). */
14900         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
14901                 UINT32_C(0x10000000)
14902         /* Value is in bits. */
14903         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
14904                 (UINT32_C(0x0) << 28)
14905         /* Value is in bytes. */
14906         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
14907                 (UINT32_C(0x1) << 28)
14908         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
14909                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
14910         /* bw_value_unit is 3 b */
14911         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
14912                 UINT32_C(0xe0000000)
14913         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
14914                 29
14915         /* Value is in Mb or MB (base 10). */
14916         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
14917                 (UINT32_C(0x0) << 29)
14918         /* Value is in Kb or KB (base 10). */
14919         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
14920                 (UINT32_C(0x2) << 29)
14921         /* Value is in bits or bytes. */
14922         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
14923                 (UINT32_C(0x4) << 29)
14924         /* Value is in Gb or GB (base 10). */
14925         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
14926                 (UINT32_C(0x6) << 29)
14927         /* Value is in 1/100th of a percentage of total bandwidth. */
14928         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14929                 (UINT32_C(0x1) << 29)
14930         /* Invalid unit */
14931         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
14932                 (UINT32_C(0x7) << 29)
14933         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
14934                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
14935         /*
14936          * Maximum BW allocated to CoS Queue.
14937          * The HWRM will translate this value into byte counter and
14938          * time interval used for this COS inside the device.
14939          */
14940         uint32_t        queue_id0_max_bw;
14941         /* The bandwidth value. */
14942         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
14943                 UINT32_C(0xfffffff)
14944         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
14945                 0
14946         /* The granularity of the value (bits or bytes). */
14947         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
14948                 UINT32_C(0x10000000)
14949         /* Value is in bits. */
14950         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
14951                 (UINT32_C(0x0) << 28)
14952         /* Value is in bytes. */
14953         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
14954                 (UINT32_C(0x1) << 28)
14955         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
14956                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
14957         /* bw_value_unit is 3 b */
14958         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
14959                 UINT32_C(0xe0000000)
14960         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
14961                 29
14962         /* Value is in Mb or MB (base 10). */
14963         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
14964                 (UINT32_C(0x0) << 29)
14965         /* Value is in Kb or KB (base 10). */
14966         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
14967                 (UINT32_C(0x2) << 29)
14968         /* Value is in bits or bytes. */
14969         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
14970                 (UINT32_C(0x4) << 29)
14971         /* Value is in Gb or GB (base 10). */
14972         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
14973                 (UINT32_C(0x6) << 29)
14974         /* Value is in 1/100th of a percentage of total bandwidth. */
14975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14976                 (UINT32_C(0x1) << 29)
14977         /* Invalid unit */
14978         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
14979                 (UINT32_C(0x7) << 29)
14980         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
14981                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
14982         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
14983         uint8_t queue_id0_tsa_assign;
14984         /* Strict Priority */
14985         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
14986                 UINT32_C(0x0)
14987         /* Enhanced Transmission Selection */
14988         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
14989                 UINT32_C(0x1)
14990         /* reserved. */
14991         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
14992                 UINT32_C(0x2)
14993         /* reserved. */
14994         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
14995                 UINT32_C(0xff)
14996         /*
14997          * Priority level for strict priority. Valid only when the
14998          * tsa_assign is 0 - Strict Priority (SP)
14999          * 0..7 - Valid values.
15000          * 8..255 - Reserved.
15001          */
15002         uint8_t queue_id0_pri_lvl;
15003         /*
15004          * Weight used to allocate remaining BW for this COS after
15005          * servicing guaranteed bandwidths for all COS.
15006          */
15007         uint8_t queue_id0_bw_weight;
15008         /* ID of CoS Queue 1. */
15009         uint8_t queue_id1;
15010         /*
15011          * Minimum BW allocated to CoS Queue.
15012          * The HWRM will translate this value into byte counter and
15013          * time interval used for this COS inside the device.
15014          */
15015         uint32_t        queue_id1_min_bw;
15016         /* The bandwidth value. */
15017         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
15018                 UINT32_C(0xfffffff)
15019         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
15020                 0
15021         /* The granularity of the value (bits or bytes). */
15022         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
15023                 UINT32_C(0x10000000)
15024         /* Value is in bits. */
15025         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
15026                 (UINT32_C(0x0) << 28)
15027         /* Value is in bytes. */
15028         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
15029                 (UINT32_C(0x1) << 28)
15030         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
15031                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
15032         /* bw_value_unit is 3 b */
15033         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
15034                 UINT32_C(0xe0000000)
15035         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
15036                 29
15037         /* Value is in Mb or MB (base 10). */
15038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
15039                 (UINT32_C(0x0) << 29)
15040         /* Value is in Kb or KB (base 10). */
15041         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
15042                 (UINT32_C(0x2) << 29)
15043         /* Value is in bits or bytes. */
15044         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
15045                 (UINT32_C(0x4) << 29)
15046         /* Value is in Gb or GB (base 10). */
15047         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
15048                 (UINT32_C(0x6) << 29)
15049         /* Value is in 1/100th of a percentage of total bandwidth. */
15050         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15051                 (UINT32_C(0x1) << 29)
15052         /* Invalid unit */
15053         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
15054                 (UINT32_C(0x7) << 29)
15055         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
15056                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
15057         /*
15058          * Maximum BW allocated to CoS queue.
15059          * The HWRM will translate this value into byte counter and
15060          * time interval used for this COS inside the device.
15061          */
15062         uint32_t        queue_id1_max_bw;
15063         /* The bandwidth value. */
15064         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
15065                 UINT32_C(0xfffffff)
15066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
15067                 0
15068         /* The granularity of the value (bits or bytes). */
15069         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
15070                 UINT32_C(0x10000000)
15071         /* Value is in bits. */
15072         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
15073                 (UINT32_C(0x0) << 28)
15074         /* Value is in bytes. */
15075         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
15076                 (UINT32_C(0x1) << 28)
15077         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
15078                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
15079         /* bw_value_unit is 3 b */
15080         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
15081                 UINT32_C(0xe0000000)
15082         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
15083                 29
15084         /* Value is in Mb or MB (base 10). */
15085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
15086                 (UINT32_C(0x0) << 29)
15087         /* Value is in Kb or KB (base 10). */
15088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
15089                 (UINT32_C(0x2) << 29)
15090         /* Value is in bits or bytes. */
15091         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
15092                 (UINT32_C(0x4) << 29)
15093         /* Value is in Gb or GB (base 10). */
15094         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
15095                 (UINT32_C(0x6) << 29)
15096         /* Value is in 1/100th of a percentage of total bandwidth. */
15097         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15098                 (UINT32_C(0x1) << 29)
15099         /* Invalid unit */
15100         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
15101                 (UINT32_C(0x7) << 29)
15102         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
15103                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
15104         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15105         uint8_t queue_id1_tsa_assign;
15106         /* Strict Priority */
15107         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
15108                 UINT32_C(0x0)
15109         /* Enhanced Transmission Selection */
15110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
15111                 UINT32_C(0x1)
15112         /* reserved. */
15113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
15114                 UINT32_C(0x2)
15115         /* reserved. */
15116         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
15117                 UINT32_C(0xff)
15118         /*
15119          * Priority level for strict priority. Valid only when the
15120          * tsa_assign is 0 - Strict Priority (SP)
15121          * 0..7 - Valid values.
15122          * 8..255 - Reserved.
15123          */
15124         uint8_t queue_id1_pri_lvl;
15125         /*
15126          * Weight used to allocate remaining BW for this COS after
15127          * servicing guaranteed bandwidths for all COS.
15128          */
15129         uint8_t queue_id1_bw_weight;
15130         /* ID of CoS Queue 2. */
15131         uint8_t queue_id2;
15132         /*
15133          * Minimum BW allocated to CoS Queue.
15134          * The HWRM will translate this value into byte counter and
15135          * time interval used for this COS inside the device.
15136          */
15137         uint32_t        queue_id2_min_bw;
15138         /* The bandwidth value. */
15139         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
15140                 UINT32_C(0xfffffff)
15141         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
15142                 0
15143         /* The granularity of the value (bits or bytes). */
15144         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
15145                 UINT32_C(0x10000000)
15146         /* Value is in bits. */
15147         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
15148                 (UINT32_C(0x0) << 28)
15149         /* Value is in bytes. */
15150         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
15151                 (UINT32_C(0x1) << 28)
15152         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
15153                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
15154         /* bw_value_unit is 3 b */
15155         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
15156                 UINT32_C(0xe0000000)
15157         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
15158                 29
15159         /* Value is in Mb or MB (base 10). */
15160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
15161                 (UINT32_C(0x0) << 29)
15162         /* Value is in Kb or KB (base 10). */
15163         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
15164                 (UINT32_C(0x2) << 29)
15165         /* Value is in bits or bytes. */
15166         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
15167                 (UINT32_C(0x4) << 29)
15168         /* Value is in Gb or GB (base 10). */
15169         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
15170                 (UINT32_C(0x6) << 29)
15171         /* Value is in 1/100th of a percentage of total bandwidth. */
15172         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15173                 (UINT32_C(0x1) << 29)
15174         /* Invalid unit */
15175         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
15176                 (UINT32_C(0x7) << 29)
15177         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
15178                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
15179         /*
15180          * Maximum BW allocated to CoS queue.
15181          * The HWRM will translate this value into byte counter and
15182          * time interval used for this COS inside the device.
15183          */
15184         uint32_t        queue_id2_max_bw;
15185         /* The bandwidth value. */
15186         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
15187                 UINT32_C(0xfffffff)
15188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
15189                 0
15190         /* The granularity of the value (bits or bytes). */
15191         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
15192                 UINT32_C(0x10000000)
15193         /* Value is in bits. */
15194         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
15195                 (UINT32_C(0x0) << 28)
15196         /* Value is in bytes. */
15197         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
15198                 (UINT32_C(0x1) << 28)
15199         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
15200                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
15201         /* bw_value_unit is 3 b */
15202         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
15203                 UINT32_C(0xe0000000)
15204         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
15205                 29
15206         /* Value is in Mb or MB (base 10). */
15207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
15208                 (UINT32_C(0x0) << 29)
15209         /* Value is in Kb or KB (base 10). */
15210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
15211                 (UINT32_C(0x2) << 29)
15212         /* Value is in bits or bytes. */
15213         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
15214                 (UINT32_C(0x4) << 29)
15215         /* Value is in Gb or GB (base 10). */
15216         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
15217                 (UINT32_C(0x6) << 29)
15218         /* Value is in 1/100th of a percentage of total bandwidth. */
15219         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15220                 (UINT32_C(0x1) << 29)
15221         /* Invalid unit */
15222         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
15223                 (UINT32_C(0x7) << 29)
15224         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
15225                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
15226         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15227         uint8_t queue_id2_tsa_assign;
15228         /* Strict Priority */
15229         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
15230                 UINT32_C(0x0)
15231         /* Enhanced Transmission Selection */
15232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
15233                 UINT32_C(0x1)
15234         /* reserved. */
15235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
15236                 UINT32_C(0x2)
15237         /* reserved. */
15238         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
15239                 UINT32_C(0xff)
15240         /*
15241          * Priority level for strict priority. Valid only when the
15242          * tsa_assign is 0 - Strict Priority (SP)
15243          * 0..7 - Valid values.
15244          * 8..255 - Reserved.
15245          */
15246         uint8_t queue_id2_pri_lvl;
15247         /*
15248          * Weight used to allocate remaining BW for this COS after
15249          * servicing guaranteed bandwidths for all COS.
15250          */
15251         uint8_t queue_id2_bw_weight;
15252         /* ID of CoS Queue 3. */
15253         uint8_t queue_id3;
15254         /*
15255          * Minimum BW allocated to CoS Queue.
15256          * The HWRM will translate this value into byte counter and
15257          * time interval used for this COS inside the device.
15258          */
15259         uint32_t        queue_id3_min_bw;
15260         /* The bandwidth value. */
15261         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
15262                 UINT32_C(0xfffffff)
15263         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
15264                 0
15265         /* The granularity of the value (bits or bytes). */
15266         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
15267                 UINT32_C(0x10000000)
15268         /* Value is in bits. */
15269         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
15270                 (UINT32_C(0x0) << 28)
15271         /* Value is in bytes. */
15272         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
15273                 (UINT32_C(0x1) << 28)
15274         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
15275                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
15276         /* bw_value_unit is 3 b */
15277         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
15278                 UINT32_C(0xe0000000)
15279         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
15280                 29
15281         /* Value is in Mb or MB (base 10). */
15282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
15283                 (UINT32_C(0x0) << 29)
15284         /* Value is in Kb or KB (base 10). */
15285         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
15286                 (UINT32_C(0x2) << 29)
15287         /* Value is in bits or bytes. */
15288         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
15289                 (UINT32_C(0x4) << 29)
15290         /* Value is in Gb or GB (base 10). */
15291         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
15292                 (UINT32_C(0x6) << 29)
15293         /* Value is in 1/100th of a percentage of total bandwidth. */
15294         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15295                 (UINT32_C(0x1) << 29)
15296         /* Invalid unit */
15297         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
15298                 (UINT32_C(0x7) << 29)
15299         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
15300                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
15301         /*
15302          * Maximum BW allocated to CoS queue.
15303          * The HWRM will translate this value into byte counter and
15304          * time interval used for this COS inside the device.
15305          */
15306         uint32_t        queue_id3_max_bw;
15307         /* The bandwidth value. */
15308         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
15309                 UINT32_C(0xfffffff)
15310         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
15311                 0
15312         /* The granularity of the value (bits or bytes). */
15313         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
15314                 UINT32_C(0x10000000)
15315         /* Value is in bits. */
15316         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
15317                 (UINT32_C(0x0) << 28)
15318         /* Value is in bytes. */
15319         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
15320                 (UINT32_C(0x1) << 28)
15321         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
15322                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
15323         /* bw_value_unit is 3 b */
15324         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
15325                 UINT32_C(0xe0000000)
15326         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
15327                 29
15328         /* Value is in Mb or MB (base 10). */
15329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
15330                 (UINT32_C(0x0) << 29)
15331         /* Value is in Kb or KB (base 10). */
15332         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
15333                 (UINT32_C(0x2) << 29)
15334         /* Value is in bits or bytes. */
15335         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
15336                 (UINT32_C(0x4) << 29)
15337         /* Value is in Gb or GB (base 10). */
15338         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
15339                 (UINT32_C(0x6) << 29)
15340         /* Value is in 1/100th of a percentage of total bandwidth. */
15341         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15342                 (UINT32_C(0x1) << 29)
15343         /* Invalid unit */
15344         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
15345                 (UINT32_C(0x7) << 29)
15346         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
15347                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
15348         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15349         uint8_t queue_id3_tsa_assign;
15350         /* Strict Priority */
15351         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
15352                 UINT32_C(0x0)
15353         /* Enhanced Transmission Selection */
15354         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
15355                 UINT32_C(0x1)
15356         /* reserved. */
15357         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
15358                 UINT32_C(0x2)
15359         /* reserved. */
15360         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
15361                 UINT32_C(0xff)
15362         /*
15363          * Priority level for strict priority. Valid only when the
15364          * tsa_assign is 0 - Strict Priority (SP)
15365          * 0..7 - Valid values.
15366          * 8..255 - Reserved.
15367          */
15368         uint8_t queue_id3_pri_lvl;
15369         /*
15370          * Weight used to allocate remaining BW for this COS after
15371          * servicing guaranteed bandwidths for all COS.
15372          */
15373         uint8_t queue_id3_bw_weight;
15374         /* ID of CoS Queue 4. */
15375         uint8_t queue_id4;
15376         /*
15377          * Minimum BW allocated to CoS Queue.
15378          * The HWRM will translate this value into byte counter and
15379          * time interval used for this COS inside the device.
15380          */
15381         uint32_t        queue_id4_min_bw;
15382         /* The bandwidth value. */
15383         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
15384                 UINT32_C(0xfffffff)
15385         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
15386                 0
15387         /* The granularity of the value (bits or bytes). */
15388         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
15389                 UINT32_C(0x10000000)
15390         /* Value is in bits. */
15391         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
15392                 (UINT32_C(0x0) << 28)
15393         /* Value is in bytes. */
15394         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
15395                 (UINT32_C(0x1) << 28)
15396         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
15397                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
15398         /* bw_value_unit is 3 b */
15399         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
15400                 UINT32_C(0xe0000000)
15401         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
15402                 29
15403         /* Value is in Mb or MB (base 10). */
15404         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
15405                 (UINT32_C(0x0) << 29)
15406         /* Value is in Kb or KB (base 10). */
15407         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
15408                 (UINT32_C(0x2) << 29)
15409         /* Value is in bits or bytes. */
15410         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
15411                 (UINT32_C(0x4) << 29)
15412         /* Value is in Gb or GB (base 10). */
15413         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
15414                 (UINT32_C(0x6) << 29)
15415         /* Value is in 1/100th of a percentage of total bandwidth. */
15416         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15417                 (UINT32_C(0x1) << 29)
15418         /* Invalid unit */
15419         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
15420                 (UINT32_C(0x7) << 29)
15421         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
15422                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
15423         /*
15424          * Maximum BW allocated to CoS queue.
15425          * The HWRM will translate this value into byte counter and
15426          * time interval used for this COS inside the device.
15427          */
15428         uint32_t        queue_id4_max_bw;
15429         /* The bandwidth value. */
15430         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
15431                 UINT32_C(0xfffffff)
15432         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
15433                 0
15434         /* The granularity of the value (bits or bytes). */
15435         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
15436                 UINT32_C(0x10000000)
15437         /* Value is in bits. */
15438         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
15439                 (UINT32_C(0x0) << 28)
15440         /* Value is in bytes. */
15441         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
15442                 (UINT32_C(0x1) << 28)
15443         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
15444                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
15445         /* bw_value_unit is 3 b */
15446         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
15447                 UINT32_C(0xe0000000)
15448         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
15449                 29
15450         /* Value is in Mb or MB (base 10). */
15451         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
15452                 (UINT32_C(0x0) << 29)
15453         /* Value is in Kb or KB (base 10). */
15454         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
15455                 (UINT32_C(0x2) << 29)
15456         /* Value is in bits or bytes. */
15457         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
15458                 (UINT32_C(0x4) << 29)
15459         /* Value is in Gb or GB (base 10). */
15460         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
15461                 (UINT32_C(0x6) << 29)
15462         /* Value is in 1/100th of a percentage of total bandwidth. */
15463         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15464                 (UINT32_C(0x1) << 29)
15465         /* Invalid unit */
15466         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
15467                 (UINT32_C(0x7) << 29)
15468         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
15469                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
15470         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15471         uint8_t queue_id4_tsa_assign;
15472         /* Strict Priority */
15473         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
15474                 UINT32_C(0x0)
15475         /* Enhanced Transmission Selection */
15476         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
15477                 UINT32_C(0x1)
15478         /* reserved. */
15479         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
15480                 UINT32_C(0x2)
15481         /* reserved. */
15482         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
15483                 UINT32_C(0xff)
15484         /*
15485          * Priority level for strict priority. Valid only when the
15486          * tsa_assign is 0 - Strict Priority (SP)
15487          * 0..7 - Valid values.
15488          * 8..255 - Reserved.
15489          */
15490         uint8_t queue_id4_pri_lvl;
15491         /*
15492          * Weight used to allocate remaining BW for this COS after
15493          * servicing guaranteed bandwidths for all COS.
15494          */
15495         uint8_t queue_id4_bw_weight;
15496         /* ID of CoS Queue 5. */
15497         uint8_t queue_id5;
15498         /*
15499          * Minimum BW allocated to CoS Queue.
15500          * The HWRM will translate this value into byte counter and
15501          * time interval used for this COS inside the device.
15502          */
15503         uint32_t        queue_id5_min_bw;
15504         /* The bandwidth value. */
15505         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
15506                 UINT32_C(0xfffffff)
15507         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
15508                 0
15509         /* The granularity of the value (bits or bytes). */
15510         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
15511                 UINT32_C(0x10000000)
15512         /* Value is in bits. */
15513         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
15514                 (UINT32_C(0x0) << 28)
15515         /* Value is in bytes. */
15516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
15517                 (UINT32_C(0x1) << 28)
15518         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
15519                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
15520         /* bw_value_unit is 3 b */
15521         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
15522                 UINT32_C(0xe0000000)
15523         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
15524                 29
15525         /* Value is in Mb or MB (base 10). */
15526         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
15527                 (UINT32_C(0x0) << 29)
15528         /* Value is in Kb or KB (base 10). */
15529         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
15530                 (UINT32_C(0x2) << 29)
15531         /* Value is in bits or bytes. */
15532         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
15533                 (UINT32_C(0x4) << 29)
15534         /* Value is in Gb or GB (base 10). */
15535         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
15536                 (UINT32_C(0x6) << 29)
15537         /* Value is in 1/100th of a percentage of total bandwidth. */
15538         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15539                 (UINT32_C(0x1) << 29)
15540         /* Invalid unit */
15541         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
15542                 (UINT32_C(0x7) << 29)
15543         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
15544                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
15545         /*
15546          * Maximum BW allocated to CoS queue.
15547          * The HWRM will translate this value into byte counter and
15548          * time interval used for this COS inside the device.
15549          */
15550         uint32_t        queue_id5_max_bw;
15551         /* The bandwidth value. */
15552         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
15553                 UINT32_C(0xfffffff)
15554         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
15555                 0
15556         /* The granularity of the value (bits or bytes). */
15557         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
15558                 UINT32_C(0x10000000)
15559         /* Value is in bits. */
15560         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
15561                 (UINT32_C(0x0) << 28)
15562         /* Value is in bytes. */
15563         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
15564                 (UINT32_C(0x1) << 28)
15565         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
15566                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
15567         /* bw_value_unit is 3 b */
15568         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
15569                 UINT32_C(0xe0000000)
15570         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
15571                 29
15572         /* Value is in Mb or MB (base 10). */
15573         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
15574                 (UINT32_C(0x0) << 29)
15575         /* Value is in Kb or KB (base 10). */
15576         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
15577                 (UINT32_C(0x2) << 29)
15578         /* Value is in bits or bytes. */
15579         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
15580                 (UINT32_C(0x4) << 29)
15581         /* Value is in Gb or GB (base 10). */
15582         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
15583                 (UINT32_C(0x6) << 29)
15584         /* Value is in 1/100th of a percentage of total bandwidth. */
15585         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15586                 (UINT32_C(0x1) << 29)
15587         /* Invalid unit */
15588         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
15589                 (UINT32_C(0x7) << 29)
15590         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
15591                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
15592         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15593         uint8_t queue_id5_tsa_assign;
15594         /* Strict Priority */
15595         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
15596                 UINT32_C(0x0)
15597         /* Enhanced Transmission Selection */
15598         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
15599                 UINT32_C(0x1)
15600         /* reserved. */
15601         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
15602                 UINT32_C(0x2)
15603         /* reserved. */
15604         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
15605                 UINT32_C(0xff)
15606         /*
15607          * Priority level for strict priority. Valid only when the
15608          * tsa_assign is 0 - Strict Priority (SP)
15609          * 0..7 - Valid values.
15610          * 8..255 - Reserved.
15611          */
15612         uint8_t queue_id5_pri_lvl;
15613         /*
15614          * Weight used to allocate remaining BW for this COS after
15615          * servicing guaranteed bandwidths for all COS.
15616          */
15617         uint8_t queue_id5_bw_weight;
15618         /* ID of CoS Queue 6. */
15619         uint8_t queue_id6;
15620         /*
15621          * Minimum BW allocated to CoS Queue.
15622          * The HWRM will translate this value into byte counter and
15623          * time interval used for this COS inside the device.
15624          */
15625         uint32_t        queue_id6_min_bw;
15626         /* The bandwidth value. */
15627         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
15628                 UINT32_C(0xfffffff)
15629         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
15630                 0
15631         /* The granularity of the value (bits or bytes). */
15632         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
15633                 UINT32_C(0x10000000)
15634         /* Value is in bits. */
15635         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
15636                 (UINT32_C(0x0) << 28)
15637         /* Value is in bytes. */
15638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
15639                 (UINT32_C(0x1) << 28)
15640         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
15641                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
15642         /* bw_value_unit is 3 b */
15643         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
15644                 UINT32_C(0xe0000000)
15645         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
15646                 29
15647         /* Value is in Mb or MB (base 10). */
15648         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
15649                 (UINT32_C(0x0) << 29)
15650         /* Value is in Kb or KB (base 10). */
15651         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
15652                 (UINT32_C(0x2) << 29)
15653         /* Value is in bits or bytes. */
15654         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
15655                 (UINT32_C(0x4) << 29)
15656         /* Value is in Gb or GB (base 10). */
15657         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
15658                 (UINT32_C(0x6) << 29)
15659         /* Value is in 1/100th of a percentage of total bandwidth. */
15660         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15661                 (UINT32_C(0x1) << 29)
15662         /* Invalid unit */
15663         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
15664                 (UINT32_C(0x7) << 29)
15665         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
15666                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
15667         /*
15668          * Maximum BW allocated to CoS queue.
15669          * The HWRM will translate this value into byte counter and
15670          * time interval used for this COS inside the device.
15671          */
15672         uint32_t        queue_id6_max_bw;
15673         /* The bandwidth value. */
15674         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
15675                 UINT32_C(0xfffffff)
15676         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
15677                 0
15678         /* The granularity of the value (bits or bytes). */
15679         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
15680                 UINT32_C(0x10000000)
15681         /* Value is in bits. */
15682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
15683                 (UINT32_C(0x0) << 28)
15684         /* Value is in bytes. */
15685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
15686                 (UINT32_C(0x1) << 28)
15687         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
15688                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
15689         /* bw_value_unit is 3 b */
15690         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
15691                 UINT32_C(0xe0000000)
15692         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
15693                 29
15694         /* Value is in Mb or MB (base 10). */
15695         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
15696                 (UINT32_C(0x0) << 29)
15697         /* Value is in Kb or KB (base 10). */
15698         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
15699                 (UINT32_C(0x2) << 29)
15700         /* Value is in bits or bytes. */
15701         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
15702                 (UINT32_C(0x4) << 29)
15703         /* Value is in Gb or GB (base 10). */
15704         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
15705                 (UINT32_C(0x6) << 29)
15706         /* Value is in 1/100th of a percentage of total bandwidth. */
15707         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15708                 (UINT32_C(0x1) << 29)
15709         /* Invalid unit */
15710         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
15711                 (UINT32_C(0x7) << 29)
15712         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
15713                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
15714         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15715         uint8_t queue_id6_tsa_assign;
15716         /* Strict Priority */
15717         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
15718                 UINT32_C(0x0)
15719         /* Enhanced Transmission Selection */
15720         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
15721                 UINT32_C(0x1)
15722         /* reserved. */
15723         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
15724                 UINT32_C(0x2)
15725         /* reserved. */
15726         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
15727                 UINT32_C(0xff)
15728         /*
15729          * Priority level for strict priority. Valid only when the
15730          * tsa_assign is 0 - Strict Priority (SP)
15731          * 0..7 - Valid values.
15732          * 8..255 - Reserved.
15733          */
15734         uint8_t queue_id6_pri_lvl;
15735         /*
15736          * Weight used to allocate remaining BW for this COS after
15737          * servicing guaranteed bandwidths for all COS.
15738          */
15739         uint8_t queue_id6_bw_weight;
15740         /* ID of CoS Queue 7. */
15741         uint8_t queue_id7;
15742         /*
15743          * Minimum BW allocated to CoS Queue.
15744          * The HWRM will translate this value into byte counter and
15745          * time interval used for this COS inside the device.
15746          */
15747         uint32_t        queue_id7_min_bw;
15748         /* The bandwidth value. */
15749         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
15750                 UINT32_C(0xfffffff)
15751         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
15752                 0
15753         /* The granularity of the value (bits or bytes). */
15754         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
15755                 UINT32_C(0x10000000)
15756         /* Value is in bits. */
15757         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
15758                 (UINT32_C(0x0) << 28)
15759         /* Value is in bytes. */
15760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
15761                 (UINT32_C(0x1) << 28)
15762         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
15763                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
15764         /* bw_value_unit is 3 b */
15765         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
15766                 UINT32_C(0xe0000000)
15767         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
15768                 29
15769         /* Value is in Mb or MB (base 10). */
15770         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
15771                 (UINT32_C(0x0) << 29)
15772         /* Value is in Kb or KB (base 10). */
15773         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
15774                 (UINT32_C(0x2) << 29)
15775         /* Value is in bits or bytes. */
15776         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
15777                 (UINT32_C(0x4) << 29)
15778         /* Value is in Gb or GB (base 10). */
15779         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
15780                 (UINT32_C(0x6) << 29)
15781         /* Value is in 1/100th of a percentage of total bandwidth. */
15782         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15783                 (UINT32_C(0x1) << 29)
15784         /* Invalid unit */
15785         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
15786                 (UINT32_C(0x7) << 29)
15787         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
15788                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
15789         /*
15790          * Maximum BW allocated to CoS queue.
15791          * The HWRM will translate this value into byte counter and
15792          * time interval used for this COS inside the device.
15793          */
15794         uint32_t        queue_id7_max_bw;
15795         /* The bandwidth value. */
15796         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
15797                 UINT32_C(0xfffffff)
15798         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
15799                 0
15800         /* The granularity of the value (bits or bytes). */
15801         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
15802                 UINT32_C(0x10000000)
15803         /* Value is in bits. */
15804         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
15805                 (UINT32_C(0x0) << 28)
15806         /* Value is in bytes. */
15807         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
15808                 (UINT32_C(0x1) << 28)
15809         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
15810                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
15811         /* bw_value_unit is 3 b */
15812         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
15813                 UINT32_C(0xe0000000)
15814         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
15815                 29
15816         /* Value is in Mb or MB (base 10). */
15817         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
15818                 (UINT32_C(0x0) << 29)
15819         /* Value is in Kb or KB (base 10). */
15820         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
15821                 (UINT32_C(0x2) << 29)
15822         /* Value is in bits or bytes. */
15823         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
15824                 (UINT32_C(0x4) << 29)
15825         /* Value is in Gb or GB (base 10). */
15826         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
15827                 (UINT32_C(0x6) << 29)
15828         /* Value is in 1/100th of a percentage of total bandwidth. */
15829         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15830                 (UINT32_C(0x1) << 29)
15831         /* Invalid unit */
15832         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
15833                 (UINT32_C(0x7) << 29)
15834         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
15835                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
15836         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
15837         uint8_t queue_id7_tsa_assign;
15838         /* Strict Priority */
15839         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
15840                 UINT32_C(0x0)
15841         /* Enhanced Transmission Selection */
15842         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
15843                 UINT32_C(0x1)
15844         /* reserved. */
15845         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
15846                 UINT32_C(0x2)
15847         /* reserved. */
15848         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
15849                 UINT32_C(0xff)
15850         /*
15851          * Priority level for strict priority. Valid only when the
15852          * tsa_assign is 0 - Strict Priority (SP)
15853          * 0..7 - Valid values.
15854          * 8..255 - Reserved.
15855          */
15856         uint8_t queue_id7_pri_lvl;
15857         /*
15858          * Weight used to allocate remaining BW for this COS after
15859          * servicing guaranteed bandwidths for all COS.
15860          */
15861         uint8_t queue_id7_bw_weight;
15862         uint8_t unused_1[5];
15863 } __attribute__((packed));
15864
15865 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
15866 struct hwrm_queue_cos2bw_cfg_output {
15867         /* The specific error status for the command. */
15868         uint16_t        error_code;
15869         /* The HWRM command request type. */
15870         uint16_t        req_type;
15871         /* The sequence ID from the original command. */
15872         uint16_t        seq_id;
15873         /* The length of the response data in number of bytes. */
15874         uint16_t        resp_len;
15875         uint8_t unused_0[7];
15876         /*
15877          * This field is used in Output records to indicate that the output
15878          * is completely written to RAM.  This field should be read as '1'
15879          * to indicate that the output has been completely written.
15880          * When writing a command completion or response to an internal processor,
15881          * the order of writes has to be such that this field is written last.
15882          */
15883         uint8_t valid;
15884 } __attribute__((packed));
15885
15886 /*************************
15887  * hwrm_queue_dscp_qcaps *
15888  *************************/
15889
15890
15891 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
15892 struct hwrm_queue_dscp_qcaps_input {
15893         /* The HWRM command request type. */
15894         uint16_t        req_type;
15895         /*
15896          * The completion ring to send the completion event on. This should
15897          * be the NQ ID returned from the `nq_alloc` HWRM command.
15898          */
15899         uint16_t        cmpl_ring;
15900         /*
15901          * The sequence ID is used by the driver for tracking multiple
15902          * commands. This ID is treated as opaque data by the firmware and
15903          * the value is returned in the `hwrm_resp_hdr` upon completion.
15904          */
15905         uint16_t        seq_id;
15906         /*
15907          * The target ID of the command:
15908          * * 0x0-0xFFF8 - The function ID
15909          * * 0xFFF8-0xFFFE - Reserved for internal processors
15910          * * 0xFFFF - HWRM
15911          */
15912         uint16_t        target_id;
15913         /*
15914          * A physical address pointer pointing to a host buffer that the
15915          * command's response data will be written. This can be either a host
15916          * physical address (HPA) or a guest physical address (GPA) and must
15917          * point to a physically contiguous block of memory.
15918          */
15919         uint64_t        resp_addr;
15920         /*
15921          * Port ID of port for which the table is being configured.
15922          * The HWRM needs to check whether this function is allowed
15923          * to configure pri2cos mapping on this port.
15924          */
15925         uint8_t port_id;
15926         uint8_t unused_0[7];
15927 } __attribute__((packed));
15928
15929 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
15930 struct hwrm_queue_dscp_qcaps_output {
15931         /* The specific error status for the command. */
15932         uint16_t        error_code;
15933         /* The HWRM command request type. */
15934         uint16_t        req_type;
15935         /* The sequence ID from the original command. */
15936         uint16_t        seq_id;
15937         /* The length of the response data in number of bytes. */
15938         uint16_t        resp_len;
15939         /* The number of bits provided by the hardware for the DSCP value. */
15940         uint8_t num_dscp_bits;
15941         uint8_t unused_0;
15942         /* Max number of DSCP-MASK-PRI entries supported. */
15943         uint16_t        max_entries;
15944         uint8_t unused_1[3];
15945         /*
15946          * This field is used in Output records to indicate that the output
15947          * is completely written to RAM.  This field should be read as '1'
15948          * to indicate that the output has been completely written.
15949          * When writing a command completion or response to an internal processor,
15950          * the order of writes has to be such that this field is written last.
15951          */
15952         uint8_t valid;
15953 } __attribute__((packed));
15954
15955 /****************************
15956  * hwrm_queue_dscp2pri_qcfg *
15957  ****************************/
15958
15959
15960 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
15961 struct hwrm_queue_dscp2pri_qcfg_input {
15962         /* The HWRM command request type. */
15963         uint16_t        req_type;
15964         /*
15965          * The completion ring to send the completion event on. This should
15966          * be the NQ ID returned from the `nq_alloc` HWRM command.
15967          */
15968         uint16_t        cmpl_ring;
15969         /*
15970          * The sequence ID is used by the driver for tracking multiple
15971          * commands. This ID is treated as opaque data by the firmware and
15972          * the value is returned in the `hwrm_resp_hdr` upon completion.
15973          */
15974         uint16_t        seq_id;
15975         /*
15976          * The target ID of the command:
15977          * * 0x0-0xFFF8 - The function ID
15978          * * 0xFFF8-0xFFFE - Reserved for internal processors
15979          * * 0xFFFF - HWRM
15980          */
15981         uint16_t        target_id;
15982         /*
15983          * A physical address pointer pointing to a host buffer that the
15984          * command's response data will be written. This can be either a host
15985          * physical address (HPA) or a guest physical address (GPA) and must
15986          * point to a physically contiguous block of memory.
15987          */
15988         uint64_t        resp_addr;
15989         /*
15990          * This is the host address where the 24-bits DSCP-MASK-PRI
15991          * tuple(s) will be copied to.
15992          */
15993         uint64_t        dest_data_addr;
15994         /*
15995          * Port ID of port for which the table is being configured.
15996          * The HWRM needs to check whether this function is allowed
15997          * to configure pri2cos mapping on this port.
15998          */
15999         uint8_t port_id;
16000         uint8_t unused_0;
16001         /* Size of the buffer pointed to by dest_data_addr. */
16002         uint16_t        dest_data_buffer_size;
16003         uint8_t unused_1[4];
16004 } __attribute__((packed));
16005
16006 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
16007 struct hwrm_queue_dscp2pri_qcfg_output {
16008         /* The specific error status for the command. */
16009         uint16_t        error_code;
16010         /* The HWRM command request type. */
16011         uint16_t        req_type;
16012         /* The sequence ID from the original command. */
16013         uint16_t        seq_id;
16014         /* The length of the response data in number of bytes. */
16015         uint16_t        resp_len;
16016         /*
16017          * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
16018          * by the dest_data_addr.
16019          */
16020         uint16_t        entry_cnt;
16021         /*
16022          * This is the default PRI which un-initialized DSCP values are
16023          * mapped to.
16024          */
16025         uint8_t default_pri;
16026         uint8_t unused_0[4];
16027         /*
16028          * This field is used in Output records to indicate that the output
16029          * is completely written to RAM.  This field should be read as '1'
16030          * to indicate that the output has been completely written.
16031          * When writing a command completion or response to an internal processor,
16032          * the order of writes has to be such that this field is written last.
16033          */
16034         uint8_t valid;
16035 } __attribute__((packed));
16036
16037 /***************************
16038  * hwrm_queue_dscp2pri_cfg *
16039  ***************************/
16040
16041
16042 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
16043 struct hwrm_queue_dscp2pri_cfg_input {
16044         /* The HWRM command request type. */
16045         uint16_t        req_type;
16046         /*
16047          * The completion ring to send the completion event on. This should
16048          * be the NQ ID returned from the `nq_alloc` HWRM command.
16049          */
16050         uint16_t        cmpl_ring;
16051         /*
16052          * The sequence ID is used by the driver for tracking multiple
16053          * commands. This ID is treated as opaque data by the firmware and
16054          * the value is returned in the `hwrm_resp_hdr` upon completion.
16055          */
16056         uint16_t        seq_id;
16057         /*
16058          * The target ID of the command:
16059          * * 0x0-0xFFF8 - The function ID
16060          * * 0xFFF8-0xFFFE - Reserved for internal processors
16061          * * 0xFFFF - HWRM
16062          */
16063         uint16_t        target_id;
16064         /*
16065          * A physical address pointer pointing to a host buffer that the
16066          * command's response data will be written. This can be either a host
16067          * physical address (HPA) or a guest physical address (GPA) and must
16068          * point to a physically contiguous block of memory.
16069          */
16070         uint64_t        resp_addr;
16071         /*
16072          * This is the host address where the 24-bits DSCP-MASK-PRI tuple
16073          * will be copied from.
16074          */
16075         uint64_t        src_data_addr;
16076         uint32_t        flags;
16077         /* use_hw_default_pri is 1 b */
16078         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI \
16079                 UINT32_C(0x1)
16080         uint32_t        enables;
16081         /*
16082          * This bit must be '1' for the default_pri field to be
16083          * configured.
16084          */
16085         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI \
16086                 UINT32_C(0x1)
16087         /*
16088          * Port ID of port for which the table is being configured.
16089          * The HWRM needs to check whether this function is allowed
16090          * to configure pri2cos mapping on this port.
16091          */
16092         uint8_t port_id;
16093         /*
16094          * This is the default PRI which un-initialized DSCP values will be
16095          * mapped to.
16096          */
16097         uint8_t default_pri;
16098         /*
16099          * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
16100          * to by src_data_addr.
16101          */
16102         uint16_t        entry_cnt;
16103         uint8_t unused_0[4];
16104 } __attribute__((packed));
16105
16106 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
16107 struct hwrm_queue_dscp2pri_cfg_output {
16108         /* The specific error status for the command. */
16109         uint16_t        error_code;
16110         /* The HWRM command request type. */
16111         uint16_t        req_type;
16112         /* The sequence ID from the original command. */
16113         uint16_t        seq_id;
16114         /* The length of the response data in number of bytes. */
16115         uint16_t        resp_len;
16116         uint8_t unused_0[7];
16117         /*
16118          * This field is used in Output records to indicate that the output
16119          * is completely written to RAM.  This field should be read as '1'
16120          * to indicate that the output has been completely written.
16121          * When writing a command completion or response to an internal processor,
16122          * the order of writes has to be such that this field is written last.
16123          */
16124         uint8_t valid;
16125 } __attribute__((packed));
16126
16127 /*******************
16128  * hwrm_vnic_alloc *
16129  *******************/
16130
16131
16132 /* hwrm_vnic_alloc_input (size:192b/24B) */
16133 struct hwrm_vnic_alloc_input {
16134         /* The HWRM command request type. */
16135         uint16_t        req_type;
16136         /*
16137          * The completion ring to send the completion event on. This should
16138          * be the NQ ID returned from the `nq_alloc` HWRM command.
16139          */
16140         uint16_t        cmpl_ring;
16141         /*
16142          * The sequence ID is used by the driver for tracking multiple
16143          * commands. This ID is treated as opaque data by the firmware and
16144          * the value is returned in the `hwrm_resp_hdr` upon completion.
16145          */
16146         uint16_t        seq_id;
16147         /*
16148          * The target ID of the command:
16149          * * 0x0-0xFFF8 - The function ID
16150          * * 0xFFF8-0xFFFE - Reserved for internal processors
16151          * * 0xFFFF - HWRM
16152          */
16153         uint16_t        target_id;
16154         /*
16155          * A physical address pointer pointing to a host buffer that the
16156          * command's response data will be written. This can be either a host
16157          * physical address (HPA) or a guest physical address (GPA) and must
16158          * point to a physically contiguous block of memory.
16159          */
16160         uint64_t        resp_addr;
16161         uint32_t        flags;
16162         /*
16163          * When this bit is '1', this VNIC is requested to
16164          * be the default VNIC for this function.
16165          */
16166         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
16167         uint8_t unused_0[4];
16168 } __attribute__((packed));
16169
16170 /* hwrm_vnic_alloc_output (size:128b/16B) */
16171 struct hwrm_vnic_alloc_output {
16172         /* The specific error status for the command. */
16173         uint16_t        error_code;
16174         /* The HWRM command request type. */
16175         uint16_t        req_type;
16176         /* The sequence ID from the original command. */
16177         uint16_t        seq_id;
16178         /* The length of the response data in number of bytes. */
16179         uint16_t        resp_len;
16180         /* Logical vnic ID */
16181         uint32_t        vnic_id;
16182         uint8_t unused_0[3];
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_vnic_free *
16195  ******************/
16196
16197
16198 /* hwrm_vnic_free_input (size:192b/24B) */
16199 struct hwrm_vnic_free_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         /* Logical vnic ID */
16228         uint32_t        vnic_id;
16229         uint8_t unused_0[4];
16230 } __attribute__((packed));
16231
16232 /* hwrm_vnic_free_output (size:128b/16B) */
16233 struct hwrm_vnic_free_output {
16234         /* The specific error status for the command. */
16235         uint16_t        error_code;
16236         /* The HWRM command request type. */
16237         uint16_t        req_type;
16238         /* The sequence ID from the original command. */
16239         uint16_t        seq_id;
16240         /* The length of the response data in number of bytes. */
16241         uint16_t        resp_len;
16242         uint8_t unused_0[7];
16243         /*
16244          * This field is used in Output records to indicate that the output
16245          * is completely written to RAM.  This field should be read as '1'
16246          * to indicate that the output has been completely written.
16247          * When writing a command completion or response to an internal processor,
16248          * the order of writes has to be such that this field is written last.
16249          */
16250         uint8_t valid;
16251 } __attribute__((packed));
16252
16253 /*****************
16254  * hwrm_vnic_cfg *
16255  *****************/
16256
16257
16258 /* hwrm_vnic_cfg_input (size:320b/40B) */
16259 struct hwrm_vnic_cfg_input {
16260         /* The HWRM command request type. */
16261         uint16_t        req_type;
16262         /*
16263          * The completion ring to send the completion event on. This should
16264          * be the NQ ID returned from the `nq_alloc` HWRM command.
16265          */
16266         uint16_t        cmpl_ring;
16267         /*
16268          * The sequence ID is used by the driver for tracking multiple
16269          * commands. This ID is treated as opaque data by the firmware and
16270          * the value is returned in the `hwrm_resp_hdr` upon completion.
16271          */
16272         uint16_t        seq_id;
16273         /*
16274          * The target ID of the command:
16275          * * 0x0-0xFFF8 - The function ID
16276          * * 0xFFF8-0xFFFE - Reserved for internal processors
16277          * * 0xFFFF - HWRM
16278          */
16279         uint16_t        target_id;
16280         /*
16281          * A physical address pointer pointing to a host buffer that the
16282          * command's response data will be written. This can be either a host
16283          * physical address (HPA) or a guest physical address (GPA) and must
16284          * point to a physically contiguous block of memory.
16285          */
16286         uint64_t        resp_addr;
16287         uint32_t        flags;
16288         /*
16289          * When this bit is '1', the VNIC is requested to
16290          * be the default VNIC for the function.
16291          */
16292         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
16293                 UINT32_C(0x1)
16294         /*
16295          * When this bit is '1', the VNIC is being configured to
16296          * strip VLAN in the RX path.
16297          * If set to '0', then VLAN stripping is disabled on
16298          * this VNIC.
16299          */
16300         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
16301                 UINT32_C(0x2)
16302         /*
16303          * When this bit is '1', the VNIC is being configured to
16304          * buffer receive packets in the hardware until the host
16305          * posts new receive buffers.
16306          * If set to '0', then bd_stall is being configured to be
16307          * disabled on this VNIC.
16308          */
16309         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
16310                 UINT32_C(0x4)
16311         /*
16312          * When this bit is '1', the VNIC is being configured to
16313          * receive both RoCE and non-RoCE traffic.
16314          * If set to '0', then this VNIC is not configured to be
16315          * operating in dual VNIC mode.
16316          */
16317         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
16318                 UINT32_C(0x8)
16319         /*
16320          * When this flag is set to '1', the VNIC is requested to
16321          * be configured to receive only RoCE traffic.
16322          * If this flag is set to '0', then this flag shall be
16323          * ignored by the HWRM.
16324          * If roce_dual_vnic_mode flag is set to '1'
16325          * or roce_mirroring_capable_vnic_mode flag to 1,
16326          * then the HWRM client shall not set this flag to '1'.
16327          */
16328         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
16329                 UINT32_C(0x10)
16330         /*
16331          * When a VNIC uses one destination ring group for certain
16332          * application (e.g. Receive Flow Steering) where
16333          * exact match is used to direct packets to a VNIC with one
16334          * destination ring group only, there is no need to configure
16335          * RSS indirection table for that VNIC as only one destination
16336          * ring group is used.
16337          *
16338          * This flag is used to enable a mode where
16339          * RSS is enabled in the VNIC using a RSS context
16340          * for computing RSS hash but the RSS indirection table is
16341          * not configured using hwrm_vnic_rss_cfg.
16342          *
16343          * If this mode is enabled, then the driver should not program
16344          * RSS indirection table for the RSS context that is used for
16345          * computing RSS hash only.
16346          */
16347         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
16348                 UINT32_C(0x20)
16349         /*
16350          * When this bit is '1', the VNIC is being configured to
16351          * receive both RoCE and non-RoCE traffic, but forward only the
16352          * RoCE traffic further. Also, RoCE traffic can be mirrored to
16353          * L2 driver.
16354          */
16355         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
16356                 UINT32_C(0x40)
16357         uint32_t        enables;
16358         /*
16359          * This bit must be '1' for the dflt_ring_grp field to be
16360          * configured.
16361          */
16362         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
16363                 UINT32_C(0x1)
16364         /*
16365          * This bit must be '1' for the rss_rule field to be
16366          * configured.
16367          */
16368         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
16369                 UINT32_C(0x2)
16370         /*
16371          * This bit must be '1' for the cos_rule field to be
16372          * configured.
16373          */
16374         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
16375                 UINT32_C(0x4)
16376         /*
16377          * This bit must be '1' for the lb_rule field to be
16378          * configured.
16379          */
16380         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
16381                 UINT32_C(0x8)
16382         /*
16383          * This bit must be '1' for the mru field to be
16384          * configured.
16385          */
16386         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
16387                 UINT32_C(0x10)
16388         /*
16389          * This bit must be '1' for the default_rx_ring_id field to be
16390          * configured.
16391          */
16392         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
16393                 UINT32_C(0x20)
16394         /*
16395          * This bit must be '1' for the default_cmpl_ring_id field to be
16396          * configured.
16397          */
16398         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
16399                 UINT32_C(0x40)
16400         /* Logical vnic ID */
16401         uint16_t        vnic_id;
16402         /*
16403          * Default Completion ring for the VNIC.  This ring will
16404          * be chosen if packet does not match any RSS rules and if
16405          * there is no COS rule.
16406          */
16407         uint16_t        dflt_ring_grp;
16408         /*
16409          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
16410          * there is no RSS rule.
16411          */
16412         uint16_t        rss_rule;
16413         /*
16414          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
16415          * there is no COS rule.
16416          */
16417         uint16_t        cos_rule;
16418         /*
16419          * RSS ID for load balancing rule/table structure.
16420          * 0xFF... (All Fs) if there is no LB rule.
16421          */
16422         uint16_t        lb_rule;
16423         /*
16424          * The maximum receive unit of the vnic.
16425          * Each vnic is associated with a function.
16426          * The vnic mru value overwrites the mru setting of the
16427          * associated function.
16428          * The HWRM shall make sure that vnic mru does not exceed
16429          * the mru of the port the function is associated with.
16430          */
16431         uint16_t        mru;
16432         /*
16433          * Default Rx ring for the VNIC.  This ring will
16434          * be chosen if packet does not match any RSS rules.
16435          * The aggregation ring associated with the Rx ring is
16436          * implied based on the Rx ring specified when the
16437          * aggregation ring was allocated.
16438          */
16439         uint16_t        default_rx_ring_id;
16440         /*
16441          * Default completion ring for the VNIC.  This ring will
16442          * be chosen if packet does not match any RSS rules.
16443          */
16444         uint16_t        default_cmpl_ring_id;
16445 } __attribute__((packed));
16446
16447 /* hwrm_vnic_cfg_output (size:128b/16B) */
16448 struct hwrm_vnic_cfg_output {
16449         /* The specific error status for the command. */
16450         uint16_t        error_code;
16451         /* The HWRM command request type. */
16452         uint16_t        req_type;
16453         /* The sequence ID from the original command. */
16454         uint16_t        seq_id;
16455         /* The length of the response data in number of bytes. */
16456         uint16_t        resp_len;
16457         uint8_t unused_0[7];
16458         /*
16459          * This field is used in Output records to indicate that the output
16460          * is completely written to RAM.  This field should be read as '1'
16461          * to indicate that the output has been completely written.
16462          * When writing a command completion or response to an internal processor,
16463          * the order of writes has to be such that this field is written last.
16464          */
16465         uint8_t valid;
16466 } __attribute__((packed));
16467
16468 /******************
16469  * hwrm_vnic_qcfg *
16470  ******************/
16471
16472
16473 /* hwrm_vnic_qcfg_input (size:256b/32B) */
16474 struct hwrm_vnic_qcfg_input {
16475         /* The HWRM command request type. */
16476         uint16_t        req_type;
16477         /*
16478          * The completion ring to send the completion event on. This should
16479          * be the NQ ID returned from the `nq_alloc` HWRM command.
16480          */
16481         uint16_t        cmpl_ring;
16482         /*
16483          * The sequence ID is used by the driver for tracking multiple
16484          * commands. This ID is treated as opaque data by the firmware and
16485          * the value is returned in the `hwrm_resp_hdr` upon completion.
16486          */
16487         uint16_t        seq_id;
16488         /*
16489          * The target ID of the command:
16490          * * 0x0-0xFFF8 - The function ID
16491          * * 0xFFF8-0xFFFE - Reserved for internal processors
16492          * * 0xFFFF - HWRM
16493          */
16494         uint16_t        target_id;
16495         /*
16496          * A physical address pointer pointing to a host buffer that the
16497          * command's response data will be written. This can be either a host
16498          * physical address (HPA) or a guest physical address (GPA) and must
16499          * point to a physically contiguous block of memory.
16500          */
16501         uint64_t        resp_addr;
16502         uint32_t        enables;
16503         /*
16504          * This bit must be '1' for the vf_id_valid field to be
16505          * configured.
16506          */
16507         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
16508         /* Logical vnic ID */
16509         uint32_t        vnic_id;
16510         /* ID of Virtual Function whose VNIC resource is being queried. */
16511         uint16_t        vf_id;
16512         uint8_t unused_0[6];
16513 } __attribute__((packed));
16514
16515 /* hwrm_vnic_qcfg_output (size:256b/32B) */
16516 struct hwrm_vnic_qcfg_output {
16517         /* The specific error status for the command. */
16518         uint16_t        error_code;
16519         /* The HWRM command request type. */
16520         uint16_t        req_type;
16521         /* The sequence ID from the original command. */
16522         uint16_t        seq_id;
16523         /* The length of the response data in number of bytes. */
16524         uint16_t        resp_len;
16525         /* Default Completion ring for the VNIC. */
16526         uint16_t        dflt_ring_grp;
16527         /*
16528          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
16529          * there is no RSS rule.
16530          */
16531         uint16_t        rss_rule;
16532         /*
16533          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
16534          * there is no COS rule.
16535          */
16536         uint16_t        cos_rule;
16537         /*
16538          * RSS ID for load balancing rule/table structure.
16539          * 0xFF... (All Fs) if there is no LB rule.
16540          */
16541         uint16_t        lb_rule;
16542         /* The maximum receive unit of the vnic. */
16543         uint16_t        mru;
16544         uint8_t unused_0[2];
16545         uint32_t        flags;
16546         /*
16547          * When this bit is '1', the VNIC is the default VNIC for
16548          * the function.
16549          */
16550         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
16551                 UINT32_C(0x1)
16552         /*
16553          * When this bit is '1', the VNIC is configured to
16554          * strip VLAN in the RX path.
16555          * If set to '0', then VLAN stripping is disabled on
16556          * this VNIC.
16557          */
16558         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
16559                 UINT32_C(0x2)
16560         /*
16561          * When this bit is '1', the VNIC is configured to
16562          * buffer receive packets in the hardware until the host
16563          * posts new receive buffers.
16564          * If set to '0', then bd_stall is disabled on
16565          * this VNIC.
16566          */
16567         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
16568                 UINT32_C(0x4)
16569         /*
16570          * When this bit is '1', the VNIC is configured to
16571          * receive both RoCE and non-RoCE traffic.
16572          * If set to '0', then this VNIC is not configured to
16573          * operate in dual VNIC mode.
16574          */
16575         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
16576                 UINT32_C(0x8)
16577         /*
16578          * When this flag is set to '1', the VNIC is configured to
16579          * receive only RoCE traffic.
16580          * When this flag is set to '0', the VNIC is not configured
16581          * to receive only RoCE traffic.
16582          * If roce_dual_vnic_mode flag and this flag both are set
16583          * to '1', then it is an invalid configuration of the
16584          * VNIC. The HWRM should not allow that type of
16585          * mis-configuration by HWRM clients.
16586          */
16587         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
16588                 UINT32_C(0x10)
16589         /*
16590          * When a VNIC uses one destination ring group for certain
16591          * application (e.g. Receive Flow Steering) where
16592          * exact match is used to direct packets to a VNIC with one
16593          * destination ring group only, there is no need to configure
16594          * RSS indirection table for that VNIC as only one destination
16595          * ring group is used.
16596          *
16597          * When this bit is set to '1', then the VNIC is enabled in a
16598          * mode where RSS is enabled in the VNIC using a RSS context
16599          * for computing RSS hash but the RSS indirection table is
16600          * not configured.
16601          */
16602         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
16603                 UINT32_C(0x20)
16604         /*
16605          * When this bit is '1', the VNIC is configured to
16606          * receive both RoCE and non-RoCE traffic, but forward only
16607          * RoCE traffic further. Also RoCE traffic can be mirrored to
16608          * L2 driver.
16609          */
16610         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
16611                 UINT32_C(0x40)
16612         uint8_t unused_1[7];
16613         /*
16614          * This field is used in Output records to indicate that the output
16615          * is completely written to RAM.  This field should be read as '1'
16616          * to indicate that the output has been completely written.
16617          * When writing a command completion or response to an internal processor,
16618          * the order of writes has to be such that this field is written last.
16619          */
16620         uint8_t valid;
16621 } __attribute__((packed));
16622
16623 /*******************
16624  * hwrm_vnic_qcaps *
16625  *******************/
16626
16627
16628 /* hwrm_vnic_qcaps_input (size:192b/24B) */
16629 struct hwrm_vnic_qcaps_input {
16630         /* The HWRM command request type. */
16631         uint16_t        req_type;
16632         /*
16633          * The completion ring to send the completion event on. This should
16634          * be the NQ ID returned from the `nq_alloc` HWRM command.
16635          */
16636         uint16_t        cmpl_ring;
16637         /*
16638          * The sequence ID is used by the driver for tracking multiple
16639          * commands. This ID is treated as opaque data by the firmware and
16640          * the value is returned in the `hwrm_resp_hdr` upon completion.
16641          */
16642         uint16_t        seq_id;
16643         /*
16644          * The target ID of the command:
16645          * * 0x0-0xFFF8 - The function ID
16646          * * 0xFFF8-0xFFFE - Reserved for internal processors
16647          * * 0xFFFF - HWRM
16648          */
16649         uint16_t        target_id;
16650         /*
16651          * A physical address pointer pointing to a host buffer that the
16652          * command's response data will be written. This can be either a host
16653          * physical address (HPA) or a guest physical address (GPA) and must
16654          * point to a physically contiguous block of memory.
16655          */
16656         uint64_t        resp_addr;
16657         uint32_t        enables;
16658         uint8_t unused_0[4];
16659 } __attribute__((packed));
16660
16661 /* hwrm_vnic_qcaps_output (size:192b/24B) */
16662 struct hwrm_vnic_qcaps_output {
16663         /* The specific error status for the command. */
16664         uint16_t        error_code;
16665         /* The HWRM command request type. */
16666         uint16_t        req_type;
16667         /* The sequence ID from the original command. */
16668         uint16_t        seq_id;
16669         /* The length of the response data in number of bytes. */
16670         uint16_t        resp_len;
16671         /* The maximum receive unit that is settable on a vnic. */
16672         uint16_t        mru;
16673         uint8_t unused_0[2];
16674         uint32_t        flags;
16675         /* Unused. */
16676         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
16677                 UINT32_C(0x1)
16678         /*
16679          * When this bit is '1', the capability of stripping VLAN in
16680          * the RX path is supported on VNIC(s).
16681          * If set to '0', then VLAN stripping capability is
16682          * not supported on VNIC(s).
16683          */
16684         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
16685                 UINT32_C(0x2)
16686         /*
16687          * When this bit is '1', the capability to buffer receive
16688          * packets in the hardware until the host posts new receive buffers
16689          * is supported on VNIC(s).
16690          * If set to '0', then bd_stall capability is not supported
16691          * on VNIC(s).
16692          */
16693         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
16694                 UINT32_C(0x4)
16695         /*
16696          * When this bit is '1', the capability to
16697          * receive both RoCE and non-RoCE traffic on VNIC(s) is
16698          * supported.
16699          * If set to '0', then the capability to receive
16700          * both RoCE and non-RoCE traffic on VNIC(s) is
16701          * not supported.
16702          */
16703         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
16704                 UINT32_C(0x8)
16705         /*
16706          * When this bit is set to '1', the capability to configure
16707          * a VNIC to receive only RoCE traffic is supported.
16708          * When this flag is set to '0', the VNIC capability to
16709          * configure to receive only RoCE traffic is not supported.
16710          */
16711         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
16712                 UINT32_C(0x10)
16713         /*
16714          * When this bit is set to '1', then the capability to enable
16715          * a VNIC in a mode where RSS context without configuring
16716          * RSS indirection table is supported (for RSS hash computation).
16717          * When this bit is set to '0', then a VNIC can not be configured
16718          * with a mode to enable RSS context without configuring RSS
16719          * indirection table.
16720          */
16721         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
16722                 UINT32_C(0x20)
16723         /*
16724          * When this bit is '1', the capability to
16725          * mirror the the RoCE traffic is supported.
16726          * If set to '0', then the capability to mirror the
16727          * RoCE traffic is not supported.
16728          */
16729         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
16730                 UINT32_C(0x40)
16731         /*
16732          * When this bit is '1', the outermost RSS hashing capability
16733          * is supported. If set to '0', then the outermost RSS hashing
16734          * capability is not supported.
16735          */
16736         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
16737                 UINT32_C(0x80)
16738         uint8_t unused_1[7];
16739         /*
16740          * This field is used in Output records to indicate that the output
16741          * is completely written to RAM.  This field should be read as '1'
16742          * to indicate that the output has been completely written.
16743          * When writing a command completion or response to an internal processor,
16744          * the order of writes has to be such that this field is written last.
16745          */
16746         uint8_t valid;
16747 } __attribute__((packed));
16748
16749 /*********************
16750  * hwrm_vnic_tpa_cfg *
16751  *********************/
16752
16753
16754 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
16755 struct hwrm_vnic_tpa_cfg_input {
16756         /* The HWRM command request type. */
16757         uint16_t        req_type;
16758         /*
16759          * The completion ring to send the completion event on. This should
16760          * be the NQ ID returned from the `nq_alloc` HWRM command.
16761          */
16762         uint16_t        cmpl_ring;
16763         /*
16764          * The sequence ID is used by the driver for tracking multiple
16765          * commands. This ID is treated as opaque data by the firmware and
16766          * the value is returned in the `hwrm_resp_hdr` upon completion.
16767          */
16768         uint16_t        seq_id;
16769         /*
16770          * The target ID of the command:
16771          * * 0x0-0xFFF8 - The function ID
16772          * * 0xFFF8-0xFFFE - Reserved for internal processors
16773          * * 0xFFFF - HWRM
16774          */
16775         uint16_t        target_id;
16776         /*
16777          * A physical address pointer pointing to a host buffer that the
16778          * command's response data will be written. This can be either a host
16779          * physical address (HPA) or a guest physical address (GPA) and must
16780          * point to a physically contiguous block of memory.
16781          */
16782         uint64_t        resp_addr;
16783         uint32_t        flags;
16784         /*
16785          * When this bit is '1', the VNIC shall be configured to
16786          * perform transparent packet aggregation (TPA) of
16787          * non-tunneled TCP packets.
16788          */
16789         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
16790                 UINT32_C(0x1)
16791         /*
16792          * When this bit is '1', the VNIC shall be configured to
16793          * perform transparent packet aggregation (TPA) of
16794          * tunneled TCP packets.
16795          */
16796         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
16797                 UINT32_C(0x2)
16798         /*
16799          * When this bit is '1', the VNIC shall be configured to
16800          * perform transparent packet aggregation (TPA) according
16801          * to Windows Receive Segment Coalescing (RSC) rules.
16802          */
16803         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
16804                 UINT32_C(0x4)
16805         /*
16806          * When this bit is '1', the VNIC shall be configured to
16807          * perform transparent packet aggregation (TPA) according
16808          * to Linux Generic Receive Offload (GRO) rules.
16809          */
16810         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
16811                 UINT32_C(0x8)
16812         /*
16813          * When this bit is '1', the VNIC shall be configured to
16814          * perform transparent packet aggregation (TPA) for TCP
16815          * packets with IP ECN set to non-zero.
16816          */
16817         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
16818                 UINT32_C(0x10)
16819         /*
16820          * When this bit is '1', the VNIC shall be configured to
16821          * perform transparent packet aggregation (TPA) for
16822          * GRE tunneled TCP packets only if all packets have the
16823          * same GRE sequence.
16824          */
16825         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
16826                 UINT32_C(0x20)
16827         /*
16828          * When this bit is '1' and the GRO mode is enabled,
16829          * the VNIC shall be configured to
16830          * perform transparent packet aggregation (TPA) for
16831          * TCP/IPv4 packets with consecutively increasing IPIDs.
16832          * In other words, the last packet that is being
16833          * aggregated to an already existing aggregation context
16834          * shall have IPID 1 more than the IPID of the last packet
16835          * that was aggregated in that aggregation context.
16836          */
16837         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
16838                 UINT32_C(0x40)
16839         /*
16840          * When this bit is '1' and the GRO mode is enabled,
16841          * the VNIC shall be configured to
16842          * perform transparent packet aggregation (TPA) for
16843          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
16844          * value.
16845          */
16846         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
16847                 UINT32_C(0x80)
16848         uint32_t        enables;
16849         /*
16850          * This bit must be '1' for the max_agg_segs field to be
16851          * configured.
16852          */
16853         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
16854         /*
16855          * This bit must be '1' for the max_aggs field to be
16856          * configured.
16857          */
16858         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
16859         /*
16860          * This bit must be '1' for the max_agg_timer field to be
16861          * configured.
16862          */
16863         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
16864         /*
16865          * This bit must be '1' for the min_agg_len field to be
16866          * configured.
16867          */
16868         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
16869         /* Logical vnic ID */
16870         uint16_t        vnic_id;
16871         /*
16872          * This is the maximum number of TCP segments that can
16873          * be aggregated (unit is Log2). Max value is 31.
16874          */
16875         uint16_t        max_agg_segs;
16876         /* 1 segment */
16877         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
16878         /* 2 segments */
16879         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
16880         /* 4 segments */
16881         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
16882         /* 8 segments */
16883         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
16884         /* Any segment size larger than this is not valid */
16885         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
16886         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
16887                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
16888         /*
16889          * This is the maximum number of aggregations this VNIC is
16890          * allowed (unit is Log2). Max value is 7
16891          */
16892         uint16_t        max_aggs;
16893         /* 1 aggregation */
16894         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
16895         /* 2 aggregations */
16896         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
16897         /* 4 aggregations */
16898         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
16899         /* 8 aggregations */
16900         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
16901         /* 16 aggregations */
16902         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
16903         /* Any aggregation size larger than this is not valid */
16904         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
16905         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
16906                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
16907         uint8_t unused_0[2];
16908         /*
16909          * This is the maximum amount of time allowed for
16910          * an aggregation context to complete after it was initiated.
16911          */
16912         uint32_t        max_agg_timer;
16913         /*
16914          * This is the minimum amount of payload length required to
16915          * start an aggregation context.
16916          */
16917         uint32_t        min_agg_len;
16918 } __attribute__((packed));
16919
16920 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
16921 struct hwrm_vnic_tpa_cfg_output {
16922         /* The specific error status for the command. */
16923         uint16_t        error_code;
16924         /* The HWRM command request type. */
16925         uint16_t        req_type;
16926         /* The sequence ID from the original command. */
16927         uint16_t        seq_id;
16928         /* The length of the response data in number of bytes. */
16929         uint16_t        resp_len;
16930         uint8_t unused_0[7];
16931         /*
16932          * This field is used in Output records to indicate that the output
16933          * is completely written to RAM.  This field should be read as '1'
16934          * to indicate that the output has been completely written.
16935          * When writing a command completion or response to an internal processor,
16936          * the order of writes has to be such that this field is written last.
16937          */
16938         uint8_t valid;
16939 } __attribute__((packed));
16940
16941 /**********************
16942  * hwrm_vnic_tpa_qcfg *
16943  **********************/
16944
16945
16946 /* hwrm_vnic_tpa_qcfg_input (size:192b/24B) */
16947 struct hwrm_vnic_tpa_qcfg_input {
16948         /* The HWRM command request type. */
16949         uint16_t        req_type;
16950         /*
16951          * The completion ring to send the completion event on. This should
16952          * be the NQ ID returned from the `nq_alloc` HWRM command.
16953          */
16954         uint16_t        cmpl_ring;
16955         /*
16956          * The sequence ID is used by the driver for tracking multiple
16957          * commands. This ID is treated as opaque data by the firmware and
16958          * the value is returned in the `hwrm_resp_hdr` upon completion.
16959          */
16960         uint16_t        seq_id;
16961         /*
16962          * The target ID of the command:
16963          * * 0x0-0xFFF8 - The function ID
16964          * * 0xFFF8-0xFFFE - Reserved for internal processors
16965          * * 0xFFFF - HWRM
16966          */
16967         uint16_t        target_id;
16968         /*
16969          * A physical address pointer pointing to a host buffer that the
16970          * command's response data will be written. This can be either a host
16971          * physical address (HPA) or a guest physical address (GPA) and must
16972          * point to a physically contiguous block of memory.
16973          */
16974         uint64_t        resp_addr;
16975         /* Logical vnic ID */
16976         uint16_t        vnic_id;
16977         uint8_t unused_0[6];
16978 } __attribute__((packed));
16979
16980 /* hwrm_vnic_tpa_qcfg_output (size:256b/32B) */
16981 struct hwrm_vnic_tpa_qcfg_output {
16982         /* The specific error status for the command. */
16983         uint16_t        error_code;
16984         /* The HWRM command request type. */
16985         uint16_t        req_type;
16986         /* The sequence ID from the original command. */
16987         uint16_t        seq_id;
16988         /* The length of the response data in number of bytes. */
16989         uint16_t        resp_len;
16990         uint32_t        flags;
16991         /*
16992          * When this bit is '1', the VNIC is configured to
16993          * perform transparent packet aggregation (TPA) of
16994          * non-tunneled TCP packets.
16995          */
16996         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_TPA \
16997                 UINT32_C(0x1)
16998         /*
16999          * When this bit is '1', the VNIC is configured to
17000          * perform transparent packet aggregation (TPA) of
17001          * tunneled TCP packets.
17002          */
17003         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_ENCAP_TPA \
17004                 UINT32_C(0x2)
17005         /*
17006          * When this bit is '1', the VNIC is configured to
17007          * perform transparent packet aggregation (TPA) according
17008          * to Windows Receive Segment Coalescing (RSC) rules.
17009          */
17010         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_RSC_WND_UPDATE \
17011                 UINT32_C(0x4)
17012         /*
17013          * When this bit is '1', the VNIC is configured to
17014          * perform transparent packet aggregation (TPA) according
17015          * to Linux Generic Receive Offload (GRO) rules.
17016          */
17017         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO \
17018                 UINT32_C(0x8)
17019         /*
17020          * When this bit is '1', the VNIC is configured to
17021          * perform transparent packet aggregation (TPA) for TCP
17022          * packets with IP ECN set to non-zero.
17023          */
17024         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_ECN \
17025                 UINT32_C(0x10)
17026         /*
17027          * When this bit is '1', the VNIC is configured to
17028          * perform transparent packet aggregation (TPA) for
17029          * GRE tunneled TCP packets only if all packets have the
17030          * same GRE sequence.
17031          */
17032         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
17033                 UINT32_C(0x20)
17034         /*
17035          * When this bit is '1' and the GRO mode is enabled,
17036          * the VNIC is configured to
17037          * perform transparent packet aggregation (TPA) for
17038          * TCP/IPv4 packets with consecutively increasing IPIDs.
17039          * In other words, the last packet that is being
17040          * aggregated to an already existing aggregation context
17041          * shall have IPID 1 more than the IPID of the last packet
17042          * that was aggregated in that aggregation context.
17043          */
17044         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_IPID_CHECK \
17045                 UINT32_C(0x40)
17046         /*
17047          * When this bit is '1' and the GRO mode is enabled,
17048          * the VNIC is configured to
17049          * perform transparent packet aggregation (TPA) for
17050          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
17051          * value.
17052          */
17053         #define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_TTL_CHECK \
17054                 UINT32_C(0x80)
17055         /*
17056          * This is the maximum number of TCP segments that can
17057          * be aggregated (unit is Log2). Max value is 31.
17058          */
17059         uint16_t        max_agg_segs;
17060         /* 1 segment */
17061         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
17062         /* 2 segments */
17063         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
17064         /* 4 segments */
17065         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
17066         /* 8 segments */
17067         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
17068         /* Any segment size larger than this is not valid */
17069         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
17070         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_LAST \
17071                 HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX
17072         /*
17073          * This is the maximum number of aggregations this VNIC is
17074          * allowed (unit is Log2). Max value is 7
17075          */
17076         uint16_t        max_aggs;
17077         /* 1 aggregation */
17078         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_1   UINT32_C(0x0)
17079         /* 2 aggregations */
17080         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_2   UINT32_C(0x1)
17081         /* 4 aggregations */
17082         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_4   UINT32_C(0x2)
17083         /* 8 aggregations */
17084         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_8   UINT32_C(0x3)
17085         /* 16 aggregations */
17086         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_16  UINT32_C(0x4)
17087         /* Any aggregation size larger than this is not valid */
17088         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX UINT32_C(0x7)
17089         #define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_LAST \
17090                 HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX
17091         /*
17092          * This is the maximum amount of time allowed for
17093          * an aggregation context to complete after it was initiated.
17094          */
17095         uint32_t        max_agg_timer;
17096         /*
17097          * This is the minimum amount of payload length required to
17098          * start an aggregation context.
17099          */
17100         uint32_t        min_agg_len;
17101         uint8_t unused_0[7];
17102         /*
17103          * This field is used in Output records to indicate that the output
17104          * is completely written to RAM.  This field should be read as '1'
17105          * to indicate that the output has been completely written.
17106          * When writing a command completion or response to an internal processor,
17107          * the order of writes has to be such that this field is written last.
17108          */
17109         uint8_t valid;
17110 } __attribute__((packed));
17111
17112 /*********************
17113  * hwrm_vnic_rss_cfg *
17114  *********************/
17115
17116
17117 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
17118 struct hwrm_vnic_rss_cfg_input {
17119         /* The HWRM command request type. */
17120         uint16_t        req_type;
17121         /*
17122          * The completion ring to send the completion event on. This should
17123          * be the NQ ID returned from the `nq_alloc` HWRM command.
17124          */
17125         uint16_t        cmpl_ring;
17126         /*
17127          * The sequence ID is used by the driver for tracking multiple
17128          * commands. This ID is treated as opaque data by the firmware and
17129          * the value is returned in the `hwrm_resp_hdr` upon completion.
17130          */
17131         uint16_t        seq_id;
17132         /*
17133          * The target ID of the command:
17134          * * 0x0-0xFFF8 - The function ID
17135          * * 0xFFF8-0xFFFE - Reserved for internal processors
17136          * * 0xFFFF - HWRM
17137          */
17138         uint16_t        target_id;
17139         /*
17140          * A physical address pointer pointing to a host buffer that the
17141          * command's response data will be written. This can be either a host
17142          * physical address (HPA) or a guest physical address (GPA) and must
17143          * point to a physically contiguous block of memory.
17144          */
17145         uint64_t        resp_addr;
17146         uint32_t        hash_type;
17147         /*
17148          * When this bit is '1', the RSS hash shall be computed
17149          * over source and destination IPv4 addresses of IPv4
17150          * packets.
17151          */
17152         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
17153         /*
17154          * When this bit is '1', the RSS hash shall be computed
17155          * over source/destination IPv4 addresses and
17156          * source/destination ports of TCP/IPv4 packets.
17157          */
17158         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
17159         /*
17160          * When this bit is '1', the RSS hash shall be computed
17161          * over source/destination IPv4 addresses and
17162          * source/destination ports of UDP/IPv4 packets.
17163          */
17164         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
17165         /*
17166          * When this bit is '1', the RSS hash shall be computed
17167          * over source and destination IPv4 addresses of IPv6
17168          * packets.
17169          */
17170         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
17171         /*
17172          * When this bit is '1', the RSS hash shall be computed
17173          * over source/destination IPv6 addresses and
17174          * source/destination ports of TCP/IPv6 packets.
17175          */
17176         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
17177         /*
17178          * When this bit is '1', the RSS hash shall be computed
17179          * over source/destination IPv6 addresses and
17180          * source/destination ports of UDP/IPv6 packets.
17181          */
17182         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
17183         /* VNIC ID of VNIC associated with RSS table being configured. */
17184         uint16_t        vnic_id;
17185         /*
17186          * Specifies which VNIC ring table pair to configure.
17187          * Valid values range from 0 to 7.
17188          */
17189         uint8_t ring_table_pair_index;
17190         /* Flags to specify different RSS hash modes. */
17191         uint8_t hash_mode_flags;
17192         /*
17193          * When this bit is '1', it indicates using current RSS
17194          * hash mode setting configured in the device.
17195          */
17196         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
17197                 UINT32_C(0x1)
17198         /*
17199          * When this bit is '1', it indicates requesting support of
17200          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
17201          * l4.src, l4.dest} for tunnel packets. For none-tunnel
17202          * packets, the RSS hash is computed over the normal
17203          * src/dest l3 and src/dest l4 headers.
17204          */
17205         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
17206                 UINT32_C(0x2)
17207         /*
17208          * When this bit is '1', it indicates requesting support of
17209          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
17210          * tunnel packets. For none-tunnel packets, the RSS hash is
17211          * computed over the normal src/dest l3 headers.
17212          */
17213         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
17214                 UINT32_C(0x4)
17215         /*
17216          * When this bit is '1', it indicates requesting support of
17217          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
17218          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
17219          * packets, the RSS hash is computed over the normal
17220          * src/dest l3 and src/dest l4 headers.
17221          */
17222         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
17223                 UINT32_C(0x8)
17224         /*
17225          * When this bit is '1', it indicates requesting support of
17226          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
17227          * tunnel packets. For none-tunnel packets, the RSS hash is
17228          * computed over the normal src/dest l3 headers.
17229          */
17230         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
17231                 UINT32_C(0x10)
17232         /* This is the address for rss ring group table */
17233         uint64_t        ring_grp_tbl_addr;
17234         /* This is the address for rss hash key table */
17235         uint64_t        hash_key_tbl_addr;
17236         /* Index to the rss indirection table. */
17237         uint16_t        rss_ctx_idx;
17238         uint8_t unused_1[6];
17239 } __attribute__((packed));
17240
17241 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
17242 struct hwrm_vnic_rss_cfg_output {
17243         /* The specific error status for the command. */
17244         uint16_t        error_code;
17245         /* The HWRM command request type. */
17246         uint16_t        req_type;
17247         /* The sequence ID from the original command. */
17248         uint16_t        seq_id;
17249         /* The length of the response data in number of bytes. */
17250         uint16_t        resp_len;
17251         uint8_t unused_0[7];
17252         /*
17253          * This field is used in Output records to indicate that the output
17254          * is completely written to RAM.  This field should be read as '1'
17255          * to indicate that the output has been completely written.
17256          * When writing a command completion or response to an internal processor,
17257          * the order of writes has to be such that this field is written last.
17258          */
17259         uint8_t valid;
17260 } __attribute__((packed));
17261
17262 /**********************
17263  * hwrm_vnic_rss_qcfg *
17264  **********************/
17265
17266
17267 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
17268 struct hwrm_vnic_rss_qcfg_input {
17269         /* The HWRM command request type. */
17270         uint16_t        req_type;
17271         /*
17272          * The completion ring to send the completion event on. This should
17273          * be the NQ ID returned from the `nq_alloc` HWRM command.
17274          */
17275         uint16_t        cmpl_ring;
17276         /*
17277          * The sequence ID is used by the driver for tracking multiple
17278          * commands. This ID is treated as opaque data by the firmware and
17279          * the value is returned in the `hwrm_resp_hdr` upon completion.
17280          */
17281         uint16_t        seq_id;
17282         /*
17283          * The target ID of the command:
17284          * * 0x0-0xFFF8 - The function ID
17285          * * 0xFFF8-0xFFFE - Reserved for internal processors
17286          * * 0xFFFF - HWRM
17287          */
17288         uint16_t        target_id;
17289         /*
17290          * A physical address pointer pointing to a host buffer that the
17291          * command's response data will be written. This can be either a host
17292          * physical address (HPA) or a guest physical address (GPA) and must
17293          * point to a physically contiguous block of memory.
17294          */
17295         uint64_t        resp_addr;
17296         /* Index to the rss indirection table. */
17297         uint16_t        rss_ctx_idx;
17298         uint8_t unused_0[6];
17299 } __attribute__((packed));
17300
17301 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
17302 struct hwrm_vnic_rss_qcfg_output {
17303         /* The specific error status for the command. */
17304         uint16_t        error_code;
17305         /* The HWRM command request type. */
17306         uint16_t        req_type;
17307         /* The sequence ID from the original command. */
17308         uint16_t        seq_id;
17309         /* The length of the response data in number of bytes. */
17310         uint16_t        resp_len;
17311         uint32_t        hash_type;
17312         /*
17313          * When this bit is '1', the RSS hash shall be computed
17314          * over source and destination IPv4 addresses of IPv4
17315          * packets.
17316          */
17317         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
17318         /*
17319          * When this bit is '1', the RSS hash shall be computed
17320          * over source/destination IPv4 addresses and
17321          * source/destination ports of TCP/IPv4 packets.
17322          */
17323         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
17324         /*
17325          * When this bit is '1', the RSS hash shall be computed
17326          * over source/destination IPv4 addresses and
17327          * source/destination ports of UDP/IPv4 packets.
17328          */
17329         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
17330         /*
17331          * When this bit is '1', the RSS hash shall be computed
17332          * over source and destination IPv4 addresses of IPv6
17333          * packets.
17334          */
17335         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
17336         /*
17337          * When this bit is '1', the RSS hash shall be computed
17338          * over source/destination IPv6 addresses and
17339          * source/destination ports of TCP/IPv6 packets.
17340          */
17341         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
17342         /*
17343          * When this bit is '1', the RSS hash shall be computed
17344          * over source/destination IPv6 addresses and
17345          * source/destination ports of UDP/IPv6 packets.
17346          */
17347         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
17348         uint8_t unused_0[4];
17349         /* This is the value of rss hash key */
17350         uint32_t        hash_key[10];
17351         /* Flags to specify different RSS hash modes. */
17352         uint8_t hash_mode_flags;
17353         /*
17354          * When this bit is '1', it indicates using current RSS
17355          * hash mode setting configured in the device.
17356          */
17357         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
17358                 UINT32_C(0x1)
17359         /*
17360          * When this bit is '1', it indicates requesting support of
17361          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
17362          * l4.src, l4.dest} for tunnel packets. For none-tunnel
17363          * packets, the RSS hash is computed over the normal
17364          * src/dest l3 and src/dest l4 headers.
17365          */
17366         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
17367                 UINT32_C(0x2)
17368         /*
17369          * When this bit is '1', it indicates requesting support of
17370          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
17371          * tunnel packets. For none-tunnel packets, the RSS hash is
17372          * computed over the normal src/dest l3 headers.
17373          */
17374         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
17375                 UINT32_C(0x4)
17376         /*
17377          * When this bit is '1', it indicates requesting support of
17378          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
17379          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
17380          * packets, the RSS hash is computed over the normal
17381          * src/dest l3 and src/dest l4 headers.
17382          */
17383         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
17384                 UINT32_C(0x8)
17385         /*
17386          * When this bit is '1', it indicates requesting support of
17387          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
17388          * tunnel packets. For none-tunnel packets, the RSS hash is
17389          * computed over the normal src/dest l3 headers.
17390          */
17391         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
17392                 UINT32_C(0x10)
17393         uint8_t unused_1[6];
17394         /*
17395          * This field is used in Output records to indicate that the output
17396          * is completely written to RAM.  This field should be read as '1'
17397          * to indicate that the output has been completely written.
17398          * When writing a command completion or response to an internal processor,
17399          * the order of writes has to be such that this field is written last.
17400          */
17401         uint8_t valid;
17402 } __attribute__((packed));
17403
17404 /**************************
17405  * hwrm_vnic_plcmodes_cfg *
17406  **************************/
17407
17408
17409 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
17410 struct hwrm_vnic_plcmodes_cfg_input {
17411         /* The HWRM command request type. */
17412         uint16_t        req_type;
17413         /*
17414          * The completion ring to send the completion event on. This should
17415          * be the NQ ID returned from the `nq_alloc` HWRM command.
17416          */
17417         uint16_t        cmpl_ring;
17418         /*
17419          * The sequence ID is used by the driver for tracking multiple
17420          * commands. This ID is treated as opaque data by the firmware and
17421          * the value is returned in the `hwrm_resp_hdr` upon completion.
17422          */
17423         uint16_t        seq_id;
17424         /*
17425          * The target ID of the command:
17426          * * 0x0-0xFFF8 - The function ID
17427          * * 0xFFF8-0xFFFE - Reserved for internal processors
17428          * * 0xFFFF - HWRM
17429          */
17430         uint16_t        target_id;
17431         /*
17432          * A physical address pointer pointing to a host buffer that the
17433          * command's response data will be written. This can be either a host
17434          * physical address (HPA) or a guest physical address (GPA) and must
17435          * point to a physically contiguous block of memory.
17436          */
17437         uint64_t        resp_addr;
17438         uint32_t        flags;
17439         /*
17440          * When this bit is '1', the VNIC shall be configured to
17441          * use regular placement algorithm.
17442          * By default, the regular placement algorithm shall be
17443          * enabled on the VNIC.
17444          */
17445         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
17446                 UINT32_C(0x1)
17447         /*
17448          * When this bit is '1', the VNIC shall be configured
17449          * use the jumbo placement algorithm.
17450          */
17451         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
17452                 UINT32_C(0x2)
17453         /*
17454          * When this bit is '1', the VNIC shall be configured
17455          * to enable Header-Data split for IPv4 packets according
17456          * to the following rules:
17457          * # If the packet is identified as TCP/IPv4, then the
17458          * packet is split at the beginning of the TCP payload.
17459          * # If the packet is identified as UDP/IPv4, then the
17460          * packet is split at the beginning of UDP payload.
17461          * # If the packet is identified as non-TCP and non-UDP
17462          * IPv4 packet, then the packet is split at the beginning
17463          * of the upper layer protocol header carried in the IPv4
17464          * packet.
17465          */
17466         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
17467                 UINT32_C(0x4)
17468         /*
17469          * When this bit is '1', the VNIC shall be configured
17470          * to enable Header-Data split for IPv6 packets according
17471          * to the following rules:
17472          * # If the packet is identified as TCP/IPv6, then the
17473          * packet is split at the beginning of the TCP payload.
17474          * # If the packet is identified as UDP/IPv6, then the
17475          * packet is split at the beginning of UDP payload.
17476          * # If the packet is identified as non-TCP and non-UDP
17477          * IPv6 packet, then the packet is split at the beginning
17478          * of the upper layer protocol header carried in the IPv6
17479          * packet.
17480          */
17481         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
17482                 UINT32_C(0x8)
17483         /*
17484          * When this bit is '1', the VNIC shall be configured
17485          * to enable Header-Data split for FCoE packets at the
17486          * beginning of FC payload.
17487          */
17488         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
17489                 UINT32_C(0x10)
17490         /*
17491          * When this bit is '1', the VNIC shall be configured
17492          * to enable Header-Data split for RoCE packets at the
17493          * beginning of RoCE payload (after BTH/GRH headers).
17494          */
17495         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
17496                 UINT32_C(0x20)
17497         uint32_t        enables;
17498         /*
17499          * This bit must be '1' for the jumbo_thresh_valid field to be
17500          * configured.
17501          */
17502         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
17503                 UINT32_C(0x1)
17504         /*
17505          * This bit must be '1' for the hds_offset_valid field to be
17506          * configured.
17507          */
17508         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
17509                 UINT32_C(0x2)
17510         /*
17511          * This bit must be '1' for the hds_threshold_valid field to be
17512          * configured.
17513          */
17514         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
17515                 UINT32_C(0x4)
17516         /* Logical vnic ID */
17517         uint32_t        vnic_id;
17518         /*
17519          * When jumbo placement algorithm is enabled, this value
17520          * is used to determine the threshold for jumbo placement.
17521          * Packets with length larger than this value will be
17522          * placed according to the jumbo placement algorithm.
17523          */
17524         uint16_t        jumbo_thresh;
17525         /*
17526          * This value is used to determine the offset into
17527          * packet buffer where the split data (payload) will be
17528          * placed according to one of of HDS placement algorithm.
17529          *
17530          * The lengths of packet buffers provided for split data
17531          * shall be larger than this value.
17532          */
17533         uint16_t        hds_offset;
17534         /*
17535          * When one of the HDS placement algorithm is enabled, this
17536          * value is used to determine the threshold for HDS
17537          * placement.
17538          * Packets with length larger than this value will be
17539          * placed according to the HDS placement algorithm.
17540          * This value shall be in multiple of 4 bytes.
17541          */
17542         uint16_t        hds_threshold;
17543         uint8_t unused_0[6];
17544 } __attribute__((packed));
17545
17546 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
17547 struct hwrm_vnic_plcmodes_cfg_output {
17548         /* The specific error status for the command. */
17549         uint16_t        error_code;
17550         /* The HWRM command request type. */
17551         uint16_t        req_type;
17552         /* The sequence ID from the original command. */
17553         uint16_t        seq_id;
17554         /* The length of the response data in number of bytes. */
17555         uint16_t        resp_len;
17556         uint8_t unused_0[7];
17557         /*
17558          * This field is used in Output records to indicate that the output
17559          * is completely written to RAM.  This field should be read as '1'
17560          * to indicate that the output has been completely written.
17561          * When writing a command completion or response to an internal processor,
17562          * the order of writes has to be such that this field is written last.
17563          */
17564         uint8_t valid;
17565 } __attribute__((packed));
17566
17567 /***************************
17568  * hwrm_vnic_plcmodes_qcfg *
17569  ***************************/
17570
17571
17572 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
17573 struct hwrm_vnic_plcmodes_qcfg_input {
17574         /* The HWRM command request type. */
17575         uint16_t        req_type;
17576         /*
17577          * The completion ring to send the completion event on. This should
17578          * be the NQ ID returned from the `nq_alloc` HWRM command.
17579          */
17580         uint16_t        cmpl_ring;
17581         /*
17582          * The sequence ID is used by the driver for tracking multiple
17583          * commands. This ID is treated as opaque data by the firmware and
17584          * the value is returned in the `hwrm_resp_hdr` upon completion.
17585          */
17586         uint16_t        seq_id;
17587         /*
17588          * The target ID of the command:
17589          * * 0x0-0xFFF8 - The function ID
17590          * * 0xFFF8-0xFFFE - Reserved for internal processors
17591          * * 0xFFFF - HWRM
17592          */
17593         uint16_t        target_id;
17594         /*
17595          * A physical address pointer pointing to a host buffer that the
17596          * command's response data will be written. This can be either a host
17597          * physical address (HPA) or a guest physical address (GPA) and must
17598          * point to a physically contiguous block of memory.
17599          */
17600         uint64_t        resp_addr;
17601         /* Logical vnic ID */
17602         uint32_t        vnic_id;
17603         uint8_t unused_0[4];
17604 } __attribute__((packed));
17605
17606 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
17607 struct hwrm_vnic_plcmodes_qcfg_output {
17608         /* The specific error status for the command. */
17609         uint16_t        error_code;
17610         /* The HWRM command request type. */
17611         uint16_t        req_type;
17612         /* The sequence ID from the original command. */
17613         uint16_t        seq_id;
17614         /* The length of the response data in number of bytes. */
17615         uint16_t        resp_len;
17616         uint32_t        flags;
17617         /*
17618          * When this bit is '1', the VNIC is configured to
17619          * use regular placement algorithm.
17620          */
17621         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
17622                 UINT32_C(0x1)
17623         /*
17624          * When this bit is '1', the VNIC is configured to
17625          * use the jumbo placement algorithm.
17626          */
17627         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
17628                 UINT32_C(0x2)
17629         /*
17630          * When this bit is '1', the VNIC is configured
17631          * to enable Header-Data split for IPv4 packets.
17632          */
17633         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
17634                 UINT32_C(0x4)
17635         /*
17636          * When this bit is '1', the VNIC is configured
17637          * to enable Header-Data split for IPv6 packets.
17638          */
17639         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
17640                 UINT32_C(0x8)
17641         /*
17642          * When this bit is '1', the VNIC is configured
17643          * to enable Header-Data split for FCoE packets.
17644          */
17645         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
17646                 UINT32_C(0x10)
17647         /*
17648          * When this bit is '1', the VNIC is configured
17649          * to enable Header-Data split for RoCE packets.
17650          */
17651         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
17652                 UINT32_C(0x20)
17653         /*
17654          * When this bit is '1', the VNIC is configured
17655          * to be the default VNIC of the requesting function.
17656          */
17657         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
17658                 UINT32_C(0x40)
17659         /*
17660          * When jumbo placement algorithm is enabled, this value
17661          * is used to determine the threshold for jumbo placement.
17662          * Packets with length larger than this value will be
17663          * placed according to the jumbo placement algorithm.
17664          */
17665         uint16_t        jumbo_thresh;
17666         /*
17667          * This value is used to determine the offset into
17668          * packet buffer where the split data (payload) will be
17669          * placed according to one of of HDS placement algorithm.
17670          *
17671          * The lengths of packet buffers provided for split data
17672          * shall be larger than this value.
17673          */
17674         uint16_t        hds_offset;
17675         /*
17676          * When one of the HDS placement algorithm is enabled, this
17677          * value is used to determine the threshold for HDS
17678          * placement.
17679          * Packets with length larger than this value will be
17680          * placed according to the HDS placement algorithm.
17681          * This value shall be in multiple of 4 bytes.
17682          */
17683         uint16_t        hds_threshold;
17684         uint8_t unused_0[5];
17685         /*
17686          * This field is used in Output records to indicate that the output
17687          * is completely written to RAM.  This field should be read as '1'
17688          * to indicate that the output has been completely written.
17689          * When writing a command completion or response to an internal processor,
17690          * the order of writes has to be such that this field is written last.
17691          */
17692         uint8_t valid;
17693 } __attribute__((packed));
17694
17695 /**********************************
17696  * hwrm_vnic_rss_cos_lb_ctx_alloc *
17697  **********************************/
17698
17699
17700 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
17701 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
17702         /* The HWRM command request type. */
17703         uint16_t        req_type;
17704         /*
17705          * The completion ring to send the completion event on. This should
17706          * be the NQ ID returned from the `nq_alloc` HWRM command.
17707          */
17708         uint16_t        cmpl_ring;
17709         /*
17710          * The sequence ID is used by the driver for tracking multiple
17711          * commands. This ID is treated as opaque data by the firmware and
17712          * the value is returned in the `hwrm_resp_hdr` upon completion.
17713          */
17714         uint16_t        seq_id;
17715         /*
17716          * The target ID of the command:
17717          * * 0x0-0xFFF8 - The function ID
17718          * * 0xFFF8-0xFFFE - Reserved for internal processors
17719          * * 0xFFFF - HWRM
17720          */
17721         uint16_t        target_id;
17722         /*
17723          * A physical address pointer pointing to a host buffer that the
17724          * command's response data will be written. This can be either a host
17725          * physical address (HPA) or a guest physical address (GPA) and must
17726          * point to a physically contiguous block of memory.
17727          */
17728         uint64_t        resp_addr;
17729 } __attribute__((packed));
17730
17731 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
17732 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
17733         /* The specific error status for the command. */
17734         uint16_t        error_code;
17735         /* The HWRM command request type. */
17736         uint16_t        req_type;
17737         /* The sequence ID from the original command. */
17738         uint16_t        seq_id;
17739         /* The length of the response data in number of bytes. */
17740         uint16_t        resp_len;
17741         /* rss_cos_lb_ctx_id is 16 b */
17742         uint16_t        rss_cos_lb_ctx_id;
17743         uint8_t unused_0[5];
17744         /*
17745          * This field is used in Output records to indicate that the output
17746          * is completely written to RAM.  This field should be read as '1'
17747          * to indicate that the output has been completely written.
17748          * When writing a command completion or response to an internal processor,
17749          * the order of writes has to be such that this field is written last.
17750          */
17751         uint8_t valid;
17752 } __attribute__((packed));
17753
17754 /*********************************
17755  * hwrm_vnic_rss_cos_lb_ctx_free *
17756  *********************************/
17757
17758
17759 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
17760 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
17761         /* The HWRM command request type. */
17762         uint16_t        req_type;
17763         /*
17764          * The completion ring to send the completion event on. This should
17765          * be the NQ ID returned from the `nq_alloc` HWRM command.
17766          */
17767         uint16_t        cmpl_ring;
17768         /*
17769          * The sequence ID is used by the driver for tracking multiple
17770          * commands. This ID is treated as opaque data by the firmware and
17771          * the value is returned in the `hwrm_resp_hdr` upon completion.
17772          */
17773         uint16_t        seq_id;
17774         /*
17775          * The target ID of the command:
17776          * * 0x0-0xFFF8 - The function ID
17777          * * 0xFFF8-0xFFFE - Reserved for internal processors
17778          * * 0xFFFF - HWRM
17779          */
17780         uint16_t        target_id;
17781         /*
17782          * A physical address pointer pointing to a host buffer that the
17783          * command's response data will be written. This can be either a host
17784          * physical address (HPA) or a guest physical address (GPA) and must
17785          * point to a physically contiguous block of memory.
17786          */
17787         uint64_t        resp_addr;
17788         /* rss_cos_lb_ctx_id is 16 b */
17789         uint16_t        rss_cos_lb_ctx_id;
17790         uint8_t unused_0[6];
17791 } __attribute__((packed));
17792
17793 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
17794 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
17795         /* The specific error status for the command. */
17796         uint16_t        error_code;
17797         /* The HWRM command request type. */
17798         uint16_t        req_type;
17799         /* The sequence ID from the original command. */
17800         uint16_t        seq_id;
17801         /* The length of the response data in number of bytes. */
17802         uint16_t        resp_len;
17803         uint8_t unused_0[7];
17804         /*
17805          * This field is used in Output records to indicate that the output
17806          * is completely written to RAM.  This field should be read as '1'
17807          * to indicate that the output has been completely written.
17808          * When writing a command completion or response to an internal processor,
17809          * the order of writes has to be such that this field is written last.
17810          */
17811         uint8_t valid;
17812 } __attribute__((packed));
17813
17814 /*******************
17815  * hwrm_ring_alloc *
17816  *******************/
17817
17818
17819 /* hwrm_ring_alloc_input (size:640b/80B) */
17820 struct hwrm_ring_alloc_input {
17821         /* The HWRM command request type. */
17822         uint16_t        req_type;
17823         /*
17824          * The completion ring to send the completion event on. This should
17825          * be the NQ ID returned from the `nq_alloc` HWRM command.
17826          */
17827         uint16_t        cmpl_ring;
17828         /*
17829          * The sequence ID is used by the driver for tracking multiple
17830          * commands. This ID is treated as opaque data by the firmware and
17831          * the value is returned in the `hwrm_resp_hdr` upon completion.
17832          */
17833         uint16_t        seq_id;
17834         /*
17835          * The target ID of the command:
17836          * * 0x0-0xFFF8 - The function ID
17837          * * 0xFFF8-0xFFFE - Reserved for internal processors
17838          * * 0xFFFF - HWRM
17839          */
17840         uint16_t        target_id;
17841         /*
17842          * A physical address pointer pointing to a host buffer that the
17843          * command's response data will be written. This can be either a host
17844          * physical address (HPA) or a guest physical address (GPA) and must
17845          * point to a physically contiguous block of memory.
17846          */
17847         uint64_t        resp_addr;
17848         uint32_t        enables;
17849         /*
17850          * This bit must be '1' for the ring_arb_cfg field to be
17851          * configured.
17852          */
17853         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
17854                 UINT32_C(0x2)
17855         /*
17856          * This bit must be '1' for the stat_ctx_id_valid field to be
17857          * configured.
17858          */
17859         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
17860                 UINT32_C(0x8)
17861         /*
17862          * This bit must be '1' for the max_bw_valid field to be
17863          * configured.
17864          */
17865         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
17866                 UINT32_C(0x20)
17867         /*
17868          * This bit must be '1' for the rx_ring_id field to be
17869          * configured.
17870          */
17871         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
17872                 UINT32_C(0x40)
17873         /*
17874          * This bit must be '1' for the nq_ring_id field to be
17875          * configured.
17876          */
17877         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
17878                 UINT32_C(0x80)
17879         /*
17880          * This bit must be '1' for the rx_buf_size field to be
17881          * configured.
17882          */
17883         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
17884                 UINT32_C(0x100)
17885         /* Ring Type. */
17886         uint8_t ring_type;
17887         /* L2 Completion Ring (CR) */
17888         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
17889         /* TX Ring (TR) */
17890         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
17891         /* RX Ring (RR) */
17892         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
17893         /* RoCE Notification Completion Ring (ROCE_CR) */
17894         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
17895         /* RX Aggregation Ring */
17896         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
17897         /* Notification Queue */
17898         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
17899         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
17900                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
17901         uint8_t unused_0[3];
17902         /*
17903          * This value is a pointer to the page table for the
17904          * Ring.
17905          */
17906         uint64_t        page_tbl_addr;
17907         /* First Byte Offset of the first entry in the first page. */
17908         uint32_t        fbo;
17909         /*
17910          * Actual page size in 2^page_size. The supported range is increments
17911          * in powers of 2 from 16 bytes to 1GB.
17912          * - 4 = 16 B
17913          *     Page size is 16 B.
17914          * - 12 = 4 KB
17915          *     Page size is 4 KB.
17916          * - 13 = 8 KB
17917          *     Page size is 8 KB.
17918          * - 16 = 64 KB
17919          *     Page size is 64 KB.
17920          * - 21 = 2 MB
17921          *     Page size is 2 MB.
17922          * - 22 = 4 MB
17923          *     Page size is 4 MB.
17924          * - 30 = 1 GB
17925          *     Page size is 1 GB.
17926          */
17927         uint8_t page_size;
17928         /*
17929          * This value indicates the depth of page table.
17930          * For this version of the specification, value other than 0 or
17931          * 1 shall be considered as an invalid value.
17932          * When the page_tbl_depth = 0, then it is treated as a
17933          * special case with the following.
17934          * 1. FBO and page size fields are not valid.
17935          * 2. page_tbl_addr is the physical address of the first
17936          *    element of the ring.
17937          */
17938         uint8_t page_tbl_depth;
17939         uint8_t unused_1[2];
17940         /*
17941          * Number of 16B units in the ring.  Minimum size for
17942          * a ring is 16 16B entries.
17943          */
17944         uint32_t        length;
17945         /*
17946          * Logical ring number for the ring to be allocated.
17947          * This value determines the position in the doorbell
17948          * area where the update to the ring will be made.
17949          *
17950          * For completion rings, this value is also the MSI-X
17951          * vector number for the function the completion ring is
17952          * associated with.
17953          */
17954         uint16_t        logical_id;
17955         /*
17956          * This field is used only when ring_type is a TX ring.
17957          * This value indicates what completion ring the TX ring
17958          * is associated with.
17959          */
17960         uint16_t        cmpl_ring_id;
17961         /*
17962          * This field is used only when ring_type is a TX ring.
17963          * This value indicates what CoS queue the TX ring
17964          * is associated with.
17965          */
17966         uint16_t        queue_id;
17967         /*
17968          * When allocating a Rx ring or Rx aggregation ring, this field
17969          * specifies the size of the buffer descriptors posted to the ring.
17970          */
17971         uint16_t        rx_buf_size;
17972         /*
17973          * When allocating an Rx aggregation ring, this field
17974          * specifies the associated Rx ring ID.
17975          */
17976         uint16_t        rx_ring_id;
17977         /*
17978          * When allocating a completion ring, this field
17979          * specifies the associated NQ ring ID.
17980          */
17981         uint16_t        nq_ring_id;
17982         /*
17983          * This field is used only when ring_type is a TX ring.
17984          * This field is used to configure arbitration related
17985          * parameters for a TX ring.
17986          */
17987         uint16_t        ring_arb_cfg;
17988         /* Arbitration policy used for the ring. */
17989         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
17990                 UINT32_C(0xf)
17991         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
17992         /*
17993          * Use strict priority for the TX ring.
17994          * Priority value is specified in arb_policy_param
17995          */
17996         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
17997                 UINT32_C(0x1)
17998         /*
17999          * Use weighted fair queue arbitration for the TX ring.
18000          * Weight is specified in arb_policy_param
18001          */
18002         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
18003                 UINT32_C(0x2)
18004         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
18005                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
18006         /* Reserved field. */
18007         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
18008                 UINT32_C(0xf0)
18009         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
18010         /*
18011          * Arbitration policy specific parameter.
18012          * # For strict priority arbitration policy, this field
18013          * represents a priority value. If set to 0, then the priority
18014          * is not specified and the HWRM is allowed to select
18015          * any priority for this TX ring.
18016          * # For weighted fair queue arbitration policy, this field
18017          * represents a weight value. If set to 0, then the weight
18018          * is not specified and the HWRM is allowed to select
18019          * any weight for this TX ring.
18020          */
18021         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
18022                 UINT32_C(0xff00)
18023         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
18024         uint16_t        unused_3;
18025         /*
18026          * This field is reserved for the future use.
18027          * It shall be set to 0.
18028          */
18029         uint32_t        reserved3;
18030         /*
18031          * This field is used only when ring_type is a TX ring.
18032          * This input indicates what statistics context this ring
18033          * should be associated with.
18034          */
18035         uint32_t        stat_ctx_id;
18036         /*
18037          * This field is reserved for the future use.
18038          * It shall be set to 0.
18039          */
18040         uint32_t        reserved4;
18041         /*
18042          * This field is used only when ring_type is a TX ring
18043          * to specify maximum BW allocated to the TX ring.
18044          * The HWRM will translate this value into byte counter and
18045          * time interval used for this ring inside the device.
18046          */
18047         uint32_t        max_bw;
18048         /* The bandwidth value. */
18049         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
18050                 UINT32_C(0xfffffff)
18051         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
18052         /* The granularity of the value (bits or bytes). */
18053         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
18054                 UINT32_C(0x10000000)
18055         /* Value is in bits. */
18056         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
18057                 (UINT32_C(0x0) << 28)
18058         /* Value is in bytes. */
18059         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
18060                 (UINT32_C(0x1) << 28)
18061         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
18062                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
18063         /* bw_value_unit is 3 b */
18064         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
18065                 UINT32_C(0xe0000000)
18066         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
18067         /* Value is in Mb or MB (base 10). */
18068         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
18069                 (UINT32_C(0x0) << 29)
18070         /* Value is in Kb or KB (base 10). */
18071         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
18072                 (UINT32_C(0x2) << 29)
18073         /* Value is in bits or bytes. */
18074         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
18075                 (UINT32_C(0x4) << 29)
18076         /* Value is in Gb or GB (base 10). */
18077         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
18078                 (UINT32_C(0x6) << 29)
18079         /* Value is in 1/100th of a percentage of total bandwidth. */
18080         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
18081                 (UINT32_C(0x1) << 29)
18082         /* Invalid unit */
18083         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
18084                 (UINT32_C(0x7) << 29)
18085         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
18086                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
18087         /*
18088          * This field is used only when ring_type is a Completion ring.
18089          * This value indicates what interrupt mode should be used
18090          * on this completion ring.
18091          * Note: In the legacy interrupt mode, no more than 16
18092          * completion rings are allowed.
18093          */
18094         uint8_t int_mode;
18095         /* Legacy INTA */
18096         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
18097         /* Reserved */
18098         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
18099         /* MSI-X */
18100         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
18101         /* No Interrupt - Polled mode */
18102         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
18103         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
18104                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
18105         uint8_t unused_4[3];
18106 } __attribute__((packed));
18107
18108 /* hwrm_ring_alloc_output (size:128b/16B) */
18109 struct hwrm_ring_alloc_output {
18110         /* The specific error status for the command. */
18111         uint16_t        error_code;
18112         /* The HWRM command request type. */
18113         uint16_t        req_type;
18114         /* The sequence ID from the original command. */
18115         uint16_t        seq_id;
18116         /* The length of the response data in number of bytes. */
18117         uint16_t        resp_len;
18118         /*
18119          * Physical number of ring allocated.
18120          * This value shall be unique for a ring type.
18121          */
18122         uint16_t        ring_id;
18123         /* Logical number of ring allocated. */
18124         uint16_t        logical_ring_id;
18125         uint8_t unused_0[3];
18126         /*
18127          * This field is used in Output records to indicate that the output
18128          * is completely written to RAM.  This field should be read as '1'
18129          * to indicate that the output has been completely written.
18130          * When writing a command completion or response to an internal processor,
18131          * the order of writes has to be such that this field is written last.
18132          */
18133         uint8_t valid;
18134 } __attribute__((packed));
18135
18136 /******************
18137  * hwrm_ring_free *
18138  ******************/
18139
18140
18141 /* hwrm_ring_free_input (size:192b/24B) */
18142 struct hwrm_ring_free_input {
18143         /* The HWRM command request type. */
18144         uint16_t        req_type;
18145         /*
18146          * The completion ring to send the completion event on. This should
18147          * be the NQ ID returned from the `nq_alloc` HWRM command.
18148          */
18149         uint16_t        cmpl_ring;
18150         /*
18151          * The sequence ID is used by the driver for tracking multiple
18152          * commands. This ID is treated as opaque data by the firmware and
18153          * the value is returned in the `hwrm_resp_hdr` upon completion.
18154          */
18155         uint16_t        seq_id;
18156         /*
18157          * The target ID of the command:
18158          * * 0x0-0xFFF8 - The function ID
18159          * * 0xFFF8-0xFFFE - Reserved for internal processors
18160          * * 0xFFFF - HWRM
18161          */
18162         uint16_t        target_id;
18163         /*
18164          * A physical address pointer pointing to a host buffer that the
18165          * command's response data will be written. This can be either a host
18166          * physical address (HPA) or a guest physical address (GPA) and must
18167          * point to a physically contiguous block of memory.
18168          */
18169         uint64_t        resp_addr;
18170         /* Ring Type. */
18171         uint8_t ring_type;
18172         /* L2 Completion Ring (CR) */
18173         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
18174         /* TX Ring (TR) */
18175         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
18176         /* RX Ring (RR) */
18177         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
18178         /* RoCE Notification Completion Ring (ROCE_CR) */
18179         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
18180         /* RX Aggregation Ring */
18181         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
18182         /* Notification Queue */
18183         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
18184         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
18185                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
18186         uint8_t unused_0;
18187         /* Physical number of ring allocated. */
18188         uint16_t        ring_id;
18189         uint8_t unused_1[4];
18190 } __attribute__((packed));
18191
18192 /* hwrm_ring_free_output (size:128b/16B) */
18193 struct hwrm_ring_free_output {
18194         /* The specific error status for the command. */
18195         uint16_t        error_code;
18196         /* The HWRM command request type. */
18197         uint16_t        req_type;
18198         /* The sequence ID from the original command. */
18199         uint16_t        seq_id;
18200         /* The length of the response data in number of bytes. */
18201         uint16_t        resp_len;
18202         uint8_t unused_0[7];
18203         /*
18204          * This field is used in Output records to indicate that the output
18205          * is completely written to RAM.  This field should be read as '1'
18206          * to indicate that the output has been completely written.
18207          * When writing a command completion or response to an internal processor,
18208          * the order of writes has to be such that this field is written last.
18209          */
18210         uint8_t valid;
18211 } __attribute__((packed));
18212
18213 /**************************************
18214  * hwrm_ring_cmpl_ring_qaggint_params *
18215  **************************************/
18216
18217
18218 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
18219 struct hwrm_ring_cmpl_ring_qaggint_params_input {
18220         /* The HWRM command request type. */
18221         uint16_t        req_type;
18222         /*
18223          * The completion ring to send the completion event on. This should
18224          * be the NQ ID returned from the `nq_alloc` HWRM command.
18225          */
18226         uint16_t        cmpl_ring;
18227         /*
18228          * The sequence ID is used by the driver for tracking multiple
18229          * commands. This ID is treated as opaque data by the firmware and
18230          * the value is returned in the `hwrm_resp_hdr` upon completion.
18231          */
18232         uint16_t        seq_id;
18233         /*
18234          * The target ID of the command:
18235          * * 0x0-0xFFF8 - The function ID
18236          * * 0xFFF8-0xFFFE - Reserved for internal processors
18237          * * 0xFFFF - HWRM
18238          */
18239         uint16_t        target_id;
18240         /*
18241          * A physical address pointer pointing to a host buffer that the
18242          * command's response data will be written. This can be either a host
18243          * physical address (HPA) or a guest physical address (GPA) and must
18244          * point to a physically contiguous block of memory.
18245          */
18246         uint64_t        resp_addr;
18247         /* Physical number of completion ring. */
18248         uint16_t        ring_id;
18249         uint8_t unused_0[6];
18250 } __attribute__((packed));
18251
18252 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
18253 struct hwrm_ring_cmpl_ring_qaggint_params_output {
18254         /* The specific error status for the command. */
18255         uint16_t        error_code;
18256         /* The HWRM command request type. */
18257         uint16_t        req_type;
18258         /* The sequence ID from the original command. */
18259         uint16_t        seq_id;
18260         /* The length of the response data in number of bytes. */
18261         uint16_t        resp_len;
18262         uint16_t        flags;
18263         /*
18264          * When this bit is set to '1', interrupt max
18265          * timer is reset whenever a completion is received.
18266          */
18267         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
18268                 UINT32_C(0x1)
18269         /*
18270          * When this bit is set to '1', ring idle mode
18271          * aggregation will be enabled.
18272          */
18273         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
18274                 UINT32_C(0x2)
18275         /*
18276          * Number of completions to aggregate before DMA
18277          * during the normal mode.
18278          */
18279         uint16_t        num_cmpl_dma_aggr;
18280         /*
18281          * Number of completions to aggregate before DMA
18282          * during the interrupt mode.
18283          */
18284         uint16_t        num_cmpl_dma_aggr_during_int;
18285         /*
18286          * Timer in unit of 80-nsec used to aggregate completions before
18287          * DMA during the normal mode (not in interrupt mode).
18288          */
18289         uint16_t        cmpl_aggr_dma_tmr;
18290         /*
18291          * Timer in unit of 80-nsec used to aggregate completions before
18292          * DMA during the interrupt mode.
18293          */
18294         uint16_t        cmpl_aggr_dma_tmr_during_int;
18295         /* Minimum time (in unit of 80-nsec) between two interrupts. */
18296         uint16_t        int_lat_tmr_min;
18297         /*
18298          * Maximum wait time (in unit of 80-nsec) spent aggregating
18299          * completions before signaling the interrupt after the
18300          * interrupt is enabled.
18301          */
18302         uint16_t        int_lat_tmr_max;
18303         /*
18304          * Minimum number of completions aggregated before signaling
18305          * an interrupt.
18306          */
18307         uint16_t        num_cmpl_aggr_int;
18308         uint8_t unused_0[7];
18309         /*
18310          * This field is used in Output records to indicate that the output
18311          * is completely written to RAM.  This field should be read as '1'
18312          * to indicate that the output has been completely written.
18313          * When writing a command completion or response to an internal processor,
18314          * the order of writes has to be such that this field is written last.
18315          */
18316         uint8_t valid;
18317 } __attribute__((packed));
18318
18319 /*****************************************
18320  * hwrm_ring_cmpl_ring_cfg_aggint_params *
18321  *****************************************/
18322
18323
18324 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
18325 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
18326         /* The HWRM command request type. */
18327         uint16_t        req_type;
18328         /*
18329          * The completion ring to send the completion event on. This should
18330          * be the NQ ID returned from the `nq_alloc` HWRM command.
18331          */
18332         uint16_t        cmpl_ring;
18333         /*
18334          * The sequence ID is used by the driver for tracking multiple
18335          * commands. This ID is treated as opaque data by the firmware and
18336          * the value is returned in the `hwrm_resp_hdr` upon completion.
18337          */
18338         uint16_t        seq_id;
18339         /*
18340          * The target ID of the command:
18341          * * 0x0-0xFFF8 - The function ID
18342          * * 0xFFF8-0xFFFE - Reserved for internal processors
18343          * * 0xFFFF - HWRM
18344          */
18345         uint16_t        target_id;
18346         /*
18347          * A physical address pointer pointing to a host buffer that the
18348          * command's response data will be written. This can be either a host
18349          * physical address (HPA) or a guest physical address (GPA) and must
18350          * point to a physically contiguous block of memory.
18351          */
18352         uint64_t        resp_addr;
18353         /* Physical number of completion ring. */
18354         uint16_t        ring_id;
18355         uint16_t        flags;
18356         /*
18357          * When this bit is set to '1', interrupt latency max
18358          * timer is reset whenever a completion is received.
18359          */
18360         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
18361                 UINT32_C(0x1)
18362         /*
18363          * When this bit is set to '1', ring idle mode
18364          * aggregation will be enabled.
18365          */
18366         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
18367                 UINT32_C(0x2)
18368         /*
18369          * Set this flag to 1 when configuring parameters on a
18370          * notification queue. Set this flag to 0 when configuring
18371          * parameters on a completion queue.
18372          */
18373         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
18374                 UINT32_C(0x4)
18375         /*
18376          * Number of completions to aggregate before DMA
18377          * during the normal mode.
18378          */
18379         uint16_t        num_cmpl_dma_aggr;
18380         /*
18381          * Number of completions to aggregate before DMA
18382          * during the interrupt mode.
18383          */
18384         uint16_t        num_cmpl_dma_aggr_during_int;
18385         /*
18386          * Timer in unit of 80-nsec used to aggregate completions before
18387          * DMA during the normal mode (not in interrupt mode).
18388          */
18389         uint16_t        cmpl_aggr_dma_tmr;
18390         /*
18391          * Timer in unit of 80-nsec used to aggregate completions before
18392          * DMA during the interrupt mode.
18393          */
18394         uint16_t        cmpl_aggr_dma_tmr_during_int;
18395         /* Minimum time (in unit of 80-nsec) between two interrupts. */
18396         uint16_t        int_lat_tmr_min;
18397         /*
18398          * Maximum wait time (in unit of 80-nsec) spent aggregating
18399          * cmpls before signaling the interrupt after the
18400          * interrupt is enabled.
18401          */
18402         uint16_t        int_lat_tmr_max;
18403         /*
18404          * Minimum number of completions aggregated before signaling
18405          * an interrupt.
18406          */
18407         uint16_t        num_cmpl_aggr_int;
18408         /*
18409          * Bitfield that indicates which parameters are to be applied. Only
18410          * required when configuring devices with notification queues, and
18411          * used in that case to set certain parameters on completion queues
18412          * and others on notification queues.
18413          */
18414         uint16_t        enables;
18415         /*
18416          * This bit must be '1' for the num_cmpl_dma_aggr field to be
18417          * configured.
18418          */
18419         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
18420                 UINT32_C(0x1)
18421         /*
18422          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
18423          * configured.
18424          */
18425         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
18426                 UINT32_C(0x2)
18427         /*
18428          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
18429          * configured.
18430          */
18431         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
18432                 UINT32_C(0x4)
18433         /*
18434          * This bit must be '1' for the int_lat_tmr_min field to be
18435          * configured.
18436          */
18437         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
18438                 UINT32_C(0x8)
18439         /*
18440          * This bit must be '1' for the int_lat_tmr_max field to be
18441          * configured.
18442          */
18443         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
18444                 UINT32_C(0x10)
18445         /*
18446          * This bit must be '1' for the num_cmpl_aggr_int field to be
18447          * configured.
18448          */
18449         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
18450                 UINT32_C(0x20)
18451         uint8_t unused_0[4];
18452 } __attribute__((packed));
18453
18454 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
18455 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
18456         /* The specific error status for the command. */
18457         uint16_t        error_code;
18458         /* The HWRM command request type. */
18459         uint16_t        req_type;
18460         /* The sequence ID from the original command. */
18461         uint16_t        seq_id;
18462         /* The length of the response data in number of bytes. */
18463         uint16_t        resp_len;
18464         uint8_t unused_0[7];
18465         /*
18466          * This field is used in Output records to indicate that the output
18467          * is completely written to RAM.  This field should be read as '1'
18468          * to indicate that the output has been completely written.
18469          * When writing a command completion or response to an internal processor,
18470          * the order of writes has to be such that this field is written last.
18471          */
18472         uint8_t valid;
18473 } __attribute__((packed));
18474
18475 /*******************
18476  * hwrm_ring_reset *
18477  *******************/
18478
18479
18480 /* hwrm_ring_reset_input (size:192b/24B) */
18481 struct hwrm_ring_reset_input {
18482         /* The HWRM command request type. */
18483         uint16_t        req_type;
18484         /*
18485          * The completion ring to send the completion event on. This should
18486          * be the NQ ID returned from the `nq_alloc` HWRM command.
18487          */
18488         uint16_t        cmpl_ring;
18489         /*
18490          * The sequence ID is used by the driver for tracking multiple
18491          * commands. This ID is treated as opaque data by the firmware and
18492          * the value is returned in the `hwrm_resp_hdr` upon completion.
18493          */
18494         uint16_t        seq_id;
18495         /*
18496          * The target ID of the command:
18497          * * 0x0-0xFFF8 - The function ID
18498          * * 0xFFF8-0xFFFE - Reserved for internal processors
18499          * * 0xFFFF - HWRM
18500          */
18501         uint16_t        target_id;
18502         /*
18503          * A physical address pointer pointing to a host buffer that the
18504          * command's response data will be written. This can be either a host
18505          * physical address (HPA) or a guest physical address (GPA) and must
18506          * point to a physically contiguous block of memory.
18507          */
18508         uint64_t        resp_addr;
18509         /* Ring Type. */
18510         uint8_t ring_type;
18511         /* L2 Completion Ring (CR) */
18512         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
18513         /* TX Ring (TR) */
18514         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX        UINT32_C(0x1)
18515         /* RX Ring (RR) */
18516         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX        UINT32_C(0x2)
18517         /* RoCE Notification Completion Ring (ROCE_CR) */
18518         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
18519         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
18520                 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL
18521         uint8_t unused_0;
18522         /* Physical number of the ring. */
18523         uint16_t        ring_id;
18524         uint8_t unused_1[4];
18525 } __attribute__((packed));
18526
18527 /* hwrm_ring_reset_output (size:128b/16B) */
18528 struct hwrm_ring_reset_output {
18529         /* The specific error status for the command. */
18530         uint16_t        error_code;
18531         /* The HWRM command request type. */
18532         uint16_t        req_type;
18533         /* The sequence ID from the original command. */
18534         uint16_t        seq_id;
18535         /* The length of the response data in number of bytes. */
18536         uint16_t        resp_len;
18537         uint8_t unused_0[7];
18538         /*
18539          * This field is used in Output records to indicate that the output
18540          * is completely written to RAM.  This field should be read as '1'
18541          * to indicate that the output has been completely written.
18542          * When writing a command completion or response to an internal processor,
18543          * the order of writes has to be such that this field is written last.
18544          */
18545         uint8_t valid;
18546 } __attribute__((packed));
18547
18548 /***********************
18549  * hwrm_ring_grp_alloc *
18550  ***********************/
18551
18552
18553 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
18554 struct hwrm_ring_grp_alloc_input {
18555         /* The HWRM command request type. */
18556         uint16_t        req_type;
18557         /*
18558          * The completion ring to send the completion event on. This should
18559          * be the NQ ID returned from the `nq_alloc` HWRM command.
18560          */
18561         uint16_t        cmpl_ring;
18562         /*
18563          * The sequence ID is used by the driver for tracking multiple
18564          * commands. This ID is treated as opaque data by the firmware and
18565          * the value is returned in the `hwrm_resp_hdr` upon completion.
18566          */
18567         uint16_t        seq_id;
18568         /*
18569          * The target ID of the command:
18570          * * 0x0-0xFFF8 - The function ID
18571          * * 0xFFF8-0xFFFE - Reserved for internal processors
18572          * * 0xFFFF - HWRM
18573          */
18574         uint16_t        target_id;
18575         /*
18576          * A physical address pointer pointing to a host buffer that the
18577          * command's response data will be written. This can be either a host
18578          * physical address (HPA) or a guest physical address (GPA) and must
18579          * point to a physically contiguous block of memory.
18580          */
18581         uint64_t        resp_addr;
18582         /*
18583          * This value identifies the CR associated with the ring
18584          * group.
18585          */
18586         uint16_t        cr;
18587         /*
18588          * This value identifies the main RR associated with the ring
18589          * group.
18590          */
18591         uint16_t        rr;
18592         /*
18593          * This value identifies the aggregation RR associated with
18594          * the ring group.  If this value is 0xFF... (All Fs), then no
18595          * Aggregation ring will be set.
18596          */
18597         uint16_t        ar;
18598         /*
18599          * This value identifies the statistics context associated
18600          * with the ring group.
18601          */
18602         uint16_t        sc;
18603 } __attribute__((packed));
18604
18605 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
18606 struct hwrm_ring_grp_alloc_output {
18607         /* The specific error status for the command. */
18608         uint16_t        error_code;
18609         /* The HWRM command request type. */
18610         uint16_t        req_type;
18611         /* The sequence ID from the original command. */
18612         uint16_t        seq_id;
18613         /* The length of the response data in number of bytes. */
18614         uint16_t        resp_len;
18615         /*
18616          * This is the ring group ID value.  Use this value to program
18617          * the default ring group for the VNIC or as table entries
18618          * in an RSS/COS context.
18619          */
18620         uint32_t        ring_group_id;
18621         uint8_t unused_0[3];
18622         /*
18623          * This field is used in Output records to indicate that the output
18624          * is completely written to RAM.  This field should be read as '1'
18625          * to indicate that the output has been completely written.
18626          * When writing a command completion or response to an internal processor,
18627          * the order of writes has to be such that this field is written last.
18628          */
18629         uint8_t valid;
18630 } __attribute__((packed));
18631
18632 /**********************
18633  * hwrm_ring_grp_free *
18634  **********************/
18635
18636
18637 /* hwrm_ring_grp_free_input (size:192b/24B) */
18638 struct hwrm_ring_grp_free_input {
18639         /* The HWRM command request type. */
18640         uint16_t        req_type;
18641         /*
18642          * The completion ring to send the completion event on. This should
18643          * be the NQ ID returned from the `nq_alloc` HWRM command.
18644          */
18645         uint16_t        cmpl_ring;
18646         /*
18647          * The sequence ID is used by the driver for tracking multiple
18648          * commands. This ID is treated as opaque data by the firmware and
18649          * the value is returned in the `hwrm_resp_hdr` upon completion.
18650          */
18651         uint16_t        seq_id;
18652         /*
18653          * The target ID of the command:
18654          * * 0x0-0xFFF8 - The function ID
18655          * * 0xFFF8-0xFFFE - Reserved for internal processors
18656          * * 0xFFFF - HWRM
18657          */
18658         uint16_t        target_id;
18659         /*
18660          * A physical address pointer pointing to a host buffer that the
18661          * command's response data will be written. This can be either a host
18662          * physical address (HPA) or a guest physical address (GPA) and must
18663          * point to a physically contiguous block of memory.
18664          */
18665         uint64_t        resp_addr;
18666         /* This is the ring group ID value. */
18667         uint32_t        ring_group_id;
18668         uint8_t unused_0[4];
18669 } __attribute__((packed));
18670
18671 /* hwrm_ring_grp_free_output (size:128b/16B) */
18672 struct hwrm_ring_grp_free_output {
18673         /* The specific error status for the command. */
18674         uint16_t        error_code;
18675         /* The HWRM command request type. */
18676         uint16_t        req_type;
18677         /* The sequence ID from the original command. */
18678         uint16_t        seq_id;
18679         /* The length of the response data in number of bytes. */
18680         uint16_t        resp_len;
18681         uint8_t unused_0[7];
18682         /*
18683          * This field is used in Output records to indicate that the output
18684          * is completely written to RAM.  This field should be read as '1'
18685          * to indicate that the output has been completely written.
18686          * When writing a command completion or response to an internal processor,
18687          * the order of writes has to be such that this field is written last.
18688          */
18689         uint8_t valid;
18690 } __attribute__((packed));
18691
18692 /****************************
18693  * hwrm_cfa_l2_filter_alloc *
18694  ****************************/
18695
18696
18697 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
18698 struct hwrm_cfa_l2_filter_alloc_input {
18699         /* The HWRM command request type. */
18700         uint16_t        req_type;
18701         /*
18702          * The completion ring to send the completion event on. This should
18703          * be the NQ ID returned from the `nq_alloc` HWRM command.
18704          */
18705         uint16_t        cmpl_ring;
18706         /*
18707          * The sequence ID is used by the driver for tracking multiple
18708          * commands. This ID is treated as opaque data by the firmware and
18709          * the value is returned in the `hwrm_resp_hdr` upon completion.
18710          */
18711         uint16_t        seq_id;
18712         /*
18713          * The target ID of the command:
18714          * * 0x0-0xFFF8 - The function ID
18715          * * 0xFFF8-0xFFFE - Reserved for internal processors
18716          * * 0xFFFF - HWRM
18717          */
18718         uint16_t        target_id;
18719         /*
18720          * A physical address pointer pointing to a host buffer that the
18721          * command's response data will be written. This can be either a host
18722          * physical address (HPA) or a guest physical address (GPA) and must
18723          * point to a physically contiguous block of memory.
18724          */
18725         uint64_t        resp_addr;
18726         uint32_t        flags;
18727         /*
18728          * Enumeration denoting the RX, TX type of the resource.
18729          * This enumeration is used for resources that are similar for both
18730          * TX and RX paths of the chip.
18731          */
18732         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
18733                 UINT32_C(0x1)
18734         /* tx path */
18735         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
18736                 UINT32_C(0x0)
18737         /* rx path */
18738         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
18739                 UINT32_C(0x1)
18740         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
18741                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
18742         /* Setting of this flag indicates the applicability to the loopback path. */
18743         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
18744                 UINT32_C(0x2)
18745         /*
18746          * Setting of this flag indicates drop action. If this flag is not set,
18747          * then it should be considered accept action.
18748          */
18749         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
18750                 UINT32_C(0x4)
18751         /*
18752          * If this flag is set, all t_l2_* fields are invalid
18753          * and they should not be specified.
18754          * If this flag is set, then l2_* fields refer to
18755          * fields of outermost L2 header.
18756          */
18757         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
18758                 UINT32_C(0x8)
18759         uint32_t        enables;
18760         /*
18761          * This bit must be '1' for the l2_addr field to be
18762          * configured.
18763          */
18764         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
18765                 UINT32_C(0x1)
18766         /*
18767          * This bit must be '1' for the l2_addr_mask field to be
18768          * configured.
18769          */
18770         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
18771                 UINT32_C(0x2)
18772         /*
18773          * This bit must be '1' for the l2_ovlan field to be
18774          * configured.
18775          */
18776         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
18777                 UINT32_C(0x4)
18778         /*
18779          * This bit must be '1' for the l2_ovlan_mask field to be
18780          * configured.
18781          */
18782         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
18783                 UINT32_C(0x8)
18784         /*
18785          * This bit must be '1' for the l2_ivlan field to be
18786          * configured.
18787          */
18788         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
18789                 UINT32_C(0x10)
18790         /*
18791          * This bit must be '1' for the l2_ivlan_mask field to be
18792          * configured.
18793          */
18794         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
18795                 UINT32_C(0x20)
18796         /*
18797          * This bit must be '1' for the t_l2_addr field to be
18798          * configured.
18799          */
18800         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
18801                 UINT32_C(0x40)
18802         /*
18803          * This bit must be '1' for the t_l2_addr_mask field to be
18804          * configured.
18805          */
18806         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
18807                 UINT32_C(0x80)
18808         /*
18809          * This bit must be '1' for the t_l2_ovlan field to be
18810          * configured.
18811          */
18812         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
18813                 UINT32_C(0x100)
18814         /*
18815          * This bit must be '1' for the t_l2_ovlan_mask field to be
18816          * configured.
18817          */
18818         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
18819                 UINT32_C(0x200)
18820         /*
18821          * This bit must be '1' for the t_l2_ivlan field to be
18822          * configured.
18823          */
18824         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
18825                 UINT32_C(0x400)
18826         /*
18827          * This bit must be '1' for the t_l2_ivlan_mask field to be
18828          * configured.
18829          */
18830         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
18831                 UINT32_C(0x800)
18832         /*
18833          * This bit must be '1' for the src_type field to be
18834          * configured.
18835          */
18836         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
18837                 UINT32_C(0x1000)
18838         /*
18839          * This bit must be '1' for the src_id field to be
18840          * configured.
18841          */
18842         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
18843                 UINT32_C(0x2000)
18844         /*
18845          * This bit must be '1' for the tunnel_type field to be
18846          * configured.
18847          */
18848         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
18849                 UINT32_C(0x4000)
18850         /*
18851          * This bit must be '1' for the dst_id field to be
18852          * configured.
18853          */
18854         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
18855                 UINT32_C(0x8000)
18856         /*
18857          * This bit must be '1' for the mirror_vnic_id field to be
18858          * configured.
18859          */
18860         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
18861                 UINT32_C(0x10000)
18862         /*
18863          * This value sets the match value for the L2 MAC address.
18864          * Destination MAC address for RX path.
18865          * Source MAC address for TX path.
18866          */
18867         uint8_t l2_addr[6];
18868         uint8_t unused_0[2];
18869         /*
18870          * This value sets the mask value for the L2 address.
18871          * A value of 0 will mask the corresponding bit from
18872          * compare.
18873          */
18874         uint8_t l2_addr_mask[6];
18875         /* This value sets VLAN ID value for outer VLAN. */
18876         uint16_t        l2_ovlan;
18877         /*
18878          * This value sets the mask value for the ovlan id.
18879          * A value of 0 will mask the corresponding bit from
18880          * compare.
18881          */
18882         uint16_t        l2_ovlan_mask;
18883         /* This value sets VLAN ID value for inner VLAN. */
18884         uint16_t        l2_ivlan;
18885         /*
18886          * This value sets the mask value for the ivlan id.
18887          * A value of 0 will mask the corresponding bit from
18888          * compare.
18889          */
18890         uint16_t        l2_ivlan_mask;
18891         uint8_t unused_1[2];
18892         /*
18893          * This value sets the match value for the tunnel
18894          * L2 MAC address.
18895          * Destination MAC address for RX path.
18896          * Source MAC address for TX path.
18897          */
18898         uint8_t t_l2_addr[6];
18899         uint8_t unused_2[2];
18900         /*
18901          * This value sets the mask value for the tunnel L2
18902          * address.
18903          * A value of 0 will mask the corresponding bit from
18904          * compare.
18905          */
18906         uint8_t t_l2_addr_mask[6];
18907         /* This value sets VLAN ID value for tunnel outer VLAN. */
18908         uint16_t        t_l2_ovlan;
18909         /*
18910          * This value sets the mask value for the tunnel ovlan id.
18911          * A value of 0 will mask the corresponding bit from
18912          * compare.
18913          */
18914         uint16_t        t_l2_ovlan_mask;
18915         /* This value sets VLAN ID value for tunnel inner VLAN. */
18916         uint16_t        t_l2_ivlan;
18917         /*
18918          * This value sets the mask value for the tunnel ivlan id.
18919          * A value of 0 will mask the corresponding bit from
18920          * compare.
18921          */
18922         uint16_t        t_l2_ivlan_mask;
18923         /* This value identifies the type of source of the packet. */
18924         uint8_t src_type;
18925         /* Network port */
18926         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
18927         /* Physical function */
18928         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
18929         /* Virtual function */
18930         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
18931         /* Virtual NIC of a function */
18932         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
18933         /* Embedded processor for CFA management */
18934         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
18935         /* Embedded processor for OOB management */
18936         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
18937         /* Embedded processor for RoCE */
18938         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
18939         /* Embedded processor for network proxy functions */
18940         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
18941         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
18942                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
18943         uint8_t unused_3;
18944         /*
18945          * This value is the id of the source.
18946          * For a network port, it represents port_id.
18947          * For a physical function, it represents fid.
18948          * For a virtual function, it represents vf_id.
18949          * For a vnic, it represents vnic_id.
18950          * For embedded processors, this id is not valid.
18951          *
18952          * Notes:
18953          * 1. The function ID is implied if it src_id is
18954          *    not provided for a src_type that is either
18955          */
18956         uint32_t        src_id;
18957         /* Tunnel Type. */
18958         uint8_t tunnel_type;
18959         /* Non-tunnel */
18960         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
18961                 UINT32_C(0x0)
18962         /* Virtual eXtensible Local Area Network (VXLAN) */
18963         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
18964                 UINT32_C(0x1)
18965         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
18966         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
18967                 UINT32_C(0x2)
18968         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
18969         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
18970                 UINT32_C(0x3)
18971         /* IP in IP */
18972         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
18973                 UINT32_C(0x4)
18974         /* Generic Network Virtualization Encapsulation (Geneve) */
18975         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
18976                 UINT32_C(0x5)
18977         /* Multi-Protocol Lable Switching (MPLS) */
18978         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
18979                 UINT32_C(0x6)
18980         /* Stateless Transport Tunnel (STT) */
18981         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
18982                 UINT32_C(0x7)
18983         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
18984         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
18985                 UINT32_C(0x8)
18986         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
18987         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
18988                 UINT32_C(0x9)
18989         /* Any tunneled traffic */
18990         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
18991                 UINT32_C(0xff)
18992         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
18993                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
18994         uint8_t unused_4;
18995         /*
18996          * If set, this value shall represent the
18997          * Logical VNIC ID of the destination VNIC for the RX
18998          * path and network port id of the destination port for
18999          * the TX path.
19000          */
19001         uint16_t        dst_id;
19002         /*
19003          * Logical VNIC ID of the VNIC where traffic is
19004          * mirrored.
19005          */
19006         uint16_t        mirror_vnic_id;
19007         /*
19008          * This hint is provided to help in placing
19009          * the filter in the filter table.
19010          */
19011         uint8_t pri_hint;
19012         /* No preference */
19013         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
19014                 UINT32_C(0x0)
19015         /* Above the given filter */
19016         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
19017                 UINT32_C(0x1)
19018         /* Below the given filter */
19019         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
19020                 UINT32_C(0x2)
19021         /* As high as possible */
19022         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
19023                 UINT32_C(0x3)
19024         /* As low as possible */
19025         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
19026                 UINT32_C(0x4)
19027         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
19028                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
19029         uint8_t unused_5;
19030         uint32_t        unused_6;
19031         /*
19032          * This is the ID of the filter that goes along with
19033          * the pri_hint.
19034          *
19035          * This field is valid only for the following values.
19036          * 1 - Above the given filter
19037          * 2 - Below the given filter
19038          */
19039         uint64_t        l2_filter_id_hint;
19040 } __attribute__((packed));
19041
19042 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
19043 struct hwrm_cfa_l2_filter_alloc_output {
19044         /* The specific error status for the command. */
19045         uint16_t        error_code;
19046         /* The HWRM command request type. */
19047         uint16_t        req_type;
19048         /* The sequence ID from the original command. */
19049         uint16_t        seq_id;
19050         /* The length of the response data in number of bytes. */
19051         uint16_t        resp_len;
19052         /*
19053          * This value identifies a set of CFA data structures used for an L2
19054          * context.
19055          */
19056         uint64_t        l2_filter_id;
19057         /*
19058          * This is the ID of the flow associated with this
19059          * filter.
19060          * This value shall be used to match and associate the
19061          * flow identifier returned in completion records.
19062          * A value of 0xFFFFFFFF shall indicate no flow id.
19063          */
19064         uint32_t        flow_id;
19065         uint8_t unused_0[3];
19066         /*
19067          * This field is used in Output records to indicate that the output
19068          * is completely written to RAM.  This field should be read as '1'
19069          * to indicate that the output has been completely written.
19070          * When writing a command completion or response to an internal processor,
19071          * the order of writes has to be such that this field is written last.
19072          */
19073         uint8_t valid;
19074 } __attribute__((packed));
19075
19076 /***************************
19077  * hwrm_cfa_l2_filter_free *
19078  ***************************/
19079
19080
19081 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
19082 struct hwrm_cfa_l2_filter_free_input {
19083         /* The HWRM command request type. */
19084         uint16_t        req_type;
19085         /*
19086          * The completion ring to send the completion event on. This should
19087          * be the NQ ID returned from the `nq_alloc` HWRM command.
19088          */
19089         uint16_t        cmpl_ring;
19090         /*
19091          * The sequence ID is used by the driver for tracking multiple
19092          * commands. This ID is treated as opaque data by the firmware and
19093          * the value is returned in the `hwrm_resp_hdr` upon completion.
19094          */
19095         uint16_t        seq_id;
19096         /*
19097          * The target ID of the command:
19098          * * 0x0-0xFFF8 - The function ID
19099          * * 0xFFF8-0xFFFE - Reserved for internal processors
19100          * * 0xFFFF - HWRM
19101          */
19102         uint16_t        target_id;
19103         /*
19104          * A physical address pointer pointing to a host buffer that the
19105          * command's response data will be written. This can be either a host
19106          * physical address (HPA) or a guest physical address (GPA) and must
19107          * point to a physically contiguous block of memory.
19108          */
19109         uint64_t        resp_addr;
19110         /*
19111          * This value identifies a set of CFA data structures used for an L2
19112          * context.
19113          */
19114         uint64_t        l2_filter_id;
19115 } __attribute__((packed));
19116
19117 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
19118 struct hwrm_cfa_l2_filter_free_output {
19119         /* The specific error status for the command. */
19120         uint16_t        error_code;
19121         /* The HWRM command request type. */
19122         uint16_t        req_type;
19123         /* The sequence ID from the original command. */
19124         uint16_t        seq_id;
19125         /* The length of the response data in number of bytes. */
19126         uint16_t        resp_len;
19127         uint8_t unused_0[7];
19128         /*
19129          * This field is used in Output records to indicate that the output
19130          * is completely written to RAM.  This field should be read as '1'
19131          * to indicate that the output has been completely written.
19132          * When writing a command completion or response to an internal processor,
19133          * the order of writes has to be such that this field is written last.
19134          */
19135         uint8_t valid;
19136 } __attribute__((packed));
19137
19138 /**************************
19139  * hwrm_cfa_l2_filter_cfg *
19140  **************************/
19141
19142
19143 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
19144 struct hwrm_cfa_l2_filter_cfg_input {
19145         /* The HWRM command request type. */
19146         uint16_t        req_type;
19147         /*
19148          * The completion ring to send the completion event on. This should
19149          * be the NQ ID returned from the `nq_alloc` HWRM command.
19150          */
19151         uint16_t        cmpl_ring;
19152         /*
19153          * The sequence ID is used by the driver for tracking multiple
19154          * commands. This ID is treated as opaque data by the firmware and
19155          * the value is returned in the `hwrm_resp_hdr` upon completion.
19156          */
19157         uint16_t        seq_id;
19158         /*
19159          * The target ID of the command:
19160          * * 0x0-0xFFF8 - The function ID
19161          * * 0xFFF8-0xFFFE - Reserved for internal processors
19162          * * 0xFFFF - HWRM
19163          */
19164         uint16_t        target_id;
19165         /*
19166          * A physical address pointer pointing to a host buffer that the
19167          * command's response data will be written. This can be either a host
19168          * physical address (HPA) or a guest physical address (GPA) and must
19169          * point to a physically contiguous block of memory.
19170          */
19171         uint64_t        resp_addr;
19172         uint32_t        flags;
19173         /*
19174          * Enumeration denoting the RX, TX type of the resource.
19175          * This enumeration is used for resources that are similar for both
19176          * TX and RX paths of the chip.
19177          */
19178         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
19179         /* tx path */
19180         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
19181         /* rx path */
19182         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
19183         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
19184                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
19185         /*
19186          * Setting of this flag indicates drop action. If this flag is not set,
19187          * then it should be considered accept action.
19188          */
19189         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP     UINT32_C(0x2)
19190         uint32_t        enables;
19191         /*
19192          * This bit must be '1' for the dst_id field to be
19193          * configured.
19194          */
19195         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
19196                 UINT32_C(0x1)
19197         /*
19198          * This bit must be '1' for the new_mirror_vnic_id field to be
19199          * configured.
19200          */
19201         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
19202                 UINT32_C(0x2)
19203         /*
19204          * This value identifies a set of CFA data structures used for an L2
19205          * context.
19206          */
19207         uint64_t        l2_filter_id;
19208         /*
19209          * If set, this value shall represent the
19210          * Logical VNIC ID of the destination VNIC for the RX
19211          * path and network port id of the destination port for
19212          * the TX path.
19213          */
19214         uint32_t        dst_id;
19215         /*
19216          * New Logical VNIC ID of the VNIC where traffic is
19217          * mirrored.
19218          */
19219         uint32_t        new_mirror_vnic_id;
19220 } __attribute__((packed));
19221
19222 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
19223 struct hwrm_cfa_l2_filter_cfg_output {
19224         /* The specific error status for the command. */
19225         uint16_t        error_code;
19226         /* The HWRM command request type. */
19227         uint16_t        req_type;
19228         /* The sequence ID from the original command. */
19229         uint16_t        seq_id;
19230         /* The length of the response data in number of bytes. */
19231         uint16_t        resp_len;
19232         uint8_t unused_0[7];
19233         /*
19234          * This field is used in Output records to indicate that the output
19235          * is completely written to RAM.  This field should be read as '1'
19236          * to indicate that the output has been completely written.
19237          * When writing a command completion or response to an internal processor,
19238          * the order of writes has to be such that this field is written last.
19239          */
19240         uint8_t valid;
19241 } __attribute__((packed));
19242
19243 /***************************
19244  * hwrm_cfa_l2_set_rx_mask *
19245  ***************************/
19246
19247
19248 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
19249 struct hwrm_cfa_l2_set_rx_mask_input {
19250         /* The HWRM command request type. */
19251         uint16_t        req_type;
19252         /*
19253          * The completion ring to send the completion event on. This should
19254          * be the NQ ID returned from the `nq_alloc` HWRM command.
19255          */
19256         uint16_t        cmpl_ring;
19257         /*
19258          * The sequence ID is used by the driver for tracking multiple
19259          * commands. This ID is treated as opaque data by the firmware and
19260          * the value is returned in the `hwrm_resp_hdr` upon completion.
19261          */
19262         uint16_t        seq_id;
19263         /*
19264          * The target ID of the command:
19265          * * 0x0-0xFFF8 - The function ID
19266          * * 0xFFF8-0xFFFE - Reserved for internal processors
19267          * * 0xFFFF - HWRM
19268          */
19269         uint16_t        target_id;
19270         /*
19271          * A physical address pointer pointing to a host buffer that the
19272          * command's response data will be written. This can be either a host
19273          * physical address (HPA) or a guest physical address (GPA) and must
19274          * point to a physically contiguous block of memory.
19275          */
19276         uint64_t        resp_addr;
19277         /* VNIC ID */
19278         uint32_t        vnic_id;
19279         uint32_t        mask;
19280         /*
19281          * When this bit is '1', the function is requested to accept
19282          * multi-cast packets specified by the multicast addr table.
19283          */
19284         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
19285                 UINT32_C(0x2)
19286         /*
19287          * When this bit is '1', the function is requested to accept
19288          * all multi-cast packets.
19289          */
19290         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
19291                 UINT32_C(0x4)
19292         /*
19293          * When this bit is '1', the function is requested to accept
19294          * broadcast packets.
19295          */
19296         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
19297                 UINT32_C(0x8)
19298         /*
19299          * When this bit is '1', the function is requested to be
19300          * put in the promiscuous mode.
19301          *
19302          * The HWRM should accept any function to set up
19303          * promiscuous mode.
19304          *
19305          * The HWRM shall follow the semantics below for the
19306          * promiscuous mode support.
19307          * # When partitioning is not enabled on a port
19308          * (i.e. single PF on the port), then the PF shall
19309          * be allowed to be in the promiscuous mode. When the
19310          * PF is in the promiscuous mode, then it shall
19311          * receive all host bound traffic on that port.
19312          * # When partitioning is enabled on a port
19313          * (i.e. multiple PFs per port) and a PF on that
19314          * port is in the promiscuous mode, then the PF
19315          * receives all traffic within that partition as
19316          * identified by a unique identifier for the
19317          * PF (e.g. S-Tag). If a unique outer VLAN
19318          * for the PF is specified, then the setting of
19319          * promiscuous mode on that PF shall result in the
19320          * PF receiving all host bound traffic with matching
19321          * outer VLAN.
19322          * # A VF shall can be set in the promiscuous mode.
19323          * In the promiscuous mode, the VF does not receive any
19324          * traffic unless a unique outer VLAN for the
19325          * VF is specified. If a unique outer VLAN
19326          * for the VF is specified, then the setting of
19327          * promiscuous mode on that VF shall result in the
19328          * VF receiving all host bound traffic with the
19329          * matching outer VLAN.
19330          * # The HWRM shall allow the setting of promiscuous
19331          * mode on a function independently from the
19332          * promiscuous mode settings on other functions.
19333          */
19334         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
19335                 UINT32_C(0x10)
19336         /*
19337          * If this flag is set, the corresponding RX
19338          * filters shall be set up to cover multicast/broadcast
19339          * filters for the outermost Layer 2 destination MAC
19340          * address field.
19341          */
19342         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
19343                 UINT32_C(0x20)
19344         /*
19345          * If this flag is set, the corresponding RX
19346          * filters shall be set up to cover multicast/broadcast
19347          * filters for the VLAN-tagged packets that match the
19348          * TPID and VID fields of VLAN tags in the VLAN tag
19349          * table specified in this command.
19350          */
19351         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
19352                 UINT32_C(0x40)
19353         /*
19354          * If this flag is set, the corresponding RX
19355          * filters shall be set up to cover multicast/broadcast
19356          * filters for non-VLAN tagged packets and VLAN-tagged
19357          * packets that match the TPID and VID fields of VLAN
19358          * tags in the VLAN tag table specified in this command.
19359          */
19360         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
19361                 UINT32_C(0x80)
19362         /*
19363          * If this flag is set, the corresponding RX
19364          * filters shall be set up to cover multicast/broadcast
19365          * filters for non-VLAN tagged packets and VLAN-tagged
19366          * packets matching any VLAN tag.
19367          *
19368          * If this flag is set, then the HWRM shall ignore
19369          * VLAN tags specified in vlan_tag_tbl.
19370          *
19371          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
19372          * flags is set, then the HWRM shall ignore
19373          * VLAN tags specified in vlan_tag_tbl.
19374          *
19375          * The HWRM client shall set at most one flag out of
19376          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
19377          */
19378         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
19379                 UINT32_C(0x100)
19380         /* This is the address for mcast address tbl. */
19381         uint64_t        mc_tbl_addr;
19382         /*
19383          * This value indicates how many entries in mc_tbl are valid.
19384          * Each entry is 6 bytes.
19385          */
19386         uint32_t        num_mc_entries;
19387         uint8_t unused_0[4];
19388         /*
19389          * This is the address for VLAN tag table.
19390          * Each VLAN entry in the table is 4 bytes of a VLAN tag
19391          * including TPID, PCP, DEI, and VID fields in network byte
19392          * order.
19393          */
19394         uint64_t        vlan_tag_tbl_addr;
19395         /*
19396          * This value indicates how many entries in vlan_tag_tbl are
19397          * valid. Each entry is 4 bytes.
19398          */
19399         uint32_t        num_vlan_tags;
19400         uint8_t unused_1[4];
19401 } __attribute__((packed));
19402
19403 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
19404 struct hwrm_cfa_l2_set_rx_mask_output {
19405         /* The specific error status for the command. */
19406         uint16_t        error_code;
19407         /* The HWRM command request type. */
19408         uint16_t        req_type;
19409         /* The sequence ID from the original command. */
19410         uint16_t        seq_id;
19411         /* The length of the response data in number of bytes. */
19412         uint16_t        resp_len;
19413         uint8_t unused_0[7];
19414         /*
19415          * This field is used in Output records to indicate that the output
19416          * is completely written to RAM.  This field should be read as '1'
19417          * to indicate that the output has been completely written.
19418          * When writing a command completion or response to an internal processor,
19419          * the order of writes has to be such that this field is written last.
19420          */
19421         uint8_t valid;
19422 } __attribute__((packed));
19423
19424 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
19425 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
19426         /*
19427          * command specific error codes that goes to
19428          * the cmd_err field in Common HWRM Error Response.
19429          */
19430         uint8_t code;
19431         /* Unknown error */
19432         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
19433                 UINT32_C(0x0)
19434         /* Unable to complete operation due to conflict with Ntuple Filter */
19435         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
19436                 UINT32_C(0x1)
19437         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
19438                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
19439         uint8_t unused_0[7];
19440 } __attribute__((packed));
19441
19442 /*******************************
19443  * hwrm_cfa_vlan_antispoof_cfg *
19444  *******************************/
19445
19446
19447 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
19448 struct hwrm_cfa_vlan_antispoof_cfg_input {
19449         /* The HWRM command request type. */
19450         uint16_t        req_type;
19451         /*
19452          * The completion ring to send the completion event on. This should
19453          * be the NQ ID returned from the `nq_alloc` HWRM command.
19454          */
19455         uint16_t        cmpl_ring;
19456         /*
19457          * The sequence ID is used by the driver for tracking multiple
19458          * commands. This ID is treated as opaque data by the firmware and
19459          * the value is returned in the `hwrm_resp_hdr` upon completion.
19460          */
19461         uint16_t        seq_id;
19462         /*
19463          * The target ID of the command:
19464          * * 0x0-0xFFF8 - The function ID
19465          * * 0xFFF8-0xFFFE - Reserved for internal processors
19466          * * 0xFFFF - HWRM
19467          */
19468         uint16_t        target_id;
19469         /*
19470          * A physical address pointer pointing to a host buffer that the
19471          * command's response data will be written. This can be either a host
19472          * physical address (HPA) or a guest physical address (GPA) and must
19473          * point to a physically contiguous block of memory.
19474          */
19475         uint64_t        resp_addr;
19476         /*
19477          * Function ID of the function that is being configured.
19478          * Only valid for a VF FID configured by the PF.
19479          */
19480         uint16_t        fid;
19481         uint8_t unused_0[2];
19482         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
19483         uint32_t        num_vlan_entries;
19484         /*
19485          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
19486          * antispoof table. Each table entry contains the 16-bit TPID
19487          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
19488          * all in network order to match hwrm_cfa_l2_set_rx_mask.
19489          * For an individual VLAN entry, the mask value should be 0xfff
19490          * for the 12-bit VLAN ID.
19491          */
19492         uint64_t        vlan_tag_mask_tbl_addr;
19493 } __attribute__((packed));
19494
19495 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
19496 struct hwrm_cfa_vlan_antispoof_cfg_output {
19497         /* The specific error status for the command. */
19498         uint16_t        error_code;
19499         /* The HWRM command request type. */
19500         uint16_t        req_type;
19501         /* The sequence ID from the original command. */
19502         uint16_t        seq_id;
19503         /* The length of the response data in number of bytes. */
19504         uint16_t        resp_len;
19505         uint8_t unused_0[7];
19506         /*
19507          * This field is used in Output records to indicate that the output
19508          * is completely written to RAM.  This field should be read as '1'
19509          * to indicate that the output has been completely written.
19510          * When writing a command completion or response to an internal processor,
19511          * the order of writes has to be such that this field is written last.
19512          */
19513         uint8_t valid;
19514 } __attribute__((packed));
19515
19516 /********************************
19517  * hwrm_cfa_vlan_antispoof_qcfg *
19518  ********************************/
19519
19520
19521 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
19522 struct hwrm_cfa_vlan_antispoof_qcfg_input {
19523         /* The HWRM command request type. */
19524         uint16_t        req_type;
19525         /*
19526          * The completion ring to send the completion event on. This should
19527          * be the NQ ID returned from the `nq_alloc` HWRM command.
19528          */
19529         uint16_t        cmpl_ring;
19530         /*
19531          * The sequence ID is used by the driver for tracking multiple
19532          * commands. This ID is treated as opaque data by the firmware and
19533          * the value is returned in the `hwrm_resp_hdr` upon completion.
19534          */
19535         uint16_t        seq_id;
19536         /*
19537          * The target ID of the command:
19538          * * 0x0-0xFFF8 - The function ID
19539          * * 0xFFF8-0xFFFE - Reserved for internal processors
19540          * * 0xFFFF - HWRM
19541          */
19542         uint16_t        target_id;
19543         /*
19544          * A physical address pointer pointing to a host buffer that the
19545          * command's response data will be written. This can be either a host
19546          * physical address (HPA) or a guest physical address (GPA) and must
19547          * point to a physically contiguous block of memory.
19548          */
19549         uint64_t        resp_addr;
19550         /*
19551          * Function ID of the function that is being queried.
19552          * Only valid for a VF FID queried by the PF.
19553          */
19554         uint16_t        fid;
19555         uint8_t unused_0[2];
19556         /*
19557          * Maximum number of VLAN entries the firmware is allowed to DMA
19558          * to vlan_tag_mask_tbl.
19559          */
19560         uint32_t        max_vlan_entries;
19561         /*
19562          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
19563          * antispoof table to which firmware will DMA to. Each table
19564          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
19565          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
19566          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
19567          * the mask value should be 0xfff for the 12-bit VLAN ID.
19568          */
19569         uint64_t        vlan_tag_mask_tbl_addr;
19570 } __attribute__((packed));
19571
19572 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
19573 struct hwrm_cfa_vlan_antispoof_qcfg_output {
19574         /* The specific error status for the command. */
19575         uint16_t        error_code;
19576         /* The HWRM command request type. */
19577         uint16_t        req_type;
19578         /* The sequence ID from the original command. */
19579         uint16_t        seq_id;
19580         /* The length of the response data in number of bytes. */
19581         uint16_t        resp_len;
19582         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
19583         uint32_t        num_vlan_entries;
19584         uint8_t unused_0[3];
19585         /*
19586          * This field is used in Output records to indicate that the output
19587          * is completely written to RAM.  This field should be read as '1'
19588          * to indicate that the output has been completely written.
19589          * When writing a command completion or response to an internal processor,
19590          * the order of writes has to be such that this field is written last.
19591          */
19592         uint8_t valid;
19593 } __attribute__((packed));
19594
19595 /********************************
19596  * hwrm_cfa_ntuple_filter_alloc *
19597  ********************************/
19598
19599
19600 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
19601 struct hwrm_cfa_ntuple_filter_alloc_input {
19602         /* The HWRM command request type. */
19603         uint16_t        req_type;
19604         /*
19605          * The completion ring to send the completion event on. This should
19606          * be the NQ ID returned from the `nq_alloc` HWRM command.
19607          */
19608         uint16_t        cmpl_ring;
19609         /*
19610          * The sequence ID is used by the driver for tracking multiple
19611          * commands. This ID is treated as opaque data by the firmware and
19612          * the value is returned in the `hwrm_resp_hdr` upon completion.
19613          */
19614         uint16_t        seq_id;
19615         /*
19616          * The target ID of the command:
19617          * * 0x0-0xFFF8 - The function ID
19618          * * 0xFFF8-0xFFFE - Reserved for internal processors
19619          * * 0xFFFF - HWRM
19620          */
19621         uint16_t        target_id;
19622         /*
19623          * A physical address pointer pointing to a host buffer that the
19624          * command's response data will be written. This can be either a host
19625          * physical address (HPA) or a guest physical address (GPA) and must
19626          * point to a physically contiguous block of memory.
19627          */
19628         uint64_t        resp_addr;
19629         uint32_t        flags;
19630         /* Setting of this flag indicates the applicability to the loopback path. */
19631         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
19632                 UINT32_C(0x1)
19633         /*
19634          * Setting of this flag indicates drop action. If this flag is not set,
19635          * then it should be considered accept action.
19636          */
19637         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
19638                 UINT32_C(0x2)
19639         /*
19640          * Setting of this flag indicates that a meter is expected to be attached
19641          * to this flow. This hint can be used when choosing the action record
19642          * format required for the flow.
19643          */
19644         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
19645                 UINT32_C(0x4)
19646         uint32_t        enables;
19647         /*
19648          * This bit must be '1' for the l2_filter_id field to be
19649          * configured.
19650          */
19651         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
19652                 UINT32_C(0x1)
19653         /*
19654          * This bit must be '1' for the ethertype field to be
19655          * configured.
19656          */
19657         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
19658                 UINT32_C(0x2)
19659         /*
19660          * This bit must be '1' for the tunnel_type field to be
19661          * configured.
19662          */
19663         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
19664                 UINT32_C(0x4)
19665         /*
19666          * This bit must be '1' for the src_macaddr field to be
19667          * configured.
19668          */
19669         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
19670                 UINT32_C(0x8)
19671         /*
19672          * This bit must be '1' for the ipaddr_type field to be
19673          * configured.
19674          */
19675         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
19676                 UINT32_C(0x10)
19677         /*
19678          * This bit must be '1' for the src_ipaddr field to be
19679          * configured.
19680          */
19681         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
19682                 UINT32_C(0x20)
19683         /*
19684          * This bit must be '1' for the src_ipaddr_mask field to be
19685          * configured.
19686          */
19687         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
19688                 UINT32_C(0x40)
19689         /*
19690          * This bit must be '1' for the dst_ipaddr field to be
19691          * configured.
19692          */
19693         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
19694                 UINT32_C(0x80)
19695         /*
19696          * This bit must be '1' for the dst_ipaddr_mask field to be
19697          * configured.
19698          */
19699         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
19700                 UINT32_C(0x100)
19701         /*
19702          * This bit must be '1' for the ip_protocol field to be
19703          * configured.
19704          */
19705         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
19706                 UINT32_C(0x200)
19707         /*
19708          * This bit must be '1' for the src_port field to be
19709          * configured.
19710          */
19711         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
19712                 UINT32_C(0x400)
19713         /*
19714          * This bit must be '1' for the src_port_mask field to be
19715          * configured.
19716          */
19717         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
19718                 UINT32_C(0x800)
19719         /*
19720          * This bit must be '1' for the dst_port field to be
19721          * configured.
19722          */
19723         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
19724                 UINT32_C(0x1000)
19725         /*
19726          * This bit must be '1' for the dst_port_mask field to be
19727          * configured.
19728          */
19729         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
19730                 UINT32_C(0x2000)
19731         /*
19732          * This bit must be '1' for the pri_hint field to be
19733          * configured.
19734          */
19735         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
19736                 UINT32_C(0x4000)
19737         /*
19738          * This bit must be '1' for the ntuple_filter_id field to be
19739          * configured.
19740          */
19741         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
19742                 UINT32_C(0x8000)
19743         /*
19744          * This bit must be '1' for the dst_id field to be
19745          * configured.
19746          */
19747         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
19748                 UINT32_C(0x10000)
19749         /*
19750          * This bit must be '1' for the mirror_vnic_id field to be
19751          * configured.
19752          */
19753         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
19754                 UINT32_C(0x20000)
19755         /*
19756          * This bit must be '1' for the dst_macaddr field to be
19757          * configured.
19758          */
19759         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
19760                 UINT32_C(0x40000)
19761         /*
19762          * This value identifies a set of CFA data structures used for an L2
19763          * context.
19764          */
19765         uint64_t        l2_filter_id;
19766         /*
19767          * This value indicates the source MAC address in
19768          * the Ethernet header.
19769          */
19770         uint8_t src_macaddr[6];
19771         /* This value indicates the ethertype in the Ethernet header. */
19772         uint16_t        ethertype;
19773         /*
19774          * This value indicates the type of IP address.
19775          * 4 - IPv4
19776          * 6 - IPv6
19777          * All others are invalid.
19778          */
19779         uint8_t ip_addr_type;
19780         /* invalid */
19781         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
19782                 UINT32_C(0x0)
19783         /* IPv4 */
19784         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
19785                 UINT32_C(0x4)
19786         /* IPv6 */
19787         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
19788                 UINT32_C(0x6)
19789         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
19790                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
19791         /*
19792          * The value of protocol filed in IP header.
19793          * Applies to UDP and TCP traffic.
19794          * 6 - TCP
19795          * 17 - UDP
19796          */
19797         uint8_t ip_protocol;
19798         /* invalid */
19799         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
19800                 UINT32_C(0x0)
19801         /* TCP */
19802         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
19803                 UINT32_C(0x6)
19804         /* UDP */
19805         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
19806                 UINT32_C(0x11)
19807         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
19808                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
19809         /*
19810          * If set, this value shall represent the
19811          * Logical VNIC ID of the destination VNIC for the RX
19812          * path and network port id of the destination port for
19813          * the TX path.
19814          */
19815         uint16_t        dst_id;
19816         /*
19817          * Logical VNIC ID of the VNIC where traffic is
19818          * mirrored.
19819          */
19820         uint16_t        mirror_vnic_id;
19821         /*
19822          * This value indicates the tunnel type for this filter.
19823          * If this field is not specified, then the filter shall
19824          * apply to both non-tunneled and tunneled packets.
19825          * If this field conflicts with the tunnel_type specified
19826          * in the l2_filter_id, then the HWRM shall return an
19827          * error for this command.
19828          */
19829         uint8_t tunnel_type;
19830         /* Non-tunnel */
19831         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
19832                 UINT32_C(0x0)
19833         /* Virtual eXtensible Local Area Network (VXLAN) */
19834         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
19835                 UINT32_C(0x1)
19836         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
19837         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
19838                 UINT32_C(0x2)
19839         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
19840         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
19841                 UINT32_C(0x3)
19842         /* IP in IP */
19843         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
19844                 UINT32_C(0x4)
19845         /* Generic Network Virtualization Encapsulation (Geneve) */
19846         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
19847                 UINT32_C(0x5)
19848         /* Multi-Protocol Lable Switching (MPLS) */
19849         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
19850                 UINT32_C(0x6)
19851         /* Stateless Transport Tunnel (STT) */
19852         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
19853                 UINT32_C(0x7)
19854         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
19855         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
19856                 UINT32_C(0x8)
19857         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
19858         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
19859                 UINT32_C(0x9)
19860         /* Any tunneled traffic */
19861         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
19862                 UINT32_C(0xff)
19863         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
19864                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
19865         /*
19866          * This hint is provided to help in placing
19867          * the filter in the filter table.
19868          */
19869         uint8_t pri_hint;
19870         /* No preference */
19871         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
19872                 UINT32_C(0x0)
19873         /* Above the given filter */
19874         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
19875                 UINT32_C(0x1)
19876         /* Below the given filter */
19877         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
19878                 UINT32_C(0x2)
19879         /* As high as possible */
19880         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
19881                 UINT32_C(0x3)
19882         /* As low as possible */
19883         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
19884                 UINT32_C(0x4)
19885         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
19886                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
19887         /*
19888          * The value of source IP address to be used in filtering.
19889          * For IPv4, first four bytes represent the IP address.
19890          */
19891         uint32_t        src_ipaddr[4];
19892         /*
19893          * The value of source IP address mask to be used in
19894          * filtering.
19895          * For IPv4, first four bytes represent the IP address mask.
19896          */
19897         uint32_t        src_ipaddr_mask[4];
19898         /*
19899          * The value of destination IP address to be used in filtering.
19900          * For IPv4, first four bytes represent the IP address.
19901          */
19902         uint32_t        dst_ipaddr[4];
19903         /*
19904          * The value of destination IP address mask to be used in
19905          * filtering.
19906          * For IPv4, first four bytes represent the IP address mask.
19907          */
19908         uint32_t        dst_ipaddr_mask[4];
19909         /*
19910          * The value of source port to be used in filtering.
19911          * Applies to UDP and TCP traffic.
19912          */
19913         uint16_t        src_port;
19914         /*
19915          * The value of source port mask to be used in filtering.
19916          * Applies to UDP and TCP traffic.
19917          */
19918         uint16_t        src_port_mask;
19919         /*
19920          * The value of destination port to be used in filtering.
19921          * Applies to UDP and TCP traffic.
19922          */
19923         uint16_t        dst_port;
19924         /*
19925          * The value of destination port mask to be used in
19926          * filtering.
19927          * Applies to UDP and TCP traffic.
19928          */
19929         uint16_t        dst_port_mask;
19930         /*
19931          * This is the ID of the filter that goes along with
19932          * the pri_hint.
19933          */
19934         uint64_t        ntuple_filter_id_hint;
19935 } __attribute__((packed));
19936
19937 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
19938 struct hwrm_cfa_ntuple_filter_alloc_output {
19939         /* The specific error status for the command. */
19940         uint16_t        error_code;
19941         /* The HWRM command request type. */
19942         uint16_t        req_type;
19943         /* The sequence ID from the original command. */
19944         uint16_t        seq_id;
19945         /* The length of the response data in number of bytes. */
19946         uint16_t        resp_len;
19947         /* This value is an opaque id into CFA data structures. */
19948         uint64_t        ntuple_filter_id;
19949         /*
19950          * This is the ID of the flow associated with this
19951          * filter.
19952          * This value shall be used to match and associate the
19953          * flow identifier returned in completion records.
19954          * A value of 0xFFFFFFFF shall indicate no flow id.
19955          */
19956         uint32_t        flow_id;
19957         uint8_t unused_0[3];
19958         /*
19959          * This field is used in Output records to indicate that the output
19960          * is completely written to RAM.  This field should be read as '1'
19961          * to indicate that the output has been completely written.
19962          * When writing a command completion or response to an internal processor,
19963          * the order of writes has to be such that this field is written last.
19964          */
19965         uint8_t valid;
19966 } __attribute__((packed));
19967
19968 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
19969 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
19970         /*
19971          * command specific error codes that goes to
19972          * the cmd_err field in Common HWRM Error Response.
19973          */
19974         uint8_t code;
19975         /* Unknown error */
19976         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
19977                 UINT32_C(0x0)
19978         /* Unable to complete operation due to conflict with Rx Mask VLAN */
19979         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
19980                 UINT32_C(0x1)
19981         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
19982                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
19983         uint8_t unused_0[7];
19984 } __attribute__((packed));
19985
19986 /*******************************
19987  * hwrm_cfa_ntuple_filter_free *
19988  *******************************/
19989
19990
19991 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
19992 struct hwrm_cfa_ntuple_filter_free_input {
19993         /* The HWRM command request type. */
19994         uint16_t        req_type;
19995         /*
19996          * The completion ring to send the completion event on. This should
19997          * be the NQ ID returned from the `nq_alloc` HWRM command.
19998          */
19999         uint16_t        cmpl_ring;
20000         /*
20001          * The sequence ID is used by the driver for tracking multiple
20002          * commands. This ID is treated as opaque data by the firmware and
20003          * the value is returned in the `hwrm_resp_hdr` upon completion.
20004          */
20005         uint16_t        seq_id;
20006         /*
20007          * The target ID of the command:
20008          * * 0x0-0xFFF8 - The function ID
20009          * * 0xFFF8-0xFFFE - Reserved for internal processors
20010          * * 0xFFFF - HWRM
20011          */
20012         uint16_t        target_id;
20013         /*
20014          * A physical address pointer pointing to a host buffer that the
20015          * command's response data will be written. This can be either a host
20016          * physical address (HPA) or a guest physical address (GPA) and must
20017          * point to a physically contiguous block of memory.
20018          */
20019         uint64_t        resp_addr;
20020         /* This value is an opaque id into CFA data structures. */
20021         uint64_t        ntuple_filter_id;
20022 } __attribute__((packed));
20023
20024 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
20025 struct hwrm_cfa_ntuple_filter_free_output {
20026         /* The specific error status for the command. */
20027         uint16_t        error_code;
20028         /* The HWRM command request type. */
20029         uint16_t        req_type;
20030         /* The sequence ID from the original command. */
20031         uint16_t        seq_id;
20032         /* The length of the response data in number of bytes. */
20033         uint16_t        resp_len;
20034         uint8_t unused_0[7];
20035         /*
20036          * This field is used in Output records to indicate that the output
20037          * is completely written to RAM.  This field should be read as '1'
20038          * to indicate that the output has been completely written.
20039          * When writing a command completion or response to an internal processor,
20040          * the order of writes has to be such that this field is written last.
20041          */
20042         uint8_t valid;
20043 } __attribute__((packed));
20044
20045 /******************************
20046  * hwrm_cfa_ntuple_filter_cfg *
20047  ******************************/
20048
20049
20050 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
20051 struct hwrm_cfa_ntuple_filter_cfg_input {
20052         /* The HWRM command request type. */
20053         uint16_t        req_type;
20054         /*
20055          * The completion ring to send the completion event on. This should
20056          * be the NQ ID returned from the `nq_alloc` HWRM command.
20057          */
20058         uint16_t        cmpl_ring;
20059         /*
20060          * The sequence ID is used by the driver for tracking multiple
20061          * commands. This ID is treated as opaque data by the firmware and
20062          * the value is returned in the `hwrm_resp_hdr` upon completion.
20063          */
20064         uint16_t        seq_id;
20065         /*
20066          * The target ID of the command:
20067          * * 0x0-0xFFF8 - The function ID
20068          * * 0xFFF8-0xFFFE - Reserved for internal processors
20069          * * 0xFFFF - HWRM
20070          */
20071         uint16_t        target_id;
20072         /*
20073          * A physical address pointer pointing to a host buffer that the
20074          * command's response data will be written. This can be either a host
20075          * physical address (HPA) or a guest physical address (GPA) and must
20076          * point to a physically contiguous block of memory.
20077          */
20078         uint64_t        resp_addr;
20079         uint32_t        enables;
20080         /*
20081          * This bit must be '1' for the new_dst_id field to be
20082          * configured.
20083          */
20084         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
20085                 UINT32_C(0x1)
20086         /*
20087          * This bit must be '1' for the new_mirror_vnic_id field to be
20088          * configured.
20089          */
20090         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
20091                 UINT32_C(0x2)
20092         /*
20093          * This bit must be '1' for the new_meter_instance_id field to be
20094          * configured.
20095          */
20096         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
20097                 UINT32_C(0x4)
20098         uint8_t unused_0[4];
20099         /* This value is an opaque id into CFA data structures. */
20100         uint64_t        ntuple_filter_id;
20101         /*
20102          * If set, this value shall represent the new
20103          * Logical VNIC ID of the destination VNIC for the RX
20104          * path and new network port id of the destination port for
20105          * the TX path.
20106          */
20107         uint32_t        new_dst_id;
20108         /*
20109          * New Logical VNIC ID of the VNIC where traffic is
20110          * mirrored.
20111          */
20112         uint32_t        new_mirror_vnic_id;
20113         /*
20114          * New meter to attach to the flow. Specifying the
20115          * invalid instance ID is used to remove any existing
20116          * meter from the flow.
20117          */
20118         uint16_t        new_meter_instance_id;
20119         /*
20120          * A value of 0xfff is considered invalid and implies the
20121          * instance is not configured.
20122          */
20123         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
20124                 UINT32_C(0xffff)
20125         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
20126                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
20127         uint8_t unused_1[6];
20128 } __attribute__((packed));
20129
20130 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
20131 struct hwrm_cfa_ntuple_filter_cfg_output {
20132         /* The specific error status for the command. */
20133         uint16_t        error_code;
20134         /* The HWRM command request type. */
20135         uint16_t        req_type;
20136         /* The sequence ID from the original command. */
20137         uint16_t        seq_id;
20138         /* The length of the response data in number of bytes. */
20139         uint16_t        resp_len;
20140         uint8_t unused_0[7];
20141         /*
20142          * This field is used in Output records to indicate that the output
20143          * is completely written to RAM.  This field should be read as '1'
20144          * to indicate that the output has been completely written.
20145          * When writing a command completion or response to an internal processor,
20146          * the order of writes has to be such that this field is written last.
20147          */
20148         uint8_t valid;
20149 } __attribute__((packed));
20150
20151 /**************************
20152  * hwrm_cfa_em_flow_alloc *
20153  **************************/
20154
20155
20156 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
20157 struct hwrm_cfa_em_flow_alloc_input {
20158         /* The HWRM command request type. */
20159         uint16_t        req_type;
20160         /*
20161          * The completion ring to send the completion event on. This should
20162          * be the NQ ID returned from the `nq_alloc` HWRM command.
20163          */
20164         uint16_t        cmpl_ring;
20165         /*
20166          * The sequence ID is used by the driver for tracking multiple
20167          * commands. This ID is treated as opaque data by the firmware and
20168          * the value is returned in the `hwrm_resp_hdr` upon completion.
20169          */
20170         uint16_t        seq_id;
20171         /*
20172          * The target ID of the command:
20173          * * 0x0-0xFFF8 - The function ID
20174          * * 0xFFF8-0xFFFE - Reserved for internal processors
20175          * * 0xFFFF - HWRM
20176          */
20177         uint16_t        target_id;
20178         /*
20179          * A physical address pointer pointing to a host buffer that the
20180          * command's response data will be written. This can be either a host
20181          * physical address (HPA) or a guest physical address (GPA) and must
20182          * point to a physically contiguous block of memory.
20183          */
20184         uint64_t        resp_addr;
20185         uint32_t        flags;
20186         /*
20187          * Enumeration denoting the RX, TX type of the resource.
20188          * This enumeration is used for resources that are similar for both
20189          * TX and RX paths of the chip.
20190          */
20191         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
20192         /* tx path */
20193         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
20194         /* rx path */
20195         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
20196         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
20197                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
20198         /*
20199          * Setting of this flag indicates enabling of a byte counter for a given
20200          * flow.
20201          */
20202         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
20203         /*
20204          * Setting of this flag indicates enabling of a packet counter for a given
20205          * flow.
20206          */
20207         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
20208         /* Setting of this flag indicates de-capsulation action for the given flow. */
20209         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
20210         /* Setting of this flag indicates encapsulation action for the given flow. */
20211         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
20212         /*
20213          * Setting of this flag indicates drop action. If this flag is not set,
20214          * then it should be considered accept action.
20215          */
20216         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
20217         /*
20218          * Setting of this flag indicates that a meter is expected to be attached
20219          * to this flow. This hint can be used when choosing the action record
20220          * format required for the flow.
20221          */
20222         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
20223         uint32_t        enables;
20224         /*
20225          * This bit must be '1' for the l2_filter_id field to be
20226          * configured.
20227          */
20228         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
20229                 UINT32_C(0x1)
20230         /*
20231          * This bit must be '1' for the tunnel_type field to be
20232          * configured.
20233          */
20234         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
20235                 UINT32_C(0x2)
20236         /*
20237          * This bit must be '1' for the tunnel_id field to be
20238          * configured.
20239          */
20240         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
20241                 UINT32_C(0x4)
20242         /*
20243          * This bit must be '1' for the src_macaddr field to be
20244          * configured.
20245          */
20246         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
20247                 UINT32_C(0x8)
20248         /*
20249          * This bit must be '1' for the dst_macaddr field to be
20250          * configured.
20251          */
20252         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
20253                 UINT32_C(0x10)
20254         /*
20255          * This bit must be '1' for the ovlan_vid field to be
20256          * configured.
20257          */
20258         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
20259                 UINT32_C(0x20)
20260         /*
20261          * This bit must be '1' for the ivlan_vid field to be
20262          * configured.
20263          */
20264         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
20265                 UINT32_C(0x40)
20266         /*
20267          * This bit must be '1' for the ethertype field to be
20268          * configured.
20269          */
20270         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
20271                 UINT32_C(0x80)
20272         /*
20273          * This bit must be '1' for the src_ipaddr field to be
20274          * configured.
20275          */
20276         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
20277                 UINT32_C(0x100)
20278         /*
20279          * This bit must be '1' for the dst_ipaddr field to be
20280          * configured.
20281          */
20282         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
20283                 UINT32_C(0x200)
20284         /*
20285          * This bit must be '1' for the ipaddr_type field to be
20286          * configured.
20287          */
20288         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
20289                 UINT32_C(0x400)
20290         /*
20291          * This bit must be '1' for the ip_protocol field to be
20292          * configured.
20293          */
20294         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
20295                 UINT32_C(0x800)
20296         /*
20297          * This bit must be '1' for the src_port field to be
20298          * configured.
20299          */
20300         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
20301                 UINT32_C(0x1000)
20302         /*
20303          * This bit must be '1' for the dst_port field to be
20304          * configured.
20305          */
20306         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
20307                 UINT32_C(0x2000)
20308         /*
20309          * This bit must be '1' for the dst_id field to be
20310          * configured.
20311          */
20312         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
20313                 UINT32_C(0x4000)
20314         /*
20315          * This bit must be '1' for the mirror_vnic_id field to be
20316          * configured.
20317          */
20318         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
20319                 UINT32_C(0x8000)
20320         /*
20321          * This bit must be '1' for the encap_record_id field to be
20322          * configured.
20323          */
20324         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
20325                 UINT32_C(0x10000)
20326         /*
20327          * This bit must be '1' for the meter_instance_id field to be
20328          * configured.
20329          */
20330         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
20331                 UINT32_C(0x20000)
20332         /*
20333          * This value identifies a set of CFA data structures used for an L2
20334          * context.
20335          */
20336         uint64_t        l2_filter_id;
20337         /* Tunnel Type. */
20338         uint8_t tunnel_type;
20339         /* Non-tunnel */
20340         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
20341                 UINT32_C(0x0)
20342         /* Virtual eXtensible Local Area Network (VXLAN) */
20343         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
20344                 UINT32_C(0x1)
20345         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
20346         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
20347                 UINT32_C(0x2)
20348         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
20349         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
20350                 UINT32_C(0x3)
20351         /* IP in IP */
20352         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
20353                 UINT32_C(0x4)
20354         /* Generic Network Virtualization Encapsulation (Geneve) */
20355         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
20356                 UINT32_C(0x5)
20357         /* Multi-Protocol Lable Switching (MPLS) */
20358         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
20359                 UINT32_C(0x6)
20360         /* Stateless Transport Tunnel (STT) */
20361         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
20362                 UINT32_C(0x7)
20363         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
20364         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
20365                 UINT32_C(0x8)
20366         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
20367         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
20368                 UINT32_C(0x9)
20369         /* Any tunneled traffic */
20370         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
20371                 UINT32_C(0xff)
20372         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
20373                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
20374         uint8_t unused_0[3];
20375         /*
20376          * Tunnel identifier.
20377          * Virtual Network Identifier (VNI). Only valid with
20378          * tunnel_types VXLAN, NVGRE, and Geneve.
20379          * Only lower 24-bits of VNI field are used
20380          * in setting up the filter.
20381          */
20382         uint32_t        tunnel_id;
20383         /*
20384          * This value indicates the source MAC address in
20385          * the Ethernet header.
20386          */
20387         uint8_t src_macaddr[6];
20388         /* The meter instance to attach to the flow. */
20389         uint16_t        meter_instance_id;
20390         /*
20391          * A value of 0xfff is considered invalid and implies the
20392          * instance is not configured.
20393          */
20394         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
20395                 UINT32_C(0xffff)
20396         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
20397                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
20398         /*
20399          * This value indicates the destination MAC address in
20400          * the Ethernet header.
20401          */
20402         uint8_t dst_macaddr[6];
20403         /*
20404          * This value indicates the VLAN ID of the outer VLAN tag
20405          * in the Ethernet header.
20406          */
20407         uint16_t        ovlan_vid;
20408         /*
20409          * This value indicates the VLAN ID of the inner VLAN tag
20410          * in the Ethernet header.
20411          */
20412         uint16_t        ivlan_vid;
20413         /* This value indicates the ethertype in the Ethernet header. */
20414         uint16_t        ethertype;
20415         /*
20416          * This value indicates the type of IP address.
20417          * 4 - IPv4
20418          * 6 - IPv6
20419          * All others are invalid.
20420          */
20421         uint8_t ip_addr_type;
20422         /* invalid */
20423         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
20424         /* IPv4 */
20425         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
20426         /* IPv6 */
20427         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
20428         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
20429                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
20430         /*
20431          * The value of protocol filed in IP header.
20432          * Applies to UDP and TCP traffic.
20433          * 6 - TCP
20434          * 17 - UDP
20435          */
20436         uint8_t ip_protocol;
20437         /* invalid */
20438         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
20439         /* TCP */
20440         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
20441         /* UDP */
20442         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
20443         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
20444                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
20445         uint8_t unused_1[2];
20446         /*
20447          * The value of source IP address to be used in filtering.
20448          * For IPv4, first four bytes represent the IP address.
20449          */
20450         uint32_t        src_ipaddr[4];
20451         /*
20452          * big_endian = True
20453          *     The value of destination IP address to be used in filtering.
20454          *     For IPv4, first four bytes represent the IP address.
20455          */
20456         uint32_t        dst_ipaddr[4];
20457         /*
20458          * The value of source port to be used in filtering.
20459          * Applies to UDP and TCP traffic.
20460          */
20461         uint16_t        src_port;
20462         /*
20463          * The value of destination port to be used in filtering.
20464          * Applies to UDP and TCP traffic.
20465          */
20466         uint16_t        dst_port;
20467         /*
20468          * If set, this value shall represent the
20469          * Logical VNIC ID of the destination VNIC for the RX
20470          * path and network port id of the destination port for
20471          * the TX path.
20472          */
20473         uint16_t        dst_id;
20474         /*
20475          * Logical VNIC ID of the VNIC where traffic is
20476          * mirrored.
20477          */
20478         uint16_t        mirror_vnic_id;
20479         /* Logical ID of the encapsulation record. */
20480         uint32_t        encap_record_id;
20481         uint8_t unused_2[4];
20482 } __attribute__((packed));
20483
20484 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
20485 struct hwrm_cfa_em_flow_alloc_output {
20486         /* The specific error status for the command. */
20487         uint16_t        error_code;
20488         /* The HWRM command request type. */
20489         uint16_t        req_type;
20490         /* The sequence ID from the original command. */
20491         uint16_t        seq_id;
20492         /* The length of the response data in number of bytes. */
20493         uint16_t        resp_len;
20494         /* This value is an opaque id into CFA data structures. */
20495         uint64_t        em_filter_id;
20496         /*
20497          * This is the ID of the flow associated with this
20498          * filter.
20499          * This value shall be used to match and associate the
20500          * flow identifier returned in completion records.
20501          * A value of 0xFFFFFFFF shall indicate no flow id.
20502          */
20503         uint32_t        flow_id;
20504         uint8_t unused_0[3];
20505         /*
20506          * This field is used in Output records to indicate that the output
20507          * is completely written to RAM.  This field should be read as '1'
20508          * to indicate that the output has been completely written.
20509          * When writing a command completion or response to an internal processor,
20510          * the order of writes has to be such that this field is written last.
20511          */
20512         uint8_t valid;
20513 } __attribute__((packed));
20514
20515 /*************************
20516  * hwrm_cfa_em_flow_free *
20517  *************************/
20518
20519
20520 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
20521 struct hwrm_cfa_em_flow_free_input {
20522         /* The HWRM command request type. */
20523         uint16_t        req_type;
20524         /*
20525          * The completion ring to send the completion event on. This should
20526          * be the NQ ID returned from the `nq_alloc` HWRM command.
20527          */
20528         uint16_t        cmpl_ring;
20529         /*
20530          * The sequence ID is used by the driver for tracking multiple
20531          * commands. This ID is treated as opaque data by the firmware and
20532          * the value is returned in the `hwrm_resp_hdr` upon completion.
20533          */
20534         uint16_t        seq_id;
20535         /*
20536          * The target ID of the command:
20537          * * 0x0-0xFFF8 - The function ID
20538          * * 0xFFF8-0xFFFE - Reserved for internal processors
20539          * * 0xFFFF - HWRM
20540          */
20541         uint16_t        target_id;
20542         /*
20543          * A physical address pointer pointing to a host buffer that the
20544          * command's response data will be written. This can be either a host
20545          * physical address (HPA) or a guest physical address (GPA) and must
20546          * point to a physically contiguous block of memory.
20547          */
20548         uint64_t        resp_addr;
20549         /* This value is an opaque id into CFA data structures. */
20550         uint64_t        em_filter_id;
20551 } __attribute__((packed));
20552
20553 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
20554 struct hwrm_cfa_em_flow_free_output {
20555         /* The specific error status for the command. */
20556         uint16_t        error_code;
20557         /* The HWRM command request type. */
20558         uint16_t        req_type;
20559         /* The sequence ID from the original command. */
20560         uint16_t        seq_id;
20561         /* The length of the response data in number of bytes. */
20562         uint16_t        resp_len;
20563         uint8_t unused_0[7];
20564         /*
20565          * This field is used in Output records to indicate that the output
20566          * is completely written to RAM.  This field should be read as '1'
20567          * to indicate that the output has been completely written.
20568          * When writing a command completion or response to an internal processor,
20569          * the order of writes has to be such that this field is written last.
20570          */
20571         uint8_t valid;
20572 } __attribute__((packed));
20573
20574 /************************
20575  * hwrm_cfa_em_flow_cfg *
20576  ************************/
20577
20578
20579 /* hwrm_cfa_em_flow_cfg_input (size:384b/48B) */
20580 struct hwrm_cfa_em_flow_cfg_input {
20581         /* The HWRM command request type. */
20582         uint16_t        req_type;
20583         /*
20584          * The completion ring to send the completion event on. This should
20585          * be the NQ ID returned from the `nq_alloc` HWRM command.
20586          */
20587         uint16_t        cmpl_ring;
20588         /*
20589          * The sequence ID is used by the driver for tracking multiple
20590          * commands. This ID is treated as opaque data by the firmware and
20591          * the value is returned in the `hwrm_resp_hdr` upon completion.
20592          */
20593         uint16_t        seq_id;
20594         /*
20595          * The target ID of the command:
20596          * * 0x0-0xFFF8 - The function ID
20597          * * 0xFFF8-0xFFFE - Reserved for internal processors
20598          * * 0xFFFF - HWRM
20599          */
20600         uint16_t        target_id;
20601         /*
20602          * A physical address pointer pointing to a host buffer that the
20603          * command's response data will be written. This can be either a host
20604          * physical address (HPA) or a guest physical address (GPA) and must
20605          * point to a physically contiguous block of memory.
20606          */
20607         uint64_t        resp_addr;
20608         uint32_t        enables;
20609         /*
20610          * This bit must be '1' for the new_dst_id field to be
20611          * configured.
20612          */
20613         #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_DST_ID \
20614                 UINT32_C(0x1)
20615         /*
20616          * This bit must be '1' for the new_mirror_vnic_id field to be
20617          * configured.
20618          */
20619         #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
20620                 UINT32_C(0x2)
20621         /*
20622          * This bit must be '1' for the new_meter_instance_id field to be
20623          * configured.
20624          */
20625         #define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
20626                 UINT32_C(0x4)
20627         uint8_t unused_0[4];
20628         /* This value is an opaque id into CFA data structures. */
20629         uint64_t        em_filter_id;
20630         /*
20631          * If set, this value shall represent the new
20632          * Logical VNIC ID of the destination VNIC for the RX
20633          * path and network port id of the destination port for
20634          * the TX path.
20635          */
20636         uint32_t        new_dst_id;
20637         /*
20638          * New Logical VNIC ID of the VNIC where traffic is
20639          * mirrored.
20640          */
20641         uint32_t        new_mirror_vnic_id;
20642         /*
20643          * New meter to attach to the flow. Specifying the
20644          * invalid instance ID is used to remove any existing
20645          * meter from the flow.
20646          */
20647         uint16_t        new_meter_instance_id;
20648         /*
20649          * A value of 0xfff is considered invalid and implies the
20650          * instance is not configured.
20651          */
20652         #define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
20653                 UINT32_C(0xffff)
20654         #define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
20655                 HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
20656         uint8_t unused_1[6];
20657 } __attribute__((packed));
20658
20659 /* hwrm_cfa_em_flow_cfg_output (size:128b/16B) */
20660 struct hwrm_cfa_em_flow_cfg_output {
20661         /* The specific error status for the command. */
20662         uint16_t        error_code;
20663         /* The HWRM command request type. */
20664         uint16_t        req_type;
20665         /* The sequence ID from the original command. */
20666         uint16_t        seq_id;
20667         /* The length of the response data in number of bytes. */
20668         uint16_t        resp_len;
20669         uint8_t unused_0[7];
20670         /*
20671          * This field is used in Output records to indicate that the output
20672          * is completely written to RAM.  This field should be read as '1'
20673          * to indicate that the output has been completely written.
20674          * When writing a command completion or response to an internal processor,
20675          * the order of writes has to be such that this field is written last.
20676          */
20677         uint8_t valid;
20678 } __attribute__((packed));
20679
20680 /******************************
20681  * hwrm_tunnel_dst_port_query *
20682  ******************************/
20683
20684
20685 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
20686 struct hwrm_tunnel_dst_port_query_input {
20687         /* The HWRM command request type. */
20688         uint16_t        req_type;
20689         /*
20690          * The completion ring to send the completion event on. This should
20691          * be the NQ ID returned from the `nq_alloc` HWRM command.
20692          */
20693         uint16_t        cmpl_ring;
20694         /*
20695          * The sequence ID is used by the driver for tracking multiple
20696          * commands. This ID is treated as opaque data by the firmware and
20697          * the value is returned in the `hwrm_resp_hdr` upon completion.
20698          */
20699         uint16_t        seq_id;
20700         /*
20701          * The target ID of the command:
20702          * * 0x0-0xFFF8 - The function ID
20703          * * 0xFFF8-0xFFFE - Reserved for internal processors
20704          * * 0xFFFF - HWRM
20705          */
20706         uint16_t        target_id;
20707         /*
20708          * A physical address pointer pointing to a host buffer that the
20709          * command's response data will be written. This can be either a host
20710          * physical address (HPA) or a guest physical address (GPA) and must
20711          * point to a physically contiguous block of memory.
20712          */
20713         uint64_t        resp_addr;
20714         /* Tunnel Type. */
20715         uint8_t tunnel_type;
20716         /* Virtual eXtensible Local Area Network (VXLAN) */
20717         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
20718                 UINT32_C(0x1)
20719         /* Generic Network Virtualization Encapsulation (Geneve) */
20720         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
20721                 UINT32_C(0x5)
20722         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
20723         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
20724                 UINT32_C(0x9)
20725         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
20726         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
20727                 UINT32_C(0xa)
20728         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
20729                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1
20730         uint8_t unused_0[7];
20731 } __attribute__((packed));
20732
20733 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
20734 struct hwrm_tunnel_dst_port_query_output {
20735         /* The specific error status for the command. */
20736         uint16_t        error_code;
20737         /* The HWRM command request type. */
20738         uint16_t        req_type;
20739         /* The sequence ID from the original command. */
20740         uint16_t        seq_id;
20741         /* The length of the response data in number of bytes. */
20742         uint16_t        resp_len;
20743         /*
20744          * This field represents the identifier of L4 destination port
20745          * used for the given tunnel type. This field is valid for
20746          * specific tunnel types that use layer 4 (e.g. UDP)
20747          * transports for tunneling.
20748          */
20749         uint16_t        tunnel_dst_port_id;
20750         /*
20751          * This field represents the value of L4 destination port
20752          * identified by tunnel_dst_port_id. This field is valid for
20753          * specific tunnel types that use layer 4 (e.g. UDP)
20754          * transports for tunneling.
20755          * This field is in network byte order.
20756          *
20757          * A value of 0 means that the destination port is not
20758          * configured.
20759          */
20760         uint16_t        tunnel_dst_port_val;
20761         uint8_t unused_0[3];
20762         /*
20763          * This field is used in Output records to indicate that the output
20764          * is completely written to RAM.  This field should be read as '1'
20765          * to indicate that the output has been completely written.
20766          * When writing a command completion or response to an internal processor,
20767          * the order of writes has to be such that this field is written last.
20768          */
20769         uint8_t valid;
20770 } __attribute__((packed));
20771
20772 /******************************
20773  * hwrm_tunnel_dst_port_alloc *
20774  ******************************/
20775
20776
20777 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
20778 struct hwrm_tunnel_dst_port_alloc_input {
20779         /* The HWRM command request type. */
20780         uint16_t        req_type;
20781         /*
20782          * The completion ring to send the completion event on. This should
20783          * be the NQ ID returned from the `nq_alloc` HWRM command.
20784          */
20785         uint16_t        cmpl_ring;
20786         /*
20787          * The sequence ID is used by the driver for tracking multiple
20788          * commands. This ID is treated as opaque data by the firmware and
20789          * the value is returned in the `hwrm_resp_hdr` upon completion.
20790          */
20791         uint16_t        seq_id;
20792         /*
20793          * The target ID of the command:
20794          * * 0x0-0xFFF8 - The function ID
20795          * * 0xFFF8-0xFFFE - Reserved for internal processors
20796          * * 0xFFFF - HWRM
20797          */
20798         uint16_t        target_id;
20799         /*
20800          * A physical address pointer pointing to a host buffer that the
20801          * command's response data will be written. This can be either a host
20802          * physical address (HPA) or a guest physical address (GPA) and must
20803          * point to a physically contiguous block of memory.
20804          */
20805         uint64_t        resp_addr;
20806         /* Tunnel Type. */
20807         uint8_t tunnel_type;
20808         /* Virtual eXtensible Local Area Network (VXLAN) */
20809         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
20810                 UINT32_C(0x1)
20811         /* Generic Network Virtualization Encapsulation (Geneve) */
20812         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
20813                 UINT32_C(0x5)
20814         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
20815         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
20816                 UINT32_C(0x9)
20817         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
20818         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
20819                 UINT32_C(0xa)
20820         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
20821                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1
20822         uint8_t unused_0;
20823         /*
20824          * This field represents the value of L4 destination port used
20825          * for the given tunnel type. This field is valid for
20826          * specific tunnel types that use layer 4 (e.g. UDP)
20827          * transports for tunneling.
20828          *
20829          * This field is in network byte order.
20830          *
20831          * A value of 0 shall fail the command.
20832          */
20833         uint16_t        tunnel_dst_port_val;
20834         uint8_t unused_1[4];
20835 } __attribute__((packed));
20836
20837 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
20838 struct hwrm_tunnel_dst_port_alloc_output {
20839         /* The specific error status for the command. */
20840         uint16_t        error_code;
20841         /* The HWRM command request type. */
20842         uint16_t        req_type;
20843         /* The sequence ID from the original command. */
20844         uint16_t        seq_id;
20845         /* The length of the response data in number of bytes. */
20846         uint16_t        resp_len;
20847         /*
20848          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
20849          * types that has l4 destination port parameters.
20850          */
20851         uint16_t        tunnel_dst_port_id;
20852         uint8_t unused_0[5];
20853         /*
20854          * This field is used in Output records to indicate that the output
20855          * is completely written to RAM.  This field should be read as '1'
20856          * to indicate that the output has been completely written.
20857          * When writing a command completion or response to an internal processor,
20858          * the order of writes has to be such that this field is written last.
20859          */
20860         uint8_t valid;
20861 } __attribute__((packed));
20862
20863 /*****************************
20864  * hwrm_tunnel_dst_port_free *
20865  *****************************/
20866
20867
20868 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
20869 struct hwrm_tunnel_dst_port_free_input {
20870         /* The HWRM command request type. */
20871         uint16_t        req_type;
20872         /*
20873          * The completion ring to send the completion event on. This should
20874          * be the NQ ID returned from the `nq_alloc` HWRM command.
20875          */
20876         uint16_t        cmpl_ring;
20877         /*
20878          * The sequence ID is used by the driver for tracking multiple
20879          * commands. This ID is treated as opaque data by the firmware and
20880          * the value is returned in the `hwrm_resp_hdr` upon completion.
20881          */
20882         uint16_t        seq_id;
20883         /*
20884          * The target ID of the command:
20885          * * 0x0-0xFFF8 - The function ID
20886          * * 0xFFF8-0xFFFE - Reserved for internal processors
20887          * * 0xFFFF - HWRM
20888          */
20889         uint16_t        target_id;
20890         /*
20891          * A physical address pointer pointing to a host buffer that the
20892          * command's response data will be written. This can be either a host
20893          * physical address (HPA) or a guest physical address (GPA) and must
20894          * point to a physically contiguous block of memory.
20895          */
20896         uint64_t        resp_addr;
20897         /* Tunnel Type. */
20898         uint8_t tunnel_type;
20899         /* Virtual eXtensible Local Area Network (VXLAN) */
20900         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
20901                 UINT32_C(0x1)
20902         /* Generic Network Virtualization Encapsulation (Geneve) */
20903         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
20904                 UINT32_C(0x5)
20905         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
20906         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
20907                 UINT32_C(0x9)
20908         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
20909         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
20910                 UINT32_C(0xa)
20911         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
20912                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1
20913         uint8_t unused_0;
20914         /*
20915          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
20916          * types that has l4 destination port parameters.
20917          */
20918         uint16_t        tunnel_dst_port_id;
20919         uint8_t unused_1[4];
20920 } __attribute__((packed));
20921
20922 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
20923 struct hwrm_tunnel_dst_port_free_output {
20924         /* The specific error status for the command. */
20925         uint16_t        error_code;
20926         /* The HWRM command request type. */
20927         uint16_t        req_type;
20928         /* The sequence ID from the original command. */
20929         uint16_t        seq_id;
20930         /* The length of the response data in number of bytes. */
20931         uint16_t        resp_len;
20932         uint8_t unused_1[7];
20933         /*
20934          * This field is used in Output records to indicate that the output
20935          * is completely written to RAM.  This field should be read as '1'
20936          * to indicate that the output has been completely written.
20937          * When writing a command completion or response to an internal processor,
20938          * the order of writes has to be such that this field is written last.
20939          */
20940         uint8_t valid;
20941 } __attribute__((packed));
20942
20943 /* ctx_hw_stats (size:1280b/160B) */
20944 struct ctx_hw_stats {
20945         /* Number of received unicast packets */
20946         uint64_t        rx_ucast_pkts;
20947         /* Number of received multicast packets */
20948         uint64_t        rx_mcast_pkts;
20949         /* Number of received broadcast packets */
20950         uint64_t        rx_bcast_pkts;
20951         /* Number of discarded packets on received path */
20952         uint64_t        rx_discard_pkts;
20953         /* Number of dropped packets on received path */
20954         uint64_t        rx_drop_pkts;
20955         /* Number of received bytes for unicast traffic */
20956         uint64_t        rx_ucast_bytes;
20957         /* Number of received bytes for multicast traffic */
20958         uint64_t        rx_mcast_bytes;
20959         /* Number of received bytes for broadcast traffic */
20960         uint64_t        rx_bcast_bytes;
20961         /* Number of transmitted unicast packets */
20962         uint64_t        tx_ucast_pkts;
20963         /* Number of transmitted multicast packets */
20964         uint64_t        tx_mcast_pkts;
20965         /* Number of transmitted broadcast packets */
20966         uint64_t        tx_bcast_pkts;
20967         /* Number of discarded packets on transmit path */
20968         uint64_t        tx_discard_pkts;
20969         /* Number of dropped packets on transmit path */
20970         uint64_t        tx_drop_pkts;
20971         /* Number of transmitted bytes for unicast traffic */
20972         uint64_t        tx_ucast_bytes;
20973         /* Number of transmitted bytes for multicast traffic */
20974         uint64_t        tx_mcast_bytes;
20975         /* Number of transmitted bytes for broadcast traffic */
20976         uint64_t        tx_bcast_bytes;
20977         /* Number of TPA packets */
20978         uint64_t        tpa_pkts;
20979         /* Number of TPA bytes */
20980         uint64_t        tpa_bytes;
20981         /* Number of TPA events */
20982         uint64_t        tpa_events;
20983         /* Number of TPA aborts */
20984         uint64_t        tpa_aborts;
20985 } __attribute__((packed));
20986
20987 /***********************
20988  * hwrm_stat_ctx_alloc *
20989  ***********************/
20990
20991
20992 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
20993 struct hwrm_stat_ctx_alloc_input {
20994         /* The HWRM command request type. */
20995         uint16_t        req_type;
20996         /*
20997          * The completion ring to send the completion event on. This should
20998          * be the NQ ID returned from the `nq_alloc` HWRM command.
20999          */
21000         uint16_t        cmpl_ring;
21001         /*
21002          * The sequence ID is used by the driver for tracking multiple
21003          * commands. This ID is treated as opaque data by the firmware and
21004          * the value is returned in the `hwrm_resp_hdr` upon completion.
21005          */
21006         uint16_t        seq_id;
21007         /*
21008          * The target ID of the command:
21009          * * 0x0-0xFFF8 - The function ID
21010          * * 0xFFF8-0xFFFE - Reserved for internal processors
21011          * * 0xFFFF - HWRM
21012          */
21013         uint16_t        target_id;
21014         /*
21015          * A physical address pointer pointing to a host buffer that the
21016          * command's response data will be written. This can be either a host
21017          * physical address (HPA) or a guest physical address (GPA) and must
21018          * point to a physically contiguous block of memory.
21019          */
21020         uint64_t        resp_addr;
21021         /* This is the address for statistic block. */
21022         uint64_t        stats_dma_addr;
21023         /*
21024          * The statistic block update period in ms.
21025          * e.g. 250ms, 500ms, 750ms, 1000ms.
21026          * If update_period_ms is 0, then the stats update
21027          * shall be never done and the DMA address shall not be used.
21028          * In this case, the stat block can only be read by
21029          * hwrm_stat_ctx_query command.
21030          */
21031         uint32_t        update_period_ms;
21032         /*
21033          * This field is used to specify statistics context specific
21034          * configuration flags.
21035          */
21036         uint8_t stat_ctx_flags;
21037         /*
21038          * When this bit is set to '1', the statistics context shall be
21039          * allocated for RoCE traffic only. In this case, traffic other
21040          * than offloaded RoCE traffic shall not be included in this
21041          * statistic context.
21042          * When this bit is set to '0', the statistics context shall be
21043          * used for the network traffic other than offloaded RoCE traffic.
21044          */
21045         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
21046         uint8_t unused_0[3];
21047 } __attribute__((packed));
21048
21049 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
21050 struct hwrm_stat_ctx_alloc_output {
21051         /* The specific error status for the command. */
21052         uint16_t        error_code;
21053         /* The HWRM command request type. */
21054         uint16_t        req_type;
21055         /* The sequence ID from the original command. */
21056         uint16_t        seq_id;
21057         /* The length of the response data in number of bytes. */
21058         uint16_t        resp_len;
21059         /* This is the statistics context ID value. */
21060         uint32_t        stat_ctx_id;
21061         uint8_t unused_0[3];
21062         /*
21063          * This field is used in Output records to indicate that the output
21064          * is completely written to RAM.  This field should be read as '1'
21065          * to indicate that the output has been completely written.
21066          * When writing a command completion or response to an internal processor,
21067          * the order of writes has to be such that this field is written last.
21068          */
21069         uint8_t valid;
21070 } __attribute__((packed));
21071
21072 /**********************
21073  * hwrm_stat_ctx_free *
21074  **********************/
21075
21076
21077 /* hwrm_stat_ctx_free_input (size:192b/24B) */
21078 struct hwrm_stat_ctx_free_input {
21079         /* The HWRM command request type. */
21080         uint16_t        req_type;
21081         /*
21082          * The completion ring to send the completion event on. This should
21083          * be the NQ ID returned from the `nq_alloc` HWRM command.
21084          */
21085         uint16_t        cmpl_ring;
21086         /*
21087          * The sequence ID is used by the driver for tracking multiple
21088          * commands. This ID is treated as opaque data by the firmware and
21089          * the value is returned in the `hwrm_resp_hdr` upon completion.
21090          */
21091         uint16_t        seq_id;
21092         /*
21093          * The target ID of the command:
21094          * * 0x0-0xFFF8 - The function ID
21095          * * 0xFFF8-0xFFFE - Reserved for internal processors
21096          * * 0xFFFF - HWRM
21097          */
21098         uint16_t        target_id;
21099         /*
21100          * A physical address pointer pointing to a host buffer that the
21101          * command's response data will be written. This can be either a host
21102          * physical address (HPA) or a guest physical address (GPA) and must
21103          * point to a physically contiguous block of memory.
21104          */
21105         uint64_t        resp_addr;
21106         /* ID of the statistics context that is being queried. */
21107         uint32_t        stat_ctx_id;
21108         uint8_t unused_0[4];
21109 } __attribute__((packed));
21110
21111 /* hwrm_stat_ctx_free_output (size:128b/16B) */
21112 struct hwrm_stat_ctx_free_output {
21113         /* The specific error status for the command. */
21114         uint16_t        error_code;
21115         /* The HWRM command request type. */
21116         uint16_t        req_type;
21117         /* The sequence ID from the original command. */
21118         uint16_t        seq_id;
21119         /* The length of the response data in number of bytes. */
21120         uint16_t        resp_len;
21121         /* This is the statistics context ID value. */
21122         uint32_t        stat_ctx_id;
21123         uint8_t unused_0[3];
21124         /*
21125          * This field is used in Output records to indicate that the output
21126          * is completely written to RAM.  This field should be read as '1'
21127          * to indicate that the output has been completely written.
21128          * When writing a command completion or response to an internal processor,
21129          * the order of writes has to be such that this field is written last.
21130          */
21131         uint8_t valid;
21132 } __attribute__((packed));
21133
21134 /***********************
21135  * hwrm_stat_ctx_query *
21136  ***********************/
21137
21138
21139 /* hwrm_stat_ctx_query_input (size:192b/24B) */
21140 struct hwrm_stat_ctx_query_input {
21141         /* The HWRM command request type. */
21142         uint16_t        req_type;
21143         /*
21144          * The completion ring to send the completion event on. This should
21145          * be the NQ ID returned from the `nq_alloc` HWRM command.
21146          */
21147         uint16_t        cmpl_ring;
21148         /*
21149          * The sequence ID is used by the driver for tracking multiple
21150          * commands. This ID is treated as opaque data by the firmware and
21151          * the value is returned in the `hwrm_resp_hdr` upon completion.
21152          */
21153         uint16_t        seq_id;
21154         /*
21155          * The target ID of the command:
21156          * * 0x0-0xFFF8 - The function ID
21157          * * 0xFFF8-0xFFFE - Reserved for internal processors
21158          * * 0xFFFF - HWRM
21159          */
21160         uint16_t        target_id;
21161         /*
21162          * A physical address pointer pointing to a host buffer that the
21163          * command's response data will be written. This can be either a host
21164          * physical address (HPA) or a guest physical address (GPA) and must
21165          * point to a physically contiguous block of memory.
21166          */
21167         uint64_t        resp_addr;
21168         /* ID of the statistics context that is being queried. */
21169         uint32_t        stat_ctx_id;
21170         uint8_t unused_0[4];
21171 } __attribute__((packed));
21172
21173 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
21174 struct hwrm_stat_ctx_query_output {
21175         /* The specific error status for the command. */
21176         uint16_t        error_code;
21177         /* The HWRM command request type. */
21178         uint16_t        req_type;
21179         /* The sequence ID from the original command. */
21180         uint16_t        seq_id;
21181         /* The length of the response data in number of bytes. */
21182         uint16_t        resp_len;
21183         /* Number of transmitted unicast packets */
21184         uint64_t        tx_ucast_pkts;
21185         /* Number of transmitted multicast packets */
21186         uint64_t        tx_mcast_pkts;
21187         /* Number of transmitted broadcast packets */
21188         uint64_t        tx_bcast_pkts;
21189         /* Number of transmitted packets with error */
21190         uint64_t        tx_err_pkts;
21191         /* Number of dropped packets on transmit path */
21192         uint64_t        tx_drop_pkts;
21193         /* Number of transmitted bytes for unicast traffic */
21194         uint64_t        tx_ucast_bytes;
21195         /* Number of transmitted bytes for multicast traffic */
21196         uint64_t        tx_mcast_bytes;
21197         /* Number of transmitted bytes for broadcast traffic */
21198         uint64_t        tx_bcast_bytes;
21199         /* Number of received unicast packets */
21200         uint64_t        rx_ucast_pkts;
21201         /* Number of received multicast packets */
21202         uint64_t        rx_mcast_pkts;
21203         /* Number of received broadcast packets */
21204         uint64_t        rx_bcast_pkts;
21205         /* Number of received packets with error */
21206         uint64_t        rx_err_pkts;
21207         /* Number of dropped packets on received path */
21208         uint64_t        rx_drop_pkts;
21209         /* Number of received bytes for unicast traffic */
21210         uint64_t        rx_ucast_bytes;
21211         /* Number of received bytes for multicast traffic */
21212         uint64_t        rx_mcast_bytes;
21213         /* Number of received bytes for broadcast traffic */
21214         uint64_t        rx_bcast_bytes;
21215         /* Number of aggregated unicast packets */
21216         uint64_t        rx_agg_pkts;
21217         /* Number of aggregated unicast bytes */
21218         uint64_t        rx_agg_bytes;
21219         /* Number of aggregation events */
21220         uint64_t        rx_agg_events;
21221         /* Number of aborted aggregations */
21222         uint64_t        rx_agg_aborts;
21223         uint8_t unused_0[7];
21224         /*
21225          * This field is used in Output records to indicate that the output
21226          * is completely written to RAM.  This field should be read as '1'
21227          * to indicate that the output has been completely written.
21228          * When writing a command completion or response to an internal processor,
21229          * the order of writes has to be such that this field is written last.
21230          */
21231         uint8_t valid;
21232 } __attribute__((packed));
21233
21234 /***************************
21235  * hwrm_stat_ctx_clr_stats *
21236  ***************************/
21237
21238
21239 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
21240 struct hwrm_stat_ctx_clr_stats_input {
21241         /* The HWRM command request type. */
21242         uint16_t        req_type;
21243         /*
21244          * The completion ring to send the completion event on. This should
21245          * be the NQ ID returned from the `nq_alloc` HWRM command.
21246          */
21247         uint16_t        cmpl_ring;
21248         /*
21249          * The sequence ID is used by the driver for tracking multiple
21250          * commands. This ID is treated as opaque data by the firmware and
21251          * the value is returned in the `hwrm_resp_hdr` upon completion.
21252          */
21253         uint16_t        seq_id;
21254         /*
21255          * The target ID of the command:
21256          * * 0x0-0xFFF8 - The function ID
21257          * * 0xFFF8-0xFFFE - Reserved for internal processors
21258          * * 0xFFFF - HWRM
21259          */
21260         uint16_t        target_id;
21261         /*
21262          * A physical address pointer pointing to a host buffer that the
21263          * command's response data will be written. This can be either a host
21264          * physical address (HPA) or a guest physical address (GPA) and must
21265          * point to a physically contiguous block of memory.
21266          */
21267         uint64_t        resp_addr;
21268         /* ID of the statistics context that is being queried. */
21269         uint32_t        stat_ctx_id;
21270         uint8_t unused_0[4];
21271 } __attribute__((packed));
21272
21273 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
21274 struct hwrm_stat_ctx_clr_stats_output {
21275         /* The specific error status for the command. */
21276         uint16_t        error_code;
21277         /* The HWRM command request type. */
21278         uint16_t        req_type;
21279         /* The sequence ID from the original command. */
21280         uint16_t        seq_id;
21281         /* The length of the response data in number of bytes. */
21282         uint16_t        resp_len;
21283         uint8_t unused_0[7];
21284         /*
21285          * This field is used in Output records to indicate that the output
21286          * is completely written to RAM.  This field should be read as '1'
21287          * to indicate that the output has been completely written.
21288          * When writing a command completion or response to an internal processor,
21289          * the order of writes has to be such that this field is written last.
21290          */
21291         uint8_t valid;
21292 } __attribute__((packed));
21293
21294 /********************
21295  * hwrm_pcie_qstats *
21296  ********************/
21297
21298
21299 /* hwrm_pcie_qstats_input (size:256b/32B) */
21300 struct hwrm_pcie_qstats_input {
21301         /* The HWRM command request type. */
21302         uint16_t        req_type;
21303         /*
21304          * The completion ring to send the completion event on. This should
21305          * be the NQ ID returned from the `nq_alloc` HWRM command.
21306          */
21307         uint16_t        cmpl_ring;
21308         /*
21309          * The sequence ID is used by the driver for tracking multiple
21310          * commands. This ID is treated as opaque data by the firmware and
21311          * the value is returned in the `hwrm_resp_hdr` upon completion.
21312          */
21313         uint16_t        seq_id;
21314         /*
21315          * The target ID of the command:
21316          * * 0x0-0xFFF8 - The function ID
21317          * * 0xFFF8-0xFFFE - Reserved for internal processors
21318          * * 0xFFFF - HWRM
21319          */
21320         uint16_t        target_id;
21321         /*
21322          * A physical address pointer pointing to a host buffer that the
21323          * command's response data will be written. This can be either a host
21324          * physical address (HPA) or a guest physical address (GPA) and must
21325          * point to a physically contiguous block of memory.
21326          */
21327         uint64_t        resp_addr;
21328         /*
21329          * The size of PCIe statistics block in bytes.
21330          * Firmware will DMA the PCIe statistics to
21331          * the host with this field size in the response.
21332          */
21333         uint16_t        pcie_stat_size;
21334         uint8_t unused_0[6];
21335         /*
21336          * This is the host address where
21337          * PCIe statistics will be stored
21338          */
21339         uint64_t        pcie_stat_host_addr;
21340 } __attribute__((packed));
21341
21342 /* hwrm_pcie_qstats_output (size:128b/16B) */
21343 struct hwrm_pcie_qstats_output {
21344         /* The specific error status for the command. */
21345         uint16_t        error_code;
21346         /* The HWRM command request type. */
21347         uint16_t        req_type;
21348         /* The sequence ID from the original command. */
21349         uint16_t        seq_id;
21350         /* The length of the response data in number of bytes. */
21351         uint16_t        resp_len;
21352         /* The size of PCIe statistics block in bytes. */
21353         uint16_t        pcie_stat_size;
21354         uint8_t unused_0[5];
21355         /*
21356          * This field is used in Output records to indicate that the output
21357          * is completely written to RAM.  This field should be read as '1'
21358          * to indicate that the output has been completely written.
21359          * When writing a command completion or response to an internal processor,
21360          * the order of writes has to be such that this field is written last.
21361          */
21362         uint8_t valid;
21363 } __attribute__((packed));
21364
21365 /* Port Tx Statistics Formats */
21366 /* tx_port_stats (size:3264b/408B) */
21367 struct tx_port_stats {
21368         /* Total Number of 64 Bytes frames transmitted */
21369         uint64_t        tx_64b_frames;
21370         /* Total Number of 65-127 Bytes frames transmitted */
21371         uint64_t        tx_65b_127b_frames;
21372         /* Total Number of 128-255 Bytes frames transmitted */
21373         uint64_t        tx_128b_255b_frames;
21374         /* Total Number of 256-511 Bytes frames transmitted */
21375         uint64_t        tx_256b_511b_frames;
21376         /* Total Number of 512-1023 Bytes frames transmitted */
21377         uint64_t        tx_512b_1023b_frames;
21378         /* Total Number of 1024-1518 Bytes frames transmitted */
21379         uint64_t        tx_1024b_1518_frames;
21380         /*
21381          * Total Number of each good VLAN (exludes FCS errors)
21382          * frame transmitted which is 1519 to 1522 bytes in length
21383          * inclusive (excluding framing bits but including FCS bytes).
21384          */
21385         uint64_t        tx_good_vlan_frames;
21386         /* Total Number of 1519-2047 Bytes frames transmitted */
21387         uint64_t        tx_1519b_2047_frames;
21388         /* Total Number of 2048-4095 Bytes frames transmitted */
21389         uint64_t        tx_2048b_4095b_frames;
21390         /* Total Number of 4096-9216 Bytes frames transmitted */
21391         uint64_t        tx_4096b_9216b_frames;
21392         /* Total Number of 9217-16383 Bytes frames transmitted */
21393         uint64_t        tx_9217b_16383b_frames;
21394         /* Total Number of good frames transmitted */
21395         uint64_t        tx_good_frames;
21396         /* Total Number of frames transmitted */
21397         uint64_t        tx_total_frames;
21398         /* Total number of unicast frames transmitted */
21399         uint64_t        tx_ucast_frames;
21400         /* Total number of multicast frames transmitted */
21401         uint64_t        tx_mcast_frames;
21402         /* Total number of broadcast frames transmitted */
21403         uint64_t        tx_bcast_frames;
21404         /* Total number of PAUSE control frames transmitted */
21405         uint64_t        tx_pause_frames;
21406         /*
21407          * Total number of PFC/per-priority PAUSE
21408          * control frames transmitted
21409          */
21410         uint64_t        tx_pfc_frames;
21411         /* Total number of jabber frames transmitted */
21412         uint64_t        tx_jabber_frames;
21413         /* Total number of frames transmitted with FCS error */
21414         uint64_t        tx_fcs_err_frames;
21415         /* Total number of control frames transmitted */
21416         uint64_t        tx_control_frames;
21417         /* Total number of over-sized frames transmitted */
21418         uint64_t        tx_oversz_frames;
21419         /* Total number of frames with single deferral */
21420         uint64_t        tx_single_dfrl_frames;
21421         /* Total number of frames with multiple deferrals */
21422         uint64_t        tx_multi_dfrl_frames;
21423         /* Total number of frames with single collision */
21424         uint64_t        tx_single_coll_frames;
21425         /* Total number of frames with multiple collisions */
21426         uint64_t        tx_multi_coll_frames;
21427         /* Total number of frames with late collisions */
21428         uint64_t        tx_late_coll_frames;
21429         /* Total number of frames with excessive collisions */
21430         uint64_t        tx_excessive_coll_frames;
21431         /* Total number of fragmented frames transmitted */
21432         uint64_t        tx_frag_frames;
21433         /* Total number of transmit errors */
21434         uint64_t        tx_err;
21435         /* Total number of single VLAN tagged frames transmitted */
21436         uint64_t        tx_tagged_frames;
21437         /* Total number of double VLAN tagged frames transmitted */
21438         uint64_t        tx_dbl_tagged_frames;
21439         /* Total number of runt frames transmitted */
21440         uint64_t        tx_runt_frames;
21441         /* Total number of TX FIFO under runs */
21442         uint64_t        tx_fifo_underruns;
21443         /*
21444          * Total number of PFC frames with PFC enabled bit for
21445          * Pri 0 transmitted
21446          */
21447         uint64_t        tx_pfc_ena_frames_pri0;
21448         /*
21449          * Total number of PFC frames with PFC enabled bit for
21450          * Pri 1 transmitted
21451          */
21452         uint64_t        tx_pfc_ena_frames_pri1;
21453         /*
21454          * Total number of PFC frames with PFC enabled bit for
21455          * Pri 2 transmitted
21456          */
21457         uint64_t        tx_pfc_ena_frames_pri2;
21458         /*
21459          * Total number of PFC frames with PFC enabled bit for
21460          * Pri 3 transmitted
21461          */
21462         uint64_t        tx_pfc_ena_frames_pri3;
21463         /*
21464          * Total number of PFC frames with PFC enabled bit for
21465          * Pri 4 transmitted
21466          */
21467         uint64_t        tx_pfc_ena_frames_pri4;
21468         /*
21469          * Total number of PFC frames with PFC enabled bit for
21470          * Pri 5 transmitted
21471          */
21472         uint64_t        tx_pfc_ena_frames_pri5;
21473         /*
21474          * Total number of PFC frames with PFC enabled bit for
21475          * Pri 6 transmitted
21476          */
21477         uint64_t        tx_pfc_ena_frames_pri6;
21478         /*
21479          * Total number of PFC frames with PFC enabled bit for
21480          * Pri 7 transmitted
21481          */
21482         uint64_t        tx_pfc_ena_frames_pri7;
21483         /* Total number of EEE LPI Events on TX */
21484         uint64_t        tx_eee_lpi_events;
21485         /* EEE LPI Duration Counter on TX */
21486         uint64_t        tx_eee_lpi_duration;
21487         /*
21488          * Total number of Link Level Flow Control (LLFC) messages
21489          * transmitted
21490          */
21491         uint64_t        tx_llfc_logical_msgs;
21492         /* Total number of HCFC messages transmitted */
21493         uint64_t        tx_hcfc_msgs;
21494         /* Total number of TX collisions */
21495         uint64_t        tx_total_collisions;
21496         /* Total number of transmitted bytes */
21497         uint64_t        tx_bytes;
21498         /* Total number of end-to-end HOL frames */
21499         uint64_t        tx_xthol_frames;
21500         /* Total Tx Drops per Port reported by STATS block */
21501         uint64_t        tx_stat_discard;
21502         /* Total Tx Error Drops per Port reported by STATS block */
21503         uint64_t        tx_stat_error;
21504 } __attribute__((packed));
21505
21506 /* Port Rx Statistics Formats */
21507 /* rx_port_stats (size:4224b/528B) */
21508 struct rx_port_stats {
21509         /* Total Number of 64 Bytes frames received */
21510         uint64_t        rx_64b_frames;
21511         /* Total Number of 65-127 Bytes frames received */
21512         uint64_t        rx_65b_127b_frames;
21513         /* Total Number of 128-255 Bytes frames received */
21514         uint64_t        rx_128b_255b_frames;
21515         /* Total Number of 256-511 Bytes frames received */
21516         uint64_t        rx_256b_511b_frames;
21517         /* Total Number of 512-1023 Bytes frames received */
21518         uint64_t        rx_512b_1023b_frames;
21519         /* Total Number of 1024-1518 Bytes frames received */
21520         uint64_t        rx_1024b_1518_frames;
21521         /*
21522          * Total Number of each good VLAN (exludes FCS errors)
21523          * frame received which is 1519 to 1522 bytes in length
21524          * inclusive (excluding framing bits but including FCS bytes).
21525          */
21526         uint64_t        rx_good_vlan_frames;
21527         /* Total Number of 1519-2047 Bytes frames received */
21528         uint64_t        rx_1519b_2047b_frames;
21529         /* Total Number of 2048-4095 Bytes frames received */
21530         uint64_t        rx_2048b_4095b_frames;
21531         /* Total Number of 4096-9216 Bytes frames received */
21532         uint64_t        rx_4096b_9216b_frames;
21533         /* Total Number of 9217-16383 Bytes frames received */
21534         uint64_t        rx_9217b_16383b_frames;
21535         /* Total number of frames received */
21536         uint64_t        rx_total_frames;
21537         /* Total number of unicast frames received */
21538         uint64_t        rx_ucast_frames;
21539         /* Total number of multicast frames received */
21540         uint64_t        rx_mcast_frames;
21541         /* Total number of broadcast frames received */
21542         uint64_t        rx_bcast_frames;
21543         /* Total number of received frames with FCS error */
21544         uint64_t        rx_fcs_err_frames;
21545         /* Total number of control frames received */
21546         uint64_t        rx_ctrl_frames;
21547         /* Total number of PAUSE frames received */
21548         uint64_t        rx_pause_frames;
21549         /* Total number of PFC frames received */
21550         uint64_t        rx_pfc_frames;
21551         /*
21552          * Total number of frames received with an unsupported
21553          * opcode
21554          */
21555         uint64_t        rx_unsupported_opcode_frames;
21556         /*
21557          * Total number of frames received with an unsupported
21558          * DA for pause and PFC
21559          */
21560         uint64_t        rx_unsupported_da_pausepfc_frames;
21561         /* Total number of frames received with an unsupported SA */
21562         uint64_t        rx_wrong_sa_frames;
21563         /* Total number of received packets with alignment error */
21564         uint64_t        rx_align_err_frames;
21565         /* Total number of received frames with out-of-range length */
21566         uint64_t        rx_oor_len_frames;
21567         /* Total number of received frames with error termination */
21568         uint64_t        rx_code_err_frames;
21569         /*
21570          * Total number of received frames with a false carrier is
21571          * detected during idle, as defined by RX_ER samples active
21572          * and RXD is 0xE. The event is reported along with the
21573          * statistics generated on the next received frame. Only
21574          * one false carrier condition can be detected and logged
21575          * between frames.
21576          *
21577          * Carrier event, valid for 10M/100M speed modes only.
21578          */
21579         uint64_t        rx_false_carrier_frames;
21580         /* Total number of over-sized frames received */
21581         uint64_t        rx_ovrsz_frames;
21582         /* Total number of jabber packets received */
21583         uint64_t        rx_jbr_frames;
21584         /* Total number of received frames with MTU error */
21585         uint64_t        rx_mtu_err_frames;
21586         /* Total number of received frames with CRC match */
21587         uint64_t        rx_match_crc_frames;
21588         /* Total number of frames received promiscuously */
21589         uint64_t        rx_promiscuous_frames;
21590         /*
21591          * Total number of received frames with one or two VLAN
21592          * tags
21593          */
21594         uint64_t        rx_tagged_frames;
21595         /* Total number of received frames with two VLAN tags */
21596         uint64_t        rx_double_tagged_frames;
21597         /* Total number of truncated frames received */
21598         uint64_t        rx_trunc_frames;
21599         /* Total number of good frames (without errors) received */
21600         uint64_t        rx_good_frames;
21601         /*
21602          * Total number of received PFC frames with transition from
21603          * XON to XOFF on Pri 0
21604          */
21605         uint64_t        rx_pfc_xon2xoff_frames_pri0;
21606         /*
21607          * Total number of received PFC frames with transition from
21608          * XON to XOFF on Pri 1
21609          */
21610         uint64_t        rx_pfc_xon2xoff_frames_pri1;
21611         /*
21612          * Total number of received PFC frames with transition from
21613          * XON to XOFF on Pri 2
21614          */
21615         uint64_t        rx_pfc_xon2xoff_frames_pri2;
21616         /*
21617          * Total number of received PFC frames with transition from
21618          * XON to XOFF on Pri 3
21619          */
21620         uint64_t        rx_pfc_xon2xoff_frames_pri3;
21621         /*
21622          * Total number of received PFC frames with transition from
21623          * XON to XOFF on Pri 4
21624          */
21625         uint64_t        rx_pfc_xon2xoff_frames_pri4;
21626         /*
21627          * Total number of received PFC frames with transition from
21628          * XON to XOFF on Pri 5
21629          */
21630         uint64_t        rx_pfc_xon2xoff_frames_pri5;
21631         /*
21632          * Total number of received PFC frames with transition from
21633          * XON to XOFF on Pri 6
21634          */
21635         uint64_t        rx_pfc_xon2xoff_frames_pri6;
21636         /*
21637          * Total number of received PFC frames with transition from
21638          * XON to XOFF on Pri 7
21639          */
21640         uint64_t        rx_pfc_xon2xoff_frames_pri7;
21641         /*
21642          * Total number of received PFC frames with PFC enabled
21643          * bit for Pri 0
21644          */
21645         uint64_t        rx_pfc_ena_frames_pri0;
21646         /*
21647          * Total number of received PFC frames with PFC enabled
21648          * bit for Pri 1
21649          */
21650         uint64_t        rx_pfc_ena_frames_pri1;
21651         /*
21652          * Total number of received PFC frames with PFC enabled
21653          * bit for Pri 2
21654          */
21655         uint64_t        rx_pfc_ena_frames_pri2;
21656         /*
21657          * Total number of received PFC frames with PFC enabled
21658          * bit for Pri 3
21659          */
21660         uint64_t        rx_pfc_ena_frames_pri3;
21661         /*
21662          * Total number of received PFC frames with PFC enabled
21663          * bit for Pri 4
21664          */
21665         uint64_t        rx_pfc_ena_frames_pri4;
21666         /*
21667          * Total number of received PFC frames with PFC enabled
21668          * bit for Pri 5
21669          */
21670         uint64_t        rx_pfc_ena_frames_pri5;
21671         /*
21672          * Total number of received PFC frames with PFC enabled
21673          * bit for Pri 6
21674          */
21675         uint64_t        rx_pfc_ena_frames_pri6;
21676         /*
21677          * Total number of received PFC frames with PFC enabled
21678          * bit for Pri 7
21679          */
21680         uint64_t        rx_pfc_ena_frames_pri7;
21681         /* Total Number of frames received with SCH CRC error */
21682         uint64_t        rx_sch_crc_err_frames;
21683         /* Total Number of under-sized frames received */
21684         uint64_t        rx_undrsz_frames;
21685         /* Total Number of fragmented frames received */
21686         uint64_t        rx_frag_frames;
21687         /* Total number of RX EEE LPI Events */
21688         uint64_t        rx_eee_lpi_events;
21689         /* EEE LPI Duration Counter on RX */
21690         uint64_t        rx_eee_lpi_duration;
21691         /*
21692          * Total number of physical type Link Level Flow Control
21693          * (LLFC) messages received
21694          */
21695         uint64_t        rx_llfc_physical_msgs;
21696         /*
21697          * Total number of logical type Link Level Flow Control
21698          * (LLFC) messages received
21699          */
21700         uint64_t        rx_llfc_logical_msgs;
21701         /*
21702          * Total number of logical type Link Level Flow Control
21703          * (LLFC) messages received with CRC error
21704          */
21705         uint64_t        rx_llfc_msgs_with_crc_err;
21706         /* Total number of HCFC messages received */
21707         uint64_t        rx_hcfc_msgs;
21708         /* Total number of HCFC messages received with CRC error */
21709         uint64_t        rx_hcfc_msgs_with_crc_err;
21710         /* Total number of received bytes */
21711         uint64_t        rx_bytes;
21712         /* Total number of bytes received in runt frames */
21713         uint64_t        rx_runt_bytes;
21714         /* Total number of runt frames received */
21715         uint64_t        rx_runt_frames;
21716         /* Total Rx Discards per Port reported by STATS block */
21717         uint64_t        rx_stat_discard;
21718         uint64_t        rx_stat_err;
21719 } __attribute__((packed));
21720
21721 /* Port Rx Statistics extended Formats */
21722 /* rx_port_stats_ext (size:320b/40B) */
21723 struct rx_port_stats_ext {
21724         /* Number of times link state changed to down */
21725         uint64_t        link_down_events;
21726         /* Number of times the idle rings with pause bit are found */
21727         uint64_t        continuous_pause_events;
21728         /* Number of times the active rings pause bit resumed back */
21729         uint64_t        resume_pause_events;
21730         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
21731         uint64_t        continuous_roce_pause_events;
21732         /* Number of times, the ROCE cos queue PFC is enabled back */
21733         uint64_t        resume_roce_pause_events;
21734 } __attribute__((packed));
21735
21736 /* PCIe Statistics Formats */
21737 /* pcie_ctx_hw_stats (size:768b/96B) */
21738 struct pcie_ctx_hw_stats {
21739         /* Number of physical layer receiver errors */
21740         uint64_t        pcie_pl_signal_integrity;
21741         /* Number of DLLP CRC errors detected by Data Link Layer */
21742         uint64_t        pcie_dl_signal_integrity;
21743         /*
21744          * Number of TLP LCRC and sequence number errors detected
21745          * by Data Link Layer
21746          */
21747         uint64_t        pcie_tl_signal_integrity;
21748         /* Number of times LTSSM entered Recovery state */
21749         uint64_t        pcie_link_integrity;
21750         /* Number of TLP bytes that have been trasmitted */
21751         uint64_t        pcie_tx_traffic_rate;
21752         /* Number of TLP bytes that have been received */
21753         uint64_t        pcie_rx_traffic_rate;
21754         /* Number of DLLP bytes that have been trasmitted */
21755         uint64_t        pcie_tx_dllp_statistics;
21756         /* Number of DLLP bytes that have been received */
21757         uint64_t        pcie_rx_dllp_statistics;
21758         /*
21759          * Number of times spent in each phase of gen3
21760          * equalization
21761          */
21762         uint64_t        pcie_equalization_time;
21763         /* Records the last 16 transitions of the LTSSM */
21764         uint32_t        pcie_ltssm_histogram[4];
21765         /*
21766          * Record the last 8 reasons on why LTSSM transitioned
21767          * to Recovery
21768          */
21769         uint64_t        pcie_recovery_histogram;
21770 } __attribute__((packed));
21771
21772 /**********************
21773  * hwrm_exec_fwd_resp *
21774  **********************/
21775
21776
21777 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
21778 struct hwrm_exec_fwd_resp_input {
21779         /* The HWRM command request type. */
21780         uint16_t        req_type;
21781         /*
21782          * The completion ring to send the completion event on. This should
21783          * be the NQ ID returned from the `nq_alloc` HWRM command.
21784          */
21785         uint16_t        cmpl_ring;
21786         /*
21787          * The sequence ID is used by the driver for tracking multiple
21788          * commands. This ID is treated as opaque data by the firmware and
21789          * the value is returned in the `hwrm_resp_hdr` upon completion.
21790          */
21791         uint16_t        seq_id;
21792         /*
21793          * The target ID of the command:
21794          * * 0x0-0xFFF8 - The function ID
21795          * * 0xFFF8-0xFFFE - Reserved for internal processors
21796          * * 0xFFFF - HWRM
21797          */
21798         uint16_t        target_id;
21799         /*
21800          * A physical address pointer pointing to a host buffer that the
21801          * command's response data will be written. This can be either a host
21802          * physical address (HPA) or a guest physical address (GPA) and must
21803          * point to a physically contiguous block of memory.
21804          */
21805         uint64_t        resp_addr;
21806         /*
21807          * This is an encapsulated request. This request should
21808          * be executed by the HWRM and the response should be
21809          * provided in the response buffer inside the encapsulated
21810          * request.
21811          */
21812         uint32_t        encap_request[26];
21813         /*
21814          * This value indicates the target id of the response to
21815          * the encapsulated request.
21816          * 0x0 - 0xFFF8 - Used for function ids
21817          * 0xFFF8 - 0xFFFE - Reserved for internal processors
21818          * 0xFFFF - HWRM
21819          */
21820         uint16_t        encap_resp_target_id;
21821         uint8_t unused_0[6];
21822 } __attribute__((packed));
21823
21824 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
21825 struct hwrm_exec_fwd_resp_output {
21826         /* The specific error status for the command. */
21827         uint16_t        error_code;
21828         /* The HWRM command request type. */
21829         uint16_t        req_type;
21830         /* The sequence ID from the original command. */
21831         uint16_t        seq_id;
21832         /* The length of the response data in number of bytes. */
21833         uint16_t        resp_len;
21834         uint8_t unused_0[7];
21835         /*
21836          * This field is used in Output records to indicate that the output
21837          * is completely written to RAM.  This field should be read as '1'
21838          * to indicate that the output has been completely written.
21839          * When writing a command completion or response to an internal processor,
21840          * the order of writes has to be such that this field is written last.
21841          */
21842         uint8_t valid;
21843 } __attribute__((packed));
21844
21845 /************************
21846  * hwrm_reject_fwd_resp *
21847  ************************/
21848
21849
21850 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
21851 struct hwrm_reject_fwd_resp_input {
21852         /* The HWRM command request type. */
21853         uint16_t        req_type;
21854         /*
21855          * The completion ring to send the completion event on. This should
21856          * be the NQ ID returned from the `nq_alloc` HWRM command.
21857          */
21858         uint16_t        cmpl_ring;
21859         /*
21860          * The sequence ID is used by the driver for tracking multiple
21861          * commands. This ID is treated as opaque data by the firmware and
21862          * the value is returned in the `hwrm_resp_hdr` upon completion.
21863          */
21864         uint16_t        seq_id;
21865         /*
21866          * The target ID of the command:
21867          * * 0x0-0xFFF8 - The function ID
21868          * * 0xFFF8-0xFFFE - Reserved for internal processors
21869          * * 0xFFFF - HWRM
21870          */
21871         uint16_t        target_id;
21872         /*
21873          * A physical address pointer pointing to a host buffer that the
21874          * command's response data will be written. This can be either a host
21875          * physical address (HPA) or a guest physical address (GPA) and must
21876          * point to a physically contiguous block of memory.
21877          */
21878         uint64_t        resp_addr;
21879         /*
21880          * This is an encapsulated request. This request should
21881          * be rejected by the HWRM and the error response should be
21882          * provided in the response buffer inside the encapsulated
21883          * request.
21884          */
21885         uint32_t        encap_request[26];
21886         /*
21887          * This value indicates the target id of the response to
21888          * the encapsulated request.
21889          * 0x0 - 0xFFF8 - Used for function ids
21890          * 0xFFF8 - 0xFFFE - Reserved for internal processors
21891          * 0xFFFF - HWRM
21892          */
21893         uint16_t        encap_resp_target_id;
21894         uint8_t unused_0[6];
21895 } __attribute__((packed));
21896
21897 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
21898 struct hwrm_reject_fwd_resp_output {
21899         /* The specific error status for the command. */
21900         uint16_t        error_code;
21901         /* The HWRM command request type. */
21902         uint16_t        req_type;
21903         /* The sequence ID from the original command. */
21904         uint16_t        seq_id;
21905         /* The length of the response data in number of bytes. */
21906         uint16_t        resp_len;
21907         uint8_t unused_0[7];
21908         /*
21909          * This field is used in Output records to indicate that the output
21910          * is completely written to RAM.  This field should be read as '1'
21911          * to indicate that the output has been completely written.
21912          * When writing a command completion or response to an internal processor,
21913          * the order of writes has to be such that this field is written last.
21914          */
21915         uint8_t valid;
21916 } __attribute__((packed));
21917
21918 /*****************
21919  * hwrm_fwd_resp *
21920  *****************/
21921
21922
21923 /* hwrm_fwd_resp_input (size:1024b/128B) */
21924 struct hwrm_fwd_resp_input {
21925         /* The HWRM command request type. */
21926         uint16_t        req_type;
21927         /*
21928          * The completion ring to send the completion event on. This should
21929          * be the NQ ID returned from the `nq_alloc` HWRM command.
21930          */
21931         uint16_t        cmpl_ring;
21932         /*
21933          * The sequence ID is used by the driver for tracking multiple
21934          * commands. This ID is treated as opaque data by the firmware and
21935          * the value is returned in the `hwrm_resp_hdr` upon completion.
21936          */
21937         uint16_t        seq_id;
21938         /*
21939          * The target ID of the command:
21940          * * 0x0-0xFFF8 - The function ID
21941          * * 0xFFF8-0xFFFE - Reserved for internal processors
21942          * * 0xFFFF - HWRM
21943          */
21944         uint16_t        target_id;
21945         /*
21946          * A physical address pointer pointing to a host buffer that the
21947          * command's response data will be written. This can be either a host
21948          * physical address (HPA) or a guest physical address (GPA) and must
21949          * point to a physically contiguous block of memory.
21950          */
21951         uint64_t        resp_addr;
21952         /*
21953          * This value indicates the target id of the encapsulated
21954          * response.
21955          * 0x0 - 0xFFF8 - Used for function ids
21956          * 0xFFF8 - 0xFFFE - Reserved for internal processors
21957          * 0xFFFF - HWRM
21958          */
21959         uint16_t        encap_resp_target_id;
21960         /*
21961          * This value indicates the completion ring the encapsulated
21962          * response will be optionally completed on.  If the value is
21963          * -1, then no CR completion shall be generated for the
21964          * encapsulated response. Any other value must be a
21965          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
21966          * is provided, then a CR completion shall be generated for
21967          * the encapsulated response.
21968          */
21969         uint16_t        encap_resp_cmpl_ring;
21970         /* This field indicates the length of encapsulated response. */
21971         uint16_t        encap_resp_len;
21972         uint8_t unused_0;
21973         uint8_t unused_1;
21974         /*
21975          * This is the host address where the encapsulated response
21976          * will be written.
21977          * This area must be 16B aligned and must be cleared to zero
21978          * before the original request is made.
21979          */
21980         uint64_t        encap_resp_addr;
21981         /* This is an encapsulated response. */
21982         uint32_t        encap_resp[24];
21983 } __attribute__((packed));
21984
21985 /* hwrm_fwd_resp_output (size:128b/16B) */
21986 struct hwrm_fwd_resp_output {
21987         /* The specific error status for the command. */
21988         uint16_t        error_code;
21989         /* The HWRM command request type. */
21990         uint16_t        req_type;
21991         /* The sequence ID from the original command. */
21992         uint16_t        seq_id;
21993         /* The length of the response data in number of bytes. */
21994         uint16_t        resp_len;
21995         uint8_t unused_0[7];
21996         /*
21997          * This field is used in Output records to indicate that the output
21998          * is completely written to RAM.  This field should be read as '1'
21999          * to indicate that the output has been completely written.
22000          * When writing a command completion or response to an internal processor,
22001          * the order of writes has to be such that this field is written last.
22002          */
22003         uint8_t valid;
22004 } __attribute__((packed));
22005
22006 /**************************
22007  * hwrm_nvm_raw_write_blk *
22008  **************************/
22009
22010
22011 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
22012 struct hwrm_nvm_raw_write_blk_input {
22013         /* The HWRM command request type. */
22014         uint16_t        req_type;
22015         /*
22016          * The completion ring to send the completion event on. This should
22017          * be the NQ ID returned from the `nq_alloc` HWRM command.
22018          */
22019         uint16_t        cmpl_ring;
22020         /*
22021          * The sequence ID is used by the driver for tracking multiple
22022          * commands. This ID is treated as opaque data by the firmware and
22023          * the value is returned in the `hwrm_resp_hdr` upon completion.
22024          */
22025         uint16_t        seq_id;
22026         /*
22027          * The target ID of the command:
22028          * * 0x0-0xFFF8 - The function ID
22029          * * 0xFFF8-0xFFFE - Reserved for internal processors
22030          * * 0xFFFF - HWRM
22031          */
22032         uint16_t        target_id;
22033         /*
22034          * A physical address pointer pointing to a host buffer that the
22035          * command's response data will be written. This can be either a host
22036          * physical address (HPA) or a guest physical address (GPA) and must
22037          * point to a physically contiguous block of memory.
22038          */
22039         uint64_t        resp_addr;
22040         /*
22041          * 64-bit Host Source Address.
22042          * This is the loation of the source data to be written.
22043          */
22044         uint64_t        host_src_addr;
22045         /*
22046          * 32-bit Destination Address.
22047          * This is the NVRAM byte-offset where the source data will be written to.
22048          */
22049         uint32_t        dest_addr;
22050         /* Length of data to be written, in bytes. */
22051         uint32_t        len;
22052 } __attribute__((packed));
22053
22054 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
22055 struct hwrm_nvm_raw_write_blk_output {
22056         /* The specific error status for the command. */
22057         uint16_t        error_code;
22058         /* The HWRM command request type. */
22059         uint16_t        req_type;
22060         /* The sequence ID from the original command. */
22061         uint16_t        seq_id;
22062         /* The length of the response data in number of bytes. */
22063         uint16_t        resp_len;
22064         uint8_t unused_0[7];
22065         /*
22066          * This field is used in Output records to indicate that the output
22067          * is completely written to RAM.  This field should be read as '1'
22068          * to indicate that the output has been completely written.
22069          * When writing a command completion or response to an internal processor,
22070          * the order of writes has to be such that this field is written last.
22071          */
22072         uint8_t valid;
22073 } __attribute__((packed));
22074
22075 /*****************
22076  * hwrm_nvm_read *
22077  *****************/
22078
22079
22080 /* hwrm_nvm_read_input (size:320b/40B) */
22081 struct hwrm_nvm_read_input {
22082         /* The HWRM command request type. */
22083         uint16_t        req_type;
22084         /*
22085          * The completion ring to send the completion event on. This should
22086          * be the NQ ID returned from the `nq_alloc` HWRM command.
22087          */
22088         uint16_t        cmpl_ring;
22089         /*
22090          * The sequence ID is used by the driver for tracking multiple
22091          * commands. This ID is treated as opaque data by the firmware and
22092          * the value is returned in the `hwrm_resp_hdr` upon completion.
22093          */
22094         uint16_t        seq_id;
22095         /*
22096          * The target ID of the command:
22097          * * 0x0-0xFFF8 - The function ID
22098          * * 0xFFF8-0xFFFE - Reserved for internal processors
22099          * * 0xFFFF - HWRM
22100          */
22101         uint16_t        target_id;
22102         /*
22103          * A physical address pointer pointing to a host buffer that the
22104          * command's response data will be written. This can be either a host
22105          * physical address (HPA) or a guest physical address (GPA) and must
22106          * point to a physically contiguous block of memory.
22107          */
22108         uint64_t        resp_addr;
22109         /*
22110          * 64-bit Host Destination Address.
22111          * This is the host address where the data will be written to.
22112          */
22113         uint64_t        host_dest_addr;
22114         /* The 0-based index of the directory entry. */
22115         uint16_t        dir_idx;
22116         uint8_t unused_0[2];
22117         /* The NVRAM byte-offset to read from. */
22118         uint32_t        offset;
22119         /* The length of the data to be read, in bytes. */
22120         uint32_t        len;
22121         uint8_t unused_1[4];
22122 } __attribute__((packed));
22123
22124 /* hwrm_nvm_read_output (size:128b/16B) */
22125 struct hwrm_nvm_read_output {
22126         /* The specific error status for the command. */
22127         uint16_t        error_code;
22128         /* The HWRM command request type. */
22129         uint16_t        req_type;
22130         /* The sequence ID from the original command. */
22131         uint16_t        seq_id;
22132         /* The length of the response data in number of bytes. */
22133         uint16_t        resp_len;
22134         uint8_t unused_0[7];
22135         /*
22136          * This field is used in Output records to indicate that the output
22137          * is completely written to RAM.  This field should be read as '1'
22138          * to indicate that the output has been completely written.
22139          * When writing a command completion or response to an internal processor,
22140          * the order of writes has to be such that this field is written last.
22141          */
22142         uint8_t valid;
22143 } __attribute__((packed));
22144
22145 /*********************
22146  * hwrm_nvm_raw_dump *
22147  *********************/
22148
22149
22150 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
22151 struct hwrm_nvm_raw_dump_input {
22152         /* The HWRM command request type. */
22153         uint16_t        req_type;
22154         /*
22155          * The completion ring to send the completion event on. This should
22156          * be the NQ ID returned from the `nq_alloc` HWRM command.
22157          */
22158         uint16_t        cmpl_ring;
22159         /*
22160          * The sequence ID is used by the driver for tracking multiple
22161          * commands. This ID is treated as opaque data by the firmware and
22162          * the value is returned in the `hwrm_resp_hdr` upon completion.
22163          */
22164         uint16_t        seq_id;
22165         /*
22166          * The target ID of the command:
22167          * * 0x0-0xFFF8 - The function ID
22168          * * 0xFFF8-0xFFFE - Reserved for internal processors
22169          * * 0xFFFF - HWRM
22170          */
22171         uint16_t        target_id;
22172         /*
22173          * A physical address pointer pointing to a host buffer that the
22174          * command's response data will be written. This can be either a host
22175          * physical address (HPA) or a guest physical address (GPA) and must
22176          * point to a physically contiguous block of memory.
22177          */
22178         uint64_t        resp_addr;
22179         /*
22180          * 64-bit Host Destination Address.
22181          * This is the host address where the data will be written to.
22182          */
22183         uint64_t        host_dest_addr;
22184         /* 32-bit NVRAM byte-offset to read from. */
22185         uint32_t        offset;
22186         /* Total length of NVRAM contents to be read, in bytes. */
22187         uint32_t        len;
22188 } __attribute__((packed));
22189
22190 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
22191 struct hwrm_nvm_raw_dump_output {
22192         /* The specific error status for the command. */
22193         uint16_t        error_code;
22194         /* The HWRM command request type. */
22195         uint16_t        req_type;
22196         /* The sequence ID from the original command. */
22197         uint16_t        seq_id;
22198         /* The length of the response data in number of bytes. */
22199         uint16_t        resp_len;
22200         uint8_t unused_0[7];
22201         /*
22202          * This field is used in Output records to indicate that the output
22203          * is completely written to RAM.  This field should be read as '1'
22204          * to indicate that the output has been completely written.
22205          * When writing a command completion or response to an internal processor,
22206          * the order of writes has to be such that this field is written last.
22207          */
22208         uint8_t valid;
22209 } __attribute__((packed));
22210
22211 /****************************
22212  * hwrm_nvm_get_dir_entries *
22213  ****************************/
22214
22215
22216 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
22217 struct hwrm_nvm_get_dir_entries_input {
22218         /* The HWRM command request type. */
22219         uint16_t        req_type;
22220         /*
22221          * The completion ring to send the completion event on. This should
22222          * be the NQ ID returned from the `nq_alloc` HWRM command.
22223          */
22224         uint16_t        cmpl_ring;
22225         /*
22226          * The sequence ID is used by the driver for tracking multiple
22227          * commands. This ID is treated as opaque data by the firmware and
22228          * the value is returned in the `hwrm_resp_hdr` upon completion.
22229          */
22230         uint16_t        seq_id;
22231         /*
22232          * The target ID of the command:
22233          * * 0x0-0xFFF8 - The function ID
22234          * * 0xFFF8-0xFFFE - Reserved for internal processors
22235          * * 0xFFFF - HWRM
22236          */
22237         uint16_t        target_id;
22238         /*
22239          * A physical address pointer pointing to a host buffer that the
22240          * command's response data will be written. This can be either a host
22241          * physical address (HPA) or a guest physical address (GPA) and must
22242          * point to a physically contiguous block of memory.
22243          */
22244         uint64_t        resp_addr;
22245         /*
22246          * 64-bit Host Destination Address.
22247          * This is the host address where the directory will be written.
22248          */
22249         uint64_t        host_dest_addr;
22250 } __attribute__((packed));
22251
22252 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
22253 struct hwrm_nvm_get_dir_entries_output {
22254         /* The specific error status for the command. */
22255         uint16_t        error_code;
22256         /* The HWRM command request type. */
22257         uint16_t        req_type;
22258         /* The sequence ID from the original command. */
22259         uint16_t        seq_id;
22260         /* The length of the response data in number of bytes. */
22261         uint16_t        resp_len;
22262         uint8_t unused_0[7];
22263         /*
22264          * This field is used in Output records to indicate that the output
22265          * is completely written to RAM.  This field should be read as '1'
22266          * to indicate that the output has been completely written.
22267          * When writing a command completion or response to an internal processor,
22268          * the order of writes has to be such that this field is written last.
22269          */
22270         uint8_t valid;
22271 } __attribute__((packed));
22272
22273 /*************************
22274  * hwrm_nvm_get_dir_info *
22275  *************************/
22276
22277
22278 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
22279 struct hwrm_nvm_get_dir_info_input {
22280         /* The HWRM command request type. */
22281         uint16_t        req_type;
22282         /*
22283          * The completion ring to send the completion event on. This should
22284          * be the NQ ID returned from the `nq_alloc` HWRM command.
22285          */
22286         uint16_t        cmpl_ring;
22287         /*
22288          * The sequence ID is used by the driver for tracking multiple
22289          * commands. This ID is treated as opaque data by the firmware and
22290          * the value is returned in the `hwrm_resp_hdr` upon completion.
22291          */
22292         uint16_t        seq_id;
22293         /*
22294          * The target ID of the command:
22295          * * 0x0-0xFFF8 - The function ID
22296          * * 0xFFF8-0xFFFE - Reserved for internal processors
22297          * * 0xFFFF - HWRM
22298          */
22299         uint16_t        target_id;
22300         /*
22301          * A physical address pointer pointing to a host buffer that the
22302          * command's response data will be written. This can be either a host
22303          * physical address (HPA) or a guest physical address (GPA) and must
22304          * point to a physically contiguous block of memory.
22305          */
22306         uint64_t        resp_addr;
22307 } __attribute__((packed));
22308
22309 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
22310 struct hwrm_nvm_get_dir_info_output {
22311         /* The specific error status for the command. */
22312         uint16_t        error_code;
22313         /* The HWRM command request type. */
22314         uint16_t        req_type;
22315         /* The sequence ID from the original command. */
22316         uint16_t        seq_id;
22317         /* The length of the response data in number of bytes. */
22318         uint16_t        resp_len;
22319         /* Number of directory entries in the directory. */
22320         uint32_t        entries;
22321         /* Size of each directory entry, in bytes. */
22322         uint32_t        entry_length;
22323         uint8_t unused_0[7];
22324         /*
22325          * This field is used in Output records to indicate that the output
22326          * is completely written to RAM.  This field should be read as '1'
22327          * to indicate that the output has been completely written.
22328          * When writing a command completion or response to an internal processor,
22329          * the order of writes has to be such that this field is written last.
22330          */
22331         uint8_t valid;
22332 } __attribute__((packed));
22333
22334 /******************
22335  * hwrm_nvm_write *
22336  ******************/
22337
22338
22339 /* hwrm_nvm_write_input (size:384b/48B) */
22340 struct hwrm_nvm_write_input {
22341         /* The HWRM command request type. */
22342         uint16_t        req_type;
22343         /*
22344          * The completion ring to send the completion event on. This should
22345          * be the NQ ID returned from the `nq_alloc` HWRM command.
22346          */
22347         uint16_t        cmpl_ring;
22348         /*
22349          * The sequence ID is used by the driver for tracking multiple
22350          * commands. This ID is treated as opaque data by the firmware and
22351          * the value is returned in the `hwrm_resp_hdr` upon completion.
22352          */
22353         uint16_t        seq_id;
22354         /*
22355          * The target ID of the command:
22356          * * 0x0-0xFFF8 - The function ID
22357          * * 0xFFF8-0xFFFE - Reserved for internal processors
22358          * * 0xFFFF - HWRM
22359          */
22360         uint16_t        target_id;
22361         /*
22362          * A physical address pointer pointing to a host buffer that the
22363          * command's response data will be written. This can be either a host
22364          * physical address (HPA) or a guest physical address (GPA) and must
22365          * point to a physically contiguous block of memory.
22366          */
22367         uint64_t        resp_addr;
22368         /*
22369          * 64-bit Host Source Address.
22370          * This is where the source data is.
22371          */
22372         uint64_t        host_src_addr;
22373         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
22374         uint16_t        dir_type;
22375         /*
22376          * Directory ordinal.
22377          * The 0-based instance of the combined Directory Entry Type and Extension.
22378          */
22379         uint16_t        dir_ordinal;
22380         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
22381         uint16_t        dir_ext;
22382         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
22383         uint16_t        dir_attr;
22384         /*
22385          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
22386          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
22387          */
22388         uint32_t        dir_data_length;
22389         /* Option. */
22390         uint16_t        option;
22391         uint16_t        flags;
22392         /*
22393          * When this bit is '1', the original active image
22394          * will not be removed. TBD: what purpose is this?
22395          */
22396         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
22397                 UINT32_C(0x1)
22398         /*
22399          * 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).
22400          * If this value is less than the specified data length, it will be ignored.
22401          * The response will contain the actual allocated item length, which may be greater than the requested item length.
22402          * 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
22403          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
22404          */
22405         uint32_t        dir_item_length;
22406         uint32_t        unused_0;
22407 } __attribute__((packed));
22408
22409 /* hwrm_nvm_write_output (size:128b/16B) */
22410 struct hwrm_nvm_write_output {
22411         /* The specific error status for the command. */
22412         uint16_t        error_code;
22413         /* The HWRM command request type. */
22414         uint16_t        req_type;
22415         /* The sequence ID from the original command. */
22416         uint16_t        seq_id;
22417         /* The length of the response data in number of bytes. */
22418         uint16_t        resp_len;
22419         /*
22420          * 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.
22421          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
22422          */
22423         uint32_t        dir_item_length;
22424         /* The directory index of the created or modified item. */
22425         uint16_t        dir_idx;
22426         uint8_t unused_0;
22427         /*
22428          * This field is used in Output records to indicate that the output
22429          * is completely written to RAM.  This field should be read as '1'
22430          * to indicate that the output has been completely written.
22431          * When writing a command completion or response to an internal processor,
22432          * the order of writes has to be such that this field is written last.
22433          */
22434         uint8_t valid;
22435 } __attribute__((packed));
22436
22437 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
22438 struct hwrm_nvm_write_cmd_err {
22439         /*
22440          * command specific error codes that goes to
22441          * the cmd_err field in Common HWRM Error Response.
22442          */
22443         uint8_t code;
22444         /* Unknown error */
22445         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
22446         /* Unable to complete operation due to fragmentation */
22447         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
22448         /* nvm is completely full. */
22449         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
22450         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
22451                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
22452         uint8_t unused_0[7];
22453 } __attribute__((packed));
22454
22455 /*******************
22456  * hwrm_nvm_modify *
22457  *******************/
22458
22459
22460 /* hwrm_nvm_modify_input (size:320b/40B) */
22461 struct hwrm_nvm_modify_input {
22462         /* The HWRM command request type. */
22463         uint16_t        req_type;
22464         /*
22465          * The completion ring to send the completion event on. This should
22466          * be the NQ ID returned from the `nq_alloc` HWRM command.
22467          */
22468         uint16_t        cmpl_ring;
22469         /*
22470          * The sequence ID is used by the driver for tracking multiple
22471          * commands. This ID is treated as opaque data by the firmware and
22472          * the value is returned in the `hwrm_resp_hdr` upon completion.
22473          */
22474         uint16_t        seq_id;
22475         /*
22476          * The target ID of the command:
22477          * * 0x0-0xFFF8 - The function ID
22478          * * 0xFFF8-0xFFFE - Reserved for internal processors
22479          * * 0xFFFF - HWRM
22480          */
22481         uint16_t        target_id;
22482         /*
22483          * A physical address pointer pointing to a host buffer that the
22484          * command's response data will be written. This can be either a host
22485          * physical address (HPA) or a guest physical address (GPA) and must
22486          * point to a physically contiguous block of memory.
22487          */
22488         uint64_t        resp_addr;
22489         /*
22490          * 64-bit Host Source Address.
22491          * This is where the modified data is.
22492          */
22493         uint64_t        host_src_addr;
22494         /* 16-bit directory entry index. */
22495         uint16_t        dir_idx;
22496         uint8_t unused_0[2];
22497         /* 32-bit NVRAM byte-offset to modify content from. */
22498         uint32_t        offset;
22499         /*
22500          * Length of data to be modified, in bytes. The length shall
22501          * be non-zero.
22502          */
22503         uint32_t        len;
22504         uint8_t unused_1[4];
22505 } __attribute__((packed));
22506
22507 /* hwrm_nvm_modify_output (size:128b/16B) */
22508 struct hwrm_nvm_modify_output {
22509         /* The specific error status for the command. */
22510         uint16_t        error_code;
22511         /* The HWRM command request type. */
22512         uint16_t        req_type;
22513         /* The sequence ID from the original command. */
22514         uint16_t        seq_id;
22515         /* The length of the response data in number of bytes. */
22516         uint16_t        resp_len;
22517         uint8_t unused_0[7];
22518         /*
22519          * This field is used in Output records to indicate that the output
22520          * is completely written to RAM.  This field should be read as '1'
22521          * to indicate that the output has been completely written.
22522          * When writing a command completion or response to an internal processor,
22523          * the order of writes has to be such that this field is written last.
22524          */
22525         uint8_t valid;
22526 } __attribute__((packed));
22527
22528 /***************************
22529  * hwrm_nvm_find_dir_entry *
22530  ***************************/
22531
22532
22533 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
22534 struct hwrm_nvm_find_dir_entry_input {
22535         /* The HWRM command request type. */
22536         uint16_t        req_type;
22537         /*
22538          * The completion ring to send the completion event on. This should
22539          * be the NQ ID returned from the `nq_alloc` HWRM command.
22540          */
22541         uint16_t        cmpl_ring;
22542         /*
22543          * The sequence ID is used by the driver for tracking multiple
22544          * commands. This ID is treated as opaque data by the firmware and
22545          * the value is returned in the `hwrm_resp_hdr` upon completion.
22546          */
22547         uint16_t        seq_id;
22548         /*
22549          * The target ID of the command:
22550          * * 0x0-0xFFF8 - The function ID
22551          * * 0xFFF8-0xFFFE - Reserved for internal processors
22552          * * 0xFFFF - HWRM
22553          */
22554         uint16_t        target_id;
22555         /*
22556          * A physical address pointer pointing to a host buffer that the
22557          * command's response data will be written. This can be either a host
22558          * physical address (HPA) or a guest physical address (GPA) and must
22559          * point to a physically contiguous block of memory.
22560          */
22561         uint64_t        resp_addr;
22562         uint32_t        enables;
22563         /*
22564          * This bit must be '1' for the dir_idx_valid field to be
22565          * configured.
22566          */
22567         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
22568                 UINT32_C(0x1)
22569         /* Directory Entry Index */
22570         uint16_t        dir_idx;
22571         /* Directory Entry (Image) Type */
22572         uint16_t        dir_type;
22573         /*
22574          * Directory ordinal.
22575          * The instance of this Directory Type
22576          */
22577         uint16_t        dir_ordinal;
22578         /* The Directory Entry Extension flags. */
22579         uint16_t        dir_ext;
22580         /* This value indicates the search option using dir_ordinal. */
22581         uint8_t opt_ordinal;
22582         /* This value indicates the search option using dir_ordinal. */
22583         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
22584         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
22585         /* Equal to specified ordinal value. */
22586         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
22587         /* Greater than or equal to specified ordinal value */
22588         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
22589         /* Greater than specified ordinal value */
22590         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
22591         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
22592                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
22593         uint8_t unused_0[3];
22594 } __attribute__((packed));
22595
22596 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
22597 struct hwrm_nvm_find_dir_entry_output {
22598         /* The specific error status for the command. */
22599         uint16_t        error_code;
22600         /* The HWRM command request type. */
22601         uint16_t        req_type;
22602         /* The sequence ID from the original command. */
22603         uint16_t        seq_id;
22604         /* The length of the response data in number of bytes. */
22605         uint16_t        resp_len;
22606         /* Allocated NVRAM for this directory entry, in bytes. */
22607         uint32_t        dir_item_length;
22608         /* Size of the stored data for this directory entry, in bytes. */
22609         uint32_t        dir_data_length;
22610         /*
22611          * Firmware version.
22612          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
22613          */
22614         uint32_t        fw_ver;
22615         /* Directory ordinal. */
22616         uint16_t        dir_ordinal;
22617         /* Directory Entry Index */
22618         uint16_t        dir_idx;
22619         uint8_t unused_0[7];
22620         /*
22621          * This field is used in Output records to indicate that the output
22622          * is completely written to RAM.  This field should be read as '1'
22623          * to indicate that the output has been completely written.
22624          * When writing a command completion or response to an internal processor,
22625          * the order of writes has to be such that this field is written last.
22626          */
22627         uint8_t valid;
22628 } __attribute__((packed));
22629
22630 /****************************
22631  * hwrm_nvm_erase_dir_entry *
22632  ****************************/
22633
22634
22635 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
22636 struct hwrm_nvm_erase_dir_entry_input {
22637         /* The HWRM command request type. */
22638         uint16_t        req_type;
22639         /*
22640          * The completion ring to send the completion event on. This should
22641          * be the NQ ID returned from the `nq_alloc` HWRM command.
22642          */
22643         uint16_t        cmpl_ring;
22644         /*
22645          * The sequence ID is used by the driver for tracking multiple
22646          * commands. This ID is treated as opaque data by the firmware and
22647          * the value is returned in the `hwrm_resp_hdr` upon completion.
22648          */
22649         uint16_t        seq_id;
22650         /*
22651          * The target ID of the command:
22652          * * 0x0-0xFFF8 - The function ID
22653          * * 0xFFF8-0xFFFE - Reserved for internal processors
22654          * * 0xFFFF - HWRM
22655          */
22656         uint16_t        target_id;
22657         /*
22658          * A physical address pointer pointing to a host buffer that the
22659          * command's response data will be written. This can be either a host
22660          * physical address (HPA) or a guest physical address (GPA) and must
22661          * point to a physically contiguous block of memory.
22662          */
22663         uint64_t        resp_addr;
22664         /* Directory Entry Index */
22665         uint16_t        dir_idx;
22666         uint8_t unused_0[6];
22667 } __attribute__((packed));
22668
22669 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
22670 struct hwrm_nvm_erase_dir_entry_output {
22671         /* The specific error status for the command. */
22672         uint16_t        error_code;
22673         /* The HWRM command request type. */
22674         uint16_t        req_type;
22675         /* The sequence ID from the original command. */
22676         uint16_t        seq_id;
22677         /* The length of the response data in number of bytes. */
22678         uint16_t        resp_len;
22679         uint8_t unused_0[7];
22680         /*
22681          * This field is used in Output records to indicate that the output
22682          * is completely written to RAM.  This field should be read as '1'
22683          * to indicate that the output has been completely written.
22684          * When writing a command completion or response to an internal processor,
22685          * the order of writes has to be such that this field is written last.
22686          */
22687         uint8_t valid;
22688 } __attribute__((packed));
22689
22690
22691 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */